diff options
| author | HorrorTroll <sonicvipduc@gmail.com> | 2020-05-05 05:10:01 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-05 08:10:01 +1000 |
| commit | 371b9999f268a07162039ad16dedd0861726d594 (patch) | |
| tree | 81af3070f54c36603cb7e7af0ec6cdd603e597dd | |
| parent | f84fb20959376fa6bb215d069799b42414bd8b27 (diff) | |
Add Docked/Handheld text on status bar (#1205)
* Add Dock/Handheld on status bar
* Simplified the code & move next to V-Sync
* Nit.
| -rw-r--r-- | Ryujinx/Ui/GLRenderer.cs | 7 | ||||
| -rw-r--r-- | Ryujinx/Ui/MainWindow.cs | 2 | ||||
| -rw-r--r-- | Ryujinx/Ui/MainWindow.glade | 31 | ||||
| -rw-r--r-- | 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 @@ </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> @@ -544,6 +544,31 @@ </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> <property name="can_focus">False</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 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 +} |
