hmm
This commit is contained in:
parent
e8f1d1db1e
commit
54aff02658
27 changed files with 1700 additions and 1034 deletions
|
|
@ -192,8 +192,10 @@ function renderSelected() {
|
|||
personalityTags.join(",")
|
||||
].join(",");
|
||||
const itemEffectSummary = t.activeItemEffectSummary ? t.activeItemEffectSummary() : [];
|
||||
const needKeys = typeof TARINAI_NEED_KEYS !== "undefined" ? TARINAI_NEED_KEYS : ["food", "sleep", "health", "safety", "social", "fulfill"];
|
||||
const snapshot = [
|
||||
t.id, t.type, t.name, generationDisplay, t.state, t.thought, targetLabel(t.target),
|
||||
t.intent?.need || "", t.intent?.actionId || "", t.intent?.actionLabel || "", t.intent?.reasonText || "", needKeys.map(key => `${key}:${t.needs?.[key] ?? 0}`).join(","),
|
||||
fmt(t.age), fmt(t.lifeSpan), fmt(t.hunger), fmt(t.loneliness),
|
||||
fmt(t.energy), fmt(t.stress), fmt(t.mood),
|
||||
t.parentNames?.join("+") || "", t.children?.length || 0, fmt(t.lack),
|
||||
|
|
@ -239,6 +241,7 @@ function renderSelected() {
|
|||
const basicHtml = `
|
||||
<div class="info-row"><span>\u4e16\u4ee3</span><strong>${escapeHtml(generationDisplay || "\u4e0d\u660e")}</strong></div>
|
||||
<div class="info-row"><span>\u72b6\u614b</span><strong>${escapeHtml(stateLabel(t.state))}</strong></div>
|
||||
<div class="info-row"><span>\u3044\u307e</span><strong>${escapeHtml(t.intent?.actionLabel || stateLabel(t.state))}</strong></div>
|
||||
<div class="info-row"><span>\u7406\u7531</span><strong>${escapeHtml(reasonLabel(t))}</strong></div>
|
||||
<div class="info-row"><span>\u5bfe\u8c61</span><strong>${escapeHtml(targetLabel(t.target))}</strong></div>
|
||||
<div class="info-row"><span>\u5e74\u9f62</span><strong>${fmt(t.age)} / ${fmt(t.lifeSpan)}</strong></div>
|
||||
|
|
@ -247,13 +250,16 @@ function renderSelected() {
|
|||
<div class="info-row"><span>\u79fb\u52d5\u901f\u5ea6</span><strong>${geneticPercentText(t, "speed")}</strong></div>
|
||||
<div class="info-row"><span>\u30b5\u30a4\u30ba</span><strong>${geneticSizeText(t)}</strong></div>
|
||||
`;
|
||||
const needRowsHtml = needKeys.map(key => {
|
||||
const label = (typeof TARINAI_NEED_LABELS !== "undefined" && TARINAI_NEED_LABELS[key]) || key;
|
||||
const value = typeof getNeedDisplayValue === "function" ? getNeedDisplayValue(t.needs?.[key] || 0) : Math.round((t.needs?.[key] || 0) / 10);
|
||||
const chosen = t.intent?.need === key ? ` data-chosen-need="true"` : "";
|
||||
return `<div class="info-row need-row"${chosen}><span>${escapeHtml(label)}</span><strong>${escapeHtml(value)}</strong></div>`;
|
||||
}).join("");
|
||||
const healthHtml = [
|
||||
selectedInfoRowHtml("\u7dcf\u5408\u7684\u6c17\u5206", fmt(t.mood), "mood"),
|
||||
selectedInfoRowHtml("\u7a7a\u8179", fmt(t.hunger), "hunger"),
|
||||
selectedInfoRowHtml("\u5bc2\u3057\u3055", fmt(t.loneliness), "loneliness"),
|
||||
needRowsHtml,
|
||||
selectedInfoRowHtml("\u4f53\u529b", fmt(t.energy), "energy"),
|
||||
selectedInfoRowHtml("\u30b9\u30c8\u30ec\u30b9", fmt(t.stress), "stress"),
|
||||
selectedInfoRowHtml("\u305a\u3093\u3061\u6c5a\u308c", fmt(t.zunchiStain || 0), "zunchi"),
|
||||
].join("");
|
||||
const itemEffectHtml = itemEffectSummary.length
|
||||
? itemEffectSummary.map(e => `<div class="info-row"><span>${escapeHtml(e.label)}</span><strong>${escapeHtml(e.detail)}</strong></div>`).join("")
|
||||
|
|
@ -297,6 +303,7 @@ function stateLabel(s) {
|
|||
}
|
||||
|
||||
function reasonLabel(t) {
|
||||
if (t?.intent?.reasonText) return t.intent.reasonText;
|
||||
return window.TEXT_CATALOG?.reasonLabel?.(t) || "なし";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue