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

Project1

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

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
104
在线时间
25 小时
注册时间
2021-1-1
帖子
4
跳转到指定楼层
1
发表于 2021-1-23 13:32:20 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
20星屑
就是下面这个......请问有大佬来解读一下嘛,非常感谢!
限時選擇插件
作者:Tsukimi
JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // TimeLimitedChoice.js        2017/04/02
  3. // Copyright (c) 2017 Tsukimi
  4. //=============================================================================
  5.  
  6. /*:
  7. * @plugindesc 時間制限付き選択肢プレグイン
  8. * @author Tsukimi
  9. *
  10. * @help
  11. * 時間制限付き選択肢プレグイン
  12. * 作者:ツキミ
  13. *
  14. * 2018/09/17 ver 1.0.1 ツキミ式選択肢との競合を解消
  15. * 2017/05/01 ver 1.0 完成
  16. *
  17. * ***************************************************
  18. * 説明:
  19. * 次の選択肢に時間制限をかけます。
  20. * プラグインコマンドを実行して選択肢を設定した時、タイマーが自動で起動します。
  21. * 時間切れすると選択ウィンドウが消え、[キャンセルのとき]
  22. * のイベントコマンドを実行します。
  23. *
  24. * ※ 選択肢の表示の設定の中の、キャンセルを[分岐]にしてください。
  25. *
  26. * ※ 必ずしもプラグインコマンドの直後に選択肢を設定する必要がありません。
  27. * オススメの設定方法は:
  28. * ◆プラグインコマンド:TLChoice 300
  29. * ◆文章:~~~~~
  30. * ◆選択肢の表示:~~~~~
  31. *
  32. *
  33. * ***************************************************
  34. * プラグインコマンド:
  35. *  イベントコマンド「プラグインコマンド」から実行。
  36. *  (パラメータの間は半角スペースで区切る)
  37. *
  38. * TLChoice [フレーム数]
  39. *   次の選択肢表示に時間制限をかける(1秒=60フレーム)
  40. *   例: TLChoice 600
  41. *   ※次の選択肢にだけ効果があります。連続で使用したい場合、
  42. *   各[選択肢の表示]コマンドの前にもう一度このコマンドを行ってください。
  43. *
  44. *
  45. * 作者のサイト: http://tsukimitsf.blog.fc2.com/
  46. * バグなどがあったら、是非こちらへご一報ください。ありがとうございます。
  47. */
  48.  
  49. var Imported = Imported || {};
  50.  
  51. (function(_global) {
  52.           // ここにプラグイン処理を記載
  53.  
  54.     var _Game_Timer_onExpire = Game_Timer.prototype.onExpire;
  55.     Game_Timer.prototype.onExpire = function() {
  56.         _Game_Timer_onExpire.call(this);
  57.         var cw = SceneManager._scene._messageWindow._choiceWindow;
  58.         if(!!cw._timeLimit && !!cw._TLStarted) {
  59.             cw._timeLimit = false;
  60.             cw._TLStarted = false;
  61.             // processCancel, without sound
  62.             cw.updateInputData();
  63.             cw.deactivate();
  64.             cw.callCancelHandler();
  65.             // end
  66.             this.stop();
  67.         }
  68.     }
  69.     if(Imported.TKM_ChoiceList) {
  70.         var _Window_TKMChoiceList_oked = Window_TKMChoiceList.prototype.oked;
  71.         Window_TKMChoiceList.prototype.oked = function() {
  72.             _Window_TKMChoiceList_oked.call(this);
  73.             if(!!this._timeLimit) {
  74.                 this._timeLimit = false;
  75.                 this._TLStarted = false;
  76.                 $gameTimer.stop();
  77.             }
  78.         };
  79.     } else {
  80.         var _Window_ChoiceList_callOkHandler = Window_ChoiceList.prototype.callOkHandler;
  81.         Window_ChoiceList.prototype.callOkHandler = function() {
  82.             _Window_ChoiceList_callOkHandler.call(this);
  83.             if(!!this._timeLimit) {
  84.                 this._timeLimit = false;
  85.                 this._TLStarted = false;
  86.                 $gameTimer.stop();
  87.             }
  88.         }
  89.     }
  90.  
  91.     var _Window_ChoiceList_start = Window_ChoiceList.prototype.start;
  92.     Window_ChoiceList.prototype.start = function() {
  93.         _Window_ChoiceList_start.call(this);
  94.         if(!!this._timeLimit) {
  95.             this._TLStarted = true;
  96.             $gameTimer.start(this._limitedTime || 300);
  97.         }
  98.     }
  99.  
  100.     var _Window_ChoiceList_isCancelEnabled = Window_ChoiceList.prototype.isCancelEnabled;
  101.     Window_ChoiceList.prototype.isCancelEnabled = function() {
  102.         var normal = _Window_ChoiceList_isCancelEnabled.call(this);
  103.         if(!!this._timeLimit) return false;
  104.         else return normal;
  105.     }
  106.  
  107.  
  108.     var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  109.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  110.         _Game_Interpreter_pluginCommand.call(this, command, args);
  111.         switch(command) {
  112.             case "TLChoice":
  113.                var cw = SceneManager._scene._messageWindow._choiceWindow;
  114.                 cw._timeLimit = true;
  115.                 if(!args) cw._limitedTime = 300;
  116.                 else if(parseInt(args[0]) == 0) cw._limitedTime = 300;
  117.                 else cw._limitedTime = parseInt(args[0]);
  118.                 break;
  119.         }
  120.     };
  121.  
  122. })(this);

最佳答案

查看完整内容

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

Lv4.逐梦者

梦石
12
星屑
6235
在线时间
1196 小时
注册时间
2020-4-19
帖子
232

极短22获奖极短21参与

2
发表于 2021-1-23 13:32:21 | 只看该作者
本帖最后由 yuyering 于 2021-1-23 17:35 编辑

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

大概就是这个意思。





点评

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

使用道具 举报

Lv1.梦旅人

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

非常感谢!!
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 21:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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