qqq
This commit is contained in:
parent
acf93ec6df
commit
ee22e1a929
49 changed files with 1380 additions and 338 deletions
|
|
@ -451,7 +451,7 @@
|
|||
if (!p?.inside) return null;
|
||||
let best = null, bestD = Infinity;
|
||||
for (const it of this.nearbyItems(p.x, p.y, 140)) {
|
||||
if (!it || it.dead || it.type !== "nest_box") continue;
|
||||
if (!it || it.dead || !(typeof globalThis.isNestContainerType === "function" ? globalThis.isNestContainerType(it.type) : (it.type === "nest_box" || it.type === "pipe"))) continue;
|
||||
const d = distXY(p.x, p.y, it.x, it.y);
|
||||
if (d < bestD && d <= Math.max(80, it.r * 2.1)) { best = it; bestD = d; }
|
||||
}
|
||||
|
|
@ -462,21 +462,24 @@
|
|||
},
|
||||
|
||||
nestBoxTooltipLines(box) {
|
||||
if (!box || box.dead || box.type !== "nest_box") return [];
|
||||
if (!box || box.dead || !(typeof globalThis.isNestContainerType === "function" ? globalThis.isNestContainerType(box.type) : (box.type === "nest_box" || box.type === "pipe"))) return [];
|
||||
const occupants = this.nestBoxOccupants(box, Infinity);
|
||||
const names = occupants.map(t => t?.name).filter(Boolean).slice(0, 5);
|
||||
const more = occupants.length > names.length ? `\u3001\u307b\u304b${occupants.length - names.length}\u5339` : "";
|
||||
return ["\u5de3\u7bb1", names.length ? `\u5165\u3063\u3066\u308b\u5b50: ${names.join("\u3001")}${more}` : "\u5165\u3063\u3066\u308b\u5b50: \u306a\u3057", this.temperatureTooltipLineFor?.(box, "\u5185\u90E8\u6C17\u6E29")].filter(Boolean);
|
||||
const label = box.type === "pipe" ? "\u571f\u7ba1" : "\u5de3\u7bb1";
|
||||
return [label, names.length ? `\u5165\u3063\u3066\u308b\u5b50: ${names.join("\u3001")}${more}` : "\u5165\u3063\u3066\u308b\u5b50: \u306a\u3057", this.temperatureTooltipLineFor?.(box, "\u5185\u90E8\u6C17\u6E29")].filter(Boolean);
|
||||
},
|
||||
|
||||
|
||||
temperatureTooltipLineFor(target, label = "\u4F53\u611F\u6C17\u6E29") {
|
||||
temperatureTooltipLineFor(target, label = "体感気温") {
|
||||
if (!target || !this.temperatureAt) return "";
|
||||
const temp = this.temperatureAt(target.x, target.y);
|
||||
const temp = target.type === "pipe" && this.pipeInteriorTemperatureFor
|
||||
? this.pipeInteriorTemperatureFor(target)
|
||||
: this.temperatureAt(target.x, target.y);
|
||||
if (!Number.isFinite(Number(temp))) return "";
|
||||
const status = this.temperatureStatusFor?.(temp) || null;
|
||||
const suffix = status?.label ? `\uFF08${status.label}\uFF09` : "";
|
||||
return `${label}: ${Number(temp).toFixed(1)}\u2103${suffix}`;
|
||||
const suffix = status?.label ? `(${status.label})` : "";
|
||||
return `${label}: ${Number(temp).toFixed(1)}℃${suffix}`;
|
||||
},
|
||||
|
||||
pointerTarinaiTooltipInfo() {
|
||||
|
|
@ -521,7 +524,7 @@
|
|||
const tarinaiInfo = this.pointerTarinaiTooltipInfo?.();
|
||||
if (tarinaiInfo?.target) return tarinaiInfo;
|
||||
const nest = this.pointerNestBoxInfo?.();
|
||||
if (nest?.box) return { target: nest.box, lines: this.nestBoxTooltipLines(nest.box), kind: "nest_box" };
|
||||
if (nest?.box) return { target: nest.box, lines: this.nestBoxTooltipLines(nest.box), kind: nest.box?.type === "pipe" ? "pipe" : "nest_box" };
|
||||
const bedInfo = this.pointerOwnedBedInfo?.();
|
||||
if (bedInfo?.bed) return { target: bedInfo.bed, lines: this.ownedBedTooltipLines(bedInfo.bed), kind: "grass_bed" };
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue