CHANGE TO escoria-core. action1 and action2 in tooltip
This commit is contained in:
@@ -101,6 +101,12 @@ export(int) var interaction_direction
|
||||
# The name for the tooltip of this item
|
||||
export(String) var tooltip_name
|
||||
|
||||
# The text for the tooltip of action1
|
||||
export(String) var action1
|
||||
|
||||
# The text for the tooltip of action2
|
||||
export(String) var action2
|
||||
|
||||
# Default action to use if object is not in the inventory
|
||||
export(String) var default_action
|
||||
|
||||
|
||||
@@ -221,7 +221,8 @@ func element_focused(element_id: String) -> void:
|
||||
)
|
||||
|
||||
var target_obj = escoria.object_manager.get_object(element_id).node
|
||||
$tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
|
||||
$tooltip_layer/tooltip.set_target(target_obj.action1 + " " + target_obj.action2)
|
||||
# $tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
|
||||
|
||||
if escoria.action_manager.current_action != VERB_USE \
|
||||
and escoria.action_manager.current_tool == null \
|
||||
@@ -236,7 +237,9 @@ func element_unfocused() -> void:
|
||||
|
||||
|
||||
## ITEMS ##
|
||||
func click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||
func click_on_item(item_global_id: String, event: InputEvent, action: String) -> void:
|
||||
escoria.action_manager.set_current_action(action)
|
||||
|
||||
var target_obj = escoria.object_manager.get_object(item_global_id).node
|
||||
|
||||
# current_action will be empty if an event completes between when you stop
|
||||
@@ -254,12 +257,10 @@ func click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||
)
|
||||
|
||||
func left_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||
escoria.action_manager.set_current_action("action1")
|
||||
click_on_item(item_global_id, event)
|
||||
click_on_item(item_global_id, event, "action1")
|
||||
|
||||
func right_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||
escoria.action_manager.set_current_action("action2")
|
||||
click_on_item(item_global_id, event)
|
||||
click_on_item(item_global_id, event, "action2")
|
||||
|
||||
func left_double_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||
escoria.action_manager.do(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
:action1
|
||||
say player "Action 1"
|
||||
say player "Action 1 asks me to say this"
|
||||
|
||||
:action2
|
||||
say player "Action 2"
|
||||
say player "Action 2 asks me to say this"
|
||||
|
||||
@@ -107,6 +107,8 @@ script = ExtResource( 5 )
|
||||
global_id = "r1_wall_item1"
|
||||
esc_script = "res://gymkhana/rooms/home/esc/wall_item.esc"
|
||||
tooltip_name = "Artwork"
|
||||
action1 = "This is action1"
|
||||
action2 = "This is action2"
|
||||
default_action = "action2"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
inventory_texture = ExtResource( 10 )
|
||||
|
||||
Reference in New Issue
Block a user