Fixed a bug where bottle in magical closet room 9 had wrong interaction position.
This commit is contained in:
@@ -31,6 +31,8 @@ Implement methods to react to inputs.
|
||||
- _on_event_done(event_name: String)
|
||||
"""
|
||||
|
||||
func _ready():
|
||||
ProjectSettings.set_setting("escoria/ui/tooltip_follows_mouse", false)
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed("switch_action_verb"):
|
||||
@@ -61,11 +63,16 @@ func left_double_click_on_bg(position : Vector2) -> void:
|
||||
## ITEM FOCUS ##
|
||||
|
||||
func element_focused(element_id : String) -> void:
|
||||
$ui/tooltip_layer/tooltip.set_target(escoria.esc_runner.get_object(element_id).tooltip_name)
|
||||
var target_obj = escoria.esc_runner.get_object(element_id)
|
||||
$ui/tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
|
||||
|
||||
if escoria.esc_runner.current_action != "use" && escoria.esc_runner.current_tool == null:
|
||||
if target_obj is ESCItem:
|
||||
$ui/verbs_layer/verbs_menu.set_by_name(target_obj.default_action)
|
||||
|
||||
func element_unfocused() -> void:
|
||||
$ui/tooltip_layer/tooltip.set_target("")
|
||||
|
||||
$ui/tooltip_layer/tooltip.clear()
|
||||
$ui/verbs_layer/verbs_menu.unselect_actions()
|
||||
|
||||
## ITEMS ##
|
||||
|
||||
@@ -73,6 +80,7 @@ func left_click_on_item(item_global_id : String, event : InputEvent) -> void:
|
||||
escoria.do("item_left_click", [item_global_id, event])
|
||||
|
||||
func right_click_on_item(item_global_id : String, event : InputEvent) -> void:
|
||||
escoria.esc_runner.set_current_action($ui/verbs_layer/verbs_menu.selected_action)
|
||||
escoria.do("item_right_click", [item_global_id, event])
|
||||
|
||||
func left_double_click_on_item(item_global_id : String, event : InputEvent) -> void:
|
||||
|
||||
@@ -63,7 +63,9 @@ margin_left = 0.0272522
|
||||
margin_top = 0.320557
|
||||
margin_right = -0.252686
|
||||
margin_bottom = -0.0794678
|
||||
rect_min_size = Vector2( 0, 32 )
|
||||
script = ExtResource( 8 )
|
||||
color = Color( 1, 1, 1, 1 )
|
||||
|
||||
[node name="dialog_layer" type="CanvasLayer" parent="ui"]
|
||||
layer = 3
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
extends ESCTooltip
|
||||
|
||||
func update_tooltip_text():
|
||||
push_align(RichTextLabel.ALIGN_CENTER)
|
||||
|
||||
bbcode_text = "[center]"
|
||||
bbcode_text += "[color=#" + color.to_html(false) + "]"
|
||||
if !current_action.empty():
|
||||
add_text(current_action + "\t")
|
||||
|
||||
add_text(current_target)
|
||||
|
||||
bbcode_text += current_action + "\t"
|
||||
bbcode_text += current_target
|
||||
|
||||
if waiting_for_target2 and current_target2.empty():
|
||||
add_text("\t" + current_prep)
|
||||
|
||||
bbcode_text += "\t" + current_prep
|
||||
|
||||
if !current_target2.empty():
|
||||
add_text("\t" + current_prep + "\t" + current_target2)
|
||||
|
||||
pop()
|
||||
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()
|
||||
|
||||
@@ -6,6 +6,8 @@ This script is out of Escoria's scope. It controls the UI reaction to an
|
||||
UI event (eg right click) to change the cursor accordingly.
|
||||
"""
|
||||
|
||||
var selected_action
|
||||
|
||||
func _ready():
|
||||
for but in $actions.get_children():
|
||||
but.connect("pressed", self, "_on_action_selected", [but.name])
|
||||
@@ -20,3 +22,10 @@ func _on_action_selected(action : String):
|
||||
func unselect_actions():
|
||||
for but in $actions.get_children():
|
||||
but.set_pressed(false)
|
||||
|
||||
func set_by_name(action_name : String):
|
||||
selected_action = action_name
|
||||
for but in $actions.get_children():
|
||||
but.set_pressed(but.get_name() == action_name)
|
||||
|
||||
|
||||
|
||||
@@ -29,9 +29,12 @@ Implement methods to react to inputs.
|
||||
- show_ui()
|
||||
|
||||
- _on_event_done(event_name: String)
|
||||
|
||||
"""
|
||||
|
||||
func _ready():
|
||||
ProjectSettings.set_setting("escoria/ui/tooltip_follows_mouse", true)
|
||||
|
||||
|
||||
## BACKGROUND ##
|
||||
|
||||
func left_click_on_bg(position : Vector2) -> void:
|
||||
@@ -54,7 +57,6 @@ func left_double_click_on_bg(position : Vector2) -> void:
|
||||
func element_focused(element_id : String) -> void:
|
||||
var target_obj = escoria.esc_runner.get_object(element_id)
|
||||
$ui/tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
|
||||
$ui/tooltip_layer/tooltip.show()
|
||||
|
||||
if escoria.esc_runner.current_action != "use" && escoria.esc_runner.current_tool == null:
|
||||
if target_obj is ESCItem:
|
||||
@@ -62,7 +64,6 @@ func element_focused(element_id : String) -> void:
|
||||
|
||||
func element_unfocused() -> void:
|
||||
$ui/tooltip_layer/tooltip.set_target("")
|
||||
$ui/tooltip_layer/tooltip.hide()
|
||||
|
||||
|
||||
## ITEMS ##
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
extends ESCTooltip
|
||||
|
||||
func update_tooltip_text():
|
||||
print("new color " + str(color))
|
||||
bbcode_text = "[center]"
|
||||
bbcode_text += "[color=#" + color.to_html(false) + "]"
|
||||
bbcode_text += current_target
|
||||
|
||||
Reference in New Issue
Block a user