设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1428|回复: 5
打印 上一主题 下一主题

[有事请教] 请问,怎么在游戏的菜单栏里加入读档选项啊?(已解决)

[复制链接]

Lv2.观梦者

梦石
0
星屑
664
在线时间
100 小时
注册时间
2022-1-3
帖子
66
跳转到指定楼层
1
发表于 2023-1-20 18:20:21 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 ex悠米桑 于 2023-1-21 07:26 编辑

就是进行游戏的时候,我发现菜单里只有保存和退出,没有读取……如果我想SL,还得先回主界面一次……有办法在菜单里加入这个选项吗?

Lv4.逐梦者

梦石
0
星屑
5745
在线时间
414 小时
注册时间
2021-12-4
帖子
450
2
发表于 2023-1-20 21:30:58 | 只看该作者
Scene_Menu.prototype.commandGameEnd = () => SceneManager.push(Scene_Load)
我用的办法是这个,但是效果是把那个【回到标题】的作用改成了读档(这样依然还是8个选项),也就是说想回到标题必须用F5刷新页面了。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5325
在线时间
1100 小时
注册时间
2013-7-8
帖子
2005

极短23参与

3
发表于 2023-1-20 22:13:35 | 只看该作者
本帖最后由 我是大仙 于 2023-1-20 22:33 编辑

我写了一个小插件以解决这个问题。

需要注意的是,系统没有“读档”这个文本设置,你需要自己在这个插件的设置栏设置一下用来读取存档的按钮名称(Command Name)

我直接把“读取存档”这个功能加到所有按钮之后了,如果你想改到其他位置,可以参考折叠内容里的方法。

顺带一提,这个插件的文件名要是"AddLoad.js".
JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // RPG Maker MZ - AddLoad
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @target MZ
  7.  * @plugindesc AddLoad
  8.  * @author Errke
  9.  *
  10.  *
  11.  * @param LoadName
  12.  * @text Command Name
  13.  * @desc The Name of the Load Command
  14.  * @type string
  15.  *
  16.  * @help AddLoad.js
  17.  * Add a command in menu scene.
  18.  *
  19.  *
  20.  */
  21.  
  22. (() => {
  23.     const pluginName = 'AddLoad';
  24.     const parameters = PluginManager.parameters(pluginName);
  25.  
  26.     const LoadName = parameters['LoadName'] || 'load game';
  27.  
  28.     const _window_menucommand_pro = Window_MenuCommand.prototype.makeCommandList;
  29.     Window_MenuCommand.prototype.makeCommandList = function() {
  30.         _window_menucommand_pro.apply(this,arguments);
  31.         this.addLoadCommand();
  32.     };
  33.  
  34.  
  35.     Window_MenuCommand.prototype.addLoadCommand = function() {
  36.             this.addCommand(LoadName, "load", true);
  37.     };
  38.  
  39.  
  40.     //const _scene_menu_pro = Scene_Menu.prototype.createCommandWindow;
  41.         Scene_Menu.prototype.createCommandWindow = function() {
  42.             const rect = this.commandWindowRect();
  43.             const commandWindow = new Window_MenuCommand(rect);
  44.             commandWindow.setHandler("item", this.commandItem.bind(this));
  45.             commandWindow.setHandler("skill", this.commandPersonal.bind(this));
  46.             commandWindow.setHandler("equip", this.commandPersonal.bind(this));
  47.             commandWindow.setHandler("status", this.commandPersonal.bind(this));
  48.             commandWindow.setHandler("formation", this.commandFormation.bind(this));
  49.             commandWindow.setHandler("options", this.commandOptions.bind(this));
  50.             commandWindow.setHandler("save", this.commandSave.bind(this));
  51.             commandWindow.setHandler("load", this.commandLoad.bind(this));
  52.             commandWindow.setHandler("gameEnd", this.commandGameEnd.bind(this));
  53.             commandWindow.setHandler("cancel", this.popScene.bind(this));
  54.             this.addWindow(commandWindow);
  55.             this._commandWindow = commandWindow;
  56.         };
  57.  
  58.  
  59.     Scene_Menu.prototype.commandLoad = function() {
  60.         SceneManager.push(Scene_Load);
  61.     };
  62.  
  63. })();



更换按钮位置的方法

评分

参与人数 3+3 收起 理由
mina.x + 1 精品文章
indio + 1 精品文章
zxgo24 + 1 我很赞同

查看全部评分

回复 支持 4 反对 0

使用道具 举报

Lv2.观梦者

梦石
0
星屑
664
在线时间
100 小时
注册时间
2022-1-3
帖子
66
4
 楼主| 发表于 2023-1-21 07:26:30 | 只看该作者
我是大仙 发表于 2023-1-20 22:13
我写了一个小插件以解决这个问题。

需要注意的是,系统没有“读档”这个文本设置,你需要自己在这个插件的 ...

太棒了!感谢大佬!这个插件完美解决了我的问题!能自由读档这才有存档的意义嘛2333
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1928
在线时间
71 小时
注册时间
2010-8-17
帖子
55
5
发表于 2023-2-22 11:11:21 | 只看该作者
我是大仙 发表于 2023-1-20 22:13
我写了一个小插件以解决这个问题。

需要注意的是,系统没有“读档”这个文本设置,你需要自己在这个插件的 ...

谢谢大佬,我也刚好需要这个插件
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
652
在线时间
52 小时
注册时间
2022-11-3
帖子
128
6
发表于 2023-2-26 05:43:51 | 只看该作者
感谢大佬分享
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-29 04:41

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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