UI: the Collection card kind is now called Ledger
Code names and JSON keys stay "collection". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
16ad73adfb
commit
3cba805ec4
12 changed files with 19 additions and 21 deletions
|
|
@ -32,9 +32,9 @@ const KIND_LABELS := {
|
|||
const CHOICE_LABELS := {"pick": "Which option", "number": "How many", "text": "Open ended"}
|
||||
|
||||
|
||||
## "Roll table", "Check", "Collection", ...
|
||||
## "Roll table", "Check", "Ledger", ...
|
||||
static func kind_label(t: RollTable) -> String:
|
||||
return "Collection" if t.is_collection() else str(KIND_LABELS.get(t.kind, "Card"))
|
||||
return "Ledger" if t.is_collection() else str(KIND_LABELS.get(t.kind, "Card"))
|
||||
|
||||
|
||||
## "Which option", "How many" or "Open ended".
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ mascot (`assets/art/fortune_teller.svg`, logo variant `fortune_teller_logo.svg`,
|
|||
| Deck mode | `card_mode` |
|
||||
| Book / Page (reusable results) | `book`, `BookPage`, `TableEntry.page` |
|
||||
| Branch / Repeat (card kinds) | `router` / `loop` |
|
||||
The Collection *card kind* still needs a new UI name (not "List", not "Collection").
|
||||
| Ledger (card kind; "for the time being", user 2026-11-11) | variable card, `var_type: "collection"` |
|
||||
Card, Result, Change, Reset, Dice wording rules: `docs/HISTORY.md` §6 "Terminology".
|
||||
|
||||
## 3. Where things stand (2026-11-10)
|
||||
|
|
@ -64,8 +64,6 @@ Card, Result, Change, Reset, Dice wording rules: `docs/HISTORY.md` §6 "Terminol
|
|||
**Waiting on the user**
|
||||
- Android: export templates are installed (checksum verified); the Android SDK (build-tools,
|
||||
platform-tools) is not. Ask before downloading. No Android preset yet.
|
||||
- A UI name for the Collection card kind. User floated "Sets" (2026-11-11); it clashes with "set"
|
||||
as a verb/state ("Not set", "Set X to 7", "is set"). Alternatives offered: Roster, Ledger, Tally.
|
||||
- Thread string art (the user will draw it), then use it like `CardFrame` does for cards.
|
||||
- Repo privacy on Forgejo: needs Niles/sock's username and a token from the user.
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ A choice card stops the roll and asks the player. Add one from [b]+ Card ▾[/b]
|
|||
The question can show values, such as "Your Luck is {@luck}. What now?". Answers can be saved under a name for later. [b]Cancel[/b] in the pop-up stops the whole roll, and the pop-up can be minimized to look at the spread first.
|
||||
|
||||
## Options that come and go
|
||||
An option can have [b]Show only if[/b], so it's offered only when a condition is true, such as `@gold >= 10`. A Which option card can also build its options from a collection of values, such as every skill the character has.
|
||||
An option can have [b]Show only if[/b], so it's offered only when a condition is true, such as `@gold >= 10`. A Which option card can also build its options from a ledger of values, such as every skill the character has.
|
||||
|
||||
[b]Make Camp[/b] in the sample is a Which option card.
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ An option can have [b]Show only if[/b], so it's offered only when a condition is
|
|||
A spread can remember [b]values[/b] between rolls, such as Luck, Gold or the current town. In rules a value is written with @: `@luck`.
|
||||
- Any result can have [b]changes[/b] that happen when it comes up: [b]Add 1 to Luck[/b], [b]Subtract 3 from Gold[/b], [b]Set Town to …[/b]. Edit them in the inspector as rows, or with Edit as text.
|
||||
- A [b]Variable[/b] card gives a value a name, a type and a starting value, and shows what it is now. The sample's [b]Luck[/b] card starts at 0.
|
||||
- A [b]Collection[/b] card groups related values, such as Skills, so they can be listed and picked from together.
|
||||
- A [b]Ledger[/b] card groups related values, such as Skills, so they can be listed and picked from together.
|
||||
- The tray's [b]Variables[/b] tab shows every value, and lets you clear or reset them. [b]Reset all…[/b] puts every value back to its start.
|
||||
|
||||
## Writing changes as text
|
||||
|
|
@ -157,7 +157,7 @@ Besides roll tables and choices, [b]+ Card ▾[/b] adds:
|
|||
- [b]Repeat[/b]: repeats its Each time result a number of times, or while or until a condition holds, then runs Afterwards once.
|
||||
- [b]Branch[/b]: checks its cases from top to bottom (if, else if, otherwise) and follows the first one that's true.
|
||||
- [b]Sheet[/b]: a page of text, such as a character sheet, that always shows the current values. A roll that reaches it prints it in the tray.
|
||||
- [b]Variable[/b] and [b]Collection[/b]: see [topic]Values and changes[/topic].
|
||||
- [b]Variable[/b] and [b]Ledger[/b]: see [topic]Values and changes[/topic].
|
||||
|
||||
Use [b]Test spread[/b] to check that a spread of logic cards works. See [topic]Testing a spread[/topic].
|
||||
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ func _test_value_picker() -> void:
|
|||
_check(names.has("@skill_pilot"), "spread members with values are offered")
|
||||
_check(not names.has("@skill_*"), "spread patterns only where they fit")
|
||||
p.allow_patterns = true
|
||||
_check(p.items().any(func(it: Dictionary) -> bool: return it["name"] == "@skill_*" and it["group"] == "Collections"), "grouped under Spreads")
|
||||
_check(p.items().any(func(it: Dictionary) -> bool: return it["name"] == "@skill_*" and it["group"] == "Ledgers"), "grouped under Spreads")
|
||||
_eq(p.filtered("lu").map(func(it: Dictionary) -> String: return it["name"]), ["@luck"], "search by label")
|
||||
p.open_menu()
|
||||
await _frames()
|
||||
|
|
@ -529,7 +529,7 @@ func _test_add_kinds() -> void:
|
|||
print("+ Card ▾")
|
||||
var labels: Array = main.editing.ADD_KINDS.map(func(k: Array) -> String: return k[0])
|
||||
_check(labels.any(func(s: String) -> bool: return s.begins_with("Check")), "Check card is in the menu")
|
||||
_check(labels.any(func(s: String) -> bool: return s.begins_with("Collection")), "Spread is in the menu")
|
||||
_check(labels.any(func(s: String) -> bool: return s.begins_with("Ledger")), "Ledger is in the menu")
|
||||
_eq(main.editing._add_menu.text, "+ Card ▾", "the button reads + Card ▾")
|
||||
var c := main.editing.add_table(RollTable.KIND_CHECK)
|
||||
_check(c.kind == RollTable.KIND_CHECK and c.name == "Check" and c.entries.size() == 2, "adding a check card")
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ func _test_collection_and_inputs() -> void:
|
|||
names.append(str(m.get_meta("member")))
|
||||
_eq(names, ["@skill_athletics", "@skill_mechanic", "@skill_recon"], "members: set ones by label, then ones the rules name")
|
||||
_check(_has(skills, "Mechanic") and _has(skills, "2") and _has(skills, "—"), "members show live values")
|
||||
_check(_has(skills, "Collection · kept between rolls"), "the spread's kind line")
|
||||
_check(_has(skills, "Ledger · kept between rolls"), "the spread's kind line")
|
||||
main.persistent_vars["skill_mechanic"] = {"value": 3, "source": ""}
|
||||
main.refresh_live()
|
||||
_check(_has(skills, "3"), "values refresh live")
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ func table_summary(t: RollTable) -> String:
|
|||
return "Repeat · " + RulesView.loop_rule(t, main.data, RulesView.plain(main))
|
||||
RollTable.KIND_VARIABLE:
|
||||
if RulesView.plain(main):
|
||||
return "Collection · kept between rolls" if t.is_collection() else "%s · kept between rolls" % t.var_type.capitalize()
|
||||
return "Ledger · kept between rolls" if t.is_collection() else "%s · kept between rolls" % t.var_type.capitalize()
|
||||
return "Variable @%s · %s" % [t.var_name, t.var_type]
|
||||
RollTable.KIND_CHECK:
|
||||
return RulesView.check_line(t, main.data, RulesView.plain(main))
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ static func _options(insp: Inspector, t: RollTable, plain: bool, err: Label) ->
|
|||
var from_picker := ValuePicker.new(main, t.options_from)
|
||||
from_picker.kinds = ["collection", "list"]
|
||||
from_picker.allow_patterns = true
|
||||
from_picker.placeholder = "a collection or list"
|
||||
from_picker.placeholder = "a ledger or list"
|
||||
insp.fields["options_from"] = from_picker
|
||||
var seg := ModalCard.segmented(["Fixed list", "From a value"], 1 if dynamic else 0, func(i: int) -> void:
|
||||
if i == 0:
|
||||
|
|
@ -255,7 +255,7 @@ static func _options(insp: Inspector, t: RollTable, plain: bool, err: Label) ->
|
|||
else:
|
||||
var first := _first_source(main.data)
|
||||
if first == "":
|
||||
InspectorKit.show_error(err, "Add a collection (+ Card ▾ → Collection) or a list value first, then pick it here.")
|
||||
InspectorKit.show_error(err, "Add a ledger (+ Card ▾ → Ledger) or a list value first, then pick it here.")
|
||||
return
|
||||
InspectorKit.show_error(err, set_options(insp, first, ""))
|
||||
)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const ADD_KINDS := [
|
|||
["Repeat", RollTable.KIND_LOOP, "times", "Repeat"],
|
||||
["Branch: if / else if / otherwise", RollTable.KIND_ROUTER, "", "Branch"],
|
||||
["Variable", RollTable.KIND_VARIABLE, "number", "New variable"],
|
||||
["Collection (Skills, Contacts…)", RollTable.KIND_VARIABLE, RollTable.VAR_COLLECTION, "Skills"],
|
||||
["Ledger (Skills, Contacts…)", RollTable.KIND_VARIABLE, RollTable.VAR_COLLECTION, "Skills"],
|
||||
["Scale (ordered steps)", RollTable.KIND_VARIABLE, RollTable.VAR_SCALE, "New scale"],
|
||||
["Sheet", RollTable.KIND_SHEET, "", "Sheet"],
|
||||
]
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ func build() -> void:
|
|||
_var_name.text_changed.connect(func(_t: String) -> void: d._refresh())
|
||||
box.add_child(ModalCard.field("Variable name (used as @name)", _var_name))
|
||||
box.add_child(ModalCard.section("Type"))
|
||||
box.add_child(ModalCard.segmented(["Number", "Text", "List", "Collection", "Scale"], RollTable.VAR_TYPES.find(_var_type), func(i: int) -> void:
|
||||
box.add_child(ModalCard.segmented(["Number", "Text", "List", "Ledger", "Scale"], RollTable.VAR_TYPES.find(_var_type), func(i: int) -> void:
|
||||
_var_type = RollTable.VAR_TYPES[i]
|
||||
d._refresh()
|
||||
))
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ func _make_kind_header(_build: bool) -> Control:
|
|||
RollTable.KIND_VARIABLE:
|
||||
var txt := "@%s · %s" % [table.var_name, table.var_type]
|
||||
if table.is_collection():
|
||||
txt = "Collection · kept between rolls" if plain else "@%s_* (spread values)" % table.var_name
|
||||
txt = "Ledger · kept between rolls" if plain else "@%s_* (spread values)" % table.var_name
|
||||
elif plain:
|
||||
txt = "%s · kept between rolls" % table.var_type.capitalize()
|
||||
var l := Style.make_label(txt, Style.body(true), 12, Style.MUTED)
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ static func kind_line(t: RollTable) -> String:
|
|||
RollTable.KIND_LOOP:
|
||||
return "Repeat card"
|
||||
RollTable.KIND_VARIABLE:
|
||||
return "Collection card" if t.is_collection() else "Variable card"
|
||||
return "Ledger card" if t.is_collection() else "Variable card"
|
||||
RollTable.KIND_SHEET:
|
||||
return "Sheet card"
|
||||
RollTable.KIND_ROUTER:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ extends Button
|
|||
|
||||
signal value_chosen(name: String)
|
||||
|
||||
const GROUPS := ["", "Variables", "Collections", "Other values", "Roll values"]
|
||||
const GROUPS := ["", "Variables", "Ledgers", "Other values", "Roll values"]
|
||||
const KIND_WORDS := {"number": "number", "text": "text", "list": "list", "collection": "collection", "scale": "scale"}
|
||||
|
||||
var main: Main
|
||||
|
|
@ -108,13 +108,13 @@ func items() -> Array:
|
|||
"variable":
|
||||
g = "Variables"
|
||||
"collection":
|
||||
g = "Collections"
|
||||
g = "Ledgers"
|
||||
"chain":
|
||||
g = "Roll values"
|
||||
"input":
|
||||
g = "Roll values"
|
||||
if k.has("collection"):
|
||||
g = "Collections"
|
||||
g = "Ledgers"
|
||||
out.append({"name": n, "label": str(k["label"]), "kind": kind, "group": g})
|
||||
var ordered: Array = []
|
||||
for g: String in GROUPS:
|
||||
|
|
|
|||
Loading…
Reference in a new issue