Beispiel #1
0
        /// <summary>
        ///     On server, load saved data on minimap awake
        /// </summary>
        private static void LoadExplorationData(On.Minimap.orig_Awake orig, Minimap self)
        {
            orig(self);

            if (ConfigUtil.Get <bool>("MapServer", "shareMapProgression"))
            {
                if (ZNet.instance.IsServerInstance())
                {
                    Minimap.instance.m_explored = new bool[Minimap.instance.m_textureSize * Minimap.instance.m_textureSize];
                    if (File.Exists(Path.Combine(ConfigUtil.GetConfigPath(), ZNet.instance.GetWorldUID().ToString(), "Explorationdata.bin")))
                    {
                        var mapData = ZPackageExtension.ReadFromFile(Path.Combine(ConfigUtil.GetConfigPath(), ZNet.instance.GetWorldUID().ToString(),
                                                                                  "Explorationdata.bin"));
                        ApplyMapData(mapData);
                    }
                    else
                    {
                        for (var i = 0; i < Minimap.instance.m_explored.Length; i++)
                        {
                            Minimap.instance.m_explored[i] = false;
                        }
                    }
                }
            }
        }
Beispiel #2
0
        private static void Minimap_Awake_NoMinimap_Patch(On.Minimap.orig_Awake orig, Minimap self)
        {
            orig(self);

            if (ConfigUtil.Get <bool>("Map", "showNoMinimap"))
            {
                self.SetMapMode(Minimap.MapMode.None);
            }
        }