Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Force Memao sprite rebuild when event changes page or image
- const _Memao_Game_Event_refresh = Game_Event.prototype.refresh;
- Game_Event.prototype.refresh = function() {
- _Memao_Game_Event_refresh.call(this);
- const page = this.page();
- const image = page ? page.image : null;
- const name = image?.characterName || "";
- const isMemao = name.toLowerCase().endsWith("_$(memao)");
- // --- Normal event: do nothing ---
- if (!isMemao) return;
- // --- Handle Memao event logic ---
- if (!page || !image.characterName) {
- // empty page → hide sprite
- this.setTransparent(true);
- this._through = true;
- // Find the sprite and visually hide it
- const scene = SceneManager._scene;
- if (scene && scene._spriteset) {
- const spriteset = scene._spriteset;
- for (const spr of spriteset._characterSprites || []) {
- if (spr && spr._character === this && spr instanceof Sprite_Memao) {
- spr.visible = false;
- }
- }
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment