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.
Changes:
This PR adds a map region system. Regions allow the minimap to display only part of a level even if the level has larger bounds (for example, a 5x5 region in a 20x16 level). Regions can also have custom images. If region
id
.png is present in /graphics, then the minimap will display that image when the current region isid
. The default region is0
, and in region0
the map will display minimap.png (instead of region0.png) if it is present, in order to maintain forwards compatibility. There are a maximum of 401 regions, from0
to400
.It adds three commands to manage them:
setregion(id,x,y,x2,y2)
- sets regionid
fromx,y
tox2,y2
.changeregion(id)
- sets the current region toid
. If regionid
doesn't exist, then it will act as if you aren't in any region at all.removeregion(id)
- removes regionid
from the array.Here is a demonstration video:
Regiondemo.mp4
This PR will not break forwards compatibility. Playing a level which uses this system with an older version of the game probably won't even affect their ability to navigate, although they might end up seeing rooms on the minimap that the level creator intended to be outside of the bounds of the displayed map.
Regions are saved to and loaded from a level's save file, as well as what the current region is. The map cursor and icons for trinkets and teleporters will display properly - if the player/a trinket/a teleporter is outside the bounds of the current region, it won't render on the map screen.
This also cleans up a lot of map code, moving more things into
MapRenderData
. Thanks to Ally and Dav999 for help with this!!!Legal Stuff:
By submitting this pull request, I confirm that...
CONTRIBUTORS
file and the "GitHub Friends"section of the credits for all of said releases, but will NOT be compensated
for these changes