From 8baa4c8060cd015d6c5ffcff405c706023717050 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Tue, 22 Apr 2025 20:16:33 +0200 Subject: [PATCH] Automatically close Cosmic Exploration tutorial --- Directory.Build.targets | 2 +- .../Controller/GameUi/HelpUiController.cs | 20 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 3630c3cb..e639b5b2 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,5 @@ - 5.9 + 5.10 diff --git a/Questionable/Controller/GameUi/HelpUiController.cs b/Questionable/Controller/GameUi/HelpUiController.cs index 504f8cd0..7fd9d070 100644 --- a/Questionable/Controller/GameUi/HelpUiController.cs +++ b/Questionable/Controller/GameUi/HelpUiController.cs @@ -46,6 +46,12 @@ internal sealed class HelpUiController : IDisposable GuidePostSetup(addonGuide); } + if (_gameGui.TryGetAddonByName("ContentsTutorial", out AtkUnitBase* addonContentsTutorial)) + { + _logger.LogInformation("ContentsTutorial window is open"); + ContentsTutorialPostSetup(addonContentsTutorial); + } + if (_gameGui.TryGetAddonByName("JobHudNotice", out AtkUnitBase* addonJobHudNotice)) { _logger.LogInformation("JobHudNotice window is open"); @@ -65,12 +71,14 @@ internal sealed class HelpUiController : IDisposable private unsafe void ContentsTutorialPostSetup(AddonEvent type, AddonArgs args) { - if (_questController.StartedQuest?.Quest.Id.Value is 245 or 3872) - { - _logger.LogInformation("Closing ContentsTutorial"); - AtkUnitBase* addon = (AtkUnitBase*)args.Addon; - addon->FireCallbackInt(13); - } + if (_questController.StartedQuest?.Quest.Id.Value is 245 or 3872 or 5253) + ContentsTutorialPostSetup((AtkUnitBase*)args.Addon); + } + + private unsafe void ContentsTutorialPostSetup(AtkUnitBase* addon) + { + _logger.LogInformation("Closing ContentsTutorial"); + addon->FireCallbackInt(13); } /// -- 2.30.2