Sync shard room objects and visuals - #216
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a state-sync gap between YAML room scripts and the live room object store (notably for room 26 shard spawning), and adds matching frontend visuals so shard/amulet ground objects render consistently across room text, console output, and badges.
Changes:
- Seed YAML room scripts’ room-object state from the live room object list before handling commands, then persist any YAML room-object mutations back into the live store and emit a sender-inclusive
room_objectsrefresh event. - Add ground-object visual definitions for
shard(💧) andamulet(🧿), plus targeted frontend tests covering inline rendering, console listing, and room panel badges. - Add/extend backend tests to verify live persistence via the
RoomScriptEngineroom-objects setter and correctroom_objectsevent emission semantics.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
backend/kyrgame/rooms.py |
Seeds YAML engine room objects from live state, persists YAML mutations through set_room_objects, and emits sender-inclusive room_objects refresh events. |
backend/kyrgame/yaml_rooms.py |
Adds set_room_objects to allow external seeding/overwriting of YAML engine room-object state. |
backend/tests/rooms/test_room26_ashtre.py |
Adds assertions/tests ensuring shard persistence to the live store and a single sender-inclusive room_objects event when shard spawns. |
frontend/src/data/groundObjectVisuals.ts |
Adds shard/amulet visuals and tightens typing via satisfies for the visual map. |
frontend/src/components/RoomPanel.test.tsx |
Extends room panel badge coverage to include amulet and shard. |
frontend/src/components/MudConsole.test.tsx |
Extends console ground-object listing coverage to include amulet and shard rendering. |
frontend/src/components/GemstoneText.test.tsx |
Adds dedicated assertions for shard/amulet inline visual rendering and styling. |
docs/PORTING_PLAN.md |
Updates porting checklist to reflect the new YAML↔live room-object sync capability and event behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix room 26 shard spawning so YAML room-object mutations sync back into the live room store, then add the matching frontend shard and amulet ground-object visuals.
Changes
RoomScriptEnginesetter and emit sender-inclusiveroom_objectsrefresh events.shard(💧) andamulet(🧿).Motivation & Context
Intent
cry ashes/weep ashes, matching the legacy behavior where the object array is updated directly.Context
pgmlobj(&gmobjs[43])modifies the live room object array directly.Legacy code being ported
legacy/KYRROUS.C/ room 26 ash-tree path that creates shard object 43.backend/kyrgame/yaml_rooms.py—YamlRoomEngine.set_room_objectshelper.backend/kyrgame/rooms.py— YAML room-object seeding, sync, androom_objectsevent emission.frontend/src/data/groundObjectVisuals.ts— shard and amulet visual definitions.frontend/src/components/*tests — room panel, console, and inline text visual coverage.room_objectspayload shape so modern clients refresh consistently.Testing
cd legacy && make -f ELWKYR(Worldgroup build)pytest backend/tests/rooms/test_room26_ashtre.pypytest backend/testscd backend && python -m kyrgame.scripts.package_content --output ../legacy/Dist/offline-content.jsoncd frontend && npm.cmd test -- GemstoneText --runcd frontend && npm.cmd test -- MudConsole --runcd frontend && npm.cmd test -- RoomPanel --runcd frontend && npm.cmd run buildDetails:
http://127.0.0.1:5173rendersA 💧 shard rests near an 🧿 amulet.and reports shardtextShadow: none.frontend/screenshots/shard-amulet-ground-object-visuals.png.Manual E2E Demo Checklist
cry ashesorweep ashes.💧 shardin blue with no text outline.🧿 amuletwhere it appears in room text or badges.Risk & Rollback
UI Changes
frontend/screenshots/shard-amulet-ground-object-visuals.pngshowing shard and amulet inline rendering.