Cloned escoria-ui-9-verbs to escoria-ui-2verbs

This commit is contained in:
2023-02-08 14:40:56 +01:00
parent eb3399736d
commit ba46a80728
14 changed files with 819 additions and 4 deletions

View File

@@ -0,0 +1,14 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://gymkhana/addons/escoria-ui-2verbs/tooltip/tooltip_action_target.gd" type="Script" id=1]
[node name="tooltip" type="RichTextLabel"]
anchor_right = 1.0
anchor_bottom = 1.0
bbcode_enabled = true
bbcode_text = "[center][/center]"
scroll_active = false
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

View File

@@ -0,0 +1,34 @@
extends ESCTooltip
export var prepositions = {"use": "with", "give": "to"}
func update_tooltip_text():
bbcode_text = "[center]"
bbcode_text += "[color=#" + color.to_html(false) + "]"
if !current_action.empty():
bbcode_text += current_action + "\t"
bbcode_text += current_target
if waiting_for_target2 and current_target2.empty():
current_prep = prepositions.get(current_action, current_prep)
bbcode_text += "\t" + current_prep
if !current_target2.empty():
bbcode_text += "\t" + current_prep + "\t" + current_target2
bbcode_text += "[/color]"
bbcode_text += "[/center]"
# push_align(RichTextLabel.ALIGN_CENTER)
# if !current_action.empty():
# add_text(current_action + "\t")
#
# add_text(current_target)
#
# if waiting_for_target2 and current_target2.empty():
# add_text("\t" + current_prep)
#
# if !current_target2.empty():
# add_text("\t" + current_prep + "\t" + current_target2)
#
# pop()