Navigation Menu

Skip to content

Commit

Permalink
Add option for outputting explored maps without unexplored BGs
Browse files Browse the repository at this point in the history
  • Loading branch information
Marlamin committed Sep 9, 2019
1 parent 5c9e56c commit 42c3ad3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
24 changes: 22 additions & 2 deletions WorldMapCompiler/Program.cs
Expand Up @@ -18,6 +18,7 @@ private static void Main(string[] args)
var saveExplored = bool.Parse(config["saveExploredMaps"]);
var saveUnexplored = bool.Parse(config["saveUnexploredMaps"]);
var saveLayers = bool.Parse(config["saveMapLayers"]);
var saveExploredMapsWithoutUnexplored = bool.Parse(config["saveExploredMapsWithoutUnexplored"]);

if (saveExplored && !Directory.Exists("explored"))
{
Expand All @@ -34,6 +35,11 @@ private static void Main(string[] args)
Directory.CreateDirectory("layers");
}

if (saveExploredMapsWithoutUnexplored && !Directory.Exists("exploredNoUnexplored"))
{
Directory.CreateDirectory("exploredNoUnexplored");
}

var locale = CASCLib.LocaleFlags.enUS;

if (config["locale"] != string.Empty)
Expand Down Expand Up @@ -160,9 +166,11 @@ private static void Main(string[] args)
}

var bmp = new Bitmap((int)res_y, (int)res_x);

var g = Graphics.FromImage(bmp);

var bmp2 = new Bitmap((int)res_y, (int)res_x);
var g2 = Graphics.FromImage(bmp2);

for (var cur_x = 0; cur_x < maxRows + 1; cur_x++)
{
for (var cur_y = 0; cur_y < maxCols + 1; cur_y++)
Expand Down Expand Up @@ -273,7 +281,14 @@ private static void Main(string[] args)
{
layerGraphics.DrawImage(blp.GetBitmap(0), cur_y * 256, cur_x * 256, new Rectangle(0, 0, 256, 256), GraphicsUnit.Pixel);
}
g.DrawImage(blp.GetBitmap(0), posY, posX, new Rectangle(0, 0, 256, 256), GraphicsUnit.Pixel);

var blpBMP = blp.GetBitmap(0);
g.DrawImage(blpBMP, posY, posX, new Rectangle(0, 0, 256, 256), GraphicsUnit.Pixel);

if (saveExploredMapsWithoutUnexplored)
{
g2.DrawImage(blpBMP, posY, posX, new Rectangle(0, 0, 256, 256), GraphicsUnit.Pixel);
}
}
catch (Exception e)
{
Expand All @@ -299,6 +314,11 @@ private static void Main(string[] args)
{
bmp.Save("explored/ " + CleanFileName(mapRow.ID + " - " + mapName + ".png"));
}

if (saveExploredMapsWithoutUnexplored)
{
bmp2.Save("exploredNoUnexplored/ " + CleanFileName(mapRow.ID + " - " + mapName + ".png"));
}
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions WorldMapCompiler/settings.json
@@ -1,8 +1,9 @@
{
"installDir": "C:/World of Warcraft/", // Set this to your WoW installation directory, leave empty if you just want to use web
"program": "wow", // Set this to wow for Retail, wowt for PTR or wow_beta for Alpha/Beta
"locale": "enUS", // Set this to deDE, enUS, ruRU, zhCN or zhTW for what language names/map images should be
"saveExploredMaps": true, // Whether or not to save explored versions of maps
"saveUnexploredMaps": false, // Whether or not to save un-explored versions of maps
"saveMapLayers": false // Whether or not to save the individual exploration layers separately
"installDir": "C:/Program Files (x86)/World of Warcraft/", // Set this to your WoW installation directory, leave empty if you just want to use web
"program": "wow_classic", // Set this to wow for Retail, wowt for PTR or wow_beta for Alpha/Beta
"locale": "enUS", // Set this to deDE, enUS, ruRU, zhCN or zhTW for what language names/map images should be
"saveExploredMaps": true, // Whether or not to save explored versions of maps
"saveExploredMapsWithoutUnexplored": true, // Whether or not to save explored maps without unexplored background
"saveUnexploredMaps": false, // Whether or not to save un-explored versions of maps
"saveMapLayers": false // Whether or not to save the individual exploration layers separately
}

0 comments on commit 42c3ad3

Please sign in to comment.