public Textures() { rootDir = null; textures = new Dictionary<int, Texture>(); backgrounds = new Dictionary<int, Texture>(); walls = new Dictionary<int, Texture>(); treeTops = new Dictionary<int, Texture>(); treeBranches = new Dictionary<int, Texture>(); shrooms = new Dictionary<int, Texture>(); npcs = new Dictionary<int, Texture>(); npcHeads = new Dictionary<int, Texture>(); banners = new Dictionary<int, Texture>(); armorHeads = new Dictionary<int, Texture>(); armorBodies = new Dictionary<int, Texture>(); femaleBodies = new Dictionary<int, Texture>(); armorLegs = new Dictionary<int, Texture>(); wires = new Dictionary<int, Texture>(); liquids = new Dictionary<int, Texture>(); woods = new Dictionary<int, Texture>(); wallOutlines = new Dictionary<int, Texture>(); actuators = new Dictionary<int, Texture>(); cacti = new Dictionary<int, Texture>(); xmasTrees = new Dictionary<int, Texture>(); items = new Dictionary<int, Texture>(); // find terraria install SteamConfig steam = new SteamConfig(); string path=null; if (steam.Ready) path = steam.Get("software/valve/steam/apps/105600/installdir"); //no steam key, no terraria found inside config. let's check for the base steam folder if ((path == null || !Directory.Exists(path)) && steam.Ready) { path = steam.Get("software/valve/steam/baseinstallfolder_1"); path = Path.Combine(path, "steamapps"); path = Path.Combine(path, "common"); path = Path.Combine(path, "terraria"); } //still nothing, let's try the default if (path==null || !Directory.Exists(path)) { path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); path = Path.Combine(path, "Steam"); path = Path.Combine(path, "steamapps"); path = Path.Combine(path, "common"); path = Path.Combine(path, "terraria"); } path = Path.Combine(path, "Content"); path = Path.Combine(path, "Images"); if (Directory.Exists(path)) rootDir=path; }
public Textures() { rootDir = null; textures = new Dictionary<int, Texture>(); backgrounds = new Dictionary<int, Texture>(); walls = new Dictionary<int, Texture>(); treeTops = new Dictionary<int, Texture>(); treeBranches = new Dictionary<int, Texture>(); shrooms = new Dictionary<int, Texture>(); npcs = new Dictionary<int, Texture>(); npcHeads = new Dictionary<int, Texture>(); banners = new Dictionary<int, Texture>(); armorHeads = new Dictionary<int, Texture>(); armorBodies = new Dictionary<int, Texture>(); armorLegs = new Dictionary<int, Texture>(); wires = new Dictionary<int, Texture>(); liquids = new Dictionary<int, Texture>(); woods = new Dictionary<int, Texture>(); wallOutlines = new Dictionary<int, Texture>(); actuators = new Dictionary<int, Texture>(); cacti = new Dictionary<int, Texture>(); // find terraria install SteamConfig steam = new SteamConfig(); string path=null; if (steam.Ready) path = steam.Get("Software/Valve/Steam/apps/105600/InstallDir"); //no steam key, let's try the default if (path==null || !Directory.Exists(path)) { path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); path = Path.Combine(path, "Steam"); path = Path.Combine(path, "steamapps"); path = Path.Combine(path, "common"); path = Path.Combine(path, "terraria"); } path = Path.Combine(path, "Content"); path = Path.Combine(path, "Images"); if (Directory.Exists(path)) rootDir=path; }