Advertisement
Guest User

TY_FnHRemoveOverlays.js

a guest
Jan 2nd, 2025
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.    
  3.     //==========================================================
  4.         // VERSION 1.1.0 -- by Toby Yasha
  5.     //==========================================================
  6.        
  7.     // The following settings are meant to be edited by users:
  8.        
  9.     const allowFogOverlay = false;        // true | false -- DEFAULT: false
  10.     const allowDarknessOverlay = false;   // true | false -- DEFAULT: false
  11.     const allowVisibilityOverlay = false; // true | false -- DEFAULT: false
  12.    
  13.     //==========================================================
  14.         // Game Configurations -- Spriteset_Map
  15.     //==========================================================
  16.    
  17.     const TY_Spriteset_Map_initialize = Spriteset_Map.prototype.initialize;
  18.     Spriteset_Map.prototype.initialize = function() {
  19.         TY_Spriteset_Map_initialize.call(this, ...arguments);
  20.         this.disableFogOverlay();
  21.         this.disableDarknessOverlay();
  22.     };
  23.    
  24.     // Check if there are any fog layers on the map
  25.     Spriteset_Map.prototype.canDisableFogOverlay = function() {
  26.         return !allowFogOverlay && Object.keys(this.layerGraphics).length > 0;
  27.     }
  28.    
  29.     // GALV_LayerGraphics.js
  30.     Spriteset_Map.prototype.disableFogOverlay = function() {
  31.         if (this.canDisableFogOverlay()) {
  32.             if (this.layerGraphics[1]) {
  33.                 this.layerGraphics[1].visible = false;
  34.             }
  35.             if (this.layerGraphics[2]) {
  36.                 this.layerGraphics[2].visible = false;
  37.             }
  38.         }
  39.     }
  40.    
  41.     // GALV_VisibilityRange.js
  42.     const TY_Spriteset_Map_setVisibilityRange = Spriteset_Map.prototype.setVisibilityRange;
  43.     Spriteset_Map.prototype.setVisibilityRange = function(image) {
  44.         if (allowVisibilityOverlay) {
  45.             TY_Spriteset_Map_setVisibilityRange.call(this, ...arguments);
  46.         }
  47.     };
  48.  
  49.     // TerraxLighting.js
  50.     Spriteset_Map.prototype.disableDarknessOverlay = function(image) {
  51.         const value = !allowDarknessOverlay;
  52.         $gameVariables.SetStopScript(value);
  53.     };
  54.    
  55. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement