Skip to content

Commit

Permalink
Updated Change Keys
Browse files Browse the repository at this point in the history
Fix typo.
  • Loading branch information
Archeia committed Mar 26, 2019
1 parent 5382ad6 commit 1aa20a7
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 64 deletions.
126 changes: 63 additions & 63 deletions General Modification/LEDA_ChangeKeys/LEDA_ChangeKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Archeia Engine LEDA -- Change Keys
//
// Version 1.0.0.1 - 1/25/2019
// Version 1.0.2 - 3/26/2019
//
// Change keyboard input for specific Visual Novel Maker games.
// This plugin overwrites a lot of input functions.
Expand All @@ -13,18 +13,18 @@ Imported.AEL_KEY = true;

var Archeia = Archeia || {};
Archeia.AEL_KEY = Archeia.AEL_KEY || {};
Archeia.AEL_KEY.version = 1.00;
Archeia.AEL_KEY.version = 1.02;

//=============================================================================
// Parameter Variables
//=============================================================================

// Keys set in this section will proceed the game
Archeia.AEL_KEY.InputOK = Input.KEY_SPACE;
Archeia.AEL_KEY.InputOK_ALT= Input.C;
Archeia.AEL_KEY.InputOK_ALT = Input.C;

// This key exists for hiding the messagebox
Archeia.AEL_KEY.inputHIDE= Input.KEY_BACK_SPACE;
Archeia.AEL_KEY.inputHIDE = Input.KEY_BACK_SPACE;

//=============================================================================
// Component_GameSceneBehavior
Expand All @@ -33,13 +33,13 @@ Archeia.AEL_KEY.inputHIDE= Input.KEY_BACK_SPACE;
// Checks for the shortcut to hide/show the game UI. By default, this is the
// space-key. You can override this method to change the shortcut.
// ----------------------------------------------------------------------- //
Component_GameSceneBehavior.prototype.updateUIVisibilityShortcut = function() {
if (!this.uiVisible && (Input.trigger(Archeia.AEL_KEY.InputOK) || Input.trigger(Archeia.AEL_KEY.InputOK_ALT) || Input.Mouse.buttonDown)) {
this.changeUIVisibility(!this.uiVisible);
}
if (Input.trigger(Archeia.AEL_KEY.inputHIDE)) {
return this.changeUIVisibility(!this.uiVisible);
}
vn.Component_GameSceneBehavior.prototype.updateUIVisibilityShortcut = function() {
if (!this.uiVisible && (Input.trigger(Archeia.AEL_KEY.InputOK) || Input.trigger(Archeia.AEL_KEY.InputOK_ALT) || Input.Mouse.buttonDown)) {
this.changeUIVisibility(!this.uiVisible);
}
if (Input.trigger(Archeia.AEL_KEY.inputHIDE)) {
return this.changeUIVisibility(!this.uiVisible);
}
};

//=============================================================================
Expand All @@ -48,56 +48,56 @@ Component_GameSceneBehavior.prototype.updateUIVisibilityShortcut = function() {
// Adds event-handlers for mouse/touch events
// ----------------------------------------------------------------------- //
gs.Component_MessageTextRenderer.prototype.setupEventHandlers = function() {
gs.GlobalEventManager.offByOwner("mouseUp", this.object);
gs.GlobalEventManager.offByOwner("keyUp", this.object);
gs.GlobalEventManager.on("mouseUp", ((function(_this) {
return function(e) {
if (_this.object.findComponentByName("animation") || (GameManager.settings.autoMessage.enabled && !GameManager.settings.autoMessage.stopOnAction)) {
return;
}
if (Input.Mouse.buttons[Input.Mouse.LEFT] !== 2) {
return;
}
if (_this.isWaiting && !(_this.waitCounter > 0 || _this.waitForKey)) {
e.breakChain = true;
_this["continue"]();
} else {
e.breakChain = _this.isRunning;
_this.drawImmediately = !_this.waitForKey;
_this.waitCounter = 0;
_this.waitForKey = false;
_this.isWaiting = false;
}
if (_this.waitForKey) {
if (Input.Mouse.buttons[Input.Mouse.LEFT] === 2) {
e.breakChain = true;
Input.clear();
_this.waitForKey = false;
return _this.isWaiting = false;
}
}
};
})(this)), null, this.object);
return gs.GlobalEventManager.on("keyUp", ((function(_this) {
return function(e) {
if ((Input.keys[Archeia.AEL_KEY.inputOK] || Input.keys[Archeia.AEL_KEY.InputOK_ALT]) && (!_this.isWaiting || (_this.waitCounter > 0 || _this.waitForKey))) {
_this.drawImmediately = !_this.waitForKey;
_this.waitCounter = 0;
_this.waitForKey = false;
_this.isWaiting = false;
}
if (_this.isWaiting && !_this.waitForKey && !_this.waitCounter && (Input.keys[Archeia.AEL_KEY.InputOK] || Input.keys[Archeia.AEL_KEY.InputOK_ALT]) ) {
_this["continue"]();
}
if (_this.waitForKey) {
if (Input.keys[Archeia.AEL_KEY.InputOK] || Input.keys[Archeia.AEL_KEY.InputOK_ALT]) {
Input.clear();
_this.waitForKey = false;
return _this.isWaiting = false;
}
}
};
})(this)), null, this.object);
gs.GlobalEventManager.offByOwner("mouseUp", this.object);
gs.GlobalEventManager.offByOwner("keyUp", this.object);
gs.GlobalEventManager.on("mouseUp", ((function(_this) {
return function(e) {
if (_this.object.findComponentByName("animation") || (GameManager.settings.autoMessage.enabled && !GameManager.settings.autoMessage.stopOnAction)) {
return;
}
if (Input.Mouse.buttons[Input.Mouse.LEFT] !== 2) {
return;
}
if (_this.isWaiting && !(_this.waitCounter > 0 || _this.waitForKey)) {
e.breakChain = true;
_this["continue"]();
} else {
e.breakChain = _this.isRunning;
_this.drawImmediately = !_this.waitForKey;
_this.waitCounter = 0;
_this.waitForKey = false;
_this.isWaiting = false;
}
if (_this.waitForKey) {
if (Input.Mouse.buttons[Input.Mouse.LEFT] === 2) {
e.breakChain = true;
Input.clear();
_this.waitForKey = false;
return _this.isWaiting = false;
}
}
};
})(this)), null, this.object);
return gs.GlobalEventManager.on("keyUp", ((function(_this) {
return function(e) {
if ((Input.keys[Archeia.AEL_KEY.inputOK] || Input.keys[Archeia.AEL_KEY.InputOK_ALT]) && (!_this.isWaiting || (_this.waitCounter > 0 || _this.waitForKey))) {
_this.drawImmediately = !_this.waitForKey;
_this.waitCounter = 0;
_this.waitForKey = false;
_this.isWaiting = false;
}
if (_this.isWaiting && !_this.waitForKey && !_this.waitCounter && (Input.keys[Archeia.AEL_KEY.InputOK] || Input.keys[Archeia.AEL_KEY.InputOK_ALT])) {
_this["continue"]();
}
if (_this.waitForKey) {
if (Input.keys[Archeia.AEL_KEY.InputOK] || Input.keys[Archeia.AEL_KEY.InputOK_ALT]) {
Input.clear();
_this.waitForKey = false;
return _this.isWaiting = false;
}
}
};
})(this)), null, this.object);
};

//=============================================================================
Expand All @@ -107,5 +107,5 @@ gs.Component_MessageTextRenderer.prototype.setupEventHandlers = function() {
// ----------------------------------------------------------------------- //

vn.Component_MessageBehavior.prototype.actionTrigger = function() {
return (gs.ObjectManager.current.input && this.object.visible && this.object.dstRect.contains(Input.Mouse.x - this.object.origin.x, Input.Mouse.y - this.object.origin.y) && Input.Mouse.buttons[Input.Mouse.LEFT] === 2) || Input.trigger(Archeia.AEL_KEY.InputOK) || Input.trigger(Archeia.AEL_KEY.InputOK_ALT);
};
return (gs.ObjectManager.current.input && this.object.visible && this.object.dstRect.contains(Input.Mouse.x - this.object.origin.x, Input.Mouse.y - this.object.origin.y) && Input.Mouse.buttons[Input.Mouse.LEFT] === 2) || Input.trigger(Archeia.AEL_KEY.InputOK) || Input.trigger(Archeia.AEL_KEY.InputOK_ALT);
};
3 changes: 2 additions & 1 deletion LEDA_CreateExtensionSettings
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ to
>>> License <<<
----------------------------------------------------------------------------------------------------------

Copyright (c) 2017-2018 Archeia (Division Heaven)
Copyright (c) 2017-2019 Archeia (Division Heaven)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -73,6 +73,7 @@ Backspace will hide the window.

>>> Changelog <<<
----------------------------------------------------------------------------------------------------------
1.0.2 - Fixed a typo that stops the script from functioning on 1.0.998 onwards.
1.0.1 - Fixed crashing when using videos.
1.0.0 - Initial Release (1/25/2019)

Expand Down

0 comments on commit 1aa20a7

Please sign in to comment.