diff --git a/Aquaria/DSQ.h b/Aquaria/DSQ.h index 1acd434..48ef1f2 100644 --- a/Aquaria/DSQ.h +++ b/Aquaria/DSQ.h @@ -177,6 +177,14 @@ enum MenuPage MENUPAGE_PETS = 3 }; +enum WorldMapRevealMethod +{ + REVEAL_UNSPECIFIED = -1, + REVEAL_DEFAULT = 0, + REVEAL_PARTIAL = 1 // Not visited areas have zero alpha (invisible) +}; + + /* class Title; class GameOver; @@ -274,6 +282,8 @@ public: static bool loadModXML(TiXmlDocument *d, std::string modName); static ModType getTypeFromXML(TiXmlElement *xml); + WorldMapRevealMethod mapRevealMethod; + protected: bool shuttingDown; bool active; diff --git a/Aquaria/Game.cpp b/Aquaria/Game.cpp index ce2c3f9..68d699b 100644 --- a/Aquaria/Game.cpp +++ b/Aquaria/Game.cpp @@ -6742,6 +6742,11 @@ void Game::applyState() worldMapRender = 0; + if(dsq->mod.isActive() && dsq->mod.mapRevealMethod != REVEAL_UNSPECIFIED) + WorldMapRender::setRevealMethod(dsq->mod.mapRevealMethod); + else + WorldMapRender::setRevealMethod((WorldMapRevealMethod)dsq->user.video.worldMapRevealMethod); + worldMapRender = new WorldMapRender; addRenderObject(worldMapRender, LR_WORLDMAP); // to hide minimap diff --git a/Aquaria/GridRender.h b/Aquaria/GridRender.h index c6ed3be..43e04b3 100644 --- a/Aquaria/GridRender.h +++ b/Aquaria/GridRender.h @@ -67,12 +67,6 @@ protected: InterpolatedVector lerp; }; -enum WorldMapRevealMethod -{ - REVEAL_DEFAULT = 0, - REVEAL_PARTIAL = 1 // Not visited areas have zero alpha (invisible) -}; - class WorldMapRender : public RenderObject, public ActionMapper { public: diff --git a/Aquaria/Mod.cpp b/Aquaria/Mod.cpp index 0f8b78c..693b9f0 100644 --- a/Aquaria/Mod.cpp +++ b/Aquaria/Mod.cpp @@ -60,6 +60,7 @@ void Mod::clear() debugMenu = false; hasMap = false; blockEditor = false; + mapRevealMethod = REVEAL_UNSPECIFIED; } bool Mod::isDebugMenu() @@ -137,6 +138,11 @@ void Mod::load(const std::string &p) props->Attribute("blockEditor", &t); blockEditor = t; } + if (props->Attribute("worldMapRevealMethod")) { + int t; + props->Attribute("worldMapRevealMethod", &t); + mapRevealMethod = (WorldMapRevealMethod)t; + } } } @@ -248,6 +254,7 @@ void Mod::setActive(bool a) { if (!active) { + mapRevealMethod = REVEAL_UNSPECIFIED; setLocalisationModPath(""); name = path = ""; dsq->secondaryTexturePath = ""; diff --git a/Aquaria/UserSettings.cpp b/Aquaria/UserSettings.cpp index b3d126b..49e19f4 100644 --- a/Aquaria/UserSettings.cpp +++ b/Aquaria/UserSettings.cpp @@ -144,6 +144,12 @@ void UserSettings::save() xml_saveSlotScreens.SetAttribute("on", video.saveSlotScreens); } xml_video.InsertEndChild(xml_saveSlotScreens); + + TiXmlElement xml_worldMap("WorldMap"); + { + xml_worldMap.SetAttribute("revealMethod", video.worldMapRevealMethod); + } + xml_video.InsertEndChild(xml_worldMap); } doc.InsertEndChild(xml_video); @@ -445,6 +451,8 @@ void UserSettings::load(bool doApply, const std::string &overrideFile) } readInt(xml_video, "SaveSlotScreens", "on", &video.saveSlotScreens); + + readInt(xml_video, "WorldMap", "revealMethod", &video.worldMapRevealMethod); } TiXmlElement *xml_control = doc.FirstChildElement("Control"); diff --git a/Aquaria/UserSettings.h b/Aquaria/UserSettings.h index 50b6c3f..1e31763 100644 --- a/Aquaria/UserSettings.h +++ b/Aquaria/UserSettings.h @@ -113,6 +113,7 @@ public: vsync = 1; darkbuffersize = 256; displaylists = 0; + worldMapRevealMethod = 0; } int shader; int blur; @@ -123,6 +124,7 @@ public: int parallaxOn0, parallaxOn1, parallaxOn2; int numParticles; int displaylists; + int worldMapRevealMethod; } video; struct Control