From 41677cd9b2d4fb6bd85f3c628824bc6cc3ac0c11 Mon Sep 17 00:00:00 2001 From: Tae Hyoung Kang <78776542+kth1888@users.noreply.github.com> Date: Thu, 23 May 2024 01:24:35 +0900 Subject: [PATCH] feat: trade shop inventory implement --- frontend/Savor-22b/gql/query.gd | 7 ++ frontend/Savor-22b/gql/query_executor.gd | 12 +++ .../scenes/house/cook/cook_book.tscn | 1 - frontend/Savor-22b/scenes/house/food.gd | 2 +- frontend/Savor-22b/scenes/market/market.gd | 52 ++++++++++ frontend/Savor-22b/scenes/market/market.tscn | 99 +++++++++++++++++++ frontend/Savor-22b/scenes/market/my_item.gd | 27 +++++ frontend/Savor-22b/scenes/market/my_item.tscn | 37 +++++++ .../Savor-22b/scenes/market/posted_item.tscn | 72 ++++++++++++++ .../Savor-22b/scenes/market/sell_list.tscn | 87 ++++++++++++++++ .../scenes/market/sell_list_button_group.tres | 3 + .../scenes/market/trade_inventory.gd | 18 ++++ .../scenes/market/trade_inventory.tscn | 74 ++++++++++++++ .../Savor-22b/scenes/village/village_view.gd | 6 ++ .../scenes/village/village_view.tscn | 23 +++++ 15 files changed, 518 insertions(+), 2 deletions(-) create mode 100644 frontend/Savor-22b/scenes/market/market.gd create mode 100644 frontend/Savor-22b/scenes/market/market.tscn create mode 100644 frontend/Savor-22b/scenes/market/my_item.gd create mode 100644 frontend/Savor-22b/scenes/market/my_item.tscn create mode 100644 frontend/Savor-22b/scenes/market/posted_item.tscn create mode 100644 frontend/Savor-22b/scenes/market/sell_list.tscn create mode 100644 frontend/Savor-22b/scenes/market/sell_list_button_group.tres create mode 100644 frontend/Savor-22b/scenes/market/trade_inventory.gd create mode 100644 frontend/Savor-22b/scenes/market/trade_inventory.tscn diff --git a/frontend/Savor-22b/gql/query.gd b/frontend/Savor-22b/gql/query.gd index 217aeda0..6c8b254a 100644 --- a/frontend/Savor-22b/gql/query.gd +++ b/frontend/Savor-22b/gql/query.gd @@ -75,3 +75,10 @@ var uninstall_kitchen_equipment_query = GQLQuery.new("createAction_UninstallKitc "publicKey": "publicKey", "spaceNumber": "spaceNumber" }); + +var register_trade_good_query = GQLQuery.new("createAction_RegisterTradeGoodAction").set_args({ + "publicKey": "publicKey", + "price": "price", + "foodStateId": "foodStateId", + "itemStateIds": "itemStateIds" +}); diff --git a/frontend/Savor-22b/gql/query_executor.gd b/frontend/Savor-22b/gql/query_executor.gd index 12c30ea7..d2a5f68a 100644 --- a/frontend/Savor-22b/gql/query_executor.gd +++ b/frontend/Savor-22b/gql/query_executor.gd @@ -125,6 +125,18 @@ var uninstall_kitchen_equipment_query_executor = SvrGqlClient.query( gql_query.uninstall_kitchen_equipment_query ); + +var register_trade_good_query_executor = SvrGqlClient.query( + 'RegisterTradeGood', + { + "publicKey": "String!", + "price": "Int!", + "foodStateId": "Int!", + "itemStateIds": "Int!" + }, + gql_query.uninstall_kitchen_equipment_query +); + func stage_action(params, query_executor, mutation_executor): query_executor.graphql_response.connect( func(data): diff --git a/frontend/Savor-22b/scenes/house/cook/cook_book.tscn b/frontend/Savor-22b/scenes/house/cook/cook_book.tscn index 5e96b6c9..0dbb2154 100644 --- a/frontend/Savor-22b/scenes/house/cook/cook_book.tscn +++ b/frontend/Savor-22b/scenes/house/cook/cook_book.tscn @@ -1,7 +1,6 @@ [gd_scene load_steps=7 format=3 uid="uid://bb0hth2o7k30q"] [ext_resource type="Script" path="res://scenes/house/cook/cook_book.gd" id="1_q1ejr"] -[ext_resource type="Script" path="res://scenes/house/recipe_book/recipe_book.gd" id="1_2wc5e"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_tvose"] bg_color = Color(0.94902, 0.694118, 0.0784314, 1) diff --git a/frontend/Savor-22b/scenes/house/food.gd b/frontend/Savor-22b/scenes/house/food.gd index b77a9370..dbbb29dc 100644 --- a/frontend/Savor-22b/scenes/house/food.gd +++ b/frontend/Savor-22b/scenes/house/food.gd @@ -18,4 +18,4 @@ func _update_info(): func set_info(info: Dictionary): self.info = info - \ No newline at end of file + diff --git a/frontend/Savor-22b/scenes/market/market.gd b/frontend/Savor-22b/scenes/market/market.gd new file mode 100644 index 00000000..3ac72f53 --- /dev/null +++ b/frontend/Savor-22b/scenes/market/market.gd @@ -0,0 +1,52 @@ +extends Control + +const TradeInventoryScn = preload("res://scenes/market/trade_inventory.tscn") +const SellListScn = preload("res://scenes/market/sell_list.tscn") + +@onready var inventory_container = $VBoxContainer/MarginContainer/SubMenuHBoxContainer/InventoryMarginContainer +@onready var sell_list_container = $VBoxContainer/MarginContainer/SubMenuHBoxContainer/SellListMarginContainer + +var query_executor = QueryExecutor.new() +var register_trade_good_query_executor +var stage_tx_mutation_executor + +func _ready(): + register_trade_good_query_executor = query_executor.register_trade_good_query_executor + stage_tx_mutation_executor = query_executor.stage_tx_mutation_executor + add_child(register_trade_good_query_executor) + add_child(stage_tx_mutation_executor) + + + load_initial_scene() + + test_register() + + +func load_initial_scene(): + load_inventory() + load_sell_list() + +func load_inventory(): + var inventory = TradeInventoryScn.instantiate() + inventory_container.add_child(inventory) + +func load_sell_list(): + var sell_list = SellListScn.instantiate() + sell_list_container.add_child(sell_list) + + +func test_register(): + query_executor.stage_action( + { + "publicKey": GlobalSigner.signer.GetPublicKey(), + "price": 10, + "foodStateId": "8ef2aa23-3595-4036-9ee9-7802d4663891", + "itemStateIds": [] + }, + register_trade_good_query_executor, + stage_tx_mutation_executor + ) + + +func _on_village_button_down(): + get_tree().change_scene_to_file("res://scenes/village/village_view.tscn") diff --git a/frontend/Savor-22b/scenes/market/market.tscn b/frontend/Savor-22b/scenes/market/market.tscn new file mode 100644 index 00000000..ef6fc395 --- /dev/null +++ b/frontend/Savor-22b/scenes/market/market.tscn @@ -0,0 +1,99 @@ +[gd_scene load_steps=3 format=3 uid="uid://5hl0imlbiaaj"] + +[ext_resource type="Script" path="res://scenes/market/market.gd" id="1_ibysf"] +[ext_resource type="PackedScene" uid="uid://co4t4p5pawylr" path="res://scenes/common/prefabs/asset.tscn" id="2_mauxh"] + +[node name="Market" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_ibysf") + +[node name="Background" type="ColorRect" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Title" type="Label" parent="Background"] +offset_right = 40.0 +offset_bottom = 23.0 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_font_sizes/font_size = 60 +text = " 무역 화면" + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +custom_minimum_size = Vector2(1920, 1080) +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_right = 4.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer"] +layout_mode = 2 +theme_override_constants/margin_left = 50 +theme_override_constants/margin_top = 20 +theme_override_constants/margin_right = 50 +theme_override_constants/margin_bottom = 20 + +[node name="TopMenuHBoxContainer" type="HBoxContainer" parent="VBoxContainer/MarginContainer2"] +layout_mode = 2 +theme_override_constants/separation = 50 +alignment = 2 + +[node name="AssetPanel" type="Panel" parent="VBoxContainer/MarginContainer2/TopMenuHBoxContainer"] +custom_minimum_size = Vector2(600, 2.08165e-12) +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/MarginContainer2/TopMenuHBoxContainer/AssetPanel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 50 +theme_override_constants/margin_right = 50 + +[node name="Asset" parent="VBoxContainer/MarginContainer2/TopMenuHBoxContainer/AssetPanel/MarginContainer" instance=ExtResource("2_mauxh")] +layout_mode = 2 + +[node name="VillageButton" type="Button" parent="VBoxContainer/MarginContainer2/TopMenuHBoxContainer"] +custom_minimum_size = Vector2(200, 2.08165e-12) +layout_mode = 2 +size_flags_vertical = 0 +theme_override_font_sizes/font_size = 50 +text = " 마을로 " + +[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"] +custom_minimum_size = Vector2(1920, 950) +layout_mode = 2 + +[node name="SubMenuHBoxContainer" type="HBoxContainer" parent="VBoxContainer/MarginContainer"] +layout_mode = 2 + +[node name="InventoryMarginContainer" type="MarginContainer" parent="VBoxContainer/MarginContainer/SubMenuHBoxContainer"] +custom_minimum_size = Vector2(700, 2.08165e-12) +layout_mode = 2 +theme_override_constants/margin_left = 10 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 10 +theme_override_constants/margin_bottom = 50 + +[node name="SellListMarginContainer" type="MarginContainer" parent="VBoxContainer/MarginContainer/SubMenuHBoxContainer"] +custom_minimum_size = Vector2(1220, 2.08165e-12) +layout_mode = 2 +theme_override_constants/margin_left = 50 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 50 +theme_override_constants/margin_bottom = 50 + +[connection signal="button_down" from="VBoxContainer/MarginContainer2/TopMenuHBoxContainer/VillageButton" to="." method="_on_village_button_down"] diff --git a/frontend/Savor-22b/scenes/market/my_item.gd b/frontend/Savor-22b/scenes/market/my_item.gd new file mode 100644 index 00000000..852c555b --- /dev/null +++ b/frontend/Savor-22b/scenes/market/my_item.gd @@ -0,0 +1,27 @@ +extends Control + +#@onready var food_name = $M/V/Name +#@onready var food_description = $M/V/Desc + +@onready var item_button = $ItemSelectButton + +var info +var desc_format_string = "%s +%s : %s +%s : %s" + +func _ready(): + _update_info() + +func _update_info(): + if item_button == null: + return + item_button.text = desc_format_string % [info.name, "등급", info.grade, "stateId", info.stateId] + + +func set_info(info: Dictionary): + self.info = info + + +func _on_item_select_button_down(): + print(info) diff --git a/frontend/Savor-22b/scenes/market/my_item.tscn b/frontend/Savor-22b/scenes/market/my_item.tscn new file mode 100644 index 00000000..8a90c047 --- /dev/null +++ b/frontend/Savor-22b/scenes/market/my_item.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=3 format=3 uid="uid://c7yghm5bsqwif"] + +[ext_resource type="Script" path="res://scenes/market/my_item.gd" id="1_5wh4n"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_21if1"] +bg_color = Color(0, 0, 0, 1) +corner_radius_top_left = 30 +corner_radius_top_right = 30 +corner_radius_bottom_right = 30 +corner_radius_bottom_left = 30 + +[node name="MyItem" type="Control"] +custom_minimum_size = Vector2(310, 200) +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_right = -1610.0 +offset_bottom = -880.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_5wh4n") + +[node name="ItemSelectButton" type="Button" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 40 +theme_override_styles/normal = SubResource("StyleBoxFlat_21if1") +text = "아이템 정보" +text_overrun_behavior = 1 + +[connection signal="button_down" from="ItemSelectButton" to="." method="_on_item_select_button_down"] diff --git a/frontend/Savor-22b/scenes/market/posted_item.tscn b/frontend/Savor-22b/scenes/market/posted_item.tscn new file mode 100644 index 00000000..884cc7e5 --- /dev/null +++ b/frontend/Savor-22b/scenes/market/posted_item.tscn @@ -0,0 +1,72 @@ +[gd_scene load_steps=3 format=3 uid="uid://crw3yutudcodf"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_3bs65"] +bg_color = Color(0, 0, 0, 1) +corner_radius_top_left = 40 +corner_radius_top_right = 40 +corner_radius_bottom_right = 40 +corner_radius_bottom_left = 40 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lobix"] +bg_color = Color(0, 0, 0, 1) +border_width_left = 3 +border_width_top = 3 +border_width_right = 3 +border_width_bottom = 3 +border_color = Color(1, 1, 1, 1) +corner_radius_top_left = 15 +corner_radius_top_right = 15 +corner_radius_bottom_right = 15 +corner_radius_bottom_left = 15 + +[node name="PostedItem" type="Control"] +custom_minimum_size = Vector2(380, 410) +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_right = -1540.0 +offset_bottom = -670.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="BackgroundPanel" type="Panel" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_3bs65") + +[node name="MarginContainer" type="MarginContainer" parent="BackgroundPanel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 25 +theme_override_constants/margin_top = 30 +theme_override_constants/margin_right = 25 +theme_override_constants/margin_bottom = 30 + +[node name="VBoxContainer" type="VBoxContainer" parent="BackgroundPanel/MarginContainer"] +layout_mode = 2 + +[node name="DescriptionLabel" type="Label" parent="BackgroundPanel/MarginContainer/VBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 280) +layout_mode = 2 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 40 +text = "품목명 : 참치 +게시자 : 맛도리 해적단 +게시 마을 : 외로운 섬" + +[node name="BuyButton" type="Button" parent="BackgroundPanel/MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 8 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 40 +theme_override_styles/normal = SubResource("StyleBoxFlat_lobix") +text = " 구매 " diff --git a/frontend/Savor-22b/scenes/market/sell_list.tscn b/frontend/Savor-22b/scenes/market/sell_list.tscn new file mode 100644 index 00000000..d5827364 --- /dev/null +++ b/frontend/Savor-22b/scenes/market/sell_list.tscn @@ -0,0 +1,87 @@ +[gd_scene load_steps=6 format=3 uid="uid://bu43d13qwmtcr"] + +[ext_resource type="ButtonGroup" uid="uid://di66p0jb8cdpk" path="res://scenes/market/sell_list_button_group.tres" id="1_vyf2b"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4l2s6"] +bg_color = Color(0, 0, 0, 1) +corner_radius_top_left = 25 +corner_radius_top_right = 25 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vqa0t"] +bg_color = Color(0.94902, 0.694118, 0.243137, 1) +corner_radius_top_left = 25 +corner_radius_top_right = 25 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_af182"] +bg_color = Color(0.94902, 0.694118, 0.243137, 1) +corner_radius_top_left = 25 +corner_radius_top_right = 25 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_as0cg"] +bg_color = Color(0.94902, 0.694118, 0.243137, 1) + +[node name="SellList" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_right = -700.0 +offset_bottom = -130.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +theme_override_constants/separation = 20 + +[node name="WholeSellListButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(200, 70) +layout_mode = 2 +size_flags_horizontal = 0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 40 +theme_override_styles/normal = SubResource("StyleBoxFlat_4l2s6") +theme_override_styles/pressed = SubResource("StyleBoxFlat_vqa0t") +toggle_mode = true +button_pressed = true +button_group = ExtResource("1_vyf2b") +text = "판매목록" + +[node name="MySellListButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(240, 70) +layout_mode = 2 +size_flags_horizontal = 0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 40 +theme_override_styles/normal = SubResource("StyleBoxFlat_4l2s6") +theme_override_styles/pressed = SubResource("StyleBoxFlat_af182") +toggle_mode = true +button_group = ExtResource("1_vyf2b") +text = "내 판매목록" + +[node name="ListPanel" type="Panel" parent="MarginContainer/VBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 750) +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_as0cg") + +[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/VBoxContainer/ListPanel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="CenterContainer" type="CenterContainer" parent="MarginContainer/VBoxContainer/ListPanel/ScrollContainer"] +layout_mode = 2 diff --git a/frontend/Savor-22b/scenes/market/sell_list_button_group.tres b/frontend/Savor-22b/scenes/market/sell_list_button_group.tres new file mode 100644 index 00000000..5c8d95f1 --- /dev/null +++ b/frontend/Savor-22b/scenes/market/sell_list_button_group.tres @@ -0,0 +1,3 @@ +[gd_resource type="ButtonGroup" format=3 uid="uid://di66p0jb8cdpk"] + +[resource] diff --git a/frontend/Savor-22b/scenes/market/trade_inventory.gd b/frontend/Savor-22b/scenes/market/trade_inventory.gd new file mode 100644 index 00000000..78ed1d62 --- /dev/null +++ b/frontend/Savor-22b/scenes/market/trade_inventory.gd @@ -0,0 +1,18 @@ +extends Control + +const MyItemScn = preload("res://scenes/market/my_item.tscn") + +@onready var inventory_container = $MarginContainer/VBoxContainer/InventoryPanel/ScrollContainer/CenterContainer/GridContainer + +var items + +func _ready(): + load_items() + +func load_items(): + items = SceneContext.user_state.inventoryState["refrigeratorStateList"] + + for item in items: + var item_scene = MyItemScn.instantiate() + item_scene.set_info(item) + inventory_container.add_child(item_scene) diff --git a/frontend/Savor-22b/scenes/market/trade_inventory.tscn b/frontend/Savor-22b/scenes/market/trade_inventory.tscn new file mode 100644 index 00000000..6ae4076a --- /dev/null +++ b/frontend/Savor-22b/scenes/market/trade_inventory.tscn @@ -0,0 +1,74 @@ +[gd_scene load_steps=4 format=3 uid="uid://81w3i6nbxjix"] + +[ext_resource type="Script" path="res://scenes/market/trade_inventory.gd" id="1_2sbin"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8vjfi"] +bg_color = Color(0, 0, 0, 1) +corner_radius_top_left = 25 +corner_radius_top_right = 25 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_as0cg"] +bg_color = Color(0.94902, 0.694118, 0.243137, 1) + +[node name="TradeInventory" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_right = -1220.0 +offset_bottom = -130.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_2sbin") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="TitlePanel" type="Panel" parent="MarginContainer/VBoxContainer"] +custom_minimum_size = Vector2(200, 70) +layout_mode = 2 +size_flags_horizontal = 0 +theme_override_styles/panel = SubResource("StyleBoxFlat_8vjfi") + +[node name="TitleLabel" type="Label" parent="MarginContainer/VBoxContainer/TitlePanel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 40 +text = "인벤토리" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="InventoryPanel" type="Panel" parent="MarginContainer/VBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 750) +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_as0cg") + +[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/VBoxContainer/InventoryPanel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="CenterContainer" type="CenterContainer" parent="MarginContainer/VBoxContainer/InventoryPanel/ScrollContainer"] +layout_mode = 2 + +[node name="GridContainer" type="GridContainer" parent="MarginContainer/VBoxContainer/InventoryPanel/ScrollContainer/CenterContainer"] +layout_mode = 2 +theme_override_constants/h_separation = 50 +theme_override_constants/v_separation = 50 +columns = 2 diff --git a/frontend/Savor-22b/scenes/village/village_view.gd b/frontend/Savor-22b/scenes/village/village_view.gd index 995eb494..88a41cb4 100644 --- a/frontend/Savor-22b/scenes/village/village_view.gd +++ b/frontend/Savor-22b/scenes/village/village_view.gd @@ -66,6 +66,10 @@ func _on_enter_button_down(): func _on_farm_button_down(): get_tree().change_scene_to_file("res://scenes/farm/farm.tscn") +func _on_market_button_down(): + get_tree().change_scene_to_file("res://scenes/market/market.tscn") + + #open shop with S input func _input(event): if event is InputEventKey and event.pressed: @@ -73,3 +77,5 @@ func _input(event): var shop = SystemShopScn.instantiate() popups.add_child(shop) shop.set_position(Vector2(400, 150)) + + diff --git a/frontend/Savor-22b/scenes/village/village_view.tscn b/frontend/Savor-22b/scenes/village/village_view.tscn index b2800bc0..5a4a0be5 100644 --- a/frontend/Savor-22b/scenes/village/village_view.tscn +++ b/frontend/Savor-22b/scenes/village/village_view.tscn @@ -68,6 +68,28 @@ grow_vertical = 2 theme_override_font_sizes/font_size = 70 text = " 내 밭으로 가기 " +[node name="MarketButtonContainer" type="ColorRect" parent="TopMenuMarginContainer/Control"] +offset_left = 920.0 +offset_right = 1370.0 +offset_bottom = 100.0 +size_flags_horizontal = 4 +color = Color(0, 0, 0, 1) + +[node name="MarketButton" type="Button" parent="TopMenuMarginContainer/Control/MarketButtonContainer"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_font_sizes/font_size = 70 +text = "무역 화면 가기 " + +[node name="HBoxContainer" type="HBoxContainer" parent="TopMenuMarginContainer/Control"] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 40.0 + [node name="BottomMenuMarginContainer" type="MarginContainer" parent="."] layout_mode = 0 offset_top = 940.0 @@ -155,4 +177,5 @@ offset_bottom = 40.0 [connection signal="button_down" from="TopMenuMarginContainer/Control/HomeButtonContainer/HomeButton" to="." method="_on_home_button_down"] [connection signal="button_down" from="TopMenuMarginContainer/Control/FarmButtonContainer/FarmButton" to="." method="_on_farm_button_down"] +[connection signal="button_down" from="TopMenuMarginContainer/Control/MarketButtonContainer/MarketButton" to="." method="_on_market_button_down"] [connection signal="button_down" from="BottomMenuMarginContainer/Control/EnterButtonContainer/EnterButton" to="." method="_on_enter_button_down"]