Skip to content

Commit

Permalink
Add colors 🖌️
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenAlex committed Apr 28, 2024
1 parent 114d99b commit 7258463
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 29 deletions.
37 changes: 23 additions & 14 deletions assets/SettingsView.bsml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,28 @@
</horizontal> -->
<horizontal horizontal-fit='PreferredSize' pad='4' spacing='2' preferred-height='79' child-control-height='false'>
<vertical spacing='2'>
<vertical child-control-height='false' bg='panel-top' pad='2' pad-bottom='1' pad-top='1' preferred-width='64'>
<text text='&lt;color=#DDD>Graphics' align='Center' bold='true' font-size='3.5' color='#69B' size-delta-y='5'/>
<list-setting id="bloomSetting" text='Bloom' options="bloomQualityOptions" value="bloomQualityValue" bind-value="true" apply-on-change="true" on-change="UpdateGraphicsSettings" />
<vertical spacing="0" child-control-height='false' bg='panel-top' pad='2' pad-bottom='1' pad-top='1' preferred-width='64'>
<text text='&lt;color=#9ff8ba>Graphics' align='Center' bold='true' font-size='3.5' color='#69B' size-delta-y='5' />
<list-setting id="bloomSetting" text='Bloom' options="bloomQualityOptions" value="bloomQualityValue" bind-value="true" apply-on-change="true" on-change="UpdateGraphicsSettings" hover-hint="Makes everything appear brighter. &lt;br>Currently is way too overblown compared to PC, not really recommended to use" />
<list-setting id="mirrorsSetting" text='Mirrors' options="mirrorOptions" value="mirrorValue" bind-value="true" apply-on-change="true" on-change="UpdateGraphicsSettings" />
<list-setting id="smokeSetting" text='Smoke' options="smokeQualityOptions" value="smokeQualityValue" bind-value="true" apply-on-change="true" on-change="UpdateGraphicsSettings" />
<list-setting id="antiAliasingSetting" text='Anti-Aliasing' options="antiAliasingOptions" value="antiAliasingValue" bind-value="true" apply-on-change="true" on-change="UpdateGraphicsSettings" />
<list-setting id="wallsSetting" text='Walls' options="wallQualityOptions" value="wallQualityValue" bind-value="true" apply-on-change="true" on-change="UpdateGraphicsSettings" />
<increment-setting id="shockwaveParticlesSetting" text='Shockwave particles' value="shockwaveParticlesValue" bind-value="true" apply-on-change="true" increment="1" min="0" max="3" hover-hint="Max Shockwave Particles (distortions on impact)" on-change="UpdateGraphicsSettings" />
<increment-setting id="shockwaveParticlesSetting" text='Shockwave particles' value="shockwaveParticlesValue" bind-value="true" apply-on-change="true" increment="1" min="0" max="3" hover-hint="Max Shockwave Particles &lt;br> (distortions on impact)" on-change="UpdateGraphicsSettings" />
<bool-setting id="burnMarksSetting" text='Burn marks' value="burnMarksValue" bind-value="true" apply-on-change="true" on-change="UpdateGraphicsSettings" hover-hint="Allows you to see cuts in the platform you stand on" />
<bool-setting text='FPS Counter' value="FPSCounterValue" bind-value="true" apply-on-change="true" on-change="UpdateGraphicsSettings" hover-hint="Minimal FPS counter pinned next to the standing platform" />
<bool-setting text='Advanced FPS Counter' value="FPSCounterAdvancedValue" bind-value="true" apply-on-change="true" on-change="UpdateGraphicsSettings" hover-hint="FPS counter with more information, not recommended for use during playing the game, as it appears in front of you" />
<bool-setting text='Advanced FPS Counter' value="FPSCounterAdvancedValue" bind-value="true" apply-on-change="true" on-change="UpdateGraphicsSettings" hover-hint="FPS counter with more information for debugging frame times. &lt;br> Not recommended to keep it on, as it can cause more crashes and could reduce your overall performance" />
<list-setting value="colorSpaceValue" bind-value="true" apply-on-change="true" text='Color Space' choices="colorSpaceOptions" on-change="UpdateGraphicsSettings" />
<!--<bool-setting id="screenDistortionSetting" text='Passthrough' value="screenDistortionValue" active="false" bind-value="true" apply-on-change="true" hover-hint="This feature requires patching BeatSaber with passthrough support" on-change="UpdateGraphicsSettings" />-->
<!-- <bool-setting id="screenDistortionSetting" text='Passthrough' value="screenDistortionValue" active="false" bind-value="true" apply-on-change="true" hover-hint="This feature requires patching BeatSaber with passthrough support" on-change="UpdateGraphicsSettings" /> -->
</vertical>
</vertical>
<vertical spacing='1'>
<vertical child-control-height='false' bg='panel-top' pad='4' pad-bottom='1' pad-top='1' preferred-width='64'>
<text text='&lt;color=#DDD>Settings based on environment' align='Center' bold='true' font-size='3.5' color='#69B' size-delta-y='5'/>
<vertical spacing='2'>
<vertical child-control-height='false' bg='panel-top' pad='2' pad-bottom='1' pad-top='1' preferred-width='64'>
<text text='&lt;color=#ffffff>Settings based on &lt;color=#2b99f4>environment' align='Center' bold='true' font-size='3.5' size-delta-y='5'/>
<tab-selector tab-tag="main" anchor-pos-y='0' size-delta-y='6' size-delta-x='-60'
child-expand-width='true' child-control-width='true' />
<!-- Funny spacer cause unity ui is a mystery to me -->
<horizontal preferred-height="1"></horizontal>
<tab tags="main" tab-name="menu" size-delta-y="31">
<vertical child-control-height='false' horizontal-fit="Unconstrained">
<increment-setting id="performanceLevelGPU" text='Resolution' min="0.2" max="2" increment="0.1" value="resolutionLevelValueMenu" bind-value="true" apply-on-change="true" on-change="UpdateGraphicsSettings" />
Expand All @@ -47,12 +49,19 @@
</vertical>
</tab>
</vertical>
<vertical child-control-height='false' bg='panel-top' pad='4' pad-bottom='1' pad-top='1' preferred-width='64'>
<text text='&lt;color=#FDD>Performance levels' align='Center' bold='true' font-size='3.5' color='#69B' size-delta-y='5'/>
<increment-setting text='GPU Level' bind-value="true" apply-on-change="true" value="gpuLevelValue" min="1" increment="1.0" max="4" on-change="UpdateGraphicsSettings" />
<increment-setting text='CPU Level' bind-value="true" apply-on-change="true" value="cpuLevelValue" min="1" increment="1.0" max="4" on-change="UpdateGraphicsSettings" />
<vertical child-control-height='false' bg='panel-top' pad='2' pad-bottom='1' pad-top='1' preferred-width='64'>
<text text='&lt;color=#fe7da6ff>Performance&lt;color=#e6eaffff> levels' align='Center' bold='true' font-size='3.5' size-delta-y='5'/>
<increment-setting text='Min. GPU Level' bind-value="true" apply-on-change="true" value="gpuLevelValue" min="1" increment="1.0" max="4" on-change="UpdateGraphicsSettings" />
<increment-setting text='Min. CPU Level' bind-value="true" apply-on-change="true" value="cpuLevelValue" min="1" increment="1.0" max="4" on-change="UpdateGraphicsSettings" />
</vertical>
<text text="if distortion walls or shockwaves are enabled, anti-aliasing will be forced to off!" align="Center" bold="true" font-size="3" font-color="red" rich-text="true"/>
<horizontal
preferred-width='50'
pad-top="3"
child-align="MiddleCenter"
horizontal-fit="PreferredSize"
>
<text overflow-mode="Overflow" text="If distortion walls or shockwaves are enabled, &lt;br> anti-aliasing will be forced to off!" align="Center" bold="false" font-size="3.2" font-color="#fdaa60" rich-text="true"/>
</horizontal>
</vertical>
</horizontal>
</vertical>
24 changes: 9 additions & 15 deletions src/ui/SettingsView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ void GraphicsTweaks::UI::SettingsView::DidActivate(bool firstActivation, bool ad
if (!firstActivation)
return;

INFO("SettingsView activated");

// Get possible FPS values
auto frequencies = GlobalNamespace::OVRPlugin::get_systemDisplayFrequenciesAvailable();
// Create lists
Expand All @@ -48,20 +46,9 @@ void GraphicsTweaks::UI::SettingsView::DidActivate(bool firstActivation, bool ad
systemDisplayFrequenciesAvailableValues->Add(item);
systemDisplayFrequenciesAvailableLabels->Add(fmt::format("{}", item));
}


DEBUG("Got FPS values");

BSML::parse_and_construct(Assets::SettingsView_bsml, this->get_transform(), this);

auto txt = BSML::Lite::CreateText(this, "<br><color=#D1ACFF>Inspired by Anytweaks (Abandoned) by Kaitlyn", {0, 0}, {50, 10});
auto trans = txt->get_transform();
trans->set_position({0, 0.01f, 2.5});
trans->set_rotation(UnityEngine::Quaternion::Euler(90, 0, 0));
txt->set_overflowMode(TMPro::TextOverflowModes::Overflow);
txt->set_enableWordWrapping(false);
txt->set_richText(true);

#ifdef HotReload
fileWatcher->checkInterval = 0.5f;
fileWatcher->filePath = "/sdcard/bsml/GraphicsTweaks/SettingsView.bsml";
Expand All @@ -71,10 +58,17 @@ void GraphicsTweaks::UI::SettingsView::DidActivate(bool firstActivation, bool ad
void GraphicsTweaks::UI::SettingsView::PostParse() {
DEBUG("SettingsView PostParse");

auto getBgSprite = GetBGSprite("RoundRect10BorderFade");

auto txt = BSML::Lite::CreateText(this, "<br><color=#D1ACFF>Inspired by Anytweaks (Abandoned) by Kaitlyn", {0, 0}, {50, 10});
auto trans = txt->get_transform();
trans->set_position({0, 0.01f, 2.5});
trans->set_rotation(UnityEngine::Quaternion::Euler(90, 0, 0));
txt->set_overflowMode(TMPro::TextOverflowModes::Overflow);
txt->set_enableWordWrapping(false);
txt->set_richText(true);


// Remove skew from all backgroundable elements
auto getBgSprite = GetBGSprite("RoundRect10BorderFade");
auto backgroundables = GetComponentsInChildren<BSML::Backgroundable*>();
for (auto & backgroundable : backgroundables) {
auto imageView = backgroundable->GetComponent<HMUI::ImageView*>();
Expand Down

0 comments on commit 7258463

Please sign in to comment.