diff --git a/tools/MapAtmosFixer/MapAtmosFixer.exe b/tools/MapAtmosFixer/MapAtmosFixer.exe deleted file mode 100644 index bce9ecbc0b1..00000000000 Binary files a/tools/MapAtmosFixer/MapAtmosFixer.exe and /dev/null differ diff --git a/tools/MapAtmosFixer/MapAtmosFixer.pdb b/tools/MapAtmosFixer/MapAtmosFixer.pdb deleted file mode 100644 index 6a348c518f0..00000000000 Binary files a/tools/MapAtmosFixer/MapAtmosFixer.pdb and /dev/null differ diff --git a/tools/MapAtmosFixer/MapAtmosFixer.sln b/tools/MapAtmosFixer/MapAtmosFixer.sln deleted file mode 100644 index 4c5fd5dc323..00000000000 --- a/tools/MapAtmosFixer/MapAtmosFixer.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapAtmosFixer", "MapAtmosFixer\MapAtmosFixer.csproj", "{7A901E97-C798-4B17-A9A9-5548C6DCDB56}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7A901E97-C798-4B17-A9A9-5548C6DCDB56}.Debug|x86.ActiveCfg = Debug|x86 - {7A901E97-C798-4B17-A9A9-5548C6DCDB56}.Debug|x86.Build.0 = Debug|x86 - {7A901E97-C798-4B17-A9A9-5548C6DCDB56}.Release|x86.ActiveCfg = Release|x86 - {7A901E97-C798-4B17-A9A9-5548C6DCDB56}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tools/MapAtmosFixer/MapAtmosFixer.suo b/tools/MapAtmosFixer/MapAtmosFixer.suo deleted file mode 100644 index e3eac516cc9..00000000000 Binary files a/tools/MapAtmosFixer/MapAtmosFixer.suo and /dev/null differ diff --git a/tools/MapAtmosFixer/MapAtmosFixer/MapAtmosFixer.csproj b/tools/MapAtmosFixer/MapAtmosFixer/MapAtmosFixer.csproj deleted file mode 100644 index 85724742f85..00000000000 --- a/tools/MapAtmosFixer/MapAtmosFixer/MapAtmosFixer.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {7A901E97-C798-4B17-A9A9-5548C6DCDB56} - Exe - Properties - MapAtmosFixer - MapAtmosFixer - v4.0 - Client - 512 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tools/MapAtmosFixer/MapAtmosFixer/Mapatmosfixer.cs b/tools/MapAtmosFixer/MapAtmosFixer/Mapatmosfixer.cs deleted file mode 100644 index ce8e66231fe..00000000000 --- a/tools/MapAtmosFixer/MapAtmosFixer/Mapatmosfixer.cs +++ /dev/null @@ -1,371 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; - -namespace MapAtmosFixer -{ - internal enum Objtype - { - Null, - Manifold, - Pump, - Pipe, - Scrubber, - Vent, - Mixer, - Filter, - Injector, - Temp - } - - internal static class Mapatmosfixer - { - /// - /// Used to make displayed lines shorter. - /// - /// The long path - /// The path to short with - /// Shorted path - public static string ShortenPath(string path, ref string masterpath) - { - return path.Substring(masterpath.Length, path.Length - masterpath.Length); - } - - /// - /// Returns true if 'str' starts with 'start' - /// - /// String to test - /// - /// - public static bool StartsWith(string str, string start) - { - if (start.Length > str.Length) - return false; - - return str.Substring(0, start.Length) == start; - } - - /// - /// Method to perform a simple regex match. - /// - /// Regex pattern - /// String to match - /// Collection of matches - public static GroupCollection Regex(string pattern, string txt) - { - var rgx = new Regex(pattern, RegexOptions.IgnoreCase); - MatchCollection matches = rgx.Matches(txt); - - if (matches.Count == 0) - return null; - - GroupCollection groups = matches[0].Groups; - if (groups.Count <= 1) - return null; - - return groups; - } - - /// - /// Gets the type of the object in the path - /// - /// String path - /// - public static Objtype GetType(string path) - { - if (StartsWith(path, "/obj/machinery/atmospherics/pipe/manifold")) - return Objtype.Manifold; - - if (StartsWith(path, "/obj/machinery/atmospherics/pipe/simple")) - return Objtype.Pipe; - - switch (path) - { - case "/obj/machinery/atmospherics/binary/pump": - return Objtype.Pump; - case "/obj/machinery/atmospherics/unary/vent_scrubber": - return Objtype.Scrubber; - case "/obj/machinery/atmospherics/unary/vent_pump": - return Objtype.Vent; - case "/obj/machinery/atmospherics/trinary/filter": - return Objtype.Filter; - case "/obj/machinery/atmospherics/trinary/mixer": - return Objtype.Mixer; - case "/obj/machinery/atmospherics/unary/heat_reservoir/heater": - return Objtype.Temp; - case "/obj/machinery/atmospherics/unary/cold_sink/freezer": - return Objtype.Temp; - case "/obj/machinery/atmospherics/unary/outlet_injector": - return Objtype.Injector; - default: - return Objtype.Null; - } - } - - /// - /// Updates an objects path with its corresponding icon_state - /// - /// Object path to change - /// Iconstate it has - /// Type of the object - public static void ProcessIconstate(ref string path, string iconstate, Objtype objtype) - { - switch (objtype) - { - case Objtype.Pipe: - switch (iconstate) - { - case "intact": - path = "/obj/machinery/atmospherics/pipe/simple/general/visible"; - return; - case "intact-f": - path = "/obj/machinery/atmospherics/pipe/simple/general/hidden"; - return; - case "intact-b": - path = "/obj/machinery/atmospherics/pipe/simple/supply/visible"; - return; - case "intact-b-f": - path = "/obj/machinery/atmospherics/pipe/simple/supply/hidden"; - return; - case "intact-r": - path = "/obj/machinery/atmospherics/pipe/simple/scrubbers/visible"; - return; - case "intact-r-f": - path = "/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden"; - return; - case "intact-y": - path = "/obj/machinery/atmospherics/pipe/simple/yellow/visible"; - return; - case "intact-y-f": - path = "/obj/machinery/atmospherics/pipe/simple/yellow/hidden"; - return; - case "intact-g": - path = "/obj/machinery/atmospherics/pipe/simple/green/visible"; - return; - case "intact-g-f": - path = "/obj/machinery/atmospherics/pipe/simple/green/hidden"; - return; - case "intact-c": - path = "/obj/machinery/atmospherics/pipe/simple/cyan/visible"; - return; - case "intact-c-f": - path = "/obj/machinery/atmospherics/pipe/simple/cyan/hidden"; - return; - case "intact-p": - path = "/obj/machinery/atmospherics/pipe/simple/supplymain/visible"; - return; - case "intact-p-f": - path = "/obj/machinery/atmospherics/pipe/simple/supplymain/hidden"; - return; - } - return; - case Objtype.Manifold: - switch (iconstate) - { - case "manifold": - path = "/obj/machinery/atmospherics/pipe/manifold/general/visible"; - return; - case "manifold-f": - path = "/obj/machinery/atmospherics/pipe/manifold/general/hidden"; - return; - case "manifold-b": - path = "/obj/machinery/atmospherics/pipe/manifold/supply/visible"; - return; - case "manifold-b-f": - path = "/obj/machinery/atmospherics/pipe/manifold/supply/hidden"; - return; - case "manifold-r": - path = "/obj/machinery/atmospherics/pipe/manifold/scrubbers/visible"; - return; - case "manifold-r-f": - path = "/obj/machinery/atmospherics/pipe/manifold/scrubbers/hidden"; - return; - case "manifold-c": - path = "/obj/machinery/atmospherics/pipe/manifold/cyan/visible"; - return; - case "manifold-c-f": - path = "/obj/machinery/atmospherics/pipe/manifold/cyan/hidden"; - return; - case "manifold-y": - path = "/obj/machinery/atmospherics/pipe/manifold/yellow/visible"; - return; - case "manifold-y-f": - path = "/obj/machinery/atmospherics/pipe/manifold/yellow/hidden"; - return; - case "manifold-g": - path = "/obj/machinery/atmospherics/pipe/manifold/green/visible"; - return; - case "manifold-g-f": - path = "/obj/machinery/atmospherics/pipe/manifold/green/hidden"; - return; - case "manifold-p": - path = "/obj/machinery/atmospherics/pipe/manifold/supplymain/visible"; - return; - case "manifold-p-f": - path = "/obj/machinery/atmospherics/pipe/manifold/supplymain/hidden"; - return; - } - return; - } - } - - /// - /// Processes one object and its parameters - /// - /// - public static void ProcessObject(ref string line) - { - GroupCollection g = Regex(@"^(.+)\{(.+)\}", line); - if (g == null) - return; - - string path = g[1].Value; - string stringtags = g[2].Value; - - Objtype objtype = GetType(path); - if (objtype == Objtype.Null) - return; - - var tags = new List(stringtags.Split(new[] {"; "}, StringSplitOptions.None)); - for (int i = 0; i < tags.Count; i++) - { - string tag = tags[i]; - - GroupCollection g2 = Regex(@"^(.+)[ ]=[ ](.+)", tag); - if (g2 == null) - continue; - - string name = g2[1].Value; - string value = g2[2].Value.Trim(new[] {'"'}); - - //Removes icon_state from heaters/freezers - if (objtype == Objtype.Temp) - { - if (name == "icon_state") - { - tags.RemoveAt(i); - i--; - } - continue; - } - - //General removal of tags we shouldn't have - if (name == "pipe_color" || name == "color" || name == "level" || - (objtype != Objtype.Pump && name == "name") - || (objtype == Objtype.Pump && name == "icon_state")) - { - tags.RemoveAt(i); - i--; - continue; - } - - //Processes icon_state into correct path - if (name == "icon_state") - { - ProcessIconstate(ref path, value, objtype); - tags.RemoveAt(i); - i--; - continue; - } - - //Fixes up injector - if (objtype == Objtype.Injector && name == "on") - { - path = "/obj/machinery/atmospherics/unary/outlet_injector/on"; - tags.RemoveAt(i); - i--; - } - } - - stringtags = String.Join("; ", tags); - line = String.Format("{0}{{{1}}}", path, stringtags); - } - - /// - /// This fixes connectors to their proper path, if they ain't on plating, they should be visible. - /// - /// - public static void FixConnector(ref string line) - { - //Dirty shit, don't read this - if (line.Contains("/obj/machinery/atmospherics/portables_connector") && - //!line.Contains("/turf/open/floor/plating") && // Most of the time connectors on plating want to be visible.. - !line.Contains("/obj/machinery/atmospherics/portables_connector/visible")) // Makes sure we don't update same line twice - { - line = line.Replace("/obj/machinery/atmospherics/portables_connector", - "/obj/machinery/atmospherics/portables_connector/visible"); - } - } - - /// - /// Processes a line of objects - /// - /// - public static void ProcessObjectline(ref string line) - { - FixConnector(ref line); - - string[] objs = line.Split(','); - - for (int i = 0; i < objs.Length; i++) - { - try - { - ProcessObject(ref objs[i]); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - } - } - - line = String.Join(",", objs); - } - - /// - /// Processes a whole .dmm - /// - /// - public static void Process(string file) - { - string[] lines = File.ReadAllLines(file, Encoding.Default); - - for (int i = 0; i < lines.Length; i++) - { - string line = lines[i]; - - if (line.Length == 0) - continue; - - if (line[0] != '"') - continue; - - GroupCollection g = Regex(@"^""([\w]+)""[ ]\=[ ]\((.+)\)", line); - if (g == null) - continue; - - string letters = g[1].Value; - string types = g[2].Value; - ProcessObjectline(ref types); - - line = String.Format("\"{0}\" = ({1})", letters, types); - - lines[i] = line; - } - - File.WriteAllLines(file, lines, Encoding.Default); - } - - internal static void Init(string file) - { - //string exepath = "C:\\Users\\Daniel\\Documents\\GitHub\\-tg-station"; - //string file = "C:\\Users\\Daniel\\Documents\\GitHub\\-tg-station\\_maps\\map_files\\tgstation.2.1.3.dmm"; - - Process(file); - Console.WriteLine("Done"); - Console.Read(); - } - } -} \ No newline at end of file diff --git a/tools/MapAtmosFixer/MapAtmosFixer/Program.cs b/tools/MapAtmosFixer/MapAtmosFixer/Program.cs deleted file mode 100644 index 96213ee7880..00000000000 --- a/tools/MapAtmosFixer/MapAtmosFixer/Program.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace MapAtmosFixer -{ - class Program - { - static void Main(string[] args) - { - if (args.Length < 1) - { - Console.WriteLine("Please drag-drop file onto the .exe"); - Console.Read(); - return; - } - - string file = args[0]; - if (Path.GetExtension(file) != ".dmm") - { - Console.WriteLine("File not a map."); - Console.Read(); - return; - } - - Mapatmosfixer.Init(file); - } - } -} diff --git a/tools/MapAtmosFixer/MapAtmosFixer/Properties/AssemblyInfo.cs b/tools/MapAtmosFixer/MapAtmosFixer/Properties/AssemblyInfo.cs deleted file mode 100644 index 1cc64b87ac9..00000000000 --- a/tools/MapAtmosFixer/MapAtmosFixer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MapAtmosFixer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MapAtmosFixer")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("87bc6d96-c3ae-4644-ac20-033d8ec401e5")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tools/MapAtmosFixer/Readme.txt b/tools/MapAtmosFixer/Readme.txt deleted file mode 100644 index 10f10355a75..00000000000 --- a/tools/MapAtmosFixer/Readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -A handy tool used to clean up all shit mappers leave behind when doing atmosia code. - -Basically it removes most edited variables and instead let the code and object do the work, less hacky shit and everything can be edited in-code without having to edit the map. - -How to use: -Drag-n-drop an .dmm onto the compiled .exe -The program will run and then overwrite the same .dmm - -Mapmerge tool is not necessary to be run with this. \ No newline at end of file