Update ena-planner.js
This commit is contained in:
@@ -718,16 +718,21 @@ function buildEjsContext() {
|
|||||||
// getvar: read a chat variable (supports dot-path for nested objects)
|
// getvar: read a chat variable (supports dot-path for nested objects)
|
||||||
function getvar(name) {
|
function getvar(name) {
|
||||||
if (!name) return '';
|
if (!name) return '';
|
||||||
// Direct lookup first
|
let val;
|
||||||
if (vars[name] !== undefined) return vars[name];
|
if (vars[name] !== undefined) {
|
||||||
// Try dot-path traversal
|
val = vars[name];
|
||||||
const parts = String(name).split('.');
|
} else {
|
||||||
let cur = vars;
|
const parts = String(name).split('.');
|
||||||
for (const p of parts) {
|
let cur = vars;
|
||||||
if (cur == null || typeof cur !== 'object') return '';
|
for (const p of parts) {
|
||||||
cur = cur[p];
|
if (cur == null || typeof cur !== 'object') return '';
|
||||||
|
cur = cur[p];
|
||||||
|
}
|
||||||
|
val = cur ?? '';
|
||||||
}
|
}
|
||||||
return cur ?? '';
|
// 处理字符串布尔值
|
||||||
|
if (val === 'false' || val === 'False' || val === '0') return '';
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
// setvar: write a chat variable (no-op for our purposes, just to avoid errors)
|
// setvar: write a chat variable (no-op for our purposes, just to avoid errors)
|
||||||
@@ -1299,6 +1304,15 @@ function createSettingsHTML() {
|
|||||||
.ep-prompt-block { border:1px solid var(--SmartThemeBorderColor,#444); border-radius:6px; padding:8px; margin-bottom:8px; }
|
.ep-prompt-block { border:1px solid var(--SmartThemeBorderColor,#444); border-radius:6px; padding:8px; margin-bottom:8px; }
|
||||||
.ep-prompt-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; flex-wrap:wrap; gap:6px; }
|
.ep-prompt-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; flex-wrap:wrap; gap:6px; }
|
||||||
.ep-prompt-block textarea { width:100%; background:var(--SmartThemeBotMesBlurTintColor,#1a1a2e); color:var(--SmartThemeBodyColor,#ccc); border:1px solid var(--SmartThemeBorderColor,#444); border-radius:4px; padding:6px; font-size:12px; }
|
.ep-prompt-block textarea { width:100%; background:var(--SmartThemeBotMesBlurTintColor,#1a1a2e); color:var(--SmartThemeBodyColor,#ccc); border:1px solid var(--SmartThemeBorderColor,#444); border-radius:4px; padding:6px; font-size:12px; }
|
||||||
|
#ena_planner_panel .ep-prompt-block textarea {
|
||||||
|
background:#1a1a2e; color:#e0e0e0; border:1px solid var(--SmartThemeBorderColor,#444);
|
||||||
|
}
|
||||||
|
.ep-log-pre {
|
||||||
|
background:rgba(20,20,30,0.95) !important; color:#e0e0e0 !important;
|
||||||
|
}
|
||||||
|
.ep-log-modal .ep-log-card {
|
||||||
|
background:rgba(20,20,30,0.97); color:#e0e0e0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<div style="padding:4px 0;">
|
<div style="padding:4px 0;">
|
||||||
<div style="display:flex;align-items:center;margin-bottom:8px;">
|
<div style="display:flex;align-items:center;margin-bottom:8px;">
|
||||||
|
|||||||
Reference in New Issue
Block a user