Repository navigation
refactor: share code and tidy the changes since 0.20 - #1333
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a quality, deduplication and CONTRIBUTING pass over everything merged since 0.20 (#1320 to #1332).
Shared code
Crew,Tier, and a game variable'sStartandAttempt. 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.playerFliessays whether the player can fly a ship.main.playerShipand the manifests' check both use it, where they used to compare against two different constants.layout.isPlaceholderandlayout.tagNameare 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.setFromRecordssets the game's variables for both a new campaign and each attempt.Tidying
Spec.bases, since a family has both or neither.The generated references don't change. All tests pass locally.