Skip to content

Commit 425cc7e

Browse files
committed
Update README.md
1 parent 690ffd3 commit 425cc7e

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,25 @@ const Opts = modmanager.registerAndGetModOptions(
294294
type: 'JSON_DATA',
295295
init: { a: 1, b: 2, c: 3 },
296296
},
297+
myInputField: {
298+
type: 'INPUT_FIELD',
299+
init: 'initial text',
300+
changeEvent() {
301+
/* optional */
302+
// code
303+
},
304+
},
305+
myValidatedInputField: {
306+
type: 'INPUT_FIELD',
307+
init: 'crossthecodes 123',
308+
changeEvent() {
309+
/* optional */
310+
// code
311+
},
312+
isValid(text) {
313+
return text.includes('crossthecodes')
314+
},
315+
},
297316
},
298317
},
299318
},
@@ -306,6 +325,8 @@ Opts.myEnum // 0 | 1
306325
Opts.mySlider // 0.8 | 0.9 | 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5
307326
// Opts.myInfo is not accessible, since it does not store data
308327
// Opts.myKeybinding is not accessible, since it does not store data
328+
Opts.myInputField // string
329+
Opts.myValidatedInputField // string
309330

310331
Opts.myNumberStorage // number
311332
Opts.myJsonStorage.a // number
@@ -321,7 +342,7 @@ Opts.myJsonStorage = { ...Opts.myJsonStorage, a: 2 }
321342
- (javascript) [cc-staircase-effect-fix](https://github.com/Unarelith/cc-staircase-effect-fix/blob/master/prestart.js) as an example of `INFO`, `CHECKBOX` and `OBJECT_SLIDER`
322343
- (typescript) [cc-fancy-crash](https://github.com/krypciak/cc-fancy-crash/blob/main/src/options.ts) as an example of `BUTTON_GROUP` and `CHECKBOX`
323344
- (typescript) [cc-record](https://github.com/krypciak/cc-record/blob/main/src/options.ts) as an example of `OBJECT_SLIDER` and `CONTROLS`
324-
- (typescript) [CCModManager](https://github.com/CCDirectLink/CCModManager/blob/master/src/options.ts) as an example of `JSON_DATA` and `BUTTON`
345+
- (typescript) [CCModManager](https://github.com/CCDirectLink/CCModManager/blob/master/src/options.ts) as an example of `JSON_DATA`, `BUTTON` and `INPUT_FIELD`
325346
- (typescript) [CrossedEyes](https://github.com/CCDirectLink/CrossedEyes/blob/master/src/options.ts) as an example of a big multi-tab menu with a custom language getter
326347

327348
#### Building CCModManager

0 commit comments

Comments
 (0)