Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
40163650 committed May 20, 2022
2 parents d97fd0d + 3b73b06 commit db456b9
Show file tree
Hide file tree
Showing 125 changed files with 2,832 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# CS8622: Nullability of reference types in type of parameter doesn't match the target delegate (possibly because of nullability attributes).
dotnet_diagnostic.CS8622.severity = none
Binary file added .vs/ProjectEvaluation/songanalyser.metadata.v2
Binary file not shown.
Binary file added .vs/ProjectEvaluation/songanalyser.projects.v2
Binary file not shown.
Binary file added .vs/SongAnalyser/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added .vs/SongAnalyser/v17/.futdcache.v1
Binary file not shown.
Binary file added .vs/SongAnalyser/v17/.suo
Binary file not shown.
1 change: 1 addition & 0 deletions BeatSaberCustomSongInfo
Submodule BeatSaberCustomSongInfo added at d97fd0
87 changes: 87 additions & 0 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 79 additions & 0 deletions Form1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
using Microsoft.Win32;

namespace SongAnalyser
{
public partial class Form1 : Form
{
public static string path = "";
public Form1()
{
InitializeComponent();
}

private void btnAnalyse_Click(object sender, EventArgs e)
{
path = tbPath.Text;

if(Directory.Exists(path))
{
Results results = new();
results.Show();
Hide();
}
else
{
MessageBox.Show("Path does not exist");
}
}

private void Form1_Load(object sender, EventArgs e)
{
RegistryKey? steamKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Valve\\Steam");
if(steamKey == null)
{
steamKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Wow6432Node\\Valve\\Steam");
if(steamKey == null)
{
return;
}
}

object? o = steamKey.GetValue("InstallPath");
if(o == null)
{
return;
}

string? installPath = o as string; // where steam.exe is
string vdfFile = installPath + "/steamapps/libraryfolders.vdf";
if(!File.Exists(vdfFile))
{
return;
}

List<string> lines = new();
string path = "";
foreach(string line in File.ReadLines(vdfFile))
{
lines.Add(line);
// we have beat saber
if(line.Contains("\"620980\""))
{
// traverse lines backwards
for(int i = lines.Count - 1; i >= 0; i--)
{
if (lines[i].Contains("path"))
{
// same as lines[i].Substring(11, lines[i].Length - 12)
path = lines[i][11..^1] + "/steamapps/common/Beat Saber/Beat Saber_Data/CustomLevels";
break;
}
}
break;
}
}

tbPath.Text = path;
}
}
}
60 changes: 60 additions & 0 deletions Form1.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
17 changes: 17 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace SongAnalyser
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
}
}
}
17 changes: 17 additions & 0 deletions Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net6.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>
</Project>
9 changes: 9 additions & 0 deletions Properties/PublishProfiles/FolderProfile.pubxml.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2022-05-20T14:39:16.7593643Z;True|2022-05-19T11:51:33.2028250+01:00;True|2022-05-18T23:25:52.5439790+01:00;True|2022-05-17T22:40:34.9974871+01:00;False|2022-05-17T22:40:07.0001215+01:00;True|2022-05-17T22:35:55.7124069+01:00;False|2022-05-17T22:35:40.7185512+01:00;True|2022-05-17T22:30:40.3887842+01:00;False|2022-05-17T22:29:42.4052652+01:00;True|2022-05-17T22:24:01.6030290+01:00;</History>
</PropertyGroup>
</Project>
110 changes: 110 additions & 0 deletions Results.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit db456b9

Please sign in to comment.