Skip to content

refactor: share code and tidy the changes since 0.20 - #1333

Merged
vdmkenny merged 1 commit into
mainfrom
refactor/review-since-0.20
Oct 24, 2026
Merged

vdmkenny merged 1 commit into
mainfrom
refactor/review-since-0.20

Conversation

@vdmkenny

Copy link
Copy Markdown
Collaborator

This is a quality, deduplication and CONTRIBUTING pass over everything merged since 0.20 (#1320 to #1332).

Shared code

  • One reader for whole numbers in the mods' manifests: Crew, Tier, and a game variable's Start and Attempt. Its log message names the key and the range it takes, for example "gives Tier the value '5', which isn't a whole number from 0 to 3".
  • GameType.playerFlies says whether the player can fly a ship. main.playerShip and the manifests' check both use it, where they used to compare against two different constants.
  • layout.isPlaceholder and layout.tagName are now the one home of the rule that a name starting with an underscore is a placeholder. The mission source vocabulary, its reference and definitions writers, the game variables' and ship types' script names, and the scripts' values each spelled it out before.
  • gameflow.setFromRecords sets the game's variables for both a new campaign and each attempt.

Tidying

  • A family's two base lookups are one optional field, Spec.bases, since a family has both or neither.
  • The pause menu's frame, the restart screen's dimmed canvas and its shapes are each worked out once per draw.
  • Comments added since 0.20 are rewrapped to 100 columns, and a few sentences in the code and the guides are plainer. A list in the scripting guide no longer splits in two.

The generated references don't change. All tests pass locally.

A review of everything since 0.20 found a few rules written out in several places, and some
comments and docs that ran past 100 columns or read awkwardly.

- One reader for whole numbers in the mods' manifests (Crew, Tier, and a game variable's Start
  and Attempt). Its log message names the key and the numbers it takes.
- GameType.playerFlies says whether the player can fly a ship. The player's ship and the
  manifests' check both use it.
- layout.isPlaceholder and layout.tagName are now the one home of the rule that a name starting
  with an underscore is a placeholder. Six places used to spell it out.
- A family's two base lookups become one optional field, Spec.bases.
- A new campaign and each attempt set the game's variables through one function.
- The pause menu's frame, the restart screen's dimmed canvas and its shapes are each worked out
  once per draw.
- Comments rewrapped to 100 columns, and a few sentences in the code and the guides made plainer.
  A list in the scripting guide no longer splits in two.
@vdmkenny
vdmkenny merged commit 0981e62 into main Oct 24, 2026
4 checks passed
@vdmkenny
vdmkenny deleted the refactor/review-since-0.20 branch October 24, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant