【解決済】commandWindowの連続処理について

よしだとものり
記事: 134
登録日時: 2017年7月25日(火) 23:18

【解決済】commandWindowの連続処理について

投稿記事by よしだとものり » 2017年9月30日(土) 19:49

例えばHTMLのボタンのonclickにconsole.logを出すようにして
ボタンを連打するとログが連続で表示されると思います。

ツクールのcommandWindowを以下の手順で表示させ、コマンドをクリックすると
1回だけしか実行されません。

これを連画面遷移しないで、連続して実行されるようにする方法はないのでしょうか?

コード: 全て選択

//コマンドウインドウの表示処理&ハンドラ登録

       this._commandWindow = new Window_BZ_Command(0,cy);
       this._commandWindow.y = 0;
       this._commandWindow.setHandler('gup',    this.gup.bind(this));
       this._commandWindow.setHandler('gdown',   this.gdown.bind(this));
       this._commandWindow.setHandler('uplist', this.uplist.bind(this));
       this._commandWindow.setHandler('mylist',   this.mylist.bind(this));
       this._commandWindow.setHandler('exec1', this.exec1.bind(this));
       this._commandWindow.setHandler('itemlist', this.itemlist.bind(this));

      this._commandWindow.show();
      this._commandWindow.move(0,this._goldWindow.height,
      this._commandWindow.width,this._commandWindow.height);
       this.addWindow(this._commandWindow);
       
       
  //コマンドウインドウのクラス定義
 
  Window_BZ_Command.prototype = Object.create(Window_HorzCommand.prototype);
Window_BZ_Command.prototype.constructor = Window_BZ_Command

Window_BZ_Command.prototype.initialize = function(width, purchaseOnly) {
    this._windowWidth = width;
    this._purchaseOnly = purchaseOnly;
    Window_HorzCommand.prototype.initialize.call(this, 0, 0);


   this.refresh();
   this.select(0);
   this.activate();

};

Window_BZ_Command.prototype.windowWidth = function() {
    return 816;
};

Window_BZ_Command.prototype.maxCols = function() {
    return 6;
};

Window_BZ_Command.prototype.makeCommandList = function() {
   //値段を上げる
    this.addCommand("価格↑",    'gup');
   //値段を下げる
    this.addCommand("価格↓",   'gdown');
   //落札リスト
    this.addCommand("落札画面",   'uplist');
   //自分の出品リスト
    this.addCommand("出品画面", 'itemlist');
   //自分の出品リスト
    this.addCommand("出品管理", 'mylist');
   //自分の出品リスト
    this.addCommand("実行", 'exec1');
};



最後に編集したユーザー よしだとものり on 2017年10月01日(日) 14:05 [ 編集 1 回目 ]

アバター
ツミオ
記事: 83
登録日時: 2017年4月02日(日) 13:46
連絡を取る:

Re: commandWindowの連続処理について

投稿記事by ツミオ » 2017年9月30日(土) 20:03

こんばんは。

決定ボタン入力後、ウィンドウに対するキー入力が無効化されてしまうということでしたら、イベントハンドラーの中で任意のウィンドウのインスタンスをactivate()させるとうまくいくと思います。
全然関係ないことを言っていたらすみません。
【Twitter】https://twitter.com/TsumioNtGame/
【GitHub】https://github.com/Tsumio/rmmv-plugins

有償の依頼も募集中。
今まで有償で制作したものは実績をご覧ください。
よしだとものり
記事: 134
登録日時: 2017年7月25日(火) 23:18

Re: commandWindowの連続処理について

投稿記事by よしだとものり » 2017年9月30日(土) 21:35

回答、ありがとうございます。
まだactivate()を入れただけですので、完全に解決できたかは
断言できませんが、連続して実行することはできましたので
これで作っていこうと思います。
完成しましたら解決済に致します。

“MV:質問” へ戻る