Skip to content

Commit

Permalink
feat: Wizard - set up combine when selected for inventory items
Browse files Browse the repository at this point in the history
  • Loading branch information
Balloonpopper committed Jan 10, 2023
1 parent cc0a067 commit dc4b6c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 0 additions & 2 deletions addons/escoria-wizard/CharacterCreator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,6 @@ func export_player(scene_name) -> void:
# you interact with them
if get_node(CHAR_TYPE_NODE).get_node("npc").pressed:
new_character = ESCItem.new()
print("ITEM")
else:
new_character = ESCPlayer.new()
new_character.selectable = true
Expand Down Expand Up @@ -1478,7 +1477,6 @@ func export_generate_animations(character_node, num_directions) -> void:
# Generate default animation. This is used by the object manager to set the
# state when the object is registered. If there's no current state, the
# default animation will be used.
print("Process "+str(default_anim_length)+" frames - default")
for loop in range(default_anim_length):
texture = ImageTexture.new()
texture = sprite_frames.get_frame("idle_down", loop)
Expand Down
8 changes: 7 additions & 1 deletion addons/escoria-wizard/item_creator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,16 @@ func _on_CreateButton_pressed() -> void:
item.global_id = get_node(GLOBAL_ID_NODE).text
item.is_interactive = get_node(INTERACTIVE_NODE).pressed
item.tooltip_name = get_node(ITEM_NAME_NODE).text

var selected_index = get_node(ACTION_NODE).selected
item.default_action = get_node(ACTION_NODE).get_item_text(selected_index)

# Make the item by default it's usable straight out of the inventory
if inventory_mode == true:
var new_pool_array: PoolStringArray = item.combine_when_selected_action_is_in
new_pool_array.append("use")
item.combine_when_selected_action_is_in = new_pool_array

# Add Dialog Position to the background item
var interact_position = ESCLocation.new()
interact_position.name = "interact_position"
Expand Down

0 comments on commit dc4b6c2

Please sign in to comment.