64 |
65 | [Configuration]
66 | BasedOn=..\BmGame\Config\DefaultUI.ini
67 |
68 | [IniVersion]
69 | 0=1577365600.000000
70 | 1=1577365085.000000
71 | 2=1577365085.000000
72 |
73 |
--------------------------------------------------------------------------------
/Resources/LauncherStart1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neatodev/BmLauncherAsylumNET6/ca3b8b3a7f8eca72ae03b1ae1c8f418cc0ad0925/Resources/LauncherStart1.png
--------------------------------------------------------------------------------
/Resources/NVSetter.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neatodev/BmLauncherAsylumNET6/ca3b8b3a7f8eca72ae03b1ae1c8f418cc0ad0925/Resources/NVSetter.exe
--------------------------------------------------------------------------------
/Resources/NvAPIWrapper.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neatodev/BmLauncherAsylumNET6/ca3b8b3a7f8eca72ae03b1ae1c8f418cc0ad0925/Resources/NvAPIWrapper.dll
--------------------------------------------------------------------------------
/Resources/UserEngine.ini:
--------------------------------------------------------------------------------
1 | [Configuration]
2 | BasedOn=..\BmGame\Config\DefaultEngine.ini
3 |
4 | [SystemSettings]
5 | Fullscreen=True
6 | UseVsync=False
7 | AllowD3D10=True
8 | ResX=1
9 | ResY=1
10 | EffectsLevel=3
11 | MaxMultisamples=1
12 | DynamicLights=True
13 | DepthOfField=True
14 | LensFlares=True
15 | Bloom=True
16 | DynamicShadows=True
17 | MotionBlur=False
18 | Distortion=True
19 | FogVolumes=True
20 | DisableSphericalHarmonicLights=False
21 | AmbientOcclusion=True
22 | DetailMode=2
23 | MaxShadowResolution=1024
24 | Stereo=False
25 | IniVersion=5.8
26 |
27 | [Engine.Engine]
28 | bOnScreenKismetWarnings=FALSE
29 | bSubtitlesEnabled=TRUE
30 | PhysXLevel=1
31 | bPhysXuseGRB=False
32 | bPhysXPatched=True
33 | Language=int
34 | bUseInvertedLeftStick=False
35 |
36 | [DevOptions.Shaders]
37 | bAllowMultiThreadedShaderCompile=True
38 |
39 | [Parameters in this file are irrelevant, as they won't be read by the game.]
40 | [Generated by Batman: Arkham Asylum - Advanced Launcher]
--------------------------------------------------------------------------------
/Resources/UserGame.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neatodev/BmLauncherAsylumNET6/ca3b8b3a7f8eca72ae03b1ae1c8f418cc0ad0925/Resources/UserGame.ini
--------------------------------------------------------------------------------
/Resources/UserInput.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neatodev/BmLauncherAsylumNET6/ca3b8b3a7f8eca72ae03b1ae1c8f418cc0ad0925/Resources/UserInput.ini
--------------------------------------------------------------------------------
/Resources/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neatodev/BmLauncherAsylumNET6/ca3b8b3a7f8eca72ae03b1ae1c8f418cc0ad0925/Resources/favicon.ico
--------------------------------------------------------------------------------
/Resources/nexus_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neatodev/BmLauncherAsylumNET6/ca3b8b3a7f8eca72ae03b1ae1c8f418cc0ad0925/Resources/nexus_icon.ico
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | remote_theme: BDHU/minimalist
2 | title: Developed by Neato
3 | description: "(C) 2020-2022 | CC BY-NC-SA 4.0"
4 | logo: Resources/favicon.ico
5 | sidebar:
6 | - name: GitHub Profile
7 | icon:
8 | link: https://github.com/neatodev
9 | - name: Project Repository
10 | icon:
11 | link: https://github.com/neatodev/BmLauncherAsylumNET6
12 | - name: License
13 | icon:
14 | link: https://raw.githubusercontent.com/neatodev/BmLauncherAsylumNET6/main/LICENSE
15 | - name: Nexusmods Page
16 | icon:
17 | link: https://www.nexusmods.com/batmanarkhamasylum/mods/117/
18 | - name: Donate
19 | icon:
20 | link: https://www.paypal.com/donate/?hosted_button_id=LG7YTKP4JYN5S
21 |
22 | github: [metadata]
23 | color-scheme: auto
24 | favicon: true
25 |
--------------------------------------------------------------------------------
/_layouts/default.html:
--------------------------------------------------------------------------------
1 | {% case site.color-scheme %}
2 | {% when "", nil, false, 0, empty %}
3 | {% assign ColorScheme = "auto" %}
4 | {% else %}
5 | {% assign ColorScheme = site.color-scheme %}
6 | {% endcase %}
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | {% seo %}
16 |
17 |
18 |
19 |
20 |
23 | {% include head-custom.html %}
24 |
25 |
26 |
27 |
54 |
55 |
56 | {{ content }}
57 |
58 |
59 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/_sass/jekyll-theme-minimalist.scss:
--------------------------------------------------------------------------------
1 | @import "fonts";
2 | @import "rouge-github";
3 | @import "colors";
4 |
5 | body {
6 | background-color: var(--clr-bg);
7 | padding:50px;
8 | font: 15px/1.5 "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
9 | color: var(--clr-text);
10 | font-weight:400;
11 | }
12 |
13 | h1, h2, h3, h4, h5, h6 {
14 | color: var(--clr-h1-and-bold);
15 | margin:0 0 20px;
16 | }
17 |
18 | p, ul, ol, table, pre, dl {
19 | margin:0 0 20px;
20 | }
21 |
22 | h1, h2, h3 {
23 | line-height:1.1;
24 | }
25 |
26 | h1 {
27 | font-size:38px;
28 | }
29 |
30 | h2 {
31 | color: var(--clr-h2);
32 | }
33 |
34 | h3, h4, h5, h6 {
35 | color: var(--clr-h-3-6);
36 | }
37 |
38 | a {
39 | color:var(--clr-a-text);
40 | text-decoration:none;
41 | }
42 |
43 | a:hover, a:focus {
44 | color: var(--clr-a-text-hvr);
45 | }
46 |
47 | a small {
48 | font-size:11px;
49 | color:var(--clr-small-in-a);
50 | margin-top:-0.3em;
51 | display:block;
52 | }
53 |
54 | a:hover small {
55 | color:var(--clr-small-in-a);
56 | }
57 |
58 | // added
59 | p.link {
60 | margin:0 0 4px;
61 | }
62 |
63 | // added
64 | ul.link {
65 | list-style-type: none; /* Remove bullets */
66 | margin: 0; /* To remove default bottom margin */
67 | padding: 0.4px; /* To remove default left padding */
68 | }
69 |
70 | ul.link li + li {
71 | margin-top: 6px;
72 | }
73 |
74 | ul.link:last-child {
75 | margin-bottom: 6px;
76 | }
77 |
78 | .wrapper {
79 | width:1160px;
80 | margin: 0 auto;
81 | }
82 |
83 | blockquote {
84 | border-left:1px solid var(--clr-splitter-blockquote-and-section);
85 | margin:0;
86 | padding:0 0 0 20px;
87 | font-style:italic;
88 | }
89 |
90 | code, pre {
91 | font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal, Consolas, Liberation Mono, DejaVu Sans Mono, Courier New, monospace;
92 | color: var(--clr-code-text);
93 | }
94 |
95 | pre {
96 | padding:8px 15px;
97 | background: var(--clr-code-bg);
98 | border-radius:5px;
99 | border:1px solid var(--clr-code-border);
100 | overflow-x: auto;
101 | }
102 |
103 | table {
104 | width:100%;
105 | border-collapse:collapse;
106 | }
107 |
108 | th, td {
109 | text-align:left;
110 | padding:5px 10px;
111 | border-bottom:1px solid var(--clr-splitter-blockquote-and-section);
112 | }
113 |
114 | dt {
115 | color:var(--clr-table-header-and-dt);
116 | font-weight:700;
117 | }
118 |
119 | th {
120 | color:var(--clr-table-header-and-dt);
121 | }
122 |
123 | img {
124 | max-width:100%;
125 | }
126 |
127 | kbd {
128 | background-color: var(--clr-kbd-bg) ;
129 | border: 1px solid var(--clr-kbd-border);
130 | border-bottom-color: var(--clr-kbd-border-bottom-and-shadow);
131 | border-radius: 3px;
132 | box-shadow: inset 0 -1px 0 var(--clr-kbd-border-bottom-and-shadow);
133 | color: var(--clr-kbd-text);
134 | display: inline-block;
135 | font-size: 11px;
136 | line-height: 10px;
137 | padding: 3px 5px;
138 | vertical-align: middle;
139 | }
140 |
141 | .sidebar {
142 | width:228px;
143 | float:left;
144 | position:fixed;
145 | -webkit-font-smoothing:subpixel-antialiased;
146 | top: 0;
147 | padding: 58px 0 50px 0;
148 | display: flex;
149 | flex-direction: column;
150 | justify-content: space-between;
151 | height: calc(100vh - 108px);
152 | overflow-x: hidden;
153 | overflow-y: scroll;
154 | -ms-overflow-style: -ms-autohiding-scrollbar; // IE10+
155 | }
156 |
157 | // Disables the scrollbar in Firefox
158 | // HTML-Proofer fails without "@-moz-document url-prefix()"
159 | // because scrollbar-width is still experimental in Firefox.
160 | @-moz-document url-prefix() {
161 | .sidebar {
162 | scrollbar-width: none;
163 | }
164 | }
165 |
166 | .sidebar::-webkit-scrollbar {
167 | /* Chrome, Safari, Edge */
168 | display: none;
169 | }
170 |
171 | strong {
172 | color:var(--clr-h1-and-bold);
173 | font-weight:700;
174 | }
175 |
176 | section {
177 | width: 900px;
178 | float:right;
179 | padding-bottom:30px;
180 | }
181 |
182 | small {
183 | font-size:11px;
184 | }
185 |
186 | hr {
187 | border:0;
188 | background:var(--clr-splitter-blockquote-and-section);
189 | height:1px;
190 | width:30%;
191 | margin:10px auto 30px;
192 | }
193 |
194 | footer, .sidebar-footer {
195 | width:185px;
196 | float:left;
197 | bottom:30px;
198 | -webkit-font-smoothing:subpixel-antialiased;
199 | }
200 |
201 | footer {
202 | display: none;
203 | }
204 |
205 | .sidebar-footer {
206 | flex-basis: content;
207 | }
208 |
209 | @media print, screen and (max-width: 960px) {
210 |
211 | .sidebar {
212 | padding: initial;
213 | display: initial;
214 | height: initial;
215 | overflow: initial;
216 | }
217 |
218 | footer {
219 | display: initial;
220 | }
221 |
222 | .sidebar-footer {
223 | display: none;
224 | }
225 |
226 | div.wrapper {
227 | width:auto;
228 | margin:0;
229 | }
230 |
231 | .sidebar, section, footer {
232 | float:none;
233 | position:static;
234 | width:auto;
235 | }
236 |
237 | header {
238 | padding-right:320px;
239 | }
240 |
241 | section {
242 | border:1px solid var(--clr-splitter-blockquote-and-section);
243 | border-width:1px 0;
244 | padding:20px 0;
245 | margin:0 0 20px;
246 | }
247 |
248 | header a small {
249 | display:inline;
250 | }
251 |
252 | header ul {
253 | position:absolute;
254 | right:50px;
255 | top:52px;
256 | }
257 |
258 | .link-wrapper {
259 | display: none !important;
260 | }
261 |
262 | .img-circle {
263 | display: none !important;
264 | }
265 | }
266 |
267 | @media print, screen and (max-width: 720px) {
268 | body {
269 | word-wrap:break-word;
270 | }
271 |
272 | header {
273 | padding:0;
274 | }
275 |
276 | header ul, header p.view {
277 | position:static;
278 | }
279 |
280 | pre, code {
281 | word-wrap:normal;
282 | }
283 | }
284 |
285 | .link-wrapper-mobile {
286 | margin-bottom: 20px;
287 | }
288 |
289 | @media print, screen and (min-width: 961px) {
290 | .link-wrapper-mobile {
291 | display: none !important;
292 | }
293 | }
294 |
295 | @media print, screen and (max-width: 480px) {
296 | body {
297 | padding:15px;
298 | }
299 |
300 | // header ul {
301 | // width:99%;
302 | // }
303 |
304 | // header li, header ul li + li + li {
305 | // width:33%;
306 | // }
307 | }
308 |
309 | @media print {
310 | body {
311 | padding:0.4in;
312 | font-size:12pt;
313 | color:#444;
314 | }
315 | }
316 |
--------------------------------------------------------------------------------
/data/Graphics.cs:
--------------------------------------------------------------------------------
1 | namespace BmLauncherAsylumNET6.data
2 | {
3 | ///
4 | /// Static class that stores all important parameters that are needed by BmEngine
5 | /// Contains setter + getter for every parameter
6 | ///
7 | internal static class Graphics
8 | {
9 | private static string language;
10 | private static string fullScreen;
11 | private static string vsync;
12 | private static string resolutionX = "default";
13 | private static string resolutionY = "default";
14 | private static string detailMode;
15 | private static string multiSampling;
16 | private static string depthOfField;
17 | private static string ambientOcclusion;
18 | private static string lensFlares;
19 | private static string motionBlur;
20 | private static string bloom;
21 | private static string highQualityBloom;
22 | private static string maxAnisotropy;
23 | private static string dynamicShadows;
24 | private static string maxShadowResolution;
25 | private static string shadowFilterRadius;
26 | private static string maxSmoothedFramerate;
27 | private static string disableSphericalHarmonicLights;
28 | private static string fogVolumes;
29 | private static string distortion;
30 | private static string shadowTexels;
31 | private static string physX;
32 | private static string memoryPoolsValue;
33 | private static string frameThreadLag;
34 | private static string shadowslope;
35 |
36 | public static string getLanguage()
37 | {
38 | return language;
39 | }
40 |
41 | public static string getFrameThreadLag()
42 | {
43 | return frameThreadLag;
44 | }
45 |
46 | public static string isFullScreen()
47 | {
48 | return fullScreen;
49 | }
50 |
51 | public static string isVsync()
52 | {
53 | return vsync;
54 | }
55 |
56 | public static string getResolutionX()
57 | {
58 | return resolutionX;
59 | }
60 |
61 | public static string getResolutionY()
62 | {
63 | return resolutionY;
64 | }
65 |
66 | public static string getDetailMode()
67 | {
68 | return detailMode;
69 | }
70 |
71 | public static string getMultiSampling()
72 | {
73 | return multiSampling;
74 | }
75 |
76 | public static string getShadowSlope()
77 | {
78 | return shadowslope;
79 | }
80 |
81 | public static string isDepthOfField()
82 | {
83 | return depthOfField;
84 | }
85 |
86 | public static string isAmbientOcclusion()
87 | {
88 | return ambientOcclusion;
89 | }
90 |
91 | public static string isLensFlares()
92 | {
93 | return lensFlares;
94 | }
95 |
96 | public static string isMotionBlur()
97 | {
98 | return motionBlur;
99 | }
100 |
101 | public static string isBloom()
102 | {
103 | return bloom;
104 | }
105 |
106 | public static string isHighQualityBloom()
107 | {
108 | return highQualityBloom;
109 | }
110 |
111 | public static string getMaxAnisotropy()
112 | {
113 | return maxAnisotropy;
114 | }
115 |
116 | public static string isDynamicShadows()
117 | {
118 | return dynamicShadows;
119 | }
120 |
121 | public static string getMaxShadowResolution()
122 | {
123 | return maxShadowResolution;
124 | }
125 |
126 | public static string getShadowFilterRadius()
127 | {
128 | return shadowFilterRadius;
129 | }
130 |
131 | public static string getMaxSmoothedFramerate()
132 | {
133 | return maxSmoothedFramerate;
134 | }
135 |
136 | public static string isDisableSphericalHarmonicLights()
137 | {
138 | return disableSphericalHarmonicLights;
139 | }
140 |
141 | public static string isFogVolumes()
142 | {
143 | return fogVolumes;
144 | }
145 |
146 | public static string isDistortion()
147 | {
148 | return distortion;
149 | }
150 |
151 | public static string getShadowTexels()
152 | {
153 | return shadowTexels;
154 | }
155 |
156 | public static string getPhysX()
157 | {
158 | return physX;
159 | }
160 |
161 | public static string getMemoryPoolsValue()
162 | {
163 | return memoryPoolsValue;
164 | }
165 |
166 | public static void setLanguage(string setLang)
167 | {
168 | language = setLang;
169 | }
170 |
171 | public static void setFullScreen(string setBool)
172 | {
173 | fullScreen = setBool;
174 | }
175 |
176 | public static void setVsync(string setBool)
177 | {
178 | vsync = setBool;
179 | }
180 |
181 | public static void setResolutionX(string xRes)
182 | {
183 | resolutionX = xRes;
184 | }
185 |
186 | public static void setResolutionY(string yRes)
187 | {
188 | resolutionY = yRes;
189 | }
190 |
191 | public static void setDetailMode(string detMode)
192 | {
193 | detailMode = detMode;
194 | }
195 |
196 | public static void setMultiSampling(string msample)
197 | {
198 | multiSampling = msample;
199 | }
200 |
201 | public static void setDepthOfField(string setBool)
202 | {
203 | depthOfField = setBool;
204 | }
205 |
206 | public static void setShadowSlope(string slope)
207 | {
208 | shadowslope = slope;
209 | }
210 |
211 | public static void setAmbientOcclusion(string setBool)
212 | {
213 | ambientOcclusion = setBool;
214 | }
215 |
216 | public static void setLensFlares(string setBool)
217 | {
218 | lensFlares = setBool;
219 | }
220 |
221 | public static void setMotionBlur(string setBool)
222 | {
223 | motionBlur = setBool;
224 | }
225 |
226 | public static void setBloom(string setBool)
227 | {
228 | bloom = setBool;
229 | }
230 |
231 | public static void setHighQualityBloom(string setBool)
232 | {
233 | highQualityBloom = setBool;
234 | }
235 |
236 | public static void setMaxAnisotropy(string maxani)
237 | {
238 | maxAnisotropy = maxani;
239 | }
240 |
241 | public static void setDynamicShadows(string setBool)
242 | {
243 | dynamicShadows = setBool;
244 | }
245 |
246 | public static void setMaxShadowResolution(string maxshadowRes)
247 | {
248 | maxShadowResolution = maxshadowRes;
249 | }
250 |
251 | public static void setShadowFilterRadius(string shadowfradius)
252 | {
253 | shadowFilterRadius = shadowfradius;
254 | }
255 |
256 | public static void setMaxSmoothedFramerate(string maxsmoothframes)
257 | {
258 | maxSmoothedFramerate = maxsmoothframes;
259 | }
260 |
261 | public static void setDisableSphericalHarmonicLights(string newLine)
262 | {
263 | disableSphericalHarmonicLights = newLine;
264 | }
265 |
266 | public static void setFogVolumes(string newLine)
267 | {
268 | fogVolumes = newLine;
269 | }
270 |
271 | public static void setDistortion(string newLine)
272 | {
273 | distortion = newLine;
274 | }
275 |
276 | public static void setShadowTexels(string newLine)
277 | {
278 | shadowTexels = newLine;
279 | }
280 |
281 | public static void setPhysX(string newLine)
282 | {
283 | physX = newLine;
284 | }
285 |
286 | public static void setMemoryPoolsValue(string newLine)
287 | {
288 | memoryPoolsValue = newLine;
289 | }
290 |
291 | public static void setFrameThreadLag(string newLine)
292 | {
293 | frameThreadLag = newLine;
294 | }
295 | }
296 | }
--------------------------------------------------------------------------------
/data/GraphicsWriter.cs:
--------------------------------------------------------------------------------
1 | using BmLauncherAsylumNET6.infrastructure;
2 | using NLog;
3 | using NvAPIWrapper.Native.Exceptions;
4 |
5 | namespace BmLauncherAsylumNET6.data
6 | {
7 | ///
8 | /// Helper Class for Graphics. Used to change parameters in Graphics class in accordance with user input.
9 | ///
10 | internal class GraphicsWriter
11 | {
12 | // logger for easy debugging
13 | private static readonly Logger logger = LogManager.GetCurrentClassLogger();
14 |
15 | private static bool isHbao;
16 |
17 | public void writeAll()
18 | {
19 | setLang();
20 | setAAMode();
21 | setAO();
22 | setAnisotropy();
23 | setBloom();
24 | setBlur();
25 | setDOF();
26 | setDetailMode();
27 | setDist();
28 | setDynamicShadows();
29 | setFogVolumes();
30 | setFullScreen();
31 | try
32 | {
33 | setHbaoPlus();
34 | }
35 | catch (FileNotFoundException e)
36 | {
37 | logger.Warn(
38 | "writeAll - could not call setHbaoPlus() - This is fine if you're not using an NVIDIA GPU. Exception: {0}",
39 | e);
40 | }
41 |
42 | setLensFlares();
43 | setMaxShadowRes();
44 | setMaxSmoothedFrames();
45 | setMemoryPools();
46 | setPhysX();
47 | setRes();
48 | setShadowTexels();
49 | setSphericalHarmonic();
50 | setVsync();
51 | setThreadLag();
52 | logger.Debug("writeAll - saved all Graphics parameters to their assigned values.");
53 | }
54 |
55 | private static void setRes()
56 | {
57 | Object selectedRes = Program.Client.resBox.SelectedItem;
58 | string resX = selectedRes.ToString().Substring(0, selectedRes.ToString().LastIndexOf("x"));
59 | string resY = selectedRes.ToString().Substring(selectedRes.ToString().LastIndexOf("x") + 1);
60 |
61 | Graphics.setResolutionX(resX);
62 | Graphics.setResolutionY(resY);
63 | logger.Debug("setRes - set resolution to {0}x{1}", resX, resY);
64 | }
65 |
66 | private static void setLang()
67 | {
68 | int caseValue = Program.Client.langBox.SelectedIndex;
69 | switch (caseValue)
70 | {
71 | case 0:
72 | Graphics.setLanguage("int");
73 | break;
74 |
75 | case 1:
76 | Graphics.setLanguage("deu");
77 | break;
78 |
79 | case 2:
80 | Graphics.setLanguage("fra");
81 | break;
82 |
83 | case 3:
84 | Graphics.setLanguage("ita");
85 | break;
86 |
87 | case 4:
88 | Graphics.setLanguage("esn");
89 | break;
90 |
91 | default:
92 | Graphics.setLanguage("nochange");
93 | break;
94 | }
95 |
96 | logger.Debug("setLang - set language to {0}", Graphics.getLanguage());
97 | }
98 |
99 | private static void setFullScreen()
100 | {
101 | Graphics.setFullScreen(Program.Client.fullscreenBox.SelectedIndex == 0 ? "False" : "True");
102 | logger.Debug("setFullScreen - set fullscreen to {0}", Graphics.isFullScreen());
103 | }
104 |
105 | private static void setVsync()
106 | {
107 | Graphics.setVsync(Program.Client.vsyncBox.SelectedIndex == 0 ? "False" : "True");
108 | logger.Debug("setVsync - set vsync to {0}", Graphics.isVsync());
109 | }
110 |
111 | private static void setFogVolumes()
112 | {
113 | Graphics.setFogVolumes(Program.Client.fogBox.SelectedIndex == 0 ? "False" : "True");
114 | logger.Debug("setFogVolumes - set fog volumes to {0}", Graphics.isFogVolumes());
115 | }
116 |
117 | private static void setBloom()
118 | {
119 | if (Program.Client.bloomBox.SelectedIndex == 0)
120 | {
121 | Graphics.setBloom("False");
122 | Graphics.setHighQualityBloom("False");
123 | }
124 | else
125 | {
126 | Graphics.setBloom("True");
127 | Graphics.setHighQualityBloom("True");
128 | }
129 |
130 | logger.Debug("setBloom - set bloom to {0}", Graphics.isBloom());
131 | }
132 |
133 | private static void setLensFlares()
134 | {
135 | Graphics.setLensFlares(Program.Client.lensFlareBox.SelectedIndex == 0 ? "False" : "True");
136 | logger.Debug("setLensFlares - set lens flares to {0}", Graphics.isLensFlares());
137 | }
138 |
139 | private static void setDOF()
140 | {
141 | Graphics.setDepthOfField(Program.Client.dofBox.SelectedIndex == 0 ? "False" : "True");
142 | logger.Debug("setDOF - set depth of field to {0}", Graphics.isDepthOfField());
143 | }
144 |
145 | private static void setDist()
146 | {
147 | Graphics.setDistortion(Program.Client.distBox.SelectedIndex == 0 ? "False" : "True");
148 | logger.Debug("setDist - set distortion to {0}", Graphics.isDistortion());
149 | }
150 |
151 | private static void setBlur()
152 | {
153 | Graphics.setMotionBlur(Program.Client.mBlurBox.SelectedIndex == 0 ? "False" : "True");
154 | logger.Debug("setBlur - set motion blur to {0}", Graphics.isMotionBlur());
155 | }
156 |
157 | private static void setAO()
158 | {
159 | if ((Program.Client.aoBox.SelectedIndex == 0 && Program.Client.aoBox.Enabled) ||
160 | !Program.Client.aoBox.Enabled)
161 | {
162 | Graphics.setAmbientOcclusion("False");
163 | }
164 | else
165 | {
166 | Graphics.setAmbientOcclusion("True");
167 | }
168 |
169 | logger.Debug("setAO - set ambient occlusion to {0}", Graphics.isAmbientOcclusion());
170 | }
171 |
172 | private static void setSphericalHarmonic()
173 | {
174 | Graphics.setDisableSphericalHarmonicLights(Program.Client.sphericBox.SelectedIndex == 0 ? "True" : "False");
175 | logger.Debug("setSphericalHarmonic - set disable spherical harmonic lights to {0}",
176 | Graphics.isDisableSphericalHarmonicLights());
177 | }
178 |
179 | private static void setDynamicShadows()
180 | {
181 | Graphics.setDynamicShadows(Program.Client.dShadowBox.SelectedIndex == 0 ? "False" : "True");
182 | logger.Debug("setDynamicShadows - set dynamic shadows to {0}", Graphics.isDynamicShadows());
183 | }
184 |
185 | private static void setHbaoPlus()
186 | {
187 | if (!Program.Client.gpInfoLabel.Text.Contains("NVIDIA") || WineChecker.IsWine())
188 | {
189 | return;
190 | }
191 |
192 | try
193 | {
194 | Program.NvWorker.setNVSettings();
195 | }
196 | catch (NVIDIANotSupportedException e)
197 | {
198 | logger.Warn("setHbaoPlus - Caught NVIDIANotSupportedException: {0}", e);
199 | return;
200 | }
201 |
202 | if (NvidiaWorker.HasHbao || !Program.Client.nvBox.Checked || isHbao)
203 | {
204 | return;
205 | }
206 |
207 | Program.MyFactory.ExecNvSetter();
208 | isHbao = true;
209 | }
210 |
211 | private static void setMaxSmoothedFrames()
212 | {
213 | if (Program.Client.maxSmoothTextBox.Text.Trim().Equals("") ||
214 | Int16.Parse(Program.Client.maxSmoothTextBox.Text.Trim()) < 25)
215 | {
216 | Program.Client.maxSmoothTextBox.Text = @"62";
217 | Graphics.setMaxSmoothedFramerate("62.000000");
218 | }
219 | else
220 | {
221 | int framecap = Int32.Parse(Program.Client.maxSmoothTextBox.Text.Trim());
222 | framecap += 2;
223 | Graphics.setMaxSmoothedFramerate(framecap + ".000000");
224 | }
225 |
226 | logger.Debug("setMaxSmoothedFrames - set max smoothed frames to {0}", Graphics.getMaxSmoothedFramerate());
227 | }
228 |
229 | private static void setDetailMode()
230 | {
231 | int caseValue = Program.Client.detailBox.SelectedIndex;
232 |
233 | switch (caseValue)
234 | {
235 | case 0:
236 | Graphics.setDetailMode("0");
237 | break;
238 |
239 | case 1:
240 | Graphics.setDetailMode("1");
241 | break;
242 |
243 | case 2:
244 | Graphics.setDetailMode("2");
245 | break;
246 | }
247 |
248 | logger.Debug("setDetailMode - set detail mode to {0}", Graphics.getDetailMode());
249 | }
250 |
251 | private static void setAAMode()
252 | {
253 | int caseValue = Program.Client.aaBox.SelectedIndex;
254 |
255 | switch (caseValue)
256 | {
257 | case 0:
258 | Graphics.setMultiSampling("1");
259 | break;
260 |
261 | case 1:
262 | Graphics.setMultiSampling("2");
263 | break;
264 |
265 | case 2:
266 | Graphics.setMultiSampling("4");
267 | break;
268 |
269 | case 3:
270 | Graphics.setMultiSampling("10");
271 | break;
272 | }
273 |
274 | logger.Debug("setAAMode - set multisampling mode to {0}", Graphics.getMultiSampling());
275 | }
276 |
277 | private static void setAnisotropy()
278 | {
279 | int caseValue = Program.Client.anisoBox.SelectedIndex;
280 |
281 | switch (caseValue)
282 | {
283 | case 0:
284 | Graphics.setMaxAnisotropy("4");
285 | break;
286 |
287 | case 1:
288 | Graphics.setMaxAnisotropy("8");
289 | break;
290 |
291 | case 2:
292 | Graphics.setMaxAnisotropy("16");
293 | break;
294 | }
295 |
296 | logger.Debug("setAnisotropy - set anisotropy to {0}", Graphics.getMaxAnisotropy());
297 | }
298 |
299 | private static void setMemoryPools()
300 | {
301 | int caseValue = Program.Client.memPoolBox.SelectedIndex;
302 |
303 | switch (caseValue)
304 | {
305 | case 0:
306 | Graphics.setMemoryPoolsValue("512");
307 | break;
308 |
309 | case 1:
310 | Graphics.setMemoryPoolsValue("1024");
311 | break;
312 |
313 | case 2:
314 | Graphics.setMemoryPoolsValue("2048");
315 | break;
316 |
317 | case 3:
318 | Graphics.setMemoryPoolsValue("3072");
319 | break;
320 |
321 | case 4:
322 | Graphics.setMemoryPoolsValue("4096");
323 | break;
324 |
325 | case 5:
326 | Graphics.setMemoryPoolsValue("0");
327 | break;
328 | }
329 |
330 | logger.Debug("setMemoryPools - set memory pools to {0}", Graphics.getMemoryPoolsValue());
331 | }
332 |
333 | private static void setShadowTexels()
334 | {
335 | int caseValue = Program.Client.texelBox.SelectedIndex;
336 |
337 | switch (caseValue)
338 | {
339 | case 0:
340 | Graphics.setShadowTexels("0.012000");
341 | break;
342 |
343 | case 1:
344 | Graphics.setShadowTexels("0.008000");
345 | break;
346 |
347 | case 2:
348 | Graphics.setShadowTexels("0.008000");
349 | break;
350 |
351 | case 3:
352 | Graphics.setShadowTexels("0.002000");
353 | break;
354 | }
355 |
356 | logger.Debug("setShadowTexels - set shadow depth bias to {0}", Graphics.getShadowTexels());
357 | }
358 |
359 | private static void setMaxShadowRes()
360 | {
361 | int caseValue = Program.Client.maxShadowBox.SelectedIndex;
362 |
363 | switch (caseValue)
364 | {
365 | case 0:
366 | Graphics.setMaxShadowResolution("512");
367 | break;
368 |
369 | case 1:
370 | Graphics.setMaxShadowResolution("1024");
371 | break;
372 |
373 | case 2:
374 | Graphics.setMaxShadowResolution("2048");
375 | break;
376 |
377 | case 3:
378 | Graphics.setMaxShadowResolution("4096");
379 | break;
380 | }
381 |
382 | logger.Debug("setMaxShadowRes - set max shadow resolution to {0}", Graphics.getMaxShadowResolution());
383 | }
384 |
385 | private static void setPhysX()
386 | {
387 | int caseValue = Program.Client.physxBox.SelectedIndex;
388 |
389 | switch (caseValue)
390 | {
391 | case 0:
392 | Graphics.setPhysX("0");
393 | break;
394 |
395 | case 1:
396 | Graphics.setPhysX("1");
397 | break;
398 |
399 | case 2:
400 | Graphics.setPhysX("2");
401 | break;
402 | }
403 |
404 | logger.Debug("setPhysX - set physx to {0}", Graphics.getPhysX());
405 | }
406 |
407 | private static void setThreadLag()
408 | {
409 | Graphics.setFrameThreadLag(Program.Client.frameCheckBox.Checked ? "True" : "False");
410 | logger.Debug("setThreadLag - set frame thread lag to {0}", Graphics.getFrameThreadLag());
411 | }
412 | }
413 | }
--------------------------------------------------------------------------------
/data/GuiInitializer.cs:
--------------------------------------------------------------------------------
1 | using BmLauncherAsylumNET6.infrastructure;
2 | using NLog;
3 | using NvAPIWrapper.Native.Exceptions;
4 |
5 | namespace BmLauncherAsylumNET6.data
6 | {
7 | ///
8 | /// Graphics helper class. Initializes the GUI with correct values from BmEngine file
9 | ///
10 | internal class GuiInitializer
11 | {
12 | // logger for easy debugging
13 | private static readonly Logger logger = LogManager.GetCurrentClassLogger();
14 |
15 | public void init()
16 | {
17 | // all false/true values
18 | Program.Client.fullscreenBox.SelectedIndex =
19 | Graphics.isFullScreen().Equals("False", StringComparison.InvariantCultureIgnoreCase) ? 0 : 1;
20 | logger.Debug("init - initialized fullscreen as {0}", Graphics.isFullScreen());
21 | Program.Client.vsyncBox.SelectedIndex =
22 | Graphics.isVsync().Equals("False", StringComparison.InvariantCultureIgnoreCase) ? 0 : 1;
23 | logger.Debug("init - initialized vsync as {0}", Graphics.isVsync());
24 |
25 | Program.Client.dofBox.SelectedIndex =
26 | Graphics.isDepthOfField().Equals("False", StringComparison.InvariantCultureIgnoreCase) ? 0 : 1;
27 | logger.Debug("init - initialized depth of field as {0}", Graphics.isDepthOfField());
28 |
29 | Program.Client.aoBox.SelectedIndex =
30 | Graphics.isAmbientOcclusion().Equals("False", StringComparison.InvariantCultureIgnoreCase) ? 0 : 1;
31 | logger.Debug("init - initialized ambient occlusion as {0}", Graphics.isAmbientOcclusion());
32 |
33 | Program.Client.lensFlareBox.SelectedIndex =
34 | Graphics.isLensFlares().Equals("False", StringComparison.InvariantCultureIgnoreCase) ? 0 : 1;
35 | logger.Debug("init - initialized lens flares as {0}", Graphics.isLensFlares());
36 |
37 | Program.Client.mBlurBox.SelectedIndex =
38 | Graphics.isMotionBlur().Equals("False", StringComparison.InvariantCultureIgnoreCase) ? 0 : 1;
39 | logger.Debug("init - initialized motion blur as {0}", Graphics.isMotionBlur());
40 |
41 | Program.Client.bloomBox.SelectedIndex =
42 | Graphics.isBloom().Equals("False", StringComparison.InvariantCultureIgnoreCase) ? 0 : 1;
43 | logger.Debug("init - initialized bloom as {0}", Graphics.isBloom());
44 |
45 | Program.Client.dShadowBox.SelectedIndex =
46 | Graphics.isDynamicShadows().Equals("False", StringComparison.InvariantCultureIgnoreCase) ? 0 : 1;
47 | logger.Debug("init - initialized dynamic shadows as {0}", Graphics.isDynamicShadows());
48 |
49 | Program.Client.sphericBox.SelectedIndex = Graphics.isDisableSphericalHarmonicLights()
50 | .Equals("True", StringComparison.InvariantCultureIgnoreCase)
51 | ? 0
52 | : 1;
53 | logger.Debug("init - initialized disable spherical harmonic lights as {0}",
54 | Graphics.isDisableSphericalHarmonicLights());
55 |
56 | Program.Client.fogBox.SelectedIndex =
57 | Graphics.isFogVolumes().Equals("False", StringComparison.InvariantCultureIgnoreCase) ? 0 : 1;
58 | logger.Debug("init - initialized fog volumes as {0}", Graphics.isFogVolumes());
59 |
60 | Program.Client.distBox.SelectedIndex =
61 | Graphics.isDistortion().Equals("False", StringComparison.InvariantCultureIgnoreCase) ? 0 : 1;
62 | logger.Debug("init - initialized distortion as {0}", Graphics.isDistortion());
63 |
64 | Program.Client.frameCheckBox.Checked = Graphics.getFrameThreadLag().Equals("True");
65 | logger.Debug("init - initialized frame thread lag as {0}", Graphics.getFrameThreadLag());
66 |
67 | // everything else
68 | initLang();
69 | initAA();
70 | initPhysx();
71 | initAnisotropy();
72 | initDetailmode();
73 | initShadowTexels();
74 | initShadowRes();
75 | initMaxSmoothedFrames();
76 | initMemoryPoolsValue();
77 | initResolutions();
78 | try
79 | {
80 | initHBAONVIDIA();
81 | }
82 | catch (FileNotFoundException e)
83 | {
84 | Program.Client.amdToolTip.Active = true;
85 | Program.Client.amdToolTip.ShowAlways = true;
86 | Program.Client.nvBox.Enabled = false;
87 | logger.Warn(
88 | "init - could not call initHBAONVIDIA() - This is fine if you're not using an NVIDIA GPU. Exception: {0}",
89 | e);
90 | }
91 |
92 | logger.Info("init - initialized all values to the gui.");
93 | }
94 |
95 | private static void initLang()
96 | {
97 | Program.Client.langBox.SelectedIndex = Graphics.getLanguage() switch
98 | {
99 | "int" => 0,
100 | "deu" => 1,
101 | "fra" => 2,
102 | "ita" => 3,
103 | "esn" => 4,
104 | _ => Program.Client.langBox.Items.Add("Unofficial"),
105 | };
106 | logger.Debug("initLang - initialized language as {0}", Graphics.getLanguage());
107 | }
108 |
109 | private static void initAA()
110 | {
111 | switch (Int16.Parse(Graphics.getMultiSampling()))
112 | {
113 | case 1:
114 | Program.Client.aaBox.SelectedIndex = 0;
115 | break;
116 |
117 | case 2:
118 | Program.Client.aaBox.SelectedIndex = 1;
119 | break;
120 |
121 | case 4:
122 | Program.Client.aaBox.SelectedIndex = 2;
123 | break;
124 |
125 | case 10:
126 | Program.Client.aaBox.SelectedIndex = 3;
127 | break;
128 | }
129 |
130 | logger.Debug("initAA - initialized multisampling as {0}", Graphics.getMultiSampling());
131 | }
132 |
133 | private static void initPhysx()
134 | {
135 | switch (Int16.Parse(Graphics.getPhysX()))
136 | {
137 | case 0:
138 | Program.Client.physxBox.SelectedIndex = 0;
139 | break;
140 |
141 | case 1:
142 | Program.Client.physxBox.SelectedIndex = 1;
143 | break;
144 |
145 | case 2:
146 | Program.Client.physxBox.SelectedIndex = 2;
147 | break;
148 | }
149 |
150 | logger.Debug("initPhysx - initialized physx as {0}", Graphics.getPhysX());
151 | }
152 |
153 | private static void initAnisotropy()
154 | {
155 | switch (Int16.Parse(Graphics.getMaxAnisotropy()))
156 | {
157 | case 4:
158 | Program.Client.anisoBox.SelectedIndex = 0;
159 | break;
160 |
161 | case 8:
162 | Program.Client.anisoBox.SelectedIndex = 1;
163 | break;
164 |
165 | case 16:
166 | Program.Client.anisoBox.SelectedIndex = 2;
167 | break;
168 | }
169 |
170 | logger.Debug("initAnisotropy - initialized max anisotropy as {0}", Graphics.getMaxAnisotropy());
171 | }
172 |
173 | private static void initDetailmode()
174 | {
175 | switch (Int16.Parse(Graphics.getDetailMode()))
176 | {
177 | case 0:
178 | Program.Client.detailBox.SelectedIndex = 0;
179 | break;
180 |
181 | case 1:
182 | Program.Client.detailBox.SelectedIndex = 1;
183 | break;
184 |
185 | case 2:
186 | Program.Client.detailBox.SelectedIndex = 2;
187 | break;
188 | }
189 |
190 | logger.Debug("initDetailmode - initialized detail mode as {0}", Graphics.getDetailMode());
191 | }
192 |
193 | private static void initShadowTexels()
194 | {
195 | switch (Graphics.getShadowTexels())
196 | {
197 | case "0.012000":
198 | Program.Client.texelBox.SelectedIndex = 0;
199 | break;
200 |
201 | case "0.008000":
202 | Program.Client.texelBox.SelectedIndex = Graphics.getShadowSlope() == "10.000000" ? 1 : 2;
203 |
204 | break;
205 |
206 | case "0.002000":
207 | Program.Client.texelBox.SelectedIndex = 3;
208 | break;
209 | }
210 |
211 | logger.Debug("initShadowTexels - initialized shadow depth bias as {0}", Graphics.getShadowTexels());
212 | }
213 |
214 | private static void initShadowRes()
215 | {
216 | switch (Int16.Parse(Graphics.getMaxShadowResolution()))
217 | {
218 | case 512:
219 | Program.Client.maxShadowBox.SelectedIndex = 0;
220 | Program.Client.texelBox.SelectedIndex = 0;
221 | Program.Client.texelBox.Enabled = false;
222 | break;
223 |
224 | case 1024:
225 | Program.Client.maxShadowBox.SelectedIndex = 1;
226 | Program.Client.texelBox.SelectedIndex = 0;
227 | Program.Client.texelBox.Enabled = false;
228 | break;
229 |
230 | case 2048:
231 | Program.Client.maxShadowBox.SelectedIndex = 2;
232 | break;
233 |
234 | case 4096:
235 | Program.Client.maxShadowBox.SelectedIndex = 3;
236 | break;
237 | }
238 |
239 | logger.Debug("initShadowRes - initialized max shadow resolution as {0}", Graphics.getMaxShadowResolution());
240 | }
241 |
242 | private static void initMaxSmoothedFrames()
243 | {
244 | int framecap = Int32.Parse(Graphics.getMaxSmoothedFramerate()
245 | .Substring(0, Graphics.getMaxSmoothedFramerate().LastIndexOf(".")));
246 | framecap -= 2;
247 | Program.Client.maxSmoothTextBox.Text = framecap.ToString();
248 | logger.Debug("initLang - initialized framerate cap as {0}", Graphics.getMaxSmoothedFramerate());
249 | }
250 |
251 | private static void initMemoryPoolsValue()
252 | {
253 | switch (Int16.Parse(Graphics.getMemoryPoolsValue()))
254 | {
255 | case 0:
256 | Program.Client.memPoolBox.SelectedIndex = 5;
257 | break;
258 |
259 | case 512:
260 | Program.Client.memPoolBox.SelectedIndex = 0;
261 | break;
262 |
263 | case 1024:
264 | Program.Client.memPoolBox.SelectedIndex = 1;
265 | break;
266 |
267 | case 2048:
268 | Program.Client.memPoolBox.SelectedIndex = 2;
269 | break;
270 |
271 | case 3072:
272 | Program.Client.memPoolBox.SelectedIndex = 3;
273 | break;
274 |
275 | case 4096:
276 | Program.Client.memPoolBox.SelectedIndex = 4;
277 | break;
278 | }
279 |
280 | logger.Debug("initMemoryPoolsValue - initialized memory pools value as {0}",
281 | Graphics.getMemoryPoolsValue());
282 | }
283 |
284 | private static void initResolutions()
285 | {
286 | foreach (string resolution in SysResolutions.ResolutionList)
287 | {
288 | Program.Client.resBox.Items.Add(resolution);
289 | }
290 |
291 | string myResolution = Graphics.getResolutionX() + "x" + Graphics.getResolutionY();
292 |
293 | foreach (string res in Program.Client.resBox.Items)
294 | {
295 | if (!res.Equals(myResolution))
296 | {
297 | continue;
298 | }
299 |
300 | Program.Client.resBox.SelectedIndex = Program.Client.resBox.Items.IndexOf(res);
301 | }
302 |
303 | logger.Debug("initResolutions - initialized resolution as {0}x{1}", Graphics.getResolutionX(),
304 | Graphics.getResolutionY());
305 | }
306 |
307 | ///
308 | /// Initializes NVIDIA component, only if NVIDIA card is found.
309 | /// Sets displayed tooltips accordingly.
310 | ///
311 | private static void initHBAONVIDIA()
312 | {
313 | if (!Program.Client.gpInfoLabel.Text.Contains("NVIDIA"))
314 | {
315 | Program.Client.amdToolTip.Active = true;
316 | Program.Client.amdToolTip.ShowAlways = true;
317 | Program.Client.nvBox.Enabled = false;
318 | logger.Debug("initHBAONVIDIA - initialized hbao+ possibility as false.");
319 | return;
320 | }
321 |
322 | if (Program.Client.gpInfoLabel.Text.Contains("NVIDIA") && !WineChecker.IsWine())
323 | {
324 | try
325 | {
326 | Program.NvWorker = new NvidiaWorker();
327 | Program.Client.nvBox.Enabled = true;
328 | Program.Client.nvidiaToolTip.Active = true;
329 | logger.Debug("initHBAONVIDIA - initialized hbao+ possibility as true.");
330 | }
331 | catch (NVIDIANotSupportedException e)
332 | {
333 | logger.Warn("initHBAONVIDIA - Caught NVIDIANotSupportedException: {0}", e);
334 | Program.Client.nvBox.Enabled = false;
335 | }
336 | }
337 | else if (Program.Client.gpInfoLabel.Text.Contains("NVIDIA"))
338 | {
339 | Program.Client.nvBox.Enabled = false;
340 | Program.Client.nvidiaToolTip.Active = true;
341 | logger.Debug(
342 | "initHBAONVIDIA - initialized hbao+ possibility as false. You're using an NVIDIA card on a Linux machine.");
343 | }
344 | }
345 | }
346 | }
--------------------------------------------------------------------------------
/data/Presets.cs:
--------------------------------------------------------------------------------
1 | namespace BmLauncherAsylumNET6.data
2 | {
3 | ///
4 | /// Simple Class to store values for the presets.
5 | ///
6 | internal static class Presets
7 | {
8 | private static void setCommon()
9 | {
10 | Program.Client.detailBox.SelectedIndex = 2;
11 | Program.Client.fogBox.SelectedIndex = 1;
12 | Program.Client.anisoBox.SelectedIndex = 2;
13 | Program.Client.aoBox.SelectedIndex = 0;
14 | Program.Client.sphericBox.SelectedIndex = 1;
15 | Program.Client.bloomBox.SelectedIndex = 1;
16 | Program.Client.lensFlareBox.SelectedIndex = 1;
17 | Program.Client.dShadowBox.SelectedIndex = 1;
18 | Program.Client.dofBox.SelectedIndex = 1;
19 | Program.Client.distBox.SelectedIndex = 1;
20 | }
21 |
22 | public static void setUltra()
23 | {
24 | setCommon();
25 | Program.Client.aaBox.SelectedIndex = 0;
26 | Program.Client.maxShadowBox.SelectedIndex = 2;
27 | Program.Client.texelBox.SelectedIndex = 0;
28 | Program.Client.physxBox.SelectedIndex = Program.Client.gpInfoLabel.Text.Contains("NVIDIA") ? 1 : 0;
29 | Program.Client.memPoolBox.SelectedIndex = 2;
30 | if (Program.Client.gpInfoLabel.Text.Contains("NVIDIA") && Program.Client.nvBox.Enabled)
31 | {
32 | Program.Client.nvBox.Checked = true;
33 | }
34 | }
35 |
36 | public static void setOptimized()
37 | {
38 | setCommon();
39 | Program.Client.aaBox.SelectedIndex = 0;
40 | Program.Client.maxShadowBox.SelectedIndex = 1;
41 | Program.Client.memPoolBox.SelectedIndex = 2;
42 | Program.Client.texelBox.SelectedIndex = 0;
43 | Program.Client.physxBox.SelectedIndex = 0;
44 | if (Program.Client.gpInfoLabel.Text.Contains("NVIDIA") && Program.Client.nvBox.Enabled)
45 | {
46 | Program.Client.nvBox.Checked = false;
47 | }
48 | }
49 |
50 | public static void setReborn()
51 | {
52 | setCommon();
53 | Program.Client.aaBox.SelectedIndex = 0;
54 | Program.Client.maxShadowBox.SelectedIndex = 3;
55 | Program.Client.texelBox.SelectedIndex = 1;
56 | Program.Client.physxBox.SelectedIndex = Program.Client.gpInfoLabel.Text.Contains("NVIDIA") ? 1 : 0;
57 | if (Program.Client.gpInfoLabel.Text.Contains("NVIDIA") && Program.Client.nvBox.Enabled)
58 | {
59 | Program.Client.nvBox.Checked = true;
60 | }
61 |
62 | Program.Client.dofBox.SelectedIndex = 0;
63 | Program.Client.memPoolBox.SelectedIndex = 3;
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/data/WineChecker.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace BmLauncherAsylumNET6.data
5 | {
6 | internal static class WineChecker
7 | {
8 | private static readonly Logger logger = LogManager.GetCurrentClassLogger();
9 |
10 | public static bool IsWine()
11 | {
12 | try
13 | {
14 | logger.Info("IsWine - Wine detected. Version: {0}", GetWineVersion());
15 | return true;
16 | }
17 | catch (EntryPointNotFoundException e)
18 | {
19 | logger.Warn(
20 | "IsWine - Wine not found. (Windows Users can ignore this.).\r\nEntryPointNotFoundException: {0}",
21 | e);
22 | return false;
23 | }
24 | }
25 |
26 | [DllImport("ntdll.dll", EntryPoint = "wine_get_version", CallingConvention = CallingConvention.Cdecl,
27 | CharSet = CharSet.Ansi)]
28 | private static extern string GetWineVersion();
29 | }
30 | }
--------------------------------------------------------------------------------
/infrastructure/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace BmLauncherAsylumNET6.infrastructure
4 | {
5 | ///
6 | /// Wrapper Class for Win32 parameters. Used to ensure only one instance of this Application is active.
7 | ///
8 | internal class NativeMethods
9 | {
10 | public const int HwndBroadcast = 0xffff;
11 | public static readonly int WmShowme = RegisterWindowMessage("WM_SHOWME");
12 |
13 | [DllImport("user32")]
14 | public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);
15 |
16 | [DllImport("user32")]
17 | public static extern int RegisterWindowMessage(string message);
18 | }
19 | }
--------------------------------------------------------------------------------
/infrastructure/NvidiaWorker.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using NvAPIWrapper;
3 | using NvAPIWrapper.DRS;
4 | using NvAPIWrapper.Native.Exceptions;
5 |
6 | namespace BmLauncherAsylumNET6.infrastructure
7 | {
8 | ///
9 | /// Worker class utilizing the Nvidia API through NvAPIWrapper.
10 | /// Used to find Arkham Asylum NVIDIA profile and modify it.
11 | ///
12 | internal class NvidiaWorker
13 | {
14 | // logger for easy debugging
15 | private static readonly Logger logger = LogManager.GetCurrentClassLogger();
16 |
17 | private static string aoActive = "0";
18 | private static string aoValue = "0";
19 |
20 | public static bool HasHbao = true;
21 | private readonly DriverSettingsProfile _prof;
22 | private readonly DriverSettingsSession _session;
23 |
24 | ///
25 | /// Created in Program, instantiated by GuiInitializer.
26 | /// Finds the Batman: Arkham Asylum Profile or creates it if it doesn't exist yet.
27 | /// Calls getNVSettings().
28 | ///
29 | public NvidiaWorker()
30 | {
31 | try
32 | {
33 | NVIDIA.Initialize();
34 | logger.Debug("Constructor - NVIDIA API initialized.");
35 | _session = DriverSettingsSession.CreateAndLoad();
36 | try
37 | {
38 | _session.FindProfileByName("Batman: Arkham Asylum");
39 | }
40 | catch (NVIDIAApiException e)
41 | {
42 | Console.WriteLine(e);
43 | DriverSettingsProfile profile =
44 | DriverSettingsProfile.CreateProfile(_session, "Batman: Arkham Asylum");
45 | ProfileApplication profApp = ProfileApplication.CreateApplication(profile, "shippingpc-bmgame.exe");
46 | profile = profApp.Profile;
47 | profile.SetSetting(KnownSettingId.AmbientOcclusionModeActive, 0);
48 | profile.SetSetting(KnownSettingId.AmbientOcclusionMode, 0);
49 | _session.Save();
50 | logger.Warn("Constructor - NVIDIA profile not found. Creating profile: {0}", profile.ToString());
51 | }
52 |
53 | _prof = _session.FindProfileByName("Batman: Arkham Asylum");
54 | getNVSettings();
55 | logger.Info("Constructor - NVIDIA profile fully processed.");
56 | }
57 | catch (NVIDIANotSupportedException e)
58 | {
59 | NVIDIA.Initialize();
60 | Program.Client.nvBox.Enabled = false;
61 | logger.Warn("Constructor - Caught NVIDIANotSupportedException: {0}.", e);
62 | }
63 | }
64 |
65 | ///
66 | /// Sets NVIDIA settings in accordance to user input.
67 | /// Called by GraphicsWriter.
68 | ///
69 | public void setNVSettings()
70 | {
71 | try
72 | {
73 | if (Program.Client.nvBox.Checked && Program.Client.nvBox.Enabled)
74 | {
75 | _prof.SetSetting(KnownSettingId.AmbientOcclusionModeActive, 1);
76 | _prof.SetSetting(KnownSettingId.AmbientOcclusionMode, 2);
77 | _session.Save();
78 | }
79 | else if (Program.Client.nvBox.Enabled)
80 | {
81 | _prof.SetSetting(KnownSettingId.AmbientOcclusionModeActive, 0);
82 | _prof.SetSetting(KnownSettingId.AmbientOcclusionMode, 0);
83 | _session.Save();
84 | }
85 |
86 | logger.Debug(
87 | "setNVSettings - setting AmbientOcclusionModeActive to {0}, setting AmbientOcclusionMode to {1}",
88 | _prof.GetSetting(KnownSettingId.AmbientOcclusionModeActive).CurrentValue,
89 | _prof.GetSetting(KnownSettingId.AmbientOcclusionMode).CurrentValue);
90 | }
91 | catch (NullReferenceException e)
92 | {
93 | logger.Warn("setNVSettings - Caught NullReferenceException: {0}", e);
94 | }
95 | }
96 |
97 | ///
98 | /// Gets the current NVIDIA settings from the profile.
99 | /// Adjusts checkbox accordingly.
100 | ///
101 | public void getNVSettings()
102 | {
103 | Int16 compValue = 0;
104 | try
105 | {
106 | aoActive = _prof.GetSetting(KnownSettingId.AmbientOcclusionModeActive).ToString();
107 | aoValue = _prof.GetSetting(KnownSettingId.AmbientOcclusionMode).ToString();
108 | compValue = Int16.Parse(_prof.GetSetting(2916165).CurrentValue.ToString());
109 | }
110 | catch (Exception)
111 | {
112 | _prof.SetSetting(KnownSettingId.AmbientOcclusionModeActive, 0);
113 | _prof.SetSetting(KnownSettingId.AmbientOcclusionMode, 0);
114 | Program.Client.nvBox.Checked = false;
115 | logger.Warn(
116 | "getNVSettings - couldn't find ambient occlusion settings. Generating settings with default(0) values now.");
117 | }
118 |
119 | if (!aoActive.Contains("1") || !aoValue.Contains("2") || compValue != 48)
120 | {
121 | if (compValue != 48)
122 | {
123 | HasHbao = false;
124 | }
125 | }
126 | else
127 | {
128 | Program.Client.nvBox.Checked = true;
129 | }
130 |
131 | logger.Debug("getNVSettings - hbao+ is currently {0}", HasHbao);
132 | }
133 | }
134 | }
--------------------------------------------------------------------------------
/infrastructure/SysResolutions.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace BmLauncherAsylumNET6.infrastructure
5 | {
6 | ///
7 | /// Premade class with slight additions, originally taken off StackOverflow.
8 | /// Used to collect available System Resolutions from user.
9 | ///
10 | internal class SysResolutions
11 | {
12 | // logger for easy debugging
13 | private static Logger logger = LogManager.GetCurrentClassLogger();
14 |
15 | // string list to store resolution values
16 | public static List ResolutionList;
17 |
18 | public SysResolutions()
19 | {
20 | logger = LogManager.GetCurrentClassLogger();
21 | }
22 |
23 | [DllImport("user32.dll")]
24 | public static extern bool EnumDisplaySettings(
25 | string deviceName, int modeNum, ref DEVMODE devMode);
26 |
27 | ///
28 | /// Getter for user resolutions.
29 | /// Called by Program upon application start.
30 | ///
31 | public void getResolutions()
32 | {
33 | List tempList = new();
34 | DEVMODE vDevMode = new();
35 | int i = 0;
36 | while (EnumDisplaySettings(null, i, ref vDevMode))
37 | {
38 | tempList.Add(vDevMode.dmPelsWidth + "x" + vDevMode.dmPelsHeight);
39 | i++;
40 | }
41 |
42 | int maxLength = tempList.Max(x => x.Length);
43 | IOrderedEnumerable orderedList = tempList.OrderBy(x => x.PadLeft(maxLength, '0'));
44 | ResolutionList = orderedList.Distinct().ToList();
45 | logger.Debug("getResolutions - found a total of {0} available resolutions.", ResolutionList.Count);
46 | }
47 |
48 | [StructLayout(LayoutKind.Sequential)]
49 | public struct DEVMODE
50 | {
51 | private const int Cchdevicename = 0x20;
52 | private const int Cchformname = 0x20;
53 |
54 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
55 | public string dmDeviceName;
56 |
57 | public short dmSpecVersion;
58 | public short dmDriverVersion;
59 | public short dmSize;
60 | public short dmDriverExtra;
61 | public int dmFields;
62 | public int dmPositionX;
63 | public int dmPositionY;
64 | public ScreenOrientation dmDisplayOrientation;
65 | public int dmDisplayFixedOutput;
66 | public short dmColor;
67 | public short dmDuplex;
68 | public short dmYResolution;
69 | public short dmTTOption;
70 | public short dmCollate;
71 |
72 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
73 | public string dmFormName;
74 |
75 | public short dmLogPixels;
76 | public int dmBitsPerPel;
77 | public int dmPelsWidth;
78 | public int dmPelsHeight;
79 | public int dmDisplayFlags;
80 | public int dmDisplayFrequency;
81 | public int dmICMMethod;
82 | public int dmICMIntent;
83 | public int dmMediaType;
84 | public int dmDitherType;
85 | public int dmReserved1;
86 | public int dmReserved2;
87 | public int dmPanningWidth;
88 | public int dmPanningHeight;
89 | }
90 | }
91 | }
--------------------------------------------------------------------------------
/ui/BmLauncherForm.cs:
--------------------------------------------------------------------------------
1 | using BmLauncherAsylumNET6.data;
2 | using BmLauncherAsylumNET6.infrastructure;
3 | using NLog;
4 | using System.Diagnostics;
5 | using System.Globalization;
6 |
7 | namespace BmLauncherAsylumNET6.ui
8 | {
9 | public partial class BmLauncherForm : Form
10 |
11 | {
12 | // logger for easy debugging
13 | private static readonly Logger logger = LogManager.GetCurrentClassLogger();
14 |
15 | private static bool firstLaunch;
16 | private static bool readWarning;
17 |
18 | public bool ChangedConfig;
19 |
20 | public BmLauncherForm()
21 | {
22 | InitializeComponent();
23 | }
24 |
25 | private void texgroupButton_Click(object sender, EventArgs e)
26 | {
27 | Program.MyFactory.SetTexfix();
28 | }
29 |
30 | private void launchButton_Click(object sender, EventArgs e)
31 | {
32 | if (ChangedConfig)
33 | {
34 | Program.MyFactory.writeGraphFile();
35 | }
36 | else
37 | {
38 | logger.Info("No configuration changes made.");
39 | }
40 |
41 |
42 | using (Process launchBmGame = new())
43 | {
44 | try
45 | {
46 | Factory.InputFileInfo.IsReadOnly = true;
47 | if (Factory.TexmodDetected)
48 | {
49 | launchBmGame.StartInfo.FileName = "texmod_autoload.exe";
50 | launchBmGame.StartInfo.CreateNoWindow = true;
51 | launchBmGame.Start();
52 | logger.Info("Launching Texmod. Logging has concluded at {0}, on {1}.",
53 | DateTime.Now.ToString("HH:mm:ss"), DateTime.Now.ToString("D", new CultureInfo("en-GB")));
54 | launchButton.Enabled = false;
55 | LogManager.Flush();
56 | Application.Exit();
57 | }
58 | else
59 | {
60 | launchBmGame.StartInfo.FileName = "ShippingPC-BmGame.exe";
61 | launchBmGame.StartInfo.CreateNoWindow = true;
62 | launchBmGame.Start();
63 | logger.Info("Launching game application. Logging has concluded at {0}, on {1}.",
64 | DateTime.Now.ToString("HH:mm:ss"), DateTime.Now.ToString("D", new CultureInfo("en-GB")));
65 | launchButton.Enabled = false;
66 | LogManager.Flush();
67 | Application.Exit();
68 | }
69 | }
70 | catch (Exception)
71 | {
72 | MessageBox.Show(
73 | "Couldn't find ShippingPC_BmGame.exe or texmod_autoload.exe.\r\nPlease place the Launcher files in the correct folder.\r\n" +
74 | "\r\nThe correct install folder is: \\Batman Arkham Asylum GOTY\\Binaries.",
75 | @"Could not start game!",
76 | MessageBoxButtons.OK,
77 | MessageBoxIcon.Error);
78 | }
79 | }
80 | }
81 |
82 | private void credLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
83 | {
84 | new CreditsWindow().ShowDialog();
85 | }
86 |
87 | private void keyButton_Click(object sender, EventArgs e)
88 | {
89 | Program.MyFactory.Keybinds.ShowDialog();
90 | }
91 |
92 | private void applyButton_Click(object sender, EventArgs e)
93 | {
94 | Program.MyFactory.writeGraphFile();
95 | if (langBox.SelectedIndex != 5)
96 | {
97 | try
98 | {
99 | langBox.Items.RemoveAt(5);
100 | }
101 | catch (ArgumentOutOfRangeException)
102 | {
103 | }
104 | }
105 |
106 | applyButton.Enabled = false;
107 | ChangedConfig = false;
108 | }
109 |
110 | private void nvBox_CheckedChanged(object sender, EventArgs e)
111 | {
112 | aoBox.Enabled = !nvBox.Checked;
113 | ChangedConfig = true;
114 | applyButton.Enabled = true;
115 | }
116 |
117 | private void fullscreenBox_SelectedIndexChanged(object sender, EventArgs e)
118 | {
119 | ChangedConfig = true;
120 | applyButton.Enabled = true;
121 | }
122 |
123 | private void resBox_SelectedIndexChanged(object sender, EventArgs e)
124 | {
125 | ChangedConfig = true;
126 | applyButton.Enabled = true;
127 | }
128 |
129 | private void vsyncBox_SelectedIndexChanged(object sender, EventArgs e)
130 | {
131 | ChangedConfig = true;
132 | applyButton.Enabled = true;
133 | }
134 |
135 | private void detailBox_SelectedIndexChanged(object sender, EventArgs e)
136 | {
137 | ChangedConfig = true;
138 | applyButton.Enabled = true;
139 | }
140 |
141 | private void ultraButton_Click(object sender, EventArgs e)
142 | {
143 | Presets.setUltra();
144 | ChangedConfig = true;
145 | applyButton.Enabled = true;
146 | }
147 |
148 | private void optiButton_Click(object sender, EventArgs e)
149 | {
150 | Presets.setOptimized();
151 | ChangedConfig = true;
152 | applyButton.Enabled = true;
153 | }
154 |
155 | private void aaBox_SelectedIndexChanged(object sender, EventArgs e)
156 | {
157 | ChangedConfig = true;
158 | applyButton.Enabled = true;
159 | }
160 |
161 | private void fogBox_SelectedIndexChanged(object sender, EventArgs e)
162 | {
163 | ChangedConfig = true;
164 | applyButton.Enabled = true;
165 | }
166 |
167 | private void bloomBox_SelectedIndexChanged(object sender, EventArgs e)
168 | {
169 | ChangedConfig = true;
170 | applyButton.Enabled = true;
171 | }
172 |
173 | private void lensFlareBox_SelectedIndexChanged(object sender, EventArgs e)
174 | {
175 | ChangedConfig = true;
176 | applyButton.Enabled = true;
177 | }
178 |
179 | private void dofBox_SelectedIndexChanged(object sender, EventArgs e)
180 | {
181 | ChangedConfig = true;
182 | applyButton.Enabled = true;
183 | }
184 |
185 | private void distBox_SelectedIndexChanged(object sender, EventArgs e)
186 | {
187 | ChangedConfig = true;
188 | applyButton.Enabled = true;
189 | }
190 |
191 | private void mBlurBox_SelectedIndexChanged(object sender, EventArgs e)
192 | {
193 | ChangedConfig = true;
194 | applyButton.Enabled = true;
195 | }
196 |
197 | private void memPoolBox_SelectedIndexChanged(object sender, EventArgs e)
198 | {
199 | ChangedConfig = true;
200 | applyButton.Enabled = true;
201 | }
202 |
203 | private void anisoBox_SelectedIndexChanged(object sender, EventArgs e)
204 | {
205 | ChangedConfig = true;
206 | applyButton.Enabled = true;
207 | }
208 |
209 | private void sphericBox_SelectedIndexChanged(object sender, EventArgs e)
210 | {
211 | ChangedConfig = true;
212 | applyButton.Enabled = true;
213 | }
214 |
215 | private void aoBox_SelectedIndexChanged(object sender, EventArgs e)
216 | {
217 | ChangedConfig = true;
218 | applyButton.Enabled = true;
219 | }
220 |
221 | private void dShadowBox_SelectedIndexChanged(object sender, EventArgs e)
222 | {
223 | ChangedConfig = true;
224 | applyButton.Enabled = true;
225 | }
226 |
227 | private void texelBox_SelectedIndexChanged(object sender, EventArgs e)
228 | {
229 | ChangedConfig = true;
230 | applyButton.Enabled = true;
231 | }
232 |
233 | private void maxShadowBox_SelectedIndexChanged(object sender, EventArgs e)
234 | {
235 | ChangedConfig = true;
236 | applyButton.Enabled = true;
237 |
238 | switch (maxShadowBox.SelectedIndex)
239 | {
240 | case 0:
241 | texelBox.Enabled = false;
242 | texelBox.SelectedIndex = 0;
243 | break;
244 | case 1:
245 | texelBox.Enabled = false;
246 | texelBox.SelectedIndex = 0;
247 | break;
248 | case 2:
249 | texelBox.Enabled = true;
250 | break;
251 | case 3:
252 | texelBox.Enabled = true;
253 | break;
254 | }
255 | }
256 |
257 | private void physxBox_SelectedIndexChanged(object sender, EventArgs e)
258 | {
259 | if (!firstLaunch)
260 | {
261 | firstLaunch = true;
262 | return;
263 | }
264 |
265 | if (physxBox.SelectedIndex == 2 && !readWarning)
266 | {
267 | MessageBox.Show(
268 | "Changing your PhysX settings to \'High\' will result in\r\nhuge frame drops for certain" +
269 | " sections of the game.\r\nIt is recommended to select \'Medium\' settings.", @"PhysX Warning",
270 | MessageBoxButtons.OK,
271 | MessageBoxIcon.Warning);
272 | readWarning = true;
273 | }
274 |
275 | ChangedConfig = true;
276 | applyButton.Enabled = true;
277 | }
278 |
279 | private void disableIntroButton_Click(object sender, EventArgs e)
280 | {
281 | ChangedConfig = true;
282 | Program.MyFactory.SetIntroFix();
283 | }
284 |
285 | private void maxSmoothTextBox_TextChanged(object sender, EventArgs e)
286 | {
287 | ChangedConfig = true;
288 | applyButton.Enabled = true;
289 | }
290 |
291 | private void langBox_SelectedIndexChanged(object sender, EventArgs e)
292 | {
293 | ChangedConfig = true;
294 | applyButton.Enabled = true;
295 | }
296 |
297 | private void frameCheckBox_CheckedChanged(object sender, EventArgs e)
298 | {
299 | ChangedConfig = true;
300 | applyButton.Enabled = true;
301 | }
302 |
303 | private void ManualModeBtn_Click(object sender, EventArgs e)
304 | {
305 | DialogResult result = MessageBox.Show(
306 | "This option removes the 'read-only' flag of the configuration files, allowing for manual edits.\r\n" +
307 | "The launcher will close if you choose this option and any unsaved changes will be lost.\r\n\r\n" +
308 | "Do you wish to continue?", @"Enable Manual Editing",
309 | MessageBoxButtons.YesNo,
310 | MessageBoxIcon.Warning);
311 |
312 | if (result == DialogResult.Yes)
313 | {
314 | Factory.ConfigInfo.IsReadOnly = false;
315 | Factory.UserEngineInfo.IsReadOnly = false;
316 | Factory.BmInputFileInfo.IsReadOnly = false;
317 | logger.Info("Closing launcher and disabling read-only flags. Logging has concluded at {0}, on {1}.",
318 | DateTime.Now.ToString("HH:mm:ss"), DateTime.Now.ToString("D", new CultureInfo("en-GB")));
319 | LogManager.Flush();
320 | Application.Exit();
321 | }
322 | }
323 |
324 | private void rebornButton_Click(object sender, EventArgs e)
325 | {
326 | Presets.setReborn();
327 | ChangedConfig = true;
328 | }
329 | }
330 | }
--------------------------------------------------------------------------------
/ui/CreditsWindow.Designer.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Windows.Forms;
3 |
4 | namespace BmLauncherAsylumNET6.ui
5 | {
6 | partial class CreditsWindow
7 | {
8 | ///
9 | /// Required designer variable.
10 | ///
11 | private IContainer components = null;
12 |
13 | ///
14 | /// Clean up any resources being used.
15 | ///
16 | /// true if managed resources should be disposed; otherwise, false.
17 | protected override void Dispose(bool disposing)
18 | {
19 | if (disposing && (components != null))
20 | {
21 | components.Dispose();
22 | }
23 | base.Dispose(disposing);
24 | }
25 |
26 | #region Windows Form Designer generated code
27 |
28 | ///
29 | /// Required method for Designer support - do not modify
30 | /// the contents of this method with the code editor.
31 | ///
32 | private void InitializeComponent()
33 | {
34 | this.rockCred = new System.Windows.Forms.Label();
35 | this.credBox = new System.Windows.Forms.GroupBox();
36 | this.writtenLabel = new System.Windows.Forms.Label();
37 | this.everLabel = new System.Windows.Forms.LinkLabel();
38 | this.gpLabel = new System.Windows.Forms.LinkLabel();
39 | this.collabLabel = new System.Windows.Forms.Label();
40 | this.frofooLabel = new System.Windows.Forms.LinkLabel();
41 | this.groupBox1 = new System.Windows.Forms.GroupBox();
42 | this.linkLabel1 = new System.Windows.Forms.LinkLabel();
43 | this.groupBox2 = new System.Windows.Forms.GroupBox();
44 | this.linkLabel2 = new System.Windows.Forms.LinkLabel();
45 | this.groupBox3 = new System.Windows.Forms.GroupBox();
46 | this.linkLabel3 = new System.Windows.Forms.LinkLabel();
47 | this.credBox.SuspendLayout();
48 | this.groupBox1.SuspendLayout();
49 | this.groupBox2.SuspendLayout();
50 | this.groupBox3.SuspendLayout();
51 | this.SuspendLayout();
52 | //
53 | // rockCred
54 | //
55 | this.rockCred.AutoSize = true;
56 | this.rockCred.ForeColor = System.Drawing.SystemColors.InfoText;
57 | this.rockCred.Location = new System.Drawing.Point(9, 9);
58 | this.rockCred.Name = "rockCred";
59 | this.rockCred.Size = new System.Drawing.Size(201, 15);
60 | this.rockCred.TabIndex = 0;
61 | this.rockCred.Text = "Game created by Rocksteady Studios";
62 | this.rockCred.Click += new System.EventHandler(this.rockCred_Click);
63 | //
64 | // credBox
65 | //
66 | this.credBox.Controls.Add(this.writtenLabel);
67 | this.credBox.Controls.Add(this.everLabel);
68 | this.credBox.Controls.Add(this.gpLabel);
69 | this.credBox.Controls.Add(this.collabLabel);
70 | this.credBox.Controls.Add(this.frofooLabel);
71 | this.credBox.Location = new System.Drawing.Point(12, 25);
72 | this.credBox.Name = "credBox";
73 | this.credBox.Size = new System.Drawing.Size(180, 91);
74 | this.credBox.TabIndex = 1;
75 | this.credBox.TabStop = false;
76 | //
77 | // writtenLabel
78 | //
79 | this.writtenLabel.AutoSize = true;
80 | this.writtenLabel.ForeColor = System.Drawing.SystemColors.InfoText;
81 | this.writtenLabel.Location = new System.Drawing.Point(6, 12);
82 | this.writtenLabel.Name = "writtenLabel";
83 | this.writtenLabel.Size = new System.Drawing.Size(127, 15);
84 | this.writtenLabel.TabIndex = 4;
85 | this.writtenLabel.Text = "Application written by:";
86 | //
87 | // everLabel
88 | //
89 | this.everLabel.AutoSize = true;
90 | this.everLabel.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
91 | this.everLabel.Location = new System.Drawing.Point(6, 74);
92 | this.everLabel.Name = "everLabel";
93 | this.everLabel.Size = new System.Drawing.Size(69, 15);
94 | this.everLabel.TabIndex = 3;
95 | this.everLabel.TabStop = true;
96 | this.everLabel.Text = "EVERGREEN";
97 | this.everLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.everLabel_LinkClicked);
98 | //
99 | // gpLabel
100 | //
101 | this.gpLabel.AutoSize = true;
102 | this.gpLabel.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
103 | this.gpLabel.Location = new System.Drawing.Point(6, 59);
104 | this.gpLabel.Name = "gpLabel";
105 | this.gpLabel.Size = new System.Drawing.Size(50, 15);
106 | this.gpLabel.TabIndex = 2;
107 | this.gpLabel.TabStop = true;
108 | this.gpLabel.Text = "GPUnity";
109 | this.gpLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.gpLabel_LinkClicked);
110 | //
111 | // collabLabel
112 | //
113 | this.collabLabel.AutoSize = true;
114 | this.collabLabel.ForeColor = System.Drawing.SystemColors.InfoText;
115 | this.collabLabel.Location = new System.Drawing.Point(6, 45);
116 | this.collabLabel.Name = "collabLabel";
117 | this.collabLabel.Size = new System.Drawing.Size(121, 15);
118 | this.collabLabel.TabIndex = 1;
119 | this.collabLabel.Text = "In Collaboration with:";
120 | //
121 | // frofooLabel
122 | //
123 | this.frofooLabel.Anchor = System.Windows.Forms.AnchorStyles.Top;
124 | this.frofooLabel.AutoSize = true;
125 | this.frofooLabel.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
126 | this.frofooLabel.Location = new System.Drawing.Point(7, 27);
127 | this.frofooLabel.Name = "frofooLabel";
128 | this.frofooLabel.Size = new System.Drawing.Size(39, 15);
129 | this.frofooLabel.TabIndex = 0;
130 | this.frofooLabel.TabStop = true;
131 | this.frofooLabel.Text = "Neato";
132 | this.frofooLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.frofooLabel_LinkClicked);
133 | //
134 | // groupBox1
135 | //
136 | this.groupBox1.Controls.Add(this.linkLabel1);
137 | this.groupBox1.Location = new System.Drawing.Point(12, 115);
138 | this.groupBox1.Name = "groupBox1";
139 | this.groupBox1.Size = new System.Drawing.Size(180, 30);
140 | this.groupBox1.TabIndex = 2;
141 | this.groupBox1.TabStop = false;
142 | //
143 | // linkLabel1
144 | //
145 | this.linkLabel1.Anchor = System.Windows.Forms.AnchorStyles.Top;
146 | this.linkLabel1.AutoSize = true;
147 | this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
148 | this.linkLabel1.Location = new System.Drawing.Point(45, 11);
149 | this.linkLabel1.Name = "linkLabel1";
150 | this.linkLabel1.Size = new System.Drawing.Size(102, 15);
151 | this.linkLabel1.TabIndex = 5;
152 | this.linkLabel1.TabStop = true;
153 | this.linkLabel1.Text = "Github Repository";
154 | this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
155 | //
156 | // groupBox2
157 | //
158 | this.groupBox2.Controls.Add(this.linkLabel2);
159 | this.groupBox2.Location = new System.Drawing.Point(12, 142);
160 | this.groupBox2.Name = "groupBox2";
161 | this.groupBox2.Size = new System.Drawing.Size(180, 30);
162 | this.groupBox2.TabIndex = 6;
163 | this.groupBox2.TabStop = false;
164 | //
165 | // linkLabel2
166 | //
167 | this.linkLabel2.Anchor = System.Windows.Forms.AnchorStyles.Top;
168 | this.linkLabel2.AutoSize = true;
169 | this.linkLabel2.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
170 | this.linkLabel2.Location = new System.Drawing.Point(45, 11);
171 | this.linkLabel2.Name = "linkLabel2";
172 | this.linkLabel2.Size = new System.Drawing.Size(93, 15);
173 | this.linkLabel2.TabIndex = 5;
174 | this.linkLabel2.TabStop = true;
175 | this.linkLabel2.Text = "HD Texture Pack";
176 | this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
177 | //
178 | // groupBox3
179 | //
180 | this.groupBox3.Controls.Add(this.linkLabel3);
181 | this.groupBox3.Location = new System.Drawing.Point(12, 169);
182 | this.groupBox3.Name = "groupBox3";
183 | this.groupBox3.Size = new System.Drawing.Size(180, 30);
184 | this.groupBox3.TabIndex = 7;
185 | this.groupBox3.TabStop = false;
186 | //
187 | // linkLabel3
188 | //
189 | this.linkLabel3.Anchor = System.Windows.Forms.AnchorStyles.Top;
190 | this.linkLabel3.AutoSize = true;
191 | this.linkLabel3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
192 | this.linkLabel3.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
193 | this.linkLabel3.LinkColor = System.Drawing.Color.DarkGoldenrod;
194 | this.linkLabel3.Location = new System.Drawing.Point(33, 11);
195 | this.linkLabel3.Name = "linkLabel3";
196 | this.linkLabel3.Size = new System.Drawing.Size(117, 13);
197 | this.linkLabel3.TabIndex = 5;
198 | this.linkLabel3.TabStop = true;
199 | this.linkLabel3.Text = "Support the Project";
200 | this.linkLabel3.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked);
201 | //
202 | // CreditsWindow
203 | //
204 | this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
205 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
206 | this.AutoSize = true;
207 | this.AutoValidate = System.Windows.Forms.AutoValidate.EnableAllowFocusChange;
208 | this.ClientSize = new System.Drawing.Size(204, 208);
209 | this.Controls.Add(this.groupBox1);
210 | this.Controls.Add(this.groupBox2);
211 | this.Controls.Add(this.groupBox3);
212 | this.Controls.Add(this.credBox);
213 | this.Controls.Add(this.rockCred);
214 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
215 | this.MaximizeBox = false;
216 | this.MinimizeBox = false;
217 | this.Name = "CreditsWindow";
218 | this.ShowInTaskbar = false;
219 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
220 | this.Text = "Information";
221 | this.TopMost = true;
222 | this.credBox.ResumeLayout(false);
223 | this.credBox.PerformLayout();
224 | this.groupBox1.ResumeLayout(false);
225 | this.groupBox1.PerformLayout();
226 | this.groupBox2.ResumeLayout(false);
227 | this.groupBox2.PerformLayout();
228 | this.groupBox3.ResumeLayout(false);
229 | this.groupBox3.PerformLayout();
230 | this.ResumeLayout(false);
231 | this.PerformLayout();
232 |
233 | }
234 |
235 | #endregion
236 |
237 | private Label rockCred;
238 | private GroupBox credBox;
239 | private LinkLabel everLabel;
240 | private LinkLabel gpLabel;
241 | private Label collabLabel;
242 | private LinkLabel frofooLabel;
243 | private Label writtenLabel;
244 | private GroupBox groupBox1;
245 | private LinkLabel linkLabel1;
246 | private GroupBox groupBox2;
247 | private LinkLabel linkLabel2;
248 | private GroupBox groupBox3;
249 | private LinkLabel linkLabel3;
250 | }
251 | }
--------------------------------------------------------------------------------
/ui/CreditsWindow.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | namespace BmLauncherAsylumNET6.ui
4 | {
5 | public partial class CreditsWindow : Form
6 | {
7 | public CreditsWindow()
8 | {
9 | InitializeComponent();
10 | }
11 |
12 | private void rockCred_Click(object sender, EventArgs e)
13 | {
14 | }
15 |
16 | private void frofooLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
17 | {
18 | Process.Start(new ProcessStartInfo { FileName = @"https://steamcommunity.com/id/frofoo/", UseShellExecute = true });
19 | }
20 |
21 | private void gpLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
22 | {
23 | Process.Start(new ProcessStartInfo { FileName = @"https://www.youtube.com/c/GPUnity", UseShellExecute = true });
24 | }
25 |
26 | private void everLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
27 | {
28 | Random number = new();
29 |
30 | if ((number.NextDouble() * (100.0 - 1.0)) + 1.0 <= 7.0)
31 | {
32 | Process.Start(new ProcessStartInfo { FileName = @"https://en.wikipedia.org/wiki/Baguette", UseShellExecute = true });
33 | }
34 | else
35 | {
36 | Process.Start(new ProcessStartInfo { FileName = @"https://www.nexusmods.com/users/6875632?tab=user+files", UseShellExecute = true });
37 | }
38 | }
39 |
40 | private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
41 | {
42 | Process.Start(new ProcessStartInfo { FileName = @"https://steamcommunity.com/sharedfiles/filedetails/?id=1159691355", UseShellExecute = true });
43 |
44 | }
45 |
46 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
47 | {
48 | Process.Start(new ProcessStartInfo { FileName = @"https://github.com/neatodev/BmLauncherAsylumNET6", UseShellExecute = true });
49 |
50 | }
51 |
52 | private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
53 | {
54 | Process.Start(new ProcessStartInfo { FileName = @"https://www.paypal.com/donate/?hosted_button_id=LG7YTKP4JYN5S", UseShellExecute = true });
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/ui/CreditsWindow.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | text/microsoft-resx
50 |
51 |
52 | 2.0
53 |
54 |
55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
56 |
57 |
58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
59 |
60 |
--------------------------------------------------------------------------------
/ui/InputForm.Designer.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Windows.Forms;
3 |
4 | namespace BmLauncherAsylumNET6.ui
5 | {
6 | partial class inputForm
7 | {
8 | ///
9 | /// Required designer variable.
10 | ///
11 | private IContainer components = null;
12 |
13 | ///
14 | /// Clean up any resources being used.
15 | ///
16 | /// true if managed resources should be disposed; otherwise, false.
17 | protected override void Dispose(bool disposing)
18 | {
19 | if (disposing && (components != null))
20 | {
21 | components.Dispose();
22 | }
23 | base.Dispose(disposing);
24 | }
25 |
26 | #region Windows Form Designer generated code
27 |
28 | ///
29 | /// Required method for Designer support - do not modify
30 | /// the contents of this method with the code editor.
31 | ///
32 | private void InitializeComponent()
33 | {
34 | this.modifierBox = new System.Windows.Forms.ComboBox();
35 | this.modifierLabel = new System.Windows.Forms.Label();
36 | this.inputButton = new System.Windows.Forms.Button();
37 | this.groupBox1 = new System.Windows.Forms.GroupBox();
38 | this.groupBox1.SuspendLayout();
39 | this.SuspendLayout();
40 | //
41 | // modifierBox
42 | //
43 | this.modifierBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
44 | this.modifierBox.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
45 | this.modifierBox.FormattingEnabled = true;
46 | this.modifierBox.Items.AddRange(new object[] {
47 | "None",
48 | "Shift",
49 | "Alt",
50 | "Ctrl"});
51 | this.modifierBox.Location = new System.Drawing.Point(12, 38);
52 | this.modifierBox.Name = "modifierBox";
53 | this.modifierBox.Size = new System.Drawing.Size(225, 23);
54 | this.modifierBox.TabIndex = 1;
55 | this.modifierBox.SelectedIndexChanged += new System.EventHandler(this.modifierBox_SelectedIndexChanged);
56 | //
57 | // modifierLabel
58 | //
59 | this.modifierLabel.AutoSize = true;
60 | this.modifierLabel.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
61 | this.modifierLabel.Location = new System.Drawing.Point(12, 16);
62 | this.modifierLabel.Name = "modifierLabel";
63 | this.modifierLabel.Size = new System.Drawing.Size(103, 15);
64 | this.modifierLabel.TabIndex = 2;
65 | this.modifierLabel.Text = "Select a Modifier:";
66 | //
67 | // inputButton
68 | //
69 | this.inputButton.BackColor = System.Drawing.Color.Transparent;
70 | this.inputButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
71 | this.inputButton.Font = new System.Drawing.Font("Calibri", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
72 | this.inputButton.Location = new System.Drawing.Point(-19, -17);
73 | this.inputButton.Name = "inputButton";
74 | this.inputButton.Size = new System.Drawing.Size(287, 220);
75 | this.inputButton.TabIndex = 3;
76 | this.inputButton.Text = "Waiting for Input";
77 | this.inputButton.UseVisualStyleBackColor = false;
78 | this.inputButton.UseWaitCursor = true;
79 | this.inputButton.KeyDown += new System.Windows.Forms.KeyEventHandler(this.inputButton_KeyDown);
80 | this.inputButton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.inputButton_MouseDown);
81 | //
82 | // groupBox1
83 | //
84 | this.groupBox1.BackColor = System.Drawing.Color.Transparent;
85 | this.groupBox1.Controls.Add(this.modifierLabel);
86 | this.groupBox1.Controls.Add(this.modifierBox);
87 | this.groupBox1.Location = new System.Drawing.Point(0, -7);
88 | this.groupBox1.Name = "groupBox1";
89 | this.groupBox1.Size = new System.Drawing.Size(250, 69);
90 | this.groupBox1.TabIndex = 4;
91 | this.groupBox1.TabStop = false;
92 | //
93 | // inputForm
94 | //
95 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
96 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
97 | this.BackColor = System.Drawing.Color.White;
98 | this.ClientSize = new System.Drawing.Size(249, 145);
99 | this.Controls.Add(this.groupBox1);
100 | this.Controls.Add(this.inputButton);
101 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
102 | this.MinimizeBox = false;
103 | this.Name = "inputForm";
104 | this.ShowIcon = false;
105 | this.ShowInTaskbar = false;
106 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
107 | this.Text = "Input Prompt";
108 | this.TopMost = true;
109 | this.groupBox1.ResumeLayout(false);
110 | this.groupBox1.PerformLayout();
111 | this.ResumeLayout(false);
112 |
113 | }
114 |
115 | #endregion
116 | private Label modifierLabel;
117 | private ComboBox modifierBox;
118 | private Button inputButton;
119 | private GroupBox groupBox1;
120 | }
121 | }
--------------------------------------------------------------------------------
/ui/InputForm.cs:
--------------------------------------------------------------------------------
1 | namespace BmLauncherAsylumNET6.ui
2 | {
3 | ///
4 | /// Small class for reading button/mouse input
5 | ///
6 | public partial class inputForm : Form
7 | {
8 | // keys that are banned from being read. Most of them would break UserInput.ini
9 | private readonly string[] _bannedKeys =
10 | {
11 | "OEM8", "LWIN", "RWIN", "OEM7", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D0", "SCROLL",
12 | "OEM1", "OEMTILDE", "OEM7", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12",
13 | "NUMLOCK", "Backslash", "BACK", "EQUALS", "MULTIPLY", "DIVIDE", "SUBTRACT", "ADD", "DECIMAL", "PAUSE",
14 | "OEMBACKSLASH", "MENU", "NUMPAD0", "NUMPAD1", "NUMPAD2", "NUMPAD3", "NUMPAD4", "NUMPAD5", "NUMPAD6",
15 | "NUMPAD7", "NUMPAD8", "NUMPAD9", "CLEAR"
16 | };
17 |
18 | // currently selected button
19 | private readonly Button _currentButton;
20 |
21 | // list of input keys that need to be corrected
22 | private readonly string[] _inputWrong =
23 | {
24 | "OEM5", "OEMOPENBRACKETS", "OEM6", "OEMQUESTION", "OEMMINUS", "OEMPLUS", "OEMCOMMA", "OEMPERIOD",
25 | "CAPITAL", "Left", "Right", "Middle", "SPACE", "LEFT", "RIGHT", "UP", "DOWN", "XButton1", "XButton2",
26 | "SHIFTKEY", "CONTROLKEY"
27 | };
28 |
29 | // list of corrected keys
30 | private readonly string[] _outputRight =
31 | {
32 | "Backslash", "LeftBracket", "RightBracket", "Slash", "Underscore", "Equals", "Comma", "Period",
33 | "CapsLock", "LeftMouseButton", "RightMouseButton", "MiddleMouseButton", "SpaceBar", "Left", "Right",
34 | "Up", "Down", "ThumbMouseButton", "ThumbMouseButton2", "LeftShift", "LeftAlt"
35 | };
36 |
37 | // key input as string value
38 | private string _keyPressed;
39 |
40 | ///
41 | /// Constructor for inputForm.
42 | ///
43 | /// current button
44 | public inputForm(Button bt)
45 | {
46 | _currentButton = bt;
47 | InitializeComponent();
48 | modifierBox.SelectedIndex = 0;
49 | inputButton.MouseWheel += get_mwinput;
50 | inputButton.Focus();
51 | inputButton.Select();
52 | inputButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
53 | }
54 |
55 | ///
56 | /// Sets the input of the keybind-buttons.
57 | /// It checks if the keyinput is equivalent to a banned key (first foreach loop),
58 | /// calls three other methods (compareKeys, setModifiers, detectDuplicate)
59 | /// and finally sets the text of the button.
60 | ///
61 | private void setInput()
62 | {
63 | foreach (string line in _bannedKeys)
64 | {
65 | if (_keyPressed.Equals(line))
66 | {
67 | MessageBox.Show(@"Key not valid", @"Not a valid input!");
68 | return;
69 | }
70 | }
71 |
72 | _keyPressed = compareKeys(_keyPressed);
73 | _keyPressed = setModifiers(_keyPressed, modifierBox.SelectedIndex);
74 | detectDuplicate(_keyPressed);
75 | foreach (Button bt in Program.MyFactory.Keybinds.ButtonList)
76 | {
77 | if (_currentButton.Name.Equals(bt.Name))
78 | {
79 | bt.Text = _keyPressed;
80 | bt.ForeColor = Color.Black;
81 | }
82 | }
83 |
84 | Close();
85 | }
86 |
87 | ///
88 | /// Compares keys to inputWrong list, corrects them with outputRight list.
89 | ///
90 | /// Line to check
91 | /// Corrected string
92 | private string compareKeys(string lineToCheck)
93 | {
94 | for (int i = 0; i < _inputWrong.Length; i++)
95 | {
96 | if (lineToCheck.Equals(_inputWrong[i]))
97 | {
98 | lineToCheck = _outputRight[i];
99 | Console.WriteLine(lineToCheck);
100 | return lineToCheck;
101 | }
102 | }
103 |
104 | return lineToCheck;
105 | }
106 |
107 | ///
108 | /// Used to detect duplicates. Respects the new input.
109 | /// Old keybind will be set to 'Unbound'.
110 | ///
111 | /// Line to check
112 | private void detectDuplicate(string lineToCheck)
113 | {
114 | foreach (Button bt in Program.MyFactory.Keybinds.ButtonList)
115 | {
116 | if (bt.Text.Equals(lineToCheck))
117 | {
118 | bt.Text = @"Unbound";
119 | bt.ForeColor = Color.Red;
120 | }
121 | }
122 | }
123 |
124 | ///
125 | /// Applies modifiers to keys.
126 | /// Very important for GraphicsWriter
127 | ///
128 | /// Line to check
129 | /// case number used for switch
130 | /// string with modifier prefix
131 | private string setModifiers(string lineToCheck, int thisCase)
132 | {
133 | return thisCase switch
134 | {
135 | 0 => lineToCheck,
136 | 1 => "S+" + lineToCheck,
137 | 2 => "A+" + lineToCheck,
138 | 3 => "C+" + lineToCheck,
139 | _ => lineToCheck,
140 | };
141 | }
142 |
143 | ///
144 | /// After selecting a modifier, the inputbutton that is used to read inputs is highlighted again.
145 | ///
146 | ///
147 | ///
148 | private void modifierBox_SelectedIndexChanged(object sender, EventArgs e)
149 | {
150 | inputButton.Select();
151 | inputButton.Focus();
152 | }
153 |
154 | ///
155 | /// Writes keyboard input to string. Pressing 'Esc' closes the form.
156 | ///
157 | ///
158 | /// input
159 | private void inputButton_KeyDown(object sender, KeyEventArgs e)
160 | {
161 | _keyPressed = e.KeyCode.ToString().ToUpper();
162 |
163 | if (_keyPressed.Contains("ESCAPE"))
164 | {
165 | Close();
166 | }
167 | else
168 | {
169 | setInput();
170 | }
171 | }
172 |
173 | ///
174 | /// MouseEvent that specifically reads mouse scroll inputs.
175 | ///
176 | ///
177 | ///
178 | private void get_mwinput(object sender, MouseEventArgs e)
179 | {
180 | _keyPressed = e.Delta > 0 ? "MouseScrollUp" : "MouseScrollDown";
181 |
182 | setInput();
183 | }
184 |
185 | ///
186 | /// MouseEvent that specifically reads mouse click inputs.
187 | ///
188 | ///
189 | ///
190 | private void inputButton_MouseDown(object sender, MouseEventArgs e)
191 | {
192 | Console.WriteLine(e);
193 | _keyPressed = e.Button.ToString();
194 | setInput();
195 | }
196 | }
197 | }
--------------------------------------------------------------------------------
/ui/InputForm.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 |
--------------------------------------------------------------------------------
/ui/KeyHelpForm.Designer.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Windows.Forms;
3 |
4 | namespace BmLauncherAsylumNET6.ui
5 | {
6 | partial class KeyHelpForm
7 | {
8 | ///
9 | /// Required designer variable.
10 | ///
11 | private IContainer components = null;
12 |
13 | ///
14 | /// Clean up any resources being used.
15 | ///
16 | /// true if managed resources should be disposed; otherwise, false.
17 | protected override void Dispose(bool disposing)
18 | {
19 | if (disposing && (components != null))
20 | {
21 | components.Dispose();
22 | }
23 | base.Dispose(disposing);
24 | }
25 |
26 | #region Windows Form Designer generated code
27 |
28 | ///
29 | /// Required method for Designer support - do not modify
30 | /// the contents of this method with the code editor.
31 | ///
32 | private void InitializeComponent()
33 | {
34 | this.groupBox1 = new System.Windows.Forms.GroupBox();
35 | this.label3 = new System.Windows.Forms.Label();
36 | this.label1 = new System.Windows.Forms.Label();
37 | this.label2 = new System.Windows.Forms.Label();
38 | this.affixS = new System.Windows.Forms.Label();
39 | this.groupBox1.SuspendLayout();
40 | this.SuspendLayout();
41 | //
42 | // groupBox1
43 | //
44 | this.groupBox1.Controls.Add(this.label3);
45 | this.groupBox1.Controls.Add(this.label1);
46 | this.groupBox1.Controls.Add(this.label2);
47 | this.groupBox1.Controls.Add(this.affixS);
48 | this.groupBox1.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
49 | this.groupBox1.Location = new System.Drawing.Point(5, 6);
50 | this.groupBox1.Name = "groupBox1";
51 | this.groupBox1.Size = new System.Drawing.Size(142, 95);
52 | this.groupBox1.TabIndex = 0;
53 | this.groupBox1.TabStop = false;
54 | this.groupBox1.Text = "Keybind Information";
55 | //
56 | // label3
57 | //
58 | this.label3.AutoSize = true;
59 | this.label3.Location = new System.Drawing.Point(7, 58);
60 | this.label3.Name = "label3";
61 | this.label3.Size = new System.Drawing.Size(126, 15);
62 | this.label3.TabIndex = 3;
63 | this.label3.Text = "\'A+\' = LeftAlt Modifier";
64 | //
65 | // label1
66 | //
67 | this.label1.AutoSize = true;
68 | this.label1.Location = new System.Drawing.Point(7, 73);
69 | this.label1.Name = "label1";
70 | this.label1.Size = new System.Drawing.Size(129, 15);
71 | this.label1.TabIndex = 2;
72 | this.label1.Text = "\'C+\' = Control Modifier";
73 | //
74 | // label2
75 | //
76 | this.label2.AutoSize = true;
77 | this.label2.Location = new System.Drawing.Point(7, 43);
78 | this.label2.Name = "label2";
79 | this.label2.Size = new System.Drawing.Size(132, 15);
80 | this.label2.TabIndex = 1;
81 | this.label2.Text = "\'S+\' = LeftShift Modifier";
82 | //
83 | // affixS
84 | //
85 | this.affixS.AutoSize = true;
86 | this.affixS.Font = new System.Drawing.Font("Calibri", 9.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
87 | this.affixS.Location = new System.Drawing.Point(7, 20);
88 | this.affixS.Name = "affixS";
89 | this.affixS.Size = new System.Drawing.Size(55, 15);
90 | this.affixS.TabIndex = 0;
91 | this.affixS.Text = "Prefixes:";
92 | //
93 | // KeyHelpForm
94 | //
95 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
96 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
97 | this.ClientSize = new System.Drawing.Size(152, 105);
98 | this.Controls.Add(this.groupBox1);
99 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
100 | this.MaximizeBox = false;
101 | this.MinimizeBox = false;
102 | this.Name = "KeyHelpForm";
103 | this.ShowIcon = false;
104 | this.ShowInTaskbar = false;
105 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
106 | this.Text = "Help";
107 | this.TopMost = true;
108 | this.groupBox1.ResumeLayout(false);
109 | this.groupBox1.PerformLayout();
110 | this.ResumeLayout(false);
111 |
112 | }
113 |
114 | #endregion
115 |
116 | private GroupBox groupBox1;
117 | private Label label3;
118 | private Label label1;
119 | private Label label2;
120 | private Label affixS;
121 | }
122 | }
--------------------------------------------------------------------------------
/ui/KeyHelpForm.cs:
--------------------------------------------------------------------------------
1 | namespace BmLauncherAsylumNET6.ui
2 | {
3 | public partial class KeyHelpForm : Form
4 | {
5 | public KeyHelpForm()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/ui/KeyHelpForm.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 |
--------------------------------------------------------------------------------
/ui/KeybindForm.cs:
--------------------------------------------------------------------------------
1 | using BmLauncherAsylumNET6.data;
2 | using BmLauncherAsylumNET6.infrastructure;
3 |
4 | namespace BmLauncherAsylumNET6.ui
5 | {
6 | /**
7 | * Keybind editor class that uses buttons as inputreaders.
8 | */
9 | public partial class KeybindForm : Form
10 | {
11 | public List