ゲームの操作に関する機能 – Mano_InputConfig.js

タイトル
ゲームの操作に関する機能
作者名
ヘルプ
※日本語テキストは下の方にあるのでスクロールしてください

Loads the settings at game startup as initial values.
Detects input changes regardless of where the plugin is installed.
It is OK even if the button is modified by another plug-in.

The config data set by this plug-in is recorded in the file.
If you install a new plugin,
Please reset the config with "Reset to default" after starting the game.

■ What to do if strange characters such as "? KEY: Symbol" are displayed
Occurs because the input added by another plugin is unknown.
If the above display is displayed,
It can be handled by adding an element to extendsMapper.
1. Add an element
2. Try either of the following AB methods.
Copy the character corresponding to A: KEY and paste it into Key Setting.
B: Copy the characters corresponding to Symbol and paste them into symbol.
Be careful not to confuse the case.

■ What to do if a display like unknow: XXXX appears
The following causes are possible.
-Symbols were set after the game started (after Scene_Boot)
-Initialization process was not performed correctly
It may be improved by moving this plugin down.

■ Button operation diffusion function
If the operation is set by another plugin,
May be set on only one of the gamepad / keyboard.
In such a case, you can operate it from others by setting it in extendsMapper.
For example, suppose that the operation is set when you press only T on the keyboard.
If you want to set the operation for the buttons on the gamepad in this state, set as follows.
Key setting: T
Pad button: (any button number)
By doing this, this plugin will read the behavior set for T on the keyboard and
Set so that the same function can be used with the buttons on the gamepad.
The same is true for the opposite.

If the operation is set on both the keyboard and the gamepad,
Determine which one to prioritize in the overwrite setting.
When using manual symbol settings (for advanced users)
Ignore the priority settings and use the contents set manually.

■ Common event call button
extendsMapper has an item called "Events".
If you set an event here, the event will be called when the button is pressed.
You can use it to create a function to open the map when you press the button.

■All functions can be used without eval ()
There are no items in this plugin that use eval ().
If you're writing a JavaScript expression for use with eval (),
you're wrong.

■ If you want to control the transition with a script
Used when modifying other plugins or switching scenes directly with a script.
SceneManager.push (Mano_InputConfig.Scene_GamepadConfig); Gamepad Config
SceneManager.push (Mano_InputConfig.Scene_KeyConfig); Keyboard config
You can now move to the specified scene.

ゲームの起動時の設定を初期値として読み込みます。
プラグインの導入位置に関わらず、入力の変更を検知します。
他のプラグインでボタンが改造されていてもOKです。

このプラグインで設定したコンフィグデータは、ファイルに記録されます。
新しいプラグインを入れた場合、
ゲーム起動後にコンフィグを「初期設定に戻す」でリセットしてください。

■"?KEY:Symbol"のような変な文字が表示される場合の対処法
他のプラグインによって追加された入力が不明なために発生します。
上記のような表示が出ている場合、
extendsMapperに要素を追加することで対応できます。
1.要素を追加する
2.下記のABどちらかの方法を試す。
A:KEYにあたる部分の文字をコピーして、KeySettingに貼り付ける。
B:Symbolにあたる部分の文字をコピーし、symbolに貼り付ける。
大文字・小文字を間違えないように注意すること。

■unknow:XXXXのような表示が出る場合の対処法
以下の原因が考えられます。
・シンボルの設定がゲーム起動後(Scene_Bootより後)で行われた
・初期化処理が正しく行われなかった
このプラグインを下の方に移動することで改善する可能性があります。

■ボタン操作拡散機能
他のプラグインで操作が設定されている場合に、
ゲームパッド・キーボードの片方にしか設定されていない場合があります。
そういった場合、extendsMapperで設定を行うことで他からも操作できるようになります。
例えば、キーボードのTにのみ押した場合の動作が設定されているとします。
この状態でゲームパッドのボタンにも操作を設定する場合、以下のように設定します。
キー設定:T
パッドボタン:(任意のボタン番号)
こうすることで、このプラグインはキーボードのTに設定されている動作を読み込み、
ゲームパッドのボタンでも同じ機能が使えるように設定を行います。
逆の場合も同様です。

キーボードとゲームパッドの双方に操作が設定されている場合、
どちらを優先するかを上書き設定で決めます。
シンボル手動設定(上級者向け)を使った場合、
優先設定を無視して手動設定による内容を使います。

■コモンイベント呼び出しボタン
extendsMapperには「イベント」という項目があります。
ここにイベントを設定すると、ボタンが押された時にイベントを呼び出します。
ボタンを押したら地図を開く機能を作る時などに使えます。

■eval()無しで全機能が使えます
このプラグインにはeval()を使う項目はありません。
eval()で使うJavaScriptの式を書いている場合、あなたは間違っています。

■スクリプトで遷移を制御したい場合
他のプラグインを改造したり、スクリプトで直接シーンを切り替える時に使います。
SceneManager.push(Mano_InputConfig.Scene_GamepadConfig ); //ゲームパッドコンフィグ
SceneManager.push(Mano_InputConfig.Scene_KeyConfig ); キーボードコンフィグ
これで、指定されたシーンに移動できます。

更新履歴
2022/06/10 ver 8.1.0
コモンイベントの設定方法が複雑という意見があったので簡易版を作成。


2022/03/15 ver 8.0.1
ゲームパッドコンフィグをリニューアル。
MV環境での不具合を修正

2022/03/08 ver 7.1.0
シンボルに対してボタンを割り当てる方式の廃止。
メンテナンスコストが大きいため。
ver8.0に向けた準備工事。

2022/01/18 ver7.0.1
PP_Optionとの連携関連で不具合があったのを修正。

2021/12/30 ver7.0.0
プラグインパラメータ「入力拡張」を中心に大改造。

2021/12/24 ver6.3.1
エラーメッセージの英語表記を追加。

2021/12/22 ver6.3.0
シンボル設定関連を更新。
ヘルプの内容を追加。

2021/12/18 ver6.2.1
ラムダ式関連の記述を修正した際に、バグを埋め込んでいたのを修正。
プラグインコマンドを追加。

2021/11/30 ver6.2.0
ManoPP_VisuMZ_OptionCore対応を実装。

2021/08/30 ver6.1.2
一部環境でラムダ式がエラーを起こすため、使用しない形に修正
一部テキストが日本語のままだったのを英語対応

2021/07/17 ver6.1.1
拡張入力の上書き設定が機能していないのを修正

2021/06/13 ver6.1.0
シンボルからボタンの名称を取得するプラグインコマンドを追加(MZのみ)

2021/05/23 ver 6.0.0
ゲームパッドにシンボルに対してボタンを割り当てる機能を実装。


2021/04/22 ver 5.4.0
MZのみ:タッチボタンの表示機能を試験的に実装

2021/04/15 ver 5.3.1
コモンイベント呼び出しを修正(簡単にしました)
イベントコマンドでコンフィグを開くと保存されない不具合を修正

2021/02/23 ver 5.3.0
ボタン入力がある時にコモンイベントを呼び出すプラグインコマンドを追加

2021/01/27 ver 5.2.0
不明なシンボルの表示機能を強化

2021/01/23 ver5.1.0
画面レイアウトを変更
必須シンボルの扱いを調整
不明なシンボルがある場合、画面上部へ表示するようにした

2020/12/25 ver5.0.3
必須シンボルチェックの動作が正しくなかったのを修正
バージョン管理を修正し、番号付けを変更。

2020/12/25 ver5.0.2(旧5.2)
拡張シンボル設定にバグがあったので修正

2020/11/26 ver5.0.1(旧5.1)
プラグインが起動できないバグがあったので修正

2020/11/24 ver5.0
プラグインパラメータを再設計。
内部実装であるsymbolを意識する必要が無くなりました。

2020/08/23 ver4.0
ツクールMZに対応。
基本システムはMZ向けに最適化し、MVはラッパーで調整

2020/05/25 ver 3.2
YEP_OptionCoreと競合するので、対策処理を追加。

2020/04/01 ver 3.1
英語対応につきヘルプを追加。

2020/03/14 ver3.0
WASD移動を設定できる機能を追加。
キーコンフィグの内部実装を大幅改造。

2020/02/26 ver2.9
コンフィグから抜けた際にボタンが連打されてしまう問題を対策。
RPGアツマールにおいて、他のゲームとコンフィグ設定が混ざる問題を修正。
別プラグインとの競合があったので対策
symbolAutoSelectがキーコンフィグで機能していなかったのを修正。

2019/07/12 ver2.8.1
ゲームパッドのハードごとの識別情報を表示する機能を追加。

2019/07/06 ver2.8
外部プラグインによって追加されたmapperのsymbolを強制的に取り込む機能。
プラグインパラメータで無効化できます。

2019/03/19 ver2.7
キーボードに任意の初期設定を割り当てる機能を追加。

2018/09/28 ver2.6
ゲームパッドコンフィグを改造すると誤作動があったので、誤作動を減らす修正。
プラグインの位置に関わらず初期設定の変更を捕まえられるように。

2018/06/25 ver 2.5
色々あった細かいバグ修正を重ねた最新版。

2017/10/21 ver 2.2 更新
外部から追加したシンボルがsymbolsと重複していた場合、追加しないようにした。
USキー配列に仮対応。

2017/10/18 ver 2.1 更新
キーボードで目立ったバグの報告がなかったため、2.0に。
外部からコンフィグを改造できる機能を導入。

2017/10/13 ver 1.9 更新
キーボードのコンフィグにも対応。
仕様が固まっていないので、1.9とします。
2017/10/05 ver 1.0 公開
パラメータ
url https://raw.githubusercontent.com/Sigureya/RPGmakerMZ/master/Mano_InputConfig.js

target MZ
orderAfter VisuMZ_1_OptionsCore
orderAfter MOG_TitleSplashScreen

command GetButtonName
text GetButton/ボタン名の取得
desc 指定した操作がどのボタンにあるかを返します。
Returns which button has the specified action.
arg symbol
type select
option ok(決定)
value ok
option cancel(取り消し)
value cancel
option shift(ダッシュ)
value shift
option menu(メニュー)
value menu
option pageup(前)
value pageup
option pagedown(次)
value pagedown
default ok

arg nameVariable
text ボタン名称/buttonName
desc ボタン名称を受け取る変数です。
Variable to store the result.
type variable
default 0

command GetButtonNameEX
text GetButtonEX/ボタン名の取得
desc 指定した操作がどのボタンにあるかを返します。
Returns which button has the specified action.
arg symbol
desc アクションのシンボル

arg nameVariable
desc ボタン名称を受け取る変数です。
Variable to store the result.
type variable
default 0

command IsKeyboardValid
desc キーボードの設定が正しい場合、指定スイッチをONにします。
arg switchId
type switch
default 0
desc 結果を保存するスイッチ
Where to save the results

command GamepadScene
text GamepadScene/ゲームパッド設定を開く
desc ゲームパッド設定のシーンを開きます。
Open the gamepad settings scene.

command KeyboardScene
text KeyboardScene/キーボード設定を開く
desc キーボード設定のシーンを開きます。
Open the keyboard settings scene.

param color
text 色設定/ColorSetting
type struct<ColorManager>
default {"normal":"#880000","mandatory":"#22e488","move":"#22e488"}

param basicOk
text 決定/ok
type struct<BasicSymbol>
default {"name":"{\"jp\":\"決定\",\"en\":\"OK\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}

param basicCancel
text 取り消し/cancle
type struct<BasicSymbol>
default {"name":"{\"jp\":\"キャンセル\",\"en\":\"cancel\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}

param basicShift
text ダッシュ/dash
type struct<BasicSymbol>
default {"name":"{\"jp\":\"ダッシュ\",\"en\":\"dash\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}

param basicMenu
text メニュー/menu
type struct<BasicSymbol>
default {"name":"{\"jp\":\"メニュー\",\"en\":\"menu\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}

param basicEscape
text メニュー(2)/menu(2)
type struct<BasicSymbol>
default {"name":"{\"jp\":\"メニュー/キャンセル\",\"en\":\"menu/cancel\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}

param basicPageup
text 次/next
type struct<BasicSymbol>
default {"name":"{\"jp\":\"次\",\"en\":\"next\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}

param basicPagedown
text 前/prev
type struct<BasicSymbol>
default {"name":"{\"jp\":\"前\",\"en\":\"prev\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}



param mapperDelete
text 設定を消去/delete
type struct<MultiLangString>
default {"en":"delete","jp":"設定を消去"}


param extendsMapper
desc ボタンイベント・追加の入力設定の登録
Registration of button events and additional input settings
text 入力拡張/inputExtension
type struct<InputDefine>[]
default []

param eventList
desc コモンイベントの呼び出し設定(簡単版)
Registration of button events and additional input settings
text コモンイベント/CommonEvent
type struct<EventDefine>[]
default []

param GamepadIsNotConnectedText
text 未接続/GamepadIsNotConnected
desc ゲームパッドが接続されていない場合の文章です。
This is the text when the gamepad is not connected.
type struct<MultiLangNote>
default {"jp":"\"ゲームパッドが接続されていません\\nボタンを押して再度試してください\"","en":"\"The gamepad is not connected.\\nPress the button and try again.\""}

param needButtonDetouchText
text ボタンから手を放すように促すメッセージ
desc キーコンフィグはボタンから手を離さない限り終了しません。
手を放すように促すメッセージを設定します。
type struct<MultiLangNote>
default {"jp":"\"コンフィグを終了するために、\\nボタンから手を放してください。\"","en":"\"Release the button to exit the config.\""}

param apply
text 設定の保存/apply
type struct<KeyconfigCommand>
default {"width":"4","text":"{\"jp\":\"設定を保存\",\"en\":\"save settings\"}"}

param rollback
text 変更を破棄/rollback
type struct<KeyconfigCommand>
default {"width":"4","text":"{\"jp\":\"変更前に戻す\",\"en\":\"rollback\"}"}

param reset
text 初期設定に戻す/reset
type struct<KeyconfigCommand>
default {"width":"4","text":"{\"jp\":\"初期設定に戻す\",\"en\":\"reset\"}"}

param WASD
type struct<KeyconfigCommand>
default {"width":"3","text":"{\"jp\":\"WASD\",\"en\":\"WASD\"}"}

param style
type struct<KeyconfigCommand>
default {"width":"3","text":"{\"jp\":\"設定方法変更\",\"en\":\"Change setting style\"}"}

param changeLayout
text JIS/US
type struct<KeyconfigCommand>
default {"width":"3","text":"{\"jp\":\"JIS/US\",\"en\":\"JIS/US\"}"}

param exit
text やめる/exit
type struct<KeyconfigCommand>
default {"width":"3","text":"{\"jp\":\"やめる\",\"en\":\"exit\"}"}



param gamepadConfigCommandText
desc ゲームパッドコンフィグを開くコマンドの名前です
type struct<MultiLangString>
default {"en":"gamepad config","jp":"ゲームパッドコンフィグ"}

param keyConfigCommandText
desc キーコンフィグを開くコマンドの名前です
type struct<MultiLangString>
default {"en":"keyboard config","jp":"キーコンフィグ"}

param gamepadBackground
type file
dir img/title1/

param keyBackground
type file
dir img/title1/

param SettingsForYEP_OptionsCore
type struct<DisguiseAsYEP>
default {"gamepad":"true","Keyboard":"true"}

ライセンス表記
Copyright (c) 2017-2021 Sigureya
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php

紹介ページ https://github.com/Sigureya/RPGmakerMV/blob/master/Mano_InputConfig.js