-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprestart.js
33 lines (32 loc) · 1.36 KB
/
prestart.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import "./js/game/feature/quick-menu/gui/char-select-menu.js";
import "./js/game/feature/quick-menu/gui/circle-menu/char-select.js";
import "./js/game/feature/quick-menu/quick-menu-model/char-select.js";
ig.module("game.feature.player.player-skin.char-select")
.requires("game.feature.player.player-skin")
.defines(() => {
sc.PlayerSkinLibrary.inject({
updateSkinSet(skinType) {
const player = sc.model.player;
if (skinType === "Appearance" && player.name !== "Lea") {
const currentSkin = this.currentSkins[skinType];
if (currentSkin) currentSkin.clearCached();
this.currentSkins[skinType] = null;
sc.Model.notifyObserver(this, sc.SKIN_EVENT.SKIN_UPDATE, skinType);
return;
}
this.parent(skinType);
},
});
ig.Game.inject({
init() {
this.parent();
sc.Model.addObserver(sc.model.player, {
modelChanged(model, messageType) {
if (model === sc.model.player && messageType === sc.PLAYER_MSG.CONFIG_CHANGED) {
sc.playerSkins.updateSkinSet("Appearance");
}
},
});
},
});
});