1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-12-26 22:55:50 +00:00

Make world map reveal method configurable via user settings,

and add the possibility for mods to override this setting.
This commit is contained in:
fgenesis 2012-10-14 03:46:47 +02:00
parent 8cad58f0c4
commit 416c47b4e9
6 changed files with 32 additions and 6 deletions

View file

@ -177,6 +177,14 @@ enum MenuPage
MENUPAGE_PETS = 3 MENUPAGE_PETS = 3
}; };
enum WorldMapRevealMethod
{
REVEAL_UNSPECIFIED = -1,
REVEAL_DEFAULT = 0,
REVEAL_PARTIAL = 1 // Not visited areas have zero alpha (invisible)
};
/* /*
class Title; class Title;
class GameOver; class GameOver;
@ -274,6 +282,8 @@ public:
static bool loadModXML(TiXmlDocument *d, std::string modName); static bool loadModXML(TiXmlDocument *d, std::string modName);
static ModType getTypeFromXML(TiXmlElement *xml); static ModType getTypeFromXML(TiXmlElement *xml);
WorldMapRevealMethod mapRevealMethod;
protected: protected:
bool shuttingDown; bool shuttingDown;
bool active; bool active;

View file

@ -6742,6 +6742,11 @@ void Game::applyState()
worldMapRender = 0; 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; worldMapRender = new WorldMapRender;
addRenderObject(worldMapRender, LR_WORLDMAP); addRenderObject(worldMapRender, LR_WORLDMAP);
// to hide minimap // to hide minimap

View file

@ -67,12 +67,6 @@ protected:
InterpolatedVector lerp; InterpolatedVector lerp;
}; };
enum WorldMapRevealMethod
{
REVEAL_DEFAULT = 0,
REVEAL_PARTIAL = 1 // Not visited areas have zero alpha (invisible)
};
class WorldMapRender : public RenderObject, public ActionMapper class WorldMapRender : public RenderObject, public ActionMapper
{ {
public: public:

View file

@ -60,6 +60,7 @@ void Mod::clear()
debugMenu = false; debugMenu = false;
hasMap = false; hasMap = false;
blockEditor = false; blockEditor = false;
mapRevealMethod = REVEAL_UNSPECIFIED;
} }
bool Mod::isDebugMenu() bool Mod::isDebugMenu()
@ -137,6 +138,11 @@ void Mod::load(const std::string &p)
props->Attribute("blockEditor", &t); props->Attribute("blockEditor", &t);
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) if (!active)
{ {
mapRevealMethod = REVEAL_UNSPECIFIED;
setLocalisationModPath(""); setLocalisationModPath("");
name = path = ""; name = path = "";
dsq->secondaryTexturePath = ""; dsq->secondaryTexturePath = "";

View file

@ -144,6 +144,12 @@ void UserSettings::save()
xml_saveSlotScreens.SetAttribute("on", video.saveSlotScreens); xml_saveSlotScreens.SetAttribute("on", video.saveSlotScreens);
} }
xml_video.InsertEndChild(xml_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); 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, "SaveSlotScreens", "on", &video.saveSlotScreens);
readInt(xml_video, "WorldMap", "revealMethod", &video.worldMapRevealMethod);
} }
TiXmlElement *xml_control = doc.FirstChildElement("Control"); TiXmlElement *xml_control = doc.FirstChildElement("Control");

View file

@ -113,6 +113,7 @@ public:
vsync = 1; vsync = 1;
darkbuffersize = 256; darkbuffersize = 256;
displaylists = 0; displaylists = 0;
worldMapRevealMethod = 0;
} }
int shader; int shader;
int blur; int blur;
@ -123,6 +124,7 @@ public:
int parallaxOn0, parallaxOn1, parallaxOn2; int parallaxOn0, parallaxOn1, parallaxOn2;
int numParticles; int numParticles;
int displaylists; int displaylists;
int worldMapRevealMethod;
} video; } video;
struct Control struct Control