Update variables v2 state handling
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import { getContext } from "../../../../../extensions.js";
|
||||
import { getLocalVariable } from "../../../../../variables.js";
|
||||
import { createModuleEvents } from "../../core/event-manager.js";
|
||||
import { replaceXbGetVarInString, replaceXbGetVarYamlInString } from "./var-commands.js";
|
||||
import { replaceXbGetVarInString, replaceXbGetVarYamlInString, replaceXbGetVarYamlIdxInString } from "./var-commands.js";
|
||||
|
||||
const MODULE_ID = 'vareventEditor';
|
||||
const LWB_EXT_ID = 'LittleWhiteBox';
|
||||
@@ -303,6 +303,9 @@ function installWIHiddenTagStripper() {
|
||||
if (msg.content.indexOf('{{xbgetvar_yaml::') !== -1) {
|
||||
msg.content = replaceXbGetVarYamlInString(msg.content);
|
||||
}
|
||||
if (msg.content.indexOf('{{xbgetvar_yaml_idx::') !== -1) {
|
||||
msg.content = replaceXbGetVarYamlIdxInString(msg.content);
|
||||
}
|
||||
}
|
||||
if (Array.isArray(msg?.content)) {
|
||||
for (const part of msg.content) {
|
||||
@@ -321,6 +324,9 @@ function installWIHiddenTagStripper() {
|
||||
if (part.text.indexOf('{{xbgetvar_yaml::') !== -1) {
|
||||
part.text = replaceXbGetVarYamlInString(part.text);
|
||||
}
|
||||
if (part.text.indexOf('{{xbgetvar_yaml_idx::') !== -1) {
|
||||
part.text = replaceXbGetVarYamlIdxInString(part.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -339,6 +345,9 @@ function installWIHiddenTagStripper() {
|
||||
if (msg.mes.indexOf('{{xbgetvar_yaml::') !== -1) {
|
||||
msg.mes = replaceXbGetVarYamlInString(msg.mes);
|
||||
}
|
||||
if (msg.mes.indexOf('{{xbgetvar_yaml_idx::') !== -1) {
|
||||
msg.mes = replaceXbGetVarYamlIdxInString(msg.mes);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
@@ -373,6 +382,9 @@ function installWIHiddenTagStripper() {
|
||||
if (data.prompt.indexOf('{{xbgetvar_yaml::') !== -1) {
|
||||
data.prompt = replaceXbGetVarYamlInString(data.prompt);
|
||||
}
|
||||
if (data.prompt.indexOf('{{xbgetvar_yaml_idx::') !== -1) {
|
||||
data.prompt = replaceXbGetVarYamlIdxInString(data.prompt);
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user