-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SVR-165] [부엌] 부엌 화면 & 식재료와 조리도구 조회 #150
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
extends GQLClient2 | ||
|
||
func _ready(): | ||
print("client 2 ready") | ||
#set_endpoint(false, "1.230.253.103", 38080, "/graphql") | ||
|
||
set_endpoint_2(false, "localhost", 38080, "/graphql/explorer") | ||
|
||
|
||
func raw_mutation(query:String): | ||
return GQLQueryExecuter2.new(endpoint, use_ssl, Mutation.new(query)) |
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,67 @@ | ||
extends Control | ||
|
||
const SLOT_EMPTY = preload("res://scenes/house/Kitchen/tool_slot_empty.tscn") | ||
const SLOT_NOT_USED = preload("res://scenes/house/Kitchen/tool_not_used.tscn") | ||
const SLOT_USED = preload("res://scenes/house/Kitchen/tool_is_used.tscn") | ||
|
||
@onready var slot = $P/M/V/Slot | ||
|
||
var largeslots: Dictionary | ||
var largetools: Array | ||
|
||
func _ready(): | ||
|
||
load_data() | ||
|
||
#slot 1 | ||
var slot1 = largeslots["firstApplianceSpace"] | ||
if (slot1.installedKitchenEquipment == null): # not installed | ||
var bigslot = SLOT_EMPTY.instantiate() | ||
slot.add_child(bigslot) | ||
else: # installed but not used | ||
if (!slot1["installedKitchenEquipment"]["isCooking"]): | ||
var bigslot = SLOT_NOT_USED.instantiate() | ||
bigslot.set_data(slot1) | ||
slot.add_child(bigslot) | ||
else: # cooking | ||
var bigslot = SLOT_USED.instantiate() | ||
bigslot.set_data(slot1) | ||
slot.add_child(bigslot) | ||
#slot 2 | ||
var slot2 = largeslots["secondApplianceSpace"] | ||
if (slot2.installedKitchenEquipment == null): | ||
var bigslot = SLOT_EMPTY.instantiate() | ||
slot.add_child(bigslot) | ||
else: | ||
if (!slot2["installedKitchenEquipment"]["isCooking"]): | ||
var bigslot = SLOT_NOT_USED.instantiate() | ||
bigslot.set_data(slot2) | ||
slot.add_child(bigslot) | ||
else: | ||
var bigslot = SLOT_USED.instantiate() | ||
bigslot.set_data(slot2) | ||
slot.add_child(bigslot) | ||
#slot 3 | ||
var slot3 = largeslots["thirdApplianceSpace"] | ||
if (slot3.installedKitchenEquipment == null): | ||
var bigslot = SLOT_EMPTY.instantiate() | ||
slot.add_child(bigslot) | ||
else: | ||
if (!slot3["installedKitchenEquipment"]["isCooking"]): | ||
var bigslot = SLOT_NOT_USED.instantiate() | ||
bigslot.set_data(slot3) | ||
slot.add_child(bigslot) | ||
else: | ||
var bigslot = SLOT_USED.instantiate() | ||
bigslot.set_data(slot3) | ||
slot.add_child(bigslot) | ||
Comment on lines
+16
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 부분은 사실 값만 다르고 행위는 다 똑같은 것 같은데 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 확실히 그렇군요 한번 함수로 묶어서 정리해보겠습니다 ! |
||
|
||
|
||
func load_data(): | ||
largeslots = SceneContext.user_kitchen_state["villageState"]["houseState"]["kitchenState"] | ||
|
||
var tools = SceneContext.user_state["inventoryState"]["kitchenEquipmentStateList"] | ||
for tool in tools: | ||
if(tool.equipmentCategoryType == "main"): | ||
largetools.append(tool) | ||
|
50 changes: 50 additions & 0 deletions
50
frontend/Savor-22b/scenes/house/Kitchen/big_tool_slot.tscn
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,50 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://bo1s5xygod4cl"] | ||
|
||
[ext_resource type="Script" path="res://scenes/house/Kitchen/big_tool_slot.gd" id="1_4yu3x"] | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mt11v"] | ||
bg_color = Color(0, 0, 0, 1) | ||
|
||
[node name="BigToolSlot" type="Control"] | ||
custom_minimum_size = Vector2(1400, 550) | ||
layout_mode = 3 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
offset_right = -520.0 | ||
offset_bottom = -530.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
size_flags_horizontal = 4 | ||
script = ExtResource("1_4yu3x") | ||
|
||
[node name="P" type="Panel" parent="."] | ||
layout_mode = 0 | ||
offset_right = 1400.0 | ||
offset_bottom = 550.0 | ||
theme_override_styles/panel = SubResource("StyleBoxFlat_mt11v") | ||
|
||
[node name="M" type="MarginContainer" parent="P"] | ||
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 = 30 | ||
theme_override_constants/margin_top = 15 | ||
theme_override_constants/margin_right = 30 | ||
theme_override_constants/margin_bottom = 15 | ||
|
||
[node name="V" type="VBoxContainer" parent="P/M"] | ||
layout_mode = 2 | ||
|
||
[node name="Title" type="Label" parent="P/M/V"] | ||
layout_mode = 2 | ||
theme_override_colors/font_color = Color(1, 1, 1, 1) | ||
theme_override_font_sizes/font_size = 50 | ||
text = "큰 조리도구 사용 슬롯" | ||
|
||
[node name="Slot" type="HBoxContainer" parent="P/M/V"] | ||
layout_mode = 2 | ||
theme_override_constants/separation = 20 |
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,31 @@ | ||
extends Control | ||
|
||
@onready var Desc = $P/Desc | ||
|
||
var data | ||
var requiredtime | ||
var foodname | ||
|
||
var format_string = "[%s] 요리 조리중 | ||
[%s 블록 남음]" | ||
|
||
func _ready(): | ||
update_label() | ||
|
||
|
||
|
||
func update_label(): | ||
if Desc == null: | ||
return | ||
|
||
Desc.text = format_string % [foodname, requiredtime] | ||
|
||
func set_data(info: Dictionary): | ||
data = info | ||
|
||
# set end times | ||
var endtime = data["cookingEndBlockIndex"] | ||
var currenttime = SceneContext.block_index["blockQuery"]["blocks"][0]["index"] | ||
requiredtime = endtime - currenttime | ||
|
||
foodname = data["cookingFood"]["name"] |
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,42 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://cs43iommrj00v"] | ||
|
||
[ext_resource type="Script" path="res://scenes/house/Kitchen/cook_menu.gd" id="1_tn6pc"] | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6jp5j"] | ||
bg_color = Color(0.94902, 0.596078, 0.0784314, 1) | ||
corner_radius_top_left = 40 | ||
corner_radius_top_right = 40 | ||
corner_radius_bottom_right = 40 | ||
corner_radius_bottom_left = 40 | ||
|
||
[node name="CookMenu" type="Control"] | ||
custom_minimum_size = Vector2(400, 250) | ||
layout_mode = 3 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
offset_right = -1520.0 | ||
offset_bottom = -830.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
script = ExtResource("1_tn6pc") | ||
|
||
[node name="P" type="Panel" parent="."] | ||
layout_mode = 0 | ||
offset_right = 400.0 | ||
offset_bottom = 250.0 | ||
theme_override_styles/panel = SubResource("StyleBoxFlat_6jp5j") | ||
|
||
[node name="Desc" type="Label" parent="P"] | ||
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(0, 0, 0, 1) | ||
theme_override_font_sizes/font_size = 40 | ||
text = "[-- -] 요리 조리중 | ||
[N 블록 남음]" | ||
horizontal_alignment = 1 | ||
vertical_alignment = 1 |
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,55 @@ | ||
extends Control | ||
|
||
const MENU = preload("res://scenes/house/Kitchen/cook_menu.tscn") | ||
|
||
@onready var slot = $P/M/V/S/Slot | ||
|
||
var menus: Array | ||
var largeslots: Dictionary | ||
var largearr: Array #큰 조리도구의 메뉴 | ||
|
||
func _ready(): | ||
load_data(); | ||
|
||
for menu in menus: | ||
var singlemenu = MENU.instantiate() | ||
singlemenu.set_data(menu) | ||
slot.add_child(singlemenu) | ||
|
||
|
||
func load_data(): | ||
var refrigerator = SceneContext.user_state["inventoryState"]["kitchenEquipmentStateList"] | ||
for items in refrigerator: | ||
if(items.isCooking): | ||
menus.append(items) | ||
|
||
refine_data() | ||
|
||
|
||
|
||
# 큰 조리도구의 메뉴를 제외시킨다 | ||
func refine_data(): | ||
largeslots = SceneContext.user_kitchen_state["villageState"]["houseState"]["kitchenState"] | ||
#print(largeslots) | ||
|
||
var slot1 = largeslots["firstApplianceSpace"] | ||
var slot2 = largeslots["secondApplianceSpace"] | ||
var slot3 = largeslots["thirdApplianceSpace"] | ||
|
||
if (slot1["installedKitchenEquipment"]!= null): | ||
var obj1 = slot1["installedKitchenEquipment"]["stateId"] | ||
largearr.append(obj1) | ||
if (slot2["installedKitchenEquipment"] != null): | ||
var obj2 = slot2["installedKitchenEquipment"]["stateId"] | ||
largearr.append(obj2) | ||
if (slot3["installedKitchenEquipment"] != null): | ||
var obj3 = slot3["installedKitchenEquipment"]["stateId"] | ||
largearr.append(obj3) | ||
|
||
print(largearr) | ||
|
||
for menu in menus: | ||
for data in largearr: | ||
if data == menu["stateId"]: | ||
menus.erase(menu) | ||
|
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,52 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://dea1yl6pikg0n"] | ||
|
||
[ext_resource type="Script" path="res://scenes/house/Kitchen/cook_slot.gd" id="1_kouyr"] | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q2usp"] | ||
bg_color = Color(0, 0, 0, 1) | ||
|
||
[node name="CookSlot" type="Control"] | ||
custom_minimum_size = Vector2(1920, 400) | ||
layout_mode = 3 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
offset_bottom = -680.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
script = ExtResource("1_kouyr") | ||
|
||
[node name="P" type="Panel" parent="."] | ||
layout_mode = 0 | ||
offset_right = 1920.0 | ||
offset_bottom = 400.0 | ||
theme_override_styles/panel = SubResource("StyleBoxFlat_q2usp") | ||
|
||
[node name="M" type="MarginContainer" parent="P"] | ||
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 = 30 | ||
theme_override_constants/margin_top = 15 | ||
theme_override_constants/margin_right = 30 | ||
theme_override_constants/margin_bottom = 15 | ||
|
||
[node name="V" type="VBoxContainer" parent="P/M"] | ||
layout_mode = 2 | ||
|
||
[node name="Title" type="Label" parent="P/M/V"] | ||
layout_mode = 2 | ||
theme_override_colors/font_color = Color(1, 1, 1, 1) | ||
theme_override_font_sizes/font_size = 50 | ||
text = "일반 음식 조리 슬롯" | ||
|
||
[node name="S" type="ScrollContainer" parent="P/M/V"] | ||
layout_mode = 2 | ||
vertical_scroll_mode = 0 | ||
|
||
[node name="Slot" type="HBoxContainer" parent="P/M/V/S"] | ||
layout_mode = 2 | ||
theme_override_constants/separation = 50 |
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,41 @@ | ||
extends Control | ||
|
||
@onready var button = $Button | ||
|
||
var data: Dictionary | ||
var requiredtime | ||
var menuname | ||
|
||
var format_string = "현재 [%s] 조리 중 | ||
|
||
남은 조리 블록 %s 블록" | ||
|
||
func _ready(): | ||
update_text() | ||
|
||
|
||
func update_text(): | ||
if button == null: | ||
return | ||
|
||
print(SceneContext.block_index) | ||
var endtime = data["installedKitchenEquipment"]["cookingEndBlockIndex"] | ||
var currenttime = SceneContext.block_index["blockQuery"]["blocks"][0]["index"] | ||
var timeleft = endtime - currenttime | ||
button.text = format_string % [menuname, timeleft] | ||
|
||
|
||
func set_data(info: Dictionary): | ||
data = info | ||
menuname = data["installedKitchenEquipment"]["cookingFood"]["name"] | ||
time_info() | ||
|
||
func time_info(): | ||
var recipe = SceneContext.recipe["recipe"] | ||
|
||
for singlerecipe in recipe: | ||
var rcpname = singlerecipe["resultFood"]["name"] | ||
if(rcpname == menuname): | ||
requiredtime = singlerecipe["requiredBlockCount"] | ||
|
||
print(requiredtime) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아무래도 이름이 client2는 좀 그렇죠..
용도에 따라 이름을 바꾸면 좋겠네요