From e39dcc72e741c654273f823f3ef5ef1130254c5d Mon Sep 17 00:00:00 2001 From: Jujuforce Date: Tue, 23 Jul 2024 22:35:53 +0200 Subject: [PATCH] Merge branch 'main' of https://gitea.tendokyu.moe/jujuforce/mu3-mods # Conflicts: # AttractVideoPlayer/AttractVideoPlayer.csproj # AttractVideoPlayer/MU3.OperationManager/patch_OperationManager.cs # AttractVideoPlayer/MU3.Sequence/patch_Advertise.cs # AttractVideoPlayer/MU3/patch_AdvManager.cs --- .../patch_OperationManager.cs | 20 ++++++------------- .../MU3.Sequence/patch_Advertise.cs | 12 +++++------ AttractVideoPlayer/MU3/patch_AdvManager.cs | 18 ----------------- Mu3Mods.sln | 6 ++++++ 4 files changed, 18 insertions(+), 38 deletions(-) diff --git a/AttractVideoPlayer/MU3.OperationManager/patch_OperationManager.cs b/AttractVideoPlayer/MU3.OperationManager/patch_OperationManager.cs index 5ecafcf..96b64e1 100644 --- a/AttractVideoPlayer/MU3.OperationManager/patch_OperationManager.cs +++ b/AttractVideoPlayer/MU3.OperationManager/patch_OperationManager.cs @@ -5,22 +5,18 @@ using System.IO; namespace MU3.Operation; class patch_OperationManager: OperationManager { + private static readonly string _fname = "data_advert_cache.txt"; private ReadOnlyCollection _movieDataList; private int _movieIndex; - private string _fileName; ~patch_OperationManager() { try { - File.WriteAllText(_fileName, MovieIndex.ToString()); - } catch(Exception) { } + File.WriteAllText(_fname, _movieIndex.ToString()); + } catch(Exception) {} } public int MovieIndex { set { - if(_movieDataList.Count > 0) { - _movieIndex = (value + _movieDataList.Count) % _movieDataList.Count; - } else { - _movieIndex = 0; - } + _movieIndex = (value + _movieDataList.Count) % _movieDataList.Count; } get { return _movieIndex; @@ -29,7 +25,7 @@ class patch_OperationManager: OperationManager { public new MovieData movieData { get { if(_movieDataList.Count > 0) { - return _movieDataList[MovieIndex]; + return _movieDataList[_movieIndex]; } return null; } @@ -39,12 +35,8 @@ class patch_OperationManager: OperationManager { public new void initialize() { orig_initialize(); - - using IniFile iniFile = new("mu3.ini"); - _fileName = Path.Combine(iniFile.getValue("Extra", "CacheDir", "."), "data_advert_cache.txt"); - try { - _movieIndex = Math.Max(0, int.Parse(File.ReadAllText(_fileName))); + _movieIndex = Math.Max(0, int.Parse(File.ReadAllText(_fname))); } catch(Exception) { _movieIndex = 0; } diff --git a/AttractVideoPlayer/MU3.Sequence/patch_Advertise.cs b/AttractVideoPlayer/MU3.Sequence/patch_Advertise.cs index 5b13bcf..ed96a89 100644 --- a/AttractVideoPlayer/MU3.Sequence/patch_Advertise.cs +++ b/AttractVideoPlayer/MU3.Sequence/patch_Advertise.cs @@ -6,12 +6,12 @@ class patch_Advertise: Advertise { // Exclude Back/Left/Right private bool anyKeyDown() { UIInput instance = Singleton.instance; - if(instance.getTriggerOn(UIInput.Key.Decision) - || instance.getTriggerOn(UIInput.Key.OptionBackward) - || instance.getTriggerOn(UIInput.Key.OptionForward) - || instance.getTriggerOn(UIInput.Key.SkipLeft) - || instance.getTriggerOn(UIInput.Key.SkipRight) - || instance.getTriggerOn(UIInput.Key.MenuLeft) + if(instance.getTriggerOn(UIInput.Key.Decision) + || instance.getTriggerOn(UIInput.Key.OptionBackward) + || instance.getTriggerOn(UIInput.Key.OptionForward) + || instance.getTriggerOn(UIInput.Key.SkipLeft) + || instance.getTriggerOn(UIInput.Key.SkipRight) + || instance.getTriggerOn(UIInput.Key.MenuLeft) || instance.getTriggerOn(UIInput.Key.MenuRight)) { return true; } diff --git a/AttractVideoPlayer/MU3/patch_AdvManager.cs b/AttractVideoPlayer/MU3/patch_AdvManager.cs index cb50e21..67708c5 100644 --- a/AttractVideoPlayer/MU3/patch_AdvManager.cs +++ b/AttractVideoPlayer/MU3/patch_AdvManager.cs @@ -32,22 +32,4 @@ class patch_AdvManager: AdvManager { initMovie(); } - - public extern bool orig_initMovie(); - public new bool initMovie() { - UIInput instance = Singleton.instance; - instance.setLedColor(UIInput.Key.L2, new Color(0f, 0.7f, 0f)); - instance.setLedColor(UIInput.Key.L3, new Color(0f, 0.7f, 0f)); - - return orig_initMovie(); - } - - public extern void orig_exitMovie(); - public new void exitMovie() { - orig_exitMovie(); - - UIInput instance = Singleton.instance; - instance.setLedColor(UIInput.Key.L2, Color.black); - instance.setLedColor(UIInput.Key.L3, Color.black); - } } \ No newline at end of file diff --git a/Mu3Mods.sln b/Mu3Mods.sln index 9c71b3d..e6a0f7d 100644 --- a/Mu3Mods.sln +++ b/Mu3Mods.sln @@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.9.34728.123 MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AttractVideoPlayer", "AttractVideoPlayer\AttractVideoPlayer.csproj", "{003AD3C6-07CA-4824-B4BD-4BEF6F3D8999}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterGiveUp", "BetterGiveUp\BetterGiveUp.csproj", "{003AD3C6-07CA-4824-B4BD-4BEF6F3D8997}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NaiveRating", "NaiveRating\NaiveRating.csproj", "{1FEA698E-DF5E-46CF-8023-F2B2F57885C5}" @@ -47,6 +49,10 @@ Global Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {003AD3C6-07CA-4824-B4BD-4BEF6F3D8999}.Debug|x64.ActiveCfg = Debug|x64 + {003AD3C6-07CA-4824-B4BD-4BEF6F3D8999}.Debug|x64.Build.0 = Debug|x64 + {003AD3C6-07CA-4824-B4BD-4BEF6F3D8999}.Release|x64.ActiveCfg = Release|x64 + {003AD3C6-07CA-4824-B4BD-4BEF6F3D8999}.Release|x64.Build.0 = Release|x64 {003AD3C6-07CA-4824-B4BD-4BEF6F3D8997}.Debug|x64.ActiveCfg = Debug|x64 {003AD3C6-07CA-4824-B4BD-4BEF6F3D8997}.Debug|x64.Build.0 = Debug|x64 {003AD3C6-07CA-4824-B4BD-4BEF6F3D8997}.Release|x64.ActiveCfg = Release|x64