Use Khas Fog/Lighting in the Menu

● ARCHIVED · READ-ONLY
Started by ZephyrAM 1 posts View original ↗
  1. I've been putting together a menu system that only covers part of the screen, and I really want some sort of activity going on in the background. Fog and/or lighting would really work for this, but I can't seem to get it to work. I've been focusing on Fog first, and created a new 'menu' section that's essentially a copy/change from battle to menu (Spriteset_Battle to Spriteset_Menu for instance) and while I've made the new version for every instance of battle I can find, it's not showing any result.

    The code I used is:

    Spoiler
    if (Khas.Graphics && Khas.Fog) {
    Object.defineProperty(Game_Map.prototype, 'menuFog', { get: function() { return this.menuFog; }, });

    Game_Map.prototype.initialize = function() {
    this._fog = new Game_Fog();
    this._battleFog = new Game_Fog(false);
    this._menuFog = new Game_Fog();
    this.kaf_initialize();
    };

    function Spriteset_Menu() {
    this.initialize.apply(this, arguments);
    };

    Spriteset_Menu.prototype.kg_createWeather = Spriteset_Menu.prototype.createWeather;
    Spriteset_Menu.prototype.kg_update = Spriteset_Menu.prototype.update;
    Spriteset_Menu.prototype.createWeather = function() {
    this.kg_createWeather();
    this.initializeKhasGraphics();
    };

    Spriteset_Menu.prototype.update = function() {
    this.kg_update();
    this.updateKhasGraphics();
    };

    Spriteset_Menu.prototype.khasType = function() {
    return "menu";
    };

    Spriteset_Menu.prototype.initializeKhasGraphics = function() {
    $khasGraphics.prepareScene(this);
    $khasGraphics.newScene();
    };

    Spriteset_Menu.prototype.updateKhasGraphics = function() {
    $khasGraphics.updateScene();
    };

    Spriteset_Menu.prototype.terminateKhasGraphics = function() {
    $khasGraphics.clearScene();
    };

    Spriteset_Menu.prototype.kg_terminate = Spriteset_Menu.prototype.terminate;
    Spriteset_Menu.prototype.terminate = function() {
    this.kg_terminate();
    this._spriteset.terminateKhasGraphics();
    };

    Khas_Graphics.prototype.newScene = function() {
    this.kaf_newScene();
    switch (this._spriteset.khasType()) {
    case "map":
    this._fog = new Khas_Fog($gameMap.fog);
    break;
    case "battle":
    if (Khas.Fog.Settings.AUTO_BATTLE_FOG) $gameMap.battleFog.copyFog($gameMap.fog);
    this._fog = new Khas_Fog($gameMap.battleFog);
    break;
    case "menu":
    this._fog = new Khas_Fog($gameMap.menuFog);
    break;
    };
    this._spriteset.addChild(this._fog.layerSprite);
    };
    };

    Is this something it's possible to do and I'm just missing an element? Or would this be a whole different problem to tackle?

    Appreciate any help!

    ~ Zephyr