Skip to content

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 ​

new ClientConfigV2()#

Fields ​

disableKeyWhenScreenOpen ​

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 ​

editorFont: String#
Resource identifier string used to select the editor font; defaults to jsmacrosce:monocraft.

editorHistorySize ​

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 ​

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 ​

editorSuggestions: boolean#
Enables suggestion production by the built-in compiler and display of suggestions in the editor; defaults to true.

editorTheme ​

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 ​

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 ​

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 ​

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 ​

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 ​

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

sortMethod ​

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 ​

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 ​

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 ​

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 ​

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 ​

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 ​

languages(): List<String>#
Returns the editor's shared language-identifier list.
Returns: the mutable list used by the editor

setServiceAutoReload ​

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