Skip to content

Commit

Permalink
Make inventory view work and also enlarge UI
Browse files Browse the repository at this point in the history
  • Loading branch information
outfrost committed Apr 26, 2021
1 parent fa89faf commit bf5d255
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 2 additions & 0 deletions environment/props/ResearchTable.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func interact():
character.set_process_input(false)
character.set_physics_process(false)
panel.show()
update_inventory_view()

func done_interacting():
panel.hide()
Expand All @@ -43,6 +44,7 @@ func update_inventory_view():
character = null
return
var inventory_buttons = $CanvasLayer/ResearchPanel/InventoryButtons.get_children()
print_debug(inventory_buttons)
var button_idx = 0
for item_type in character.inventory:
if button_idx >= inventory_buttons.size():
Expand Down
22 changes: 11 additions & 11 deletions level/Item.gd
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ enum ItemType {
}

const ICONS: Dictionary = {
NONE = preload("res://item/None.tres"),
ORB_RED = preload("res://item/OrbRed.tres"),
ORB_BLUE = preload("res://item/OrbBlue.tres"),
ORB_YELLOW = preload("res://item/OrbYellow.tres"),
ORB_GREEN = preload("res://item/OrbGreen.tres"),
LEAVES = preload("res://item/Leaves.tres"),
TWIG = preload("res://item/Twig.tres"),
BOTTLE_RED = preload("res://item/BottleRed.tres"),
BOTTLE_BLUE = preload("res://item/BottleBlue.tres"),
BOTTLE_YELLOW = preload("res://item/BottleYellow.tres"),
BOTTLE_GREEN = preload("res://item/BottleGreen.tres"),
ItemType.NONE: preload("res://item/None.tres"),
ItemType.ORB_RED: preload("res://item/OrbRed.tres"),
ItemType.ORB_BLUE: preload("res://item/OrbBlue.tres"),
ItemType.ORB_YELLOW: preload("res://item/OrbYellow.tres"),
ItemType.ORB_GREEN: preload("res://item/OrbGreen.tres"),
ItemType.LEAVES: preload("res://item/Leaves.tres"),
ItemType.TWIG: preload("res://item/Twig.tres"),
ItemType.BOTTLE_RED: preload("res://item/BottleRed.tres"),
ItemType.BOTTLE_BLUE: preload("res://item/BottleBlue.tres"),
ItemType.BOTTLE_YELLOW: preload("res://item/BottleYellow.tres"),
ItemType.BOTTLE_GREEN: preload("res://item/BottleGreen.tres"),
}

static func type_str(item_type):
Expand Down
1 change: 1 addition & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ gdscript/warnings/integer_division=false

window/size/width=1280
window/size/height=720
window/stretch/mode="viewport"
window/stretch/aspect="expand"

[input]
Expand Down

0 comments on commit bf5d255

Please sign in to comment.