580 lines
16 KiB
GDScript
580 lines
16 KiB
GDScript
extends Control
|
||
## Inventar als Modal über der Karte (docs/ui.md §1).
|
||
##
|
||
## 5×3-Raster mit Item-Icons, ausgerüstete Slots links, Details und Aktionen
|
||
## rechts. Ausrüsten prüft die Klassenbeschränkung aus `classes.json`;
|
||
## Verbrauchsgüter laufen über `Game.benutzen()`.
|
||
|
||
signal geschlossen
|
||
|
||
const THEME := preload("res://scripts/ui/ui_theme.gd")
|
||
|
||
const SLOTS := [
|
||
{"key": "weapon", "label": "Waffe"},
|
||
{"key": "armor", "label": "Rüstung"},
|
||
{"key": "shield", "label": "Schild"},
|
||
]
|
||
const SPALTEN := 5
|
||
const ZEILEN := 3
|
||
const KACHEL := 88
|
||
const ABSTAND := 8
|
||
const RASTER := Vector2(640, 200)
|
||
|
||
var _index := 0
|
||
var _wurzel: Control
|
||
var _sel_id := ""
|
||
var _sel_quelle := "" ## "inventar" oder "slot"
|
||
var _meldung := ""
|
||
var _seite := 0
|
||
var _geben_ebene: Control
|
||
|
||
|
||
func _ready() -> void:
|
||
theme = THEME.baue()
|
||
set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||
_wurzel = Control.new()
|
||
_wurzel.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||
add_child(_wurzel)
|
||
_bauen()
|
||
|
||
|
||
func _bauen() -> void:
|
||
_leeren(_wurzel)
|
||
_geben_ebene = null
|
||
|
||
var dimm := UiTheme.dimmung()
|
||
dimm.color = Color(0.04, 0.03, 0.02, 0.72)
|
||
_wurzel.add_child(dimm)
|
||
|
||
var p := Panel.new()
|
||
p.position = Vector2(260, 160)
|
||
p.size = Vector2(1400, 760)
|
||
p.add_theme_stylebox_override("panel", THEME.flaeche(Color(1, 1, 1)))
|
||
_wurzel.add_child(p)
|
||
|
||
_titel(p)
|
||
_reiter(p)
|
||
_gold(p)
|
||
|
||
if Game.party.is_empty():
|
||
_label(p, "Keine Figur in der Party.", Vector2(40, 200))
|
||
_schliessen_knopf(p)
|
||
return
|
||
|
||
var figur: Dictionary = Game.party[_index]
|
||
_ausgeruestet(p, figur)
|
||
_rucksack(p, figur)
|
||
_details(p, figur)
|
||
|
||
_label(p, "RK %d Angriff +%d TP %d/%d" % [
|
||
Game.rk(figur), Game.angriffsbonus(figur),
|
||
int(figur["hp"]["current"]), int(figur["hp"]["max"])],
|
||
Vector2(40, 680), Vector2(700, 40))
|
||
_label(p, "Last %d / %d" % [Game.gewicht(figur), Game.kapazitaet(figur)],
|
||
Vector2(40, 640), Vector2(400, 36), UiTheme.CREAM_D)
|
||
_schliessen_knopf(p)
|
||
|
||
|
||
func _titel(p: Panel) -> void:
|
||
var l := Label.new()
|
||
l.text = "INVENTAR"
|
||
l.position = Vector2(40, 24)
|
||
l.add_theme_color_override("font_color", UiTheme.GOLD)
|
||
p.add_child(l)
|
||
|
||
|
||
func _gold(p: Panel) -> void:
|
||
var l := Label.new()
|
||
l.text = "Gold: %d" % Game.gold
|
||
l.position = Vector2(1080, 24)
|
||
l.size = Vector2(280, 40)
|
||
l.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
||
l.clip_text = true
|
||
l.add_theme_color_override("font_color", UiTheme.GOLD)
|
||
p.add_child(l)
|
||
|
||
|
||
func _reiter(p: Panel) -> void:
|
||
var x := 40
|
||
for i in Game.party.size():
|
||
var b := DropReiter.new()
|
||
b.text = str(Game.party[i].get("name", "?"))
|
||
b.index = i
|
||
b.position = Vector2(x, 80)
|
||
b.size = Vector2(170, 52)
|
||
b.focus_mode = Control.FOCUS_NONE
|
||
b.clip_text = true
|
||
b.modulate = Color(1.45, 1.25, 0.95) if i == _index else Color(1, 1, 1)
|
||
b.pressed.connect(_waehlen_figur.bind(i))
|
||
b.figur_bekommen.connect(_geben_drop)
|
||
p.add_child(b)
|
||
x += 180
|
||
|
||
|
||
# ------------------------------------------------------------- ausgerüstet --
|
||
|
||
func _ausgeruestet(p: Panel, figur: Dictionary) -> void:
|
||
_label(p, "AUSGERÜSTET", Vector2(40, 160),
|
||
Vector2(300, 40), UiTheme.GOLD)
|
||
|
||
var equipment: Dictionary = figur.get("equipment", {})
|
||
for i in SLOTS.size():
|
||
var slot: Dictionary = SLOTS[i]
|
||
var y := 210 + i * 100
|
||
var id := ""
|
||
if str(slot["key"]) == "shield":
|
||
if bool(equipment.get("shield", false)):
|
||
id = "schild"
|
||
else:
|
||
id = str(equipment.get(slot["key"], ""))
|
||
|
||
var ziel := DropSlot.new()
|
||
ziel.slot = str(slot["key"])
|
||
ziel.position = Vector2(40, y)
|
||
ziel.size = Vector2(64, 64)
|
||
var rahmen := StyleBoxFlat.new()
|
||
rahmen.bg_color = Color(0, 0, 0, 0)
|
||
rahmen.border_color = Color(UiTheme.LINE, 0.7)
|
||
rahmen.set_border_width_all(2)
|
||
ziel.add_theme_stylebox_override("panel", rahmen)
|
||
ziel.slot_bekommen.connect(_auf_slot)
|
||
p.add_child(ziel)
|
||
if not id.is_empty():
|
||
_icon(ziel, id, Vector2.ZERO)
|
||
_label(p, str(slot["label"]), Vector2(120, y + 12),
|
||
Vector2(260, 40), UiTheme.CREAM_D)
|
||
_label(p, _item_name(id) if not id.is_empty() else "—",
|
||
Vector2(120, y + 44), Vector2(260, 40))
|
||
|
||
if not id.is_empty():
|
||
var b := Button.new()
|
||
b.text = "Ablegen"
|
||
b.position = Vector2(400, y + 6)
|
||
b.size = Vector2(200, 52)
|
||
b.focus_mode = Control.FOCUS_NONE
|
||
b.clip_text = true
|
||
b.pressed.connect(_ablegen.bind(str(slot["key"])))
|
||
p.add_child(b)
|
||
|
||
|
||
# ---------------------------------------------------------------- Rucksack --
|
||
|
||
func _rucksack(p: Panel, figur: Dictionary) -> void:
|
||
var inventar: Array = figur.get("inventory", [])
|
||
var seiten := maxi(1, ceili(float(inventar.size()) / float(SPALTEN * ZEILEN)))
|
||
_seite = clampi(_seite, 0, seiten - 1)
|
||
|
||
_label(p, "RUCKSACK %d/%d" % [_seite + 1, seiten],
|
||
RASTER + Vector2(0, -40), Vector2(340, 40), UiTheme.GOLD)
|
||
|
||
if seiten > 1:
|
||
var zurueck := Button.new()
|
||
zurueck.text = "<"
|
||
zurueck.position = Vector2(980, 144)
|
||
zurueck.size = Vector2(72, 56)
|
||
zurueck.focus_mode = Control.FOCUS_NONE
|
||
zurueck.clip_text = true
|
||
zurueck.disabled = _seite == 0
|
||
zurueck.pressed.connect(_seite_wechseln.bind(-1))
|
||
p.add_child(zurueck)
|
||
var vor := Button.new()
|
||
vor.text = ">"
|
||
vor.position = Vector2(1060, 144)
|
||
vor.size = Vector2(72, 56)
|
||
vor.focus_mode = Control.FOCUS_NONE
|
||
vor.clip_text = true
|
||
vor.disabled = _seite >= seiten - 1
|
||
vor.pressed.connect(_seite_wechseln.bind(1))
|
||
p.add_child(vor)
|
||
|
||
for i in SPALTEN * ZEILEN:
|
||
var x := RASTER.x + (i % SPALTEN) * (KACHEL + ABSTAND)
|
||
var y := RASTER.y + (i / SPALTEN) * (KACHEL + ABSTAND)
|
||
var index := _seite * SPALTEN * ZEILEN + i
|
||
if index < inventar.size():
|
||
var eintrag = inventar[index]
|
||
var id := ""
|
||
var anzahl := 1
|
||
if typeof(eintrag) == TYPE_DICTIONARY:
|
||
id = str(eintrag.get("id", ""))
|
||
anzahl = int(eintrag.get("count", 1))
|
||
else:
|
||
id = str(eintrag)
|
||
_slot_knopf(p, id, anzahl, Vector2(x, y))
|
||
else:
|
||
_leerer_slot(p, Vector2(x, y))
|
||
|
||
|
||
func _slot_knopf(p: Panel, id: String, anzahl: int, pos: Vector2) -> void:
|
||
var b := ItemSlot.new()
|
||
b.item_id = id
|
||
b.position = pos
|
||
b.size = Vector2(KACHEL, KACHEL)
|
||
b.focus_mode = Control.FOCUS_NONE
|
||
b.tooltip_text = _item_name(id)
|
||
_slot_style(b, _sel_id == id and _sel_quelle == "inventar")
|
||
b.pressed.connect(_waehlen_item.bind(id))
|
||
p.add_child(b)
|
||
|
||
var t := _item_textur(id)
|
||
if t != null:
|
||
var icon := TextureRect.new()
|
||
icon.texture = t
|
||
icon.position = Vector2(12, 6)
|
||
icon.size = Vector2(64, 64)
|
||
icon.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||
icon.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||
icon.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST
|
||
icon.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||
b.add_child(icon)
|
||
|
||
if anzahl > 1:
|
||
var zahl := Label.new()
|
||
zahl.text = str(anzahl)
|
||
zahl.position = Vector2(44, 54)
|
||
zahl.size = Vector2(40, 30)
|
||
zahl.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
||
zahl.add_theme_color_override("font_outline_color", UiTheme.INK)
|
||
zahl.add_theme_constant_override("outline_size", 6)
|
||
zahl.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||
b.add_child(zahl)
|
||
|
||
|
||
func _leerer_slot(p: Panel, pos: Vector2) -> void:
|
||
var panel := Panel.new()
|
||
panel.position = pos
|
||
panel.size = Vector2(KACHEL, KACHEL)
|
||
var sb := StyleBoxFlat.new()
|
||
sb.bg_color = Color(UiTheme.PANEL_LO, 0.7)
|
||
sb.border_color = Color(UiTheme.LINE, 0.45)
|
||
sb.set_border_width_all(2)
|
||
panel.add_theme_stylebox_override("panel", sb)
|
||
p.add_child(panel)
|
||
|
||
|
||
func _slot_style(b: Button, gewaehlt: bool) -> void:
|
||
var normal := StyleBoxFlat.new()
|
||
normal.bg_color = UiTheme.PANEL_LO
|
||
normal.border_color = UiTheme.GOLD if gewaehlt else UiTheme.LINE
|
||
normal.set_border_width_all(2)
|
||
var heiss := normal.duplicate() as StyleBoxFlat
|
||
heiss.bg_color = UiTheme.PANEL_HI
|
||
heiss.border_color = UiTheme.GOLD
|
||
b.add_theme_stylebox_override("normal", normal)
|
||
b.add_theme_stylebox_override("hover", heiss)
|
||
b.add_theme_stylebox_override("pressed", heiss)
|
||
b.add_theme_stylebox_override("focus", normal)
|
||
|
||
|
||
# ----------------------------------------------------------------- Details --
|
||
|
||
func _details(p: Panel, figur: Dictionary) -> void:
|
||
var box := Panel.new()
|
||
box.position = Vector2(640, 510)
|
||
box.size = Vector2(720, 160)
|
||
box.add_theme_stylebox_override("panel", THEME.flaeche(Color(1, 1, 1)))
|
||
p.add_child(box)
|
||
|
||
if _sel_id.is_empty():
|
||
_label(box, "Wähle einen Gegenstand.", Vector2(20, 20),
|
||
Vector2(680, 40), UiTheme.CREAM_D)
|
||
if not _meldung.is_empty():
|
||
_label(box, _meldung, Vector2(20, 80), Vector2(680, 36),
|
||
Color(0.88, 0.78, 0.55))
|
||
return
|
||
|
||
_label(box, _item_name(_sel_id), Vector2(20, 16),
|
||
Vector2(420, 40), UiTheme.GOLD)
|
||
|
||
var typ := _item_typ(_sel_id)
|
||
var item: Dictionary = Content.entry("items", _sel_id)
|
||
var beschreibung := "Sonstiges"
|
||
match typ:
|
||
"weapon":
|
||
beschreibung = "Waffe - %s" % str(item.get("damage", "?"))
|
||
"armor":
|
||
beschreibung = "Rüstung - RK +%d" % int(item.get("ac_bonus", 0))
|
||
"shield":
|
||
beschreibung = "Schild - RK +%d" % int(item.get("ac_bonus", 0))
|
||
_label(box, beschreibung, Vector2(20, 58), Vector2(420, 36), UiTheme.CREAM_D)
|
||
|
||
if _sel_quelle == "slot":
|
||
_aktions_knopf(box, "Ablegen", _ablegen.bind(_sel_id))
|
||
elif typ in ["weapon", "armor", "shield"]:
|
||
var erlaubt: bool = Game.ausruesten_erlaubt(figur, _sel_id)
|
||
if erlaubt:
|
||
_aktions_knopf(box, "Ausrüsten", _ausruesten.bind(_sel_id))
|
||
else:
|
||
_label(box, "Diese Klasse darf das nicht tragen.",
|
||
Vector2(20, 104), Vector2(560, 36), Color(0.85, 0.55, 0.42))
|
||
else:
|
||
_aktions_knopf(box, "Benutzen", _benutzen.bind(_sel_id))
|
||
|
||
var geben := Button.new()
|
||
geben.text = "Tausch"
|
||
geben.position = Vector2(450, 96)
|
||
geben.size = Vector2(250, 52)
|
||
geben.focus_mode = Control.FOCUS_NONE
|
||
geben.clip_text = true
|
||
geben.pressed.connect(_geben_panel)
|
||
box.add_child(geben)
|
||
|
||
if not _meldung.is_empty():
|
||
_label(box, _meldung, Vector2(20, 110), Vector2(420, 36),
|
||
Color(0.88, 0.78, 0.55))
|
||
|
||
|
||
func _aktions_knopf(box: Panel, text: String, cb: Callable) -> void:
|
||
var b := Button.new()
|
||
b.text = text
|
||
b.position = Vector2(450, 30)
|
||
b.size = Vector2(250, 56)
|
||
b.focus_mode = Control.FOCUS_NONE
|
||
b.clip_text = true
|
||
b.pressed.connect(cb)
|
||
box.add_child(b)
|
||
|
||
|
||
# -------------------------------------------------------------- Aktionen ----
|
||
|
||
func _waehlen_figur(index: int) -> void:
|
||
_index = index
|
||
_seite = 0
|
||
_sel_id = ""
|
||
_sel_quelle = ""
|
||
_meldung = ""
|
||
_bauen()
|
||
|
||
|
||
func _waehlen_item(id: String) -> void:
|
||
_sel_id = id
|
||
_sel_quelle = "inventar"
|
||
_meldung = ""
|
||
_bauen()
|
||
|
||
|
||
func _ausruesten(id: String) -> void:
|
||
if Game.party.is_empty():
|
||
return
|
||
if Game.ausruesten(Game.party[_index], id):
|
||
_meldung = "%s ausgerüstet." % _item_name(id)
|
||
_sel_id = ""
|
||
_sel_quelle = ""
|
||
else:
|
||
_meldung = "Nicht erlaubt oder nicht im Rucksack."
|
||
_bauen()
|
||
|
||
|
||
func _ablegen(slot: String) -> void:
|
||
if Game.party.is_empty():
|
||
return
|
||
var figur: Dictionary = Game.party[_index]
|
||
var id := ""
|
||
if slot == "shield":
|
||
id = "schild"
|
||
else:
|
||
id = str(figur.get("equipment", {}).get(slot, ""))
|
||
if Game.ablegen(figur, slot):
|
||
_meldung = "%s abgelegt." % _item_name(id)
|
||
_sel_id = ""
|
||
_sel_quelle = ""
|
||
else:
|
||
_meldung = "Slot ist leer."
|
||
_bauen()
|
||
|
||
|
||
func _benutzen(id: String) -> void:
|
||
if Game.party.is_empty():
|
||
return
|
||
_meldung = Game.benutzen(Game.party[_index], id)
|
||
if Game.inventar_hat(Game.party[_index], id) <= 0:
|
||
_sel_id = ""
|
||
_sel_quelle = ""
|
||
_bauen()
|
||
|
||
|
||
func _seite_wechseln(delta: int) -> void:
|
||
_seite += delta
|
||
_bauen()
|
||
|
||
|
||
func _geben_drop(index: int, id: String) -> void:
|
||
_sel_id = id
|
||
_sel_quelle = "inventar"
|
||
_geben_an(index)
|
||
|
||
|
||
func _geben_panel() -> void:
|
||
if _sel_id.is_empty() or _geben_ebene != null:
|
||
return
|
||
_geben_ebene = Control.new()
|
||
_geben_ebene.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||
_wurzel.add_child(_geben_ebene)
|
||
|
||
var dimm := UiTheme.dimmung()
|
||
dimm.color = Color(0.03, 0.02, 0.01, 0.78)
|
||
_geben_ebene.add_child(dimm)
|
||
|
||
var p := Panel.new()
|
||
p.position = Vector2(610, 340)
|
||
p.size = Vector2(700, 400)
|
||
p.add_theme_stylebox_override("panel", THEME.flaeche(Color(1, 1, 1)))
|
||
_geben_ebene.add_child(p)
|
||
|
||
var kopf := Label.new()
|
||
kopf.text = "TAUSCH"
|
||
kopf.position = Vector2(30, 24)
|
||
kopf.add_theme_color_override("font_color", UiTheme.GOLD)
|
||
p.add_child(kopf)
|
||
|
||
var gegen := Label.new()
|
||
gegen.text = _item_name(_sel_id)
|
||
gegen.position = Vector2(30, 64)
|
||
gegen.size = Vector2(620, 40)
|
||
gegen.clip_text = true
|
||
p.add_child(gegen)
|
||
|
||
for i in Game.party.size():
|
||
var b := Button.new()
|
||
var ziel: Dictionary = Game.party[i]
|
||
b.text = str(ziel.get("name", "?"))
|
||
b.position = Vector2(30 + (i % 2) * 320, 120 + (i / 2) * 72)
|
||
b.size = Vector2(300, 56)
|
||
b.focus_mode = Control.FOCUS_NONE
|
||
b.clip_text = true
|
||
b.disabled = i == _index
|
||
b.tooltip_text = "Last %d / %d" % [
|
||
Game.gewicht(ziel), Game.kapazitaet(ziel)]
|
||
b.pressed.connect(_geben_an.bind(i))
|
||
p.add_child(b)
|
||
|
||
var fallen := Button.new()
|
||
fallen.text = "Fallen lassen"
|
||
fallen.position = Vector2(30, 320)
|
||
fallen.size = Vector2(350, 56)
|
||
fallen.focus_mode = Control.FOCUS_NONE
|
||
fallen.clip_text = true
|
||
fallen.pressed.connect(_fallen_lassen)
|
||
p.add_child(fallen)
|
||
|
||
var ab := Button.new()
|
||
ab.text = "Abbrechen"
|
||
ab.position = Vector2(390, 320)
|
||
ab.size = Vector2(240, 56)
|
||
ab.focus_mode = Control.FOCUS_NONE
|
||
ab.clip_text = true
|
||
ab.pressed.connect(_geben_schliessen)
|
||
p.add_child(ab)
|
||
|
||
|
||
func _geben_an(index: int) -> void:
|
||
if index == _index or _sel_id.is_empty() or Game.party.is_empty():
|
||
return
|
||
_meldung = Game.geben(Game.party[_index], Game.party[index], _sel_id)
|
||
if Game.inventar_hat(Game.party[_index], _sel_id) <= 0:
|
||
_sel_id = ""
|
||
_sel_quelle = ""
|
||
_bauen()
|
||
|
||
|
||
func _fallen_lassen() -> void:
|
||
if _sel_id.is_empty() or Game.party.is_empty():
|
||
return
|
||
_meldung = Game.fallen_lassen(Game.party[_index], _sel_id)
|
||
if Game.inventar_hat(Game.party[_index], _sel_id) <= 0:
|
||
_sel_id = ""
|
||
_sel_quelle = ""
|
||
_bauen()
|
||
|
||
|
||
func _geben_schliessen() -> void:
|
||
if _geben_ebene != null:
|
||
_geben_ebene.queue_free()
|
||
_geben_ebene = null
|
||
|
||
|
||
func _auf_slot(slot: String, id: String) -> void:
|
||
if Game.party.is_empty():
|
||
return
|
||
var typ := _item_typ(id)
|
||
var passt: bool
|
||
if slot == "shield":
|
||
passt = typ == "shield"
|
||
else:
|
||
passt = typ == slot
|
||
if not passt:
|
||
_meldung = "Passt nicht in den Slot."
|
||
else:
|
||
var figur: Dictionary = Game.party[_index]
|
||
if Game.ausruesten(figur, id):
|
||
_meldung = "%s ausgerüstet." % _item_name(id)
|
||
_sel_id = ""
|
||
_sel_quelle = ""
|
||
else:
|
||
_meldung = "Diese Klasse darf das nicht tragen."
|
||
_bauen()
|
||
|
||
|
||
func _schliessen_knopf(p: Panel) -> void:
|
||
var b := Button.new()
|
||
b.text = "Schließen"
|
||
b.position = Vector2(1120, 680)
|
||
b.size = Vector2(240, 56)
|
||
b.focus_mode = Control.FOCUS_NONE
|
||
b.clip_text = true
|
||
b.pressed.connect(func() -> void: geschlossen.emit())
|
||
p.add_child(b)
|
||
|
||
|
||
# --------------------------------------------------------------- Bausteine --
|
||
|
||
func _label(eltern: Node, text: String, pos: Vector2,
|
||
groesse: Vector2 = Vector2(300, 40), farbe: Color = UiTheme.CREAM) -> Label:
|
||
var l := Label.new()
|
||
l.text = text
|
||
l.position = pos
|
||
l.size = groesse
|
||
l.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||
l.clip_text = true
|
||
l.add_theme_color_override("font_color", farbe)
|
||
eltern.add_child(l)
|
||
return l
|
||
|
||
|
||
func _icon(eltern: Node, id: String, pos: Vector2) -> void:
|
||
var t := _item_textur(id)
|
||
if t == null:
|
||
return
|
||
var icon := TextureRect.new()
|
||
icon.texture = t
|
||
icon.position = pos
|
||
icon.size = Vector2(64, 64)
|
||
icon.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||
icon.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||
icon.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST
|
||
icon.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||
eltern.add_child(icon)
|
||
|
||
|
||
func _item_textur(id: String) -> Texture2D:
|
||
var pfad := "res://assets/objects/item_%s_64.png" % id
|
||
if not ResourceLoader.exists(pfad):
|
||
return null
|
||
return load(pfad)
|
||
|
||
|
||
func _item_name(id: String) -> String:
|
||
if id.is_empty():
|
||
return "—"
|
||
var item: Dictionary = Content.entry("items", id)
|
||
return str(item.get("name", id))
|
||
|
||
|
||
func _item_typ(id: String) -> String:
|
||
return str(Content.entry("items", id).get("type", ""))
|
||
|
||
|
||
func _leeren(node: Node) -> void:
|
||
for kind in node.get_children():
|
||
node.remove_child(kind)
|
||
kind.queue_free()
|