From 371b9999f268a07162039ad16dedd0861726d594 Mon Sep 17 00:00:00 2001 From: HorrorTroll <sonicvipduc@gmail.com> 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 b37ab44810..b5eb8a03b1 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 fb87df7138..9c77fddbf0 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 95beefb24f..854e450678 100644 --- a/Ryujinx/Ui/MainWindow.glade +++ b/Ryujinx/Ui/MainWindow.glade @@ -494,7 +494,7 @@ </packing> </child> <child> - <object class="GtkLabel" id="_hostStatus"> + <object class="GtkLabel" id="_dockedMode"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> @@ -519,7 +519,7 @@ </packing> </child> <child> - <object class="GtkLabel" id="_gameStatus"> + <object class="GtkLabel" id="_hostStatus"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> @@ -543,6 +543,31 @@ <property name="position">5</property> </packing> </child> + <child> + <object class="GtkLabel" id="_gameStatus"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="margin_left">5</property> + <property name="margin_right">5</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">6</property> + </packing> + </child> + <child> + <object class="GtkSeparator"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">7</property> + </packing> + </child> <child> <object class="GtkLabel" id="_gpuName"> <property name="visible">True</property> @@ -553,7 +578,7 @@ <packing> <property name="expand">True</property> <property name="fill">True</property> - <property name="position">6</property> + <property name="position">8</property> </packing> </child> </object> diff --git a/Ryujinx/Ui/StatusUpdatedEventArgs.cs b/Ryujinx/Ui/StatusUpdatedEventArgs.cs index 3d0cc30075..8c59f086d5 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 +}