in the fleet upkeep menu show the total it cost, everything presented in a nice spreadsheet #230

Closed
opened 2026-09-12 12:10:44 +00:00 by metaheavens · 1 comment
Owner
No description provided.
Author
Owner

Done in 34e2520.

Two faults, and the second is invisible from the code.

There was no total. The menu listed every berth and never added them up, so the bill had to be done in your head. There is a TOTAL row now, and the headline carries both figures — "13 ore 2 gas 5 energy EVERY 25S · 31.2 ore 4.8 gas 12.0 energy PER MINUTE" — because they answer different questions: the per-charge bill is what you watch happen, the rate is what you plan against.

The columns never aligned. Rows were one Label padded with %-16s, which lines up only in a monospace font — the theme's is CarroisGothicSC-Regular, which is proportional — with autowrap_mode = 2 on top, so a long row folded and the table lost its shape entirely. It is a real GridContainer of Label cells now.

Amounts are listed in the game's own resource order rather than the dictionary's. The screenshot showed "2 ore 1 energy" on one row above "2 gas 2 ore" on the next, which defeats the point of a column you read down.

The sheet is rebuilt only when the numbers change. BuildController refreshes this menu every frame while it is open, and rebuilding a dozen Labels per frame for figures that move every 25 seconds is what #6 and #10 are about. The test refreshes twice and asserts the same cell objects come back.

Every figure still comes from fleet_upkeep_breakdown(), the calculation the charging loop itself runs — the new total sums those same per-berth costs rather than recomputing them, so the readout cannot disagree with what is actually being taken.

Done in 34e2520. Two faults, and the second is invisible from the code. **There was no total.** The menu listed every berth and never added them up, so the bill had to be done in your head. There is a `TOTAL` row now, and the headline carries both figures — *"13 ore 2 gas 5 energy EVERY 25S · 31.2 ore 4.8 gas 12.0 energy PER MINUTE"* — because they answer different questions: the per-charge bill is what you watch happen, the rate is what you plan against. **The columns never aligned.** Rows were one `Label` padded with `%-16s`, which lines up only in a monospace font — the theme's is `CarroisGothicSC-Regular`, which is proportional — with `autowrap_mode = 2` on top, so a long row folded and the table lost its shape entirely. It is a real `GridContainer` of `Label` cells now. Amounts are listed in the game's own resource order rather than the dictionary's. The screenshot showed *"2 ore 1 energy"* on one row above *"2 gas 2 ore"* on the next, which defeats the point of a column you read down. The sheet is rebuilt **only when the numbers change**. `BuildController` refreshes this menu every frame while it is open, and rebuilding a dozen Labels per frame for figures that move every 25 seconds is what #6 and #10 are about. The test refreshes twice and asserts the same cell objects come back. Every figure still comes from `fleet_upkeep_breakdown()`, the calculation the charging loop itself runs — the new total sums those same per-berth costs rather than recomputing them, so the readout cannot disagree with what is actually being taken.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
metaheavens/spaceship#230
No description provided.