-
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: trade shop sell list implement
- Loading branch information
Showing
9 changed files
with
188 additions
and
16 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
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,28 @@ | ||
extends Control | ||
|
||
#@onready var food_name = $M/V/Name | ||
#@onready var food_description = $M/V/Desc | ||
|
||
@onready var item_button = $ItemSelectButton | ||
@onready var description_label = $BackgroundPanel/MarginContainer/VBoxContainer/DescriptionLabel | ||
|
||
var info | ||
var desc_format_string = "%s : %s | ||
%s : %s%s | ||
%s : %s" | ||
|
||
func _ready(): | ||
_update_info() | ||
|
||
func _update_info(): | ||
if description_label == null: | ||
return | ||
description_label.text = desc_format_string % ["품목명",info.food["name"],"가격",info.price," BBG","게시자",info.sellerAddress] | ||
|
||
|
||
func set_info(info: Dictionary): | ||
self.info = info | ||
|
||
|
||
func _on_item_select_button_down(): | ||
print(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
extends Control | ||
|
||
const PostedItemScn = preload("res://scenes/market/posted_item.tscn") | ||
|
||
@onready var list_container = $MarginContainer/VBoxContainer/ListPanel/ScrollContainer/MarginContainer/CenterContainer/GridContainer | ||
|
||
var goods | ||
var my_address = GlobalSigner.signer_address | ||
|
||
func _ready(): | ||
pass | ||
|
||
func set_list(data: Array): | ||
goods = data | ||
load_list() | ||
|
||
|
||
func load_list(): | ||
clear_list_panel() | ||
|
||
for good in goods: | ||
if(good["sellerAddress"] != my_address): | ||
add_lists(good) | ||
|
||
|
||
func _on_my_sell_list_button_down(): | ||
clear_list_panel() | ||
|
||
for good in goods: | ||
if(good["sellerAddress"] == my_address): | ||
add_lists(good) | ||
|
||
func clear_list_panel(): | ||
if is_instance_valid(list_container): | ||
for posted_item in list_container.get_children(): | ||
posted_item.queue_free() | ||
|
||
func add_lists(good: Dictionary): | ||
var posted_item_scene = PostedItemScn.instantiate() | ||
posted_item_scene.set_info(good) | ||
list_container.add_child(posted_item_scene) | ||
|
||
|
||
func _on_whole_sell_list_button_down(): | ||
load_list() |
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