Skip to content

Commit

Permalink
upgrade to ccloader 3
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitmel committed Jul 11, 2020
1 parent 7ffe7e0 commit 5e6dc32
Show file tree
Hide file tree
Showing 24 changed files with 22 additions and 20 deletions.
11 changes: 11 additions & 0 deletions ccmod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"id": "world-map-overhaul",
"title": "World map overhaul",
"description": {
"en_US": "A better world map",
"ru_RU": "Улучшенная карта мира"
},
"homepage": "https://github.com/dmitmel/cc-world-map-overhaul",
"version": "1.0.2",
"prestart": "prestart.js"
}
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
8 changes: 0 additions & 8 deletions package.json

This file was deleted.

23 changes: 11 additions & 12 deletions prestart.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ ig.module('game.feature.world-map-overhaul')
'impact.base.image',
)
.defines(() => {
const ASSETS_DIR = 'media/gui/better-world-map';

const CHANGED_BUTTON_POSITIONS = {
arid: { x: 454, y: 213 },
'autumn-area': { x: 259, y: 158 },
Expand Down Expand Up @@ -59,17 +57,16 @@ ig.module('game.feature.world-map-overhaul')
posY: CROSSHAIR_SPRITE.posY,
};

sc.MapModel.inject({
initAreas() {
this.parent();
for (let [id, pos] of Object.entries(CHANGED_BUTTON_POSITIONS)) {
this.areas[id].position = pos;
}
},
ccmod.resources.jsonPatches.add('data/database.json', (data) => {
for (let [id, pos] of Object.entries(CHANGED_BUTTON_POSITIONS)) {
data.areas[id].position = pos;
}
});

sc.AreaButton.inject({
patchedGfx: new ig.Image(`${ASSETS_DIR}/patched-area-buttons.png`),
patchedGfx: new ig.Image(
'mod://world-map-overhaul/media/area-buttons.png',
),

updateDrawables(renderer) {
if (this.focus) {
Expand Down Expand Up @@ -115,7 +112,7 @@ ig.module('game.feature.world-map-overhaul')
});

sc.MapWorldMap.inject({
_seaGfx: new ig.Image(`${ASSETS_DIR}/sea.png`),
_seaGfx: new ig.Image(`mod://world-map-overhaul/media/sea.png`),
_areasGfx: [],
_areaVisitStatuses: null,

Expand All @@ -130,7 +127,9 @@ ig.module('game.feature.world-map-overhaul')
for (let [id, visited] of this._areaVisitStatuses) {
let overlayType = visited ? 'colored' : 'default';
this._areasGfx.push(
new ig.Image(`${ASSETS_DIR}/overlays/${overlayType}/${id}.png`),
new ig.Image(
`mod://world-map-overhaul/media/overlays/${overlayType}/${id}.png`,
),
);
}
this._areaVisitStatuses = null;
Expand Down

0 comments on commit 5e6dc32

Please sign in to comment.