- Joined
- Oct 26, 2021
- Messages
- 734
I want to replace a single function in the base code.
Base\modules\core\ui\utilities\utilities-image.js
The my replacement:
I know the code works because I can change it in the original file, and the I know the game is using my file the game now gets stuck on the loading screen.
Thanks in advance,
Base\modules\core\ui\utilities\utilities-image.js
Code:
<ImportFiles>
<!-- Replacing existing ui code or new css files (not code) -->
<Item>ui/utilities/utilities-image.js</Item>
</ImportFiles>
The my replacement:
Code:
import { Icon } from '/core/ui/utilities/utilities-image.js';
function goggles_getCivSymbolFromCivilizationType(civilization) {
const civDef = GameInfo.Civilizations.lookup(civilization);
const iconURL = UI.getIconURL(civDef.CivilizationType, "CIVILIZATION");
return iconURL;
}
Icon.prototype.getCivSymbolFromCivilizationType = goggles_getCivSymbolFromCivilizationType;
//# sourceMappingURL=file:///core/ui/utilities/utilities-image.js.map
I know the code works because I can change it in the original file, and the I know the game is using my file the game now gets stuck on the loading screen.
Thanks in advance,
Last edited: