From ef429709da4291dbb28ffc9833650e5abdeb5fa3 Mon Sep 17 00:00:00 2001
From: lxymahatma <326265648@qq.com>
Date: Sun, 19 Feb 2023 19:46:57 +0900
Subject: [PATCH 1/6] remove onsceneload, set indicator when game start
---
.gitignore | 355 +++++++++++++++++-
AccuracyIndicator/AccuracyIndicator.csproj | 203 +++++-----
.../Indicator/InGameIndicator.cs | 2 +-
AccuracyIndicator/Main.cs | 3 -
AccuracyIndicator/Patch/GameStartPatch.cs | 17 +
AccuracyIndicator/Patch/SceneChangePatch.cs | 16 +-
AccuracyIndicator/Properties/AssemblyInfo.cs | 6 +-
7 files changed, 484 insertions(+), 118 deletions(-)
create mode 100644 AccuracyIndicator/Patch/GameStartPatch.cs
diff --git a/.gitignore b/.gitignore
index 182853c..9fb0f72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,353 @@
-.idea
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# Ignore the proxy and the MASM file
+Proxy/proxy.c
+Proxy/dllproxy.asm
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
*.DotSettings.user
-*/bin
-*/obj
\ No newline at end of file
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
\ No newline at end of file
diff --git a/AccuracyIndicator/AccuracyIndicator.csproj b/AccuracyIndicator/AccuracyIndicator.csproj
index 5d68558..8543a57 100644
--- a/AccuracyIndicator/AccuracyIndicator.csproj
+++ b/AccuracyIndicator/AccuracyIndicator.csproj
@@ -1,97 +1,112 @@
-
-
- Debug
- AnyCPU
- {7E1AD6AF-F9E2-4F37-B476-78C2876F3FEC}
- Library
- Properties
- AccuracyIndicator
- AccuracyIndicator
- v4.7.2
- 10.0
- 512
- true
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
-
-
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\0Harmony.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\Assembly-CSharp.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\Il2Cppmscorlib.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\MelonLoader.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\mscorlib.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnhollowerBaseLib.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\Unity.Addressables.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\Unity.ResourceManager.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.CoreModule.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.TextCoreModule.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.TextRenderingModule.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.UI.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.UIElementsModule.dll
-
-
- ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.UIModule.dll
-
-
-
+
+
+ Debug
+ AnyCPU
+ {7E1AD6AF-F9E2-4F37-B476-78C2876F3FEC}
+ Library
+ Properties
+ AccuracyIndicator
+ AccuracyIndicator
+ v4.7.2
+ 10.0
+ 512
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ true
+
+
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\0Harmony.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\Assembly-CSharp.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\Il2Cppmscorlib.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\MelonLoader.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\mscorlib.dll
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnhollowerBaseLib.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\Unity.Addressables.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\Unity.ResourceManager.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.CoreModule.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.TextCoreModule.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.TextRenderingModule.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.UI.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.UIElementsModule.dll
+ False
+
+
+ ..\..\..\Jeux\SteamLibrary\steamapps\common\Muse Dash\MelonLoader\Managed\UnityEngine.UIModule.dll
+ False
+
+
+
\ No newline at end of file
diff --git a/AccuracyIndicator/Indicator/InGameIndicator.cs b/AccuracyIndicator/Indicator/InGameIndicator.cs
index 2babcae..69e8b92 100644
--- a/AccuracyIndicator/Indicator/InGameIndicator.cs
+++ b/AccuracyIndicator/Indicator/InGameIndicator.cs
@@ -93,7 +93,7 @@ public void AddHit(float time)
_hitEntries.Add(new HitEntry(Time.time, time, hitIndicator, hitRi));
- if (time is < -0.14f or > 0.14f)
+ if (time is < -0.13f or > 0.13f)
return;
// -140 = 0
diff --git a/AccuracyIndicator/Main.cs b/AccuracyIndicator/Main.cs
index 1806e6a..b4b0cee 100644
--- a/AccuracyIndicator/Main.cs
+++ b/AccuracyIndicator/Main.cs
@@ -21,9 +21,6 @@ public override void OnInitializeMelon()
HarmonyInstance.PatchAll();
}
- public override void OnSceneWasLoaded(int buildIndex, string sceneName) =>
- SceneChangePatch.OnSceneWasLoaded(sceneName);
-
public override void OnSceneWasUnloaded(int buildIndex, string sceneName) =>
SceneChangePatch.OnSceneWasUnloaded(sceneName);
diff --git a/AccuracyIndicator/Patch/GameStartPatch.cs b/AccuracyIndicator/Patch/GameStartPatch.cs
new file mode 100644
index 0000000..91ab122
--- /dev/null
+++ b/AccuracyIndicator/Patch/GameStartPatch.cs
@@ -0,0 +1,17 @@
+using AccuracyIndicator.Indicator;
+using FormulaBase;
+using HarmonyLib;
+using UnityEngine;
+
+namespace AccuracyIndicator.Patch
+{
+ [HarmonyPatch(typeof(StageBattleComponent), "GameStart")]
+ public static class GameStartPatch
+ {
+ private static void Postfix()
+ {
+ Main.IndicatorObj = new GameObject("Indicator");
+ Main.InGameIndicator = Main.IndicatorObj.AddComponent();
+ }
+ }
+}
diff --git a/AccuracyIndicator/Patch/SceneChangePatch.cs b/AccuracyIndicator/Patch/SceneChangePatch.cs
index fa42ea3..29c16ad 100644
--- a/AccuracyIndicator/Patch/SceneChangePatch.cs
+++ b/AccuracyIndicator/Patch/SceneChangePatch.cs
@@ -1,23 +1,11 @@
-using HarmonyLib;
-using AccuracyIndicator.Indicator;
+using AccuracyIndicator.Indicator;
+using HarmonyLib;
using UnityEngine;
namespace AccuracyIndicator.Patch;
public static class SceneChangePatch
{
-
- public static void OnSceneWasLoaded(string sceneName)
- {
- switch (sceneName)
- {
- case "GameMain":
- Main.IndicatorObj = new GameObject("Indicator");
- Main.InGameIndicator = Main.IndicatorObj.AddComponent();
- break;
- }
- }
-
public static void OnSceneWasUnloaded(string sceneName)
{
switch (sceneName)
diff --git a/AccuracyIndicator/Properties/AssemblyInfo.cs b/AccuracyIndicator/Properties/AssemblyInfo.cs
index ef72663..dd7544c 100644
--- a/AccuracyIndicator/Properties/AssemblyInfo.cs
+++ b/AccuracyIndicator/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.2.0.0")]
-[assembly: AssemblyFileVersion("1.2.0.0")]
+[assembly: AssemblyVersion("1.2.1.0")]
+[assembly: AssemblyFileVersion("1.2.1.0")]
-[assembly: MelonInfo(typeof(Main), "Accuracy Indicator", "1.2.0", "Azn9", "https://github.com/Azn9/MDAccuracyIndicatorMod")]
+[assembly: MelonInfo(typeof(Main), "Accuracy Indicator", "1.2.1", "Azn9", "https://github.com/Azn9/MDAccuracyIndicatorMod")]
[assembly: MelonGame("PeroPeroGames", "MuseDash")]
\ No newline at end of file
From cfbb19d8ae0191b4de05ec1738e7c63a25ed5a1f Mon Sep 17 00:00:00 2001
From: lxymahatma <326265648@qq.com>
Date: Sun, 19 Feb 2023 20:04:20 +0900
Subject: [PATCH 2/6] fix patch error when retry chart (ig)
---
AccuracyIndicator/Indicator/InGameIndicator.cs | 4 ++--
AccuracyIndicator/Patch/PauseResumePatch.cs | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/AccuracyIndicator/Indicator/InGameIndicator.cs b/AccuracyIndicator/Indicator/InGameIndicator.cs
index 69e8b92..3a6a9ec 100644
--- a/AccuracyIndicator/Indicator/InGameIndicator.cs
+++ b/AccuracyIndicator/Indicator/InGameIndicator.cs
@@ -39,11 +39,11 @@ private void Start()
_canvas.AddComponent();
_canvas.GetComponent