feat: integrate inventory with cursor system, scene input, and GameScript
- ActionState: add ITEM action (value 4) to enum and get_action_name() - MainGame: right-click cycles through all 5 actions including ITEM; skips ITEM if nothing selected; clears selection when cycling away - Scene: guard _unhandled_input() against active inventory overlay; handle ITEM action for world-wide item use; add give_item(), remove_item(), strip_items() helper methods - SetPiece: handle ITEM action by calling scene's _use_item_on_setpiece() - GameScript: add GiveItem and GiveItemDeferred script step classes for item acquisition during cutscenes
This commit is contained in:
@@ -75,3 +75,9 @@ func _input(event):
|
||||
ActionState.Action.TALK:
|
||||
if talked.get_connections().size() > 0:
|
||||
emit_signal("talked")
|
||||
ActionState.Action.ITEM:
|
||||
if InventoryManager.selected_item:
|
||||
var item_id = InventoryManager.selected_item
|
||||
var scene = get_node_or_null("/root/Node2D/SceneViewport/background")
|
||||
if scene and scene is Scene:
|
||||
scene._use_item_on_setpiece(item_id, self)
|
||||
|
||||
Reference in New Issue
Block a user