Remember the SimpleMsgSideView plugin that programmed the Battle Log Window for RPG Maker MV to display the battle log/message as a single line message but only for the side-view battle? The OneLineBattleMessage plugin is similar to that plugin, but unlike the other plugin, the OneLineBattleMessage will work with the front-view battle and the side-view battle. Here are the screenshots of the plugin in action during the front-view battle:

Now, here are the screenshots of the plugin in action during the side-view battle:

The plugin will also let you change the message speed (from 0 to 30) as well as change the window skin image (which should be in the same graphic format as the Window image file unless you choose to have no window displayed behind the text). For the load window skin function, I created that type of function that's exclusive to the plugin. I personally don't think that there's any risk of having a complete override to the loadWindowskin function for this plugin, but just to be on the safe as you never know if someone will create a plugin that may rely on the window properties from the Battle Log Window, I decided to create a function that's not a complete override to the loadWindowskin function as a precaution against any potential conflict with other plugins. Here's the screenshot of the plugin:

The plugin is copyleft and open-source, so there's no need for you to give me credit for the plugin and you are free to modify the plugin if you wish to do so. Here's the code for the plugin:
In addition to the code, I'll be attaching the OneLineBattleMessage plugin to this post. If I notice that there's any mistake or error in the plugin that I may have overlooked, then I'll update the code and upload the plugin attachment with the fix(es).


Now, here are the screenshots of the plugin in action during the side-view battle:


The plugin will also let you change the message speed (from 0 to 30) as well as change the window skin image (which should be in the same graphic format as the Window image file unless you choose to have no window displayed behind the text). For the load window skin function, I created that type of function that's exclusive to the plugin. I personally don't think that there's any risk of having a complete override to the loadWindowskin function for this plugin, but just to be on the safe as you never know if someone will create a plugin that may rely on the window properties from the Battle Log Window, I decided to create a function that's not a complete override to the loadWindowskin function as a precaution against any potential conflict with other plugins. Here's the screenshot of the plugin:

The plugin is copyleft and open-source, so there's no need for you to give me credit for the plugin and you are free to modify the plugin if you wish to do so. Here's the code for the plugin:
JavaScript:
//=============================================================================
// OneLineBattleMessage.js
//=============================================================================
/*:
* @target MZ
* @plugindesc Displays battle log as a one-line battle message.
* @author N/A (open-source, copyleft)
*
* @help OneLineBattleMessage.js
*
* This plugin displays the battle log as a one-line battle message at the
* top window. You can change the window for the battle message.
*
* This plugin does not provide plugin commands.
*
* @param windowName
* @type string
* @default Window
* @text Window
* @desc Filename of the window for the battle message
*
* @param messageSpeed
* @type number
* @min 0
* @max 30
* @default 16
* @text Message Speed
* @desc Message Speed value (0 - 30)
*/
(() => {
//-----------------------------------------------------------------------------
// PluginManager
//
const pluginName = "OneLineBattleMessage";
const parameters = PluginManager.parameters(pluginName);
const windowName = String(parameters['windowName'] || '');
const messageSpeed = Number(parameters['messageSpeed'] || 16);
//-----------------------------------------------------------------------------
// Window_BattleLog
//
// The window for displaying battle progress. No frame is displayed, but it is
// handled as a window for convenience.
Window_BattleLog.prototype.initialize = function(rect) {
Window_Base.prototype.initialize.call(this, rect);
this.openness = 0;
this.opacity = 255;
this._lines = [];
this._methods = [];
this._waitCount = 0;
this._waitMode = "";
this._baseLineStack = [];
this._spriteset = null;
this.refresh();
};
Window_BattleLog.prototype.loadBattleLogWindowskin = function() {
this.windowskin = ImageManager.loadSystem(windowName);
};
Window_BattleLog.prototype.messageSpeed = function() {
return messageSpeed;
};
Window_BattleLog.prototype.clear = function() {
this.openness = 0;
this._lines = [];
this._baseLineStack = [];
this.refresh();
};
Window_BattleLog.prototype.addText = function(text) {
if (text) {
this.openness = 255;
this._lines.push(text);
this.refresh();
this.wait();
}
};
Window_BattleLog.prototype.refresh = function() {
this.contents.clear();
this.loadBattleLogWindowskin();
for (let i = 0; i < this._lines.length; i++) {
this.drawLineText(i);
}
};
Window_BattleLog.prototype.drawLineText = function(index) {
const rect = new Rectangle(0, 0, this.innerWidth, this.innerHeight);
this.contents.clearRect(rect.x, rect.y, rect.width, rect.height);
this.drawText(this._lines[index], rect.x, rect.y, rect.width, "center");
};
//-----------------------------------------------------------------------------
// Scene_Battle
//
// The scene class of the battle screen.
Scene_Battle.prototype.logWindowRect = function() {
const wx = 0;
const wy = 0;
const ww = Graphics.boxWidth;
const wh = this.calcWindowHeight(1, false);
return new Rectangle(wx, wy, ww, wh);
};
})();
In addition to the code, I'll be attaching the OneLineBattleMessage plugin to this post. If I notice that there's any mistake or error in the plugin that I may have overlooked, then I'll update the code and upload the plugin attachment with the fix(es).
Attachments
-
3.1 KB Views: 14