feat: per-map configurable start camera position (#427)#795
Open
Apezdr wants to merge 1 commit intoBlueMap-Minecraft:masterfrom
Open
feat: per-map configurable start camera position (#427)#795Apezdr wants to merge 1 commit intoBlueMap-Minecraft:masterfrom
Apezdr wants to merge 1 commit intoBlueMap-Minecraft:masterfrom
Conversation
Extend map config with start-distance, start-rotation, start-angle,
start-tilt, and start-view fields so each map can define its full initial
camera state beyond just start-pos x/z.
- MapConfig: add startDistance (1500), startRotation (0), startAngle (0),
startTilt (0), startView ("perspective") fields
- MapSettings: add default getters for the new fields
- MapSettingsSerializer: emit all new fields into each map's settings.json
- map.conf template: document new options with defaults and comments
- Map.js: parse new fields from settings.json into map data
- BlueMapApp.resetCamera: apply per-map start values; per-map startView
takes priority over global defaultToFlatView, with graceful fallback
when the requested view is not enabled on the map
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
Closes #427
Extends the map config with five new optional fields that control the full initial camera state when a map is opened without a URL hash:
start-distance— zoom/camera distance (default:1500)start-rotation— horizontal camera rotation in radians (default:0)start-angle— vertical camera angle in radians (default:0)start-tilt— camera tilt in radians (default:0)start-view— initial view mode:"perspective","flat", or"free"(default:"perspective")These complement the existing
start-posfield. All five default to the same values as before, so existing configs are unaffected.Example config
The values map directly to the URL hash format (
#mapId:x:y:z:distance:rotation:angle:tilt:ortho:state), making it easy to copy a position from the browser bar into the config.Changes
MapConfig— five new fields with safe defaultsMapSettings— default interface getters for the new fieldsMapSettingsSerializer— emits all five fields into each map'ssettings.jsonmap.conftemplate — documents the new optionsMap.js— parses the new fields fromsettings.jsonBlueMapApp.resetCamera()— applies per-map start values;start-viewtakes priority over the globaldefaultToFlatViewsetting, with graceful fallback when the requested view is not enabled on the mapTest plan
start-view: "flat"opens in flat/isometric viewstart-view: "free"opens in free-flight viewstart-viewrequests a disabled view, falls back to the next available view