changed DrawMap() function to allow access to named objects of the MapCreator if kept #114
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.
This implements DrawCreatorMap() function for LC. DrawCreatorMap uses the MapCreator used for the generation of the initial map from Landscape.txt to draw a map with named overlays the same way DrawMap() would. Like DrawDefMap it requires KeepMapCreator=1. The way it is implemented, it can also be used to append named overlays to the MapCreator.
DrawCreatorMap(0,0,LandscapeWidth(),LandscapeHeight(),"map newMap{Rock{y=0};Paper{y=33;};Scissors{y=67;};};")
Would draw a new map using overlays with the names "Rock", "Paper" and "Scissors" if they're defined in the Landscape.txt. Additonally the map "newMap" is appended to the MapCreator, so DrawDefMap(0,0,LandscapeWidth(),LandscapeHeight(),"newMap") is now possible even if newMap was not initially defined in the Landscape.txt
This implementation did not require changes to the C4MapCreatorS2.
Note: The C4MapCreatorS2::GetMap() function does always provide a drawable map if one is present in the MapCreator-Tree (i.e. is defined in Landscape.txt or appended to the MapCreator using DrawCreatorMap) thus calling DrawCreatorMap() will draw a map even if only a named overlay is defined.