configuring mod Options with a dedicated Mods tab

Update 1.3.0 changed the Options screen in a way that is breaking this code. to work around the problem, you can add this block to your -options.js script before calling Options.addInitCallback for the first time. i've also sent this to the Firaxis community team to let the devs know that this is a pain point for modders.

JavaScript:
// fix Options initialization
Options.addInitCallback = function(callback) {
    if (this.optionsReInitCallbacks.length && !this.optionsInitCallbacks.length) {
        throw new Error("Options already initialized, cannot add init callback");
    }
    this.optionsInitCallbacks.push(callback);
    this.optionsReInitCallbacks.push(callback);
}
 
Back
Top Bottom