Game Version Display Plugin

bluebooth

Veteran
Veteran
Joined
Nov 12, 2015
Messages
95
Reaction score
115
First Language
English
Primarily Uses
N/A
Version Display v1.02
Author:
Michael Morris @Blue Booth Studios


Introduction
While a small plugin, this helps give your title screen a more professional look, and helps with debugging your title. Version Display allows you to include your version number on your title screen. In addition, the variable is exposed via script, so you can access it from anywhere in your project (in case you want to display version elsewhere).

As an additional service, the current game version is saved to a separate variable (also exposed) called "saveVersion" when the game is saved. So, say a user is playing version 1.0.4 of your game, and saves the game. They quit, and download an update to your game (think beta-testers or public-release). They restart the game with the new patch - and the game version displays 1.0.5. Their save version is still 1.0.4, and in the case an error occurs due to version changes, scripting access is exposed to make comparing these two variables trivial.

You must update your game version in plugin parameters manually - versioning varies between developers, and so do the number of changes between versions. Once the change is made in plugin parameters it is universal for all new instances of play.

A number of customization parameters are available.

Features
- Adds a version display number to the title screen - used for tracking your game version, not for tracking the running version of RMMV.

- Version and saveVersion variables exposed to script access to fit any number of additional display options (i.e. on your save files, main menus, etc.).

- Version and saveVersion are tracked separately to identify potential version conflicts.

- A number of customization options are available so the version text will fit your games aesthetic.

- Fast. No performance drop was noted during tests.

- Now properly supports multiple resolutions. Width value now available as plugin parameter.

How to Use
- Copy script into your game js/plugins directory.
- Import and configure plugin. You must update your version plugin parameter manually!

Code:
//=============================================================================
// Bluebooth Plugins - Version Display
// BBS_VersionDisplay.js
//=============================================================================

//=============================================================================
 /*:
 * @title Version Display
 * @author Michael Morris (https://www.*******.com/bluebooth)
 * @date May 29, 2017
 * @filename BBS_VersionDisplay.js
 * If you enjoy my work, consider supporting me on *******!
 *
 * https://www.*******.com/bluebooth
 *
 * @plugindesc v1.02 Adds display of the game version to the title screen.
 * Special Thanks to Tsukihime for all the help.
 * Special Thanks to 'Ramza' Michael Sweeney for all the support.
 *
 * ============================================================================
 * Parameters
 * ============================================================================
 *
 * @param Game Version Number
 * @desc Game Version. Recommend using format [MILESTONE].[MAJOR].[MINOR]
 * Default: 1.0.0
 * @default 1.0.0
 *
 * @param Game Version Font
 * @desc Font face for the version number. Leave blank to use standard. See help.
 * @default
 *
 * @param Version Font Size
 * @desc Font size for the version number in the details window.
 * Default: 20
 * @default 20
 *
 * @param Show Version Number?
 * @desc true to show version number, false to hide.  Useful if you want to store version
 * number without showing it.
 * Default: true
 * @default true
 *
 * @param Version Text Color
 * @desc Version font color. Use system color name.
 * Leave blank to use standard color.
 * @default white
 *
 * @param Version Outline Color
 * @desc Version text outline color. Use system color name.
 * Leave blank to use standard.
 * @default black
 *
 * @param Version Outline Width
 * @desc Version text outline width. Use system color number, or leave blank
 * blank to use standard.
 * @default 8
 *
 * @param Title Italic
 * @desc Version font in Italics?      YES: true      NO: false
 * Default: false
 * @default false
 *
 * @param Version Text Max Width
 * @desc Max width for the game version number label.  Can contain formulae!
 * Default Graphics.width / 3
 * @default Graphics.width / 3
 *   
 * ============================================================================
 * Terms of Use
 * ============================================================================
 *  - Free for use in non-commercial projects and commercial products with credits
 *
 * @help
 * ============================================================================
 * Description
 * ============================================================================
 *
 * Adds the display of a customized version number to the Title Scene.  Exposes
 * a variable to get version number at any time in play.
 *
 * Use script: $gameSystem.getVersion();
 *
 * ============================================================================
 * Change Log
 * ============================================================================
 * 1.02 - Fixed display bug pointed out by Michael 'Ramza' Sweeney when using
 *          different resolutions.
 * 1.01 - Plugin finished.
 *
 */
//=============================================================================

//=============================================================================
var Imported = Imported || {} ;
var BBS = BBS || {};
Imported.VersionDisplay = 1;
BBS.VersionDisplay = BBS.VersionDisplay || {};

(function() {
  
       //=============================================================================
    // Parameter Variables
    //=============================================================================
    var parameters = PluginManager.parameters('BBS_VersionDisplay');
    var pVersionNumber            = String(parameters['Game Version Number'] || '1.0.0');
    var pVersionFont            = String(parameters['Game Version Font'] || '').trim();
    var pFontSize                 = Number(parameters['Version Font Size'] || 20);
    var pShowVersionNumber        = eval(String(parameters['Show Version Number?'] || 'true'));
  
    var pVersionTextColor        = String(parameters['Version Text Color'] || 'white');
    var pVersionOutlineColor    = String(parameters['Version Outline Color'] || 'black');
    var pVersionOutlineWidth    = Number(parameters['Version Outline Width'] || 8);
    var pVersionItalic             = eval(String(parameters['Title Italic'] || 'false'));
    var pVersionWidth            = String(parameters['Version Text Max Width'] || 'Graphics.width / 3');
  
    var _version = pVersionNumber;                // Track the current version of the game.
    var _saveVersion = pVersionNumber;            // Track the version of the game last saved.  This can be different from current game version.
    var _defaultVersion = "version 1.0.0";        // Value to use when no _version is found.
  
    //=============================================================================
    // Game_System
    //============================================================================= 
    Game_System.prototype.getVersion = function() {
        return _version;
    };
  
    Game_System.prototype.getSaveVersion = function() {
        return _saveVersion;
    };
  
    //=============================================================================
    // Scene_Title
    //=============================================================================
    var BBS_VD_Scene_Title_createForeground = Scene_Title.prototype.createForeground;
    Scene_Title.prototype.createForeground = function() {
        BBS_VD_Scene_Title_createForeground.call(this);
        if (pShowVersionNumber) {
            this.drawGameVersion();
        }
    };

    Scene_Title.prototype.drawGameVersion = function() {
        var x = Graphics.width - (Graphics.width / 3) - 18;
        var y = Graphics.height - 50;
        var maxWidth = eval(pVersionWidth); //Graphics.width / 3;
      
        // Handle customization options.
        this._gameTitleSprite.bitmap.fontSize = pFontSize;
        this._gameTitleSprite.bitmap.fontItalic = pVersionItalic;
      
        if(pVersionFont !== '') {
            this._gameTitleSprite.bitmap.fontFace = pVersionFont; 
        }
        if(pVersionTextColor !== '') {
            this._gameTitleSprite.bitmap.textColor = pVersionTextColor;
        }
        if(pVersionOutlineColor !== '') {
            this._gameTitleSprite.bitmap.outlineColor = pVersionOutlineColor;
        }
        if(pVersionOutlineWidth !== '') {
            this._gameTitleSprite.bitmap.outlineWidth = pVersionOutlineWidth;
        }
      
        // And finally... draw
        this._gameTitleSprite.bitmap.drawText(pVersionNumber, x, y, maxWidth, 48, 'right');
    };
  
    //=============================================================================
    // ConfigManager
    //============================================================================= 
    var bbs_vd_Configmanager_makeData = ConfigManager.makeData;
    ConfigManager.makeData = function() {
        var config = bbs_vd_Configmanager_makeData.call(this);
        config.saveVersion = _saveVersion;
        return config;
    };

    var bbs_vd_Configmanager_applyData = ConfigManager.applyData;
    ConfigManager.applyData = function(config) {
        bbs_vd_Configmanager_applyData.call(this, config);
        _saveVersion = this.readSaveVersion(config, 'saveVersion');
    };
  
    ConfigManager.readSaveVersion = function(config, name) {
        var value = config[name];
        if (value !== undefined) {
            return value;
        } else {
            return _defaultVersion;
        }
    }; 
  
})(BBS.VersionDisplay);
//=============================================================================
// End of File
//=============================================================================

Requirements
None known.

Screenshots
Coming soon!


Demo
N/A

Script


Change Log
1.02

- Fixed display bug pointed out by Michael 'Ramza' Sweeney when using
different resolutions.
- Width now plugin parameter.

1.01
- Plugin finished.


Known Bugs / TODO
Suggestions, bug reports, and feature requests are welcomed!


Compatibility Issues
None known.


Credit and Thanks
- Micheal Morris @Blue Booth Studios

Author's Notes
Free for non-commercial and commercial use as long as credit is given.
 

Attachments

Last edited:

Kane Hart

Elmlor.com
Veteran
Joined
Jun 27, 2014
Messages
656
Reaction score
166
First Language
English
Sadly was not compatible for me using YEP_CoreEngine and Just VersionDisplay. But great idea either way this kind of stuff I normally like to add. Maybe can allow the user to also add more lines to it like Game Title Alpha Version 1.0.0 and etc.
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
603
Reaction score
343
First Language
English
Primarily Uses
RMMV
Sadly was not compatible for me using YEP_CoreEngine and Just VersionDisplay. But great idea either way this kind of stuff I normally like to add. Maybe can allow the user to also add more lines to it like Game Title Alpha Version 1.0.0 and etc.
I too was having an issue with this plugin because I'd used YEP_CoreEngine to change the game resolution to be widescreen aspect ratio. I was able to fix it by changing a hardcoded value for the x position of the image it draws. Changing line 137 to read:
Code:
var x = Graphics.width - (Graphics.width / 3) -18;
Will resolve this, as it is drawing right-aligned text at the far end of a box that is being drawn over the right edge of the screen. If you added enough text to the version number, you might be able to see some of it on the edge of the screen. The author hardcoded this value as 290, which was 1/3 of the default resolution + 18 pixels, so changing it to 1/3 of the current resolution + 18 pixels makes it appear as normal.
 

Kane Hart

Elmlor.com
Veteran
Joined
Jun 27, 2014
Messages
656
Reaction score
166
First Language
English
I too was having an issue with this plugin because I'd used YEP_CoreEngine to change the game resolution to be widescreen aspect ratio. I was able to fix it by changing a hardcoded value for the x position of the image it draws. Changing line 137 to read:
Code:
var x = Graphics.width - (Graphics.width / 3) -18;
Will resolve this, as it is drawing right-aligned text at the far end of a box that is being drawn over the right edge of the screen. If you added enough text to the version number, you might be able to see some of it on the edge of the screen. The author hardcoded this value as 290, which was 1/3 of the default resolution + 18 pixels, so changing it to 1/3 of the current resolution + 18 pixels makes it appear as normal.
Thanks mate that did the trick.

My changes:
Code:
        var x = Graphics.width - 100;
        var y = Graphics.height - 50;
        var maxWidth = Graphics.width / 18;
Screenshot:
 

bluebooth

Veteran
Veteran
Joined
Nov 12, 2015
Messages
95
Reaction score
115
First Language
English
Primarily Uses
N/A
Thanks mate that did the trick.

My changes:
Code:
        var x = Graphics.width - 100;
        var y = Graphics.height - 50;
        var maxWidth = Graphics.width / 18;
Screenshot:
Hey Kane, glad you were able to get it fixed! I'll be posting a fix to the original plugin soon. My apologies, but for some reason, alerts didn't notify me about the posts here :S

**EDIT: Update is now posted **
 
Last edited:

Ally

Linked Rooms Games Founder - Fleshforward
Member
Joined
Mar 17, 2012
Messages
332
Reaction score
153
First Language
Italy
Primarily Uses
RM2k
it's compatible with the full resolution plugin?
 

bluebooth

Veteran
Veteran
Joined
Nov 12, 2015
Messages
95
Reaction score
115
First Language
English
Primarily Uses
N/A
it's compatible with the full resolution plugin?
If you mean Yanfly's Resolution Plugin, then yes! If you're referring to a different plugin, can you please provide a link?
 

Ally

Linked Rooms Games Founder - Fleshforward
Member
Joined
Mar 17, 2012
Messages
332
Reaction score
153
First Language
Italy
Primarily Uses
RM2k
If you mean Yanfly's Resolution Plugin, then yes! If you're referring to a different plugin, can you please provide a link?
Here:
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Writing out an idea for the No Travel Game Jam. I have a general plot and challenge written out, it's just a matter of filling the rest in and making it interesting.
A definite difficult time right now. How is everyone doing during this pandemic? I already have seen furloughs and layoffs.
Hollow 1977 wrote on Archeia's profile.
Hope you and your family are doing well during this difficult time. :)
My elderly neighbor whom I've been buying groceries for just got carried out of his home on a stretcher by guys with hazmat suits. Considering I've been his only point of contact for the past month it's probably safe to say my boss was right to tell me to stay home once I developed a mild cough after all.
Damn. All these new features to the forums. Takes some getting used to.

Forum statistics

Threads
95,641
Messages
930,667
Members
125,959
Latest member
LeoOtrue
Top