Skip to content

Commit

Permalink
ui: added ui action details
Browse files Browse the repository at this point in the history
  • Loading branch information
kth1888 committed Mar 5, 2024
1 parent 44d3628 commit 259af12
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/Savor-22b/scenes/house/house.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ offset_right = 40.0
offset_bottom = 40.0

[connection signal="button_down" from="M/V/menus/V/InventoryButton" to="." method="_on_inventory_button_button_down"]
[connection signal="button_down" from="M/V/menus/V/RefreshButton" to="." method="_on_refresh_button_button_down"]
7 changes: 5 additions & 2 deletions frontend/Savor-22b/scenes/house/house_inventory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ func _ready():
func _on_tools_button_down():
clear_popup()
var kitchens = KITCHEN_TOOLS.instantiate()

kitchens.closetab.connect(closetab)
panel.add_child(kitchens)

func _on_shop_button_down():
clear_popup()
var kitchens = KITCHEN_SHOP.instantiate()

kitchens.closetab.connect(closetab)
kitchens.buysignal.connect(popup)
panel.add_child(kitchens)

Expand All @@ -33,5 +33,8 @@ func clear_popup():
for pop in panel.get_children():
pop.queue_free()

func closetab():
queue_free()

func popup():
buysignal.emit()
6 changes: 6 additions & 0 deletions frontend/Savor-22b/scenes/house/kitchenshop.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const TOOL = preload("res://scenes/house/tool.tscn")
@onready var grid = $M/V/Items/G

signal buysignal
signal closetab

var list

Expand All @@ -20,3 +21,8 @@ func _ready():

func popup():
buysignal.emit()


func _on_close_button_down():
closetab.emit()
queue_free()
2 changes: 2 additions & 0 deletions frontend/Savor-22b/scenes/house/kitchenshop.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 40
theme_override_styles/normal = SubResource("StyleBoxFlat_rk6tx")
text = " 닫기 "

[connection signal="button_down" from="M/V/Button/Close" to="." method="_on_close_button_down"]
8 changes: 8 additions & 0 deletions frontend/Savor-22b/scenes/house/kitchentools.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const TOOL = preload("res://scenes/house/tool.tscn")

@onready var grid = $M/V/Items/G

signal closetab

var tools

func _ready():
Expand All @@ -14,3 +16,9 @@ func _ready():
toolpanel.set_info(tool)
grid.add_child(toolpanel)



func _on_close_button_down():
closetab.emit()
queue_free()

2 changes: 2 additions & 0 deletions frontend/Savor-22b/scenes/house/kitchentools.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 40
theme_override_styles/normal = SubResource("StyleBoxFlat_rk6tx")
text = " 닫기 "

[connection signal="button_down" from="M/V/Button/Close" to="." method="_on_close_button_down"]
11 changes: 11 additions & 0 deletions frontend/Savor-22b/scripts/scenes/house.gd
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ func buypopup():
var askpopup = ASK_POPUP.instantiate()
askpopup.set_itemname(SceneContext.selected_item_name)
askpopup.buy_button_down.connect(buyaction)
askpopup.set_position(Vector2(900,600))
popup.add_child(askpopup)

func buyaction():
clear_popup()
buytool()

var donepopup = DONE_POPUP.instantiate()
donepopup.set_position(Vector2(900,600))
popup.add_child(donepopup)

func buytool():
Expand Down Expand Up @@ -62,3 +64,12 @@ func clear_popup():
if is_instance_valid(popup):
for pop in popup.get_children():
pop.queue_free()



func _on_refresh_button_button_down():
Intro._query_user_state()

if is_instance_valid(subscene):
for scene in subscene.get_children():
scene.queue_free()

0 comments on commit 259af12

Please sign in to comment.