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

Project1

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

[已经过期] 哪个大神帮忙修改一下这个插件~

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3657
在线时间
1133 小时
注册时间
2017-4-6
帖子
278

开拓者

跳转到指定楼层
1
发表于 2017-7-15 14:11:31 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
出处:https://www6.atwiki.jp/pokotan/pages/3.html
这个插件实用性很大,可以查看敌我buff的详细说明,窗口会随着buff数量增宽或变窄,但是比较尴尬的就是窗口不会随着名字的长短而变化,只会压缩名字的宽度,因为敌人有些有前后词缀,比较长,所以太影响美观,有没有大神愿意帮忙修改一下呢,窗口也会根据名字长短而变化,谢谢!






JAVASCRIPT 代码复制
  1. //
  2. //  ステートヘルプ ver1.03
  3. //
  4. // ------------------------------------------------------
  5. // Copyright (c) 2016 Yana
  6. // Released under the MIT license
  7. // [url]http://opensource.org/licenses/mit-license.php[/url]
  8. // ------------------------------------------------------
  9. //
  10. // author Yana
  11. //
  12.  
  13. var Imported = Imported || {};
  14. Imported['StateHelp'] = 1.03;
  15.  
  16. /*:
  17.  * @plugindesc ver1.03/ステートにヘルプを付け、ステートの詳細を見るための仕組みを追加します。
  18.  * @author Yana
  19.  *
  20.  * @param State Help Text
  21.  * @desc 戦闘時、パーティコマンドに追加するステートヘルプの名称です。
  22.  * ここを空白にすると、ステートヘルプが追加されなくなります。
  23.  * @default ステート詳細
  24.  *
  25.  * @param Call State Window Key
  26.  * @desc ステートヘルプを呼び出すためのショートカットキーです。
  27.  * ここを空白にすると、ショートカットが無効になります。
  28.  * @default left
  29.  *
  30.  * @param Use Touch Call
  31.  * @desc 画面の左端をクリックするすることでステートヘルプを呼び出せるようにするかの設定です。
  32.  * @default true
  33.  *
  34.  * @param Add Menu State Help
  35.  * @desc メニュー画面にステートヘルプを追加するかの設定です。
  36.  * @default true
  37.  *
  38.  * @param Touch Call Rect
  39.  * @desc タッチすることで起動する領域の矩形位置です。
  40.  * @default 0,0,128,444
  41.  *
  42.  * @param Debuff Help HP1
  43.  * @desc 最大HP1段階減少のデバフのヘルプです。
  44.  * @default 最大HPが25%減少します。
  45.  *
  46.  * @param Debuff Help HP2
  47.  * @desc 最大HP2段階減少のデバフのヘルプです。
  48.  * @default 最大HPが50%減少します。
  49.  *
  50.  * @param Debuff Help MP1
  51.  * @desc 最大MP1段階減少のデバフのヘルプです。
  52.  * @default 最大HPが25%減少します。
  53.  *
  54.  * @param Debuff Help HP2
  55.  * @desc 最大MP2段階減少のデバフのヘルプです。
  56.  * @default 最大MPが50%減少します。
  57.  *
  58.  * @param Debuff Help ATK1
  59.  * @desc 攻撃力1段階減少のデバフのヘルプです。
  60.  * @default 攻撃力が25%減少します。
  61.  *
  62.  * @param Debuff Help ATK2
  63.  * @desc 攻撃力2段階減少のデバフのヘルプです。
  64.  * @default 攻撃力がが50%減少します。
  65.  *
  66.  * @param Debuff Help DEF1
  67.  * @desc 防御力1段階減少のデバフのヘルプです。
  68.  * @default 防御力が25%減少します。
  69.  *
  70.  * @param Debuff Help DEF2
  71.  * @desc 防御力2段階減少のデバフのヘルプです。
  72.  * @default 防御力が50%減少します。
  73.  *
  74.  * @param Debuff Help MAT1
  75.  * @desc 魔法力1段階減少のデバフのヘルプです。
  76.  * @default 魔法力が25%減少します。
  77.  *
  78.  * @param Debuff Help MAT2
  79.  * @desc 魔法力1段階減少のデバフのヘルプです。
  80.  * @default 魔法力が50%減少します。
  81.  *
  82.  * @param Debuff Help MDF1
  83.  * @desc 魔法防御1段階減少のデバフのヘルプです。
  84.  * @default 魔法防御が25%減少します。
  85.  *
  86.  * @param Debuff Help MDF2
  87.  * @desc 魔法防御2段階減少のデバフのヘルプです。
  88.  * @default 魔法防御が50%減少します。
  89.  *
  90.  * @param Debuff Help AGI1
  91.  * @desc 敏捷性1段階減少のデバフのヘルプです。
  92.  * @default 敏捷性が25%減少します。
  93.  *
  94.  * @param Debuff Help AGI2
  95.  * @desc 敏捷性2段階減少のデバフのヘルプです。
  96.  * @default 敏捷性が50%減少します。
  97.  *
  98.  * @param Debuff Help LUK1
  99.  * @desc 運1段階減少のデバフのヘルプです。
  100.  * @default 運が25%減少します。
  101.  *
  102.  * @param Debuff Help LUK2
  103.  * @desc 運2段階減少のデバフのヘルプです。
  104.  * @default 運が50%減少します。
  105.  *
  106.  * @param Buff Help HP1
  107.  * @desc 最大HP1段階上昇のデバフのヘルプです。
  108.  * @default 最大HPが25%上昇します。
  109.  *
  110.  * @param Buff Help HP2
  111.  * @desc 最大HP2段階上昇のデバフのヘルプです。
  112.  * @default 最大HPが50%上昇します。
  113.  *
  114.  * @param Buff Help MP1
  115.  * @desc 最大MP1段階上昇のデバフのヘルプです。
  116.  * @default 最大HPが25%上昇します。
  117.  *
  118.  * @param Buff Help HP2
  119.  * @desc 最大MP2段階上昇のデバフのヘルプです。
  120.  * @default 最大MPが50%上昇します。
  121.  *
  122.  * @param Buff Help ATK1
  123.  * @desc 攻撃力1段階上昇のデバフのヘルプです。
  124.  * @default 攻撃力が25%上昇します。
  125.  *
  126.  * @param Buff Help ATK2
  127.  * @desc 攻撃力2段階上昇のデバフのヘルプです。
  128.  * @default 攻撃力がが50%上昇します。
  129.  *
  130.  * @param Buff Help DEF1
  131.  * @desc 防御力1段階上昇のデバフのヘルプです。
  132.  * @default 防御力が25%上昇します。
  133.  *
  134.  * @param Buff Help DEF2
  135.  * @desc 防御力2段階上昇のデバフのヘルプです。
  136.  * @default 防御力が50%上昇します。
  137.  *
  138.  * @param Buff Help MAT1
  139.  * @desc 魔法力1段階上昇のデバフのヘルプです。
  140.  * @default 魔法力が25%上昇します。
  141.  *
  142.  * @param Buff Help MAT2
  143.  * @desc 魔法力1段階上昇のデバフのヘルプです。
  144.  * @default 魔法力が50%上昇します。
  145.  *
  146.  * @param Buff Help MDF1
  147.  * @desc 魔法防御1段階上昇のデバフのヘルプです。
  148.  * @default 魔法防御が25%上昇します。
  149.  *
  150.  * @param Buff Help MDF2
  151.  * @desc 魔法防御2段階上昇のデバフのヘルプです。
  152.  * @default 魔法防御が50%上昇します。
  153.  *
  154.  * @param Buff Help AGI1
  155.  * @desc 敏捷性1段階上昇のデバフのヘルプです。
  156.  * @default 敏捷性が25%上昇します。
  157.  *
  158.  * @param Buff Help AGI2
  159.  * @desc 敏捷性2段階上昇のデバフのヘルプです。
  160.  * @default 敏捷性が50%上昇します。
  161.  *
  162.  * @param Buff Help LUK1
  163.  * @desc 運1段階上昇のデバフのヘルプです。
  164.  * @default 運が25%上昇します。
  165.  *
  166.  * @param Buff Help LUK2
  167.  * @desc 運2段階上昇のデバフのヘルプです。
  168.  * @default 運が50%上昇します。
  169.  *
  170.  * @help------------------------------------------------------
  171.  *  プラグインコマンドはありません。
  172.  * ------------------------------------------------------
  173.  * ------------------------------------------------------
  174.  * 設定方法
  175.  * ------------------------------------------------------
  176.  *
  177.  * ステートのメモ欄に
  178.  *
  179.  * <ステートヘルプ>
  180.  * ステートの解説
  181.  * </ステートヘルプ>
  182.  *
  183.  * または、
  184.  *
  185.  * <STATE_HELP>
  186.  * ステートの解説
  187.  * </STATE_HELP>
  188.  *
  189.  * と記述することで、そのステートに説明を設定することができます。
  190.  *
  191.  * ------------------------------------------------------
  192.  * 仕様
  193.  * ------------------------------------------------------
  194.  *
  195.  * 戦闘中、アクターコマンドまたはパーティコマンドがアクティブな状態で、画面の左側をクリックすることで、
  196.  * ステートヘルプウィンドウを呼び出すことができます。
  197.  * この設定は、UseTouchCallをfalseにすることで無効化できます。
  198.  *
  199.  * ステートヘルプウィンドウは、ステートヘルプウィンドウ以外の領域をクリックすることでも、閉じることができます。
  200.  *
  201.  * ------------------------------------------------------
  202.  * 利用規約
  203.  * ------------------------------------------------------
  204.  * 当プラグインはMITライセンスで公開されています。
  205.  * 使用に制限はありません。商用、アダルト、いずれにも使用できます。
  206.  * 二次配布も制限はしませんが、サポートは行いません。
  207.  * 著作表示は任意です。行わなくても利用できます。
  208.  * 要するに、特に規約はありません。
  209.  * バグ報告や使用方法等のお問合せはネ実ツクールスレ、または、Twitterにお願いします。
  210.  * [url]https://twitter.com/yanatsuki_[/url]
  211.  * 素材利用は自己責任でお願いします。
  212.  * ------------------------------------------------------
  213.  * 更新履歴:
  214.  * ver1.03:
  215.  * 利用規約をMITライセンスに変更
  216.  * メニューで呼び出した際にエネミーが表示されるバグを修正
  217.  * ver1.02:
  218.  * YEP_X_BattleSysATBと競合しないように処理を修正
  219.  * ver1.01:
  220.  * 隠れているエネミーが表示されていたバグを修正
  221.  * ver1.00:
  222.  * 公開
  223.  */
  224.  
  225. (function(){
  226.  
  227.     var parameters = PluginManager.parameters('StateHelp');
  228.     var stateHelpText = String(parameters['State Help Text']);
  229.     var callStateWindowKey = String(parameters['Call State Window Key']);
  230.     var useTouchCall = String(parameters['Use Touch Call']) === 'true';
  231.     var addMenuStateHelp = String(parameters['Add Menu State Help']) === 'true';
  232.     var touchCallRect = String(parameters['Touch Call Rect'] || '0,0,128,444');
  233.     var buffHelp = [
  234.         String(parameters['Debuff Help HP2'] || '最大HPが50%減少します。'),
  235.         String(parameters['Debuff Help HP1'] || '最大HPが25%減少します。'),
  236.         String(parameters['Buff Help HP1'] || '最大HPが25%上昇します。'),
  237.         String(parameters['Buff Help HP2'] || '最大HPが50%上昇します。'),
  238.         String(parameters['Debuff Help MP2'] || '最大MPが50%減少します。'),
  239.         String(parameters['Debuff Help MP1'] || '最大MPが25%減少します。'),
  240.         String(parameters['Buff Help MP1'] || '最大MPが25%上昇します。'),
  241.         String(parameters['Buff Help MP2'] || '最大MPが50%上昇します。'),
  242.         String(parameters['Debuff Help ATK2'] || '攻撃力が50%減少します。'),
  243.         String(parameters['Debuff Help ATK1'] || '攻撃力が25%減少します。'),
  244.         String(parameters['Buff Help ATK1'] || '攻撃力が25%上昇します。'),
  245.         String(parameters['Buff Help ATK2'] || '攻撃力が50%上昇します。'),
  246.         String(parameters['Debuff Help DEF2'] || '防御力が50%減少します。'),
  247.         String(parameters['Debuff Help DEF1'] || '防御力が25%減少します。'),
  248.         String(parameters['Buff Help DEF1'] || '防御力が25%上昇します。'),
  249.         String(parameters['Buff Help DEF2'] || '防御力が50%上昇します。'),
  250.         String(parameters['Debuff Help MAT2'] || '魔法力が50%減少します。'),
  251.         String(parameters['Debuff Help MAT1'] || '魔法力が25%減少します。'),
  252.         String(parameters['Buff Help MAT1'] || '魔法力が25%上昇します。'),
  253.         String(parameters['Buff Help MAT2'] || '魔法力が50%上昇します。'),
  254.         String(parameters['Debuff Help MDF2'] || '魔法防御が50%減少します。'),
  255.         String(parameters['Debuff Help MDF1'] || '魔法防御が25%減少します。'),
  256.         String(parameters['Buff Help MDF1'] || '魔法防御が25%上昇します。'),
  257.         String(parameters['Buff Help MDF2'] || '魔法防御が50%上昇します。'),
  258.         String(parameters['Debuff Help AGI2'] || '敏捷性が50%減少します。'),
  259.         String(parameters['Debuff Help AGI1'] || '敏捷性が25%減少します。'),
  260.         String(parameters['Buff Help AGI1'] || '敏捷性が25%上昇します。'),
  261.         String(parameters['Buff Help AGI2'] || '敏捷性が50%上昇します。'),
  262.         String(parameters['Debuff Help LUK2'] || '運が50%減少します。'),
  263.         String(parameters['Debuff Help LUK1'] || '運が25%減少します。'),
  264.         String(parameters['Buff Help LUK1'] || '運が25%上昇します。'),
  265.         String(parameters['Buff Help LUK2'] || '運が50%上昇します。')
  266.     ]
  267.  
  268.     function Window_StateHelp() {
  269.         this.initialize.apply(this, arguments);
  270.     }
  271.  
  272.     Window_StateHelp.prototype = Object.create(Window_Selectable.prototype);
  273.     Window_StateHelp.prototype.constructor = Window_StateHelp;
  274.  
  275.     Window_StateHelp.prototype.initialize = function() {
  276.         this._posY = 120;
  277.         var width = this.windowWidth();
  278.         var height = this.windowHeight();
  279.         var x = (Graphics.boxWidth - width) / 2;
  280.         var y = this.posY();
  281.         this._topCol = 0;
  282.         Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  283.         this.refresh();
  284.         this.openness = 0;
  285.         this._subIndex = 0;
  286.     };
  287.  
  288.     Window_StateHelp.prototype.posY = function() {
  289.         return this._posY;
  290.     };
  291.  
  292.     Window_StateHelp.prototype.windowWidth = function() {
  293.         return 134 + this.fittingWidth(Math.max(Math.min(this.maxIcons(),this.numVisibleCols()),1));
  294.     };
  295.  
  296.     Window_StateHelp.prototype.numVisibleCols = function() {
  297.         return 16;
  298.     };
  299.  
  300.     Window_StateHelp.prototype.fittingWidth = function(numCols){
  301.         return numCols * this.itemWidth() + this.standardPadding() * 2;
  302.     };
  303.  
  304.     Window_StateHelp.prototype.windowHeight = function() {
  305.         return this.fittingHeight(this.numVisibleRows());
  306.     };
  307.  
  308.     Window_StateHelp.prototype.fittingHeight = function(numLines) {
  309.         return numLines * this.itemHeight() + this.standardPadding() * 2;
  310.     };
  311.  
  312.  
  313.     Window_StateHelp.prototype.numVisibleRows = function() {
  314.         return Math.min(this.maxItems(),7);
  315.     };
  316.  
  317.     Window_StateHelp.prototype.maxItems = function() {
  318.         return this.allBattleMembers().length;
  319.     };
  320.  
  321.     Window_StateHelp.prototype.allBattleMembers = function() {
  322.         var members = [];
  323.         if ($gameParty.inBattle()){
  324.             members = BattleManager.allBattleMembers().filter(function(obj){ return obj.isAppeared() });
  325.         } else {
  326.             members = $gameParty.members();
  327.         }
  328.         return members;
  329.     };
  330.  
  331.     Window_StateHelp.prototype.maxPageRows = function() {
  332.         return Math.min(this.maxItems(), 7);
  333.     };
  334.  
  335.     Window_StateHelp.prototype.itemWidth = function() {
  336.         return 40;
  337.     };
  338.  
  339.     Window_StateHelp.prototype.itemHeight = function() {
  340.         return 40;
  341.     };
  342.  
  343.     Window_StateHelp.prototype.maxIcons = function() {
  344.         var n = 0;
  345.         for(var i=0;i<this.maxItems();i++){
  346.             var chr = BattleManager.allBattleMembers()[i];
  347.             if (n < chr.allIcons().length) { n = chr.allIcons().length }
  348.         }
  349.         return n;
  350.     };
  351.  
  352.     Window_StateHelp.prototype.maxColItems = function() {
  353.         return this.maxColIndex(this.index());
  354.     };
  355.  
  356.     Window_StateHelp.prototype.maxColIndex = function(index) {
  357.         var character = BattleManager.allBattleMembers()[index];
  358.         if (!character){ return 1 }
  359.         return Math.max(character.allIcons().length,1);
  360.     };
  361.  
  362.     Window_StateHelp.prototype.maxTopCols = function() {
  363.         return Math.max(this.numVisibleCols - this.maxColIndex(),0);
  364.     };
  365.  
  366.     Window_StateHelp.prototype.colWidth = function(index) {
  367.         return (this.maxColIndex(index)-1) * this.itemWidth();
  368.     };
  369.  
  370.     Window_StateHelp.prototype.adjustWindowSize = function() {
  371.         this.width = this.windowWidth();
  372.         this.height = this.windowHeight();
  373.         this.x = (Graphics.boxWidth - this.width) / 2;
  374.         this.y = this.posY();
  375.     };
  376.  
  377.     Window_StateHelp.prototype.itemRect = function(index) {
  378.         var rect = Window_Selectable.prototype.itemRect.call(this,index);
  379.         rect.x += 130 + (this.itemWidth() * (this._subIndex - this._topCol));
  380.         return rect;
  381.     };
  382.  
  383.     Window_StateHelp.prototype.updateHelp = function() {
  384.         Window_Selectable.prototype.updateHelp.call(this);
  385.         var character = BattleManager.allBattleMembers()[this.index()];
  386.         if (character){
  387.             var states = character.addedShowStates();
  388.             var buffs = character.addedShowBuffs();
  389.             var text = '';
  390.             if (this._subIndex < states.length){
  391.                 text = DataManager.getStateHelp(states[this._subIndex]);
  392.             } else if (this._subIndex < (states.length + buffs.length)) {
  393.                 var buff = buffs[this._subIndex - states.length];
  394.                 text = DataManager.getBuffHelp(buff);
  395.             }
  396.             this._helpWindow.setText(text);
  397.         } else {
  398.             this._helpWindow.setText('');
  399.         }
  400.     };
  401.  
  402.     Window_StateHelp.prototype.checkTopCol = function() {
  403.         if (this._subIndex >= this.numVisibleCols()){
  404.             this._topCol = this._subIndex - this.numVisibleCols() + 1;
  405.             this.refresh();
  406.         } else if (this._subIndex <= this._topCol){
  407.             this._topCol = this._subIndex;
  408.             this.refresh();
  409.         }
  410.     };
  411.  
  412.     Window_StateHelp.prototype.select = function(index) {
  413.         this.checkTopCol();
  414.         Window_Selectable.prototype.select.call(this,index);
  415.     };
  416.  
  417.     Window_StateHelp.prototype.initSelect = function() {
  418.         this.select(0);
  419.         this._subIndex = 0;
  420.         this._lastSubIndex = this._subIndex;
  421.     };
  422.  
  423.     Window_StateHelp.prototype.cursorRight = function(wrap) {
  424.         this._subIndex = (this._subIndex + 1) % this.maxColItems();
  425.         this.select(this.index());
  426.     };
  427.  
  428.     Window_StateHelp.prototype.cursorLeft = function(wrap) {
  429.         this._subIndex = (this._subIndex + (this.maxColItems() - 1)) % this.maxColItems();
  430.         this.select(this.index());
  431.     };
  432.  
  433.     Window_StateHelp.prototype.cursorUp = function(wrap) {
  434.         Window_Selectable.prototype.cursorUp.call(this,wrap);
  435.         this._subIndex = Math.min(this._subIndex,this.maxColItems()-1);
  436.         this.select(this.index());
  437.     };
  438.  
  439.     Window_StateHelp.prototype.cursorDown = function(wrap) {
  440.         Window_Selectable.prototype.cursorDown.call(this,wrap);
  441.         this._subIndex = Math.min(this._subIndex,this.maxColItems()-1);
  442.         this.select(this.index());
  443.     };
  444.  
  445.     Window_StateHelp.prototype.processCursorMove = function() {
  446.         Window_Selectable.prototype.processCursorMove.call(this);
  447.         if (this._lastSubIndex !== this._subIndex){
  448.             if (this.active){ SoundManager.playCursor() }
  449.             this._lastSubIndex = this._subIndex;
  450.         }
  451.     };
  452.  
  453.     Window_StateHelp.prototype.scrollRight = function() {
  454.         if (this._topCol + 1 < this.maxTopCols()) {
  455.             this._topCol += 1;
  456.         }
  457.     };
  458.  
  459.     Window_Selectable.prototype.scrollLeft = function() {
  460.         if (this._topCol > 0) {
  461.             this._topCol -= 1;
  462.         }
  463.     };
  464.  
  465.     Window_StateHelp.prototype.onTouch = function(triggered) {
  466.         var lastIndex = this.index();
  467.         var x = this.canvasToLocalX(TouchInput.x);
  468.         var y = this.canvasToLocalY(TouchInput.y);
  469.         var hitIndex = this.hitTest(x, y);
  470.         if (hitIndex >= 0) {
  471.             if (hitIndex === this.index()) {
  472.                 if (triggered && this.isTouchOkEnabled()) {
  473.                     this.processOk();
  474.                 }
  475.             } else if (this.isCursorMovable()) {
  476.                 this.select(hitIndex);
  477.             }
  478.         } else if (this._stayCount >= 10) {
  479.             if (y < this.padding) {
  480.                 this.cursorUp();
  481.             } else if (y >= this.height - this.padding) {
  482.                 this.cursorDown();
  483.             } else if (x < 132) {
  484.                 this.cursorLeft();
  485.             } else if (x >= this.width - this.padding) {
  486.                 this.cursorRight();
  487.             }
  488.         }
  489.         if (this.index() !== lastIndex) {
  490.             if (this.active){ SoundManager.playCursor() }
  491.         } else if (this._subIndex !== this._lastSubIndex) {
  492.             if (this.active){ SoundManager.playCursor() }
  493.             this._lastSubIndex = this._subIndex;
  494.         }
  495.     };
  496.  
  497.     Window_StateHelp.prototype.hitTest = function(x, y) {
  498.         if (this.isContentsArea(x, y)) {
  499.             var cx = x - this.padding;
  500.             var cy = y - this.padding;
  501.             var topIndex = this.topIndex();
  502.             for (var i = 0; i < this.maxPageItems(); i++) {
  503.                 var index = topIndex + i;
  504.                 if (index < this.maxItems()) {
  505.                     var rect = this.itemRect(index);
  506.                     var left = 132;
  507.                     var right = left + rect.width + this.colWidth(index);
  508.                     var bottom = rect.y + rect.height;
  509.                     if (cx >= left && cy >= rect.y && cx < right && cy < bottom) {
  510.                         this._subIndex = Math.floor((cx - 132) / this.itemWidth()) + this._topCol;
  511.                         this.select(index);
  512.                         return index;
  513.                     }
  514.                 }
  515.             }
  516.         }
  517.         return -1;
  518.     };
  519.  
  520.     Window_StateHelp.prototype.drawItem = function(index) {
  521.         var rect = this.itemRect(index);
  522.         var character = this.allBattleMembers()[index];
  523.         //var rect = this.itemRectForText(index);
  524.         var y = rect.y;
  525.         var x = 0;
  526.         var iw = this.itemWidth();
  527.         var c = Math.min(character.allIcons().length,this.numVisibleCols());
  528.         this.drawText(character.name(),x,y,120);
  529.         this.drawText(':',120,y);
  530.         for (var i=this._topCol;i<(c+this._topCol);i++){
  531.             var ii = i-this._topCol;
  532.             this.drawIcon(character.allIcons()[i],x+iw*ii+134,y+(iw-32)/2);
  533.         }
  534.     };
  535.  
  536.     Window_StateHelp.prototype.refresh = function() {
  537.         this.adjustWindowSize();
  538.         this.createContents();
  539.         Window_Selectable.prototype.refresh.call(this);
  540.     };
  541.  
  542.     ///////////////////////////////////////////////////////////////////////////////////
  543.  
  544.     DataManager.getStateHelp = function(state) {
  545.         if (!state) { return '' }
  546.         if (state.description){ return state.description }
  547.         state.description = '';
  548.         var texts = state.note.split('\n');
  549.         var description = '';
  550.         var start = false;
  551.         for (var i=0;i<texts.length;i++){
  552.             var text = texts[i];
  553.             if (text.match(/^<\/ステートヘルプ>/) || text.match(/^<\/STATE_HELP>/)){
  554.                 start = false;
  555.                 state.description = description;
  556.             } else if (text.match(/^<ステートヘルプ>/)  || text.match(/^<STATE_HELP>/)){
  557.                 start = true;
  558.             } else if (start){
  559.                 description += text + '\n';
  560.             }
  561.         }
  562.         return state.description;
  563.     };
  564.  
  565.     DataManager.getBuffHelp = function(buff) {
  566.         if (!buff){ return '' }
  567.         var n = buff[0]*4+buff[1]+2;
  568.         if (buff[1] > 0){ n -= 1 }
  569.         return buffHelp[n];
  570.     };
  571.  
  572.     ///////////////////////////////////////////////////////////////////////////////////
  573.  
  574.     Game_BattlerBase.prototype.addedShowStates = function() {
  575.         return this.states().map(function(state) {
  576.             return state;
  577.         }).filter(function(state) {
  578.             return state.iconIndex > 0;
  579.         });
  580.     };
  581.  
  582.     Game_BattlerBase.prototype.addedShowBuffs = function() {
  583.         var result = [];
  584.         for (var i = 0; i < this._buffs.length; i++) {
  585.             if (this._buffs[i] !== 0) {
  586.                 result.push([i,this._buffs[i]]);
  587.             }
  588.         }
  589.         return result;
  590.     };
  591.  
  592.     ///////////////////////////////////////////////////////////////////////////////////
  593.  
  594.     var _sHelp_WPCommand_makeCommandList = Window_PartyCommand.prototype.makeCommandList;
  595.     Window_PartyCommand.prototype.makeCommandList = function() {
  596.         _sHelp_WPCommand_makeCommandList.call(this);
  597.         if (stateHelpText){ this.addCommand(stateHelpText,  'stateHelp') }
  598.     };
  599.  
  600.     ///////////////////////////////////////////////////////////////////////////////////
  601.  
  602.     var _sHelp_SBattle_createDisplayObjects = Scene_Battle.prototype.createDisplayObjects;
  603.     Scene_Battle.prototype.createDisplayObjects = function() {
  604.         _sHelp_SBattle_createDisplayObjects.call(this);
  605.         this.createStateHelpWindow();
  606.         this._windowLayer.removeChild(this._helpWindow);
  607.         this.addWindow(this._helpWindow);
  608.     };
  609.  
  610.     Scene_Battle.prototype.createStateHelpWindow = function() {
  611.         this._stateHelpWindow = new Window_StateHelp();
  612.         this._stateHelpWindow.setHelpWindow(this._helpWindow);
  613.         this._stateHelpWindow.setHandler('cancel', this.cancelStateHelp.bind(this));
  614.         this.addWindow(this._stateHelpWindow);
  615.     };
  616.  
  617.     var _sHelp_SBattle_createPartyCommandWindow = Scene_Battle.prototype.createPartyCommandWindow;
  618.     Scene_Battle.prototype.createPartyCommandWindow = function() {
  619.         _sHelp_SBattle_createPartyCommandWindow.call(this);
  620.         this._partyCommandWindow.setHandler('stateHelp', this.commandStateHelp.bind(this));
  621.     };
  622.  
  623.     Scene_Battle.prototype.commandStateHelp = function() {
  624.         this._stateHelpWindow.refresh();
  625.         this._stateHelpWindow.initSelect();
  626.         this._stateHelpWindow.activate();
  627.         this._stateHelpWindow.open();
  628.         this._helpWindow.show();
  629.         this._callPhaseWindow = null;
  630.         if (this._partyCommandWindow.isOpen()) this._activedCommand = 1;
  631.         if (this._actorCommandWindow.isOpen()) this._activedCommand = 2;
  632.         this._partyCommandWindow.deactivate();
  633.         this._actorCommandWindow.deactivate();
  634.         BattleManager._phase = 'input';
  635.     };
  636.  
  637.     Scene_Battle.prototype.cancelStateHelp = function() {
  638.         this._stateHelpWindow.deactivate();
  639.         this._stateHelpWindow.close();
  640.         this._helpWindow.hide();
  641.         if (BattleManager.isInputting()){
  642.             if (this._activedCommand === 1){
  643.                 this._partyCommandWindow.activate();
  644.             } else if (this._activedCommand === 2) {
  645.                 this._actorCommandWindow.activate();
  646.             }
  647.             /*
  648.             if (BattleManager.actor()){
  649.                 this._actorCommandWindow.activate();
  650.             }else{
  651.                 this._partyCommandWindow.activate();
  652.             }
  653.             */
  654.         }
  655.     };
  656.  
  657.     var _sHelp_SBattle_changeInputWindow = Scene_Battle.prototype.changeInputWindow;
  658.     Scene_Battle.prototype.changeInputWindow = function() {
  659.         if(!this._stateHelpWindow.active){
  660.             _sHelp_SBattle_changeInputWindow.call(this);
  661.         }
  662.     };
  663.  
  664.     var _sHelp_SBattle_update = Scene_Battle.prototype.update;
  665.     Scene_Battle.prototype.update = function() {
  666.         _sHelp_SBattle_update.call(this);
  667.         if (this._actorCommandWindow.active || this._partyCommandWindow.active) {
  668.             if (Input.isTriggered(callStateWindowKey) || this.onTouchCallStateHelp()){
  669.                 SoundManager.playOk();
  670.                 this.commandStateHelp();
  671.             }
  672.         } else if (this._stateHelpWindow.active) {
  673.             if (this.onTouchCancelStateHelp()){
  674.                 SoundManager.playCancel();
  675.                 this.cancelStateHelp();
  676.             }
  677.         }
  678.     };
  679.  
  680.     Scene_Battle.prototype.onTouchCallStateHelp = function() {
  681.         if (!useTouchCall){ return false }
  682.         if (TouchInput.isTriggered()){
  683.             var touchPos = touchCallRect.split(',');
  684.             var x = TouchInput.x;
  685.             var y = TouchInput.y;
  686.             var ax = Number(touchPos[0]);
  687.             var xw = ax + Number(touchPos[2]);
  688.             var ay = Number(touchPos[1]);
  689.             var yh = ay + Number(touchPos[3]);
  690.             return x >= ax && x <= xw && y >= ay && y <= yh;
  691.         }
  692.         return false;
  693.     };
  694.  
  695.     Scene_Battle.prototype.onTouchCancelStateHelp = function() {
  696.         if (TouchInput.isTriggered()){
  697.             var x = TouchInput.x;
  698.             var y = TouchInput.y;
  699.             var ax = this._stateHelpWindow.x;
  700.             var xw = ax + this._stateHelpWindow.width;
  701.             var ay = this._stateHelpWindow.y;
  702.             var yh = ay + this._stateHelpWindow.height;
  703.             return !(x >= ax && x <= xw && y >= ay && y <= yh);
  704.         }
  705.         return false;
  706.     };
  707.     ////////////////////////////////////////////////////////////////////////////////////   
  708.  
  709.     var _sHelp_WMCommand_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
  710.     Window_MenuCommand.prototype.addOriginalCommands = function() {
  711.         _sHelp_WMCommand_addOriginalCommands.call(this);
  712.         if (stateHelpText && addMenuStateHelp){ this.addCommand(stateHelpText, 'stateHelp', true) }
  713.     };
  714.  
  715.     ///////////////////////////////////////////////////////////////////////////////////
  716.  
  717.     var _sHelp_SMenu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
  718.     Scene_Menu.prototype.createCommandWindow = function() {
  719.         _sHelp_SMenu_createCommandWindow.call(this);
  720.         this._commandWindow.setHandler('stateHelp',   this.commandStateHelp.bind(this));
  721.     };
  722.  
  723.     Scene_Menu.prototype.commandStateHelp = function() {
  724.         SceneManager.push(Scene_StateHelp);
  725.     };
  726.  
  727.     ///////////////////////////////////////////////////////////////////////////////////
  728.  
  729.  
  730.     function Scene_StateHelp() {
  731.         this.initialize.apply(this, arguments);
  732.     };
  733.  
  734.     Scene_StateHelp.prototype = Object.create(Scene_MenuBase.prototype);
  735.     Scene_StateHelp.prototype.constructor = Scene_StateHelp;
  736.  
  737.     Scene_StateHelp.prototype.create = function() {
  738.         Scene_MenuBase.prototype.create.call(this);
  739.         this.createAllWindows();
  740.     };
  741.  
  742.     Scene_StateHelp.prototype.createAllWindows = function() {
  743.         this.createHelpWindow();
  744.         this.createStateHelpWindow();
  745.     };
  746.  
  747.     Scene_StateHelp.prototype.createStateHelpWindow = function() {
  748.         this._stateHelpWindow = new Window_StateHelp();
  749.         this._stateHelpWindow.setHelpWindow(this._helpWindow);
  750.         this._stateHelpWindow.setHandler('cancel', this.returnScene.bind(this));
  751.         this._stateHelpWindow.show();
  752.         this._stateHelpWindow.openness = 255;
  753.         this._stateHelpWindow.initSelect();
  754.         this._stateHelpWindow.activate();
  755.         this._stateHelpWindow.y = (Graphics.boxHeight - this._helpWindow.height) / 2 - (this._stateHelpWindow.height / 2) + this._helpWindow.height;
  756.         this._stateHelpWindow._posY = this._stateHelpWindow.y;
  757.         this.addWindow(this._stateHelpWindow);
  758.     };
  759.  
  760.     Scene_StateHelp.prototype.returnScene = function() {
  761.         this.popScene(this);
  762.     };
  763.  
  764.     Scene_StateHelp.prototype.update = function() {
  765.         Scene_Base.prototype.update.call(this);
  766.         if (this.onTouchCancelStateHelp()){ this.returnScene() }
  767.     };
  768.  
  769.     Scene_StateHelp.prototype.onTouchCancelStateHelp = function() {
  770.         if (TouchInput.isTriggered()){
  771.             var x = TouchInput.x;
  772.             var y = TouchInput.y;
  773.             var ax = this._stateHelpWindow.x;
  774.             var xw = ax + this._stateHelpWindow.width;
  775.             var ay = this._stateHelpWindow.y;
  776.             var yh = ay + this._stateHelpWindow.height;
  777.             return !(x >= ax && x <= xw && y >= ay && y <= yh);
  778.         }
  779.         return false;
  780.     };
  781. }());
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-4-27 22:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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