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

Project1

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

[搬运汉化] 视觉小说 自动消息

[复制链接]

Lv5.捕梦者

梦石
0
星屑
20709
在线时间
123 小时
注册时间
2019-5-18
帖子
68
跳转到指定楼层
1
发表于 2022-8-1 00:52:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
AltMenuScreen.js

//=============================================================================
// RPG Maker MZ - AutoMessage
//=============================================================================

/*:
* @target MZ
* @plugindesc 自动消息。
* @author 雪あすか
* @url https://twitter.com/askyq
*
*
* @help 它是一个自动读消息的插件。
*
* [如何使用]
*当指定编号的开关为 ON 时
*自动读消息。
*如果遇到选择项,就停在那里。
*
*
* 【利用規約】
* WTFPL
*
* 【更新履歴】
* 1.0 初版公開
*
*
* @param SwitchId
* @text 开关号码
* @desc 仅当指定编号的开关为 ON 时,才会自动发送消息。
* @type switch
* @default 0
*
* @param WaitMilliseconds
* @text 读取间隔毫秒
* @desc 指定等待的时间(以毫秒为单位)。 如果变量编号具有非零值,则忽略此设置。
* @type number
* @default 2500
*
* @param WaitMillisecondsVariableId
* @text 读取间隔毫秒-变量编号
* @desc 指定存储读取间隔(毫秒)的变量的编号。 这在值不是 0 时有效。
* @type variable
* @default 0
*/

(() => {
  const PLUGIN_NAME = 'AutoMessage';
  const params = PluginManager.parameters(PLUGIN_NAME);

  const switchId = parseInt(params.SwitchId);
  const waitMilliseconds = parseInt(params.WaitMilliseconds);
  const waitMillisecondsVariableId = parseInt(params.WaitMillisecondsVariableId);

  let isTimerFilled = false;
  let timerId = 0;

  const Window_Message_isTriggered = Window_Message.prototype.isTriggered;
  Window_Message.prototype.isTriggered = function() {
    const _isTimerFilled = isTimerFilled;
    isTimerFilled = false;
    return (
        Window_Message_isTriggered.call(this) ||
        _isTimerFilled
    );
  };

  const Window_Message_startPause = Window_Message.prototype.startPause;
  Window_Message.prototype.startPause = function() {
    Window_Message_startPause.call(this);
   
    if (switchId) {
      if ($gameSwitches.value(switchId)) {
        let time = waitMilliseconds;
        if (waitMillisecondsVariableId) {
          time = $gameVariables.value(waitMillisecondsVariableId);
        }
        timerId = setTimeout(function() {
          isTimerFilled = true;
          timerId = 0;
        }, time);
      }
    }
  };

  const Window_Message_startMessage = Window_Message.prototype.startMessage;
  Window_Message.prototype.startMessage = function() {
    if (timerId) {
      clearTimeout(timerId);
      timerId = 0;
    }

    Window_Message_startMessage.call(this);
  };
})();

评分

参与人数 1+1 收起 理由
pillow鸽鸽 + 1 精品文章

查看全部评分

Lv1.梦旅人

梦石
0
星屑
178
在线时间
12 小时
注册时间
2021-6-22
帖子
12
2
发表于 2022-8-8 22:39:08 | 只看该作者
有没有在事件中保存的功能?
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
20709
在线时间
123 小时
注册时间
2019-5-18
帖子
68
3
 楼主| 发表于 2022-8-8 23:46:52 | 只看该作者
liu7liu 发表于 2022-8-8 22:39
有没有在事件中保存的功能?

看看这个插件        https://rpg.blue/forum.php?mod=v ... p;page=1#pid2955943
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
27
在线时间
2 小时
注册时间
2022-6-28
帖子
5
4
发表于 2022-8-9 12:33:12 | 只看该作者
这个好啊,苦苦找了好久
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-11 11:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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