Skip to content

Commit

Permalink
custom osu path
Browse files Browse the repository at this point in the history
  • Loading branch information
Exsper committed Jul 2, 2024
1 parent 57c51de commit 688c70f
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion LazerFilesViewer/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using Microsoft.VisualBasic.Logging;
using osu.Game;
using Realms;
using Realms.Logging;
using System.Buffers;
using System.Collections;
using System.Configuration;
using System.Diagnostics;
Expand All @@ -14,7 +16,7 @@ namespace LazerFilesViewer
{
public partial class MainForm : Form
{
private const int schema_version = 40;
private const int schema_version = 41;

private string TempFolder = AppDomain.CurrentDomain.BaseDirectory + "tmp\\";
private string BackupFolder = AppDomain.CurrentDomain.BaseDirectory + "Backups\\";
Expand Down Expand Up @@ -356,6 +358,38 @@ private void MainForm_Load(object sender, EventArgs e)
Lang = ConfigurationManager.AppSettings["Lang"] ?? "";
SetLangText(Lang);

if (File.Exists(LazerPath + "storage.ini"))
{
using (var stream = File.Open(LazerPath + "storage.ini", FileMode.Open, FileAccess.Read, FileShare.Read))
{
if (stream == null)
return;

using (var reader = new StreamReader(stream))
{
string line;

while ((line = reader.ReadLine()) != null)
{
int equalsIndex = line.IndexOf('=');

if (line.Length == 0 || line[0] == '#' || equalsIndex < 0) continue;

string key = line.AsSpan(0, equalsIndex).Trim().ToString();
string val = line.AsSpan(equalsIndex + 1).Trim().ToString();

if (key == "FullPath" && val != "")
{
LazerPath = val + @"\";
LazerFilePath = val + @"\files\";
DataBasePath = val + @"\client.realm";
break;
}
}
}
}
}

DeleteWarning = ConfigurationManager.AppSettings["DeleteWarning"] ?? DeleteWarning;
DeleteWarningStripMenuItem.Checked = (DeleteWarning == "1") ? true : false;
CleanTemp = ConfigurationManager.AppSettings["CleanTemp"] ?? CleanTemp;
Expand Down

0 comments on commit 688c70f

Please sign in to comment.