From dabeb896e8e98cb06fd35fc73d8c7a4b37c24ada Mon Sep 17 00:00:00 2001 From: type-two Date: Fri, 21 Aug 2026 13:57:00 +1000 Subject: [PATCH] Group destinations, using the format's own idea of a group Destinations were one flat list, so building a second set meant overwriting the first. They now live in named groups, listed down the left: click a group and its destinations appear. This is not a new concept bolted on. The .td5 header carries a company count with room for twelve, each with its own name and its own pointer table, the .tp5 has "Company Sum:", and TP5's manual has you create a company before you can add any destinations. A group is that company. - a saved project (.tp5) holds every group, which the old software can still open, and reloading one restores them all - a .td5 is written from the selected group, since one file is what goes on one SD card. That keeps every exported file the exact shape already proven against the bus, rather than a multi-company layout with no reference file to check against - deleting a group takes its destinations with it, so it is undoable too state.destinations and state.company are now accessors onto the active group, so everything built on the flat list keeps working untouched. Also fixes the custom sign size inputs showing when a preset was selected: .field sets display:flex, which beats the [hidden] attribute's display:none. Co-Authored-By: Claude Opus 5 --- README.md | 7 ++ app/index.html | 19 ++++- app/main.mjs | 136 +++++++++++++++++++++++------ dist/DestoGod.html | 209 ++++++++++++++++++++++++++++++++++----------- src/codec/tp5.mjs | 56 +++++++----- 5 files changed, 330 insertions(+), 97 deletions(-) diff --git a/README.md b/README.md index e9f1903..ff0e973 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,13 @@ That is what this does. ## What it does +- **Groups.** Destinations live in named groups — one per contract, depot or + bus — listed down the left; click one and its destinations appear. This is not + an invention of the editor: the file format calls them companies, holds up to + twelve, and TP5's own manual has you create one before adding any + destinations. A saved project keeps every group; a `.td5` for the bus is + written from the group you have selected, since that is what goes on one SD + card. - **Opens the files the company already has.** Drop in a `.td5` (what goes on the SD card) or a `.tp5` (the TP5 project). Drop in both and it uses the text from the project with the exact artwork from the bus file. diff --git a/app/index.html b/app/index.html index 9122362..ff09ccd 100644 --- a/app/index.html +++ b/app/index.html @@ -46,10 +46,22 @@ header{ .field{display:flex; align-items:center; gap:7px} .field label{margin:0} .field input,.field select{width:auto; min-width:120px} +/* .field sets display:flex, which beats the [hidden] default of display:none */ +#custom-size[hidden]{display:none} .spacer{flex:1} /* ---------- layout ---------- */ main{flex:1; display:grid; grid-template-columns:290px 1fr; min-height:0} +#groups{overflow-y:auto; padding:6px; max-height:34vh; flex:0 0 auto; border-bottom:1px solid var(--line)} +.grp{display:flex; align-items:center; gap:8px; padding:7px 9px; border-radius:8px; cursor:pointer; border:1px solid transparent} +.grp:hover{background:var(--panel2)} +.grp.sel{background:#20304a; border-color:#37517d} +.grp .gnm{flex:1; min-width:0; font-size:13px; font-weight:650; white-space:nowrap; overflow:hidden; text-overflow:ellipsis} +.grp .gct{font-size:10px; color:var(--dim); font-variant-numeric:tabular-nums} +.grp .del{flex:0 0 auto; width:22px; height:22px; padding:0; line-height:1; font-size:15px; border-radius:6px; + background:transparent; border:1px solid transparent; color:var(--dim); opacity:0; transition:opacity .12s ease} +.grp:hover .del,.grp.sel .del{opacity:1} +.grp .del:hover{background:#3a2226; border-color:#7d3b43; color:#ffb3b3} #sidebar{ background:var(--panel); border-right:1px solid var(--line); display:flex; flex-direction:column; min-height:0; @@ -163,7 +175,7 @@ kbd{background:#12141a; border:1px solid var(--line); border-bottom-width:2px; b
DestoGodbus destination signs
-
+