Add boardShape to client rules editor + ability builder help docs

- rules_editor_dialog.gd: add add_option helper, boardShape OptionButton
  in BOARD section (Default/Rectangle/Cross/Triangular/RadialStar/HexRing),
  and OptionButton branch in _on_confirm
- lobby_room_screen.gd: add boardShape to both rules display dicts
- AbilityBuilder.razor: add help docs for OnUnitSentToDiscard CausedBy field
- GameDbContextModelSnapshot.cs: reflect AddBoardShapeOverride migration

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-03-26 15:01:36 -04:00
co-authored by Claude Happy
parent 766ba336ec
commit 8b0490687e
4 changed files with 55 additions and 0 deletions
@@ -40,6 +40,8 @@ func _build_fields(r: Dictionary) -> void:
return int(r[k]) if r.has(k) else d
var get_b := func(k: String, d: bool) -> bool:
return bool(r[k]) if r.has(k) else d
var get_s := func(k: String, d: String) -> String:
return str(r[k]) if r.has(k) and r[k] != null else d
var add_int := func(label: String, key: String, min_v: int, max_v: int, def_v: int, note: String) -> void:
var hbox := HBoxContainer.new()
@@ -70,6 +72,22 @@ func _build_fields(r: Dictionary) -> void:
fields_box.add_child(hbox)
_controls[key] = chk
var add_option := func(label: String, key: String, options: Array, def_v: String) -> void:
var hbox := HBoxContainer.new()
var lbl := Label.new()
lbl.text = label
lbl.size_flags_horizontal = Control.SIZE_EXPAND_FILL
hbox.add_child(lbl)
var opt := OptionButton.new()
for o in options:
opt.add_item(o)
var cur := get_s.call(key, def_v)
var idx := options.find(cur)
opt.selected = idx if idx >= 0 else 0
hbox.add_child(opt)
fields_box.add_child(hbox)
_controls[key] = opt
# ── Hand & Cards ──────────────────────────────────────────────────────────
_section("HAND & CARDS")
add_int.call("Opening Hand Size", "openingHandSize", 1, 20, 6, "")
@@ -94,6 +112,7 @@ func _build_fields(r: Dictionary) -> void:
add_int.call("Board Width", "boardWidth", 3, 12, 6, "")
add_int.call("Board Height", "boardHeight", 3, 12, 6, "")
add_int.call("Starting Tile Affinity %","startingRandomTilePct",0, 100, 0, "% of tiles with a random basic affinity")
add_option.call("Board Shape", "boardShape", ["Default", "Rectangle", "Cross", "Triangular", "RadialStar", "HexRing"], "Default")
# ── Deck ───────────────────────────────────────────────────────────────────
_section("DECK")
@@ -124,5 +143,7 @@ func _on_confirm() -> void:
overrides[key] = int(ctrl.value)
elif ctrl is CheckBox:
overrides[key] = ctrl.button_pressed
elif ctrl is OptionButton:
overrides[key] = ctrl.get_item_text(ctrl.selected)
confirmed.emit(overrides)
queue_free()