-
Notifications
You must be signed in to change notification settings - Fork 125
/
BlueMushroom.js
137 lines (124 loc) · 4.87 KB
/
BlueMushroom.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//=============================================================================
// BlueMushroom.js
// ----------------------------------------------------------------------------
// Copyright (c) 2015 Triacontane
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 1.0.0 2016/08/16 初版
// ----------------------------------------------------------------------------
// [Blog] : http://triacontane.blogspot.jp/
// [Twitter]: https://twitter.com/triacontane/
// [GitHub] : https://github.com/triacontane/
//=============================================================================
/*:
* @plugindesc Plugin That ...
* @author triacontane
*
* @param param
* @desc parameter description
* @default default value
*
* @help Plugin That ...
*
* Plugin Command
* XXXXX [XXX]
* ex1:XXXXX 1
*
* This plugin is released under the MIT License.
*/
/*:ja
* @plugindesc ビジュアルノベルプラグイン
* @author トリアコンタン
*
* @param パラメータ
* @desc パラメータ説明
* @default デフォルト値
*
* @help RPGツクールMVでビジュアルノベルを手軽に作成するための
* プラグインです。
*
* プラグインコマンド詳細
* イベントコマンド「プラグインコマンド」から実行。
* (パラメータの間は半角スペースで区切る)
*
* このプラグインにはプラグインコマンドはありません。
*
* 利用規約:
* 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
* についても制限はありません。
* このプラグインはもうあなたのものです。
*/
(function() {
'use strict';
var pluginName = 'BlueMushroom';
var metaTagPrefix = 'BlueMushroom';
var getCommandName = function(command) {
return (command || '').toUpperCase();
};
var getParamOther = function(paramNames) {
if (!Array.isArray(paramNames)) paramNames = [paramNames];
for (var i = 0; i < paramNames.length; i++) {
var name = PluginManager.parameters(pluginName)[paramNames[i]];
if (name) return name;
}
return null;
};
var getParamString = function(paramNames) {
var value = getParamOther(paramNames);
return value === null ? '' : value;
};
var getParamNumber = function(paramNames, min, max) {
var value = getParamOther(paramNames);
if (arguments.length < 2) min = -Infinity;
if (arguments.length < 3) max = Infinity;
return (parseInt(value, 10) || 0).clamp(min, max);
};
var getParamBoolean = function(paramNames) {
var value = getParamOther(paramNames);
return (value || '').toUpperCase() === 'ON';
};
//=============================================================================
// Game_Interpreter
// プラグインコマンドを追加定義します。
//=============================================================================
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
_Game_Interpreter_pluginCommand.apply(this, arguments);
if (!command.match(new RegExp('^' + metaTagPrefix))) return;
try {
this.pluginCommandBlueMushroom(command.replace(metaTagPrefix, ''), args);
} catch (e) {
if ($gameTemp.isPlaytest() && Utils.isNwjs()) {
var window = require('nw.gui').Window.get();
if (!window.isDevToolsOpen()) {
var devTool = window.showDevTools();
devTool.moveTo(0, 0);
devTool.resizeTo(window.screenX + window.outerWidth, window.screenY + window.outerHeight);
window.focus();
}
}
console.log('プラグインコマンドの実行中にエラーが発生しました。');
console.log('- コマンド名 : ' + command);
console.log('- コマンド引数 : ' + args);
console.log('- エラー原因 : ' + e.stack || e.toString());
}
};
Game_Interpreter.prototype.pluginCommandBlueMushroom = function(command, args) {
switch (getCommandName(command)) {
case 'XXXXX' :
break;
}
};
//=============================================================================
// Game_BlueMushroom
// BlueMushroom
//=============================================================================
function Game_BlueMushroom() {
this.initialize.apply(this, arguments);
}
Game_BlueMushroom.prototype.constructor = Game_BlueMushroom;
Game_BlueMushroom.prototype.initialize = function() {
};
})();