Skip to content

Commit 964c0c7

Browse files
committed
feat(prefs): add more pref keys
1 parent 195b366 commit 964c0c7

File tree

1 file changed

+73
-9
lines changed

1 file changed

+73
-9
lines changed

electron/main/preference/types.ts

+73-9
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,90 @@ import type { Maybe } from '../../common/types.js';
22

33
export enum PreferenceKey {
44
/**
5-
* The window zoom factor (as a percentage).
5+
* The app zoom factor (as a percentage).
6+
* Scales the entire app window, text, etc just like in a browser.
67
* 0.5 = 50%
78
* 1.0 = 100%
89
* 1.5 = 150%
910
*/
10-
WINDOW_ZOOM_FACTOR = 'window.zoomFactor',
11+
APP_ZOOM_FACTOR = 'app.zoomFactor',
1112
/**
12-
* Whether to confirm before closing the window.
13+
* Whether to confirm before closing the app.
1314
*/
14-
WINDOW_CONFIRM_ON_CLOSE = 'window.confirmOnClose',
15+
APP_CONFIRM_CLOSE = 'app.confirmClose',
1516
/**
16-
* The maximum number of lines to keep in any game stream.
17+
* The maximum number of lines to display in each game window.
1718
*/
18-
GAME_STREAM_SCROLLBACK_BUFFER_SIZE = 'gameStream.scrollbackBufferSize',
19+
GAME_WINDOW_SCROLLBACK_BUFFER_SIZE = 'game.window.scrollbackBufferSize',
20+
/**
21+
* The character to display when the game sends a prompt.
22+
* Generally, this is the ">" character.
23+
* To disable, set to an empty string.
24+
*/
25+
GAME_WINDOW_PROMPT = 'game.window.prompt',
26+
/**
27+
* When a user submits a command, this is the separator character
28+
* that will be used to split the command into multiple commands.
29+
*
30+
* For example, if the separator is ";" and the user submits
31+
* "go bank; go window" then the app will send to the game two
32+
* commands: "go bank" and "go window".
33+
*
34+
* Success of performing the sequential commands depends on factors like
35+
* roundtime incurred, game mechanics, and the account's type-ahead limits.
36+
*/
37+
GAME_COMMAND_SEPARATOR = 'game.command.separator',
38+
/**
39+
* The minimum length of a command to save it in the command history.
40+
*/
41+
GAME_COMMAND_HISTORY_MIN_LENGTH = 'game.command.historyMinLength',
42+
/**
43+
* Absolute path to the Ruby executable.
44+
* Windows Example: "C:\path\to\Ruby4Lich\bin\ruby.exe"
45+
* macOS Example: "/path/to/.rbenv/shims/ruby"
46+
*/
47+
RUBY_PATH = 'lich.rubyPath',
48+
/**
49+
* Absolute path to the Lich executable.
50+
* Windows Example: "C:\path\to\lich\lich.rbw"
51+
* macOS Example: "/path/to/lich.rbw"
52+
*/
53+
LICH_PATH = 'lich.lichPath',
54+
/**
55+
* The arguments to pass to Lich when starting it.
56+
* Example: "--dragonrealms"
57+
*/
58+
LICH_ARGS = 'lich.lichArgs',
59+
/**
60+
* The host to connect to when starting Lich.
61+
* Example: "localhost"
62+
*/
63+
LICH_HOST = 'lich.lichHost',
64+
/**
65+
* The port to connect to when starting Lich.
66+
* Example: 11024
67+
*/
68+
LICH_PORT = 'lich.lichPort',
69+
/**
70+
* The number of seconds to wait after starting Lich before
71+
* attempting to connect to it.
72+
*/
73+
LICH_WAIT = 'lich.startWait',
1974
}
2075

2176
export type PreferenceKeyToTypeMap = {
22-
[PreferenceKey.WINDOW_ZOOM_FACTOR]: number;
23-
[PreferenceKey.WINDOW_CONFIRM_ON_CLOSE]: boolean;
24-
[PreferenceKey.GAME_STREAM_SCROLLBACK_BUFFER_SIZE]: number;
77+
[PreferenceKey.APP_ZOOM_FACTOR]: number;
78+
[PreferenceKey.APP_CONFIRM_CLOSE]: boolean;
79+
[PreferenceKey.GAME_WINDOW_SCROLLBACK_BUFFER_SIZE]: number;
80+
[PreferenceKey.GAME_WINDOW_PROMPT]: string;
81+
[PreferenceKey.GAME_COMMAND_SEPARATOR]: string;
82+
[PreferenceKey.GAME_COMMAND_HISTORY_MIN_LENGTH]: number;
83+
[PreferenceKey.RUBY_PATH]: string;
84+
[PreferenceKey.LICH_PATH]: string;
85+
[PreferenceKey.LICH_ARGS]: string;
86+
[PreferenceKey.LICH_HOST]: string;
87+
[PreferenceKey.LICH_PORT]: number;
88+
[PreferenceKey.LICH_WAIT]: number;
2589
};
2690

2791
export interface PreferenceService {

0 commit comments

Comments
 (0)