--
This commit is contained in:
parent
5ed977788c
commit
f500279abd
93 changed files with 1893 additions and 1198 deletions
|
|
@ -16,27 +16,27 @@
|
|||
function groundDef(worldRef = null) {
|
||||
const worldObj = activeWorld(worldRef);
|
||||
const id = worldObj?.groundType || "soil";
|
||||
return global.TarinaiGround?.definition?.(id) || (typeof GROUND_TYPES !== "undefined" ? GROUND_TYPES[id] || GROUND_TYPES.soil : { id: "soil", label: "砂", description: "普通の地面。" });
|
||||
return global.TarinaiGround?.definition?.(id) || (typeof GROUND_TYPES !== "undefined" ? GROUND_TYPES[id] || GROUND_TYPES.soil : { id: "soil", label: "\u7802", description: "\u666e\u901a\u306e\u5730\u9762\u3002" });
|
||||
}
|
||||
|
||||
function groundTip(worldRef = null) {
|
||||
const def = groundDef(worldRef);
|
||||
if (global.TarinaiGround?.tooltipText) return global.TarinaiGround.tooltipText(def.id);
|
||||
return `${def.label || "地面"}\n${def.description || "クリックで切り替え"}`;
|
||||
return `${def.label || "\u5730\u9762"}\n${def.description || "\u30af\u30ea\u30c3\u30af\u3067\u5207\u308a\u66ff\u3048"}`;
|
||||
}
|
||||
|
||||
function updateGroundUI(worldRef = null) {
|
||||
const uiRef = global.ui || {};
|
||||
const def = groundDef(worldRef);
|
||||
const label = def.label || "砂";
|
||||
const label = def.label || "\u7802";
|
||||
const statEl = uiRef.statGroundType || document.getElementById("statGroundType");
|
||||
const btnEl = uiRef.groundTypeBtn || document.getElementById("groundTypeBtn");
|
||||
if (statEl) setTextIfChanged(statEl, "groundType", label);
|
||||
if (btnEl) {
|
||||
const desc = def.description || "クリックで切り替え";
|
||||
const desc = def.description || "\u30af\u30ea\u30c3\u30af\u3067\u5207\u308a\u66ff\u3048";
|
||||
btnEl.dataset.tip = desc;
|
||||
btnEl.removeAttribute("title");
|
||||
btnEl.setAttribute("aria-label", desc ? `地面を切り替える。現在は${label}。${desc}` : `地面を切り替える。現在は${label}`);
|
||||
btnEl.setAttribute("aria-label", desc ? `\u5730\u9762\u3092\u5207\u308a\u66ff\u3048\u308b\u3002\u73fe\u5728\u306f${label}\u3002${desc}` : `\u5730\u9762\u3092\u5207\u308a\u66ff\u3048\u308b\u3002\u73fe\u5728\u306f${label}`);
|
||||
global.TarinaiTooltips?.refresh?.(btnEl);
|
||||
}
|
||||
}
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
cycleGroundFromEvent.lastAt = now;
|
||||
const currentWorld = activeWorld(fallbackWorld);
|
||||
if (!currentWorld?.cycleGroundType) {
|
||||
if (typeof showToast === "function") showToast("地面をまだ切り替えられません。");
|
||||
if (typeof showToast === "function") showToast("\u5730\u9762\u3092\u307e\u3060\u5207\u308a\u66ff\u3048\u3089\u308c\u307e\u305b\u3093\u3002");
|
||||
return;
|
||||
}
|
||||
global.audio?.uiClick?.();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue