This repository has been archived by the owner on May 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3747f0b
commit 08ff09c
Showing
7 changed files
with
208 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,53 @@ | ||
using Assets.Scripts.UI.Panels; | ||
using Il2CppSystem.IO; | ||
using Il2CppSystem.IO; | ||
using MelonLoader; | ||
using MuseDashMirror; | ||
using MuseDashMirror.CommonPatches; | ||
using MuseDashMirror.UICreate; | ||
using System; | ||
using Tomlet; | ||
using UnhollowerRuntimeLib; | ||
using UnityEngine; | ||
using static MuseDashMirror.CommonPatches.PatchEvents; | ||
using static MuseDashMirror.BattleComponent; | ||
using static MuseDashMirror.SceneInfo; | ||
using static FC_AP.Indicator; | ||
|
||
namespace FC_AP | ||
namespace FC_AP; | ||
|
||
public class Main : MelonMod | ||
{ | ||
public class Main : MelonMod | ||
public override void OnInitializeMelon() | ||
{ | ||
public override void OnInitializeMelon() | ||
{ | ||
Save.Load(); | ||
PatchEvents.PnlMenuEvent += new Action<PnlMenu>(Patch.PnlMenuPostfix); | ||
PatchEvents.SwitchLanguagesEvent += new Action(Patch.SwitchLanguagesPostfix); | ||
PatchEvents.MenuSelectEvent += new Action<int, int, bool>(DisableToggle); | ||
SceneInfo.EnterGameScene += new Action(RegisterGameObject); | ||
SceneInfo.ExitGameScene += new Action(Reset); | ||
LoggerInstance.Msg("FC/AP indicator is loaded!"); | ||
} | ||
Save.Load(); | ||
PnlMenuEvent += Patch.PnlMenuPostfix; | ||
SwitchLanguagesEvent += Patch.SwitchLanguagesPostfix; | ||
MenuSelectEvent += DisableToggle; | ||
EnterGameScene += RegisterGameObject; | ||
GameStartEvent += SetAPToggle; | ||
OnVictoryEvent += DestroyGameObject; | ||
AddScoreEvent += UpdateFCGameObject; | ||
MissCubeEvent += UpdateMissGameObject; | ||
LoggerInstance.Msg("FC/AP indicator is loaded!"); | ||
} | ||
|
||
public override void OnDeinitializeMelon() | ||
{ | ||
File.WriteAllText(Path.Combine("UserData", "FC AP.cfg"), TomletMain.TomlStringFrom(Save.Settings)); | ||
} | ||
public override void OnDeinitializeMelon() | ||
{ | ||
File.WriteAllText(Path.Combine("UserData", "FC AP.cfg"), TomletMain.TomlStringFrom(Save.Settings)); | ||
} | ||
|
||
private void RegisterGameObject() | ||
{ | ||
ClassInjector.RegisterTypeInIl2Cpp<Indicator>(); | ||
GameObject gameObject = new GameObject("Indicator"); | ||
UnityEngine.Object.DontDestroyOnLoad(gameObject); | ||
gameObject.AddComponent<Indicator>(); | ||
} | ||
private void RegisterGameObject() | ||
{ | ||
if (!Save.Settings.FC_APEnabled) return; | ||
ClassInjector.RegisterTypeInIl2Cpp<Indicator>(); | ||
var gameObject = new GameObject("Indicator"); | ||
gameObject.AddComponent<Indicator>(); | ||
} | ||
|
||
private void Reset() | ||
private void DisableToggle(int listIndex, int index, bool isOn) | ||
{ | ||
if (listIndex == 0 && index == 0 && isOn) | ||
{ | ||
Indicator.GreatNum = 0; | ||
Indicator.CurrentMissNum = 0; | ||
Indicator.MissNum = 0; | ||
Indicator.GhostMiss = 0; | ||
Indicator.CollectableNoteMiss = 0; | ||
Fonts.UnloadFonts(); | ||
Patch.FC_APToggle.SetActive(true); | ||
} | ||
|
||
private void DisableToggle(int listIndex, int index, bool isOn) | ||
else | ||
{ | ||
if (listIndex == 0 && index == 0 && isOn) | ||
{ | ||
Patch.FC_APToggle.SetActive(true); | ||
} | ||
else | ||
{ | ||
Patch.FC_APToggle.SetActive(false); | ||
} | ||
Patch.FC_APToggle.SetActive(false); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
namespace FC_AP | ||
namespace FC_AP; | ||
|
||
internal static class MelonBuildInfo | ||
{ | ||
internal static class MelonBuildInfo | ||
{ | ||
public const string Name = "FC AP indicator"; | ||
public const string Name = "FC AP indicator"; | ||
|
||
public const string Description = "Indicators for whether you are on FC/AP pace"; | ||
public const string Description = "Indicators for whether you are on FC/AP pace"; | ||
|
||
public const string Author = "lxy"; | ||
public const string Author = "lxy"; | ||
|
||
public const string Company = null; | ||
public const string Company = null; | ||
|
||
public const string Version = "1.5.4"; | ||
public const string Version = "1.6.0"; | ||
|
||
public const string DownloadLink = "https://github.com/MDModsDev/FC-AP-Indicator/releases/latest"; | ||
} | ||
public const string DownloadLink = "https://github.com/MDModsDev/FC-AP-Indicator/releases/latest"; | ||
} |
Oops, something went wrong.