My JavaScript knowledge is rusty/intermediate.
Recently I've been spending hours trying to dissect the RPG Maker MV engine in order to fulfill this idea and after relentless trying I've hit a total brick wall in development.
What I Think I Know
After digging around I concluded that the code for the Cursor that appears over the menu is hard-coded to the point where my options are to create a new Window_Selectable class entirely or fake it by drawing a sprite over the existing cursor. I opted for the latter.
What I Am Trying To Do
I've created a Sprite object and added it as a child of the Command Window for the Title Screen, and that's about it.
The Script doesn't really work. I'm just lost.
Recently I've been spending hours trying to dissect the RPG Maker MV engine in order to fulfill this idea and after relentless trying I've hit a total brick wall in development.
What I Think I Know
After digging around I concluded that the code for the Cursor that appears over the menu is hard-coded to the point where my options are to create a new Window_Selectable class entirely or fake it by drawing a sprite over the existing cursor. I opted for the latter.
What I Am Trying To Do
- Create a Sprite object
- Add it as a child of the Command Window for the title screen
- Update its position and size along with the existing cursor.
I've created a Sprite object and added it as a child of the Command Window for the Title Screen, and that's about it.
The Script doesn't really work. I'm just lost.
JavaScript:
/*:
* @plugindesc Game Specific Modifications
* @author Best Waifu
*
* @help This plugin does not provide plugin commands.
* @help WARNING: Likely not web compatible
*/
{
// const SBL = Scene_Boot.loadSystemImages;
// Scene_Boot.loadSystemImages = function() {
// SBL.call(this);
// }
Scene_Title.prototype.create = function() {
Scene_Base.prototype.create.call(this);
this.createBackground();
this.createForeground();
this.createWindowLayer();
this.createCommandWindow();
// this.createCursorBackground();
};
// Scene_Title.prototype.createCursorBackground = function() {
// this._commandWindow.cursorBackground = new Sprite(ImageManager.loadSystem("DSCursor"));
// this._commandWindow.addChildAt(this.cursorBackground, 1);
// this._commandWindow.cursorBackground.y = 400;
// }
/* FULLSCREEN */
const FSInitStart = SceneManager.initialize;
SceneManager.initialize = function() {
FSInitStart.call(this, arguments);
Graphics._requestFullScreen();
};
Window_TitleCommand.prototype.getOrCreateCursorBG = function() {
if (!this.cursor_bg) {
this.cursor_bg = new Sprite(ImageManager.loadSystem("DSCursor"));
return this.cursor_bg;
} else {
return this.cursor_bg
}
}
Window_TitleCommand.prototype.setCursorBG = function(newCursor) {
if (!this.cursor_bg) return;
this.cursor_bg = newCursor;
}
/* CUSTOM BUTTONS */
Scene_Title.prototype.createCommandWindow = function() {
this._commandWindow = new Window_TitleCommand();
this._commandWindow.setHandler('newGame', this.commandNewGame.bind(this));
this._commandWindow.setHandler('options', this.commandOptions.bind(this));
this._commandWindow.setHandler('gameEnd',()=>{
this._commandWindow.close();
this.fadeOutAll();
SceneManager.exit();
});
this.addWindow(this._commandWindow);
this._commandWindow.addChildAt(this._commandWindow.getOrCreateCursorBG(), 1);
};
/* CURSOR */
const CUP = Window_TitleCommand.prototype.updateCursor;
Window_TitleCommand.prototype.updateCursor = function() {
CUP.call(this);
const rect = this.itemRect(this._index);
};
Window_TitleCommand.prototype.makeCommandList = function() {
this.addCommand(TextManager.newGame, 'newGame');
this.addCommand(TextManager.options, 'options');
this.addCommand(TextManager.gameEnd, 'gameEnd');
};
}