AttractVideoPlayer #2
@ -1,13 +1,7 @@
|
||||
<Project ToolsVersion="Current">
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<AssemblyName>Assembly-CSharp.AttractVideoPlayer.mm</AssemblyName>
|
||||
<Description>Control attract video</Description>
|
||||
jujuforce marked this conversation as resolved
Outdated
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<ProjectGuid>{6889330F-2E7E-4778-ADFF-70AF036F1BD5}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\Mu3Mods.csproj" />
|
||||
</Project>
|
@ -1,40 +1,27 @@
|
||||
using MU3.Operation;
|
||||
using MU3.SceneObject;
|
||||
using MU3.Sequence;
|
||||
using MU3.Util;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.ObjectModel;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3.Operation;
|
||||
|
||||
class patch_OperationManager: OperationManager
|
||||
{
|
||||
class patch_OperationManager: OperationManager {
|
||||
private static readonly string CurrentSongIndexFilePath = "BepInEx/monomod/AttractVideoPlayer.currentSongIndex.txt";
|
||||
private ReadOnlyCollection<MovieData> _movieDataList;
|
||||
public new MovieData movieData
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_movieDataList.Count > 0)
|
||||
{
|
||||
public new MovieData movieData {
|
||||
get {
|
||||
if(_movieDataList.Count > 0) {
|
||||
int currentSongIndex = 0;
|
||||
try
|
||||
{
|
||||
try {
|
||||
currentSongIndex = int.Parse(System.IO.File.ReadAllText(CurrentSongIndexFilePath));
|
||||
}
|
||||
catch (System.Exception)
|
||||
{
|
||||
} catch(System.Exception) {
|
||||
saveCurrentSongIndex(0);
|
||||
}
|
||||
|
||||
if (currentSongIndex < 0)
|
||||
{
|
||||
if(currentSongIndex < 0) {
|
||||
currentSongIndex = _movieDataList.Count - 1;
|
||||
saveCurrentSongIndex(currentSongIndex);
|
||||
}
|
||||
|
||||
if (currentSongIndex >= _movieDataList.Count)
|
||||
{
|
||||
if(currentSongIndex >= _movieDataList.Count) {
|
||||
currentSongIndex = 0;
|
||||
saveCurrentSongIndex(currentSongIndex);
|
||||
}
|
||||
@ -47,8 +34,7 @@ class patch_OperationManager: OperationManager
|
||||
}
|
||||
}
|
||||
|
||||
private void saveCurrentSongIndex(int currentSongIndex)
|
||||
{
|
||||
private void saveCurrentSongIndex(int currentSongIndex) {
|
||||
System.IO.File.WriteAllText(CurrentSongIndexFilePath, currentSongIndex.ToString());
|
||||
}
|
||||
}
|
@ -1,25 +1,17 @@
|
||||
using Mono.Cecil;
|
||||
using MU3.AM;
|
||||
using MU3.AM;
|
||||
using MU3.Operation;
|
||||
using MU3.SceneObject;
|
||||
using MU3.Sequence;
|
||||
using MU3.Util;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3.Sequence;
|
||||
|
||||
class patch_Advertise : Advertise
|
||||
{
|
||||
private bool checkButtonOrAime()
|
||||
{
|
||||
if (SingletonStateMachine<AMManager, AMManager.EState>.instance.aimeReader.advCheck())
|
||||
{
|
||||
class patch_Advertise: Advertise {
|
||||
private bool checkButtonOrAime() {
|
||||
if(SingletonStateMachine<AMManager, AMManager.EState>.instance.aimeReader.advCheck()) {
|
||||
Singleton<OperationManager>.instance.loginType = OperationManager.LoginType.Aime;
|
||||
return true;
|
||||
}
|
||||
UIInput instance = Singleton<UIInput>.instance;
|
||||
akanyan marked this conversation as resolved
Outdated
akanyan
commented
doesn't this effectively disable guest login? doesn't this effectively disable guest login?
jujuforce
commented
oh crap you are right... I would be tempted to say we don't care about guest login but I don't like to remove a feature. oh crap you are right... I would be tempted to say we don't care about guest login but I don't like to remove a feature.
Let me cook something...
|
||||
if (instance.getTriggerOn(UIInput.Key.Decision) || instance.getTriggerOn(UIInput.Key.OptionBackward) || instance.getTriggerOn(UIInput.Key.OptionForward) || instance.getTriggerOn(UIInput.Key.SkipRight) || instance.getTriggerOn(UIInput.Key.MenuLeft) || instance.getTriggerOn(UIInput.Key.MenuRight))
|
||||
{
|
||||
if(instance.getTriggerOn(UIInput.Key.Decision) || instance.getTriggerOn(UIInput.Key.OptionBackward) || instance.getTriggerOn(UIInput.Key.OptionForward) || instance.getTriggerOn(UIInput.Key.SkipRight) || instance.getTriggerOn(UIInput.Key.MenuLeft) || instance.getTriggerOn(UIInput.Key.MenuRight)) {
|
||||
Singleton<OperationManager>.instance.loginType = OperationManager.LoginType.Button;
|
||||
return true;
|
||||
}
|
||||
|
@ -1,14 +1,9 @@
|
||||
using Mono.Cecil;
|
||||
using MU3.Operation;
|
||||
using MU3.SceneObject;
|
||||
using MU3.Sequence;
|
||||
using MU3.Util;
|
||||
using MU3.Util;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3;
|
||||
|
||||
class patch_AdvManager : AdvManager
|
||||
{
|
||||
class patch_AdvManager: AdvManager {
|
||||
private static readonly string CurrentSongIndexFilePath = "BepInEx/monomod/AttractVideoPlayer.currentSongIndex.txt";
|
||||
private static readonly float DelayBetweenButtonPress = 0.5f;
|
||||
private float lastButtonPressedTime = 0f;
|
||||
@ -16,30 +11,22 @@ class patch_AdvManager : AdvManager
|
||||
private GameObject objMovie;
|
||||
private CriManaMovieMaterial movieController;
|
||||
private extern bool orig_initMovie();
|
||||
public new bool initMovie()
|
||||
{
|
||||
public new bool initMovie() {
|
||||
return orig_initMovie();
|
||||
}
|
||||
|
||||
private extern bool orig_exec();
|
||||
public new bool exec()
|
||||
{
|
||||
if (Time.time - lastButtonPressedTime > DelayBetweenButtonPress)
|
||||
{
|
||||
if (Singleton<UIInput>.instance.getStateOn(UIInput.Key.Service))
|
||||
{
|
||||
public new bool exec() {
|
||||
if(Time.time - lastButtonPressedTime > DelayBetweenButtonPress) {
|
||||
if(Singleton<UIInput>.instance.getStateOn(UIInput.Key.Service)) {
|
||||
lastButtonPressedTime = Time.time;
|
||||
|
||||
movieController?.player.Pause(!movieController.player.IsPaused());
|
||||
}
|
||||
else if (Singleton<UIInput>.instance.getStateOn(UIInput.Key.L2))
|
||||
{
|
||||
} else if(Singleton<UIInput>.instance.getStateOn(UIInput.Key.L2)) {
|
||||
lastButtonPressedTime = Time.time;
|
||||
|
||||
addOffsetToCurrentSongIndexAndPlayMovie(-1);
|
||||
}
|
||||
else if (Singleton<UIInput>.instance.getStateOn(UIInput.Key.L3))
|
||||
{
|
||||
} else if(Singleton<UIInput>.instance.getStateOn(UIInput.Key.L3)) {
|
||||
lastButtonPressedTime = Time.time;
|
||||
|
||||
addOffsetToCurrentSongIndexAndPlayMovie(1);
|
||||
@ -48,14 +35,11 @@ class patch_AdvManager : AdvManager
|
||||
|
||||
return orig_exec();
|
||||
}
|
||||
public void addOffsetToCurrentSongIndexAndPlayMovie(int offset)
|
||||
{
|
||||
try
|
||||
{
|
||||
public void addOffsetToCurrentSongIndexAndPlayMovie(int offset) {
|
||||
try {
|
||||
int currentSongIndex = int.Parse(System.IO.File.ReadAllText(CurrentSongIndexFilePath)) + offset;
|
||||
System.IO.File.WriteAllText(CurrentSongIndexFilePath, currentSongIndex.ToString());
|
||||
}
|
||||
catch (System.Exception) { }
|
||||
} catch(System.Exception) { }
|
||||
|
||||
movieController?.Stop();
|
||||
Utility.destroyGameObject(ref movieController);
|
||||
|
Loading…
Reference in New Issue
Block a user
description unchanged