aboutsummaryrefslogtreecommitdiff
path: root/webAO/client/createArea.ts
diff options
context:
space:
mode:
authorDavid Skoland <davidskoland@gmail.com>2026-03-24 12:23:45 +0100
committerDavid Skoland <davidskoland@gmail.com>2026-03-24 12:23:45 +0100
commit1a1ed4e1d0568a1610d5f5da3d541a59afe2b863 (patch)
tree6df185dcb2994767619d2dc32e45e27e3496aff3 /webAO/client/createArea.ts
parent4715e7ccde04a77ff04f1ac839c151eaebc4ad44 (diff)
Add reconnect UI, disconnect button, and visual cleanup
- Redesign disconnect overlay as a full-screen modal with dark backdrop - Add working Reconnect button that properly re-establishes WebSocket connection - Add Disconnect button in Settings for testing - Separate disconnect and ban/kick codepaths (no reconnect on ban) - Log disconnect notice in IC log using hrtext style - Refactor area list rendering from client state (renderAreaList) - Extract appendICNotice for reusable IC log notices - Clean up charselect: hide during loading, simplify toolbar layout - Freshen loading screen and charselect styling - Remove loading progress text updates (just show "Loading...") - Guard against undefined client.chars and client.serv Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'webAO/client/createArea.ts')
-rw-r--r--webAO/client/createArea.ts25
1 files changed, 4 insertions, 21 deletions
diff --git a/webAO/client/createArea.ts b/webAO/client/createArea.ts
index 9a40bef..dfc57e8 100644
--- a/webAO/client/createArea.ts
+++ b/webAO/client/createArea.ts
@@ -1,32 +1,15 @@
import { client } from "../client";
-import { area_click } from "../dom/areaClick";
+import { renderAreaList } from "../dom/renderAreaList";
import { safeTags } from "../encoding";
export const createArea = (id: number, aname: string) => {
const name = safeTags(aname);
- const thisarea = {
+ client.areas.push({
name,
players: 0,
status: "IDLE",
cm: "",
locked: "FREE",
- };
-
- client.areas.push(thisarea);
-
- // Create area button
- const newarea = document.createElement("SPAN");
- newarea.className = "area-button area-default";
- newarea.id = `area${id}`;
- newarea.innerText = thisarea.name;
- newarea.title =
- `Players: ${thisarea.players}\n` +
- `Status: ${thisarea.status}\n` +
- `CM: ${thisarea.cm}\n` +
- `Area lock: ${thisarea.locked}`;
- newarea.onclick = function () {
- area_click(newarea);
- };
-
- document.getElementById("areas")!.appendChild(newarea);
+ });
+ renderAreaList();
};