Automap (client) [VS plugin mod]
Revisão | 94a997fedb1dff51d608c4cca0d5579fb9eec74a (tree) |
---|---|
Hora | 2020-05-05 08:20:21 |
Autor | melchior <melchior@user...> |
Commiter | melchior |
Changed shard (png) output to its own "Chunks" directory path
@@ -93,6 +93,8 @@ namespace Automap | ||
93 | 93 | { |
94 | 94 | path = ClientAPI.GetOrCreateDataPath(_mapPath); |
95 | 95 | path = ClientAPI.GetOrCreateDataPath(Path.Combine(path, "World_" + ClientAPI.World.Seed));//Add name of World too...'ServerApi.WorldManager.CurrentWorldName' |
96 | + ClientAPI.GetOrCreateDataPath(Path.Combine(path, _chunkPath)); | |
97 | + | |
96 | 98 | JsonGenerator = new JsonGenerator(ClientAPI, Logger, path); |
97 | 99 | |
98 | 100 | string mapFilename = Path.Combine(path, "automap.html"); |
@@ -388,22 +390,22 @@ namespace Automap | ||
388 | 390 | /// <returns>The metadata.</returns> |
389 | 391 | private void Reload_Metadata() |
390 | 392 | { |
391 | - var worldmapDir = new DirectoryInfo(path); | |
393 | + var shardsDir = new DirectoryInfo( Path.Combine(path, _chunkPath) ); | |
392 | 394 | |
393 | - if (!worldmapDir.Exists) | |
395 | + if (!shardsDir.Exists) | |
394 | 396 | { |
395 | -#if DEBUG | |
396 | - Logger.VerboseDebug("Could not open world map directory"); | |
397 | -#endif | |
397 | + #if DEBUG | |
398 | + Logger.VerboseDebug("Could not open world map (shards) directory"); | |
399 | + #endif | |
398 | 400 | return; |
399 | 401 | } |
400 | - var shardFiles = worldmapDir.GetFiles(chunkFile_filter); | |
402 | + var shardFiles = shardsDir.GetFiles(chunkFile_filter); | |
401 | 403 | |
402 | 404 | if (shardFiles.Length > 0) |
403 | 405 | { |
404 | -#if DEBUG | |
406 | + #if DEBUG | |
405 | 407 | Logger.VerboseDebug("Metadata reloading from {0} shards", shardFiles.Length); |
406 | -#endif | |
408 | + #endif | |
407 | 409 | |
408 | 410 | foreach (var shardFile in shardFiles) |
409 | 411 | { |
@@ -472,7 +474,7 @@ namespace Automap | ||
472 | 474 | ImageInfo imageInf = new ImageInfo(chunkSize, chunkSize, 8, false); |
473 | 475 | |
474 | 476 | string filename = $"{coord.X}_{coord.Y}.png"; |
475 | - filename = Path.Combine(path, filename); | |
477 | + filename = Path.Combine(path, _chunkPath ,filename); | |
476 | 478 | |
477 | 479 | PngWriter pngWriter = FileHelper.CreatePngWriter(filename, imageInf, true); |
478 | 480 | PngMetadata meta = pngWriter.GetMetadata(); |