mirror of
https://github.com/Theaninova/HitScoreVisualizer.git
synced 2026-01-11 12:02:48 +00:00
First Release
This commit is contained in:
@@ -124,6 +124,7 @@ namespace HitScoreVisualizer
|
|||||||
|
|
||||||
// path to where the config is saved
|
// path to where the config is saved
|
||||||
private const string FILE_PATH = "/UserData/HitScoreVisualizerConfig.json";
|
private const string FILE_PATH = "/UserData/HitScoreVisualizerConfig.json";
|
||||||
|
private const string FILE_PATH_RATINGS = "\\Ratings\\Latest.txt";
|
||||||
|
|
||||||
private const string DEFAULT_JSON = @"{
|
private const string DEFAULT_JSON = @"{
|
||||||
""majorVersion"": 2,
|
""majorVersion"": 2,
|
||||||
@@ -255,6 +256,7 @@ namespace HitScoreVisualizer
|
|||||||
};
|
};
|
||||||
|
|
||||||
public static string fullPath => Environment.CurrentDirectory.Replace('\\', '/') + FILE_PATH;
|
public static string fullPath => Environment.CurrentDirectory.Replace('\\', '/') + FILE_PATH;
|
||||||
|
public static string fullPathRatings => Environment.CurrentDirectory + FILE_PATH_RATINGS;
|
||||||
|
|
||||||
public static void load()
|
public static void load()
|
||||||
{
|
{
|
||||||
@@ -450,6 +452,16 @@ namespace HitScoreVisualizer
|
|||||||
formattedBuilder.Append("<color=#" + floatToHexColor(1f - afterCut) + floatToHexColor(afterCut) + "00>" + afterCutScore);
|
formattedBuilder.Append("<color=#" + floatToHexColor(1f - afterCut) + floatToHexColor(afterCut) + "00>" + afterCutScore);
|
||||||
|
|
||||||
text.text = formattedBuilder.ToString();
|
text.text = formattedBuilder.ToString();
|
||||||
|
|
||||||
|
if (saberAfterCutSwingRatingCounter.didFinish)
|
||||||
|
{
|
||||||
|
using (StreamWriter file = File.AppendText(fullPathRatings))
|
||||||
|
{
|
||||||
|
file.WriteLine(saberAfterCutSwingRatingCounter.RequestId + " <<>> " + beforeCut + " " + accuracy + " " + afterCut + " | " + score);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (instance.displayMode == mode_format)
|
else if (instance.displayMode == mode_format)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>..\..\..\..\Steam Games\steamapps\common\Beat Saber\Plugins\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ namespace HitScoreVisualizer
|
|||||||
|
|
||||||
public void OnApplicationStart()
|
public void OnApplicationStart()
|
||||||
{
|
{
|
||||||
|
System.IO.File.WriteAllText(Config.fullPathRatings, "NO DATA");
|
||||||
|
|
||||||
SceneManager.activeSceneChanged += SceneManagerOnActiveSceneChanged;
|
SceneManager.activeSceneChanged += SceneManagerOnActiveSceneChanged;
|
||||||
SceneManager.sceneLoaded += SceneManager_sceneLoaded;
|
SceneManager.sceneLoaded += SceneManager_sceneLoaded;
|
||||||
try
|
try
|
||||||
@@ -33,8 +35,27 @@ namespace HitScoreVisualizer
|
|||||||
Config.load();
|
Config.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SceneManagerOnActiveSceneChanged(Scene arg0, Scene arg1)
|
private void SceneManagerOnActiveSceneChanged(Scene arg0, Scene newScene)
|
||||||
{
|
{
|
||||||
|
switch (newScene.buildIndex)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
// Return if we're not playing in a song.
|
||||||
|
return;
|
||||||
|
case 8:
|
||||||
|
case 9:
|
||||||
|
// We're in a song
|
||||||
|
//System.IO.File.WriteAllText(Config.fullPathRatings, newScene.name);
|
||||||
|
return;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Unknown, fallback to matching the name.
|
||||||
|
if (newScene.name.Contains("Environment"))
|
||||||
|
goto case 8;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1)
|
private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1)
|
||||||
|
|||||||
Reference in New Issue
Block a user