Skip to content

Commit

Permalink
Fuck you WinRT now i can run on Windows 7
Browse files Browse the repository at this point in the history
  • Loading branch information
NotYoojun committed Jul 19, 2024
1 parent d107881 commit 3443abc
Showing 1 changed file with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@ public NavigationRootPage()
Current = this;
RootFrame = rootFrame;

Gamepad.GamepadAdded += OnGamepadAdded;
Gamepad.GamepadRemoved += OnGamepadRemoved;
try
{
Gamepad.GamepadAdded += OnGamepadAdded;
Gamepad.GamepadRemoved += OnGamepadRemoved;

_isKeyboardConnected = Convert.ToBoolean(new KeyboardCapabilities().KeyboardPresent);
_isKeyboardConnected = Convert.ToBoolean(new KeyboardCapabilities().KeyboardPresent);
}
catch { _isKeyboardConnected = true; }

// remove the solid-colored backgrounds behind the caption controls and system back button if we are in left mode
// This is done when the app is loaded since before that the actual theme that is used is not "determined" yet
Expand Down Expand Up @@ -236,14 +240,21 @@ private static IconElement GetIcon(string imagePath)

private void SetDeviceFamily()
{
var familyName = AnalyticsInfo.VersionInfo.DeviceFamily;
try
{
var familyName = AnalyticsInfo.VersionInfo.DeviceFamily;

if (!Enum.TryParse(familyName.Replace("Windows.", string.Empty), out DeviceType parsedDeviceType))
{
parsedDeviceType = DeviceType.Other;
}

if (!Enum.TryParse(familyName.Replace("Windows.", string.Empty), out DeviceType parsedDeviceType))
DeviceFamily = parsedDeviceType;
}
catch
{
parsedDeviceType = DeviceType.Other;
DeviceFamily = DeviceType.Other;
}

DeviceFamily = parsedDeviceType;
}

private void OnNewControlsMenuItemLoaded(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -510,10 +521,14 @@ private void UpdateHeaderMargin(NavigationView sender)

private void Page_Loaded(object sender, RoutedEventArgs e)
{
if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Xbox")
try
{
XboxContentSafeRect.Visibility = Visibility.Visible;
if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Xbox")
{
XboxContentSafeRect.Visibility = Visibility.Visible;
}
}
catch { }
}

private void rootFrame_Navigating(object sender, NavigatingCancelEventArgs e)
Expand Down

0 comments on commit 3443abc

Please sign in to comment.