diff --git a/InfiniteStory/InfiniteStory.csproj b/InfiniteStory/InfiniteStory.csproj new file mode 100644 index 0000000..e29b96e --- /dev/null +++ b/InfiniteStory/InfiniteStory.csproj @@ -0,0 +1,7 @@ + + + Assembly-CSharp.InfiniteStory.mm + Allows to watch infinite story per session + + + \ No newline at end of file diff --git a/InfiniteStory/MU3.Sequence/patch_Play.cs b/InfiniteStory/MU3.Sequence/patch_Play.cs new file mode 100644 index 0000000..c70beea --- /dev/null +++ b/InfiniteStory/MU3.Sequence/patch_Play.cs @@ -0,0 +1,13 @@ +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.instance.userLocal.isStoryWatched = false; + } +} \ No newline at end of file diff --git a/InfiniteStory/MU3/patch_Scene_32_PrePlayMusic_MusicSelect.cs b/InfiniteStory/MU3/patch_Scene_32_PrePlayMusic_MusicSelect.cs new file mode 100644 index 0000000..e021dc6 --- /dev/null +++ b/InfiniteStory/MU3/patch_Scene_32_PrePlayMusic_MusicSelect.cs @@ -0,0 +1,215 @@ +using MU3.Data; +using MU3.DataStudio; +using MU3.DB; +using MU3.Game; +using MU3.Sequence; +using MU3.Util; +using MU3.ViewData; +using UnityEngine; + +namespace MU3; + +class patch_Scene_32_PrePlayMusic_MusicSelect: Scene_32_PrePlayMusic_MusicSelect { + private bool _playVoice; + private UIDialogBase _dialogBase; + private ChapterSelectionViewData _chapterSelectionViewData; + private Scene_32_PrePlayMusic _sceneCommonObject; + private bool _isCanceled; + private MusicSelectViewDataList _selectList; + private FumenDifficulty _selectorDifficulty; + private SystemUI.Request _deactivateTimer = SystemUI.Request.Default; + private float timeCountLogOutButtonPressed; + private float _timer; + + [SerializeField] + private UIMusicSelector _selector; + private extern void orig_executeDifficulty(); + private void executeDifficulty() + { + orig_executeDifficulty(); + } + private extern bool orig_updateMatchingTag(); + private bool updateMatchingTag() + { + return orig_updateMatchingTag(); + } + private extern void orig_updateSecretMusic(); + private void updateSecretMusic() + { + orig_updateSecretMusic(); + } + private extern void orig_disableInput(); + private void disableInput() + { + orig_disableInput(); + } + private extern void orig_onFinishPurchaseItem(ChapterItemViewData itemViewData, int status); + private void onFinishPurchaseItem(ChapterItemViewData itemViewData, int status) + { + orig_onFinishPurchaseItem(itemViewData, status); + } + private extern void orig_onFinishPlayScenario(int status, bool flag); + private void onFinishPlayScenario(int status, bool flag) + { + orig_onFinishPlayScenario(status, flag); + } + private extern void orig_onFinishUnlockMusic(MusicViewData musicViewData, int status); + private void onFinishUnlockMusic(MusicViewData musicViewData, int status) + { + orig_onFinishUnlockMusic(musicViewData, status); + } + private extern void orig_updateSystemUIPanel(); + private void updateSystemUIPanel() + { + orig_updateSystemUIPanel(); + } + + private void Execute_Select() { + + if (_dialogBase != null) + { + if (_selector.isTimeOut) + { + _dialogBase.forceCancel(); + } + return; + } + executeDifficulty(); + if (_chapterSelectionViewData.category != ChapterMajorCategoryID.MedalShop) + { + _sceneCommonObject.localMatchingCtrl.addNewRecruitNotice(); + } + updateMatchingTag(); + updateSecretMusic(); + memoryQRReader.update(); + UIInput.UILayeredInput input = _selector.getInput(); + bool flag = false; + if (_selector.isDecided) + { + flag = true; + _isCanceled = false; + } + else if (_selector.isCanceled) + { + flag = true; + _isCanceled = true; + } + else if (_selector.isPressed || _selector.isPressedDisabledElement) + { + MusicSelectViewData musicViewData = _selectList.getMusicViewData(_selector.selectIndex); + if (musicViewData != null) + { + if (musicViewData.kind == MusicSelectViewData.Kind.Music) + { + if (musicViewData.musicViewData.isForMatchingMusic) + { + if (_sceneCommonObject.localMatchingCtrl.startJoin(musicViewData.initOrder, _selectorDifficulty)) + { + if (SingletonMonoBehaviour.instance.systemTimer != null) + { + SingletonMonoBehaviour.instance.systemTimer.deactivate(ref _deactivateTimer); + } + setNextState(EState.MatchingEntryWait); + disableInput(); + } + } + else if (musicViewData.musicViewData.isSphereLock) + { + if (!musicViewData.musicViewData.isShortOfSphere) + { + Singleton.instance.avatarVoice.play(107); + _dialogBase = UIUnlockMusicDialog.create(musicViewData.musicViewData, _selectorDifficulty, _chapterSelectionViewData, onFinishUnlockMusic); + disableInput(); + } + else + { + Singleton.instance.avatarVoice.play(109); + } + } + } + else if (musicViewData.kind == MusicSelectViewData.Kind.Item) + { + ChapterItemViewData itemViewData = musicViewData.itemViewData; + switch (itemViewData.ngReason) + { + case ChapterItemViewData.PurchaseNgReason.ShortOfJewel: + if (itemViewData.jewelWallet != null && itemViewData.jewelWallet.CurrencyType == CurrencyType.Medal) + { + Singleton.instance.avatarVoice.play(1405); + } + else + { + Singleton.instance.avatarVoice.play(109); + } + break; + case ChapterItemViewData.PurchaseNgReason.None: + { + ItemType itemType = itemViewData.itemType; + if (itemType == ItemType.Card) + { + Singleton.instance.avatarVoice.play(108); + } + else + { + Singleton.instance.avatarVoice.play(965); + } + _dialogBase = UIPurchaseItemDialog.create(itemViewData, _chapterSelectionViewData, onFinishPurchaseItem); + disableInput(); + break; + } + } + } + else if (musicViewData.kind == MusicSelectViewData.Kind.Scenario) + { + ScenarioViewData scenarioViewData = musicViewData.scenarioViewData; + ScenarioViewData.PlayNGReason ngReason = scenarioViewData.ngReason; + if (ngReason == ScenarioViewData.PlayNGReason.None) + { + Singleton.instance.avatarVoice.play(1396); + onFinishPlayScenario(0, flag: false); + } + } + } + } + else if (input != null && _selector.isInputActive && !_selector.isDecidedOrWait && !_selector.isCanceledOrWait) + { + if (input.getStateOn(UIInput.Key.MenuLeft)) + { + timeCountLogOutButtonPressed += UnityEngine.Time.deltaTime; + if ((double)timeCountLogOutButtonPressed > 1.5) + { + timeCountLogOutButtonPressed = 0f; + disableInput(); + setNextState(EState.Logout); + } + } + else if (input.getTriggerOn(UIInput.Key.SkipRight, enableRepeat: true)) + { + _selector.moveGenre(1); + } + else if (input.getTriggerOn(UIInput.Key.SkipLeft, enableRepeat: true)) + { + _selector.moveGenre(-1); + } + else if (input.getTriggerOn(UIInput.Key.MenuRight)) + { + MusicSelectViewData selectedMusicSelectViewData = _selector.selectedMusicSelectViewData; + if (selectedMusicSelectViewData != null && selectedMusicSelectViewData.majorCategory == MusicMajorCategoryID.MyList && !selectedMusicSelectViewData.isRandom) + { + disableInput(); + setNextState(EState.Sort); + } + } + if (!input.getStateOn(UIInput.Key.MenuLeft) && timeCountLogOutButtonPressed != 0f) + { + timeCountLogOutButtonPressed = 0f; + } + } + if (flag) + { + _timer = 0f; + setNextState(EState.WaitFinish); + } + updateSystemUIPanel(); + } +} \ No newline at end of file diff --git a/Mu3Mods.sln b/Mu3Mods.sln index 0151335..e297753 100644 --- a/Mu3Mods.sln +++ b/Mu3Mods.sln @@ -41,16 +41,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlatinumTiming", "PlatinumT EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AttractVideoPlayer", "AttractVideoPlayer\AttractVideoPlayer.csproj", "{6889330F-2E7E-4778-ADFF-70AF036F1BD5}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InfiniteStory", "InfiniteStory\InfiniteStory.csproj", "{6F7668B3-4EE0-40DD-8D09-D51D35785B94}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 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 @@ -127,6 +125,10 @@ Global {6889330F-2E7E-4778-ADFF-70AF036F1BD5}.Debug|x64.Build.0 = Debug|x64 {6889330F-2E7E-4778-ADFF-70AF036F1BD5}.Release|x64.ActiveCfg = Release|x64 {6889330F-2E7E-4778-ADFF-70AF036F1BD5}.Release|x64.Build.0 = Release|x64 + {6F7668B3-4EE0-40DD-8D09-D51D35785B94}.Debug|x64.ActiveCfg = Debug|x64 + {6F7668B3-4EE0-40DD-8D09-D51D35785B94}.Debug|x64.Build.0 = Debug|x64 + {6F7668B3-4EE0-40DD-8D09-D51D35785B94}.Release|x64.ActiveCfg = Release|x64 + {6F7668B3-4EE0-40DD-8D09-D51D35785B94}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE