# ClientConfigV2

`com.jsmacrosce.jsmacros.client.config.ClientConfigV2`

Client-side GUI, input, and editor options registered with the client core configuration.  
 Scripts can retrieve this options object from the global config manager:  
 ```js
const ClientConfig = Java.type("com.jsmacrosce.jsmacros.client.config.ClientConfigV2");  
const options = JsMacros.getConfig().getOptions(ClientConfig);  
if (options !== null) {
  Chat.log(options.editorHistorySize);  
}
 ```

 The options object is not the global configuration itself; assigning fields does not by itself save the config or rebuild an open editor.

## Constructors

### new ClientConfigV2 {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_constructor-}

```js
new ClientConfigV2()
```

## Fields

### disableKeyWhenScreenOpen {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_disableKeyWhenScreenOpen}

```js
disableKeyWhenScreenOpen: boolean
```

Suppresses most JsMacros key-event dispatch while a screen is open; defaults to `true`.  
 Releases matching presses begun without a screen remain eligible. Disabling this option does not bypass
 the other screen filters, and this check does not prevent the preceding key-state ledger update.

### editorFont {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_editorFont}

```js
editorFont: String
```

Resource identifier string used to select the editor font; defaults to `jsmacrosce:monocraft`.

### editorHistorySize {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_editorHistorySize}

```js
editorHistorySize: int
```

Maximum undo-history entries for each newly created editor history; defaults to 20.  
 Use a positive count: zero or negative values can fail during construction or edits.  
 Existing histories keep the limit read at their construction; grouped edits may share one entry.

### editorLinterOverrides {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_editorLinterOverrides}

```js
editorLinterOverrides: Map<String, String>
```

Maps editor language identifiers to linter script paths resolved relative to the macro folder; an empty map uses built-in compilers. The language `none` bypasses overrides.

### editorSuggestions {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_editorSuggestions}

```js
editorSuggestions: boolean
```

Enables suggestion production by the built-in compiler and display of suggestions in the editor; defaults to `true`.

### editorTheme {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_editorTheme}

```js
editorTheme: Map<String, short[]>
```

Editor syntax-token colors, mapped from token names to red, green, and blue components using their low 8 bits.  
 Color arrays need at least three entries. Initially `null`; `getThemeData()` creates defaults
 and saves the config when the field is null. A supplied non-null map is reused without merging defaults.

### externalEditor {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_externalEditor}

```js
externalEditor: boolean
```

When enabled, tries the configured external command for an existing regular file; defaults to `false`.  
 A successful process start skips the internal editor; caught process-start I/O failures allow fallback.  
 This does not wait for the external process or check its exit status.

### externalEditorCommand {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_externalEditorCommand}

```js
externalEditorCommand: String
```

Command template split on whitespace before substitution, without shell-style quote parsing.  
 Supports `%File` (absolute file path), `%MacroFolder` (absolute macro folder),  
 and `%Folder` (absolute file parent). Substituted paths remain in their existing argument tokens.  
 Defaults to `code %MacroFolder %File`.

### serviceAutoReload {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_serviceAutoReload}

```js
serviceAutoReload: boolean
```

Stores whether service file-change reload processing is enabled; defaults to `false`.  
 Client startup uses this value to start the reload listener. Use `setServiceAutoReload(boolean)` to also update the current manager.

### showRunningServices {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_showRunningServices}

```js
showRunningServices: boolean
```

Controls whether service-triggered contexts are included in the running-scripts screen; defaults to `false`.  
 A new screen initializes its service checkbox from this value; changing it does not update an open screen.

### showSlotIndexes {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_showSlotIndexes}

```js
showSlotIndexes: boolean
```

Enables zero-based menu slot-list indexes in the active slots rendered by the handled-screen hook; defaults to `false`.

### sortMethod {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_sortMethod}

```js
sortMethod: Sorting.MacroSortMethod
```

Controls the ordering of macros in the GUI macro list; defaults to `Enabled`.  
 `getSortComparator()` resets a null value to `Enabled` when called.

### sortServicesMethod {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_sortServicesMethod}

```js
sortServicesMethod: Sorting.ServiceSortMethod
```

Controls the ordering of services in the GUI service list; defaults to `Enabled`.  
 `getServiceSortComparator()` resets a null value to `Enabled` when called.

## Methods

### getFonts {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_getFonts-}

```js
getFonts(): List<String>
```

Collects font resource identifiers from the client font manager.

**Returns:** a newly collected list of font resource identifier strings; order is unspecified

### getServiceSortComparator {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_getServiceSortComparator-}

```js
getServiceSortComparator(): Comparator<String>
```

Returns a new service-name comparator selected by `sortServicesMethod`; a `null` setting is reset to `Enabled`.  
 Enabled and running comparisons query the current client service manager when comparing; selection does not reorder services.

**Returns:** a new service-name comparator for the selected ordering

### getSortComparator {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_getSortComparator-}

```js
getSortComparator(): Comparator<ScriptTrigger>
```

Returns a new comparator selected by `sortMethod`; a `null` setting is reset to `Enabled`.  
 The comparator compares triggers but does not sort a collection.

**Returns:** a new macro-trigger comparator for the selected ordering

### getThemeData {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_getThemeData-}

```js
getThemeData(): Map<String, short[]>
```

Returns the editor token-color map, initializing defaults and saving the config if it is `null`.  
 The returned map is reused directly; non-null maps are not cloned, validated, or merged with defaults.

**Returns:** the live mutable token-name-to-RGB map; each color array must provide at least three components, whose low 8 bits are used

### languages {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_languages-}

```js
languages(): List<String>
```

Returns the editor's shared language-identifier list.

**Returns:** the mutable list used by the editor

### setServiceAutoReload {#com.jsmacrosce.jsmacros.client.config.ClientConfigV2_setServiceAutoReload-boolean-}

```js
setServiceAutoReload(boolean value): void
```

Stores the service auto-reload preference and starts or stops reload processing in the current client manager.

**Parameters:**
- `value`: whether to enable file-change reload processing
