♰nu-ma♰のゲームログ

~三度の飯よりゲーム好き~

挑戦!RPGツクールMV【4日目】

脱出ゲームは今回で終わり

本日の更新を最後に脱出ゲーム製作は一旦ストップします。
また気が向いたら作ります。
次はミニゲームRPGを製作をする予定です。

アイテムカテゴリを省略するプラグイン

友達にプレイしてもらって言われたのですが、
アイテム選択時に一々カテゴリを決定しないといけないのが
煩わしいとのことでした。

f:id:Tnu-maT:20160205223939p:plain
メニューのアイテムを押すと上図のようにカテゴリ選択から始まる。

f:id:Tnu-maT:20160205223918p:plain
カテゴリを決定して初めてアイテムを選択できる。


アイテムが見えているのに直接クリックできないのは確かに煩わしいですよね。
スマホでプレイするとなれば、
なおさら直接タッチができないことに違和感を覚えると思います。
僕も最初煩わしいと思ったのですが、変にいじってエラーが起きたら嫌だし、
めんどくさかったので妥協してましたが、(本音)
友人に言われたのを機にプラグインを作ることにしました。
NoItemCategory.js

(function() {
	var _Scene_Item_create = Scene_Item.prototype.create;    
	Scene_Item.prototype.create = function() {
    	_Scene_Item_create.call(this);
    	this._categoryWindow.deactivate();
    	this.onCategoryOk();
    	this._categoryWindow.hide();
	};

Scene_Item.prototype.onItemCancel = function() {
    this._itemWindow.deselect();
    this.popScene();
};

	Scene_Item.prototype.createItemWindow = function() {
    	var wy = this._categoryWindow.y;
    	var wh = Graphics.boxHeight - wy;
    	this._itemWindow = new Window_ItemList(0, wy, Graphics.boxWidth, wh);
    	this._itemWindow.setHelpWindow(this._helpWindow);
    	this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
    	this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
    	this.addWindow(this._itemWindow);
    	this._categoryWindow.setItemWindow(this._itemWindow);
	};

	Window_ItemCategory.prototype.makeCommandList = function() {
    	this.addCommand(TextManager.item,    'item');
    	//this.addCommand(TextManager.weapon,  'weapon');
    	//this.addCommand(TextManager.armor,   'armor');
    	//this.addCommand(TextManager.keyItem, 'keyItem');
	};

})();

カテゴリ別に分ける必要が無ければ省略した方がいいですよね。
アイテム選択と同時にアイテム使用も行おうと思ったのですが、
そうするとアイテムの説明欄が表示できなくなるのでやめました。

ついでに、部屋移動の判定も少し修正しました。
以上で、脱出ゲーム製作は一旦終了とします。
ではまた。

youtu.be