From 371b9999f268a07162039ad16dedd0861726d594 Mon Sep 17 00:00:00 2001 From: HorrorTroll Date: Tue, 5 May 2020 05:10:01 +0700 Subject: [PATCH] Add Docked/Handheld text on status bar (#1205) * Add Dock/Handheld on status bar * Simplified the code & move next to V-Sync * Nit. --- Ryujinx/Ui/GLRenderer.cs | 7 +++++-- Ryujinx/Ui/MainWindow.cs | 2 ++ Ryujinx/Ui/MainWindow.glade | 31 +++++++++++++++++++++++++--- Ryujinx/Ui/StatusUpdatedEventArgs.cs | 6 ++++-- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/Ryujinx/Ui/GLRenderer.cs b/Ryujinx/Ui/GLRenderer.cs index b37ab448..b5eb8a03 100644 --- a/Ryujinx/Ui/GLRenderer.cs +++ b/Ryujinx/Ui/GLRenderer.cs @@ -326,6 +326,8 @@ namespace Ryujinx.Ui _device.ProcessFrame(); } + string dockedMode = ConfigurationState.Instance.System.EnableDockedMode ? "Docked" : "Handheld"; + if (_ticks >= _ticksPerFrame) { _device.PresentFrame(SwapBuffers); @@ -333,8 +335,9 @@ namespace Ryujinx.Ui _device.Statistics.RecordSystemFrameTime(); StatusUpdatedEvent?.Invoke(this, new StatusUpdatedEventArgs( - _device.EnableDeviceVsync, - $"Host: {_device.Statistics.GetSystemFrameRate():00.00} FPS", + _device.EnableDeviceVsync, + dockedMode, + $"Host: {_device.Statistics.GetSystemFrameRate():00.00} FPS", $"Game: {_device.Statistics.GetGameFrameRate():00.00} FPS", $"GPU: {_renderer.GpuVendor}")); diff --git a/Ryujinx/Ui/MainWindow.cs b/Ryujinx/Ui/MainWindow.cs index fb87df71..9c77fddb 100644 --- a/Ryujinx/Ui/MainWindow.cs +++ b/Ryujinx/Ui/MainWindow.cs @@ -66,6 +66,7 @@ namespace Ryujinx.Ui [GUI] CheckMenuItem _fileExtToggle; [GUI] CheckMenuItem _pathToggle; [GUI] CheckMenuItem _fileSizeToggle; + [GUI] Label _dockedMode; [GUI] Label _gameStatus; [GUI] TreeView _gameTable; [GUI] TreeSelection _gameTableSelection; @@ -665,6 +666,7 @@ namespace Ryujinx.Ui _hostStatus.Text = args.HostStatus; _gameStatus.Text = args.GameStatus; _gpuName.Text = args.GpuName; + _dockedMode.Text = args.DockedMode; if (args.VSyncEnabled) { diff --git a/Ryujinx/Ui/MainWindow.glade b/Ryujinx/Ui/MainWindow.glade index 95beefb2..854e4506 100644 --- a/Ryujinx/Ui/MainWindow.glade +++ b/Ryujinx/Ui/MainWindow.glade @@ -494,7 +494,7 @@ - + True False start @@ -519,7 +519,7 @@ - + True False start @@ -543,6 +543,31 @@ 5 + + + True + False + start + 5 + 5 + + + False + True + 6 + + + + + True + False + + + False + True + 7 + + True @@ -553,7 +578,7 @@ True True - 6 + 8 diff --git a/Ryujinx/Ui/StatusUpdatedEventArgs.cs b/Ryujinx/Ui/StatusUpdatedEventArgs.cs index 3d0cc300..8c59f086 100644 --- a/Ryujinx/Ui/StatusUpdatedEventArgs.cs +++ b/Ryujinx/Ui/StatusUpdatedEventArgs.cs @@ -5,16 +5,18 @@ namespace Ryujinx.Ui public class StatusUpdatedEventArgs : EventArgs { public bool VSyncEnabled; + public string DockedMode; public string HostStatus; public string GameStatus; public string GpuName; - public StatusUpdatedEventArgs(bool vSyncEnabled, string hostStatus, string gameStatus, string gpuName) + public StatusUpdatedEventArgs(bool vSyncEnabled, string dockedMode, string hostStatus, string gameStatus, string gpuName) { VSyncEnabled = vSyncEnabled; + DockedMode = dockedMode; HostStatus = hostStatus; GameStatus = gameStatus; GpuName = gpuName; } } -} \ No newline at end of file +}