├── Executable
└── RLMapLoader.exe
├── RLMapLoader
├── FodyWeavers.xml
├── previews
│ ├── hoops_preview.jpg
│ ├── pillars_preview.jpg
│ ├── winter_preview.jpg
│ ├── underpass_preview.jpg
│ ├── wasteland_preview.png
│ └── utopiaretro_preview.png
├── packages.config
├── Program.cs
├── MapPackage.cs
├── Properties
│ ├── Settings.settings
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Settings.Designer.cs
│ └── Resources.resx
├── App.config
├── Win32.cs
├── RLMapLoader.csproj
├── MapPackageManager.resx
├── Form1.resx
├── MapPackageManager.Designer.cs
├── MapPackageManager.cs
├── Memory.cs
├── Form1.Designer.cs
└── Form1.cs
├── .gitattributes
├── RLMapLoader.sln
└── .gitignore
/Executable/RLMapLoader.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinkertims/RLMapLoader/HEAD/Executable/RLMapLoader.exe
--------------------------------------------------------------------------------
/RLMapLoader/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/RLMapLoader/previews/hoops_preview.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinkertims/RLMapLoader/HEAD/RLMapLoader/previews/hoops_preview.jpg
--------------------------------------------------------------------------------
/RLMapLoader/previews/pillars_preview.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinkertims/RLMapLoader/HEAD/RLMapLoader/previews/pillars_preview.jpg
--------------------------------------------------------------------------------
/RLMapLoader/previews/winter_preview.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinkertims/RLMapLoader/HEAD/RLMapLoader/previews/winter_preview.jpg
--------------------------------------------------------------------------------
/RLMapLoader/previews/underpass_preview.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinkertims/RLMapLoader/HEAD/RLMapLoader/previews/underpass_preview.jpg
--------------------------------------------------------------------------------
/RLMapLoader/previews/wasteland_preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinkertims/RLMapLoader/HEAD/RLMapLoader/previews/wasteland_preview.png
--------------------------------------------------------------------------------
/RLMapLoader/previews/utopiaretro_preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinkertims/RLMapLoader/HEAD/RLMapLoader/previews/utopiaretro_preview.png
--------------------------------------------------------------------------------
/RLMapLoader/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/RLMapLoader/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace RLMapLoader
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/RLMapLoader.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RLMapLoader", "RLMapLoader\RLMapLoader.csproj", "{42C2B44E-3B05-4102-93AA-FA4CEA92A6BF}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {42C2B44E-3B05-4102-93AA-FA4CEA92A6BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {42C2B44E-3B05-4102-93AA-FA4CEA92A6BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {42C2B44E-3B05-4102-93AA-FA4CEA92A6BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {42C2B44E-3B05-4102-93AA-FA4CEA92A6BF}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/RLMapLoader/MapPackage.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Net;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 |
12 | namespace RLMapLoader
13 | {
14 | public class MapPackageJson
15 | {
16 | [JsonProperty("Map")]
17 | public MapPackage mapPackage { get; set; }
18 | }
19 |
20 |
21 | public class MapPackage
22 | {
23 | [DisplayName(@"Preview")]
24 | public string PreviewUrl { get; set; }
25 | [DisplayName(@"Map Name")]
26 | public string Name { get; set; }
27 | [DisplayName(@"Created By")]
28 | public string CreatedBy { get; set; }
29 | public string Version { get; set; }
30 | [DisplayName(@"Date Added")]
31 | public DateTime DateAdded { get; set; }
32 | [DisplayName(@"Download Link")]
33 | public string FileUrl { get; set; }
34 |
35 |
36 | }
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/RLMapLoader/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | E:\STEAM\steamapps\common\rocketleague\TAGame\CookedPCConsole\mods\
7 |
8 |
9 | E:\STEAM\steamapps\common\rocketleague\
10 |
11 |
12 | False
13 |
14 |
15 | [Default] Park_P.upk
16 |
17 |
18 | True
19 |
20 |
21 |
--------------------------------------------------------------------------------
/RLMapLoader/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("RLMapLoader")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("RLMapLoader")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("42c2b44e-3b05-4102-93aa-fa4cea92a6bf")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/RLMapLoader/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | E:\STEAM\steamapps\common\rocketleague\TAGame\CookedPCConsole\mods\
15 |
16 |
17 | E:\STEAM\steamapps\common\rocketleague\
18 |
19 |
20 | False
21 |
22 |
23 | [Default] Park_P.upk
24 |
25 |
26 | True
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/RLMapLoader/Win32.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace RLMapLoader
5 | {
6 | ///
7 | /// Win32 methods
8 | ///
9 | public static class Win32
10 | {
11 | [DllImport("kernel32.dll", SetLastError = true)]
12 | public static extern bool WriteProcessMemory(
13 | IntPtr process, IntPtr address, byte[] buffer, uint size, ref uint written);
14 |
15 | [DllImport("Kernel32.dll", SetLastError = true)]
16 | public static extern bool ReadProcessMemory(
17 | IntPtr process, IntPtr address, byte[] buffer, uint size, ref uint read);
18 |
19 | [Flags]
20 | public enum ProcessAccessType
21 | {
22 | PROCESS_TERMINATE = (0x0001),
23 | PROCESS_CREATE_THREAD = (0x0002),
24 | PROCESS_SET_SESSIONID = (0x0004),
25 | PROCESS_VM_OPERATION = (0x0008),
26 | PROCESS_VM_READ = (0x0010),
27 | PROCESS_VM_WRITE = (0x0020),
28 | PROCESS_DUP_HANDLE = (0x0040),
29 | PROCESS_CREATE_PROCESS = (0x0080),
30 | PROCESS_SET_QUOTA = (0x0100),
31 | PROCESS_SET_INFORMATION = (0x0200),
32 | PROCESS_QUERY_INFORMATION = (0x0400)
33 | }
34 |
35 | [DllImport("kernel32.dll")]
36 | public static extern IntPtr OpenProcess(
37 | [MarshalAs(UnmanagedType.U4)]ProcessAccessType access,
38 | [MarshalAs(UnmanagedType.Bool)]bool inheritHandler, uint processId);
39 |
40 | [DllImport("kernel32.dll")]
41 | public static extern int CloseHandle(IntPtr objectHandle);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/RLMapLoader/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace RLMapLoader.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RLMapLoader.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/RLMapLoader/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace RLMapLoader.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("E:\\STEAM\\steamapps\\common\\rocketleague\\TAGame\\CookedPCConsole\\mods\\")]
29 | public string ModFolder {
30 | get {
31 | return ((string)(this["ModFolder"]));
32 | }
33 | set {
34 | this["ModFolder"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("E:\\STEAM\\steamapps\\common\\rocketleague\\")]
41 | public string RLFolder {
42 | get {
43 | return ((string)(this["RLFolder"]));
44 | }
45 | set {
46 | this["RLFolder"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
53 | public bool loadMapOnStart {
54 | get {
55 | return ((bool)(this["loadMapOnStart"]));
56 | }
57 | set {
58 | this["loadMapOnStart"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("[Default] Park_P.upk")]
65 | public string lastMap {
66 | get {
67 | return ((string)(this["lastMap"]));
68 | }
69 | set {
70 | this["lastMap"] = value;
71 | }
72 | }
73 |
74 | [global::System.Configuration.UserScopedSettingAttribute()]
75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
77 | public bool restoreDefaultMapOnClose {
78 | get {
79 | return ((bool)(this["restoreDefaultMapOnClose"]));
80 | }
81 | set {
82 | this["restoreDefaultMapOnClose"] = value;
83 | }
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/RLMapLoader/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/RLMapLoader/RLMapLoader.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {42C2B44E-3B05-4102-93AA-FA4CEA92A6BF}
8 | WinExe
9 | Properties
10 | RLMapLoader
11 | RLMapLoader
12 | v4.5.2
13 | 512
14 | true
15 |
16 |
17 |
18 |
19 | AnyCPU
20 | true
21 | full
22 | false
23 | bin\Debug\
24 | DEBUG;TRACE
25 | prompt
26 | 4
27 |
28 |
29 | AnyCPU
30 | pdbonly
31 | true
32 | bin\Release\
33 | TRACE
34 | prompt
35 | 4
36 |
37 |
38 |
39 | ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll
40 | True
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | Form
57 |
58 |
59 | Form1.cs
60 |
61 |
62 |
63 | Form
64 |
65 |
66 | MapPackageManager.cs
67 |
68 |
69 |
70 |
71 |
72 |
73 | Form1.cs
74 |
75 |
76 | MapPackageManager.cs
77 |
78 |
79 | ResXFileCodeGenerator
80 | Resources.Designer.cs
81 | Designer
82 |
83 |
84 | True
85 | Resources.resx
86 | True
87 |
88 |
89 |
90 | SettingsSingleFileGenerator
91 | Settings.Designer.cs
92 |
93 |
94 | True
95 | Settings.settings
96 | True
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
118 |
119 |
120 |
121 |
128 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 | *.VC.VC.opendb
85 |
86 | # Visual Studio profiler
87 | *.psess
88 | *.vsp
89 | *.vspx
90 | *.sap
91 |
92 | # TFS 2012 Local Workspace
93 | $tf/
94 |
95 | # Guidance Automation Toolkit
96 | *.gpState
97 |
98 | # ReSharper is a .NET coding add-in
99 | _ReSharper*/
100 | *.[Rr]e[Ss]harper
101 | *.DotSettings.user
102 |
103 | # JustCode is a .NET coding add-in
104 | .JustCode
105 |
106 | # TeamCity is a build add-in
107 | _TeamCity*
108 |
109 | # DotCover is a Code Coverage Tool
110 | *.dotCover
111 |
112 | # NCrunch
113 | _NCrunch_*
114 | .*crunch*.local.xml
115 | nCrunchTemp_*
116 |
117 | # MightyMoose
118 | *.mm.*
119 | AutoTest.Net/
120 |
121 | # Web workbench (sass)
122 | .sass-cache/
123 |
124 | # Installshield output folder
125 | [Ee]xpress/
126 |
127 | # DocProject is a documentation generator add-in
128 | DocProject/buildhelp/
129 | DocProject/Help/*.HxT
130 | DocProject/Help/*.HxC
131 | DocProject/Help/*.hhc
132 | DocProject/Help/*.hhk
133 | DocProject/Help/*.hhp
134 | DocProject/Help/Html2
135 | DocProject/Help/html
136 |
137 | # Click-Once directory
138 | publish/
139 |
140 | # Publish Web Output
141 | *.[Pp]ublish.xml
142 | *.azurePubxml
143 | # TODO: Comment the next line if you want to checkin your web deploy settings
144 | # but database connection strings (with potential passwords) will be unencrypted
145 | *.pubxml
146 | *.publishproj
147 |
148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
149 | # checkin your Azure Web App publish settings, but sensitive information contained
150 | # in these scripts will be unencrypted
151 | PublishScripts/
152 |
153 | # NuGet Packages
154 | *.nupkg
155 | # The packages folder can be ignored because of Package Restore
156 | **/packages/*
157 | # except build/, which is used as an MSBuild target.
158 | !**/packages/build/
159 | # Uncomment if necessary however generally it will be regenerated when needed
160 | #!**/packages/repositories.config
161 | # NuGet v3's project.json files produces more ignoreable files
162 | *.nuget.props
163 | *.nuget.targets
164 |
165 | # Microsoft Azure Build Output
166 | csx/
167 | *.build.csdef
168 |
169 | # Microsoft Azure Emulator
170 | ecf/
171 | rcf/
172 |
173 | # Windows Store app package directories and files
174 | AppPackages/
175 | BundleArtifacts/
176 | Package.StoreAssociation.xml
177 | _pkginfo.txt
178 |
179 | # Visual Studio cache files
180 | # files ending in .cache can be ignored
181 | *.[Cc]ache
182 | # but keep track of directories ending in .cache
183 | !*.[Cc]ache/
184 |
185 | # Others
186 | ClientBin/
187 | ~$*
188 | *~
189 | *.dbmdl
190 | *.dbproj.schemaview
191 | *.pfx
192 | *.publishsettings
193 | node_modules/
194 | orleans.codegen.cs
195 |
196 | # Since there are multiple workflows, uncomment next line to ignore bower_components
197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
198 | #bower_components/
199 |
200 | # RIA/Silverlight projects
201 | Generated_Code/
202 |
203 | # Backup & report files from converting an old project file
204 | # to a newer Visual Studio version. Backup files are not needed,
205 | # because we have git ;-)
206 | _UpgradeReport_Files/
207 | Backup*/
208 | UpgradeLog*.XML
209 | UpgradeLog*.htm
210 |
211 | # SQL Server files
212 | *.mdf
213 | *.ldf
214 |
215 | # Business Intelligence projects
216 | *.rdl.data
217 | *.bim.layout
218 | *.bim_*.settings
219 |
220 | # Microsoft Fakes
221 | FakesAssemblies/
222 |
223 | # GhostDoc plugin setting file
224 | *.GhostDoc.xml
225 |
226 | # Node.js Tools for Visual Studio
227 | .ntvs_analysis.dat
228 |
229 | # Visual Studio 6 build log
230 | *.plg
231 |
232 | # Visual Studio 6 workspace options file
233 | *.opt
234 |
235 | # Visual Studio LightSwitch build output
236 | **/*.HTMLClient/GeneratedArtifacts
237 | **/*.DesktopClient/GeneratedArtifacts
238 | **/*.DesktopClient/ModelManifest.xml
239 | **/*.Server/GeneratedArtifacts
240 | **/*.Server/ModelManifest.xml
241 | _Pvt_Extensions
242 |
243 | # Paket dependency manager
244 | .paket/paket.exe
245 | paket-files/
246 |
247 | # FAKE - F# Make
248 | .fake/
249 |
250 | # JetBrains Rider
251 | .idea/
252 | *.sln.iml
253 |
254 | # =========================
255 | # Operating System Files
256 | # =========================
257 |
258 | # OSX
259 | # =========================
260 |
261 | .DS_Store
262 | .AppleDouble
263 | .LSOverride
264 |
265 | # Thumbnails
266 | ._*
267 |
268 | # Files that might appear in the root of a volume
269 | .DocumentRevisions-V100
270 | .fseventsd
271 | .Spotlight-V100
272 | .TemporaryItems
273 | .Trashes
274 | .VolumeIcon.icns
275 |
276 | # Directories potentially created on remote AFP share
277 | .AppleDB
278 | .AppleDesktop
279 | Network Trash Folder
280 | Temporary Items
281 | .apdisk
282 |
283 | # Windows
284 | # =========================
285 |
286 | # Windows image file caches
287 | Thumbs.db
288 | ehthumbs.db
289 |
290 | # Folder config file
291 | Desktop.ini
292 |
293 | # Recycle Bin used on file shares
294 | $RECYCLE.BIN/
295 |
296 | # Windows Installer files
297 | *.cab
298 | *.msi
299 | *.msm
300 | *.msp
301 |
302 | # Windows shortcuts
303 | *.lnk
304 |
--------------------------------------------------------------------------------
/RLMapLoader/MapPackageManager.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | 175, 17
125 |
126 |
--------------------------------------------------------------------------------
/RLMapLoader/Form1.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | 173, 17
125 |
126 |
127 | 411, 17
128 |
129 |
--------------------------------------------------------------------------------
/RLMapLoader/MapPackageManager.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace RLMapLoader
2 | {
3 | partial class MapPackageManager
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
32 | this.statusStrip1 = new System.Windows.Forms.StatusStrip();
33 | this.packageStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
34 | this.downloadProgressBar = new System.Windows.Forms.ToolStripProgressBar();
35 | this.menuStrip1 = new System.Windows.Forms.MenuStrip();
36 | this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
37 | this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
38 | this.updatePackageListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
39 | this.createMapPackageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
40 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
41 | this.depDownloadButton = new System.Windows.Forms.Button();
42 | this.statusStrip1.SuspendLayout();
43 | this.menuStrip1.SuspendLayout();
44 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
45 | this.SuspendLayout();
46 | //
47 | // statusStrip1
48 | //
49 | this.statusStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
50 | this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
51 | this.packageStatusLabel,
52 | this.downloadProgressBar});
53 | this.statusStrip1.Location = new System.Drawing.Point(0, 939);
54 | this.statusStrip1.Name = "statusStrip1";
55 | this.statusStrip1.Size = new System.Drawing.Size(999, 28);
56 | this.statusStrip1.TabIndex = 0;
57 | this.statusStrip1.Text = "statusStrip1";
58 | this.statusStrip1.SizeChanged += new System.EventHandler(this.statusStrip1_SizeChanged);
59 | //
60 | // packageStatusLabel
61 | //
62 | this.packageStatusLabel.Name = "packageStatusLabel";
63 | this.packageStatusLabel.Size = new System.Drawing.Size(882, 23);
64 | this.packageStatusLabel.Spring = true;
65 | this.packageStatusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
66 | //
67 | // downloadProgressBar
68 | //
69 | this.downloadProgressBar.Name = "downloadProgressBar";
70 | this.downloadProgressBar.Size = new System.Drawing.Size(100, 22);
71 | //
72 | // menuStrip1
73 | //
74 | this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
75 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
76 | this.fileToolStripMenuItem,
77 | this.optionsToolStripMenuItem});
78 | this.menuStrip1.Location = new System.Drawing.Point(0, 0);
79 | this.menuStrip1.Name = "menuStrip1";
80 | this.menuStrip1.Size = new System.Drawing.Size(999, 33);
81 | this.menuStrip1.TabIndex = 1;
82 | this.menuStrip1.Text = "menuStrip1";
83 | //
84 | // fileToolStripMenuItem
85 | //
86 | this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
87 | this.fileToolStripMenuItem.Size = new System.Drawing.Size(50, 29);
88 | this.fileToolStripMenuItem.Text = "File";
89 | //
90 | // optionsToolStripMenuItem
91 | //
92 | this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
93 | this.updatePackageListToolStripMenuItem,
94 | this.createMapPackageToolStripMenuItem});
95 | this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
96 | this.optionsToolStripMenuItem.Size = new System.Drawing.Size(88, 29);
97 | this.optionsToolStripMenuItem.Text = "Options";
98 | this.optionsToolStripMenuItem.Visible = false;
99 | //
100 | // updatePackageListToolStripMenuItem
101 | //
102 | this.updatePackageListToolStripMenuItem.Name = "updatePackageListToolStripMenuItem";
103 | this.updatePackageListToolStripMenuItem.Size = new System.Drawing.Size(257, 30);
104 | this.updatePackageListToolStripMenuItem.Text = "Update Package List";
105 | //
106 | // createMapPackageToolStripMenuItem
107 | //
108 | this.createMapPackageToolStripMenuItem.Name = "createMapPackageToolStripMenuItem";
109 | this.createMapPackageToolStripMenuItem.Size = new System.Drawing.Size(257, 30);
110 | this.createMapPackageToolStripMenuItem.Text = "Create Map Package";
111 | //
112 | // dataGridView1
113 | //
114 | this.dataGridView1.AllowUserToAddRows = false;
115 | dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
116 | this.dataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
117 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
118 | | System.Windows.Forms.AnchorStyles.Left)
119 | | System.Windows.Forms.AnchorStyles.Right)));
120 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
121 | this.dataGridView1.Location = new System.Drawing.Point(12, 79);
122 | this.dataGridView1.Name = "dataGridView1";
123 | this.dataGridView1.ReadOnly = true;
124 | this.dataGridView1.RowHeadersVisible = false;
125 | this.dataGridView1.RowTemplate.Height = 100;
126 | this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
127 | this.dataGridView1.Size = new System.Drawing.Size(975, 847);
128 | this.dataGridView1.TabIndex = 2;
129 | this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
130 | this.dataGridView1.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dataGridView1_CellFormatting);
131 | this.dataGridView1.DataBindingComplete += new System.Windows.Forms.DataGridViewBindingCompleteEventHandler(this.dataGridView1_DataBindingComplete);
132 | this.dataGridView1.SelectionChanged += new System.EventHandler(this.dataGridView1_SelectionChanged);
133 | this.dataGridView1.Resize += new System.EventHandler(this.dataGridView1_Resize);
134 | //
135 | // depDownloadButton
136 | //
137 | this.depDownloadButton.Location = new System.Drawing.Point(770, 36);
138 | this.depDownloadButton.Name = "depDownloadButton";
139 | this.depDownloadButton.Size = new System.Drawing.Size(217, 37);
140 | this.depDownloadButton.TabIndex = 3;
141 | this.depDownloadButton.Text = "Download Dependencies";
142 | this.depDownloadButton.UseVisualStyleBackColor = true;
143 | this.depDownloadButton.Click += new System.EventHandler(this.button1_Click);
144 | //
145 | // MapPackageManager
146 | //
147 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
148 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
149 | this.ClientSize = new System.Drawing.Size(999, 967);
150 | this.Controls.Add(this.depDownloadButton);
151 | this.Controls.Add(this.dataGridView1);
152 | this.Controls.Add(this.statusStrip1);
153 | this.Controls.Add(this.menuStrip1);
154 | this.MainMenuStrip = this.menuStrip1;
155 | this.Name = "MapPackageManager";
156 | this.Text = "MapPackageManager";
157 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MapPackageManager_FormClosing);
158 | this.statusStrip1.ResumeLayout(false);
159 | this.statusStrip1.PerformLayout();
160 | this.menuStrip1.ResumeLayout(false);
161 | this.menuStrip1.PerformLayout();
162 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
163 | this.ResumeLayout(false);
164 | this.PerformLayout();
165 |
166 | }
167 |
168 | #endregion
169 |
170 | private System.Windows.Forms.StatusStrip statusStrip1;
171 | private System.Windows.Forms.ToolStripStatusLabel packageStatusLabel;
172 | private System.Windows.Forms.MenuStrip menuStrip1;
173 | private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
174 | private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
175 | private System.Windows.Forms.ToolStripMenuItem updatePackageListToolStripMenuItem;
176 | private System.Windows.Forms.DataGridView dataGridView1;
177 | private System.Windows.Forms.ToolStripMenuItem createMapPackageToolStripMenuItem;
178 | private System.Windows.Forms.ToolStripProgressBar downloadProgressBar;
179 | private System.Windows.Forms.Button depDownloadButton;
180 | }
181 | }
--------------------------------------------------------------------------------
/RLMapLoader/MapPackageManager.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.IO;
8 | using System.Linq;
9 | using System.Net;
10 | using System.Text;
11 | using System.Threading.Tasks;
12 | using System.Windows.Forms;
13 |
14 | namespace RLMapLoader
15 | {
16 | public partial class MapPackageManager : Form
17 | {
18 | private BindingList mapPackages = new BindingList();
19 | private WebClient webClient;
20 | Form1 mainForm;
21 |
22 | public MapPackageManager(Form1 formRef)
23 | {
24 | InitializeComponent();
25 | mainForm = formRef;
26 |
27 | // Get list of maps from server
28 | using (WebClient wc = new WebClient())
29 | {
30 | var json = wc.DownloadString("http://hack.fyi/rlmaps/maps.json");
31 |
32 | List maps = JsonConvert.DeserializeObject>(json);
33 |
34 | foreach(MapPackageJson mpj in maps)
35 | {
36 | mapPackages.Add(mpj.mapPackage);
37 | }
38 | }
39 |
40 | dataGridView1.DataSource = mapPackages;
41 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
42 | dataGridView1.Columns["FileUrl"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
43 | dataGridView1.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
44 | dataGridView1.RowsDefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent;
45 | DataGridViewCellStyle columnHeaderStyle = new DataGridViewCellStyle();
46 | columnHeaderStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
47 |
48 | dataGridView1.ColumnHeadersDefaultCellStyle = columnHeaderStyle;
49 |
50 | packageStatusLabel.Text = "Downloaded initial map list.";
51 | }
52 |
53 | private void MapPackageManager_FormClosing(object sender, FormClosingEventArgs e)
54 | {
55 | packageStatusLabel.Text = "Downloaded initial map list.";
56 | this.Hide();
57 | e.Cancel = true;
58 |
59 | }
60 |
61 | private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
62 | {
63 |
64 | foreach (DataGridViewRow r in dataGridView1.Rows)
65 | {
66 | if (System.Uri.IsWellFormedUriString(r.Cells["FileUrl"].Value.ToString(), UriKind.Absolute))
67 | {
68 | r.Cells["FileUrl"] = new DataGridViewButtonCell();
69 | // Note that if I want a different link colour for example it must go here
70 | DataGridViewButtonCell c = r.Cells["FileUrl"] as DataGridViewButtonCell;
71 | int pad = (r.Height - 25) / 2;
72 | c.Style.Padding = new Padding(10, pad, 10, pad);
73 | }
74 | if (System.Uri.IsWellFormedUriString(r.Cells["PreviewUrl"].Value.ToString(), UriKind.Absolute))
75 | {
76 | string imageUrl = r.Cells["PreviewUrl"].Value.ToString();
77 | r.Cells["PreviewUrl"] = new DataGridViewImageCell();
78 | DataGridViewImageCell c = r.Cells["PreviewUrl"] as DataGridViewImageCell;
79 | c.ImageLayout = DataGridViewImageCellLayout.Zoom;
80 | }
81 |
82 | }
83 | }
84 |
85 | private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
86 | {
87 | if (dataGridView1.Columns[e.ColumnIndex].Name == "PreviewUrl")
88 | {
89 | if (System.Uri.IsWellFormedUriString(dataGridView1.Rows[e.RowIndex].Cells["PreviewUrl"].Value.ToString(), UriKind.Absolute))
90 | {
91 |
92 | // Note that if I want a different link colour for example it must go here
93 | var request = WebRequest.Create(dataGridView1.Rows[e.RowIndex].Cells["PreviewUrl"].Value.ToString());
94 | try
95 | {
96 | using (var response = request.GetResponse())
97 | using (var stream = response.GetResponseStream())
98 | {
99 | Image tempPreview = (Image)Bitmap.FromStream(stream);
100 | e.Value = tempPreview;
101 | }
102 | }
103 | catch
104 | {
105 |
106 | }
107 | }
108 | }
109 | else if (dataGridView1.Columns[e.ColumnIndex].Name == "FileUrl")
110 | {
111 | Uri downloadUrl = new Uri(mapPackages[e.RowIndex].FileUrl);
112 | string filename = System.IO.Path.GetFileName(downloadUrl.LocalPath);
113 |
114 | if (File.Exists(Properties.Settings.Default.ModFolder + "\\" + filename))
115 | {
116 | e.Value = "Update";
117 | } else
118 | {
119 | e.Value = "Download";
120 | }
121 | }
122 | }
123 |
124 | private void dataGridView1_SelectionChanged(object sender, EventArgs e)
125 | {
126 | dataGridView1.ClearSelection();
127 |
128 | }
129 |
130 | private void dataGridView1_Resize(object sender, EventArgs e)
131 | {
132 |
133 | }
134 |
135 | private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
136 | {
137 | var senderGrid = (DataGridView)sender;
138 |
139 | if (senderGrid.Columns[e.ColumnIndex].Name == "FileUrl" &&
140 | e.RowIndex >= 0)
141 | {
142 | Uri downloadUrl = new Uri(mapPackages[e.RowIndex].FileUrl);
143 | string filename = System.IO.Path.GetFileName(downloadUrl.LocalPath);
144 |
145 | if (File.Exists(Properties.Settings.Default.ModFolder+ "\\" + filename))
146 | {
147 | // Confirm overwrite
148 | DialogResult dialogResult = MessageBox.Show(filename + " already exists, overwrite?", "Dependency Exists", MessageBoxButtons.YesNo);
149 | if (dialogResult == DialogResult.Yes)
150 | {
151 | packageStatusLabel.Text = "Downloading " + mapPackages[e.RowIndex].Name + " map...";
152 | webClient = new WebClient();
153 | webClient.Proxy = null;
154 | webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
155 | webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
156 |
157 | webClient.DownloadFileAsync(downloadUrl, Properties.Settings.Default.ModFolder + "\\" + filename);
158 | }
159 | } else
160 | {
161 | packageStatusLabel.Text = "Downloading " + mapPackages[e.RowIndex].Name + " map...";
162 | webClient = new WebClient();
163 | webClient.Proxy = null;
164 | webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
165 | webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
166 |
167 | webClient.DownloadFileAsync(downloadUrl, Properties.Settings.Default.ModFolder + "\\" + filename);
168 | }
169 | }
170 | }
171 |
172 | private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e)
173 | {
174 | downloadProgressBar.Value = e.ProgressPercentage;
175 | }
176 |
177 | private void Completed(object sender, AsyncCompletedEventArgs e)
178 | {
179 | packageStatusLabel.Text = "Download completed!";
180 | mainForm.RescanModsFolder();
181 | }
182 |
183 | private void statusStrip1_SizeChanged(object sender, EventArgs e)
184 | {
185 |
186 | }
187 |
188 | private void button1_Click(object sender, EventArgs e)
189 | {
190 | // Check if engine files already exist, if so ignore.
191 | String[] mapDependencies = { "EditorLandscapeResources.upk", "EditorMaterials.upk", "EditorMeshes.upk", "EditorResources.upk", "Engine_MI_Shaders.upk", "EngineBuildings.upk", "EngineDebugMaterials.upk", "EngineFonts.upk", "EngineFonts_RUS.upk", "EngineMaterials.upk", "EngineMeshes.upk", "EngineResources.upk", "EngineSounds.upk", "EngineVolumetrics.upk", "MapTemplateIndex.upk", "MapTemplates.upk", "MaterialTemplates.upk", "MobileEngineMaterials.upk", "MobileResources.upk", "NodeBuddies.upk" };
192 | Boolean[] downloadDep;
193 | Boolean yesToAll = false;
194 |
195 |
196 | foreach (string depName in mapDependencies)
197 | {
198 | if (File.Exists(Properties.Settings.Default.RLFolder + "\\TAGame\\CookedPCConsole\\" + depName))
199 | {
200 | // Confirm overwrite
201 | DialogResult dialogResult = MessageBox.Show(depName + " already exists, overwrite?", "Dependency Exists", MessageBoxButtons.YesNo);
202 | if (dialogResult == DialogResult.Yes)
203 | {
204 | // Download dependency
205 | packageStatusLabel.Text = "Downloading " + depName + " dependency...";
206 | webClient = new WebClient();
207 | webClient.Proxy = null;
208 | webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
209 | webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
210 |
211 | Uri downloadUrl = new Uri("http://hack.fyi/rlmaps/dep/" + depName);
212 | string filename = System.IO.Path.GetFileName(downloadUrl.LocalPath);
213 |
214 | webClient.DownloadFileAsync(downloadUrl, Properties.Settings.Default.RLFolder + "\\TAGame\\CookedPCConsole\\" + filename);
215 | }
216 |
217 | }
218 | else
219 | {
220 | // Download dependency
221 | packageStatusLabel.Text = "Downloading " + depName + " dependency...";
222 | webClient = new WebClient();
223 | webClient.Proxy = null;
224 | webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
225 | webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
226 |
227 | Uri downloadUrl = new Uri("http://hack.fyi/rlmaps/dep/" + depName);
228 | string filename = System.IO.Path.GetFileName(downloadUrl.LocalPath);
229 |
230 | webClient.DownloadFileAsync(downloadUrl, Properties.Settings.Default.RLFolder + "\\TAGame\\CookedPCConsole\\" + filename);
231 | }
232 | }
233 |
234 |
235 |
236 | }
237 | }
238 | }
239 |
--------------------------------------------------------------------------------
/RLMapLoader/Memory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Text.RegularExpressions;
4 |
5 | namespace RLMapLoader
6 | {
7 | ///
8 | /// Represents an access to a remote process memory
9 | ///
10 | public class Memory : IDisposable
11 | {
12 | private Process process;
13 | private IntPtr processHandle;
14 | private bool isDisposed;
15 |
16 | public const string OffsetPattern = "(\\+|\\-){0,1}(0x){0,1}[a-fA-F0-9]{1,}";
17 |
18 | ///
19 | /// Initializes a new instance of the Memory
20 | ///
21 | /// Remote process
22 | public Memory(Process process)
23 | {
24 | if (process == null)
25 | throw new ArgumentNullException("process");
26 |
27 | this.process = process;
28 | processHandle = Win32.OpenProcess(
29 | Win32.ProcessAccessType.PROCESS_VM_READ | Win32.ProcessAccessType.PROCESS_VM_WRITE |
30 | Win32.ProcessAccessType.PROCESS_VM_OPERATION, true, (uint)process.Id);
31 | if (processHandle == IntPtr.Zero)
32 | throw new InvalidOperationException("Could not open the process");
33 | }
34 |
35 | #region IDisposable
36 |
37 | ~Memory()
38 | {
39 | Dispose(false);
40 | }
41 |
42 | public void Dispose()
43 | {
44 | Dispose(true);
45 | GC.SuppressFinalize(this);
46 | }
47 |
48 | private void Dispose(bool disposing)
49 | {
50 | if (isDisposed)
51 | return;
52 | Win32.CloseHandle(processHandle);
53 | process = null;
54 | processHandle = IntPtr.Zero;
55 | isDisposed = true;
56 | }
57 |
58 | #endregion
59 |
60 | #region Properties
61 |
62 | ///
63 | /// Gets the process to which this memory is attached to
64 | ///
65 | public Process Process
66 | {
67 | get
68 | {
69 | return process;
70 | }
71 | }
72 |
73 | #endregion
74 |
75 | ///
76 | /// Finds module with the given name
77 | ///
78 | /// Module name
79 | ///
80 | protected ProcessModule FindModule(string name)
81 | {
82 | if (string.IsNullOrEmpty(name))
83 | throw new ArgumentNullException("name");
84 | foreach (ProcessModule module in process.Modules)
85 | {
86 | if (module.ModuleName.ToLower() == name.ToLower())
87 | return module;
88 | }
89 | return null;
90 | }
91 |
92 | ///
93 | /// Gets module based address
94 | ///
95 | /// Module name
96 | /// Base address
97 | /// Collection of offsets
98 | ///
99 | public IntPtr GetAddress(string moduleName, IntPtr baseAddress, int[] offsets)
100 | {
101 | if (string.IsNullOrEmpty(moduleName))
102 | throw new ArgumentNullException("moduleName");
103 |
104 | ProcessModule module = FindModule(moduleName);
105 | if (module == null)
106 | return IntPtr.Zero;
107 | else
108 | {
109 | int address = module.BaseAddress.ToInt32() + baseAddress.ToInt32();
110 | return GetAddress((IntPtr)address, offsets);
111 | }
112 | }
113 |
114 | ///
115 | /// Gets address
116 | ///
117 | /// Base address
118 | /// Collection of offsets
119 | ///
120 | public IntPtr GetAddress(IntPtr baseAddress, int[] offsets)
121 | {
122 | if (baseAddress == IntPtr.Zero)
123 | throw new ArgumentException("Invalid base address");
124 |
125 | int address = baseAddress.ToInt32();
126 |
127 | if (offsets != null && offsets.Length > 0)
128 | {
129 | byte[] buffer = new byte[4];
130 | foreach (int offset in offsets)
131 | address = ReadInt32((IntPtr)address) + offset;
132 | }
133 |
134 | return (IntPtr)address;
135 | }
136 |
137 | ///
138 | /// Gets address pointer
139 | ///
140 | /// Address
141 | ///
142 | public IntPtr GetAddress(string address)
143 | {
144 | if (string.IsNullOrEmpty(address))
145 | throw new ArgumentNullException("address");
146 |
147 | string moduleName = null;
148 | int index = address.IndexOf('"');
149 | if (index != -1)
150 | {
151 | // Module name at the beginning
152 | int endIndex = address.IndexOf('"', index + 1);
153 | if (endIndex == -1)
154 | throw new ArgumentException("Invalid module name. Could not find matching \"");
155 | moduleName = address.Substring(index + 1, endIndex - 1);
156 | address = address.Substring(endIndex + 1);
157 | }
158 |
159 | int[] offsets = GetAddressOffsets(address);
160 | int[] _offsets = null;
161 | IntPtr baseAddress = offsets != null && offsets.Length > 0 ?
162 | (IntPtr)offsets[0] : IntPtr.Zero;
163 | if (offsets != null && offsets.Length > 1)
164 | {
165 | _offsets = new int[offsets.Length - 1];
166 | for (int i = 0; i < offsets.Length - 1; i++)
167 | _offsets[i] = offsets[i + 1];
168 | }
169 |
170 | if (moduleName != null)
171 | return GetAddress(moduleName, baseAddress, _offsets);
172 | else
173 | return GetAddress(baseAddress, _offsets);
174 | }
175 |
176 | ///
177 | /// Gets address offsets
178 | ///
179 | /// Address
180 | ///
181 | protected static int[] GetAddressOffsets(string address)
182 | {
183 | if (string.IsNullOrEmpty(address))
184 | return new int[0];
185 | else
186 | {
187 | MatchCollection matches = Regex.Matches(address, OffsetPattern);
188 | int[] offsets = new int[matches.Count];
189 | string value;
190 | char ch;
191 | for (int i = 0; i < matches.Count; i++)
192 | {
193 | ch = matches[i].Value[0];
194 | if (ch == '+' || ch == '-')
195 | value = matches[i].Value.Substring(1);
196 | else
197 | value = matches[i].Value;
198 | offsets[i] = Convert.ToInt32(value, 16);
199 | if (ch == '-')
200 | offsets[i] = -offsets[i];
201 | }
202 | return offsets;
203 | }
204 | }
205 |
206 | ///
207 | /// Reads memory at the address
208 | ///
209 | /// Memory address
210 | /// Buffer
211 | /// Size in bytes
212 | public void ReadMemory(IntPtr address, byte[] buffer, int size)
213 | {
214 | if (isDisposed)
215 | throw new ObjectDisposedException("Memory");
216 | if (buffer == null)
217 | throw new ArgumentNullException("buffer");
218 | if (size <= 0)
219 | throw new ArgumentException("Size must be greater than zero");
220 | if (address == IntPtr.Zero)
221 | throw new ArgumentException("Invalid address");
222 |
223 | uint read = 0;
224 | if (!Win32.ReadProcessMemory(processHandle, address, buffer, (uint)size, ref read) ||
225 | read != size)
226 | throw new AccessViolationException();
227 | }
228 |
229 | ///
230 | /// Writes memory at the address
231 | ///
232 | /// Memory address
233 | /// Buffer
234 | /// Size in bytes
235 | public void WriteMemory(IntPtr address, byte[] buffer, int size)
236 | {
237 | if (isDisposed)
238 | throw new ObjectDisposedException("Memory");
239 | if (buffer == null)
240 | throw new ArgumentNullException("buffer");
241 | if (size <= 0)
242 | throw new ArgumentException("Size must be greater than zero");
243 | if (address == IntPtr.Zero)
244 | throw new ArgumentException("Invalid address");
245 |
246 | uint write = 0;
247 | if (!Win32.WriteProcessMemory(processHandle, address, buffer, (uint)size, ref write) ||
248 | write != size)
249 | throw new AccessViolationException();
250 | }
251 |
252 | ///
253 | /// Reads 32 bit signed integer at the address
254 | ///
255 | /// Memory address
256 | ///
257 | public int ReadInt32(IntPtr address)
258 | {
259 | byte[] buffer = new byte[4];
260 | ReadMemory(address, buffer, 4);
261 | return BitConverter.ToInt32(buffer, 0);
262 | }
263 |
264 | ///
265 | /// Reads 32 bit unsigned integer at the address
266 | ///
267 | /// Memory address
268 | ///
269 | public uint ReadUInt32(IntPtr address)
270 | {
271 | byte[] buffer = new byte[4];
272 | ReadMemory(address, buffer, 4);
273 | return BitConverter.ToUInt32(buffer, 0);
274 | }
275 |
276 | ///
277 | /// Reads single precision value at the address
278 | ///
279 | /// Memory address
280 | ///
281 | public float ReadFloat(IntPtr address)
282 | {
283 | byte[] buffer = new byte[4];
284 | ReadMemory(address, buffer, 4);
285 | return BitConverter.ToSingle(buffer, 0);
286 | }
287 |
288 | ///
289 | /// Reads double precision value at the address
290 | ///
291 | /// Memory address
292 | ///
293 | public double ReadDouble(IntPtr address)
294 | {
295 | byte[] buffer = new byte[8];
296 | ReadMemory(address, buffer, 8);
297 | return BitConverter.ToDouble(buffer, 0);
298 | }
299 |
300 | ///
301 | /// Writes 32 bit unsigned integer at the address
302 | ///
303 | /// Memory address
304 | /// Value
305 | ///
306 | public void WriteUInt32(IntPtr address, uint value)
307 | {
308 | byte[] buffer = BitConverter.GetBytes(value);
309 | WriteMemory(address, buffer, 4);
310 | }
311 |
312 | ///
313 | /// Writes 32 bit signed integer at the address
314 | ///
315 | /// Memory address
316 | /// Value
317 | ///
318 | public void WriteInt32(IntPtr address, int value)
319 | {
320 | byte[] buffer = BitConverter.GetBytes(value);
321 | WriteMemory(address, buffer, 4);
322 | }
323 |
324 | ///
325 | /// Writes single precision value at the address
326 | ///
327 | /// Memory address
328 | /// Value
329 | ///
330 | public void WriteFloat(IntPtr address, float value)
331 | {
332 | byte[] buffer = BitConverter.GetBytes(value);
333 | WriteMemory(address, buffer, 4);
334 | }
335 |
336 | ///
337 | /// Writes double precision value at the address
338 | ///
339 | /// Memory address
340 | /// Value
341 | ///
342 | public void WriteDouble(IntPtr address, double value)
343 | {
344 | byte[] buffer = BitConverter.GetBytes(value);
345 | WriteMemory(address, buffer, 8);
346 | }
347 | }
348 | }
349 |
--------------------------------------------------------------------------------
/RLMapLoader/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace RLMapLoader
2 | {
3 | partial class Form1
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label2 = new System.Windows.Forms.Label();
32 | this.menuStrip1 = new System.Windows.Forms.MenuStrip();
33 | this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
34 | this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
35 | this.mapPackageManagerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
36 | this.deleteParkPBackupToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
37 | this.restoreOriginalParkPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
38 | this.restoreDefaultSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
39 | this.rescanModsFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
40 | this.loadMapButton = new System.Windows.Forms.Button();
41 | this.rlDirTextBox = new System.Windows.Forms.TextBox();
42 | this.mapSelectComboBox = new System.Windows.Forms.ComboBox();
43 | this.modsDirTextBox = new System.Windows.Forms.TextBox();
44 | this.label1 = new System.Windows.Forms.Label();
45 | this.label3 = new System.Windows.Forms.Label();
46 | this.selectRLButton = new System.Windows.Forms.Button();
47 | this.selectModsButton = new System.Windows.Forms.Button();
48 | this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
49 | this.loadOnStartCheckBox = new System.Windows.Forms.CheckBox();
50 | this.statusStrip1 = new System.Windows.Forms.StatusStrip();
51 | this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
52 | this.imagePreviewPictureBox = new System.Windows.Forms.PictureBox();
53 | this.groupBox1 = new System.Windows.Forms.GroupBox();
54 | this.restoreDefaultMapCheckBox = new System.Windows.Forms.CheckBox();
55 | this.menuStrip1.SuspendLayout();
56 | this.statusStrip1.SuspendLayout();
57 | ((System.ComponentModel.ISupportInitialize)(this.imagePreviewPictureBox)).BeginInit();
58 | this.groupBox1.SuspendLayout();
59 | this.SuspendLayout();
60 | //
61 | // label2
62 | //
63 | this.label2.AutoSize = true;
64 | this.label2.Location = new System.Drawing.Point(32, 56);
65 | this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
66 | this.label2.Name = "label2";
67 | this.label2.Size = new System.Drawing.Size(166, 20);
68 | this.label2.TabIndex = 2;
69 | this.label2.Text = "Current Freeplay Map:";
70 | //
71 | // menuStrip1
72 | //
73 | this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
74 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
75 | this.fileToolStripMenuItem,
76 | this.toolsToolStripMenuItem,
77 | this.rescanModsFolderToolStripMenuItem});
78 | this.menuStrip1.Location = new System.Drawing.Point(0, 0);
79 | this.menuStrip1.Name = "menuStrip1";
80 | this.menuStrip1.Padding = new System.Windows.Forms.Padding(9, 3, 0, 3);
81 | this.menuStrip1.Size = new System.Drawing.Size(604, 35);
82 | this.menuStrip1.TabIndex = 4;
83 | this.menuStrip1.Text = "menuStrip1";
84 | //
85 | // fileToolStripMenuItem
86 | //
87 | this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
88 | this.fileToolStripMenuItem.Size = new System.Drawing.Size(50, 29);
89 | this.fileToolStripMenuItem.Text = "File";
90 | //
91 | // toolsToolStripMenuItem
92 | //
93 | this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
94 | this.mapPackageManagerToolStripMenuItem,
95 | this.deleteParkPBackupToolStripMenuItem1,
96 | this.restoreOriginalParkPToolStripMenuItem,
97 | this.restoreDefaultSettingsToolStripMenuItem});
98 | this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
99 | this.toolsToolStripMenuItem.Size = new System.Drawing.Size(65, 29);
100 | this.toolsToolStripMenuItem.Text = "Tools";
101 | //
102 | // mapPackageManagerToolStripMenuItem
103 | //
104 | this.mapPackageManagerToolStripMenuItem.Name = "mapPackageManagerToolStripMenuItem";
105 | this.mapPackageManagerToolStripMenuItem.Size = new System.Drawing.Size(287, 30);
106 | this.mapPackageManagerToolStripMenuItem.Text = "Map Package Manager";
107 | this.mapPackageManagerToolStripMenuItem.Click += new System.EventHandler(this.mapPackageManagerToolStripMenuItem_Click);
108 | //
109 | // deleteParkPBackupToolStripMenuItem1
110 | //
111 | this.deleteParkPBackupToolStripMenuItem1.Name = "deleteParkPBackupToolStripMenuItem1";
112 | this.deleteParkPBackupToolStripMenuItem1.Size = new System.Drawing.Size(287, 30);
113 | this.deleteParkPBackupToolStripMenuItem1.Text = "Delete Park_P Backup";
114 | this.deleteParkPBackupToolStripMenuItem1.Click += new System.EventHandler(this.deleteParkPBackupToolStripMenuItem_Click);
115 | //
116 | // restoreOriginalParkPToolStripMenuItem
117 | //
118 | this.restoreOriginalParkPToolStripMenuItem.Name = "restoreOriginalParkPToolStripMenuItem";
119 | this.restoreOriginalParkPToolStripMenuItem.Size = new System.Drawing.Size(287, 30);
120 | this.restoreOriginalParkPToolStripMenuItem.Text = "Restore Original Park_P";
121 | this.restoreOriginalParkPToolStripMenuItem.Click += new System.EventHandler(this.restoreOriginalParkPToolStripMenuItem_Click);
122 | //
123 | // restoreDefaultSettingsToolStripMenuItem
124 | //
125 | this.restoreDefaultSettingsToolStripMenuItem.Name = "restoreDefaultSettingsToolStripMenuItem";
126 | this.restoreDefaultSettingsToolStripMenuItem.Size = new System.Drawing.Size(287, 30);
127 | this.restoreDefaultSettingsToolStripMenuItem.Text = "Restore Default Settings";
128 | this.restoreDefaultSettingsToolStripMenuItem.Click += new System.EventHandler(this.restoreDefaultSettingsToolStripMenuItem_Click);
129 | //
130 | // rescanModsFolderToolStripMenuItem
131 | //
132 | this.rescanModsFolderToolStripMenuItem.Name = "rescanModsFolderToolStripMenuItem";
133 | this.rescanModsFolderToolStripMenuItem.Size = new System.Drawing.Size(184, 29);
134 | this.rescanModsFolderToolStripMenuItem.Text = "Rescan Mods Folder";
135 | this.rescanModsFolderToolStripMenuItem.Click += new System.EventHandler(this.rescanModsFolderToolStripMenuItem_Click);
136 | //
137 | // loadMapButton
138 | //
139 | this.loadMapButton.Location = new System.Drawing.Point(508, 47);
140 | this.loadMapButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
141 | this.loadMapButton.Name = "loadMapButton";
142 | this.loadMapButton.Size = new System.Drawing.Size(70, 38);
143 | this.loadMapButton.TabIndex = 6;
144 | this.loadMapButton.Text = "Load";
145 | this.loadMapButton.UseVisualStyleBackColor = true;
146 | this.loadMapButton.Click += new System.EventHandler(this.loadMapButton_Click);
147 | //
148 | // rlDirTextBox
149 | //
150 | this.rlDirTextBox.Location = new System.Drawing.Point(116, 125);
151 | this.rlDirTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
152 | this.rlDirTextBox.Name = "rlDirTextBox";
153 | this.rlDirTextBox.Size = new System.Drawing.Size(385, 26);
154 | this.rlDirTextBox.TabIndex = 10;
155 | //
156 | // mapSelectComboBox
157 | //
158 | this.mapSelectComboBox.FormattingEnabled = true;
159 | this.mapSelectComboBox.Location = new System.Drawing.Point(205, 52);
160 | this.mapSelectComboBox.Name = "mapSelectComboBox";
161 | this.mapSelectComboBox.Size = new System.Drawing.Size(295, 28);
162 | this.mapSelectComboBox.TabIndex = 11;
163 | this.mapSelectComboBox.Text = "Park_P.upk";
164 | this.mapSelectComboBox.SelectedIndexChanged += new System.EventHandler(this.mapSelectComboBox_SelectedIndexChanged);
165 | //
166 | // modsDirTextBox
167 | //
168 | this.modsDirTextBox.Location = new System.Drawing.Point(116, 161);
169 | this.modsDirTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
170 | this.modsDirTextBox.Name = "modsDirTextBox";
171 | this.modsDirTextBox.Size = new System.Drawing.Size(385, 26);
172 | this.modsDirTextBox.TabIndex = 12;
173 | //
174 | // label1
175 | //
176 | this.label1.AutoSize = true;
177 | this.label1.Location = new System.Drawing.Point(33, 128);
178 | this.label1.Name = "label1";
179 | this.label1.Size = new System.Drawing.Size(58, 20);
180 | this.label1.TabIndex = 13;
181 | this.label1.Text = "RL Dir:";
182 | //
183 | // label3
184 | //
185 | this.label3.AutoSize = true;
186 | this.label3.Location = new System.Drawing.Point(33, 164);
187 | this.label3.Name = "label3";
188 | this.label3.Size = new System.Drawing.Size(76, 20);
189 | this.label3.TabIndex = 14;
190 | this.label3.Text = "Mods Dir:";
191 | //
192 | // selectRLButton
193 | //
194 | this.selectRLButton.Location = new System.Drawing.Point(508, 121);
195 | this.selectRLButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
196 | this.selectRLButton.Name = "selectRLButton";
197 | this.selectRLButton.Size = new System.Drawing.Size(70, 35);
198 | this.selectRLButton.TabIndex = 15;
199 | this.selectRLButton.Text = "...";
200 | this.selectRLButton.UseVisualStyleBackColor = true;
201 | this.selectRLButton.Click += new System.EventHandler(this.selectRLButton_Click);
202 | //
203 | // selectModsButton
204 | //
205 | this.selectModsButton.Location = new System.Drawing.Point(508, 157);
206 | this.selectModsButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
207 | this.selectModsButton.Name = "selectModsButton";
208 | this.selectModsButton.Size = new System.Drawing.Size(70, 34);
209 | this.selectModsButton.TabIndex = 16;
210 | this.selectModsButton.Text = "...";
211 | this.selectModsButton.UseVisualStyleBackColor = true;
212 | this.selectModsButton.Click += new System.EventHandler(this.selectModsButton_Click);
213 | //
214 | // loadOnStartCheckBox
215 | //
216 | this.loadOnStartCheckBox.AutoSize = true;
217 | this.loadOnStartCheckBox.Location = new System.Drawing.Point(410, 93);
218 | this.loadOnStartCheckBox.Name = "loadOnStartCheckBox";
219 | this.loadOnStartCheckBox.Size = new System.Drawing.Size(167, 24);
220 | this.loadOnStartCheckBox.TabIndex = 17;
221 | this.loadOnStartCheckBox.Text = "Load Map on Start";
222 | this.loadOnStartCheckBox.UseVisualStyleBackColor = true;
223 | this.loadOnStartCheckBox.CheckedChanged += new System.EventHandler(this.loadOnStartCheckBox_CheckedChanged);
224 | //
225 | // statusStrip1
226 | //
227 | this.statusStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
228 | this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
229 | this.statusLabel});
230 | this.statusStrip1.Location = new System.Drawing.Point(0, 208);
231 | this.statusStrip1.Name = "statusStrip1";
232 | this.statusStrip1.Size = new System.Drawing.Size(604, 22);
233 | this.statusStrip1.TabIndex = 18;
234 | this.statusStrip1.Text = "statusStrip1";
235 | //
236 | // statusLabel
237 | //
238 | this.statusLabel.Name = "statusLabel";
239 | this.statusLabel.Size = new System.Drawing.Size(0, 17);
240 | //
241 | // imagePreviewPictureBox
242 | //
243 | this.imagePreviewPictureBox.Location = new System.Drawing.Point(16, 25);
244 | this.imagePreviewPictureBox.Name = "imagePreviewPictureBox";
245 | this.imagePreviewPictureBox.Size = new System.Drawing.Size(508, 177);
246 | this.imagePreviewPictureBox.TabIndex = 19;
247 | this.imagePreviewPictureBox.TabStop = false;
248 | //
249 | // groupBox1
250 | //
251 | this.groupBox1.Controls.Add(this.imagePreviewPictureBox);
252 | this.groupBox1.Location = new System.Drawing.Point(36, 442);
253 | this.groupBox1.Name = "groupBox1";
254 | this.groupBox1.Size = new System.Drawing.Size(541, 223);
255 | this.groupBox1.TabIndex = 20;
256 | this.groupBox1.TabStop = false;
257 | this.groupBox1.Text = "Map Preview:";
258 | //
259 | // restoreDefaultMapCheckBox
260 | //
261 | this.restoreDefaultMapCheckBox.AutoSize = true;
262 | this.restoreDefaultMapCheckBox.Location = new System.Drawing.Point(205, 93);
263 | this.restoreDefaultMapCheckBox.Name = "restoreDefaultMapCheckBox";
264 | this.restoreDefaultMapCheckBox.Size = new System.Drawing.Size(197, 24);
265 | this.restoreDefaultMapCheckBox.TabIndex = 21;
266 | this.restoreDefaultMapCheckBox.Text = "Restore Park_P on exit";
267 | this.restoreDefaultMapCheckBox.UseVisualStyleBackColor = true;
268 | this.restoreDefaultMapCheckBox.CheckedChanged += new System.EventHandler(this.restoreDefaultMapCheckBox_CheckedChanged);
269 | //
270 | // Form1
271 | //
272 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
273 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
274 | this.ClientSize = new System.Drawing.Size(604, 230);
275 | this.Controls.Add(this.restoreDefaultMapCheckBox);
276 | this.Controls.Add(this.groupBox1);
277 | this.Controls.Add(this.statusStrip1);
278 | this.Controls.Add(this.loadOnStartCheckBox);
279 | this.Controls.Add(this.selectModsButton);
280 | this.Controls.Add(this.selectRLButton);
281 | this.Controls.Add(this.label3);
282 | this.Controls.Add(this.label1);
283 | this.Controls.Add(this.modsDirTextBox);
284 | this.Controls.Add(this.mapSelectComboBox);
285 | this.Controls.Add(this.rlDirTextBox);
286 | this.Controls.Add(this.loadMapButton);
287 | this.Controls.Add(this.label2);
288 | this.Controls.Add(this.menuStrip1);
289 | this.MainMenuStrip = this.menuStrip1;
290 | this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
291 | this.Name = "Form1";
292 | this.Text = "RL Map Loader";
293 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
294 | this.Load += new System.EventHandler(this.Form1_Load);
295 | this.menuStrip1.ResumeLayout(false);
296 | this.menuStrip1.PerformLayout();
297 | this.statusStrip1.ResumeLayout(false);
298 | this.statusStrip1.PerformLayout();
299 | ((System.ComponentModel.ISupportInitialize)(this.imagePreviewPictureBox)).EndInit();
300 | this.groupBox1.ResumeLayout(false);
301 | this.ResumeLayout(false);
302 | this.PerformLayout();
303 |
304 | }
305 |
306 | #endregion
307 | private System.Windows.Forms.Label label2;
308 | private System.Windows.Forms.MenuStrip menuStrip1;
309 | private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
310 | private System.Windows.Forms.Button loadMapButton;
311 | private System.Windows.Forms.TextBox rlDirTextBox;
312 | private System.Windows.Forms.ComboBox mapSelectComboBox;
313 | private System.Windows.Forms.TextBox modsDirTextBox;
314 | private System.Windows.Forms.Label label1;
315 | private System.Windows.Forms.Label label3;
316 | private System.Windows.Forms.Button selectRLButton;
317 | private System.Windows.Forms.Button selectModsButton;
318 | private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
319 | private System.Windows.Forms.CheckBox loadOnStartCheckBox;
320 | private System.Windows.Forms.StatusStrip statusStrip1;
321 | private System.Windows.Forms.ToolStripStatusLabel statusLabel;
322 | private System.Windows.Forms.PictureBox imagePreviewPictureBox;
323 | private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem;
324 | private System.Windows.Forms.ToolStripMenuItem mapPackageManagerToolStripMenuItem;
325 | private System.Windows.Forms.GroupBox groupBox1;
326 | private System.Windows.Forms.ToolStripMenuItem deleteParkPBackupToolStripMenuItem1;
327 | private System.Windows.Forms.ToolStripMenuItem restoreOriginalParkPToolStripMenuItem;
328 | private System.Windows.Forms.CheckBox restoreDefaultMapCheckBox;
329 | private System.Windows.Forms.ToolStripMenuItem restoreDefaultSettingsToolStripMenuItem;
330 | private System.Windows.Forms.ToolStripMenuItem rescanModsFolderToolStripMenuItem;
331 | }
332 | }
333 |
334 |
--------------------------------------------------------------------------------
/RLMapLoader/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Diagnostics;
6 | using System.Drawing;
7 | using System.IO;
8 | using System.Linq;
9 | using System.Runtime.InteropServices;
10 | using System.Text;
11 | using System.Threading.Tasks;
12 | using System.Windows.Forms;
13 |
14 | namespace RLMapLoader
15 | {
16 | public partial class Form1 : Form
17 | {
18 | [DllImport("kernel32.dll")]
19 | static extern bool CreateHardLink(
20 | string lpFileName,
21 | string lpExistingFileName,
22 | IntPtr lpSecurityAttributes
23 | );
24 |
25 |
26 | private Memory rlMemory;
27 | IntPtr trainingMapAddress;
28 | MapPackageManager mpm;
29 |
30 | public Form1()
31 | {
32 | InitializeComponent();
33 |
34 | // Initialize Map Package Manager
35 | mpm = new MapPackageManager(this);
36 |
37 | // Load Settings
38 | if (Properties.Settings.Default.RLFolder != "")
39 | {
40 | rlDirTextBox.Text = Properties.Settings.Default.RLFolder;
41 | }
42 | if (Properties.Settings.Default.ModFolder != "")
43 | {
44 | modsDirTextBox.Text = Properties.Settings.Default.ModFolder;
45 | }
46 | loadOnStartCheckBox.Checked = Properties.Settings.Default.loadMapOnStart;
47 | restoreDefaultMapCheckBox.Checked = Properties.Settings.Default.restoreDefaultMapOnClose;
48 |
49 | //InitializeMemoryAddresses();
50 | InitializeCustomMapList();
51 |
52 | // Add default maps to selection
53 | mapSelectComboBox.Items.Add("[Default] EuroStadium_P.upk");
54 | mapSelectComboBox.Items.Add("[Default] EuroStadium_Rainy_P.upk");
55 |
56 | mapSelectComboBox.Items.Add("[Default] HoopsStadium_P.upk");
57 |
58 | mapSelectComboBox.Items.Add("[Default] Labs_CirclePillars_P.upk");
59 | mapSelectComboBox.Items.Add("[Default] Labs_Cosmic_P.upk");
60 | mapSelectComboBox.Items.Add("[Default] Labs_DoubleGoal_P.upk");
61 | mapSelectComboBox.Items.Add("[Default] Labs_Underpass_P.upk");
62 | mapSelectComboBox.Items.Add("[Default] Labs_Underpass_v0_p.upk");
63 | mapSelectComboBox.Items.Add("[Default] Labs_Utopia_P.upk");
64 |
65 | mapSelectComboBox.Items.Add("[Default] NeoTokyo_P.upk");
66 |
67 | mapSelectComboBox.Items.Add("[Default] Park_P.upk");
68 | mapSelectComboBox.Items.Add("[Default] Park_Night_P.upk");
69 | mapSelectComboBox.Items.Add("[Default] Park_Rainy_P.upk");
70 |
71 | mapSelectComboBox.Items.Add("[Default] Stadium_P.upk");
72 | mapSelectComboBox.Items.Add("[Default] Stadium_Winter_P.upk");
73 |
74 | mapSelectComboBox.Items.Add("[Default] test_Volleyball.upk");
75 |
76 | mapSelectComboBox.Items.Add("[Default] TrainStation_P.upk");
77 | mapSelectComboBox.Items.Add("[Default] TrainStation_Night_P.upk");
78 |
79 | mapSelectComboBox.Items.Add("[Default] TutorialAdvanced.upk");
80 | mapSelectComboBox.Items.Add("[Default] TutorialTest.upk");
81 |
82 | mapSelectComboBox.Items.Add("[Default] UtopiaStadium_P.upk");
83 | mapSelectComboBox.Items.Add("[Default] UtopiaStadium_Dusk_P.upk");
84 |
85 | mapSelectComboBox.Items.Add("[Default] Wasteland_P.upk");
86 |
87 | if (Properties.Settings.Default.lastMap != "") {
88 | mapSelectComboBox.SelectedItem = Properties.Settings.Default.lastMap;
89 | } else
90 | {
91 | // TO DO: replace this with hash detection to determine actual map, not just default to Park_P when unknown
92 | mapSelectComboBox.SelectedIndex = mapSelectComboBox.Items.Count - 13;
93 |
94 | }
95 |
96 | if (loadOnStartCheckBox.Checked)
97 | {
98 | // Load map, if we had disabled restoring default park_p on last close, don't backup.
99 | LoadCustomMap(Properties.Settings.Default.restoreDefaultMapOnClose);
100 | }
101 |
102 | }
103 |
104 | private void InitializeMemoryAddresses()
105 | {
106 | Process[] processes = Process.GetProcessesByName("RocketLeague");
107 | if (processes.Length > 0)
108 | {
109 | rlMemory = new Memory(processes[0]);
110 | //trainingMapAddress = rlMemory.GetAddress("\"RocketLeague.exe\"+0164955C+464+54c+6a8+114+714"); - 1.19
111 | //trainingMapAddress = rlMemory.GetAddress("\"RocketLeague.exe\"+0164C44C+604+5e4+a8+714+514"); - 1.20
112 | trainingMapAddress = rlMemory.GetAddress("\"RocketLeague.exe\"+01634DEC+3c+6a8+7c4+54+714"); // 1.21
113 |
114 | byte[] buff = new byte[6];
115 | rlMemory.ReadMemory(trainingMapAddress, buff, 6);
116 | //currentFreeplayMapTextBox.Text = System.Text.Encoding.Default.GetString(buff);
117 | }
118 | else
119 | {
120 | //MessageBox.Show("Rocket League isn't running...");
121 | }
122 | }
123 |
124 | public void InitializeCustomMapList()
125 | {
126 | try
127 | {
128 | string[] filePaths = Directory.GetFiles(Properties.Settings.Default.ModFolder, "*.upk");
129 | foreach(string mapPath in filePaths)
130 | {
131 | string mapName = Path.GetFileName(mapPath);
132 | mapSelectComboBox.Items.Add(mapName);
133 | }
134 | }
135 | catch { }
136 | }
137 |
138 | public void ChangeFreePlayMap(String mapName)
139 | {
140 | if(mapName.Length != 6)
141 | {
142 | MessageBox.Show("Map Name must be 6 characters!");
143 | return;
144 | }
145 | byte[] mapNameBytes = System.Text.Encoding.UTF8.GetBytes(mapName);
146 | rlMemory.WriteMemory(trainingMapAddress, mapNameBytes, 6);
147 | }
148 |
149 | private void loadMapButton_Click(object sender, EventArgs e)
150 | {
151 | LoadCustomMap(Properties.Settings.Default.lastMap.Equals("[Default] Park_P.upk"));
152 | /**
153 | if(rlMemory != null)
154 | {
155 | ChangeFreePlayMap(currentFreeplayMapTextBox.Text);
156 | }
157 | else
158 | {
159 | InitializeMemoryAddresses();
160 | }
161 | **/
162 | }
163 |
164 | private void saveMapNameButton_Click(object sender, EventArgs e)
165 | {
166 | MessageBox.Show("I don't do anything yet.");
167 | }
168 |
169 |
170 | private void reloadGameButton_Click(object sender, EventArgs e)
171 | {
172 | /**
173 | var processes = Process.GetProcessesByName("RocketLeague");
174 |
175 | if (processes.Length == 0)
176 | {
177 | Process.Start(@"C:\Path\To\Your\RocketLeague.exe");
178 | }
179 |
180 | // Kill the extras
181 | for (int i = 1; i < processes.Length; i++)
182 | {
183 | processes[i].Kill();
184 | }
185 | **/
186 | }
187 |
188 | private Boolean LoadCustomMap(Boolean backupDefaultMap)
189 | {
190 | Process[] processes = Process.GetProcessesByName("RocketLeague");
191 | if (processes.Length > 0)
192 | {
193 | statusLabel.Text = "Unable to load map, please exit Rocket League and try again.";
194 | return false;
195 | } else if(!Directory.Exists(Properties.Settings.Default.RLFolder))
196 | {
197 | statusLabel.Text = "Unable to load map, please select a valid Rocket League Folder.";
198 | return false;
199 | }
200 | else if (!Directory.Exists(Properties.Settings.Default.ModFolder))
201 | {
202 | statusLabel.Text = "Unable to load map, please select a valid Mods Folder.";
203 | return false;
204 | }
205 | else
206 | {
207 | string newMapPath = "";
208 |
209 | // Make sure the last map loaded wasn't Park_P otherwise we will end up deleting the UPK for no reason.
210 | if (mapSelectComboBox.SelectedItem.ToString().Equals("[Default] Park_P.upk") && !Properties.Settings.Default.lastMap.Equals("[Default] Park_P.upk"))
211 | {
212 | RestoreOriginalMap();
213 | return true;
214 |
215 | } // Park_P is already loaded
216 | else if (mapSelectComboBox.SelectedItem.ToString().Equals("[Default] Park_P.upk") && Properties.Settings.Default.lastMap.Equals("[Default] Park_P.upk"))
217 | {
218 | statusLabel.Text = "Park_P is already loaded, doing nothing.";
219 | return true;
220 | }
221 | string parkpPath = Properties.Settings.Default.RLFolder + "\\TAGame\\CookedPCConsole\\Park_P.upk";
222 | // If default rl map, load from maps folder
223 | if (mapSelectComboBox.SelectedItem.ToString().Contains("[Default] "))
224 | {
225 | newMapPath = Properties.Settings.Default.RLFolder + "\\TAGame\\CookedPCConsole\\" + mapSelectComboBox.SelectedItem.ToString().Replace("[Default] ", ""); ;
226 | }
227 | else
228 | {
229 | newMapPath = Properties.Settings.Default.ModFolder + "\\" + mapSelectComboBox.SelectedItem;
230 |
231 | }
232 | // Backup original Park_P map if current Park_P map is original
233 | if (backupDefaultMap)
234 | {
235 | try
236 | {
237 | File.Copy(parkpPath, Properties.Settings.Default.RLFolder + "\\TAGame\\CookedPCConsole\\Park_P.upk.bak");
238 | }
239 | catch (IOException ex)
240 | {
241 | statusLabel.Text = "Backup already exists.";
242 | }
243 | }
244 |
245 | // Create link to selected map
246 | try
247 | {
248 | File.Delete(parkpPath);
249 | }
250 | catch
251 | {
252 |
253 | }
254 |
255 | statusLabel.Text = mapSelectComboBox.SelectedItem.ToString().Replace("[Default] ", "") + " loaded successfully";
256 |
257 | // Only update last loaded map on load button click...duh
258 | Properties.Settings.Default.lastMap = mapSelectComboBox.SelectedItem.ToString();
259 | Properties.Settings.Default.Save();
260 |
261 | return CreateHardLink(parkpPath, newMapPath, IntPtr.Zero);
262 |
263 |
264 | }
265 |
266 | }
267 |
268 | private void Form1_FormClosing(object sender, FormClosingEventArgs e)
269 | {
270 | // Revert Park_P back to default map if enabled
271 | if(Properties.Settings.Default.restoreDefaultMapOnClose)
272 | RestoreOriginalMap();
273 | }
274 |
275 | private void RestoreOriginalMap()
276 | {
277 | string parkpPath = Properties.Settings.Default.RLFolder + "\\TAGame\\CookedPCConsole\\Park_P.upk";
278 | string backupParkp = Properties.Settings.Default.RLFolder + "\\TAGame\\CookedPCConsole\\Park_P.upk.bak";
279 | if (!File.Exists(backupParkp) )
280 | {
281 | if (!Properties.Settings.Default.lastMap.Equals("[Default] Park_P.upk"))
282 | {
283 | MessageBox.Show("No backup exists, unable to restore backup.");
284 | return;
285 | } else
286 | {
287 |
288 | }
289 | }
290 | try {
291 | File.Delete(parkpPath);
292 | }
293 | catch
294 | {
295 | statusLabel.Text = "Unable to delete current Park_P file. File was not restored.";
296 | return;
297 | }
298 | try
299 | {
300 | File.Copy(Properties.Settings.Default.RLFolder + "\\TAGame\\CookedPCConsole\\Park_P.upk.bak", parkpPath);
301 | statusLabel.Text = "Original Park_P restored.";
302 |
303 | }
304 | catch (IOException ex)
305 | {
306 | statusLabel.Text = "Park_P already exists.";
307 |
308 | }
309 | mapSelectComboBox.SelectedItem = "[Default] Park_P.upk";
310 | Properties.Settings.Default.lastMap = "[Default] Park_P.upk";
311 | Properties.Settings.Default.Save();
312 | }
313 |
314 | private void selectModsButton_Click(object sender, EventArgs e)
315 | {
316 | if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
317 | {
318 | modsDirTextBox.Text = folderBrowserDialog1.SelectedPath;
319 | Properties.Settings.Default.ModFolder = modsDirTextBox.Text;
320 |
321 | Properties.Settings.Default.Save();
322 | statusLabel.Text = "New mod path saved.";
323 | }
324 | }
325 |
326 | private void selectRLButton_Click(object sender, EventArgs e)
327 | {
328 | if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
329 | {
330 | rlDirTextBox.Text = folderBrowserDialog1.SelectedPath;
331 | Properties.Settings.Default.RLFolder = rlDirTextBox.Text;
332 | Properties.Settings.Default.Save();
333 | statusLabel.Text = "New Rocket League path saved.";
334 | }
335 | }
336 |
337 | private void deleteParkPBackupToolStripMenuItem_Click(object sender, EventArgs e)
338 | {
339 | string parkpPath = Properties.Settings.Default.RLFolder + "\\TAGame\\CookedPCConsole\\Park_P.upk";
340 | string backupParkp = Properties.Settings.Default.RLFolder + "\\TAGame\\CookedPCConsole\\Park_P.upk.bak";
341 |
342 | if (!File.Exists(parkpPath))
343 | {
344 | DialogResult result1 = MessageBox.Show("Are you sure you want to delete the backup? Park_P.upk is missing.",
345 | "Delete Backup?",
346 | MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
347 | if (result1 == DialogResult.Yes)
348 | {
349 | File.Delete(backupParkp);
350 | statusLabel.Text = "Park_P backup deleted.";
351 | }
352 | } else
353 | {
354 | File.Delete(backupParkp);
355 | statusLabel.Text = "Park_P backup deleted.";
356 | }
357 |
358 | }
359 |
360 | private void loadOnStartCheckBox_CheckedChanged(object sender, EventArgs e)
361 | {
362 |
363 | Properties.Settings.Default.loadMapOnStart = loadOnStartCheckBox.Checked;
364 | Properties.Settings.Default.Save();
365 | }
366 |
367 | private void mapSelectComboBox_SelectedIndexChanged(object sender, EventArgs e)
368 | {
369 | // Load preview when map selected
370 | }
371 |
372 | private void mapPackageManagerToolStripMenuItem_Click(object sender, EventArgs e)
373 | {
374 | statusLabel.Text = "Loading Package Manager...";
375 | mpm.Show();
376 | }
377 |
378 | private void restoreOriginalParkPToolStripMenuItem_Click(object sender, EventArgs e)
379 | {
380 | RestoreOriginalMap();
381 | }
382 |
383 | private void restoreDefaultMapCheckBox_CheckedChanged(object sender, EventArgs e)
384 | {
385 | Properties.Settings.Default.restoreDefaultMapOnClose = restoreDefaultMapCheckBox.Checked;
386 | Properties.Settings.Default.Save();
387 | }
388 |
389 | private void restoreDefaultSettingsToolStripMenuItem_Click(object sender, EventArgs e)
390 | {
391 | // Need to save the last loaded map or things would get wonky. Maybe we should restore default Park_P on settings reset?
392 | String currentlyLoadedMap = Properties.Settings.Default.lastMap;
393 |
394 | Properties.Settings.Default.Reset();
395 | Properties.Settings.Default.Save();
396 |
397 | // Load Settings
398 | if (Properties.Settings.Default.RLFolder != "")
399 | {
400 | rlDirTextBox.Text = Properties.Settings.Default.RLFolder;
401 | }
402 | if (Properties.Settings.Default.ModFolder != "")
403 | {
404 | modsDirTextBox.Text = Properties.Settings.Default.ModFolder;
405 | }
406 | loadOnStartCheckBox.Checked = Properties.Settings.Default.loadMapOnStart;
407 | restoreDefaultMapCheckBox.Checked = Properties.Settings.Default.restoreDefaultMapOnClose;
408 |
409 | InitializeCustomMapList();
410 | mapSelectComboBox.SelectedItem = currentlyLoadedMap;
411 | Properties.Settings.Default.lastMap = currentlyLoadedMap;
412 | }
413 |
414 | private void rescanModsFolderToolStripMenuItem_Click(object sender, EventArgs e)
415 | {
416 | RescanModsFolder();
417 |
418 | }
419 | public void RescanModsFolder()
420 | {
421 | mapSelectComboBox.Items.Clear();
422 |
423 | InitializeCustomMapList();
424 |
425 | // Add default maps to selection
426 | mapSelectComboBox.Items.Add("[Default] EuroStadium_P.upk");
427 | mapSelectComboBox.Items.Add("[Default] EuroStadium_Rainy_P.upk");
428 |
429 | mapSelectComboBox.Items.Add("[Default] HoopsStadium_P.upk");
430 |
431 | mapSelectComboBox.Items.Add("[Default] Labs_CirclePillars_P.upk");
432 | mapSelectComboBox.Items.Add("[Default] Labs_Cosmic_P.upk");
433 | mapSelectComboBox.Items.Add("[Default] Labs_DoubleGoal_P.upk");
434 | mapSelectComboBox.Items.Add("[Default] Labs_Underpass_P.upk");
435 | mapSelectComboBox.Items.Add("[Default] Labs_Underpass_v0_p.upk");
436 | mapSelectComboBox.Items.Add("[Default] Labs_Utopia_P.upk");
437 |
438 | mapSelectComboBox.Items.Add("[Default] NeoTokyo_P.upk");
439 |
440 | mapSelectComboBox.Items.Add("[Default] Park_P.upk");
441 | mapSelectComboBox.Items.Add("[Default] Park_Night_P.upk");
442 | mapSelectComboBox.Items.Add("[Default] Park_Rainy_P.upk");
443 |
444 | mapSelectComboBox.Items.Add("[Default] Stadium_P.upk");
445 | mapSelectComboBox.Items.Add("[Default] Stadium_Winter_P.upk");
446 |
447 | mapSelectComboBox.Items.Add("[Default] test_Volleyball.upk");
448 |
449 | mapSelectComboBox.Items.Add("[Default] TrainStation_P.upk");
450 | mapSelectComboBox.Items.Add("[Default] TrainStation_Night_P.upk");
451 |
452 | mapSelectComboBox.Items.Add("[Default] TutorialAdvanced.upk");
453 | mapSelectComboBox.Items.Add("[Default] TutorialTest.upk");
454 |
455 | mapSelectComboBox.Items.Add("[Default] UtopiaStadium_P.upk");
456 | mapSelectComboBox.Items.Add("[Default] UtopiaStadium_Dusk_P.upk");
457 |
458 | mapSelectComboBox.Items.Add("[Default] Wasteland_P.upk");
459 |
460 | if (Properties.Settings.Default.lastMap != "")
461 | {
462 | mapSelectComboBox.SelectedItem = Properties.Settings.Default.lastMap;
463 | }
464 | else
465 | {
466 | // TO DO: replace this with hash detection to determine actual map, not just default to Park_P when unknown
467 | mapSelectComboBox.SelectedIndex = mapSelectComboBox.Items.Count - 13;
468 |
469 | }
470 |
471 | statusLabel.Text = "Finished rescanning the mods folder for maps.";
472 | }
473 |
474 | private void Form1_Load(object sender, EventArgs e)
475 | {
476 |
477 | }
478 | }
479 | }
480 |
--------------------------------------------------------------------------------