查看: 4977|回复: 1

[搬运汉化] 帮助文档 【坐等汉化】

[复制链接]
梦石
0
星屑
2457
在线时间
912 小时
注册时间
2014-10-14
回帖
1155

开拓者

发表于 2020-11-15 00:22:59 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 j296196585 于 2020-11-15 00:31 编辑

服务条款
MIT许可证。
无需信用标记
可用于商业目的
可以修改
也可以仅重新分配材料
可用于成人游戏和残酷游戏


■创建帮助
1. 1。准备帮助图像。存储在img /图片文件夹中。
(宽640像素*高360像素)

对于每个帮助, 可以设置(
1)帮助名称(2)
一个或多个图像。
■插件命令
AB_Help打开
打开帮助场景。
AB_Help显示1
显示ID号为1的帮助。
*此后,它会未经允许被添加到帮助列表中,并被标记为已读。
AB_Help加1
将ID为1的帮助添加到帮助场景列表中。
AB_Help删除1
从帮助场景列表中删除ID为1的帮助。
AB_帮助完成
将所有帮助添加到帮助场景列表。
AB_Help清除
从帮助场景列表中删除所有帮助。





  1. // =============================================================================
  2. // AB_HelpScene.js
  3. // Version: 1.01
  4. // -----------------------------------------------------------------------------
  5. // Copyright (c) 2020 ヱビ
  6. // Released under the MIT license
  7. // [url]http://opensource.org/licenses/mit-license.php[/url]
  8. // -----------------------------------------------------------------------------
  9. // [Homepage]: ヱビのノート
  10. //             [url]http://www.zf.em-net.ne.jp/~ebi-games/[/url]
  11. // =============================================================================


  12. /*:
  13. * @plugindesc v1.01 画像でヘルプを表示する機能を追加します。
  14. * @author ヱビ
  15. *
  16. *
  17. * @param ヘルプタイトル
  18. * @type string
  19. * @desc ヘルプタイトルの名前です。
  20. * @default ヘルプ
  21. *
  22. * @param メニュー表示スイッチ
  23. * @type switch
  24. * @desc ここで設定したスイッチがONの時、メニューで表示します。
  25. * 0を指定すると常に表示します。
  26. * @default 0
  27. *
  28. * @param メニュー有効化スイッチ
  29. * @type switch
  30. * @desc ここで設定したスイッチがONの時、メニューで有効化します。
  31. * 0を指定すると常に有効です。無効のときは灰色になります。
  32. * @default 0
  33. *
  34. * @param ヘルプリスト
  35. * @type struct<HelpList>[]
  36. * @desc ヘルプリストです。
  37. * @default []
  38. *
  39. * @param 未閲覧ヘルプアイコン
  40. * @type number
  41. * @desc 見ていないヘルプにつくアイコンです。
  42. * @default 4
  43. *
  44. * @param 未開放ヘルプ名前
  45. * @type string
  46. * @desc 追加されていないヘルプの名前です。
  47. * @default ???
  48. *
  49. * @param 次へ名前
  50. * @type string
  51. * @desc ヘルプ画面で次の画像に移るコマンドの名前です。
  52. * @default >
  53. *
  54. * @param 閉じる名前
  55. * @type string
  56. * @desc ヘルプ画面で最後の画像になり、閉じるためのコマンドの名前です。
  57. * @default OK
  58. *
  59. * @help
  60. * ============================================================================
  61. * 概要
  62. * ============================================================================
  63. *
  64. * チュートリアルで出てくるような、数枚の画像のヘルプを、
  65. * ①イベントで表示できるようにし、
  66. * ②メニューやイベントで、後で見返せるようにする
  67. * プラグインです。
  68. *
  69. * ■ヘルプ画像
  70. * ヘルプ画像(幅640px*高さ360px)。
  71. * 一つのヘルプに1~4枚程度表示することを想定しています。
  72. *
  73. *
  74. * ============================================================================
  75. * 作り方
  76. * ============================================================================
  77. *
  78. * ■ヘルプの作成
  79. *
  80. * 1.ヘルプ画像を用意。img/picturesフォルダに格納します。
  81. *
  82. * (幅640px*高さ360px)
  83. *
  84. * 2.プラグインパラメータでヘルプを設定。
  85. *
  86. * 1つのヘルプにつき、
  87. * ①ヘルプ名
  88. * ②1枚以上の画像を設定できます。
  89. *
  90. * ■プラグインコマンド
  91. *
  92. * AB_Help Open
  93. * ヘルプシーンを開きます。
  94. *
  95. * AB_Help Show 1
  96. * ID1番のヘルプを表示します。
  97. * ※この後、勝手にヘルプリストに追加され、既読になります。
  98. *
  99. * AB_Help Add 1
  100. * ID1番のヘルプをヘルプシーンのリストに追加します。
  101. *
  102. * AB_Help Remove 1
  103. * ID1番のヘルプをヘルプシーンのリストから削除します。
  104. *
  105. * AB_Help Complete
  106. * すべてのヘルプをヘルプシーンのリストに加えます。
  107. *
  108. * AB_Help Clear
  109. * すべてのヘルプをヘルプシーンのリストから削除します。
  110. *
  111. * ============================================================================
  112. * 更新履歴
  113. * ============================================================================
  114. *
  115. * Version 1.01
  116. *   メニューの表示スイッチとメニュー有効化スイッチが変数を参照していたため、
  117. *   スイッチに修正しました。
  118. *
  119. * Version 1.00 公開
  120. *   
  121. *
  122. * ============================================================================
  123. * 利用規約
  124. * ============================================================================
  125. *
  126. * MITライセンスです。
  127. * ・クレジット表記は不要
  128. * ・営利目的で使用可
  129. * ・改変可
  130. *     ただし、ソースコードのヘッダのライセンス表示は残してください。
  131. * ・素材だけの再配布も可
  132. * ・アダルトゲーム、残酷なゲームでの使用も可
  133. *
  134. *
  135. *
  136. */

  137. /*~struct~HelpList:
  138. *
  139. * @param name
  140. * @type string
  141. * @desc ヘルプの名前です。
  142. * @default ヘルプ
  143. *
  144. * @param ImageList
  145. * @type file[]
  146. * @dir img/pictures
  147. * @desc ヘルプの画像ファイルです。
  148. * @default []
  149. *
  150. */


  151. (function() {

  152.         var parameters = PluginManager.parameters('AB_HelpScene');
  153.         var AB_Helptitle = String(parameters['ヘルプタイトル']);
  154.         var ABHelp_ShowSwitchID = Number(parameters['メニュー表示スイッチ']);
  155.         var ABHelp_EnableSwitchID = Number(parameters['メニュー有効化スイッチ']);
  156.         var AB_HelpList = JSON.parse(parameters['ヘルプリスト']);
  157.         for (var i=0,l=AB_HelpList.length; i<l; i++) {
  158.                 AB_HelpList[i] = JSON.parse(AB_HelpList[i]);
  159.                 AB_HelpList[i].ImageList = JSON.parse(AB_HelpList[i].ImageList);/*
  160.                 for (var j=0,jl = AB_HelpList[i].ImageList.length; j<jl; j++) {
  161.                         AB_HelpList[i].ImageList[j] = String(AB_HelpList[i].ImageList[j]);
  162.                 }*/
  163.         }
  164.         var AB_HelpNotRead = Number(parameters['未閲覧ヘルプアイコン']);
  165.         var AB_HelpUnOpenName = String(parameters['未開放ヘルプ名前']);
  166.         var AB_HelpNextName = String(parameters['次へ名前']);
  167.         var AB_HelpCloseName = String(parameters['閉じる名前']);



  168. //=============================================================================
  169. // Game_System
  170. //=============================================================================

  171.        

  172.         Game_System.prototype.initABHelp = function() {
  173.                 this._ABHelpList = [];
  174.                 this._ABHelpSceneIndex = -1;
  175.         };

  176.         Game_System.prototype.isABHelpOpenWithIndex = function() {
  177.                 if (this._ABHelpSceneIndex !=null) {
  178.                         if (this._ABHelpSceneIndex >= 0) {
  179.                                 return true;
  180.                         }
  181.                 }
  182.                 if (this._ABHelpSceneIndex === 0) {
  183.                         return true;
  184.                 }
  185.                 return false;
  186.         };
  187.         Game_System.prototype.getABHelpOpenWithIndex = function() {
  188.                 return this._ABHelpSceneIndex;
  189.         };
  190.         Game_System.prototype.setABHelpOpenWithIndex = function(id) {
  191.                 if (!this._ABHelpList) this.initABHelp();
  192.                 this._ABHelpSceneIndex = id;
  193.         };
  194.        
  195.         Game_System.prototype.addABHelp = function(id) {
  196.                 if (!this._ABHelpList) this.initABHelp();
  197.                 if (this._ABHelpList[id]) return;
  198.                 this._ABHelpList[id] = 1;
  199.         };

  200.         Game_System.prototype.removeABHelp = function(id) {
  201.                 if (!this._ABHelpList) this.initABHelp();
  202.                 //if (this._ABHelpList[id]) return;
  203.                 this._ABHelpList[id] = 0;
  204.         };

  205.         Game_System.prototype.setABHelpRead = function(id) {
  206.                 if (!this._ABHelpList) this.initABHelp();
  207.                 this._ABHelpList[id] = 2;
  208.         };
  209.         Game_System.prototype.getABHelpRead = function(id) {
  210.                 if (!this._ABHelpList) this.initABHelp();
  211.                 return this._ABHelpList[id] == 2;
  212.         };


  213.         Game_System.prototype.completeABHelp = function() {
  214.                 if (!this._ABHelpList) this.initABHelp();
  215.                 for (var i = 0; i < AB_HelpList.length; i++) {
  216.                         if (this._ABHelpList[i]) continue;
  217.                         this._ABHelpList[i] = 1;
  218.                 }
  219.         };

  220.         Game_System.prototype.canRead = function(index) {
  221.                 if (!this._ABHelpList) return false;
  222.                 return this._ABHelpList[index];
  223.         };


  224. //=============================================================================
  225. // Game_System
  226. //=============================================================================

  227.        



  228.         var Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  229.         Game_Interpreter.prototype.pluginCommand = function(command, args) {
  230.                 Game_Interpreter_pluginCommand.call(this, command, args);
  231.                 if (command === 'AB_Help') {
  232.                         var command2 = args[0].toLowerCase();
  233.                         switch(command2) {
  234.                         case "open":
  235.                                 SceneManager.push(Scene_ABHelp);
  236.                                 break;
  237.                         case "add":
  238.                                 var id = Number(args[1] -1);
  239.                                 $gameSystem.addABHelp(id);
  240.                                 break;
  241.                         case "remove":
  242.                                 var id = Number(args[1] -1);
  243.                                 $gameSystem.removeABHelp(id);
  244.                                 break;
  245.                         case "complete":
  246.                                 $gameSystem.completeABHelp();
  247.                                 break;
  248.                         case "clear":
  249.                                 $gameSystem.initABHelp();
  250.                                 break;
  251.                         case "show":
  252.                                 var id = Number(args[1] - 1);
  253.                                 $gameSystem.setABHelpOpenWithIndex(id);
  254.                                 SceneManager.push(Scene_ABHelp);
  255.                                
  256.                                 break;
  257.                         }
  258.                 }
  259.         };



  260. //=============================================================================
  261. // Window_ABHelpName
  262. //=============================================================================


  263.         function Window_ABHelpName() {
  264.             this.initialize.apply(this, arguments);
  265.         }
  266.        
  267.         Window_ABHelpName.prototype = Object.create(Window_Base.prototype);
  268.         Window_ABHelpName.prototype.constructor = Window_ABHelpName;
  269.        
  270.         Window_ABHelpName.prototype.initialize = function() {
  271.                         var x = 0;
  272.                         var y = 0;
  273.                         var width = Graphics.boxWidth;
  274.                         var height = Window_Base.prototype.fittingHeight(1);
  275.             Window_Base.prototype.initialize.call(this, x, y, width, height);
  276.                         this.refresh();
  277.         };
  278.        


  279.         Window_ABHelpName.prototype.refresh = function() {
  280.             this.contents.clear();
  281.                         this.drawText(AB_Helptitle, 0, 0, this.contents.width, "center");
  282.         };


  283. //=============================================================================
  284. // Window_ABHelpTitle
  285. //=============================================================================


  286.         function Window_ABHelpTitle() {
  287.             this.initialize.apply(this, arguments);
  288.         }
  289.        
  290.         Window_ABHelpTitle.prototype = Object.create(Window_Base.prototype);
  291.         Window_ABHelpTitle.prototype.constructor = Window_ABHelpTitle;
  292.        
  293.         Window_ABHelpTitle.prototype.initialize = function() {
  294.                         var x = (Graphics.boxWidth - 676) / 2;
  295.                         var y = Window_Base.prototype.fittingHeight(1);
  296.                         var width = 676;//
  297.                         var height = Window_Base.prototype.fittingHeight(1);
  298.             Window_Base.prototype.initialize.call(this, x, y, width, height);
  299.                         this._item = null;
  300.         };
  301.        
  302.         Window_ABHelpTitle.prototype.setItem = function(item) {
  303.                 if (this._item != item) {
  304.                         this._item = item;
  305.                         this.refresh();
  306.                 }
  307.         }

  308.         Window_ABHelpTitle.prototype.refresh = function() {
  309.             this.contents.clear();
  310.                        
  311.                         var name = this._item.name;//
  312.                         //var iw = Window_Base._iconWidth;
  313.                         /*if () {
  314.                                
  315.                         }
  316.                         this.drawIcon();*/
  317.                         this.drawText(name, 0, 0, this.contents.width, "center");
  318.         };


  319. //=============================================================================
  320. // Window_ABHelpNumber
  321. //=============================================================================


  322.         function Window_ABHelpNumber() {
  323.             this.initialize.apply(this, arguments);
  324.         }
  325.        
  326.         Window_ABHelpNumber.prototype = Object.create(Window_Base.prototype);
  327.         Window_ABHelpNumber.prototype.constructor = Window_ABHelpNumber;
  328.        
  329.         Window_ABHelpNumber.prototype.initialize = function() {
  330.                         var x = (Graphics.boxWidth - 676) / 2;
  331.                         var y = Window_Base.prototype.fittingHeight(1)*2 + 396;
  332.                         var width = 478;//
  333.                         var height = Window_Base.prototype.fittingHeight(1);
  334.             Window_Base.prototype.initialize.call(this, x, y, width, height);
  335.                         this._item = null;
  336.                         this._index = null;
  337.         };
  338.        
  339.         Window_ABHelpNumber.prototype.setItem = function(item) {
  340.                 if (this._item != item) {
  341.                         this._item = item;
  342.                         this._helpIndex = 0;
  343.                         this._imageIndex = 0;
  344.                         this.refresh();
  345.                 }
  346.         };
  347.        
  348. /*
  349.         Window_ABHelpNumber.prototype.setHelpIndex = function(index) {
  350.                 if (this._helpIndex != index) {
  351.                         this._helpIndex = index;
  352.                         refresh();
  353.                 }
  354.         };*/
  355.         Window_ABHelpNumber.prototype.setImageIndex = function(index) {
  356.                 if (this._imageIndex != index) {
  357.                         this._imageIndex = index;
  358.                         this.refresh();
  359.                 }
  360.         };

  361.         Window_ABHelpNumber.prototype.refresh = function() {
  362.             this.contents.clear();
  363.                        
  364.                         var max = this._item.ImageList.length;//
  365.                         //var iw = Window_Base._iconWidth;
  366.                         /*if () {
  367.                                
  368.                         }
  369.                         this.drawIcon();*/
  370.                         var text = "";
  371.                         for (var i=0; i<max; i++) {
  372.                                 if (this._imageIndex == i) {
  373.                                         text += "● ";
  374.                                 } else {
  375.                                         text += "〇 ";
  376.                                 }
  377.                         }
  378.                         var text2 = (this._imageIndex+1)+" / "+ max;
  379.                         this.drawText(text, 0,0,this.contents.width - 18 - this.textWidth(text2), "center");
  380.                         this.drawText(text2, 0, 0, this.contents.width-18, 'right');
  381.         };
  382. //=============================================================================
  383. // Window_ABHelpImage
  384. //=============================================================================


  385.         function Window_ABHelpImage() {
  386.             this.initialize.apply(this, arguments);
  387.         }

  388.         Window_ABHelpImage.prototype = Object.create(Window_Base.prototype);
  389.         Window_ABHelpImage.prototype.constructor = Window_ABHelpImage;
  390.        
  391.         Window_ABHelpImage.prototype.initialize = function() {
  392.                 var x = (Graphics.boxWidth - 676) / 2;
  393.                 var y = Window_Base.prototype.fittingHeight(1)*2;
  394.                 var width = 676;//
  395.                 var height = 396;
  396.     Window_Base.prototype.initialize.call(this, x, y, width, height);
  397.                 this._item = null;
  398.                 this._imageIndex = 0;
  399.                 this._sprite = new Sprite();
  400.                 this._sprite.x=18;
  401.                 this._sprite.y=18;
  402.                 this.addChildToBack(this._sprite);
  403.         };
  404.         Window_ABHelpImage.prototype.setItem = function(item) {
  405.             if (this._item !== item) {
  406.                 this._item = item;
  407.                                         this._imageIndex = 0;
  408.                 this.refresh();
  409.             }
  410.         };
  411.         Window_ABHelpImage.prototype.setImageIndex = function(index) {
  412.                 if (this._imageIndex != index) {
  413.                         this._imageIndex = index;
  414.                         this.refresh();
  415.                 }
  416.         };
  417.         /*
  418.         Window_ABHelpImage.prototype.nextImage = function() {
  419.                 var lastIndex = this._index;
  420.                 this._index++;
  421.                 if (this._index >=this._item.ImageList.length) {
  422.                         this._index = this._item.ImageList.length-1;
  423.                 }
  424.                 if (lastIndex == this._index) return;
  425.                 this.refresh();
  426.         };
  427.        
  428.         Window_ABHelpImage.prototype.prevImage = function() {
  429.                 var lastIndex = this._index;
  430.                 this._index--;
  431.                 if (this._index < 0) {
  432.                         this._index = 0;
  433.                 }
  434.                 if (lastIndex == this._index) return;
  435.                 this.refresh();
  436.         };
  437.         */
  438.         Window_ABHelpImage.prototype.refresh = function() {
  439.                 this.contents.clear();
  440.                 if (this._item) {
  441.                         this._sprite.bitmap = ImageManager.loadPicture(this._item.ImageList[this._imageIndex]);
  442.                 }
  443.         };

  444.        

  445. //=============================================================================
  446. // Window_ABHelpList
  447. //=============================================================================

  448.         function Window_ABHelpList() {
  449.                 this.initialize.apply(this, arguments);
  450.         }
  451.        
  452.         Window_ABHelpList.prototype = Object.create(Window_Selectable.prototype);
  453.         Window_ABHelpList.prototype.constructor = Window_ABHelpList;
  454.        
  455.         Window_ABHelpList.prototype.initialize = function() {
  456.                         var x = (Graphics.boxWidth-676) / 2;
  457.                         //var y = Window_Base.prototype.fittingHeight(2) + 396;
  458.                         var y = Window_Base.prototype.fittingHeight(1)*2;
  459.                         var h = Graphics.boxHeight - Window_Base.prototype.fittingHeight(1)*2;
  460.                         var w = 676;
  461.             Window_Selectable.prototype.initialize.call(this, x, y, w, h);
  462.                         this._data = [];
  463.         };
  464. /*
  465.         Window_ABHelpList.prototype.setTitleWindow = function(w) {
  466.             this._ABHelpTitleWindow = w;
  467.         };
  468.         Window_ABHelpList.prototype.setImageWindow = function(w) {
  469.             this._ABHelpImageWindow = w;
  470.         };
  471.         Window_ABHelpList.prototype.setNumberWindow = function(w) {
  472.             this._ABHelpNumberWindow = w;
  473.         };
  474.         Window_ABHelpList.prototype.setNextWindow = function(w) {
  475.             this._ABHelpNextWindow = w;
  476.         };
  477. */

  478.         Window_ABHelpList.prototype.isCurrentItemEnabled = function() {
  479.             return this.isEnabled(this.index());
  480.         };
  481.         Window_ABHelpList.prototype.maxCols = function() {
  482.             return 1;
  483.         };
  484.         Window_ABHelpList.prototype.maxItems = function() {
  485.             return this._data ? this._data.length : 1;
  486.         };
  487.         Window_ABHelpList.prototype.item = function() {
  488.             var index = this.index();
  489.             return this._data && index >= 0 ? this._data[index] : null;
  490.         };

  491.         Window_ABHelpList.prototype.isEnabled = function(index) {
  492.             return $gameSystem.canRead(index);
  493.         };

  494.         Window_ABHelpList.prototype.selectLast = function() {
  495.             var index = this._data.length-1;
  496.             this.select(index >= 0 ? index : 0);
  497.         };

  498.         Window_ABHelpList.prototype.drawItem = function(index) {
  499.             var item = this._data[index];
  500.             if (item) {
  501.                 var rect = this.itemRect(index);
  502.                 rect.width -= this.textPadding();
  503.                                         var iw = Window_Base._iconWidth;
  504.                 this.changePaintOpacity(this.isEnabled(index));
  505.                 if (this.isEnabled(index)) {
  506.                                                 if (!$gameSystem.getABHelpRead(index)) {
  507.                                                         this.drawIcon(AB_HelpNotRead, rect.x,rect.y + 0);
  508.                                                 }
  509.                                                 this.drawText(item.name, rect.x + iw, rect.y, rect.width-iw);
  510.                                                
  511.                                         } else {
  512.                                                 this.drawText(AB_HelpUnOpenName, rect.x + iw, rect.y, rect.width-iw, 'left'); //
  513.                                         }
  514.                 this.changePaintOpacity(1);
  515.             }
  516.         };

  517.         Window_ABHelpList.prototype.makeItemList = function() {
  518.             this._data = AB_HelpList;
  519.         };
  520.         Window_ABHelpList.prototype.refresh = function() {
  521.             this.makeItemList();
  522.             this.createContents();
  523.             this.drawAllItems();
  524.         };
  525. /*
  526.        
  527.         Window_ABHelpList.prototype.select = function(index) {
  528.                         Window_Selectable.prototype.select.call(this, index);
  529.                         if (this.isEnabled(index))
  530.             this._ABHelpTitleWindow.setItem(this._date[index]);
  531.         };*/
  532.                
  533. //=============================================================================
  534. // Window_ABHelpNext
  535. //=============================================================================
  536.        
  537.         function Window_ABHelpNext() {
  538.                 this.initialize.apply(this, arguments);
  539.         }
  540.         Window_ABHelpNext.prototype = Object.create(Window_HorzCommand.prototype);
  541.         Window_ABHelpNext.prototype.constructor = Window_ABHelpNext;
  542.        
  543.         Window_ABHelpNext.prototype.initialize = function() {
  544.                         var x = Graphics.boxWidth / 2 + 140/*149*/;
  545.                         var y = Window_Base.prototype.fittingHeight(1)*2 + 396;
  546.                         var w = 196;
  547.             Window_HorzCommand.prototype.initialize.call(this, x, y, w);
  548.                         this._windowWidth = w;
  549.                         this._haveNext = false;
  550.                         this._havePrev = false;
  551.         };
  552. /*
  553.         Window_ABHelpNext.prototype.setImageWindow = function(actor) {
  554.                 if (this._actor != actor) {
  555.                         this._actor = actor;
  556.                         this._systemId = 0;
  557.                         this._nextSkillId = 0;
  558.                         this.refresh();
  559.                 }
  560.         };
  561.         */

  562.         Window_ABHelpNext.prototype.windowWidth = function() {
  563.     return 196;
  564.         };
  565.        
  566.         Window_ABHelpNext.prototype.makeCommandList = function() {
  567.                 if (this._haveNext) {
  568.             this.addCommand(AB_HelpNextName, 'next', true);
  569.                 } else {
  570.                         this.addCommand(AB_HelpCloseName, 'end', true);
  571.                 }
  572.         };
  573.         Window_ABHelpNext.prototype.cursorRight = function() {
  574.                         if (this.active) {
  575.                                 if (this._haveNext) {
  576.                                         SoundManager.playCursor();
  577.                                         this.callHandler('next');
  578.                                 } else {/*
  579.                                         this.callHandler('end');*/
  580.                                 }
  581.                         }
  582.         };
  583.         Window_ABHelpNext.prototype.cursorLeft = function() {
  584.                         if (this.active) {
  585.                                 if (this._havePrev) {
  586.                                         SoundManager.playCursor();
  587.                                         this.callHandler('cancel');
  588.                                 }
  589.                         }
  590.         };

  591.         Window_ABHelpNext.prototype.setHaveNext = function(next) {
  592.                 this._haveNext = next;
  593.                 this.refresh();
  594.         };

  595.         Window_ABHelpNext.prototype.setHavePrev = function(prev) {
  596.                 this._havePrev = prev;
  597.         };

  598.         Window_ABHelpNext.prototype.maxCols = function() {
  599.             return 1;
  600.         };
  601.         Window_ABHelpNext.prototype.numVisibleRows = function() {
  602.             return 1;
  603.         };

  604. /*
  605.         Window_ABHelpNext.prototype.refresh = function() {
  606.                 this.contents.clear();
  607.                 this.makeCommandList();
  608.         };
  609. */

  610. //=============================================================================
  611. // Scene_ABHelp
  612. //=============================================================================

  613.         function Scene_ABHelp() {
  614.             this.initialize.apply(this, arguments);
  615.         }
  616.        
  617.         Scene_ABHelp.prototype = Object.create(Scene_MenuBase.prototype);
  618.         Scene_ABHelp.prototype.constructor = Scene_ABHelp;
  619.        
  620.         Scene_ABHelp.prototype.initialize = function() {
  621.             Scene_MenuBase.prototype.initialize.call(this);
  622.                         this._ABHelpItem = null;
  623.                         this._ABHelpImageIndex = 0;
  624.         };
  625.        
  626.         Scene_ABHelp.prototype.create = function() {
  627.             Scene_MenuBase.prototype.create.call(this);

  628.             this.createABHelpNameWindow();
  629.             this.createABHelpListWindow();
  630.             this.createABHelpTitleWindow();
  631.             this.createABHelpImageWindow();
  632.             this.createABHelpNextWindow();
  633.             this.createABHelpNumberWindow();
  634.                         if ($gameSystem.isABHelpOpenWithIndex()) {
  635.                                 this.openIndex($gameSystem.getABHelpOpenWithIndex());
  636.                         } else {
  637.                                 this._ABHelpNextWindow.deactivate();
  638.                                 this._ABHelpNextWindow.deselect();
  639.                                 this._ABHelpListWindow.activate();
  640.                                 this._ABHelpListWindow.select(0);
  641.                                 this._ABHelpListWindow.refresh();
  642.                         }
  643.         };

  644.         Scene_ABHelp.prototype.createABHelpListWindow = function() {
  645.     this._ABHelpListWindow = new Window_ABHelpList();
  646.                 this._ABHelpListWindow.setHandler('ok', this.onItemOk.bind(this));
  647.                 this._ABHelpListWindow.setHandler('cancel', this.popScene.bind(this));
  648.     this.addWindow(this._ABHelpListWindow);
  649.                 //this._ABHelpListWindow.openness = 0;
  650.         };
  651.         Scene_ABHelp.prototype.createABHelpNameWindow = function() {
  652.     this._ABHelpNameWindow = new Window_ABHelpName();
  653.     this.addWindow(this._ABHelpNameWindow);
  654.                 //this._ABHelpNameWindow.openness = 0;
  655.         };
  656.         Scene_ABHelp.prototype.createABHelpTitleWindow = function() {
  657.     this._ABHelpTitleWindow = new Window_ABHelpTitle();
  658.     this.addWindow(this._ABHelpTitleWindow);
  659.                 this._ABHelpTitleWindow.openness = 0;
  660.         };
  661.         Scene_ABHelp.prototype.createABHelpImageWindow = function() {
  662.     this._ABHelpImageWindow = new Window_ABHelpImage();
  663.     this.addWindow(this._ABHelpImageWindow);
  664.                 this._ABHelpImageWindow.openness = 0;
  665.         };
  666.         Scene_ABHelp.prototype.createABHelpNumberWindow = function() {
  667.     this._ABHelpNumberWindow = new Window_ABHelpNumber();
  668.     this.addWindow(this._ABHelpNumberWindow);
  669.                 this._ABHelpNumberWindow.openness = 0;
  670.         };
  671.         Scene_ABHelp.prototype.createABHelpNextWindow = function() {
  672.     this._ABHelpNextWindow = new Window_ABHelpNext();
  673.                 this._ABHelpNextWindow.openness = 0;
  674.     //this._ABHelpNextWindow.setHelpWindow(this._helpWindow);
  675.     this._ABHelpNextWindow.setHandler('next',    this.commandNext.bind(this));
  676.     this._ABHelpNextWindow.setHandler('end',   this.commandEnd.bind(this));
  677.           this._ABHelpNextWindow.setHandler('cancel',   this.commandCancel.bind(this));
  678.     this.addWindow(this._ABHelpNextWindow);
  679.         };

  680.         Scene_ABHelp.prototype.onItemOk = function() {
  681.                 var index = this._ABHelpListWindow.index();
  682.                 this._ABHelpIndex = index;
  683.                 this._ABHelpItem = this._ABHelpListWindow._data[index];
  684.                 this._ABHelpImageIndex = 0;

  685.                
  686.                 $gameSystem.setABHelpRead(index);
  687.                
  688.                 this._ABHelpListWindow.deactivate();
  689.                 this._ABHelpListWindow.close();
  690.                 this._ABHelpTitleWindow.setItem(this._ABHelpItem);
  691.                 this._ABHelpTitleWindow.open();
  692.                 this._ABHelpNumberWindow.setItem(this._ABHelpItem);
  693.                 this._ABHelpNumberWindow.open();
  694.                 this._ABHelpImageWindow.setItem(this._ABHelpItem);
  695.                 this._ABHelpImageWindow.open();
  696.     this._ABHelpImageWindow.setImageIndex(this._ABHelpImageIndex);
  697.     this._ABHelpNumberWindow.setImageIndex(this._ABHelpImageIndex);
  698.                 this._ABHelpNextWindow.setHaveNext(this._ABHelpItem.ImageList.length > 1);
  699.                 this._ABHelpNextWindow.setHavePrev(false);
  700.                 this._ABHelpNextWindow.open();
  701.                 this._ABHelpNextWindow.activate();
  702.                 this._ABHelpNextWindow.select(0);
  703.         };



  704.         Scene_ABHelp.prototype.commandNext = function() {
  705.                         this._ABHelpImageIndex++;
  706.                         if (this._ABHelpImageIndex >= this._ABHelpItem.ImageList.length) {
  707.                                 this._ABHelpImageIndex = this._ABHelpItem.ImageList.length-1;
  708.                         }
  709.             this._ABHelpNextWindow.setHaveNext(this._ABHelpItem.ImageList.length > this._ABHelpImageIndex+1);
  710.                         this._ABHelpNextWindow.setHavePrev(this._ABHelpImageIndex > 0);
  711.             this._ABHelpImageWindow.setImageIndex(this._ABHelpImageIndex);
  712.             this._ABHelpNumberWindow.setImageIndex(this._ABHelpImageIndex);
  713.                         this._ABHelpNextWindow.activate();
  714.         };

  715.         Scene_ABHelp.prototype.commandCancel = function() {
  716.                         this._ABHelpImageIndex--;
  717.                         if (this._ABHelpImageIndex < 0) {
  718.                                 this.commandEnd();
  719.                                 return;
  720.                         }
  721.             this._ABHelpNextWindow.setHaveNext(this._ABHelpItem.ImageList.length > this._ABHelpImageIndex);
  722.                         this._ABHelpNextWindow.setHavePrev(this._ABHelpImageIndex > 0);
  723.             this._ABHelpImageWindow.setImageIndex(this._ABHelpImageIndex);
  724.             this._ABHelpNumberWindow.setImageIndex(this._ABHelpImageIndex);
  725.                         this._ABHelpNextWindow.activate();
  726.                        
  727.         };


  728.        

  729.         Scene_ABHelp.prototype.commandEnd = function() {
  730.                 if ($gameSystem.isABHelpOpenWithIndex()) {
  731.                         $gameSystem.setABHelpOpenWithIndex(-1);
  732.                         this.popScene();
  733.                         return;
  734.                 }
  735.                 this._ABHelpListWindow.refresh();
  736.                 this._ABHelpListWindow.activate();
  737.                 this._ABHelpListWindow.open();
  738.                 this._ABHelpTitleWindow.close();
  739.                 this._ABHelpNumberWindow.close();
  740.                 this._ABHelpImageWindow.close();
  741.                 this._ABHelpNextWindow.close();
  742.                 this._ABHelpNextWindow.deactivate();
  743.         };


  744.         Scene_ABHelp.prototype.openIndex = function(index) {
  745.                 this._ABHelpIndex = index;
  746.                 this._ABHelpItem = AB_HelpList[index];
  747.                 this._ABHelpImageIndex = 0;

  748.                
  749.                 $gameSystem.setABHelpRead(index);
  750.                
  751.                 this._ABHelpListWindow.deactivate();
  752.                 this._ABHelpListWindow.close();
  753.                 this._ABHelpTitleWindow.setItem(this._ABHelpItem);
  754.                 this._ABHelpTitleWindow.open();
  755.                 this._ABHelpNumberWindow.setItem(this._ABHelpItem);
  756.                 this._ABHelpNumberWindow.open();
  757.                 this._ABHelpImageWindow.setItem(this._ABHelpItem);
  758.                 this._ABHelpImageWindow.open();
  759.     this._ABHelpImageWindow.setImageIndex(this._ABHelpImageIndex);
  760.     this._ABHelpNumberWindow.setImageIndex(this._ABHelpImageIndex);
  761.                 this._ABHelpNextWindow.setHaveNext(this._ABHelpItem.ImageList.length > 1);
  762.                 this._ABHelpNextWindow.setHavePrev(false);
  763.                 this._ABHelpNextWindow.open();
  764.                 this._ABHelpNextWindow.activate();
  765.                 this._ABHelpNextWindow.select(0);
  766.         };


  767. //=============================================================================
  768. // Scene_Menu
  769. //=============================================================================

  770.         var _Scene_Menu_prototype_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
  771.         Scene_Menu.prototype.createCommandWindow = function() {
  772.                 _Scene_Menu_prototype_createCommandWindow.call(this);
  773.                 this._commandWindow.setHandler('ABHelp',        this.commandABHelp.bind(this));
  774.         };

  775.         Scene_Menu.prototype.commandABHelp = function() {
  776.                 SceneManager.push(Scene_ABHelp);
  777.         };

  778. //=============================================================================
  779. // Window_MenuCommand
  780. //=============================================================================

  781.         var _Window_MenuCommand_prototype_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
  782.         Window_MenuCommand.prototype.addOriginalCommands = function() {
  783.                 _Window_MenuCommand_prototype_addOriginalCommands.call(this);
  784.                 this.addABHelpCommand();
  785.         };

  786.         Window_MenuCommand.prototype.addABHelpCommand = function() {
  787.                 var show = ABHelp_ShowSwitchID === 0 ? true : $gameSwitches.value(ABHelp_ShowSwitchID);
  788.                 if (!show) return;
  789.                 var enable = ABHelp_EnableSwitchID === 0 ? true : $gameSwitches.value(ABHelp_EnableSwitchID);
  790.                 this.addCommand(AB_Helptitle, 'ABHelp', enable);
  791.         };
  792. })();
复制代码
sc_HelpScene1.png
------落尽红樱君不见,轻绘梨花泪沾衣。~~~
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部