From 4009aa307d67ea65b2d58ec45d9aa02e3e58628b Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Tue, 23 Jul 2024 00:39:12 +0200 Subject: [PATCH] Automatically close ARR credits (only for 2.55, not for base ARR) --- Questionable/Controller/GameUiController.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Questionable/Controller/GameUiController.cs b/Questionable/Controller/GameUiController.cs index bd26ba71d..be43974cd 100644 --- a/Questionable/Controller/GameUiController.cs +++ b/Questionable/Controller/GameUiController.cs @@ -54,6 +54,7 @@ internal sealed class GameUiController : IDisposable _addonLifecycle.RegisterListener(AddonEvent.PostSetup, "SelectIconString", SelectIconStringPostSetup); _addonLifecycle.RegisterListener(AddonEvent.PostSetup, "SelectYesno", SelectYesnoPostSetup); _addonLifecycle.RegisterListener(AddonEvent.PostSetup, "PointMenu", PointMenuPostSetup); + _addonLifecycle.RegisterListener(AddonEvent.PostSetup, "CreditScroll", CreditScrollPostSetup); _addonLifecycle.RegisterListener(AddonEvent.PostSetup, "Credit", CreditPostSetup); _addonLifecycle.RegisterListener(AddonEvent.PostSetup, "AkatsukiNote", UnendingCodexPostSetup); _addonLifecycle.RegisterListener(AddonEvent.PostSetup, "ContentsTutorial", ContentsTutorialPostSetup); @@ -560,6 +561,19 @@ internal sealed class GameUiController : IDisposable currentQuest.IncreasePointMenuCounter(); } + /// + /// ARR Credits. + /// + private unsafe void CreditScrollPostSetup(AddonEvent type, AddonArgs args) + { + _logger.LogInformation("Closing Credits sequence"); + AtkUnitBase* addon = (AtkUnitBase*)args.Addon; + addon->FireCallbackInt(-2); + } + + /// + /// Credits for (possibly all?) expansions, not used for ARR. + /// private unsafe void CreditPostSetup(AddonEvent type, AddonArgs args) { _logger.LogInformation("Closing Credits sequence"); @@ -633,6 +647,7 @@ internal sealed class GameUiController : IDisposable _addonLifecycle.UnregisterListener(AddonEvent.PostSetup, "ContentsTutorial", ContentsTutorialPostSetup); _addonLifecycle.UnregisterListener(AddonEvent.PostSetup, "AkatsukiNote", UnendingCodexPostSetup); _addonLifecycle.UnregisterListener(AddonEvent.PostSetup, "Credit", CreditPostSetup); + _addonLifecycle.UnregisterListener(AddonEvent.PostSetup, "CreditScroll", CreditScrollPostSetup); _addonLifecycle.UnregisterListener(AddonEvent.PostSetup, "PointMenu", PointMenuPostSetup); _addonLifecycle.UnregisterListener(AddonEvent.PostSetup, "SelectYesno", SelectYesnoPostSetup); _addonLifecycle.UnregisterListener(AddonEvent.PostSetup, "SelectIconString", SelectIconStringPostSetup);