1
+ #include " main.hpp"
2
+ #include " ClockRotationUpdater.hpp" // Part of making this a class
3
+ #include " ClockModConfig.hpp" // Just the config
4
+ using namespace ClockMod ;
5
+
6
+ #include " GlobalNamespace/CoreGameHUDController.hpp" // Just take the damn rotation from CoreGameHUDController, and it'll rotate smooth as fuck.
7
+ #include " GlobalNamespace/PlayerDataModel.hpp" // For checking if noTextandHUDs is enabled
8
+ #include " GlobalNamespace/PlayerData.hpp" // For checking if noTextandHUDs is enabled
9
+ #include " GlobalNamespace/PlayerSpecificSettings.hpp" // For checking if noTextandHUDs is enabled
10
+ using namespace GlobalNamespace ;
11
+
12
+ // Needed for the Transform stuff.
13
+ #include " UnityEngine/Quaternion.hpp"
14
+ #include " UnityEngine/GameObject.hpp"
15
+ #include " UnityEngine/Transform.hpp"
16
+ #include " UnityEngine/Vector3.hpp"
17
+ #include " UnityEngine/Canvas.hpp"
18
+ using namespace UnityEngine ;
19
+
20
+ DEFINE_CLASS (ClockMod::ClockRotationUpdater);
21
+
22
+ // Updates every frame and runs the following code.
23
+ // Setting any Position does not work well here, please don't try, it is only for Realtime Rotation.
24
+ void ClockMod::ClockRotationUpdater::Update () {
25
+ if (Config.IsInSong ) {
26
+ // Instance of PlayerDataModel the noTextAndHUDs variable specifically
27
+ bool NoTextAndHUD = UnityEngine::Object::FindObjectOfType<PlayerDataModel*>()->playerData ->playerSpecificSettings ->noTextsAndHuds ;
28
+ if (NoTextAndHUD == false ) {
29
+ Config.noTextAndHUD = false ;
30
+ // This will get an instance of CoreGameHUDController
31
+ auto coreGameHUDController = UnityEngine::Object::FindObjectOfType<CoreGameHUDController*>();
32
+ // Checks if the CoreGameHUDControlller exists, and will run the following code.
33
+ if (coreGameHUDController) {
34
+ if (Config.InRotationMap ) {
35
+ get_transform ()->set_rotation (coreGameHUDController->get_transform ()->get_rotation ());
36
+ }
37
+ // else if (getModConfig().ClockPosition.GetValue()) {
38
+ // get_transform()->set_eulerAngles(UnityEngine::Vector3(60, 0, 0));
39
+ // }
40
+ // else { get_transform()->set_eulerAngles(UnityEngine::Vector3(0, 0, 0)); }
41
+ // Gets the rotation from the CoreGameHUDController and applies it to the Clock
42
+ }
43
+ // else if (getModConfig().ClockPosition.GetValue() == false) {
44
+ // get_transform()->set_position(UnityEngine::Vector3(0, -1.25, -0.5));
45
+ // get_transform()->set_eulerAngles(UnityEngine::Vector3(60, 0, 0));
46
+ // get_transform()->set_localScale(UnityEngine::Vector3(0.6, 0.6, 0.6));
47
+ // get_transform()->set_localPosition(UnityEngine::Vector3(getModConfig().ClockXOffset.GetValue(), getModConfig().ClockYOffset.GetValue(), getModConfig().ClockZOffset.GetValue()));
48
+ // }
49
+ else {
50
+ // get_transform()->GetParent()->set_position(UnityEngine::Vector3(0, 0, 0));
51
+ get_transform ()->set_eulerAngles (UnityEngine::Vector3 (0 , 0 , 0 ));
52
+ }
53
+ }
54
+ else {
55
+ Config.noTextAndHUD = true ;
56
+ GetComponent<UnityEngine::Canvas*>()->get_gameObject ()->SetActive (false );
57
+ }
58
+ }
59
+ }
60
+
61
+ // get_transform()->set_rotation(UnityEngine::Object::FindObjectOfType<NoteController*>()->get_worldRotation());
62
+ // auto ClockRot = UnityEngine::Object::FindObjectOfType<NoteController*>()->get_worldRotation();
63
+ // layout->get_transform()->GetParent()->set_rotation(ClockRot);
0 commit comments