Exemplo n.º 1
0
 public static void VTExploreAll(this Minimap minimap)
 {
     if (minimap != null)
     {
         minimap.ExploreAll();
     }
 }
Exemplo n.º 2
0
            static void Postfix(Minimap __instance)
            {
                if (_miniMap == null)
                {
                    _miniMap = __instance;
                }

                if (!_exploreFullMap.Value)
                {
                    return;
                }

                // generate the path for the saved map
                if (string.IsNullOrEmpty(_cachedPath))
                {
                    var    world            = Traverse.Create(WorldGenerator.instance).Field("m_world").GetValue() as World;
                    string fileName         = $"{Game.instance.GetPlayerProfile().GetFilename()}_{world.m_uid}_ExploreMapSave.dat";
                    string currentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

                    string targetPath = Path.Combine(currentDirectory, @"..\cache\");

                    // create the final path
                    _cachedPath = Path.Combine(targetPath, fileName);
                }

                // if a saved map exists, the map has been fully explored before
                if (File.Exists(_cachedPath))
                {
                    return;
                }

                // save the map data, then retrieve it (easiest way to retrieve current map data)
                __instance.SaveMapData();
                byte[] mapData = Game.instance.GetPlayerProfile().GetMapData();

                // write the map to a file
                File.WriteAllBytes(_cachedPath, mapData);
                Debug.Log($"wrote mapdata to {_cachedPath}");

                // explore the whole map
                __instance.ExploreAll();
            }