guarriconos
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 144 B |
Binary file not shown.
|
After Width: | Height: | Size: 145 B |
@@ -2,8 +2,17 @@ extends ESCTooltip
|
|||||||
|
|
||||||
var id: int
|
var id: int
|
||||||
|
|
||||||
|
|
||||||
|
export(Texture) var iconTexture: Texture = null \
|
||||||
|
setget ,_get_icon_texture
|
||||||
|
|
||||||
func _init(tooltip_id = 0):
|
func _init(tooltip_id = 0):
|
||||||
id = tooltip_id
|
id = tooltip_id
|
||||||
|
|
||||||
|
#$icon.texture = iconTexture
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
signal tooltip2_size_updated
|
signal tooltip2_size_updated
|
||||||
|
|
||||||
@@ -13,14 +22,16 @@ func update_tooltip_text():
|
|||||||
# first frame the text is wider than the default of 0 and ends up being really tall
|
# first frame the text is wider than the default of 0 and ends up being really tall
|
||||||
# and setting the wrong vertical margin for the tooltip
|
# and setting the wrong vertical margin for the tooltip
|
||||||
update_size()
|
update_size()
|
||||||
|
#var texturePath = get_constant()
|
||||||
|
var texturePath = null
|
||||||
# We signal this here since the processing in this class happens AFTER input
|
# We signal this here since the processing in this class happens AFTER input
|
||||||
# processing. We signal here to avoid "lagging" behind a frame since
|
# processing. We signal here to avoid "lagging" behind a frame since
|
||||||
# tooltips are presently dependent on the size of the bounding box around
|
# tooltips are presently dependent on the size of the bounding box around
|
||||||
# the rendered string.
|
# the rendered string.
|
||||||
emit_signal("tooltip2_size_updated")
|
emit_signal("tooltip2_size_updated")
|
||||||
|
|
||||||
bbcode_text = "[center]"
|
bbcode_text = "[center]"
|
||||||
|
#if(texturePath != null):
|
||||||
|
bbcode_text += "[img]" + "res://gymkhana/addons/escoria-ui-return-monkey-island/cursors/mouse_right.png" + "[/img]"
|
||||||
bbcode_text += "[color=#" + color.to_html(false) + "]"
|
bbcode_text += "[color=#" + color.to_html(false) + "]"
|
||||||
bbcode_text += current_target
|
bbcode_text += current_target
|
||||||
bbcode_text += "[/color]"
|
bbcode_text += "[/color]"
|
||||||
@@ -35,3 +46,12 @@ func update_tooltip_text():
|
|||||||
func _on_room_ready():
|
func _on_room_ready():
|
||||||
escoria.main.current_scene.game.tooltip2_node = self
|
escoria.main.current_scene.game.tooltip2_node = self
|
||||||
_room_is_ready = true
|
_room_is_ready = true
|
||||||
|
|
||||||
|
func _get_icon_texture() -> Texture:
|
||||||
|
if iconTexture == null:
|
||||||
|
for c in get_children():
|
||||||
|
if c is TextureRect or c is Sprite:
|
||||||
|
return c.texture
|
||||||
|
return null
|
||||||
|
else:
|
||||||
|
return iconTexture
|
||||||
|
|||||||
@@ -19,8 +19,10 @@ func update_tooltip_text():
|
|||||||
# tooltips are presently dependent on the size of the bounding box around
|
# tooltips are presently dependent on the size of the bounding box around
|
||||||
# the rendered string.
|
# the rendered string.
|
||||||
emit_signal("tooltip_size_updated")
|
emit_signal("tooltip_size_updated")
|
||||||
|
|
||||||
bbcode_text = "[center]"
|
bbcode_text = "[center]"
|
||||||
|
bbcode_text = "[center]"
|
||||||
|
bbcode_text += "[img]" + "res://gymkhana/addons/escoria-ui-return-monkey-island/cursors/mouse_left.png" + "[/img]"
|
||||||
bbcode_text += "[color=#" + color.to_html(false) + "]"
|
bbcode_text += "[color=#" + color.to_html(false) + "]"
|
||||||
bbcode_text += current_target
|
bbcode_text += current_target
|
||||||
bbcode_text += "[/color]"
|
bbcode_text += "[/color]"
|
||||||
|
|||||||
Reference in New Issue
Block a user