Repository navigation
Refactor 2/6: options, setting commands and English strings by name - #97
Merged
Merged
Conversation
|
LGTM 👍 Option parsing preserves defaults and exit codes, keyboard input is consumed at the same points in the frame loop, and the 24 extracted setting commands retain their updates and saves. The shared menu helpers preserve text-field routing and grid geometry. All 1,481 English strings match their previous fields and values, including array entries and format specifiers. |
seaweeduk
force-pushed
the
refactor/wave-1
branch
from
November 22, 2026 20:14
333e557 to
fa8a120
Compare
seaweeduk
force-pushed
the
refactor/wave-0
branch
from
November 22, 2026 20:58
45cf969 to
032431c
Compare
seaweeduk
force-pushed
the
refactor/wave-1
branch
from
November 22, 2026 20:58
fa8a120 to
848682b
Compare
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.
Second layer of the structural refactor: small mechanical moves out of
main.cpp, the menu and the English strings. Nothing changes for users.Steps in this layer: A1, A2, M1, M2, D2.
main.cpp. Argument parsing, the usage text andOptionsmove tooptions.{h,cpp};main()callsparseOptions(argc, argv, opts). The keyboard's edge flags move out ofAppintoKeyboardInput, withonKeyandonCharas members that the GLFW callbacks forward to.execute. The 24 commands that only change a setting and save it move intoapplySettingCommand(command, settings), called once at the top ofexecute. Commands that also touch the player, presets, room match, foveation or a Stash connection stay where they are.filterText,setFilter,submitText,stopEditing,editingFilter) each decided which field is being typed into. They now switch on onetextTarget(), so a new field can't be forgotten in one of them.gridCellWidth()andgridRows()replace them, and the 30-pixel scroll bar allowance is nowkScrollbarRoom.kEnglishfilled about 1,480 fields by position, so one string out of place shifted every later one. It's now written like the six translations, ones.member = "…";per line, still built at compile time. At start-up the app checks that no English string is missing and names its position if one is.main.cpplinesrun()linesKnown and left as is
applySettingCommand()handles a subset and returnsfalsefor commands it doesn't own. The empty-command fast path and exhaustiveexecuteswitch come with the full command dispatch in the fourth layer.Important
AI disclosure
anthropic/claude-opus-5-5highopenai/gpt-6.2-astrahighAgent harness OpenCode 2.3.2