InfiniteStory #6
7
InfiniteStory/InfiniteStory.csproj
Normal file
7
InfiniteStory/InfiniteStory.csproj
Normal file
@ -0,0 +1,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<AssemblyName>Assembly-CSharp.InfiniteStory.mm</AssemblyName>
|
||||
<Description>Allows to watch infinite story per session</Description>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\Mu3Mods.csproj" />
|
||||
</Project>
|
13
InfiniteStory/MU3.Sequence/patch_Play.cs
Normal file
13
InfiniteStory/MU3.Sequence/patch_Play.cs
Normal file
@ -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<UserManager>.instance.userLocal.isStoryWatched = false;
|
||||
}
|
||||
}
|
215
InfiniteStory/MU3/patch_Scene_32_PrePlayMusic_MusicSelect.cs
Normal file
215
InfiniteStory/MU3/patch_Scene_32_PrePlayMusic_MusicSelect.cs
Normal file
@ -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<SystemUI>.instance.systemTimer != null)
|
||||
{
|
||||
SingletonMonoBehaviour<SystemUI>.instance.systemTimer.deactivate(ref _deactivateTimer);
|
||||
}
|
||||
setNextState(EState.MatchingEntryWait);
|
||||
disableInput();
|
||||
}
|
||||
}
|
||||
else if (musicViewData.musicViewData.isSphereLock)
|
||||
{
|
||||
if (!musicViewData.musicViewData.isShortOfSphere)
|
||||
{
|
||||
Singleton<GameSound>.instance.avatarVoice.play(107);
|
||||
_dialogBase = UIUnlockMusicDialog.create(musicViewData.musicViewData, _selectorDifficulty, _chapterSelectionViewData, onFinishUnlockMusic);
|
||||
disableInput();
|
||||
}
|
||||
else
|
||||
{
|
||||
Singleton<GameSound>.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<GameSound>.instance.avatarVoice.play(1405);
|
||||
}
|
||||
else
|
||||
{
|
||||
Singleton<GameSound>.instance.avatarVoice.play(109);
|
||||
}
|
||||
break;
|
||||
case ChapterItemViewData.PurchaseNgReason.None:
|
||||
{
|
||||
ItemType itemType = itemViewData.itemType;
|
||||
if (itemType == ItemType.Card)
|
||||
{
|
||||
Singleton<GameSound>.instance.avatarVoice.play(108);
|
||||
}
|
||||
else
|
||||
{
|
||||
Singleton<GameSound>.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<GameSound>.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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user