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
This commit is contained in:
parent
920d2386d5
commit
e39dcc72e7
@ -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<MovieData> _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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
@ -32,22 +32,4 @@ class patch_AdvManager: AdvManager {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user