feat(map.lic): v2.1.0 Add Dynamic Map Renderer & Genie Cross-Reference #2245
+1,191
−4
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.
Dynamic Map Renderer & Genie Cross-Reference for ElanthiaMap v2.0.0
Summary
Adds a Cairo-based dynamic map renderer and Genie cross-database commands to ElanthiaMap v2.0.0 (PR #2207). This PR is designed to be merged on top of
feat/map-v2.0.0.;map genieand;map g<zone>:<node>commands for looking up rooms by Genie client zone/node IDs (DR only, requires feat(all): Add Genie map cross-reference fields to the DragonRealms map data model lich-5#1169).Changes
Base branch:
feat/map-v2.0.0(PR #2207)Files changed:
scripts/map.lic(+564 lines),spec/map/map_dynamic_spec.rb(new, 40 tests)New Modules
ElanthiaMap::ZoneResolvergenie_zone->@image->@location-> BFS flood-fill. Results are cached.ElanthiaMap::LayoutEnginegenie_poscoordinates directly. Mode B: BFS auto-layout using compass directions fromwaytodata. Includes post-processing collision resolution.Window Modifications
update_dynamic_displayqueue_drawdynamic_map_enabled?@settings[:dynamic_map]render_dynamic_mapfind_dynamic_room_attoggle_dynamic_mode@map_image/@room_marker) vs@drawing_areahandle_dynamic_clickgo2resize_drawing_area@drawing_areasize to@scrollerallocationcalculate_dynamic_scaleSettings & Menu
dynamic_mapsetting added toload_settings,save_settings,reset_all_settingsGenie Commands
;map genie— displayszone:nodefor the current room (DR only, returns early);map g<zone>:<node>— opens map centered on the room matching that Genie referencedetermine_display_roomupdated to handlegenieandg\w+:\w+patternsOther Changes
create_map_display: adds@drawing_area(Gtk::DrawingArea) to layout, hidden by defaultshow: properly toggles static/dynamic widget visibility aftershow_allhandle_click: early return tohandle_dynamic_clickwhen dynamic mode is activedestroy: cleans up@drawing_areabefore menu/window destroy (macOS Quartz fix)dynamic_map_enabled?for dynamic vs static rendering pathupdate_dynamic_displaywhen dynamic mode is activeArchitecture
Dependencies
genie_id,genie_zone,genie_posfields tomap_dr.rbandjson_extra_fieldshook tomap_base.rb. The Genie commands useRoom.by_genie_refwhich is defined there. Dynamic map rendering works without this PR but Genie-specific features (Mode A positioning,;map genie,;map g1:335) require it.feat/map-v2.0.0): This PR is branched from and targets the ElanthiaMap v2.0.0 refactor.Test Plan
rspec spec/map/map_dynamic_spec.rb— 40 examples, 0 failuresruby -c scripts/map.lic— Syntax OK;map— static mode works unchangedgo2navigation;map genie-> shows Genie zone:node reference (DR only);map g1:335-> opens map centered on that room;map resetresets dynamic_map to false