Migrate CI to Gitea and improve live map diagnostics
CI / Real Minecraft installs (manual) (push) Skipped
CI / Rust, web and container (push) Canceled after 0s
CI / Windows launcher (push) Canceled after 0s
Server integrations / paper (push) Canceled after 0s
Server integrations / Fabric and Forge / 1.20.1 (push) Canceled after 0s
Server integrations / Fabric and Forge / 1.21.1 (push) Canceled after 0s
Server integrations / Fabric and Forge / 26.1.2 (push) Canceled after 0s
Server integrations / Fabric and Forge / 26.2 (push) Canceled after 0s
Server integrations / Fabric and Forge / 26.3 (push) Canceled after 0s
CI / Real Minecraft installs (manual) (push) Skipped
CI / Rust, web and container (push) Canceled after 0s
CI / Windows launcher (push) Canceled after 0s
Server integrations / paper (push) Canceled after 0s
Server integrations / Fabric and Forge / 1.20.1 (push) Canceled after 0s
Server integrations / Fabric and Forge / 1.21.1 (push) Canceled after 0s
Server integrations / Fabric and Forge / 26.1.2 (push) Canceled after 0s
Server integrations / Fabric and Forge / 26.2 (push) Canceled after 0s
Server integrations / Fabric and Forge / 26.3 (push) Canceled after 0s
This commit is contained in:
1 parent
d72d7c2e80
commit
7809d47d39
32 files changed
+518
-325
No files matched your search
@@ -37,9 +37,11 @@
|
||||
let zoomText = $state('');
|
||||
let listOpen = $state(false);
|
||||
let following = $state<string | null>(null);
|
||||
let hiddenPlayers = $state<string[]>([]);
|
||||
let showSkins = $state(true);
|
||||
|
||||
const dims = $derived((info?.dimensions ?? []).filter((d) => d.available));
|
||||
const here = $derived((overlay?.players ?? []).filter((p) => dimSlug(p.dimension) === dim));
|
||||
const here = $derived((overlay?.players ?? []).filter((p) => dimSlug(p.dimension) === dim && !hiddenPlayers.includes(p.uuid)));
|
||||
const everyone = $derived(overlay?.players ?? []);
|
||||
const me = $derived(selfUuid ? everyone.find((p) => p.uuid.toLowerCase() === selfUuid.toLowerCase()) : undefined);
|
||||
const waiting = $derived(!info || !info.ready);
|
||||
@@ -59,13 +61,15 @@
|
||||
});
|
||||
|
||||
$effect(() => { if (view && info) { view.setInfo(info); dim = view.currentDimension?.slug ?? ''; } });
|
||||
$effect(() => { if (view && overlay) view.setOverlay(overlay); });
|
||||
$effect(() => { if (view && overlay) view.setOverlay({ ...overlay, players: overlay.players.filter((p) => !hiddenPlayers.includes(p.uuid)) }); });
|
||||
$effect(() => { view?.setLayers(layers); });
|
||||
$effect(() => { view?.setSkins(showSkins); });
|
||||
$effect(() => { view?.setSelf(selfUuid); });
|
||||
$effect(() => { if (view && info && initialDimension) view.setDimension(initialDimension); });
|
||||
|
||||
function chooseDimension(slug: string) { view?.setDimension(slug); dim = view?.currentDimension?.slug ?? slug; following = null; }
|
||||
function goTo(p: LivePlayer) {
|
||||
if (hiddenPlayers.includes(p.uuid)) hiddenPlayers = hiddenPlayers.filter((id) => id !== p.uuid);
|
||||
if (dimSlug(p.dimension) !== dim) chooseDimension(p.dimension);
|
||||
view?.flyTo(p.x, p.z, Math.max(view.getView().scale, 1.2));
|
||||
view?.select({ type: 'player', player: p });
|
||||
@@ -76,6 +80,10 @@
|
||||
view?.follow(following);
|
||||
}
|
||||
function findMe() { if (me) { goTo(me); } }
|
||||
function togglePlayer(uuid: string) {
|
||||
hiddenPlayers = hiddenPlayers.includes(uuid) ? hiddenPlayers.filter((id) => id !== uuid) : [...hiddenPlayers, uuid];
|
||||
if (hiddenPlayers.includes(uuid) && selection?.type === 'player' && selection.player.uuid === uuid) closeCard();
|
||||
}
|
||||
function toSpawn() {
|
||||
const spawn = view?.pinsOfKind('spawn')[0];
|
||||
if (spawn) view?.flyTo(spawn.x, spawn.z, 1);
|
||||
@@ -118,8 +126,10 @@
|
||||
</button>{/if}
|
||||
{#if listOpen && everyone.length}
|
||||
<ul class="plist" aria-label="Players online">
|
||||
<li class="options">{#if avatarUrl}<label><input type="checkbox" bind:checked={showSkins} /> Show skins</label>{/if}<button onclick={() => (hiddenPlayers = hiddenPlayers.length ? [] : everyone.map((p) => p.uuid))}>{hiddenPlayers.length ? 'Show all' : 'Hide all'}</button></li>
|
||||
{#each everyone as p (p.uuid)}
|
||||
<li>
|
||||
<input type="checkbox" aria-label={`Show ${p.name} on map`} checked={!hiddenPlayers.includes(p.uuid)} onchange={() => togglePlayer(p.uuid)} />
|
||||
<button onclick={() => goTo(p)}>
|
||||
{#if avatarUrl}<img src={avatarUrl(p.uuid)} alt="" width="22" height="22" />{/if}
|
||||
<span class="nm">{p.name}</span>
|
||||
@@ -204,6 +214,11 @@
|
||||
.right { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
|
||||
.plist { list-style: none; margin: 0; padding: 6px; width: 230px; max-height: 320px; overflow: auto; border-radius: 16px; background: var(--map-glass, rgba(14, 19, 34, 0.92)); border: 1px solid var(--map-line, rgba(255,255,255,0.12)); backdrop-filter: blur(14px); box-shadow: 0 14px 40px rgba(0,0,0,0.45); }
|
||||
.plist button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border: 0; border-radius: 11px; background: transparent; color: inherit; font: 600 13px/1 inherit; cursor: pointer; text-align: left; }
|
||||
.plist li { display: flex; align-items: center; gap: 3px; }
|
||||
.plist input { accent-color: var(--map-accent, #8b6cff); flex: 0 0 auto; }
|
||||
.plist .options { justify-content: space-between; padding: 6px 9px; border-bottom: 1px solid var(--map-line, rgba(255,255,255,0.12)); margin-bottom: 3px; font-size: 12px; }
|
||||
.plist .options label { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
|
||||
.plist .options button { width: auto; padding: 4px 6px; font-size: 12px; }
|
||||
.plist button:hover { background: rgba(255,255,255,0.08); }
|
||||
.plist img { border-radius: 6px; image-rendering: pixelated; }
|
||||
.nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
|
||||
Reference in new issue
Block a user