K8s changes for NATS
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
[gd_scene load_steps=2 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/bazaar/components/store_item_row.gd" id="1_sir"]
|
||||
|
||||
[node name="StoreItemRow" type="PanelContainer"]
|
||||
script = ExtResource("1_sir")
|
||||
|
||||
[node name="Margin" type="MarginContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="Margin"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 12
|
||||
|
||||
[node name="Info" type="VBoxContainer" parent="Margin/HBox"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 3
|
||||
|
||||
[node name="NameLabel" type="Label" parent="Margin/HBox/Info"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 14
|
||||
|
||||
[node name="DescLabel" type="Label" parent="Margin/HBox/Info"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = ""
|
||||
visible = false
|
||||
autowrap_mode = 2
|
||||
modulate = Color(0.70, 0.70, 0.75, 1.0)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
|
||||
[node name="SubLabel" type="Label" parent="Margin/HBox/Info"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = ""
|
||||
visible = false
|
||||
modulate = Color(0.55, 0.55, 0.60, 1.0)
|
||||
theme_override_font_sizes/font_size = 11
|
||||
|
||||
[node name="PriceBox" type="VBoxContainer" parent="Margin/HBox"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 4
|
||||
|
||||
[node name="PriceLabel" type="Label" parent="Margin/HBox/PriceBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
horizontal_alignment = 1
|
||||
modulate = Color(0.95, 0.85, 0.30, 1.0)
|
||||
theme_override_font_sizes/font_size = 13
|
||||
|
||||
[node name="BuyBtn" type="Button" parent="Margin/HBox/PriceBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
custom_minimum_size = Vector2(76, 32)
|
||||
text = "Buy"
|
||||
theme_override_font_sizes/font_size = 13
|
||||
@@ -0,0 +1,50 @@
|
||||
extends PanelContainer
|
||||
## A single row in the Bazaar store listing.
|
||||
##
|
||||
## Call setup(item) with a Dictionary from get_store (StorePackDto,
|
||||
## StoreDeckDto, or CosmeticDto). Emits buy_pressed(item) when the
|
||||
## Buy button is pressed.
|
||||
|
||||
signal buy_pressed(item: Dictionary)
|
||||
|
||||
@onready var name_label : Label = %NameLabel
|
||||
@onready var desc_label : Label = %DescLabel
|
||||
@onready var sub_label : Label = %SubLabel
|
||||
@onready var price_label : Label = %PriceLabel
|
||||
@onready var buy_btn : Button = %BuyBtn
|
||||
|
||||
var _item: Dictionary = {}
|
||||
|
||||
|
||||
func setup(item: Dictionary) -> void:
|
||||
_item = item
|
||||
name_label.text = item.get("name", "—")
|
||||
|
||||
var desc: String = item.get("description", "")
|
||||
if desc.is_empty():
|
||||
desc_label.visible = false
|
||||
else:
|
||||
desc_label.text = desc
|
||||
desc_label.visible = true
|
||||
|
||||
# Sub-line varies by product type.
|
||||
var sub := ""
|
||||
if item.has("totalSlots"):
|
||||
sub = "%d cards per pack" % int(item.get("totalSlots", 0))
|
||||
elif item.has("totalCards"):
|
||||
sub = "%d cards" % int(item.get("totalCards", 0))
|
||||
var arch: String = item.get("archSpiritName", "")
|
||||
if not arch.is_empty():
|
||||
sub += " · Arch: %s" % arch
|
||||
elif item.has("cosmeticType"):
|
||||
sub = item.get("cosmeticType", "")
|
||||
|
||||
if sub.is_empty():
|
||||
sub_label.visible = false
|
||||
else:
|
||||
sub_label.text = sub
|
||||
sub_label.visible = true
|
||||
|
||||
price_label.text = "◆ %d OP" % int(item.get("originPointPrice", 0))
|
||||
|
||||
buy_btn.pressed.connect(func(): buy_pressed.emit(_item))
|
||||
@@ -0,0 +1 @@
|
||||
uid://bl4vmmiurfap2
|
||||
Reference in New Issue
Block a user