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

[转载发布] Call menu during messages

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

    连续签到: 2 天

    [LV.7]常住居民III

    7949

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 昨天 13:50 | 显示全部楼层 |阅读模式
    CallMenu.js
    ver. 1.5
    by Krimer

    Introduction

    Call menu during messages\choices on map by pressing one of the standard menu keys ESC, X, Insert, NUM 0.

    Script
    MV version - pastebin

    Spoiler: MZ version
                    JavaScript:       
    1. /*=============================================================================
    2. *  CallMenuMZ.js
    3. *=============================================================================*/
    4. var Imported = Imported || {};
    5. Imported.CallMenuMZ = true;
    6. /*:=============================================================================
    7. * @plugindesc v1.0 Call menu during messages\choices on map by pressing one of the standard menu keys ESC, X, Insert, NUM 0. For MZ
    8. * @author Krimer
    9. * @help
    10. * If you want call menu during choices just disallow cancel in choice command.
    11. * Place this plugin below non-standard message systems or choice windows in
    12. * plugin manager for better compatibility.
    13. * =============================================================================*/
    14. /*=============================================================================*/
    15. /* Alias */
    16. var _Game_Temp_initialize_Alias = Game_Temp.prototype.initialize;
    17. Game_Temp.prototype.initialize = function() {
    18.     _Game_Temp_initialize_Alias.call(this)
    19.     this._lastSelectedChoice = null;
    20. };
    21. /* NEW */
    22. Game_Temp.prototype.setLastSelectedChoice = function(f) {
    23.     this._lastSelectedChoice = f
    24. };
    25. /* NEW */
    26. Game_Temp.prototype.getLastSelectedChoice = function() {
    27.     return this._lastSelectedChoice
    28. };
    29. /* Alias*/
    30. var _Window_ChoiceList_callOkHandler = Window_ChoiceList.prototype.callOkHandler
    31. Window_ChoiceList.prototype.callOkHandler = function() {
    32.     $gameTemp.setLastSelectedChoice(null)
    33.     _Window_ChoiceList_callOkHandler.call(this);
    34. };
    35. /* Alias */
    36. var _Window_ChoiceList_callCancelHandler = Window_ChoiceList.prototype.callCancelHandler
    37. Window_ChoiceList.prototype.callCancelHandler = function() {
    38.     $gameTemp.setLastSelectedChoice(null)
    39.     _Window_ChoiceList_callCancelHandler.call(this);
    40. };
    41. /* Alias */
    42. var _Window_ChoiceList_selectDefault = Window_ChoiceList.prototype.selectDefault
    43. Window_ChoiceList.prototype.selectDefault = function() {
    44.     if ($gameTemp.getLastSelectedChoice() !== null){
    45.         this.select($gameTemp.getLastSelectedChoice());
    46.     } else {
    47.         _Window_ChoiceList_selectDefault.call(this);
    48.     }
    49. };
    50. /* Alias*/
    51. var _Window_ChoiceList_update = Window_ChoiceList.prototype.update
    52. Window_ChoiceList.prototype.update = function() {
    53.     _Window_ChoiceList_update.call(this);
    54.      if ((Input.isTriggered('escape') || Input.isTriggered('menu') || TouchInput.isCancelled()) && $gameMessage.isBusy() && $gameSystem.isMenuEnabled()) {
    55.         $gameTemp.setLastSelectedChoice(this._index)
    56.     }
    57. };
    58. /* Alias */
    59. var _DataManager_makeSaveContents_Alias = DataManager.makeSaveContents;
    60. DataManager.makeSaveContents = function () {
    61.     var contents = _DataManager_makeSaveContents_Alias.call(this);
    62.     contents.message = $gameMessage;
    63.     return contents;
    64. };
    65. /* Alias */
    66. var _DataManager_extractSaveContents_Alias = DataManager.extractSaveContents;
    67. DataManager.extractSaveContents = function (contents) {
    68.     _DataManager_extractSaveContents_Alias.call(this, contents);
    69.     $gameMessage = contents.message;
    70.     if ($gameMessage._choices.length !== 0) {
    71.      
    72.         $gameMessage.setChoiceCallback(n => {
    73.             $gameMap._interpreter._branch[$gameMap._interpreter._indent] = n;
    74.         });
    75.     }
    76. };
    77. /* Alias */
    78. var _Scene_Map_update_Alias = Scene_Map.prototype.update;
    79. Scene_Map.prototype.update = function () {
    80.     _Scene_Map_update_Alias.call(this);
    81.     if ((Input.isTriggered('escape') || Input.isTriggered('menu') || TouchInput.isCancelled()) && $gameMessage.isBusy() && $gameSystem.isMenuEnabled()) {
    82.         this.callMenu();
    83.     }
    84. };
    85. /* OVERWRITE */
    86. Window_Message.prototype.isTriggered = function () {
    87.     return (Input.isRepeated('ok') || TouchInput.isRepeated());
    88. };
    89. /* End of File */
    90. /*=============================================================================*/
    91. [/SPOILER]
    复制代码


    Author's Notes
    I created this plugin some time ago, but it did not have own topic, so i decided to create one

    I tried to fix most compatibility problems. But tell me if you find something.

    Feel free to use it as you wish


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-31 22:40 , Processed in 0.142424 second(s), 57 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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