Before:
After:
For users:
This is a mod that works as an addon for content mods. It enables set replace/remap unit portrait.
For developers:
1. Add mod dependency to .modinfo file (Important: don't add addon source code to your mod, use it only as dependency)
2. Create ui/game.js file
3. Include game.js file into .modinfo
After:
For users:
This is a mod that works as an addon for content mods. It enables set replace/remap unit portrait.
For developers:
1. Add mod dependency to .modinfo file (Important: don't add addon source code to your mod, use it only as dependency)
XML:
<Dependencies>
<Mod id="izica-unit-portrait-visual-remaps" title="Izica's unit portrait visual remaps"/>
</Dependencies>
2. Create ui/game.js file
JavaScript:
window.UnitPortraitVisualRemaps = {
...(window.UnitPortraitVisualRemaps || {}),
'UNIT_CUSTOM': { //your unit type
unitType: 'UNIT_ARCHER',
background: "UnitPortraitsBG_UNIQUE", //"UnitPortraitsBG_UNIQUE" || "UnitPortraitsBG_BASE"
}
}
3. Include game.js file into .modinfo
XML:
<ActionGroup id="..." scope="game" criteria="always">
<Actions>
<UIScripts>
<Item>ui/game.js</Item>
</UIScripts>
</Actions>
</ActionGroup>