扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 122|回复: 0

[转载发布] 看到了一个很不错的MV插件,有谁愿意转MZ嘛?

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    昨天 17:34
  • 签到天数: 112 天

    连续签到: 2 天

    [LV.6]常住居民II

    2332

    主题

    398

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10541
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13299

    灌水之王

    发表于 2024-2-14 17:11:58 | 显示全部楼层 |阅读模式
    我在MV的dlc目录中找到了一个名叫NovelMessage.js的插件,作用是利用开关切换全屏的对话框。
    我感觉这个插件蛮有用的,就尝试导入到MZ里面,结果发现不能用。
    因为我不懂JS,所以无能为力将其改成支持MZ的版本,所以说,有人愿意将它转成支持MZ的嘛?
    JAVASCRIPT 代码下载
    1. //=============================================================================
    2. // NovelMessage.js
    3. //=============================================================================
    4. /*:
    5. * @plugindesc Provides the full screen type message window.
    6. * @author Yoji Ojima, Sasuke KANNAZUKI
    7. *
    8. * @param Switch ID
    9. * @desc The ID of the switch to determine novel mode.
    10. * @default 11
    11. *
    12. * @help
    13. * Use control character '\F' to page break in novel mode.
    14. *
    15. * This plugin does not provide plugin commands.
    16. */
    17. /*:ja
    18. * @plugindesc 全画面型のメッセージウィンドウです。
    19. * @author Yoji Ojima, 神無月サスケ
    20. *
    21. * @param Switch ID
    22. * @desc ノベルモードにするためのスイッチのIDです。
    23. * @default 11
    24. *
    25. * @help
    26. * ノベルモードにて改ページをするには、制御文字「\F」を使用してください。
    27. *
    28. * このプラグインには、プラグインコマンドはありません。
    29. */
    30. (function(){
    31.     var parameters = PluginManager.parameters('NovelMessage');
    32.     var switchId = Number(parameters['Switch ID'] || 11);
    33.     function isNovelMode(){
    34.         return $gameSwitches.value(switchId);
    35.     };
    36.     var _Window_Message_initMembers = Window_Message.prototype.initMembers;
    37.     Window_Message.prototype.initMembers = function(){
    38.         _Window_Message_initMembers.call(this);
    39.         this._novelLineY = 0;
    40.         this._novelNewPage = true;
    41.     };
    42.     var _Window_Message_updatePlacement =
    43.             Window_Message.prototype.updatePlacement;
    44.     Window_Message.prototype.updatePlacement = function(){
    45.         if(!isNovelMode()){
    46.             this.width = this.windowWidth();
    47.             this.height = this.windowHeight();
    48.             this.x = (Graphics.boxWidth - this.width) / 2;
    49.         }
    50.         _Window_Message_updatePlacement.call(this);
    51.         if(isNovelMode()){
    52.             this.move(0, 0, Graphics.boxWidth, Graphics.boxHeight);
    53.         }
    54.         if(this.contents.height !== this.contentsHeight()){
    55.             this.contents.resize(this.contentsWidth(), this.contentsHeight());
    56.         }
    57.     };
    58.     var _Window_Message_updateBackground =
    59.             Window_Message.prototype.updateBackground;
    60.     Window_Message.prototype.updateBackground = function(){
    61.         _Window_Message_updateBackground.call(this);
    62.         if(isNovelMode()){
    63.             this.setBackgroundType(2);
    64.         }
    65.     };
    66.     var _Window_Message_onEndOfText = Window_Message.prototype.onEndOfText;
    67.     Window_Message.prototype.onEndOfText = function(){
    68.         if(isNovelMode()){
    69.             this.processNewLine(this._textState);
    70.         }
    71.         _Window_Message_onEndOfText.call(this);
    72.     };
    73.     var _Window_Message_startMessage = Window_Message.prototype.startMessage;
    74.     Window_Message.prototype.startMessage = function(){
    75.         _Window_Message_startMessage.call(this);
    76.         if(isNovelMode()){
    77.             this._textState.y = this._novelLineY;
    78.         }
    79.     };
    80.     var _Window_Message_newPage = Window_Message.prototype.newPage;
    81.     Window_Message.prototype.newPage = function(textState){
    82.         if(!isNovelMode() || this._novelNewPage){
    83.             _Window_Message_newPage.call(this, textState);
    84.             this._novelLineY = 0;
    85.             this._novelNewPage = false;
    86.         }
    87.         if(isNovelMode()){
    88.             textState.x = this.newLineX();
    89.             textState.left = this.newLineX();
    90.             textState.height = this.calcTextHeight(textState, false);
    91.             this._lineShowFast = false;
    92.             this._pauseSkip = false;
    93.             if(this.needsNewPage(textState)){
    94.                 textState.y = this.contents.height;
    95.                 this._novelNewPage = true;
    96.                 this._textState.index--;
    97.                 this.startPause();
    98.             }
    99.         }
    100.     };
    101.     var _Window_Message_processNewLine = Window_Message.prototype.processNewLine;
    102.     Window_Message.prototype.processNewLine = function(textState){
    103.         _Window_Message_processNewLine.call(this, textState);
    104.         if(isNovelMode()){
    105.             this._novelLineY = this._textState.y;
    106.         }
    107.     };
    108.     var _Window_Message_processEscapeCharacter =
    109.             Window_Message.prototype.processEscapeCharacter;
    110.     Window_Message.prototype.processEscapeCharacter = function(code, textState){
    111.         if(isNovelMode() && code === 'F'){
    112.             textState.y = this.contents.height;
    113.             this._novelNewPage = true;
    114.             return;
    115.         }
    116.         _Window_Message_processEscapeCharacter.call(this, code, textState);
    117.     };
    118.     var _Window_ChoiceList_updatePlacement =
    119.             Window_ChoiceList.prototype.updatePlacement;
    120.     Window_ChoiceList.prototype.updatePlacement = function(){
    121.         _Window_ChoiceList_updatePlacement.call(this);
    122.         if(isNovelMode()){
    123.             this.y = Graphics.boxHeight - this.height - 8;
    124.         }
    125.     };
    126.     var _Window_NumberInput_updatePlacement =
    127.             Window_NumberInput.prototype.updatePlacement;
    128.     Window_NumberInput.prototype.updatePlacement = function(){
    129.         _Window_NumberInput_updatePlacement.call(this);
    130.         if(isNovelMode()){
    131.             this.y = Graphics.boxHeight - this.height - 8;
    132.         }
    133.     };
    134.     var _Window_NumberInput_buttonY =
    135.             Window_NumberInput.prototype.buttonY;
    136.     Window_NumberInput.prototype.buttonY = function(){
    137.         if(isNovelMode()){
    138.             return0 - this._buttons[0].height - 8;
    139.         }else{
    140.             return _Window_NumberInput_buttonY.call(this);
    141.         }
    142.     };
    143. })();
    复制代码

                本帖来自P1论坛作者rkjspb,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=489063  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

    关闭

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2025-3-13 08:23 , Processed in 0.095268 second(s), 57 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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