Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
ca15fac6a1 | |||
ebb78efcde | |||
2204fb4756 | |||
66fdc27787 | |||
032b6864da | |||
07ee892b43 | |||
920d2386d5 | |||
4ad595f6c3 | |||
8cbc7e8b86 | |||
7f5cd6d0d7 | |||
381d888da6 | |||
946402fa82 |
7
AttractVideoPlayer/AttractVideoPlayer.csproj
Normal file
7
AttractVideoPlayer/AttractVideoPlayer.csproj
Normal file
@ -0,0 +1,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<AssemblyName>Assembly-CSharp.AttractVideoPlayer.mm</AssemblyName>
|
||||
<Description>Control attract video</Description>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\Mu3Mods.csproj" />
|
||||
</Project>
|
@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
|
||||
namespace MU3.Operation;
|
||||
|
||||
class patch_OperationManager: OperationManager {
|
||||
private ReadOnlyCollection<MovieData> _movieDataList;
|
||||
private int _movieIndex;
|
||||
private string _fileName;
|
||||
|
||||
~patch_OperationManager() {
|
||||
try {
|
||||
File.WriteAllText(_fileName, MovieIndex.ToString());
|
||||
} catch(Exception ex) {
|
||||
System.Console.WriteLine(ex);
|
||||
}
|
||||
}
|
||||
public int MovieIndex {
|
||||
set {
|
||||
if(_movieDataList.Count > 0) {
|
||||
_movieIndex = (value + _movieDataList.Count) % _movieDataList.Count;
|
||||
} else {
|
||||
_movieIndex = 0;
|
||||
}
|
||||
}
|
||||
get {
|
||||
return _movieIndex;
|
||||
}
|
||||
}
|
||||
public new MovieData movieData {
|
||||
get {
|
||||
if(_movieDataList.Count > 0) {
|
||||
return _movieDataList[MovieIndex];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public extern void orig_initialize();
|
||||
|
||||
public new void initialize() {
|
||||
orig_initialize();
|
||||
|
||||
using IniFile iniFile = new("mu3.ini");
|
||||
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)));
|
||||
} catch(Exception) {
|
||||
_movieIndex = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
20
AttractVideoPlayer/MU3.Sequence/patch_Advertise.cs
Normal file
20
AttractVideoPlayer/MU3.Sequence/patch_Advertise.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using MU3.Util;
|
||||
|
||||
namespace MU3.Sequence;
|
||||
|
||||
class patch_Advertise: Advertise {
|
||||
// Exclude Back/Left/Right
|
||||
private bool anyKeyDown() {
|
||||
UIInput instance = Singleton<UIInput>.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)
|
||||
|| instance.getTriggerOn(UIInput.Key.MenuRight)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
53
AttractVideoPlayer/MU3/patch_AdvManager.cs
Normal file
53
AttractVideoPlayer/MU3/patch_AdvManager.cs
Normal file
@ -0,0 +1,53 @@
|
||||
using MU3.Operation;
|
||||
using MU3.Util;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3;
|
||||
|
||||
class patch_AdvManager: AdvManager {
|
||||
private GameObject objMovie;
|
||||
private CriManaMovieMaterial movieController;
|
||||
|
||||
private extern bool orig_exec();
|
||||
public new bool exec() {
|
||||
if(movieController?.player?.status == CriMana.Player.Status.Playing) {
|
||||
if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.Service)) {
|
||||
movieController.player.Pause(!movieController.player.IsPaused());
|
||||
} else if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.L2)) {
|
||||
addMovieOffset(-1);
|
||||
} else if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.L3)) {
|
||||
addMovieOffset(1);
|
||||
}
|
||||
}
|
||||
|
||||
return orig_exec();
|
||||
}
|
||||
public void addMovieOffset(int offset) {
|
||||
var om = (patch_OperationManager)Singleton<OperationManager>.instance;
|
||||
om.MovieIndex += offset;
|
||||
|
||||
movieController.Stop();
|
||||
Utility.destroyGameObject(ref movieController);
|
||||
Utility.destroyGameObject(ref objMovie);
|
||||
|
||||
initMovie();
|
||||
}
|
||||
|
||||
public extern bool orig_initMovie();
|
||||
public new bool initMovie() {
|
||||
UIInput instance = Singleton<UIInput>.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<UIInput>.instance;
|
||||
instance.setLedColor(UIInput.Key.L2, Color.black);
|
||||
instance.setLedColor(UIInput.Key.L3, Color.black);
|
||||
}
|
||||
}
|
@ -13,6 +13,7 @@ class patch_PlayMusic: PlayMusic {
|
||||
public static bool QuickSkip = false;
|
||||
private GameEngine _gameEngine;
|
||||
private SessionInfo _sessionInfo;
|
||||
private bool _pressedYellow;
|
||||
private bool _isRolling;
|
||||
private float _totalRollingFrame;
|
||||
private DateTime _rollingStartTime;
|
||||
@ -30,11 +31,13 @@ class patch_PlayMusic: PlayMusic {
|
||||
return min + (max - min) * Math.Pow(progress, 2.0);
|
||||
}
|
||||
|
||||
private static bool IsHolding() {
|
||||
return Singleton<UIInput>.instance.getStateOn(UIInput.Key.MenuLeft) ^ Singleton<UIInput>.instance.getStateOn(UIInput.Key.MenuRight);
|
||||
private bool IsHolding() {
|
||||
return Singleton<UIInput>.instance.getStateOn(UIInput.Key.MenuLeft)
|
||||
^ (_pressedYellow && Singleton<UIInput>.instance.getStateOn(UIInput.Key.MenuRight));
|
||||
}
|
||||
|
||||
private void StartRolling() {
|
||||
_pressedYellow = false;
|
||||
_isRolling = true;
|
||||
_totalRollingFrame = ntMgr.getCurrentFrame();
|
||||
_rollingStartTime = CustomDateTime.Now;
|
||||
@ -60,6 +63,9 @@ class patch_PlayMusic: PlayMusic {
|
||||
}
|
||||
|
||||
private void Execute_Play() {
|
||||
if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuRight)) {
|
||||
_pressedYellow = true;
|
||||
}
|
||||
if(_isRolling) {
|
||||
TimeSpan timeSpan = CustomDateTime.Now - _rollingStartTime;
|
||||
if(timeSpan <= ROLL_DURATION) {
|
||||
|
@ -1,13 +1,12 @@
|
||||
namespace MU3.User;
|
||||
|
||||
class patch_UserManager: UserManager {
|
||||
public new const int DefaultGP = 666;
|
||||
public new const int DefaultGP = 999;
|
||||
private int _gp;
|
||||
private OnUpdate _onUpdateGP;
|
||||
private OnReset _onResetGP;
|
||||
|
||||
public new void resetGP() {
|
||||
_gp = 999;
|
||||
if(_onResetGP != null) {
|
||||
_onResetGP(_gp);
|
||||
}
|
||||
@ -18,10 +17,20 @@ class patch_UserManager: UserManager {
|
||||
return _gp;
|
||||
}
|
||||
private set {
|
||||
_gp = 999;
|
||||
if(_onUpdateGP != null) {
|
||||
_onUpdateGP(_gp);
|
||||
}
|
||||
}
|
||||
}
|
||||
public new bool checkBattleGP(int needed) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public extern void orig_initialize();
|
||||
public new void initialize() {
|
||||
orig_initialize();
|
||||
|
||||
using IniFile iniFile = new("mu3.ini");
|
||||
_gp = iniFile.getIntValue("Extra", "GP", 999);
|
||||
}
|
||||
}
|
55
InfiniteGP/MU3/patch_UICredit.cs
Normal file
55
InfiniteGP/MU3/patch_UICredit.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using MU3.CustomUI;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3;
|
||||
|
||||
class patch_UICredit: UICredit {
|
||||
private Animator gpAnimator_;
|
||||
private GameObject creditRoot_;
|
||||
private MU3UICounter credit_;
|
||||
private GameObject freePlayRoot_;
|
||||
private GameObject gpRoot_;
|
||||
private MU3UICounter gp_;
|
||||
private MU3UICounter gpPlus_;
|
||||
private MU3UICounter gpMinus_;
|
||||
private MU3UIImageChanger netIcon_;
|
||||
private MU3UIImageChanger groupIcon_;
|
||||
private void onUpdateGP(int value) { /* nop */ }
|
||||
|
||||
public extern void orig_initialize();
|
||||
|
||||
public new void initialize() {
|
||||
orig_initialize();
|
||||
|
||||
using IniFile iniFile = new("mu3.ini");
|
||||
|
||||
if(iniFile.getValue("Extra", "HideGP", true)) {
|
||||
DestroyImmediate(gpAnimator_);
|
||||
|
||||
gpRoot_.transform.localScale = new Vector3(0, 0, 0);
|
||||
gp_.transform.localScale = new Vector3(0, 0, 0);
|
||||
gpPlus_.transform.localScale = new Vector3(0, 0, 0);
|
||||
gpMinus_.transform.localScale = new Vector3(0, 0, 0);
|
||||
}
|
||||
|
||||
if(iniFile.getValue("Extra", "HideCredits", true)) {
|
||||
creditRoot_.transform.localScale = new Vector3(0, 0, 0);
|
||||
credit_.transform.localScale = new Vector3(0, 0, 0);
|
||||
freePlayRoot_.transform.localScale = new Vector3(0, 0, 0);
|
||||
|
||||
netIcon_.transform.localPosition = new Vector3(
|
||||
-514,
|
||||
netIcon_.transform.localPosition.y,
|
||||
netIcon_.transform.localPosition.z
|
||||
);
|
||||
netIcon_.image.rectTransform.pivot = new Vector2(0f, 0.5f);
|
||||
|
||||
groupIcon_.transform.localPosition = new Vector3(
|
||||
-476,
|
||||
groupIcon_.transform.localPosition.y,
|
||||
groupIcon_.transform.localPosition.z
|
||||
);
|
||||
groupIcon_.image.rectTransform.pivot = new Vector2(0f, 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
using MU3.CustomUI;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3;
|
||||
|
||||
class patch_UICredit: UICredit {
|
||||
private Animator gpAnimator_;
|
||||
private GameObject creditRoot_;
|
||||
private MU3UICounter credit_;
|
||||
private GameObject freePlayRoot_;
|
||||
private GameObject gpRoot_;
|
||||
private MU3UICounter gp_;
|
||||
private MU3UICounter gpPlus_;
|
||||
private MU3UICounter gpMinus_;
|
||||
private MU3UIImageChanger netIcon_;
|
||||
private void onUpdateGP(int value) { /* nop */ }
|
||||
|
||||
public extern void orig_initialize();
|
||||
|
||||
public new void initialize() {
|
||||
orig_initialize();
|
||||
|
||||
DestroyImmediate(gpAnimator_);
|
||||
|
||||
creditRoot_.transform.localScale = new Vector3(0, 0, 0);
|
||||
credit_.transform.localScale = new Vector3(0, 0, 0);
|
||||
freePlayRoot_.transform.localScale = new Vector3(0, 0, 0);
|
||||
gpRoot_.transform.localScale = new Vector3(0, 0, 0);
|
||||
gp_.transform.localScale = new Vector3(0, 0, 0);
|
||||
gpPlus_.transform.localScale = new Vector3(0, 0, 0);
|
||||
gpMinus_.transform.localScale = new Vector3(0, 0, 0);
|
||||
|
||||
var tf = (RectTransform)netIcon_.transform;
|
||||
tf.localPosition = new Vector3(35, netIcon_.transform.localPosition.y, netIcon_.transform.localPosition.z);
|
||||
for(int i = 0; i < 3; ++i) {
|
||||
tf.anchorMin = new Vector2(0f, 0.5f);
|
||||
tf.anchorMax = new Vector2(1f, 0.5f);
|
||||
tf = (RectTransform)tf.parent;
|
||||
}
|
||||
netIcon_.image.rectTransform.pivot = new Vector2(0f, 0.5f);
|
||||
}
|
||||
}
|
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 watching the story endlessly</Description>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\Mu3Mods.csproj" />
|
||||
</Project>
|
12
InfiniteStory/MU3.Sequence/patch_Play.cs
Normal file
12
InfiniteStory/MU3.Sequence/patch_Play.cs
Normal 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;
|
||||
}
|
||||
}
|
30
InfiniteStory/MU3/patch_Scene_32_PrePlayMusic_MusicSelect.cs
Normal file
30
InfiniteStory/MU3/patch_Scene_32_PrePlayMusic_MusicSelect.cs
Normal 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();
|
||||
}
|
||||
}
|
@ -7,61 +7,62 @@ namespace MU3.Data;
|
||||
|
||||
public class patch_DataManager: DataManager {
|
||||
private Dictionary<int, FumenAnalysisData> _fumenAnalysisData;
|
||||
private string _fileName;
|
||||
|
||||
private void InitCache() {
|
||||
if(File.Exists("data_fumen_analysis_cache.bin")) {
|
||||
System.Console.WriteLine("Loading FumenAnalysisData cache...");
|
||||
private void initCache() {
|
||||
if(File.Exists(_fileName)) {
|
||||
System.Console.WriteLine("Loading chart analysis cache...");
|
||||
_fumenAnalysisData = new Dictionary<int, FumenAnalysisData>();
|
||||
using(FileStream input = File.OpenRead("data_fumen_analysis_cache.bin")) {
|
||||
using BinaryReader binaryReader = new BinaryReader(input);
|
||||
while(binaryReader.BaseStream.Position < binaryReader.BaseStream.Length) {
|
||||
int key = binaryReader.ReadInt32();
|
||||
bool isExist = binaryReader.ReadBoolean();
|
||||
int bpm = binaryReader.ReadInt32();
|
||||
int platinumScoreMax = binaryReader.ReadInt32();
|
||||
string notesDesignerName = binaryReader.ReadString();
|
||||
_fumenAnalysisData.Add(key, new FumenAnalysisData {
|
||||
isExist = isExist,
|
||||
bpm = bpm,
|
||||
platinumScoreMax = platinumScoreMax,
|
||||
notesDesignerName = notesDesignerName
|
||||
});
|
||||
}
|
||||
using FileStream input = File.OpenRead(_fileName);
|
||||
using BinaryReader binaryReader = new BinaryReader(input);
|
||||
|
||||
while(binaryReader.BaseStream.Position < binaryReader.BaseStream.Length) {
|
||||
int key = binaryReader.ReadInt32();
|
||||
bool isExist = binaryReader.ReadBoolean();
|
||||
int bpm = binaryReader.ReadInt32();
|
||||
int platinumScoreMax = binaryReader.ReadInt32();
|
||||
string notesDesignerName = binaryReader.ReadString();
|
||||
_fumenAnalysisData.Add(key, new FumenAnalysisData {
|
||||
isExist = isExist,
|
||||
bpm = bpm,
|
||||
platinumScoreMax = platinumScoreMax,
|
||||
notesDesignerName = notesDesignerName
|
||||
});
|
||||
}
|
||||
System.Console.WriteLine("Success");
|
||||
} else {
|
||||
_fumenAnalysisData = new Dictionary<int, FumenAnalysisData>();
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveCache() {
|
||||
System.Console.WriteLine($"Saving FumenAnalysisData cache...{Enumerable.First<KeyValuePair<int, FumenAnalysisData>>((IEnumerable<KeyValuePair<int, FumenAnalysisData>>)_fumenAnalysisData).Key},{Enumerable.First<KeyValuePair<int, FumenAnalysisData>>((IEnumerable<KeyValuePair<int, FumenAnalysisData>>)_fumenAnalysisData).Value.notesDesignerName}");
|
||||
if(File.Exists("data_fumen_analysis_cache.bin")) {
|
||||
File.Delete("data_fumen_analysis_cache.bin");
|
||||
private void saveCache() {
|
||||
System.Console.WriteLine($"Saving chart analysis cache...{Enumerable.First(_fumenAnalysisData).Key},{Enumerable.First(_fumenAnalysisData).Value.notesDesignerName}");
|
||||
if(File.Exists(_fileName)) {
|
||||
File.Delete(_fileName);
|
||||
}
|
||||
using(FileStream fileStream = File.OpenWrite("data_fumen_analysis_cache.bin")) {
|
||||
using BinaryWriter binaryWriter = new BinaryWriter(fileStream);
|
||||
foreach(KeyValuePair<int, FumenAnalysisData> fumenAnalysisDatum in _fumenAnalysisData) {
|
||||
binaryWriter.Write(fumenAnalysisDatum.Key);
|
||||
binaryWriter.Write(fumenAnalysisDatum.Value.isExist);
|
||||
binaryWriter.Write(fumenAnalysisDatum.Value.bpm);
|
||||
binaryWriter.Write(fumenAnalysisDatum.Value.platinumScoreMax);
|
||||
binaryWriter.Write(fumenAnalysisDatum.Value.notesDesignerName);
|
||||
}
|
||||
fileStream.Flush();
|
||||
using FileStream fileStream = File.OpenWrite(_fileName);
|
||||
using BinaryWriter binaryWriter = new BinaryWriter(fileStream);
|
||||
foreach(KeyValuePair<int, FumenAnalysisData> fumenAnalysisDatum in _fumenAnalysisData) {
|
||||
binaryWriter.Write(fumenAnalysisDatum.Key);
|
||||
binaryWriter.Write(fumenAnalysisDatum.Value.isExist);
|
||||
binaryWriter.Write(fumenAnalysisDatum.Value.bpm);
|
||||
binaryWriter.Write(fumenAnalysisDatum.Value.platinumScoreMax);
|
||||
binaryWriter.Write(fumenAnalysisDatum.Value.notesDesignerName);
|
||||
}
|
||||
System.Console.WriteLine("Success");
|
||||
fileStream.Flush();
|
||||
}
|
||||
|
||||
private extern void orig_makeFumenAnalysisDataList();
|
||||
|
||||
private void makeFumenAnalysisDataList() {
|
||||
using IniFile iniFile = new("mu3.ini");
|
||||
_fileName = Path.Combine(iniFile.getValue("Extra", "CacheDir", "."), "data_fumen_analysis_cache.bin");
|
||||
|
||||
try {
|
||||
if(DataStudioManager.needSave || !File.Exists("data_fumen_analysis_cache.bin")) {
|
||||
if(patch_DataStudioManager.needSave || !File.Exists(_fileName)) {
|
||||
orig_makeFumenAnalysisDataList();
|
||||
SaveCache();
|
||||
saveCache();
|
||||
} else {
|
||||
InitCache();
|
||||
initCache();
|
||||
}
|
||||
} catch(Exception value) {
|
||||
System.Console.WriteLine(value);
|
||||
|
@ -4,40 +4,48 @@ using System.Runtime.Serialization.Formatters.Binary;
|
||||
|
||||
namespace MU3.Data;
|
||||
|
||||
public class DataStudioManager {
|
||||
public class patch_DataStudioManager: DataStudioManager {
|
||||
public static bool needSave;
|
||||
|
||||
private static string _fileName;
|
||||
private static Dictionary<string, object> _dataCache;
|
||||
|
||||
private static extern bool orig_Deserialize<T>(string filePath, out T dsr) where T : new();
|
||||
|
||||
private static void InitCache() {
|
||||
if(File.Exists("data_cache.bin")) {
|
||||
System.Console.WriteLine("Loading cache...");
|
||||
using FileStream serializationStream = File.OpenRead("data_cache.bin");
|
||||
private static void initCache() {
|
||||
using IniFile iniFile = new("mu3.ini");
|
||||
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...");
|
||||
using FileStream serializationStream = File.OpenRead(_fileName);
|
||||
_dataCache = (Dictionary<string, object>)new BinaryFormatter().Deserialize(serializationStream);
|
||||
return;
|
||||
}
|
||||
_dataCache = new Dictionary<string, object>();
|
||||
_dataCache = new();
|
||||
}
|
||||
|
||||
private static void SaveCache() {
|
||||
if(File.Exists("data_cache.bin")) {
|
||||
File.Delete("data_cache.bin");
|
||||
private static void saveCache() {
|
||||
if(_fileName == "") {
|
||||
return;
|
||||
}
|
||||
using FileStream serializationStream = File.OpenWrite("data_cache.bin");
|
||||
if(File.Exists(_fileName)) {
|
||||
File.Delete(_fileName);
|
||||
}
|
||||
using FileStream serializationStream = File.OpenWrite(_fileName);
|
||||
new BinaryFormatter().Serialize(serializationStream, _dataCache);
|
||||
}
|
||||
|
||||
private static bool Deserialize<T>(string filePath, out T dsr) where T : new() {
|
||||
if(_dataCache == null) {
|
||||
InitCache();
|
||||
initCache();
|
||||
}
|
||||
if(_dataCache.ContainsKey(filePath)) {
|
||||
dsr = (T)_dataCache[filePath];
|
||||
return true;
|
||||
}
|
||||
if(orig_Deserialize<T>(filePath, out dsr)) {
|
||||
if(orig_Deserialize(filePath, out dsr)) {
|
||||
needSave = true;
|
||||
_dataCache.Add(filePath, dsr);
|
||||
return true;
|
||||
@ -47,11 +55,11 @@ public class DataStudioManager {
|
||||
|
||||
public extern bool orig_IsLoaded();
|
||||
|
||||
public bool IsLoaded() {
|
||||
public new bool IsLoaded() {
|
||||
if(orig_IsLoaded()) {
|
||||
if(needSave) {
|
||||
System.Console.WriteLine("Saving cache...");
|
||||
SaveCache();
|
||||
System.Console.WriteLine("Saving data cache...");
|
||||
saveCache();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net35</TargetFramework>
|
||||
<Company>7EVENDAYS⇔HOLIDAYS</Company>
|
||||
<Version>2.0.2</Version>
|
||||
<Version>2.3.1</Version>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Platforms>x64</Platforms>
|
||||
|
29
Mu3Mods.sln
29
Mu3Mods.sln
@ -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
|
||||
@ -37,6 +36,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnlockGameEvents", "UnlockG
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnlockMemoryChapters", "UnlockMemoryChapters\UnlockMemoryChapters.csproj", "{3A217A12-6082-491B-89F6-C1D13AD69A19}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlatinumTiming", "PlatinumTiming\PlatinumTiming.csproj", "{099AD6AF-181A-4745-88C4-1D0466BECCB1}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AttractVideoPlayer", "AttractVideoPlayer\AttractVideoPlayer.csproj", "{6889330F-2E7E-4778-ADFF-70AF036F1BD5}"
|
||||
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
|
||||
@ -111,6 +118,22 @@ Global
|
||||
{3A217A12-6082-491B-89F6-C1D13AD69A19}.Debug|x64.Build.0 = Debug|x64
|
||||
{3A217A12-6082-491B-89F6-C1D13AD69A19}.Release|x64.ActiveCfg = Release|x64
|
||||
{3A217A12-6082-491B-89F6-C1D13AD69A19}.Release|x64.Build.0 = Release|x64
|
||||
{099AD6AF-181A-4745-88C4-1D0466BECCB1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{099AD6AF-181A-4745-88C4-1D0466BECCB1}.Debug|x64.Build.0 = Debug|x64
|
||||
{099AD6AF-181A-4745-88C4-1D0466BECCB1}.Release|x64.ActiveCfg = Release|x64
|
||||
{099AD6AF-181A-4745-88C4-1D0466BECCB1}.Release|x64.Build.0 = Release|x64
|
||||
{6889330F-2E7E-4778-ADFF-70AF036F1BD5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{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
|
||||
{07C01DA1-7ABF-4759-A1C2-9DCD04298E85}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{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
|
||||
@ -118,4 +141,4 @@ Global
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D9317002-F66D-4CDE-8FF5-FF2A0D8DC021}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
EndGlobal
|
@ -22,7 +22,7 @@ class patch_PlayMusic: PlayMusic {
|
||||
}
|
||||
public override bool updateState(float deltaTime = -1f) {
|
||||
pauseTimer += deltaTime;
|
||||
if(Singleton<UIInput>.instance.getStateOn(UIInput.Key.Service) && !Singleton<UIInput>.instance.getStateOn(UIInput.Key.Test)) {
|
||||
if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.Service) && !Singleton<UIInput>.instance.getStateOn(UIInput.Key.Test)) {
|
||||
if((!Paused && pauseTimer >= PAUSE_CD) || (Paused && pauseTimer >= UNPAUSE_CD)) {
|
||||
Paused = !Paused;
|
||||
pgm.pause(Paused);
|
||||
|
26
PlatinumTiming/MU3.Battle/patch_Counters.cs
Normal file
26
PlatinumTiming/MU3.Battle/patch_Counters.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using MU3.Notes;
|
||||
|
||||
namespace MU3.Battle;
|
||||
class patch_Counters: Counters {
|
||||
public int PlatinumFastCount { get; private set; } = 0;
|
||||
public int PlatinumLateCount { get; private set; } = 0;
|
||||
public extern void orig_addPlatinumScore(Judge judge, Timing timing);
|
||||
public new void addPlatinumScore(Judge judge, Timing timing) {
|
||||
orig_addPlatinumScore(judge, timing);
|
||||
|
||||
if(judge == Judge.Perfect) {
|
||||
if(timing == Timing.Fast) {
|
||||
PlatinumFastCount += 1;
|
||||
} else if(timing == Timing.Late) {
|
||||
PlatinumLateCount += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public extern void orig_reset();
|
||||
public new void reset() {
|
||||
orig_reset();
|
||||
PlatinumFastCount = 0;
|
||||
PlatinumLateCount = 0;
|
||||
}
|
||||
}
|
13
PlatinumTiming/MU3.Battle/patch_GameEngine.cs
Normal file
13
PlatinumTiming/MU3.Battle/patch_GameEngine.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using MU3.Game;
|
||||
|
||||
namespace MU3.Battle;
|
||||
class patch_GameEngine: GameEngine {
|
||||
private patch_Counters _counters;
|
||||
public extern void orig_calcCurrentBattleResult(SessionResult sessionResult);
|
||||
|
||||
public void calcCurrentBattleResult(patch_SessionResult sessionResult) {
|
||||
orig_calcCurrentBattleResult(sessionResult);
|
||||
sessionResult.PlatinumFastCount = _counters.PlatinumFastCount;
|
||||
sessionResult.PlatinumLateCount = _counters.PlatinumLateCount;
|
||||
}
|
||||
}
|
5
PlatinumTiming/MU3.Game/patch_SessionResult.cs
Normal file
5
PlatinumTiming/MU3.Game/patch_SessionResult.cs
Normal file
@ -0,0 +1,5 @@
|
||||
namespace MU3.Game;
|
||||
class patch_SessionResult: SessionResult {
|
||||
public int PlatinumFastCount { get; set; }
|
||||
public int PlatinumLateCount { get; set; }
|
||||
}
|
63
PlatinumTiming/MU3/patch_UIResultTechScore.cs
Normal file
63
PlatinumTiming/MU3/patch_UIResultTechScore.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using MU3.CustomUI;
|
||||
using MU3.Game;
|
||||
using MU3.Sequence;
|
||||
using MU3.Util;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3;
|
||||
class patch_UIResultTechScore: UIResultTechScore {
|
||||
private MU3UICounter counterFast_;
|
||||
private MU3UICounter counterLate_;
|
||||
private Animator animator_;
|
||||
private static readonly int State_TechnicalScore_Loop;
|
||||
private void cloneCounter(MU3UICounter counter, Color color, int value) {
|
||||
var otherValue = counter.CounterAsInt;
|
||||
var offset = 12;
|
||||
while(otherValue > 9) {
|
||||
otherValue /= 10;
|
||||
offset += 8;
|
||||
}
|
||||
|
||||
var cpy = Instantiate(counter);
|
||||
cpy.color = color;
|
||||
cpy.gameObject.transform.SetParent(counter.transform.parent, false);
|
||||
var pos = counter.gameObject.transform.localPosition;
|
||||
cpy.gameObject.transform.localPosition = new Vector3(pos.x - offset, pos.y, pos.z);
|
||||
cpy.gameObject.SetActive(true);
|
||||
cpy.CounterAsInt = value;
|
||||
}
|
||||
|
||||
private void drawCounters() {
|
||||
float posXf = counterFast_.gameObject.transform.localPosition.x + 5.0f;
|
||||
float posXl = counterLate_.gameObject.transform.localPosition.x + 5.0f;
|
||||
float posY = counterLate_.gameObject.transform.localPosition.y;
|
||||
|
||||
counterFast_.gameObject.transform.localPosition = new Vector3(posXf, posY, 0.0f);
|
||||
counterLate_.gameObject.transform.localPosition = new Vector3(posXl, posY, 0.0f);
|
||||
|
||||
var sessionResult = (patch_SessionResult)Singleton<PlayInfo>.instance.sessionResult;
|
||||
|
||||
cloneCounter(
|
||||
counterFast_,
|
||||
new Color(0.630f, 0.766f, 0.829f, 1.000f),
|
||||
sessionResult.PlatinumFastCount
|
||||
);
|
||||
|
||||
cloneCounter(
|
||||
counterLate_,
|
||||
new Color(0.809f, 0.396f, 0.365f, 1.000f),
|
||||
sessionResult.PlatinumLateCount
|
||||
);
|
||||
}
|
||||
|
||||
private extern IEnumerator orig_showPlatinumScore(PlayInfo playInfo);
|
||||
|
||||
private IEnumerator showPlatinumScore(PlayInfo playInfo) {
|
||||
StartCoroutine(orig_showPlatinumScore(playInfo));
|
||||
while(!AnimatorState.stateEquals(animator_, State_TechnicalScore_Loop)) {
|
||||
yield return null;
|
||||
}
|
||||
drawCounters();
|
||||
}
|
||||
}
|
7
PlatinumTiming/PlatinumTiming.csproj
Normal file
7
PlatinumTiming/PlatinumTiming.csproj
Normal file
@ -0,0 +1,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<AssemblyName>Assembly-CSharp.PlatinumTiming.mm</AssemblyName>
|
||||
<Description>Platinum early/late</Description>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\Mu3Mods.csproj" />
|
||||
</Project>
|
14
SelectBGM/MU3.Game/patch_GameBGM.cs
Normal file
14
SelectBGM/MU3.Game/patch_GameBGM.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using MU3.Sound;
|
||||
|
||||
namespace MU3.Game;
|
||||
|
||||
class patch_GameBGM: GameBGM {
|
||||
public static bool WithholdPlay = false;
|
||||
public extern void orig_playBGM(SoundManager.ACBData acbData, int soundId, int selectorID, bool forcePlay = false);
|
||||
public new void playBGM(SoundManager.ACBData acbData, int soundId, int selectorID, bool forcePlay = false) {
|
||||
// Prevents theme music from being restarted
|
||||
if(!WithholdPlay) {
|
||||
orig_playBGM(acbData, soundId, selectorID, forcePlay);
|
||||
}
|
||||
}
|
||||
}
|
38
SelectBGM/MU3.Sequence/patch_Play.cs
Normal file
38
SelectBGM/MU3.Sequence/patch_Play.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using MU3.Data;
|
||||
using MU3.Game;
|
||||
using MU3.Util;
|
||||
using System;
|
||||
|
||||
namespace MU3.Sequence;
|
||||
class patch_Play: Play {
|
||||
private LocalSessionInfo _localSessionInfo;
|
||||
|
||||
public static int RecentID = 6;
|
||||
private extern void orig_Enter_Login();
|
||||
private void Enter_Login() {
|
||||
orig_Enter_Login();
|
||||
using IniFile iniFile = new("mu3.ini");
|
||||
var index = iniFile.getIntValue("Extra", "BGM", 6);
|
||||
if(index == 0) {
|
||||
var rnd = new Random();
|
||||
index = rnd.Next(1, 7);
|
||||
}
|
||||
if(index < 0 || index > 6) {
|
||||
index = 6;
|
||||
}
|
||||
RecentID = index;
|
||||
Singleton<GameSound>.instance.gameBGM.playBGM(233, index);
|
||||
}
|
||||
|
||||
private extern void orig_Enter_ChapterSelect();
|
||||
private void Enter_ChapterSelect() {
|
||||
patch_GameBGM.WithholdPlay = true;
|
||||
orig_Enter_ChapterSelect();
|
||||
patch_GameBGM.WithholdPlay = false;
|
||||
|
||||
int selectorID = SingletonStateMachine<DataManager, DataManager.EState>.instance.getMemoryChapterData(
|
||||
_localSessionInfo.chapterSelection.memoryChapterId
|
||||
)?.getMemoryChapterSelectorID() ?? RecentID;
|
||||
Singleton<GameSound>.instance.gameBGM.playBGM(233, selectorID);
|
||||
}
|
||||
}
|
22
SelectBGM/MU3/patch_Scene_32_PrePlayMusic_ChapterSelect.cs
Normal file
22
SelectBGM/MU3/patch_Scene_32_PrePlayMusic_ChapterSelect.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using MU3.Game;
|
||||
using MU3.Sequence;
|
||||
using MU3.Util;
|
||||
using MU3.ViewData;
|
||||
|
||||
namespace MU3;
|
||||
class patch_Scene_32_PrePlayMusic_ChapterSelect: Scene_32_PrePlayMusic_ChapterSelect {
|
||||
private ChapterSelectorItemViewData _selectItemViewData;
|
||||
private extern void orig_onChangeElement(int index, int indexRaw);
|
||||
private void onChangeElement(int index, int indexRaw) {
|
||||
patch_GameBGM.WithholdPlay = true;
|
||||
orig_onChangeElement(index, indexRaw);
|
||||
patch_GameBGM.WithholdPlay = false;
|
||||
|
||||
int selectorID = (
|
||||
(_selectItemViewData.memoryChapterViewData == null)
|
||||
? null
|
||||
: _selectItemViewData.memoryChapterViewData.memoryChapterData
|
||||
)?.getMemoryChapterSelectorID() ?? patch_Play.RecentID;
|
||||
Singleton<GameSound>.instance.gameBGM.playBGM(233, selectorID);
|
||||
}
|
||||
}
|
7
SelectBGM/SelectBGM.csproj
Normal file
7
SelectBGM/SelectBGM.csproj
Normal file
@ -0,0 +1,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<AssemblyName>Assembly-CSharp.SelectBGM.mm</AssemblyName>
|
||||
<Description>Select main menu BGM</Description>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\Mu3Mods.csproj" />
|
||||
</Project>
|
@ -16,11 +16,15 @@ class patch_Scene_30_NoticeReward: Scene_30_NoticeReward {
|
||||
SingletonMonoBehaviour<SystemUI>.instance.Panel.pushState(0, show: true);
|
||||
}
|
||||
private void Update() {
|
||||
if(_mode.get() < (int)State.FadeOut && Singleton<UIInput>.instance.getStateOn(UIInput.Key.MenuLeft)) {
|
||||
if(_mode.get() < (int)State.FadeOut && Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuLeft)) {
|
||||
Skipped = true;
|
||||
_mode.set(State.FadeOut);
|
||||
} else {
|
||||
_mode.update();
|
||||
}
|
||||
}
|
||||
|
||||
private void End_Init() {
|
||||
Skipped = false;
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ class patch_PlayMusic: PlayMusic {
|
||||
private void Execute_StartCutscene() {
|
||||
orig_Execute_StartCutscene();
|
||||
ForceSkipped = false;
|
||||
if(Singleton<Sys.System>.instance.config.isQuickStart || Singleton<UIInput>.instance.getStateOn(UIInput.Key.MenuLeft)) {
|
||||
if(Singleton<Sys.System>.instance.config.isQuickStart || Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuLeft)) {
|
||||
ForceSkipped = true;
|
||||
_gameEngine.skipStartCutscene();
|
||||
setNextState(EState.Countdown);
|
||||
|
20
SortByInternalDifficulty/MU3.User/patch_UserDetail.cs
Normal file
20
SortByInternalDifficulty/MU3.User/patch_UserDetail.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user