查看: 6883|回复: 3

[有事请教] 新手,看不懂限时选项的插件,请求翻译(p_q)

[复制链接]
梦石
0
星屑
104
在线时间
25 小时
注册时间
2021-1-1
回帖
2
发表于 2021-1-23 13:32:20 | 显示全部楼层 |阅读模式
悬赏20星屑已解决
就是下面这个......请问有大佬来解读一下嘛,非常感谢!
限時選擇插件
作者:Tsukimi
  1. //=============================================================================
  2. // TimeLimitedChoice.js        2017/04/02
  3. // Copyright (c) 2017 Tsukimi
  4. //=============================================================================

  5. /*:
  6. * @plugindesc 時間制限付き選択肢プレグイン
  7. * @author Tsukimi
  8. *
  9. * @help
  10. * 時間制限付き選択肢プレグイン
  11. * 作者:ツキミ
  12. *
  13. * 2018/09/17 ver 1.0.1 ツキミ式選択肢との競合を解消
  14. * 2017/05/01 ver 1.0 完成
  15. *
  16. * ***************************************************
  17. * 説明:
  18. * 次の選択肢に時間制限をかけます。
  19. * プラグインコマンドを実行して選択肢を設定した時、タイマーが自動で起動します。
  20. * 時間切れすると選択ウィンドウが消え、[キャンセルのとき]
  21. * のイベントコマンドを実行します。
  22. *
  23. * ※ 選択肢の表示の設定の中の、キャンセルを[分岐]にしてください。
  24. *
  25. * ※ 必ずしもプラグインコマンドの直後に選択肢を設定する必要がありません。
  26. * オススメの設定方法は:
  27. * ◆プラグインコマンド:TLChoice 300
  28. * ◆文章:~~~~~
  29. * ◆選択肢の表示:~~~~~
  30. *
  31. *
  32. * ***************************************************
  33. * プラグインコマンド:
  34. *  イベントコマンド「プラグインコマンド」から実行。
  35. *  (パラメータの間は半角スペースで区切る)
  36. *
  37. * TLChoice [フレーム数]
  38. *   次の選択肢表示に時間制限をかける(1秒=60フレーム)
  39. *   例: TLChoice 600
  40. *   ※次の選択肢にだけ効果があります。連続で使用したい場合、
  41. *   各[選択肢の表示]コマンドの前にもう一度このコマンドを行ってください。
  42. *
  43. *
  44. * 作者のサイト: http://tsukimitsf.blog.fc2.com/
  45. * バグなどがあったら、是非こちらへご一報ください。ありがとうございます。
  46. */

  47. var Imported = Imported || {};

  48. (function(_global) {
  49.           // ここにプラグイン処理を記載
  50.    
  51.     var _Game_Timer_onExpire = Game_Timer.prototype.onExpire;
  52.     Game_Timer.prototype.onExpire = function() {
  53.         _Game_Timer_onExpire.call(this);
  54.         var cw = SceneManager._scene._messageWindow._choiceWindow;
  55.         if(!!cw._timeLimit && !!cw._TLStarted) {
  56.             cw._timeLimit = false;
  57.             cw._TLStarted = false;
  58.             // processCancel, without sound
  59.             cw.updateInputData();
  60.             cw.deactivate();
  61.             cw.callCancelHandler();
  62.             // end
  63.             this.stop();
  64.         }
  65.     }
  66.     if(Imported.TKM_ChoiceList) {
  67.         var _Window_TKMChoiceList_oked = Window_TKMChoiceList.prototype.oked;
  68.         Window_TKMChoiceList.prototype.oked = function() {
  69.             _Window_TKMChoiceList_oked.call(this);
  70.             if(!!this._timeLimit) {
  71.                 this._timeLimit = false;
  72.                 this._TLStarted = false;
  73.                 $gameTimer.stop();
  74.             }
  75.         };
  76.     } else {
  77.         var _Window_ChoiceList_callOkHandler = Window_ChoiceList.prototype.callOkHandler;
  78.         Window_ChoiceList.prototype.callOkHandler = function() {
  79.             _Window_ChoiceList_callOkHandler.call(this);
  80.             if(!!this._timeLimit) {
  81.                 this._timeLimit = false;
  82.                 this._TLStarted = false;
  83.                 $gameTimer.stop();
  84.             }
  85.         }
  86.     }
  87.    
  88.     var _Window_ChoiceList_start = Window_ChoiceList.prototype.start;
  89.     Window_ChoiceList.prototype.start = function() {
  90.         _Window_ChoiceList_start.call(this);
  91.         if(!!this._timeLimit) {
  92.             this._TLStarted = true;
  93.             $gameTimer.start(this._limitedTime || 300);
  94.         }
  95.     }
  96.    
  97.     var _Window_ChoiceList_isCancelEnabled = Window_ChoiceList.prototype.isCancelEnabled;
  98.     Window_ChoiceList.prototype.isCancelEnabled = function() {
  99.         var normal = _Window_ChoiceList_isCancelEnabled.call(this);
  100.         if(!!this._timeLimit) return false;
  101.         else return normal;
  102.     }
  103.    
  104.    
  105.     var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  106.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  107.         _Game_Interpreter_pluginCommand.call(this, command, args);
  108.         switch(command) {
  109.             case "TLChoice":
  110.                var cw = SceneManager._scene._messageWindow._choiceWindow;
  111.                 cw._timeLimit = true;
  112.                 if(!args) cw._limitedTime = 300;
  113.                 else if(parseInt(args[0]) == 0) cw._limitedTime = 300;
  114.                 else cw._limitedTime = parseInt(args[0]);
  115.                 break;
  116.         }
  117.     };
  118.    
  119. })(this);
复制代码

最佳答案

查看完整内容

去用翻译把日语的部分翻译一下呀……基本都能理解的。 简单来说就是:将选项设置中的取消设为[分支]。 在选择的语句之前(不一定紧贴着)添加一行插件命令例如: TLChoice [帧数] 一次命令只对一次选项生效。 大概就是这个意思。
梦石
14
星屑
8091
在线时间
1454 小时
注册时间
2020-4-19
回帖
267

MZ评测员极短25参与极短22获奖极短21参与

发表于 2021-1-23 13:32:21 | 显示全部楼层
本帖最后由 yuyering 于 2021-1-23 17:35 编辑

去用翻译把日语的部分翻译一下呀……基本都能理解的。
简单来说就是:将选项设置中的取消设为[分支]。
在选择的语句之前(不一定紧贴着)添加一行插件命令例如:
QQ截图20210123172355.jpg TLChoice [帧数]
一次命令只对一次选项生效。

大概就是这个意思。





点评

我不是楼主,我也不需要用这个插件,但还是谢谢您。  发表于 2021-1-23 17:56
回复

使用道具 举报

梦石
0
星屑
104
在线时间
25 小时
注册时间
2021-1-1
回帖
2
 楼主| 发表于 2021-1-23 19:27:05 | 显示全部楼层
yuyering 发表于 2021-1-23 13:32
去用翻译把日语的部分翻译一下呀……基本都能理解的。
简单来说就是:将选项设置中的取消设为[分支]。
在选 ...

非常感谢!!
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部