Skip to content

Commit

Permalink
Fixed some things (VR Toasts) not being displayed properly
Browse files Browse the repository at this point in the history
  • Loading branch information
KimihikoAkayasaki committed Oct 2, 2022
1 parent 3aabc8a commit eeae8ee
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions Amethyst/K2Main.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include <ranges>

#include "K2DeviceMath.h"
Expand Down Expand Up @@ -43,15 +43,21 @@ namespace k2app::main
shared::general::general_tab_setup_finished = false; // Boiler
shared::general::toggleFreezeButton.get()->IsChecked(isTrackingFrozen);
shared::general::toggleFreezeButton.get()->Content(isTrackingFrozen
? winrt::box_value(L"Unfreeze")
: winrt::box_value(L"Freeze"));
? winrt::box_value(
LocalizedResourceWString(
L"GeneralPage",
L"Buttons/Skeleton/Unfreeze"))
: winrt::box_value(
LocalizedResourceWString(
L"GeneralPage",
L"Buttons/Skeleton/Freeze")));
shared::general::general_tab_setup_finished = true; // Boiler end
}
});

{
auto _header = LocalizedJSONString(
L"/GeneralPage/Tips/TrackingFreeze/Header");
L"/GeneralPage/Tips/TrackingFreeze/Header_Short");

// Change the tip depending on the currently connected controllers
char _controller_model[1024];
Expand Down Expand Up @@ -89,11 +95,11 @@ namespace k2app::main
L"GeneralPage",
L"Tips/TrackingFreeze/Buttons/Oculus"));

stringReplaceAll(_header,
L"also toggle tracker freeze while in VR"s, L"toggle it"s);

ShowVRToast(std::wstring(L"Tracking Freeze ") +
(isTrackingFrozen ? L"enabled!" : L"disabled!"), _header);
ShowVRToast(isTrackingFrozen
? LocalizedJSONString(
L"/GeneralPage/Tips/TrackingFreeze/Toast_Enabled")
: LocalizedJSONString(
L"/GeneralPage/Tips/TrackingFreeze/Toast_Disabled"), _header);
}
}

Expand Down Expand Up @@ -138,7 +144,7 @@ namespace k2app::main

{
auto _header = LocalizedJSONString(
L"/SettingsPage/Tips/FlipToggle/Header");
L"/SettingsPage/Tips/FlipToggle/Header_Short");

// Change the tip depending on the currently connected controllers
char _controller_model[1024];
Expand Down Expand Up @@ -175,12 +181,12 @@ namespace k2app::main
LocalizedResourceWString(
L"SettingsPage",
L"Tips/FlipToggle/Buttons/Oculus"));

stringReplaceAll(_header,
L"also toggle skeleton flip while in VR"s, L"toggle it"s);

ShowVRToast(std::wstring(L"Skeleton Flip ") +
(K2Settings.isFlipEnabled ? L"enabled!" : L"disabled!"), _header);
ShowVRToast(K2Settings.isFlipEnabled
? LocalizedJSONString(
L"/SettingsPage/Tips/FlipToggle/Toast_Enabled")
: LocalizedJSONString(
L"/SettingsPage/Tips/FlipToggle/Toast_Disabled"), _header);
}
}

Expand Down

0 comments on commit eeae8ee

Please sign in to comment.