Skip to content

Commit 690ffd3

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

1 file changed

Lines changed: 32 additions & 6 deletions

File tree

README.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Read the in-game manual in the help menu for usage instructions.
2626
{
2727
type: 'CHECKBOX',
2828
init: true,
29-
/* optional */ changeEvent() {
29+
changeEvent() { /* optional */
3030
// code
3131
},
3232
name: 'My checkbox',
@@ -159,12 +159,12 @@ const myenum = {
159159
init: { key1: ig.KEY.I },
160160
// If false, the keybinding only works in-game
161161
// If true, the keybinding works everywhere
162-
global: false,
163-
pressEvent() {
162+
global: false, /* optional, false by default */
163+
pressEvent() { /* optional */
164164
// keybinding pressed! I will trigger only once
165165
// code
166166
},
167-
holdEvent() {
167+
holdEvent() { /* optional */
168168
// keybinding is pressed now! I will trigger every frame the key is pressed
169169
// code
170170
},
@@ -173,12 +173,38 @@ const myenum = {
173173
}
174174
```
175175

176+
### `INPUT_FIELD`
177+
178+
```javascript
179+
{
180+
type: 'INPUT_FIELD',
181+
init: 'initial text',
182+
changeEvent() { /* optional */
183+
// code
184+
}
185+
},
186+
```
187+
188+
```javascript
189+
{
190+
type: 'INPUT_FIELD',
191+
init: 'crossthecodes 123',
192+
changeEvent() { /* optional */
193+
// code
194+
},
195+
isValid(text) {
196+
return text.includes('crossthecodes')
197+
}
198+
}
199+
},
200+
```
201+
176202
### `JSON_DATA`
177203
```javascript
178204
{
179205
type: 'JSON_DATA',
180206
init: 123,
181-
/* optional */ changeEvent() {
207+
changeEvent() { /* optional */
182208
// code
183209
}
184210
}
@@ -190,7 +216,7 @@ const myenum = {
190216

191217
```javascript
192218
// for typescript:
193-
// import type * as _ from 'ccmodmanager/types/plugin'
219+
// import type {} from 'ccmodmanager/types/plugin'
194220

195221
const Opts = modmanager.registerAndGetModOptions(
196222
{

0 commit comments

Comments
 (0)