Skip to content
This repository has been archived by the owner on Dec 4, 2022. It is now read-only.

Commit

Permalink
WAY_EvalText v2.2.0
Browse files Browse the repository at this point in the history
Add compatibility for YEP_X_EquipCustomize
  • Loading branch information
waynee95 committed Jan 6, 2020
1 parent 7e31f1d commit 60a2ec5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
11 changes: 9 additions & 2 deletions dist/WAY_EvalText.js
Expand Up @@ -4,7 +4,7 @@
// ===========================================================================

/*:
@plugindesc v2.1.2 Use JavaScript Code in textboxes. <WAY_EvalText>
@plugindesc v2.2.0 Use JavaScript Code in textboxes. <WAY_EvalText>
@author waynee95
Expand Down Expand Up @@ -73,7 +73,7 @@ if (typeof WAY === "undefined") {

SceneManager.stop();
} else {
WAYModuleLoader.registerPlugin("WAY_EvalText", "2.1.2", "waynee95", {
WAYModuleLoader.registerPlugin("WAY_EvalText", "2.2.0", "waynee95", {
name: "WAY_Core",
version: ">= 2.0.0"
});
Expand Down Expand Up @@ -133,6 +133,13 @@ if (typeof WAY === "undefined") {
if (currentScene._storageWindow) {
item = currentScene._storageWindow.item();
}
} // Fix for YEP_X_EquipCustomize


if (Imported.YEP_X_EquipCustomize && currentScene instanceof Scene_EquipCustomize) {
if (currentScene._itemActionWindow) {
item = currentScene.item();
}
}

return text.replace(/\${[^{}\\]+(?=\})}/g, function (code) {
Expand Down
14 changes: 12 additions & 2 deletions src/WAY_EvalText.js
Expand Up @@ -3,7 +3,7 @@
// WAY_EvalText.js
// ===========================================================================
/*:
@plugindesc v2.1.2 Use JavaScript Code in textboxes. <WAY_EvalText>
@plugindesc v2.2.0 Use JavaScript Code in textboxes. <WAY_EvalText>
@author waynee95
Expand Down Expand Up @@ -69,7 +69,7 @@ if (typeof WAY === "undefined") {
}
SceneManager.stop();
} else {
WAYModuleLoader.registerPlugin("WAY_EvalText", "2.1.2", "waynee95", {
WAYModuleLoader.registerPlugin("WAY_EvalText", "2.2.0", "waynee95", {
name: "WAY_Core",
version: ">= 2.0.0"
});
Expand Down Expand Up @@ -135,6 +135,16 @@ if (typeof WAY === "undefined") {
}
}

// Fix for YEP_X_EquipCustomize
if (
Imported.YEP_X_EquipCustomize &&
currentScene instanceof Scene_EquipCustomize
) {
if (currentScene._itemActionWindow) {
item = currentScene.item();
}
}

return text.replace(/\${[^{}\\]+(?=\})}/g, code => {
try {
const s = $gameSwitches;
Expand Down

0 comments on commit 60a2ec5

Please sign in to comment.