Optimized item and background signal handling (#365)
Co-authored-by: Dennis Ploeger <develop@dieploegers.de> Co-authored-by: dploeger <dploeger@users.noreply.github.com>
This commit is contained in:
@@ -26,6 +26,66 @@ var hover_stack: Array = []
|
||||
var hotspot_focused: String = ""
|
||||
|
||||
|
||||
# Connect the item signals to the local methods
|
||||
func register_inventory_item(item: Node):
|
||||
item.connect(
|
||||
"mouse_left_inventory_item",
|
||||
self,
|
||||
"_on_mouse_left_click_inventory_item"
|
||||
)
|
||||
item.connect(
|
||||
"mouse_double_left_inventory_item",
|
||||
self,
|
||||
"_on_mouse_double_left_click_inventory_item"
|
||||
)
|
||||
item.connect(
|
||||
"mouse_right_inventory_item",
|
||||
self,
|
||||
"_on_mouse_right_click_inventory_item"
|
||||
)
|
||||
|
||||
item.connect(
|
||||
"inventory_item_focused",
|
||||
self,
|
||||
"_on_mouse_entered_inventory_item"
|
||||
)
|
||||
item.connect(
|
||||
"inventory_item_unfocused",
|
||||
self,
|
||||
"_on_mouse_exited_inventory_item"
|
||||
)
|
||||
|
||||
|
||||
func register_background(background: ESCBackground):
|
||||
background.connect(
|
||||
"left_click_on_bg",
|
||||
self,
|
||||
"_on_left_click_on_bg"
|
||||
)
|
||||
background.connect(
|
||||
"right_click_on_bg",
|
||||
escoria.inputs_manager,
|
||||
"_on_right_click_on_bg"
|
||||
)
|
||||
background.connect(
|
||||
"double_left_click_on_bg",
|
||||
escoria.inputs_manager,
|
||||
"_on_double_left_click_on_bg"
|
||||
)
|
||||
background.connect(
|
||||
"mouse_wheel_up",
|
||||
self,
|
||||
"_on_mousewheel_action",
|
||||
[-1]
|
||||
)
|
||||
background.connect(
|
||||
"mouse_wheel_down",
|
||||
self,
|
||||
"_on_mousewheel_action",
|
||||
[-1]
|
||||
)
|
||||
|
||||
|
||||
# Input event handler
|
||||
#
|
||||
# #### Parameters
|
||||
|
||||
Reference in New Issue
Block a user