forked from im-henri/QonsistentSaberColors
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03f35ad
commit 29d3c7b
Showing
6 changed files
with
171 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# QonsistentSaberColors | ||
|
||
description | ||
Menu saber colors reflect in game saber colors. | ||
|
||
## Credits | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
#include "UnityEngine/Color.hpp" | ||
#include "VRUIControls/VRLaserPointer.hpp" | ||
|
||
namespace QonsistentSaberColors | ||
{ | ||
void GetControllers(); | ||
void UpdatePointers(); | ||
|
||
void SetColors(); | ||
void SetColors(UnityEngine::Color leftColor, UnityEngine::Color rightColor); | ||
void UpdateControllerColors(); | ||
|
||
void ResetColors(); | ||
void UpdateLaserColor(); | ||
|
||
void SetLaser(VRUIControls::VRLaserPointer* laser); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
#include "main.hpp" | ||
#include "SettingsViewController.hpp" | ||
#include "ColorManager.hpp" | ||
#include "ModConfig.hpp" | ||
|
||
#include "questui/shared/BeatSaberUI.hpp" | ||
|
||
DEFINE_TYPE(QonsistentSaberColors, SettingsViewController) | ||
|
||
void QonsistentSaberColors::SettingsViewController::DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling) | ||
{} | ||
{ | ||
if(!firstActivation) | ||
return; | ||
|
||
auto transform = QuestUI::BeatSaberUI::CreateScrollableSettingsContainer(get_transform())->get_transform(); | ||
|
||
QuestUI::BeatSaberUI::CreateToggle(transform, "Enabled", getModConfig().Enabled.GetValue(), [](bool value) | ||
{ | ||
getLogger().info("Enabled toggle"); | ||
getModConfig().Enabled.SetValue(value); | ||
QonsistentSaberColors::UpdateControllerColors(); | ||
QonsistentSaberColors::UpdateLaserColor(); | ||
}); | ||
|
||
QuestUI::BeatSaberUI::CreateToggle(transform, "Colored lasers", getModConfig().ColoredLasers.GetValue(), [](bool value) | ||
{ | ||
getLogger().info("Lasers toggle"); | ||
getModConfig().ColoredLasers.SetValue(value); | ||
QonsistentSaberColors::UpdateLaserColor(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters