Exemplo n.º 1
0
        /// <summary>
        /// Loads custom map texture if there is one.
        /// </summary>
        private static void Map_Update(On.HUD.Map.orig_Update orig, HUD.Map self)
        {
            if (self.www == null && self.mapTexture == null)
            {
                foreach (KeyValuePair <string, string> keyValues in CustomWorldMod.activatedPacks)
                {
                    string pathToMapFile = CRExtras.BuildPath(keyValues.Value, CRExtras.CustomFolder.RegionID, regionID: self.RegionName,
                                                              file: "map_" + self.RegionName + ".png");

                    if (File.Exists(pathToMapFile))
                    {
                        CustomWorldMod.Log($"Loading map texture from {keyValues.Value} in region [{self.RegionName}]. Path [{pathToMapFile}]");
                        self.www = new WWW("file:///" + pathToMapFile);
                        break;
                    }
                }
            }
            orig(self);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads custom map texture if there is one.
        /// </summary>
        private static void Map_Update(On.HUD.Map.orig_Update orig, HUD.Map self)
        {
            if (self.www == null && self.mapTexture == null)
            {
                foreach (KeyValuePair <string, string> keyValues in CustomWorldMod.activatedPacks)
                {
                    string pathToCustomFolder = Custom.RootFolderDirectory() + CustomWorldMod.resourcePath + keyValues.Value + Path.DirectorySeparatorChar;
                    string test = pathToCustomFolder + "World" + Path.DirectorySeparatorChar + "Regions" + Path.DirectorySeparatorChar +
                                  self.RegionName + Path.DirectorySeparatorChar + "map_" + self.RegionName + ".png";

                    if (File.Exists(test))
                    {
                        CustomWorldMod.Log($"Loading map texture from {keyValues.Value} in region [{self.RegionName}]. Path [{test}]");
                        self.www = new WWW("file:///" + test);
                        break;
                    }
                }
            }
            orig(self);
        }