设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 87|回复: 0

[转载发布] Game Version Display Plugin

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    7959

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    29925
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    38778

    灌水之王

    发表于 4 天前 | 显示全部楼层 |阅读模式
    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!

    Spoiler                Code:       
    1. //=============================================================================
    2. // Bluebooth Plugins - Version Display
    3. // BBS_VersionDisplay.js
    4. //=============================================================================
    5. //=============================================================================
    6. /*:
    7. * @title Version Display
    8. * @author Michael Morris (https://www.patreon.com/bluebooth)
    9. * @date May 29, 2017
    10. * @filename BBS_VersionDisplay.js
    11. * If you enjoy my work, consider supporting me on Patreon!
    12. *
    13. * https://www.patreon.com/bluebooth
    14. *
    15. * @plugindesc v1.02 Adds display of the game version to the title screen.
    16. * Special Thanks to Tsukihime for all the help.
    17. * Special Thanks to 'Ramza' Michael Sweeney for all the support.
    18. *
    19. * ============================================================================
    20. * Parameters
    21. * ============================================================================
    22. *
    23. * @param Game Version Number
    24. * @desc Game Version. Recommend using format [MILESTONE].[MAJOR].[MINOR]
    25. * Default: 1.0.0
    26. * @default 1.0.0
    27. *
    28. * @param Game Version Font
    29. * @desc Font face for the version number. Leave blank to use standard. See help.
    30. * @default
    31. *
    32. * @param Version Font Size
    33. * @desc Font size for the version number in the details window.
    34. * Default: 20
    35. * @default 20
    36. *
    37. * @param Show Version Number?
    38. * @desc true to show version number, false to hide.  Useful if you want to store version
    39. * number without showing it.
    40. * Default: true
    41. * @default true
    42. *
    43. * @param Version Text Color
    44. * @desc Version font color. Use system color name.
    45. * Leave blank to use standard color.
    46. * @default white
    47. *
    48. * @param Version Outline Color
    49. * @desc Version text outline color. Use system color name.
    50. * Leave blank to use standard.
    51. * @default black
    52. *
    53. * @param Version Outline Width
    54. * @desc Version text outline width. Use system color number, or leave blank
    55. * blank to use standard.
    56. * @default 8
    57. *
    58. * @param Title Italic
    59. * @desc Version font in Italics?      YES: true      NO: false
    60. * Default: false
    61. * @default false
    62. *
    63. * @param Version Text Max Width
    64. * @desc Max width for the game version number label.  Can contain formulae!
    65. * Default Graphics.width / 3
    66. * @default Graphics.width / 3
    67. *   
    68. * ============================================================================
    69. * Terms of Use
    70. * ============================================================================
    71. *  - Free for use in non-commercial projects and commercial products with credits
    72. *
    73. * @help
    74. * ============================================================================
    75. * Description
    76. * ============================================================================
    77. *
    78. * Adds the display of a customized version number to the Title Scene.  Exposes
    79. * a variable to get version number at any time in play.
    80. *
    81. * Use script: $gameSystem.getVersion();
    82. *
    83. * ============================================================================
    84. * Change Log
    85. * ============================================================================
    86. * 1.02 - Fixed display bug pointed out by Michael 'Ramza' Sweeney when using
    87. *          different resolutions.
    88. * 1.01 - Plugin finished.
    89. *
    90. */
    91. //=============================================================================
    92. //=============================================================================
    93. var Imported = Imported || {} ;
    94. var BBS = BBS || {};
    95. Imported.VersionDisplay = 1;
    96. BBS.VersionDisplay = BBS.VersionDisplay || {};
    97. (function() {
    98.   
    99.        //=============================================================================
    100.     // Parameter Variables
    101.     //=============================================================================
    102.     var parameters = PluginManager.parameters('BBS_VersionDisplay');
    103.     var pVersionNumber            = String(parameters['Game Version Number'] || '1.0.0');
    104.     var pVersionFont            = String(parameters['Game Version Font'] || '').trim();
    105.     var pFontSize                 = Number(parameters['Version Font Size'] || 20);
    106.     var pShowVersionNumber        = eval(String(parameters['Show Version Number?'] || 'true'));
    107.   
    108.     var pVersionTextColor        = String(parameters['Version Text Color'] || 'white');
    109.     var pVersionOutlineColor    = String(parameters['Version Outline Color'] || 'black');
    110.     var pVersionOutlineWidth    = Number(parameters['Version Outline Width'] || 8);
    111.     var pVersionItalic             = eval(String(parameters['Title Italic'] || 'false'));
    112.     var pVersionWidth            = String(parameters['Version Text Max Width'] || 'Graphics.width / 3');
    113.   
    114.     var _version = pVersionNumber;                // Track the current version of the game.
    115.     var _saveVersion = pVersionNumber;            // Track the version of the game last saved.  This can be different from current game version.
    116.     var _defaultVersion = "version 1.0.0";        // Value to use when no _version is found.
    117.   
    118.     //=============================================================================
    119.     // Game_System
    120.     //=============================================================================
    121.     Game_System.prototype.getVersion = function() {
    122.         return _version;
    123.     };
    124.   
    125.     Game_System.prototype.getSaveVersion = function() {
    126.         return _saveVersion;
    127.     };
    128.   
    129.     //=============================================================================
    130.     // Scene_Title
    131.     //=============================================================================
    132.     var BBS_VD_Scene_Title_createForeground = Scene_Title.prototype.createForeground;
    133.     Scene_Title.prototype.createForeground = function() {
    134.         BBS_VD_Scene_Title_createForeground.call(this);
    135.         if (pShowVersionNumber) {
    136.             this.drawGameVersion();
    137.         }
    138.     };
    139.     Scene_Title.prototype.drawGameVersion = function() {
    140.         var x = Graphics.width - (Graphics.width / 3) - 18;
    141.         var y = Graphics.height - 50;
    142.         var maxWidth = eval(pVersionWidth); //Graphics.width / 3;
    143.       
    144.         // Handle customization options.
    145.         this._gameTitleSprite.bitmap.fontSize = pFontSize;
    146.         this._gameTitleSprite.bitmap.fontItalic = pVersionItalic;
    147.       
    148.         if(pVersionFont !== '') {
    149.             this._gameTitleSprite.bitmap.fontFace = pVersionFont;
    150.         }
    151.         if(pVersionTextColor !== '') {
    152.             this._gameTitleSprite.bitmap.textColor = pVersionTextColor;
    153.         }
    154.         if(pVersionOutlineColor !== '') {
    155.             this._gameTitleSprite.bitmap.outlineColor = pVersionOutlineColor;
    156.         }
    157.         if(pVersionOutlineWidth !== '') {
    158.             this._gameTitleSprite.bitmap.outlineWidth = pVersionOutlineWidth;
    159.         }
    160.       
    161.         // And finally... draw
    162.         this._gameTitleSprite.bitmap.drawText(pVersionNumber, x, y, maxWidth, 48, 'right');
    163.     };
    164.   
    165.     //=============================================================================
    166.     // ConfigManager
    167.     //=============================================================================
    168.     var bbs_vd_Configmanager_makeData = ConfigManager.makeData;
    169.     ConfigManager.makeData = function() {
    170.         var config = bbs_vd_Configmanager_makeData.call(this);
    171.         config.saveVersion = _saveVersion;
    172.         return config;
    173.     };
    174.     var bbs_vd_Configmanager_applyData = ConfigManager.applyData;
    175.     ConfigManager.applyData = function(config) {
    176.         bbs_vd_Configmanager_applyData.call(this, config);
    177.         _saveVersion = this.readSaveVersion(config, 'saveVersion');
    178.     };
    179.   
    180.     ConfigManager.readSaveVersion = function(config, name) {
    181.         var value = config[name];
    182.         if (value !== undefined) {
    183.             return value;
    184.         } else {
    185.             return _defaultVersion;
    186.         }
    187.     };
    188.   
    189. })(BBS.VersionDisplay);
    190. //=============================================================================
    191. // End of File
    192. //=============================================================================
    复制代码






    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.


    本贴来自国际rpgmaker官方论坛作者:bluebooth处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/game-version-display-plugin.79411/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-1 05:47 , Processed in 0.115301 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表