Skip to content

Commit b019a71

Browse files
Fix - level editor render issues
Update - allow battle dome access Add - NPC difficulty levels Fix - FINALLY FIX DIALOGUE ISSUES!!
1 parent 01a4063 commit b019a71

22 files changed

Lines changed: 991 additions & 151 deletions

packages/api/src/routes/admin.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,19 @@ const getProject: RequestHandler = async (req, res) => {
451451
return;
452452
}
453453

454+
const [owner] = await db
455+
.select({ username: users.username })
456+
.from(users)
457+
.where(eq(users.id, project.userId))
458+
.limit(1);
459+
454460
const shipments = await db
455461
.select()
456462
.from(yswsShipments)
457463
.where(eq(yswsShipments.projectId, project.id))
458464
.orderBy(desc(yswsShipments.submittedAt));
459465

460-
res.json({ ...project, shipments });
466+
res.json({ ...project, ownerUsername: owner?.username ?? null, shipments });
461467
} catch (error) {
462468
console.error("Error fetching project:", error);
463469
res.status(500).json({ error: "Failed to fetch project" });

packages/client/public/assets/levels/town-square.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,11 @@
12361236
"x": -2.5647778667974714,
12371237
"z": -6.80905290268835,
12381238
"rotation": 0.2617993877991494,
1239-
"scale": 1
1239+
"scale": 1,
1240+
"action": {
1241+
"type": "open_battle_dome",
1242+
"label": "Open battle dome"
1243+
}
12401244
},
12411245
{
12421246
"id": "1774307412236_wlyc22h",

packages/client/src/components/AdminDashboard.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ interface AdminProject {
120120
interface ProjectDetail {
121121
id: string;
122122
userId: string;
123+
ownerUsername: string | null;
123124
title: string;
124125
description: string | null;
125126
screenshotUrl: string | null;
@@ -2860,15 +2861,22 @@ export const AdminDashboard: Component = () => {
28602861
<Show when={inspectedProject()}>
28612862
{(proj) => (
28622863
<div class={s.editPanel}>
2864+
<button class={s.backBtn} onClick={() => { setTab("users"); inspectUser(proj().userId); }}>
2865+
{proj().ownerUsername || proj().userId}
2866+
</button>
28632867
<h3 class={s.sectionTitle}>Inspect: {proj().title}</h3>
28642868

28652869
<div class={s.editRow}>
28662870
<label class={s.editLabel}>ID</label>
28672871
<span class={s.detailValue}>{proj().id}</span>
28682872
</div>
28692873
<div class={s.editRow}>
2870-
<label class={s.editLabel}>User ID</label>
2871-
<span class={s.detailValue}>{proj().userId}</span>
2874+
<label class={s.editLabel}>Owner</label>
2875+
<span class={s.detailValue}>
2876+
<button class={s.linkBtn} onClick={() => { setTab("users"); inspectUser(proj().userId); }}>
2877+
{proj().ownerUsername || proj().userId}
2878+
</button>
2879+
</span>
28722880
</div>
28732881

28742882
<div class={s.editRow}>
@@ -3148,6 +3156,9 @@ export const AdminDashboard: Component = () => {
31483156
<Show when={inspectedShipment()}>
31493157
{(ship) => (
31503158
<div class={s.editPanel}>
3159+
<button class={s.backBtn} onClick={() => { setTab("projects"); inspectProject(ship().projectId); }}>
3160+
{ship().projectTitle}
3161+
</button>
31513162
<h3 class={s.sectionTitle}>Inspect Ship: {ship().title || ship().projectTitle}</h3>
31523163

31533164
<div class={s.editRow}>

packages/client/src/components/BattleDomeUI.module.scss

Lines changed: 108 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,25 @@
99
background: rgba(0, 0, 0, 0.75);
1010
}
1111

12-
.panel {
13-
background: $brown-accent;
14-
border: 5px solid $brown-dark;
15-
border-radius: 1.8em;
12+
.panelContainer {
1613
width: min(1100px, 96vw);
1714
max-height: 92vh;
1815
display: flex;
1916
flex-direction: column;
2017
font-family: $font-stack;
18+
animation: panelFlyIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
19+
}
20+
21+
.backing {
22+
background: $brown-accent;
23+
border: 5px solid $brown-dark;
24+
border-radius: 1.8em;
25+
display: flex;
26+
flex-direction: column;
2127
overflow: hidden;
2228
padding: 0.3em;
23-
animation: panelFlyIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
29+
flex: 1;
30+
min-height: 0;
2431
}
2532

2633
@keyframes panelFlyIn {
@@ -34,39 +41,94 @@
3441
}
3542
}
3643

44+
// ============ TAB BAR ============
45+
46+
.tabBar {
47+
display: flex;
48+
padding: 0 1.2em 0 1.8em;
49+
gap: 2px;
50+
align-self: stretch;
51+
position: relative;
52+
z-index: 2;
53+
}
54+
55+
.tabSpacer {
56+
flex: 1;
57+
}
58+
59+
.tab {
60+
background: $brown-tab;
61+
border: 4px solid $brown-dark;
62+
border-bottom: none;
63+
border-radius: 1em 1em 0 0;
64+
padding: 0.3em 0.5em;
65+
cursor: pointer;
66+
font-family: $font-stack;
67+
font-size: 0.85em;
68+
color: $parchment;
69+
text-align: center;
70+
position: relative;
71+
top: 4.7px;
72+
display: flex;
73+
align-items: center;
74+
justify-content: center;
75+
76+
&:hover {
77+
background: $brown-mid;
78+
}
79+
}
80+
81+
.closeIcon {
82+
width: 2em;
83+
height: 2em;
84+
object-fit: contain;
85+
image-rendering: auto;
86+
}
87+
3788
// ============ HEADER ============
3889

3990
.header {
91+
background: $brown-mid;
92+
border-radius: 1.8em;
93+
padding: 0.5em;
94+
margin: -0.3em -0.55em 0 -0.55em;
95+
position: relative;
96+
z-index: 2;
97+
border: 5px solid $brown-dark;
98+
border-top: none;
99+
box-shadow: 0 4px 0 0 #00000050;
100+
}
101+
102+
.headerInset {
103+
border-radius: 1.2em;
104+
padding: 0.6em 1em;
105+
min-height: 2.5em;
40106
display: flex;
41-
justify-content: space-between;
42107
align-items: center;
43-
padding: 0.6em 1em;
44-
background: $brown-mid;
45-
border-radius: 1.4em 1.4em 0 0;
46-
border-bottom: 3px solid $brown-dark;
108+
justify-content: space-between;
109+
position: relative;
110+
111+
&::after {
112+
content: '';
113+
position: absolute;
114+
inset: -2px;
115+
border-radius: inherit;
116+
pointer-events: none;
117+
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='26' fill='none' stroke='%23F4CA9540' stroke-width='8' stroke-dasharray='18 12' stroke-dashoffset='15' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
118+
background-size: 100% 100%;
119+
}
47120
}
48121

49122
.title {
50-
color: $parchment-light;
123+
color: $brown-border;
51124
margin: 0;
52-
font-size: 1.5rem;
125+
font-size: 1.4em;
53126
font-family: $font-stack;
54-
-webkit-text-stroke: 1px $brown-dark;
127+
font-weight: bold;
128+
-webkit-text-stroke: 4px $parchment-light;
55129
paint-order: stroke fill;
56-
}
57-
58-
.closeBtn {
59-
@include button-base;
60-
background: rgba(0, 0, 0, 0.2);
61-
color: $parchment-light;
62-
padding: 0.25rem 0.75rem;
63-
border-radius: $radius-md;
64-
font-size: 1rem;
65-
border: 1px solid rgba(255, 255, 255, 0.15);
66-
67-
&:hover {
68-
background: rgba(0, 0, 0, 0.4);
69-
}
130+
filter: drop-shadow(2px 2px 0 #00000050);
131+
letter-spacing: 0.05em;
70132
}
71133

72134
// ============ CONTENT AREA ============
@@ -76,8 +138,22 @@
76138
overflow-y: auto;
77139
padding: 1em;
78140
background: $parchment;
79-
border-radius: 0 0 1.4em 1.4em;
141+
border-radius: 1.5em;
142+
margin-top: -2em;
143+
padding-top: calc(2em + 1em);
144+
position: relative;
80145
@include custom-scrollbar;
146+
147+
&::after {
148+
content: '';
149+
position: absolute;
150+
inset: -2px;
151+
border-radius: inherit;
152+
pointer-events: none;
153+
z-index: -1;
154+
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='34' fill='none' stroke='%2393582C' stroke-width='8' stroke-dasharray='18 12' stroke-dashoffset='15' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
155+
background-size: 100% 100%;
156+
}
81157
}
82158

83159
// ============ CENTER STATE (loading, error) ============
@@ -704,6 +780,8 @@
704780
border-radius: $radius-sm;
705781
font-size: $font-size-xs;
706782
border: 1px solid rgba(255, 255, 255, 0.15);
783+
-webkit-text-stroke: 0;
784+
filter: none;
707785

708786
&:hover {
709787
background: rgba(0, 0, 0, 0.3);
@@ -718,6 +796,8 @@
718796
padding: 0.15rem 0.5rem;
719797
border-radius: $radius-pill;
720798
border: 1px solid rgba(245, 158, 11, 0.3);
799+
-webkit-text-stroke: 0;
800+
filter: none;
721801
}
722802

723803
// ============ REWARD INFO ============

packages/client/src/components/BattleDomeUI.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -823,15 +823,21 @@ export const BattleDomeUI: Component<BattleDomeUIProps> = (props) => {
823823
</Show>
824824

825825
<Show when={phase() !== "tutorial"}>
826-
<div class={s.panel}>
826+
<div class={s.panelContainer}>
827+
<div class={s.tabBar}>
828+
<div class={s.tabSpacer} />
829+
<button class={s.tab} onClick={props.onClose}><img src="/assets/sprites/ui/exit.webp" alt="Close" class={s.closeIcon} /></button>
830+
</div>
831+
<div class={s.backing}>
827832
<div class={s.header}>
828-
<h2 class={s.title}>Battle Dome</h2>
829-
<div class={s.headerRight}>
830-
<Show when={voterStreak() > 0}>
831-
<span class={s.streakBadge}>{voterStreak()} day streak</span>
832-
</Show>
833-
<button onClick={() => { setShowImpact(true); }} class={s.headerBtn}>Impact</button>
834-
<button onClick={props.onClose} class={s.closeBtn}>X</button>
833+
<div class={s.headerInset}>
834+
<h2 class={s.title}>Battle Dome</h2>
835+
<div class={s.headerRight}>
836+
<Show when={voterStreak() > 0}>
837+
<span class={s.streakBadge}>{voterStreak()} day streak</span>
838+
</Show>
839+
<button onClick={() => { setShowImpact(true); }} class={s.headerBtn}>Impact</button>
840+
</div>
835841
</div>
836842
</div>
837843

@@ -885,6 +891,7 @@ export const BattleDomeUI: Component<BattleDomeUIProps> = (props) => {
885891
</Show>
886892
</Show>
887893
</div>
894+
</div>
888895
</div>
889896
</Show>
890897
</div>

0 commit comments

Comments
 (0)