Update src/engine/target.js
Browse files- src/engine/target.js +13 -3
src/engine/target.js
CHANGED
|
@@ -8,6 +8,7 @@ const {Map} = require('immutable');
|
|
| 8 |
const log = require('../util/log');
|
| 9 |
const StringUtil = require('../util/string-util');
|
| 10 |
const VariableUtil = require('../util/variable-util');
|
|
|
|
| 11 |
|
| 12 |
/**
|
| 13 |
* @fileoverview
|
|
@@ -70,6 +71,15 @@ class Target extends EventEmitter {
|
|
| 70 |
* @type {Object.<string, *>}
|
| 71 |
*/
|
| 72 |
this._edgeActivatedHatValues = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
}
|
| 74 |
|
| 75 |
/**
|
|
@@ -211,12 +221,12 @@ class Target extends EventEmitter {
|
|
| 211 |
if (typeof name !== 'string') return;
|
| 212 |
if (typeof type !== 'string') type = Variable.SCALAR_TYPE;
|
| 213 |
skipStage = skipStage || false;
|
| 214 |
-
|
| 215 |
// Search variables in the current target
|
| 216 |
const variables = Object.values(this.variables);
|
| 217 |
const foundInCurrent = variables.find(varData => varData.name === name && varData.type === type);
|
| 218 |
if (foundInCurrent) return foundInCurrent;
|
| 219 |
-
|
| 220 |
// Search variables in the stage if applicable
|
| 221 |
if (!skipStage && this.runtime && !this.isStage) {
|
| 222 |
const stage = this.runtime.getTargetForStage();
|
|
@@ -791,4 +801,4 @@ class Target extends EventEmitter {
|
|
| 791 |
|
| 792 |
}
|
| 793 |
|
| 794 |
-
module.exports = Target;
|
|
|
|
| 8 |
const log = require('../util/log');
|
| 9 |
const StringUtil = require('../util/string-util');
|
| 10 |
const VariableUtil = require('../util/variable-util');
|
| 11 |
+
const ExtensionStorage = require('../util/deprecated-extension-storage.js');
|
| 12 |
|
| 13 |
/**
|
| 14 |
* @fileoverview
|
|
|
|
| 71 |
* @type {Object.<string, *>}
|
| 72 |
*/
|
| 73 |
this._edgeActivatedHatValues = {};
|
| 74 |
+
|
| 75 |
+
/**
|
| 76 |
+
* Part of a recreation of the TurboWarp extensionStorage
|
| 77 |
+
* API. The only real reason this is here is to make sure
|
| 78 |
+
* that extensions that only implement TurboWarp's store
|
| 79 |
+
* method don't break in PenguinMod.
|
| 80 |
+
* @type {Object<string, Object>}
|
| 81 |
+
*/
|
| 82 |
+
this.extensionStorage = ExtensionStorage();
|
| 83 |
}
|
| 84 |
|
| 85 |
/**
|
|
|
|
| 221 |
if (typeof name !== 'string') return;
|
| 222 |
if (typeof type !== 'string') type = Variable.SCALAR_TYPE;
|
| 223 |
skipStage = skipStage || false;
|
| 224 |
+
|
| 225 |
// Search variables in the current target
|
| 226 |
const variables = Object.values(this.variables);
|
| 227 |
const foundInCurrent = variables.find(varData => varData.name === name && varData.type === type);
|
| 228 |
if (foundInCurrent) return foundInCurrent;
|
| 229 |
+
|
| 230 |
// Search variables in the stage if applicable
|
| 231 |
if (!skipStage && this.runtime && !this.isStage) {
|
| 232 |
const stage = this.runtime.getTargetForStage();
|
|
|
|
| 801 |
|
| 802 |
}
|
| 803 |
|
| 804 |
+
module.exports = Target;
|