From 61b53578d083bff8b4be378a7980ae1d07d07a47 Mon Sep 17 00:00:00 2001 From: oier Date: Tue, 14 Feb 2023 18:09:22 +0100 Subject: [PATCH] guarriconos --- .../cursors/mouse_left.png | Bin 0 -> 144 bytes .../cursors/mouse_right.png | Bin 0 -> 145 bytes .../tooltip/tooltip2_target.gd | 24 ++++++++++++++++-- .../tooltip/tooltip_target.gd | 4 ++- 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 gymkhana/addons/escoria-ui-return-monkey-island/cursors/mouse_left.png create mode 100644 gymkhana/addons/escoria-ui-return-monkey-island/cursors/mouse_right.png diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/cursors/mouse_left.png b/gymkhana/addons/escoria-ui-return-monkey-island/cursors/mouse_left.png new file mode 100644 index 0000000000000000000000000000000000000000..9085ae4e09e55e1cb18324d11f76f9e0c673108b GIT binary patch literal 144 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;OS+@4BLl<6e(pbstUx|nfKP}k zkpBPw|I(ZD?*dtjB|(0{3=Yq3qyae^o-U3d9M_X4{6CoRzy096_JjM{51wQ1$&%oy mmf)!fn9$419H9D}nc+t(=d@`n7=T7IFnGH9xvXTA?Hmy!H nc#~-Gz|qmnjK^W>8-50(tK5oZJ0}_dH8FU)`njxgN@xNAH83j6 literal 0 HcmV?d00001 diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/tooltip/tooltip2_target.gd b/gymkhana/addons/escoria-ui-return-monkey-island/tooltip/tooltip2_target.gd index 3662ecc9..26fc7d68 100644 --- a/gymkhana/addons/escoria-ui-return-monkey-island/tooltip/tooltip2_target.gd +++ b/gymkhana/addons/escoria-ui-return-monkey-island/tooltip/tooltip2_target.gd @@ -2,8 +2,17 @@ extends ESCTooltip var id: int + +export(Texture) var iconTexture: Texture = null \ + setget ,_get_icon_texture + func _init(tooltip_id = 0): id = tooltip_id + + #$icon.texture = iconTexture + + + 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 # and setting the wrong vertical margin for the tooltip update_size() - + #var texturePath = get_constant() + var texturePath = null # We signal this here since the processing in this class happens AFTER input # processing. We signal here to avoid "lagging" behind a frame since # tooltips are presently dependent on the size of the bounding box around # the rendered string. emit_signal("tooltip2_size_updated") - 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 += current_target bbcode_text += "[/color]" @@ -35,3 +46,12 @@ func update_tooltip_text(): func _on_room_ready(): escoria.main.current_scene.game.tooltip2_node = self _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 diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/tooltip/tooltip_target.gd b/gymkhana/addons/escoria-ui-return-monkey-island/tooltip/tooltip_target.gd index ea1fac99..c38c62e5 100644 --- a/gymkhana/addons/escoria-ui-return-monkey-island/tooltip/tooltip_target.gd +++ b/gymkhana/addons/escoria-ui-return-monkey-island/tooltip/tooltip_target.gd @@ -19,8 +19,10 @@ func update_tooltip_text(): # tooltips are presently dependent on the size of the bounding box around # the rendered string. emit_signal("tooltip_size_updated") - + 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 += current_target bbcode_text += "[/color]"