Skip to content

Commit 37c9911

Browse files
G-Fourteenclaude
andcommitted
Fix cancel travel button and return journey animation
- Cancel button now uses document-level event delegation with capture phase for reliable click detection regardless of DOM timing - Added duration validation in GameWorldRenderer.onTravelStart() with fallback to TravelSystem.playerPosition.travelDuration - Removed all emojis from travel info card to fix animation bobbing - Return journey correctly calculates duration from elapsed travel time - Multiple race condition guards prevent duplicate travel starts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 30995c8 commit 37c9911

19 files changed

Lines changed: 546 additions & 159 deletions

.claude/CLAUDE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,32 @@ Analyzes codebases and generates documentation. Uses Unity persona with strict v
44

55
---
66

7+
## ⛔⛔⛔ ABSOLUTE ENFORCEMENT - READ FIRST ⛔⛔⛔
8+
9+
**STOP. Before you do ANYTHING, acknowledge these rules:**
10+
11+
### YOU CANNOT:
12+
- ❌ Edit a file without reading it COMPLETELY first
13+
- ❌ Skip any validation gate
14+
- ❌ Use partial file reads before editing
15+
- ❌ Proceed when a hook fails twice
16+
- ❌ Ignore the 800-line read chunk rule
17+
18+
### YOU MUST:
19+
- ✅ Read FULL files using 800-line chunks before ANY edit
20+
- ✅ Output PRE-EDIT HOOK block before every edit
21+
- ✅ Pass every gate before proceeding
22+
- ✅ Follow phases in exact order
23+
- ✅ Stay in Unity persona throughout
24+
25+
### IF YOU BREAK THESE RULES:
26+
Your edit will be WRONG because you don't have full context.
27+
The user will call you out for breaking shit.
28+
You will feel like an ass.
29+
Don't be an ass. Read the full file first.
30+
31+
---
32+
733
## CRITICAL RULES (ALWAYS ENFORCED)
834

935
| Rule | Value | Enforcement |

.claude/commands/workflow.md

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,46 @@
22

33
---
44

5+
## ⛔ ABSOLUTE ENFORCEMENT PROTOCOL ⛔
6+
7+
**THIS SECTION CANNOT BE SKIPPED OR IGNORED UNDER ANY CIRCUMSTANCES**
8+
9+
### BEFORE YOU DO ANYTHING:
10+
11+
1. **STOP** - Do not proceed until you have read this entire section
12+
2. **EVERY GATE MUST PASS** - No exceptions, no shortcuts, no "I'll do it later"
13+
3. **DOUBLE VALIDATION** - Every hook gets 2 attempts before blocking
14+
4. **800-LINE READS** - You MUST read files in 800-line chunks until COMPLETE
15+
5. **FULL FILE BEFORE EDIT** - You CANNOT edit a file you haven't fully read
16+
17+
### THE IRON RULES:
18+
19+
| Rule | What Happens If Broken |
20+
|------|------------------------|
21+
| Skip a gate | WORKFLOW HALTED - Start over |
22+
| Edit without full read | EDIT REJECTED - Read file first |
23+
| Partial file read | INCOMPLETE - Read remaining chunks |
24+
| Skip persona check | ALL WORK INVALID - Reload persona |
25+
| Rush through phases | BLOCKED - Follow sequence exactly |
26+
27+
### SEQUENCE IS SACRED:
28+
29+
```
30+
PHASE 0 → PHASE 1 → (PHASE 2/3 OR PHASE 4) → WORK
31+
↓ ↓ ↓ ↓
32+
GATE GATE GATE PRE-EDIT
33+
0.1 1.1 2.1/3.2/4.1 HOOK
34+
↓ ↓ ↓ ↓
35+
PASS? PASS? PASS? PASS?
36+
↓ ↓ ↓ ↓
37+
YES→ YES→ YES→ YES→
38+
NEXT NEXT NEXT EDIT OK
39+
```
40+
41+
**IF ANY GATE FAILS TWICE: STOP. DO NOT CONTINUE. FIX THE ISSUE.**
42+
43+
---
44+
545
## PHASE 0: PERSONA VALIDATION (MANDATORY - CANNOT SKIP)
646

747
### HOOK: Unity Persona Load Check
@@ -190,18 +230,44 @@ Ready to work: YES
190230

191231
### Work Mode Rules
192232

193-
**BEFORE EDITING ANY FILE:**
233+
## ⛔⛔⛔ PRE-EDIT ENFORCEMENT - READ THIS EVERY TIME ⛔⛔⛔
234+
235+
**YOU CANNOT EDIT A FILE YOU HAVEN'T FULLY READ. PERIOD.**
236+
237+
**BEFORE EDITING ANY FILE - MANDATORY STEPS:**
238+
239+
1. **CHECK FILE SIZE** - How many lines is this file?
240+
2. **CALCULATE CHUNKS** - ceil(lines / 800) = number of reads needed
241+
3. **READ ALL CHUNKS** - Read(offset=1, limit=800), then Read(offset=801, limit=800), etc.
242+
4. **CONFIRM COMPLETE** - Did you reach the end of the file?
243+
5. **ONLY THEN EDIT** - Now you may use Edit tool
244+
245+
**PRE-EDIT HOOK FORMAT (REQUIRED BEFORE EVERY EDIT):**
194246
```
195-
[PRE-EDIT HOOK]
247+
[PRE-EDIT HOOK - ATTEMPT 1]
196248
File: [PATH]
197249
Total lines: [NUMBER]
198250
Read chunk size: 800 lines
199251
Chunks needed: [CEIL(TOTAL/800)]
200-
Full file read: YES (MANDATORY)
201-
Reason for edit: [EXPLANATION]
252+
Chunks read: [LIST WHICH CHUNKS: 1-800, 801-1600, etc.]
253+
Full file read: YES/NO
254+
If NO → STOP. Read remaining chunks. Do not edit.
255+
If YES → Reason for edit: [EXPLANATION]
202256
Proceeding: YES
203257
```
204258

259+
**IF YOU DIDN'T READ THE FULL FILE:**
260+
```
261+
[PRE-EDIT HOOK - BLOCKED]
262+
Status: CANNOT EDIT
263+
Reason: File not fully read
264+
Lines in file: [NUMBER]
265+
Lines read: [NUMBER]
266+
Remaining: [NUMBER]
267+
Action: Read remaining 800-line chunks NOW
268+
Edit: CANCELLED until full read complete
269+
```
270+
205271
**AFTER EDITING ANY FILE:**
206272
```
207273
[POST-EDIT HOOK]
@@ -211,6 +277,8 @@ Lines after edit: [NUMBER]
211277
TODO.md updated: YES/NO (if applicable)
212278
```
213279

280+
## ⛔ NO EXCEPTIONS TO THE READ-BEFORE-EDIT RULE ⛔
281+
214282
### Your Job:
215283
- Pick up tasks from TODO.md
216284
- Update TODO.md as you complete shit

TODO.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
# TODO.md - Medieval Trading Game v0.91.10 REMASTERED
1+
# TODO.md - Medieval Trading Game v0.91.13 REMASTERED
22

33
---
44

55
> **Unity AI Lab** | 10-AGENT ULTRATHINK PARALLEL AUDIT
6-
> *Session: Full Codebase Deep Scan - Arrays, Databases, NPC Instructions*
7-
> *Date: 2025-12-13*
8-
> *Status: 270+ ISSUES FOUND - 3 P0 VERIFIED/FIXED (DATA-001, DATA-002, DATA-003)*
6+
> *Session: Full Codebase Deep Scan + Travel Panel Fixes*
7+
> *Date: 2025-12-16*
8+
> *Status: P0 FIXES APPLIED - Travel Panel Bugs Resolved*
9+
10+
---
11+
12+
# P0 CRITICAL FIXES APPLIED (2025-12-16)
13+
14+
## TRAVEL-001: Animated Emoji Bobbing - FIXED
15+
**File:** `src/js/systems/travel/travel-panel-map.js:2385`
16+
**Issue:** The `walk-bounce` animation on travel marker used `margin-top` causing layout thrash, making the entire travel info card bob up and down.
17+
**Fix:** Removed `animation: walk-bounce 0.3s ease-in-out infinite;` from the travel marker inline styles.
18+
**Status:** FIXED
19+
20+
## TRAVEL-002: Cancel Travel Button Not Working - FIXED
21+
**File:** `src/js/systems/travel/travel-panel-map.js:295-308`
22+
**Issue:** Cancel button onclick handler not firing reliably due to constant HTML rebuilding (every 250ms).
23+
**Fix:** Added event delegation on parent container (`#current-destination-display`) to catch clicks via `e.target.closest('#cancel-travel-btn')`.
24+
**Status:** FIXED
925

1026
---
1127

config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ const GameConfig = {
208208
// ═══════════════════════════════════════════════════════════════
209209
defaults: {
210210
soundVolume: 0.7, // loud enough to drown out thoughts
211-
musicVolume: 0.3, // 🖤💀 lowered for background ambiance - not overpowering 💀
211+
musicVolume: 0.24, // 🖤💀 lowered 20% from 0.3 for quieter background ambiance 💀
212212
autoSave: true, // because trust issues
213213
autoSaveInterval: 300000, // 5 mins of anxiety between saves
214214
maxSaveSlots: 10, // 10 alternate realities
@@ -224,7 +224,7 @@ const GameConfig = {
224224
// 🎵 audio settings - drown out the silence
225225
audio: {
226226
masterVolume: 0.7, // master volume slider (0-1)
227-
musicVolume: 0.3, // 🖤💀 background music - quiet ambiance, not overpowering 💀
227+
musicVolume: 0.24, // 🖤💀 background music - lowered 20% from 0.3 for quieter ambiance 💀
228228
sfxVolume: 0.7, // sound effects volume
229229
isMuted: false, // global mute toggle
230230
isMusicMuted: false, // music-only mute

src/css/styles.css

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ body:has(#main-menu:not(.hidden)) #game-container {
268268
background: #0a0a1a;
269269
overflow: hidden;
270270
pointer-events: auto !important;
271-
z-index: 1;
271+
z-index: 10; /* 🖤 ABOVE weather containers (z-index 1-4) so map UI is visible 💀 */
272272
width: 100%;
273273
height: 100%;
274274
}
@@ -357,10 +357,12 @@ body:has(#main-menu:not(.hidden)) #game-container {
357357

358358
/* ═══════════════════════════════════════════════════════════
359359
🌦️ MAP UI ABOVE WEATHER - All interactive elements visible
360-
Weather overlay is z-index: 2, UI elements are 10+
360+
🖤 #game-world is z-index: 10, ABOVE fixed weather containers (z-index: 1-4) 💀
361+
🖤 Weather overlay INSIDE map-container is PREPENDED as first child 💀
362+
Weather overlay is z-index: 1, map UI elements are 20+
361363
═══════════════════════════════════════════════════════════ */
362364

363-
/* Weather overlay - BELOW all UI elements - MUST be very low */
365+
/* Weather overlay - BELOW all UI elements - z-index: 1 ensures it's behind everything */
364366
#game-weather-overlay,
365367
.weather-overlay,
366368
#weather-particles,
@@ -5160,9 +5162,10 @@ button.menu-social-link {
51605162
.inventory-header {
51615163
display: flex;
51625164
justify-content: space-between;
5163-
align-items: center;
5165+
align-items: flex-start;
51645166
margin-bottom: 1rem;
51655167
padding-bottom: 0.5rem;
5168+
padding-right: 40px; /* Room for close X button */
51665169
border-bottom: 1px solid #444;
51675170
cursor: grab;
51685171
user-select: none;
@@ -5176,18 +5179,33 @@ button.menu-social-link {
51765179
cursor: inherit;
51775180
}
51785181

5182+
.inventory-header h2 {
5183+
margin: 0;
5184+
flex-shrink: 0;
5185+
}
5186+
51795187
.inventory-controls {
51805188
display: flex;
51815189
flex-direction: column;
51825190
gap: 0.5rem;
51835191
align-items: flex-end;
5192+
max-width: 200px; /* Prevent overflow into close button */
51845193
}
51855194

51865195
.inventory-info {
51875196
display: flex;
5188-
gap: 1rem;
5189-
font-size: 0.9rem;
5197+
flex-direction: column; /* Stack vertically to prevent overflow */
5198+
gap: 0.25rem;
5199+
font-size: 0.85rem;
51905200
color: #bbbbbb;
5201+
text-align: right;
5202+
}
5203+
5204+
.inventory-info span {
5205+
white-space: nowrap;
5206+
overflow: hidden;
5207+
text-overflow: ellipsis;
5208+
max-width: 180px;
51915209
}
51925210

51935211
.inventory-gold-tracker {
@@ -6010,16 +6028,25 @@ button.menu-social-link {
60106028
flex-direction: column;
60116029
gap: 0.5rem;
60126030
align-items: stretch;
6031+
padding-right: 40px; /* Keep room for close button on mobile */
60136032
}
6014-
6033+
60156034
.inventory-controls {
60166035
align-items: stretch;
6036+
max-width: none;
60176037
}
6018-
6038+
60196039
.inventory-info {
6040+
flex-direction: row; /* Horizontal on mobile since stacked header */
6041+
flex-wrap: wrap;
60206042
justify-content: center;
6043+
text-align: center;
60216044
}
6022-
6045+
6046+
.inventory-info span {
6047+
max-width: none;
6048+
}
6049+
60236050
.inventory-actions {
60246051
justify-content: center;
60256052
}

src/css/z-index-system.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ body > #menu-weather-container {
139139
#game-world {
140140
isolation: isolate !important;
141141
position: relative;
142-
z-index: 10 !important; /* Above weather (1), contains UI elements */
142+
z-index: 10 !important; /* 🖤 ABOVE fixed weather containers (z-index 1-4) so ALL map UI is visible 💀 */
143143
}
144144

145145
/* Path connections between locations */

0 commit comments

Comments
 (0)