Compare commits

...

5 Commits
2.2.0 ... main

Author SHA1 Message Date
ca15fac6a1 fix: don't store SortByInternal in db 2024-08-30 17:20:26 +00:00
ebb78efcde fix: item popup disappearing 2024-08-30 14:54:59 +00:00
2204fb4756 fix: shop confirmation dialog not showing (#7)
Co-authored-by: Jujuforce <jujuforce@gmail.com>
Co-authored-by: akanyan <alicechecker01@proton.me>
Co-authored-by: あかニャン <akanyan@noreply.gitea.tendokyu.moe>
Reviewed-on: #7
Co-authored-by: jujuforce <jujuforce@noreply.gitea.tendokyu.moe>
Co-committed-by: jujuforce <jujuforce@noreply.gitea.tendokyu.moe>
2024-08-30 14:53:27 +00:00
66fdc27787 feat: implement InfiniteStory (#6)
Infinite Story mod
- Allows watching an infinite number of stories per session
- Skips the dialog about it when selecting a story

Co-authored-by: Jujuforce <jujuforce@gmail.com>
Co-authored-by: akanyan <alicechecker01@proton.me>
Reviewed-on: #6
Co-authored-by: jujuforce <jujuforce@noreply.gitea.tendokyu.moe>
Co-committed-by: jujuforce <jujuforce@noreply.gitea.tendokyu.moe>
2024-08-24 16:29:07 +00:00
032b6864da fix: cache mkdir
I originally left it out because I wanted to avoid unnecessary
code duplication. Turns out it wasn't unnecessary.
2024-08-24 14:14:02 +00:00
10 changed files with 96 additions and 12 deletions

View File

@ -12,7 +12,9 @@ class patch_OperationManager: OperationManager {
~patch_OperationManager() {
try {
File.WriteAllText(_fileName, MovieIndex.ToString());
} catch(Exception) { }
} catch(Exception ex) {
System.Console.WriteLine(ex);
}
}
public int MovieIndex {
set {
@ -41,7 +43,9 @@ class patch_OperationManager: OperationManager {
orig_initialize();
using IniFile iniFile = new("mu3.ini");
_fileName = Path.Combine(iniFile.getValue("Extra", "CacheDir", "."), "data_advert_cache.txt");
var dir = iniFile.getValue("Extra", "CacheDir", ".");
Directory.CreateDirectory(dir);
_fileName = Path.Combine(dir, "data_advert_cache.txt");
try {
_movieIndex = Math.Max(0, int.Parse(File.ReadAllText(_fileName)));

View File

@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<AssemblyName>Assembly-CSharp.InfiniteStory.mm</AssemblyName>
<Description>Allows watching the story endlessly</Description>
</PropertyGroup>
<Import Project="..\Mu3Mods.csproj" />
</Project>

View File

@ -0,0 +1,12 @@
using MU3.User;
using MU3.Util;
namespace MU3.Sequence;
class patch_Play: Play {
private extern void orig_Enter_PlayScenario();
private void Enter_PlayScenario() {
orig_Enter_PlayScenario();
Singleton<UserManager>.instance.userLocal.isStoryWatched = false;
}
}

View File

@ -0,0 +1,30 @@
using MonoMod;
using MU3.ViewData;
namespace MU3;
class patch_Scene_32_PrePlayMusic_MusicSelect: Scene_32_PrePlayMusic_MusicSelect {
private MusicSelectViewDataList _selectList;
private UIMusicSelector _selector;
private UIDialogBase _dialogBase;
[MonoModIgnore]
private extern void onFinishPlayScenario(int status, bool flag);
[MonoModIgnore]
private extern void updateSystemUIPanel();
private extern void orig_Execute_Select();
private void Execute_Select() {
// Walk around the warning dialog
if(_dialogBase == null && !_selector.isDecided && !_selector.isCanceled && (_selector.isPressed || _selector.isPressedDisabledElement)) {
MusicSelectViewData musicViewData = _selectList.getMusicViewData(_selector.selectIndex);
if(musicViewData != null && musicViewData.kind == MusicSelectViewData.Kind.Scenario
&& musicViewData.scenarioViewData.ngReason == ScenarioViewData.PlayNGReason.None) {
onFinishPlayScenario(0, false);
updateSystemUIPanel();
return;
}
}
orig_Execute_Select();
}
}

View File

@ -13,7 +13,9 @@ public class patch_DataStudioManager: DataStudioManager {
private static void initCache() {
using IniFile iniFile = new("mu3.ini");
_fileName = Path.Combine(iniFile.getValue("Extra", "CacheDir", "."), "data_cache.bin");
var dir = iniFile.getValue("Extra", "CacheDir", ".");
Directory.CreateDirectory(dir);
_fileName = Path.Combine(dir, "data_cache.bin");
if(File.Exists(_fileName)) {
System.Console.WriteLine("Loading data cache...");

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net35</TargetFramework>
<Company>7EVENDAYS⇔HOLIDAYS</Company>
<Version>2.2.0</Version>
<Version>2.3.1</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<Platforms>x64</Platforms>

View File

@ -1,5 +1,4 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
MinimumVisualStudioVersion = 10.0.40219.1
@ -43,6 +42,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AttractVideoPlayer", "Attra
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SelectBGM", "SelectBGM\SelectBGM.csproj", "{07C01DA1-7ABF-4759-A1C2-9DCD04298E85}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InfiniteStory", "InfiniteStory\InfiniteStory.csproj", "{939914E5-8D9A-4696-9957-AA6C6480FE94}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@ -129,6 +130,10 @@ Global
{07C01DA1-7ABF-4759-A1C2-9DCD04298E85}.Debug|x64.Build.0 = Debug|x64
{07C01DA1-7ABF-4759-A1C2-9DCD04298E85}.Release|x64.ActiveCfg = Release|x64
{07C01DA1-7ABF-4759-A1C2-9DCD04298E85}.Release|x64.Build.0 = Release|x64
{939914E5-8D9A-4696-9957-AA6C6480FE94}.Debug|x64.ActiveCfg = Debug|x64
{939914E5-8D9A-4696-9957-AA6C6480FE94}.Debug|x64.Build.0 = Debug|x64
{939914E5-8D9A-4696-9957-AA6C6480FE94}.Release|x64.ActiveCfg = Release|x64
{939914E5-8D9A-4696-9957-AA6C6480FE94}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -136,4 +141,4 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D9317002-F66D-4CDE-8FF5-FF2A0D8DC021}
EndGlobalSection
EndGlobal
EndGlobal

View File

@ -23,4 +23,8 @@ class patch_Scene_30_NoticeReward: Scene_30_NoticeReward {
_mode.update();
}
}
private void End_Init() {
Skipped = false;
}
}

View File

@ -0,0 +1,20 @@
using MU3.Client;
using MU3.DB;
namespace MU3.User;
class patch_UserDetail: UserDetail {
public extern void orig_copyTo(UserData userDetail);
public new void copyTo(UserData userDetail) {
orig_copyTo(userDetail);
// Attempting to use a profile with InternalLevel sorting enabled
// causes unpatched clients to crash thanks to enormous incompetence
// of Sxga's interns. So, unfortunately, this value has to be discarded.
// See:
// * MusicSelectViewDataList._sort1 set
// * UserDetail.copyFrom()
if(userDetail.tabSetting == (int)patch_MusicSort1ID.InternalLevel) {
userDetail.tabSetting = (int)patch_MusicSort1ID.Level;
}
}
}

View File

@ -15,6 +15,7 @@ class patch_MusicSelectViewDataList: MusicSelectViewDataList {
private CompareProc _compareProc1;
private CompareProc _compareProc2;
private GetCategoryNameProc _getCategoryNameProc;
private PropertyInfo _reMasterPi = null;
private extern void orig_set__sort1(MusicSort1ID value);
private extern void orig_set__sort2(MusicSort2ID value);
@ -36,19 +37,18 @@ class patch_MusicSelectViewDataList: MusicSelectViewDataList {
}
}
private PropertyInfo reMasterPi = null;
private bool isReMaster(Data.MusicData d) {
// Fall back for pre-Act3
if(reMasterPi == null) {
if(_reMasterPi == null) {
return false;
}
return (bool)reMasterPi.GetValue(d, null);
return (bool)_reMasterPi.GetValue(d, null);
}
public extern void orig_create(GameViewData gameViewData, ChapterSelection chapterSelection, FumenDifficulty difficulty, MusicSort1ID sort1, MusicSort2ID sort2);
public new void create(GameViewData gameViewData, ChapterSelection chapterSelection, FumenDifficulty difficulty, MusicSort1ID sort1, MusicSort2ID sort2) {
reMasterPi = typeof(Data.MusicData).GetProperty("isReMaster");
_reMasterPi = typeof(Data.MusicData).GetProperty("isReMaster");
orig_create(gameViewData, chapterSelection, difficulty, sort1, sort2);
}
@ -100,7 +100,7 @@ class patch_MusicSelectViewDataList: MusicSelectViewDataList {
private extern int orig_getMetaSortKey(MusicSelectViewData d, bool forCategorySort);
private int getMetaSortKey(MusicSelectViewData d, bool forCategorySort) {
if(reMasterPi == null) {
if(_reMasterPi == null) {
return orig_getMetaSortKey(d, forCategorySort);
}
var remas = isReMaster(d.musicViewData.data);