RMMZ Little issue with Moghunter Menu Background in RMMZ.

Gigadragon78

Veteran
Veteran
Joined
Feb 2, 2019
Messages
55
Reaction score
17
First Language
Spanish
Primarily Uses
RMMV
NEVERMIND... THERE ARE OTHER ISSUES,SO I GUESS I SHOULD START LOOKING FOR A REPLACEMENT...
Sorry to bother yourselves,i have a problem with Mog Menu Background,it nearly works perfectly with MZ,except for a thing... When you close the menu a transparent window appear in the top corner of the screen. Does anyone know of to fix it? Excuse me for my bad english and greetings from Argentina.
JavaScript:
//=============================================================================
// MOG_MenuBackground.js
//=============================================================================
/*:
* @plugindesc (v1.2) O plugin permite mudar a imagem de fundo do menu.
* @author Moghunter
*
* @param Disable Scenes
* @desc Definição das cenas que terão o efeito desativado.
* Scene_Name1 , Scene_Name2 , Scene_Name3 ...
* @default Scene_Test1,Scene_Test2,Scene_Test3
*
* @param Default FileName
* @desc Definição do nome de arquivo.
* @default Pic_1
*
* @param Unique Backgrounds
* @desc Cada cena terá uma imagem diferente.
* @default false
*
* @param Sufix FileName
* @desc Definição do sufixo nos background únicos.
* @default _back
*
* @param Window Opacity
* @desc Definição da transparência da janela.
* @default 30
*
* @param Scroll X-Axis
* @desc Definição da velocidade de deslize na horizontal.
* @default 0
*
* @param Scroll Y-Axis
* @desc Definição da velocidade de deslize na vertical.
* @default 0
*
* @help
* =============================================================================
* +++ MOG - Menu Background (v1.2) +++
* By Moghunter
* https://atelierrgss.wordpress.com/
* =============================================================================
* O plugin permite mudar a imagem de fundo do menu.
* É possivel ativar uma imagem diferente para cada cena ou desativar a imagem
* de fundo em cenas especificas.
* =============================================================================
* As imagens do background deverão ficar na pasta /img/pictures/
* =============================================================================
* No caso da opção Unique Backgrounds estiver ativada cada imagem de fundo
* deverá seguir essa nomeação.
*
* SCENE_NAME + _back.png
*
* Exemplo.
*
* Scene_Menu_back.png
* Scene_Item_back.png
* Scene_Skill_back.png
* etc...
*
* =============================================================================
* PLUGIN COMMAND
* =============================================================================
* Para mudar a imagem de fundo durante o jogo use o comando abaixo.
*
* backgroundName : FILE_NAME
*
* =============================================================================
* HISTÓRICO
* =============================================================================
* v1.2 - Compatibilidade com MOG_PictureGalery.
* v1.1 - Melhoria na codificação.
*/

//=============================================================================
// ** PLUGIN PARAMETERS
//=============================================================================
  var Imported = Imported || {};
  Imported.MOG_MenuBackground = true;
  var Moghunter = Moghunter || {};

   Moghunter.parameters = PluginManager.parameters('MOG_MenuBackground');
    Moghunter.mback_fileName = String(Moghunter.parameters['Default FileName'] || "Pic_1");
    Moghunter.mback_sufixName = String(Moghunter.parameters['Sufix FileName'] || "_back");
    Moghunter.mback_selfback = String(Moghunter.parameters['Unique Backgrounds'] || "false");
    Moghunter.mback_skipscenes = Object(Moghunter.parameters['Disable Scenes'] || []);
    Moghunter.mback_ox = Number(Moghunter.parameters['Scroll X-Axis'] || 0);
    Moghunter.mback_oy = Number(Moghunter.parameters['Scroll Y-Axis'] || 0);
    Moghunter.mback_opacity = Number(Moghunter.parameters['Window Opacity'] || 30);
    SceneManager._mback             = false;
   
//=============================================================================
// ** Game_Interpreter
//=============================================================================  

//==============================
// * PluginCommand
//==============================
var _mog_menuback_pluginCommand = Game_Interpreter.prototype.pluginCommand
Game_Interpreter.prototype.pluginCommand = function(command, args) {
    _mog_menuback_pluginCommand.call(this,command, args)
    if (command === "backgroundName")  {$gameSystem._backgroundName = String(args[1])};
    return true;
};

//=============================================================================
// ** Game System
//=============================================================================

//==============================
// * Initialize
//==============================
var _mog_picture_gsys_initialize = Game_System.prototype.initialize;
Game_System.prototype.initialize = function() {
    _mog_picture_gsys_initialize.call(this);
    this._backgroundName = String(Moghunter.mback_fileName)
};

//==============================
// * Get Par Array
//==============================
Game_System.prototype.get_par_array = function(object,value,type) {
    if (value.length === 0) {return};
    var s = value.split(',');
    if (type === 0){
        for (var i = 0; i < s.length; i++) {object.push(String(s[i]));    };
    } else {
        for (var i = 0; i < s.length; i++) {object.push(Number(s[i]));    };
   };
};

//=============================================================================
// ** Window Base
//=============================================================================

//==============================
// * Update
//==============================
var _alias_mog_mback_wbase_update = Window_Base.prototype.update;
Window_Base.prototype.update = function() {
    _alias_mog_mback_wbase_update.call(this);
    if (this.needUpdateBackOpacity()) {this.updateBackgroundOpacity()};
};

//==============================
// * Need Update Back Opacity
//==============================
Window_Base.prototype.needUpdateBackOpacity = function() {
   if (!SceneManager._mback) {return false};
   return true;
};

//==============================
// * Update
//==============================
Window_Base.prototype.updateBackgroundOpacity = function() {
    this.opacity = Moghunter.mback_opacity;
};


if (Imported.MOG_TimeSystem) {
    //==============================
    // * Update
    //==============================
    var _alias_mog_mback_time_status_update = Window_Time_Status.prototype.update;
    Window_Time_Status.prototype.update = function() {
        _alias_mog_mback_time_status_update.call(this);
        if (SceneManager._mback) {this.contentsOpacity = 255;this.opacity = Moghunter.mback_opacity}
    };
};

//=============================================================================
// ** Scene MenuBase
//=============================================================================

//==============================
// * Skip Mbackground
//==============================
Scene_MenuBase.prototype.skip_mbackground = function() {
    if (!SceneManager._scene) {return false};
    this._mb_skip_scenes = [];
    $gameSystem.get_par_array(this._mb_skip_scenes, Moghunter.mback_skipscenes, 0);
       for (var i = 0; i < this._mb_skip_scenes.length; i++) {
        if (this._mb_skip_scenes[i] === SceneManager._scene.constructor.name) {return true};
    };  
    return false;
};

//==============================
// * create Background
//==============================
var _alias_mog_mback_scbase_createBackground = Scene_MenuBase.prototype.createBackground;
Scene_MenuBase.prototype.createBackground = function() {      
    _alias_mog_mback_scbase_createBackground.call(this);
    SceneManager._mback = false;
    if (!this.skip_mbackground()) {this.create_mbackground()};
};

//==============================
// * Skip Mbackground
//==============================
var _alias_mog_mback_scmb_terminate = Scene_MenuBase.prototype.terminate;
Scene_MenuBase.prototype.terminate = function() {
    _alias_mog_mback_scmb_terminate.call(this);
    SceneManager._mback = false;
};

//==============================
// * Set Background Img
//==============================
Scene_MenuBase.prototype.set_background_img = function() {
    if (this._self_background && SceneManager._scene) {return SceneManager._scene.constructor.name + String(Moghunter.mback_sufixName)}
    return $gameSystem._backgroundName;
};

//==============================
// * Create Mbackground
//==============================
Scene_MenuBase.prototype.create_mbackground = function() {
    this._self_background = false;
    SceneManager._mback = true;
    if (String(Moghunter.mback_selfback) === "true") {this._self_background = true};
    this._backgroundSpriteNew = new TilingSprite();
    this._backgroundSpriteNew.move(0, 0, Graphics.width, Graphics.height);  
    this.addChild(this._backgroundSpriteNew);
    this.refreshBackgroundName();
};

//==============================
// * Update
//==============================
var _mog_mback_scbase_update = Scene_MenuBase.prototype.update;
Scene_MenuBase.prototype.update = function() {
    _mog_mback_scbase_update.call(this);
    if (this._backgroundSpriteNew) {this.update_mbackground()};  
};

//==============================
// * Refresh Background Name
//==============================
Scene_MenuBase.prototype.refreshBackgroundName = function() {
    this._backGroundName = $gameSystem._backgroundName;
    this._backgroundSpriteNew.bitmap = null;
    this._backImg = ImageManager.loadPicture(this.set_background_img());
};

//==============================
// * Refresh Background Bitmap
//==============================
Scene_MenuBase.prototype.refreshBackgroundBitmap = function() {
    this._backgroundSpriteNew.bitmap = this._backImg;
    this._backgroundSpriteNew.scale.x = Graphics.boxWidth / this._backImg.width;
    this._backgroundSpriteNew.scale.y = Graphics.boxHeight / this._backImg.height;
    this._backgroundSpriteNew.move(0, 0, this._backImg.width, this._backImg.height);  
};

//==============================
// * Update MBackground
//==============================
Scene_MenuBase.prototype.update_mbackground = function() {
    if ($gameSystem._backgroundName != this._backGroundName) {this.refreshBackgroundName()};
    if (!this._backgroundSpriteNew.bitmap && this._backImg.isReady()) {this.refreshBackgroundBitmap()};
    this._backgroundSpriteNew.origin.x += Moghunter.mback_ox;
    this._backgroundSpriteNew.origin.y += Moghunter.mback_oy;
    if (this._backgroundSprite) {this._backgroundSprite.opacity = 0};
};
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

I've been working on some ABS team A.I. for 'A New Suburbia', and thought I'd share.

I'm generally quite please although the AI is a little grenade heavy right now :rolleyes: - Sneaking and stalking next! Please excuse the terrible map... it was just for ease of viewing!
Voting for the second round of the Map Madness Tournament is now live! Vote for your favorite in each matchup! https://forums.rpgmakerweb.com/index.php?forums/map-madness-2021-polls.187/
Just bought the Visustella All Waves bundle... Time to go IN!!
Oh, I was just confirmed I'll be doing small online classes during june - july, on one side I'm nervous and looking forward it, on the other one: I've became the very thing I swore to destroy. :kaodes:
Work starts today at 2pm. I hate jeans, but the dress code says I have to wear them... That's how I discovered I was a plus size. Shopping for my first pair of jeans.
Anyhow, I'll post a new video on TheDazzlingsAreBack as soon as I'm able to.

Forum statistics

Threads
110,576
Messages
1,054,325
Members
143,689
Latest member
Twin_A
Top