ページ 11

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

Posted: 2017年9月30日(土) 19:49
by よしだとものり
例えば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');
};




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

Posted: 2017年9月30日(土) 20:03
by ツミオ
こんばんは。

決定ボタン入力後、ウィンドウに対するキー入力が無効化されてしまうということでしたら、イベントハンドラーの中で任意のウィンドウのインスタンスをactivate()させるとうまくいくと思います。
全然関係ないことを言っていたらすみません。

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

Posted: 2017年9月30日(土) 21:35
by よしだとものり
回答、ありがとうございます。
まだactivate()を入れただけですので、完全に解決できたかは
断言できませんが、連続して実行することはできましたので
これで作っていこうと思います。
完成しましたら解決済に致します。