-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: show kitchentools in inventory
- Loading branch information
Showing
10 changed files
with
103 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
extends Control | ||
|
||
const KITCHEN_TOOLS = preload("res://scenes/house/kitchentools.tscn") | ||
|
||
@onready var panel = $M/V/Panel/C | ||
|
||
func _ready(): | ||
var kitchens = KITCHEN_TOOLS.instantiate() | ||
|
||
panel.add_child(kitchens) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
extends Control | ||
|
||
const TOOL = preload("res://scenes/house/tool.tscn") | ||
|
||
@onready var grid = $M/V/Items/G | ||
|
||
var tools | ||
|
||
func _ready(): | ||
tools = SceneContext.user_state.inventoryState["kitchenEquipmentStateList"] | ||
|
||
for tool in tools: | ||
var toolpanel = TOOL.instantiate() | ||
toolpanel.set_info(tool) | ||
grid.add_child(toolpanel) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
extends Panel | ||
|
||
@onready var toolname = $M/V/Name | ||
@onready var tooldesc = $M/V/Desc | ||
|
||
var info | ||
|
||
func _ready(): | ||
_update_info() | ||
|
||
|
||
func _update_info(): | ||
if toolname == null: | ||
return | ||
|
||
toolname.text = info.equipmentName | ||
tooldesc.text = info.stateId | ||
|
||
func set_info(info: Dictionary): | ||
self.info = info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
extends Control | ||
|
||
const HOUSE_INVENTORY = preload("res://scenes/house/house_inventory.tscn") | ||
|
||
@onready var subscene = $M/V/subscene | ||
|
||
func _ready(): | ||
pass # Replace with function body. | ||
|
||
|
||
|
||
|
||
func _on_inventory_button_button_down(): | ||
var inventory = HOUSE_INVENTORY.instantiate() | ||
|
||
subscene.add_child(inventory) |