Skip to content

Commit

Permalink
Parent to ComboUIController
Browse files Browse the repository at this point in the history
  • Loading branch information
kodenamekrak committed May 16, 2023
1 parent b9e8711 commit 6d0d5f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/UI/ChartView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "GlobalNamespace/AudioTimeSyncController.hpp"
#include "GlobalNamespace/IReadonlyBeatmapData.hpp"
#include "GlobalNamespace/ComboUIController.hpp"

#include "HMUI/CurvedTextMeshPro.hpp"

Expand All @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions src/UI/ChartView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#include "ModConfig.hpp"
#include "Services/SvcAssetLoader.hpp"

#include "UnityEngine/Quaternion.hpp"

#include "GlobalNamespace/NoteData.hpp"

#include "Tweening/FloatTween.hpp"
Expand All @@ -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"

Expand Down Expand Up @@ -50,6 +50,9 @@ namespace SongChartVisualizer
_floatingScreen = BSML::FloatingScreen::CreateFloatingScreen(chartSize, false, pos, rot, 0, getModConfig().showBackground.GetValue());
_floatingScreen->GetComponent<Canvas*>()->set_sortingOrder(0);

_comboUIController = UnityEngine::Resources::FindObjectsOfTypeAll<ComboUIController*>().FirstOrDefault();
_floatingScreen->get_transform()->SetParent(_comboUIController->get_transform(), true);

if (getModConfig().showBackground.GetValue())
{
auto image = _floatingScreen->GetComponent<Canvas *>()->get_transform()->GetComponentsInChildren<HMUI::ImageView *>().FirstOrDefault([](auto x)
Expand Down

0 comments on commit 6d0d5f5

Please sign in to comment.