stable
This commit is contained in:
parent
fbdac9ebf1
commit
86226ccc94
97 changed files with 5790 additions and 2307 deletions
|
|
@ -685,6 +685,48 @@ draw(ctx, t, lighting = null) {
|
|||
ctx.fillText("N", this.r * 0.56, -this.r * 0.56);
|
||||
ctx.fillText("S", this.r * 0.56, this.r * 0.56);
|
||||
ctx.restore();
|
||||
} else if (this.type === "rotator") {
|
||||
const angle = typeof itemAngleFor === "function" ? itemAngleFor(this) : (Number(this.angle) || 0);
|
||||
const speed = Number(this.rotatorSpeed || 0) || 0;
|
||||
const segments = (world?.rotatorSegments?.(this) || (Array.isArray(this.rotatorSegments) ? this.rotatorSegments : [[-78, 0, 78, 0], [0, -52, 0, 52]])).slice(0, 96);
|
||||
const thick = Math.max(4, Math.min(34, Number(this.rotatorThickness || 12) || 12));
|
||||
ctx.save();
|
||||
ctx.rotate(angle);
|
||||
ctx.lineCap = "round";
|
||||
ctx.lineJoin = "round";
|
||||
ctx.strokeStyle = styleNight ? "#6e5f89" : "#8b6cc5";
|
||||
ctx.lineWidth = thick;
|
||||
ctx.shadowColor = styleNight ? "rgba(116,92,170,0.38)" : "rgba(126,82,190,0.30)";
|
||||
ctx.shadowBlur = Math.max(4, thick * 0.28);
|
||||
ctx.beginPath();
|
||||
for (const seg of segments) {
|
||||
if (!Array.isArray(seg) || seg.length < 4) continue;
|
||||
ctx.moveTo(Number(seg[0]) || 0, Number(seg[1]) || 0);
|
||||
ctx.lineTo(Number(seg[2]) || 0, Number(seg[3]) || 0);
|
||||
}
|
||||
ctx.stroke();
|
||||
ctx.shadowBlur = 0;
|
||||
ctx.strokeStyle = styleNight ? "rgba(236,220,255,0.44)" : "rgba(255,255,255,0.46)";
|
||||
ctx.lineWidth = Math.max(1.4, thick * 0.22);
|
||||
ctx.beginPath();
|
||||
for (const seg of segments) {
|
||||
if (!Array.isArray(seg) || seg.length < 4) continue;
|
||||
ctx.moveTo(Number(seg[0]) || 0, Number(seg[1]) || 0);
|
||||
ctx.lineTo(Number(seg[2]) || 0, Number(seg[3]) || 0);
|
||||
}
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
ctx.fillStyle = styleNight ? "#3c324e" : "#f4eaff";
|
||||
ctx.strokeStyle = styleNight ? "#a28cc8" : "#6e4fa4";
|
||||
ctx.lineWidth = 2.2;
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, Math.max(8, thick * 0.72), 0, Math.PI * 2);
|
||||
ctx.fill(); ctx.stroke();
|
||||
ctx.fillStyle = styleNight ? "#d8c5ff" : "#6e4fa4";
|
||||
ctx.font = `bold ${Math.max(10, thick * 0.84)}px ui-rounded, sans-serif`;
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillText(speed >= 0 ? "↻" : "↺", 0, 0);
|
||||
} else if (this.type === "zunchi") {
|
||||
const zunchiId = this.zunchiVariant || "zunchi";
|
||||
const img = images.get(zunchiId) || images.get("zunchi");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue