From 6d0d5f5b4914fe53eafa75c77755dc2ff8cb3f4b Mon Sep 17 00:00:00 2001 From: kodenamekrak Date: Tue, 16 May 2023 17:54:52 +0100 Subject: [PATCH] Parent to ComboUIController --- include/UI/ChartView.hpp | 2 ++ src/UI/ChartView.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/UI/ChartView.hpp b/include/UI/ChartView.hpp index 44bf451..8ea93cc 100644 --- a/include/UI/ChartView.hpp +++ b/include/UI/ChartView.hpp @@ -10,6 +10,7 @@ #include "GlobalNamespace/AudioTimeSyncController.hpp" #include "GlobalNamespace/IReadonlyBeatmapData.hpp" +#include "GlobalNamespace/ComboUIController.hpp" #include "HMUI/CurvedTextMeshPro.hpp" @@ -26,6 +27,7 @@ ___DECLARE_TYPE_WRAPPER_INHERITANCE(SongChartVisualizer, ChartView, Il2CppTypeEn DECLARE_PRIVATE_FIELD(GlobalNamespace::AudioTimeSyncController*, _audioTimeSyncController); DECLARE_PRIVATE_FIELD(GlobalNamespace::IReadonlyBeatmapData*, _beatmapData); + DECLARE_PRIVATE_FIELD(GlobalNamespace::ComboUIController*, _comboUIController); DECLARE_PRIVATE_FIELD(Tweening::TimeTweeningManager*, _timeTweeningManager); DECLARE_PRIVATE_FIELD(SongChartVisualizer::WindowGraph*, _windowGraph); DECLARE_PRIVATE_FIELD(BSML::FloatingScreen*, _floatingScreen); diff --git a/src/UI/ChartView.cpp b/src/UI/ChartView.cpp index 5f5a315..8fd9b4b 100644 --- a/src/UI/ChartView.cpp +++ b/src/UI/ChartView.cpp @@ -3,8 +3,6 @@ #include "ModConfig.hpp" #include "Services/SvcAssetLoader.hpp" -#include "UnityEngine/Quaternion.hpp" - #include "GlobalNamespace/NoteData.hpp" #include "Tweening/FloatTween.hpp" @@ -15,7 +13,9 @@ #include "UnityEngine/Canvas.hpp" #include "UnityEngine/RenderMode.hpp" +#include "UnityEngine/Quaternion.hpp" #include "UnityEngine/RectTransform.hpp" +#include "UnityEngine/Resources.hpp" #include "System/Action_1.hpp" @@ -50,6 +50,9 @@ namespace SongChartVisualizer _floatingScreen = BSML::FloatingScreen::CreateFloatingScreen(chartSize, false, pos, rot, 0, getModConfig().showBackground.GetValue()); _floatingScreen->GetComponent()->set_sortingOrder(0); + _comboUIController = UnityEngine::Resources::FindObjectsOfTypeAll().FirstOrDefault(); + _floatingScreen->get_transform()->SetParent(_comboUIController->get_transform(), true); + if (getModConfig().showBackground.GetValue()) { auto image = _floatingScreen->GetComponent()->get_transform()->GetComponentsInChildren().FirstOrDefault([](auto x)