Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32e644b
commit 19aec40
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/*============================================================================= | ||
FixSimultaneouslyPress.js | ||
---------------------------------------------------------------------------- | ||
(C)2018 Triacontane | ||
This software is released under the MIT License. | ||
http://opensource.org/licenses/mit-license.php | ||
---------------------------------------------------------------------------- | ||
Version | ||
1.0.0 2018/09/17 初版 | ||
---------------------------------------------------------------------------- | ||
[Blog] : https://triacontane.blogspot.jp/ | ||
[Twitter]: https://twitter.com/triacontane/ | ||
[GitHub] : https://github.com/triacontane/ | ||
=============================================================================*/ | ||
|
||
/*: | ||
* @plugindesc FixSimultaneouslyPressPlugin | ||
* @author triacontane | ||
* | ||
* @help FixSimultaneouslyPress.js | ||
* | ||
* 同一フレーム内で複数のキーを同時押しした際に | ||
* Input.isTriggeredがいずれか一つのキーしか感知しない仕様を変更します。 | ||
* | ||
* このプラグインにはプラグインコマンドはありません。 | ||
* | ||
* This plugin is released under the MIT License. | ||
*/ | ||
/*:ja | ||
* @plugindesc 同時押し仕様変更プラグイン | ||
* @author トリアコンタン | ||
* | ||
* @help FixSimultaneouslyPress.js | ||
* | ||
* 同一フレーム内で複数のキーを同時押しした際に | ||
* Input.isTriggeredがいずれか一つのキーしか感知しない仕様を変更します。 | ||
* | ||
* このプラグインにはプラグインコマンドはありません。 | ||
* | ||
* 利用規約: | ||
* 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等) | ||
* についても制限はありません。 | ||
* このプラグインはもうあなたのものです。 | ||
*/ | ||
|
||
(function() { | ||
'use strict'; | ||
|
||
var _Input_update = Input.update; | ||
Input.update = function() { | ||
this._latestButtons = []; | ||
for (var name in this._currentState) { | ||
if (this._currentState[name] && !this._previousState[name]) { | ||
this._latestButtons.push(name); | ||
} | ||
} | ||
_Input_update.apply(this, arguments); | ||
}; | ||
|
||
var _Input_isTriggered = Input.isTriggered; | ||
Input.isTriggered = function(keyName) { | ||
var result = _Input_isTriggered.apply(this, arguments); | ||
return result || (this._latestButtons.contains(keyName) && this._pressedTime === 0); | ||
}; | ||
})(); |