diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.gd b/gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.gd index 4fdc5b9a..e1b44054 100644 --- a/gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.gd +++ b/gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.gd @@ -21,9 +21,9 @@ const ONE_LINE_HEIGHT = 16 export(Color) var color setget set_color # Vector2 defining the offset from the cursor -export(Vector2) var offset_from_cursor_action1 = Vector2(5,5) +export(Vector2) var offset_from_cursor_action1 = Vector2(0,3) -export(Vector2) var offset_from_cursor_action2 = Vector2(5,-5) +export(Vector2) var offset_from_cursor_action2 = Vector2(0,-2) # Activates debug mode. If enabled, shows the label with a white background. export(bool) var debug_mode = false setget set_debug_mode @@ -180,14 +180,16 @@ func get_tooltip1_size(): if not get_tree(): # We're not in the tree anymore. Return return + return Vector2(150,20); # escoria.logger.info(self, "get_string_size: " + String($tooltip1/label.get_font("normal_font").get_string_size(current_target))) - return $tooltip1/label.get_font("normal_font").get_string_size(current_target) + #return $tooltip1/label.get_font("normal_font").get_string_size(current_target) func get_tooltip2_size(): if not get_tree(): # We're not in the tree anymore. Return - return - return $tooltip2/label.get_font("normal_font").get_string_size(current_target) + return + return Vector2(150,20); + #return $tooltip2/label.get_font("normal_font").get_string_size(current_target) # Calculate the offset of the label depending on its position. # @@ -197,11 +199,11 @@ func get_tooltip2_size(): # **Return** # The calculated offset func _offset(position: Vector2) -> Vector2: - var center_offset_x = current_size.x / 2 - var offset_y = 5 + #var center_offset_x = current_size.x / 2 + #var offset_y = 5 - position.x -= center_offset_x - position.y += offset_y + #position.x -= center_offset_x + #position.y += offset_y return position diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.tscn b/gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.tscn index 2dc7c0ca..e9b71e55 100644 --- a/gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.tscn +++ b/gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.tscn @@ -6,7 +6,6 @@ [ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/theme.tres" type="Theme" id=4] [node name="tooltipManager" type="Node2D"] -position = Vector2( -1, -10 ) script = ExtResource( 1 ) [node name="tooltip1" type="Node2D" parent="."] diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/game.gd b/gymkhana/addons/escoria-ui-return-monkey-island/game.gd index 45309c42..b2dc916b 100644 --- a/gymkhana/addons/escoria-ui-return-monkey-island/game.gd +++ b/gymkhana/addons/escoria-ui-return-monkey-island/game.gd @@ -122,9 +122,11 @@ func _exit_tree(): func _input(event: InputEvent) -> void: if escoria.get_escoria().is_ready_for_inputs(): if event is InputEventMouseMotion: - _current_mouse_pos = get_global_mouse_position() + #_current_mouse_pos = get_global_mouse_position() + _current_mouse_pos = get_viewport().get_mouse_position() update_tooltip_following_mouse_position(tooltip_node) update_tooltip_following_mouse_position(tooltip2_node) + # https://github.com/godotengine/godot-demo-projects/blob/3.4-585455e/misc/joypads/joypads.gd @@ -385,6 +387,7 @@ func set_tooltip_position(nodeId: String, tooltip: ESCRichTooltip, size: Vector2 var mouse_position = calculateMousePosition(size) var corrected_position = correctPosition(tooltip, size, mouse_position, offset) tooltip.get_node(nodeId).position = corrected_position + #tooltip.get_node(nodeId).position = mouse_position func calculateMousePosition(size: Vector2): @@ -392,7 +395,8 @@ func calculateMousePosition(size: Vector2): size.y / 2 #escoria.logger.info(self, "_current_mouse_pos" + String(_current_mouse_pos.x) + " gameSize: " + escoria.game_size.x) - return _current_mouse_pos - size + #return _current_mouse_pos - size + return _current_mouse_pos func correctPosition(tooltip: ESCRichTooltip, size: Vector2, mouse_position: Vector2, offset: Vector2): diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/game.tscn b/gymkhana/addons/escoria-ui-return-monkey-island/game.tscn index d6478ac1..8c5430a6 100644 --- a/gymkhana/addons/escoria-ui-return-monkey-island/game.tscn +++ b/gymkhana/addons/escoria-ui-return-monkey-island/game.tscn @@ -82,18 +82,18 @@ layer = 2 mouse_filter = 2 bbcode_text = "[center][color=#000000][/color][/center]" fit_content_height = true -offset_from_cursor = Vector2( -5, -50 ) +offset_from_cursor = Vector2( 0, 20 ) [node name="tooltip2" parent="tooltip_layer" instance=ExtResource( 10 )] mouse_filter = 2 bbcode_text = "[center][color=#000000][/color][/center]" fit_content_height = true -offset_from_cursor = Vector2( -5, 50 ) +offset_from_cursor = Vector2( 0, -10 ) [node name="tooltip" parent="tooltip_layer" instance=ExtResource( 4 )] z_index = 10 color = Color( 1, 1, 1, 1 ) -offset_from_cursor_action1 = Vector2( 0, 50 ) -offset_from_cursor_action2 = Vector2( 0, -50 ) +offset_from_cursor_action1 = Vector2( 0, 30 ) +offset_from_cursor_action2 = Vector2( 0, -20 ) [connection signal="pressed" from="CanvasLayer/ui/HBoxContainer/VBoxContainer/MenuButton" to="." method="_on_MenuButton_pressed"] diff --git a/gymkhana/rooms/turno_cocina/despensa/assets/Background.xcf b/gymkhana/rooms/turno_cocina/despensa/assets/Background.xcf new file mode 100644 index 00000000..e6ed9c9d Binary files /dev/null and b/gymkhana/rooms/turno_cocina/despensa/assets/Background.xcf differ diff --git a/project.godot b/project.godot index 20218d38..d71dc266 100644 --- a/project.godot +++ b/project.godot @@ -204,7 +204,7 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://addons/escoria-core/game/scenes/dialogs/esc_dialog_options_chooser.gd" }, { -"base": "StateMachine", +"base": "Node", "class": "ESCDialogPlayer", "language": "GDScript", "path": "res://addons/escoria-core/game/scenes/dialogs/esc_dialog_player.gd" @@ -344,7 +344,7 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://addons/escoria-core/game/esc_project_settings_manager.gd" }, { -"base": "Reference", +"base": "Node", "class": "ESCResourceCache", "language": "GDScript", "path": "res://addons/escoria-core/game/core-scripts/esc_resource_cache.gd"