Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 10 additions & 113 deletions Mano_ChestList.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
* 画面内にある宝箱で、開けていないものをすべて光らせます。
* 光り方ですが、バルーンの再生で行います。
*
* プラグインコマンド「ChestFlash」で、開けていない宝箱にバルーンが付きます
* プラグインコマンド「ChestFlash」で、開けていない宝箱にバルーンが付きます。
* プラグインコマンド「CountChest」で、開けていない宝箱の数を表示します。
*
* @param balloonId
* @desc chestFlash()で使用するバルーンの番号です。
Expand Down Expand Up @@ -85,12 +86,6 @@
* @type boolean
* @default true
*
* @param CountChest
* @desc 簡易版盗賊の鼻を使うかを決めます
* イベントコマンドを書くのが面倒という人向け
* @type boolean
* @default false
*
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このパラメータはワンボタンで起動することを想定した簡易版盗賊の鼻のために書かれたもののようです。

ワンボタンで起動する盗賊の鼻は長らくWIPの状態で放置されている上、以前お話した際にワンボタンコモンで実現可能であるため積極的に実装するつもりはないと仰っていたので、実際に使われているメッセージ周りの設定以外を削除しています。

* @param CountChestText
* @desc 簡易版盗賊の鼻のメッセージです。
* @default このあたりにはあと%1個、宝物があるようだ。
Expand Down Expand Up @@ -143,63 +138,11 @@
* @type variable
* @default 20
*
*/
/*~struct~CommonDefine:
*
* @param enableSwitch
* @desc 指定したスイッチがONの時だけ、呼びだしを行います。
* ゲームの進行で機能が追加される場合を想定しています。
* @type switch
*
* @param symbol
* @desc Input.isTriggered()の引数として使われます
*
* @param text
* @desc コマンド名称です
*
* @param mandatory
* @desc inputConfigの方で必須指定されたものとして扱います。
* @type boolean
* @default false
*
* @param keycode
* @desc キーボードの割り当てです
* キーコードは各自調べてください
* @type number
* @command showChestCountMessage
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MV用プラグインコマンドの CountChest と同じ処理を行うMZ用コマンドです。

* @text 開けていない宝箱の数を表示
* @desc 開けていない宝箱の数をメッセージで表示します。
*
* @param padButton
* @desc ゲームパッドの割り当てです
* カッコ内はツクールのデフォルトでの割り当てです
* @type select
* @default -1
* @option non(割り当てなし)
* @value -1
* @type select
* @option button6
* @value 6
* @option button7
* @value 7
* @option button8
* @value 8
* @option button9
* @value 9
* @option button10
* @value 10
* @option button11
* @value 11
* @option button0(ok/決定)
* @value 0
* @option button1(cancel/キャンセル)
* @value 1
* @option button2(shift/ダッシュ)
* @value 2
* @option button3(menu/メニュー)
* @value 3
* @option button4(pageup)
* @value 4
* @option button5(pagedown)
* @value 5
*/
*/

/**
* TODO
Expand All @@ -218,41 +161,11 @@
* 第2引数に'B','C','D'など任意のセルフスイッチに割り当てられるキーを指定することで、
* 他のセルフスイッチも調べられます。
*
* @param oneButtonCountChestCall
* @desc キーボードやゲームパッドから1ボタンで盗賊の鼻を起動します。
* @type boolean
* @on 機能を使う
* @off 機能を使わない
* @default false
*
*/
(function(){
'use strict'
const PLUGIN_NAME='Mano_ChestList';

function createCommonDefine(param){
const obj =JSON.parse(param);
return{
mandatory:Boolean(obj.mandatory),
text:String(obj.text),
symbol:String(obj.symbol),
enableSwitch:Number(obj.enableSwitch),
keycode:String(obj.keycode),
padButton:String(obj.padButton),
};
}

function createCountChestSetting(params){
if(params.CountChest!=='true'){
return null;
}
return {
countChestEmptyText:String(params.CountChestEmptyText),
inputDefine :createCommonDefine(params.CountChestinputSetting),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CountChestinputSetting はパラメータには存在せず、簡易版盗賊の鼻設定をONにするとプラグインごと動かなくなっていました。
ワンボタン起動用のものと判断し、削除しています。

};
}


const setting=(function(){
const params = PluginManager.parameters('Mano_ChestList');

Expand All @@ -269,18 +182,10 @@ const setting=(function(){
flashWait:(params.flashWait==='true'),
countChestText:String(params.CountChestText),
countChestEmptyText:String(params.CountChestEmptyText),
countChest:createCountChestSetting(params),
};
return result;
})();



//const setting =createSetting();


const KEYSYMBOL_CHESTCOUNT ='ChestCount';

/**
* @param {[]} array
* @param {Function } func
Expand Down Expand Up @@ -386,16 +291,6 @@ Game_Interpreter.prototype.chestFlash=function(){
this.setWaitMode('balloon');
}
};
function argParse(arg){
return {

flash:"true"===arg.flash
};
}

function chestSearch(arg){

}

const Game_Interpreter_pluginCommand =Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand =function(command, args){
Expand Down Expand Up @@ -434,7 +329,9 @@ PluginManager.registerCommand(PLUGIN_NAME,"countClosedChest",(arg)=>{
const result = countClosedChest();
$gameVariables.setValue(variableId,result);
});
PluginManager.registerCommand(PLUGIN_NAME,"showChestCountMessage",function(){
$gameMap.showChestCountMessage();
});



})();
})();