Skip to content

Commit b0e5e3c

Browse files
committed
Add fullscreen checkbox
1 parent 3aedc0c commit b0e5e3c

2 files changed

Lines changed: 46 additions & 4 deletions

File tree

Form1.Designer.cs

Lines changed: 17 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Form1.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private void Form1_Load(object sender, EventArgs e)
3434

3535
private void checkDirAndPatched()
3636
{
37-
bool readSuccess = false, patched = false;
37+
bool readSuccess = false, patched = false, fullscreen = false;
3838

3939
while (!readSuccess)
4040
{
@@ -43,6 +43,11 @@ private void checkDirAndPatched()
4343
foreach (var line in File.ReadAllLines("data2.dat"))
4444
if (line == "Catalog URL=https://www.ricochetuniverse.com/gateway/catalog.php" || line == "Catalog URL=http://www.ricochetuniverse.com/gateway/catalog.php")
4545
patched = true;
46+
47+
foreach (var line in File.ReadAllLines("Ricochet Infinity.CFG"))
48+
if (line == "Full Screen=1")
49+
fullscreen = true;
50+
4651
readSuccess = true;
4752
}
4853
catch
@@ -65,6 +70,8 @@ private void checkDirAndPatched()
6570
btnReviver.Enabled = false;
6671
label4.Visible = true;
6772
}
73+
74+
cbFullscreen.Checked = fullscreen;
6875
}
6976

7077
private void generateEnabled()
@@ -347,6 +354,7 @@ private void btnDown_Click(object sender, EventArgs e)
347354
}
348355
#endregion
349356

357+
#region delete and install
350358
private void btnDelete_Click(object sender, EventArgs e)
351359
{
352360
if (MessageBox.Show("Are you sure?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
@@ -407,13 +415,33 @@ private void btnInstall_Click(object sender, EventArgs e)
407415
}
408416
}
409417
}
418+
#endregion
410419

411420
private void cbClose_CheckedChanged(object sender, EventArgs e)
412421
{
413422
Program.ProgramSettings.CloseOnLaunch = cbClose.Checked;
414423
File.WriteAllText(Program.ConfigPath, JsonConvert.SerializeObject(Program.ProgramSettings, Formatting.Indented));
415424
}
416425

426+
private void cbFullscreen_CheckedChanged(object sender, EventArgs e)
427+
{
428+
try
429+
{
430+
string[] lines = File.ReadAllLines("Ricochet Infinity.CFG");
431+
432+
for (int i = 0; i < lines.Length; i++)
433+
if (lines[i].Length >= 11)
434+
if (lines[i].Substring(0, 11) == "Full Screen")
435+
lines[i] = "Full Screen=" + (cbFullscreen.Checked ? "1" : "0");
436+
437+
File.WriteAllLines("Ricochet Infinity.CFG", lines);
438+
}
439+
catch (Exception ex)
440+
{
441+
MessageBox.Show($"An error has occurred while updating the game files. \r\nIf you have the game installed in the Program Files folder, try running the mod manager as administrator. \r\n \r\nDetails: \r\n{ex}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
442+
}
443+
}
444+
417445
private void btnCd_Click(object sender, EventArgs e)
418446
{
419447
using (var fbd = new FolderBrowserDialog())

0 commit comments

Comments
 (0)