Addon: Leader model changer

Addon: Leader model changer 1.2

new options for config
To change the model using JS, you need to create two files and include them in modinfo:
the first one is shell.js:
JavaScript:
import LeaderSelectModelManager from '/core/ui/shell/leader-select/leader-select-model-manager.js';

LeaderSelectModelManager.modelMap = {
    ...(LeaderSelectModelManager.modelMap || {}),
    LEADER_CONFUCIUS: "CHAR_LOGIOS_ARISTOTLE"
}


second one is game.js:
JavaScript:
import LeaderModelManager from '/base-standard/ui/diplomacy/leader-model-manager.js';

LeaderModelManager.modelMap = {
    ...(LeaderModelManager.modelMap || {}),
    LEADER_CONFUCIUS: "CHAR_LOGIOS_ARISTOTLE"
}

and include files into modinfo:

XML:
<ActionGroup id="..." scope="game" criteria="always">
    <Actions>
        <UIScripts>
            <Item>ui/game.js</Item>
        </UIScripts>
    </Actions>
</ActionGroup>
<ActionGroup id="..." scope="shell" criteria="always">
    <Actions>
        <UIScripts>
            <Item>ui/shell.js</Item>
        </UIScripts>
    </Actions>
</ActionGroup>
Back
Top Bottom