Game Options & Settings
Relevant source files
The following files were used as context for generating this wiki page:The "Game Options & Settings" system provides players with the ability to customize their gameplay experience, manage game data, and configure application-specific behaviors. The system is bifurcated: core gameplay settings are available in all versions of the game (web and desktop), while advanced save management and notification settings are exclusive to the Electron desktop application.
Options can be accessed through two primary mechanisms: a graphical user interface (GUI) via the "Options" modal, and a command-line interface (CLI) using the option command in the game's terminal. The settings range from simple visual toggles, like color inversion, to complex data operations like save file management and data migration.
Options Modal UI
The primary graphical interface for settings is the "Options" modal, defined in index.html. It is triggered from the "More" dropdown in the main game interface. The modal contains several sections, some of which are only visible when running in the Electron environment.
Sources: index.html:94-97, index.html:420-509
UI Access Flow
The following diagram illustrates how a user accesses the options modal.
Sources: index.html:96-97, index.html:420
Option Controls
The modal is composed of several buttons, each linked to a specific function in the game's JavaScript.
| Button Text / Icon | Element ID | Function | Environment | Source File |
|---|---|---|---|---|
| Toggle inversion | #option-inversion | Toggles the inverted class on the <body> and terminal elements. | All | app/js/options.js:10, 48-55 |
| Toggle typed effect | #option-typed | Enables or disables the character-by-character text animation. | All | app/js/options.js:14, 57-63 |
| Save now | #option-save | Manually triggers a game save. | All | app/js/options.js:22, 71-73 |
| Erase save | #option-erase | Prompts the user to erase their local save data. | All | app/js/options.js:26, 65-69 |
| Migrate localStorage | #option-migrate | Initiates migration of web-based save data to the Electron file system. | Electron | index.html:450-452 |
| Toggle Auto-load | #option-auto-load | Enables or disables automatic loading of the latest save on startup. | Electron | index.html:463-465 |
| Show Save Files | #option-save-list | Opens the Save Manager modal. | Electron | index.html:467-469 |
| Success Notifications | #option-success-notifications | Toggles notifications for successful save operations. | Electron | index.html:478-480 |
| Error Notifications | #option-error-notifications | Toggles notifications for failed save operations. | Electron | index.html:482-484 |
| Auto-save Notifications | #option-auto-save-notifications | Toggles notifications for automatic background saves. | Electron | index.html:486-488 |
| Discrete Mode | #option-discrete-mode | Toggles a mode for notifications (functionality not fully detailed in files). | Electron | index.html:495-497 |
Sources: index.html:420-509, app/js/options.js:8-31
Command-Line Interface (CLI)
Players can manage settings via the in-game terminal using the option command. This provides a text-based alternative to the GUI.
Sources: [app/js/console.js:57-66]
option Command Definition
The command is registered in the console's command list.
// app/js/console.js:57-66
{
id: 'option',
desc: 'change in-game options.',
effect: 'skidinc.options.execute',
requireArg: true,
argsType: ['base', 'string', 'string'],
supportList: true,
listExec: 'skidinc.options.list',
supportHelp: true,
helpExec: 'skidinc.options.help'
}
Command Execution Flow
The skidinc.console.parse function processes the input, validates it against the command definition, and calls the corresponding function in skidinc.options.
Available option Sub-commands
The option command requires sub-commands to function.
| Sub-command | Argument | Description |
|---|---|---|
inversion | true / false | Toggles the UI color inversion. |
typed | true / false | Toggles the text typing animation. |
save | (none) | Manually saves the game. |
erase | (none) | Erases the current save file. |
Sources: app/js/options.js:33-46
Core Gameplay Options
These settings are handled by app/js/options.js and are available in all environments. They primarily control UI appearance and basic data actions.
Event Handling
Click events for the core option buttons are bound during initialization.
// app/js/options.js:8-31
skidinc.options.init = function() {
// Toggle inversion
$('#option-inversion').on('click', function() {
skidinc.options.toggleInversion();
});
// Toggle typed.js effect
$('#option-typed').on('click', function() {
skidinc.options.toggleTyped();
});
// Erase save
$('#option-erase').on('click', function() {
skidinc.options.erase();
});
// Save now
$('#option-save').on('click', function() {
skidinc.options.save();
});
// ... Electron-specific options
};
Electron-Specific Settings
When the game runs within the Electron wrapper, additional options related to the desktop application's features become available. These are primarily managed by SaveStateManager in the renderer process.
Sources: src/renderer/save-manager.js, [index.html:448-503]
Auto-Load on Startup
This option controls whether the game automatically loads the most recent save file when the application starts.
- UI Element:
#option-auto-load - State Management: The
autoLoadEnabledproperty inSaveStateManager. - Persistence: The setting is saved to
localStorageunder the keyelectronSavePreferences.
The sequence diagram below shows how toggling this option works.
Save Notifications
The Electron version provides granular control over notifications related to the save system. The UI presents toggles for different notification types, which are managed by the NotificationManager and triggered by events from SaveStateManager and AutoSaveManager.
| Option | Element ID | Description |
|---|---|---|
| Success Notifications | #option-success-notifications | Show a notification when a save operation completes successfully. |
| Error Notifications | #option-error-notifications | Show a notification when a save operation fails. |
| Auto-save Notifications | #option-auto-save-notifications | Show a notification for periodic or quick background saves. |
Sources: index.html:476-490, [src/renderer/save-manager.js:1217-1234]
The SaveStateManager's showNotification method is overridden to route different notification types (success, error, info) to the NotificationManager, which then displays them. The UI buttons would toggle flags that determine whether these calls are made.
Sources: [src/renderer/save-manager.js:1217-1234]
Save File Management
The options modal provides a link to the "Save Manager" UI, which allows for detailed management of save files.
- UI Element:
#option-save-list - Action: Triggers the
#modal-save-managermodal. - Functionality: The UI, managed by
app/js/save-manager-ui.js, allows users to list, search, load, and delete save files by interacting with theSaveStateManager.
Sources: index.html:467-469, app/js/save-manager-ui.js
Conclusion
The game's settings architecture effectively separates universal gameplay options from advanced, environment-specific features. Core settings are managed through a straightforward module (app/js/options.js) accessible via both GUI and CLI. In the Electron environment, this is augmented by a more sophisticated SaveStateManager that interfaces with the main process to offer robust control over file operations, notifications, and application startup behavior, providing a significantly enhanced user experience for the desktop version.