mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-27 11:03:04 +00:00
Debug settings in the Avalonia UI
This commit is contained in:
parent
64206c7c5e
commit
652423cfeb
6 changed files with 113 additions and 1 deletions
|
@ -780,5 +780,10 @@
|
||||||
"MultiplayerMode": "Mode:",
|
"MultiplayerMode": "Mode:",
|
||||||
"MultiplayerModeTooltip": "Change LDN multiplayer mode.\n\nLdnMitm will modify local wireless/local play functionality in games to function as if it were LAN, allowing for local, same-network connections with other Ryujinx instances and hacked Nintendo Switch consoles that have the ldn_mitm module installed.\n\nMultiplayer requires all players to be on the same game version (i.e. Super Smash Bros. Ultimate v13.0.1 can't connect to v13.0.0).\n\nLeave DISABLED if unsure.",
|
"MultiplayerModeTooltip": "Change LDN multiplayer mode.\n\nLdnMitm will modify local wireless/local play functionality in games to function as if it were LAN, allowing for local, same-network connections with other Ryujinx instances and hacked Nintendo Switch consoles that have the ldn_mitm module installed.\n\nMultiplayer requires all players to be on the same game version (i.e. Super Smash Bros. Ultimate v13.0.1 can't connect to v13.0.0).\n\nLeave DISABLED if unsure.",
|
||||||
"MultiplayerModeDisabled": "Disabled",
|
"MultiplayerModeDisabled": "Disabled",
|
||||||
"MultiplayerModeLdnMitm": "ldn_mitm"
|
"MultiplayerModeLdnMitm": "ldn_mitm",
|
||||||
|
"SettingsTabDebug": "Debug",
|
||||||
|
"SettingsTabDebugTitle": "Debug (WARNING: For developer use only)",
|
||||||
|
"SettingsTabDebugEnableGDBStub": "Enable GDB Stub",
|
||||||
|
"GDBStubToggleTooltip": "Enables the GDB stub which makes it possible to debug the running application. For development use only!",
|
||||||
|
"GDBStubPort": "GDB stub port:"
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
public event Action SaveSettingsEvent;
|
public event Action SaveSettingsEvent;
|
||||||
private int _networkInterfaceIndex;
|
private int _networkInterfaceIndex;
|
||||||
private int _multiplayerModeIndex;
|
private int _multiplayerModeIndex;
|
||||||
|
private bool _enableGDBStub;
|
||||||
|
private ushort _gdbStubPort;
|
||||||
|
|
||||||
public int ResolutionScale
|
public int ResolutionScale
|
||||||
{
|
{
|
||||||
|
@ -259,6 +261,26 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool EnableGdbStub
|
||||||
|
{
|
||||||
|
get => _enableGDBStub;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_enableGDBStub = value;
|
||||||
|
ConfigurationState.Instance.Debug.EnableGdbStub.Value = _enableGDBStub;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ushort GDBStubPort
|
||||||
|
{
|
||||||
|
get => _gdbStubPort;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_gdbStubPort = value;
|
||||||
|
ConfigurationState.Instance.Debug.GdbStubPort.Value = _gdbStubPort;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public SettingsViewModel(VirtualFileSystem virtualFileSystem, ContentManager contentManager) : this()
|
public SettingsViewModel(VirtualFileSystem virtualFileSystem, ContentManager contentManager) : this()
|
||||||
{
|
{
|
||||||
_virtualFileSystem = virtualFileSystem;
|
_virtualFileSystem = virtualFileSystem;
|
||||||
|
@ -472,7 +494,12 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
FsGlobalAccessLogMode = config.System.FsGlobalAccessLogMode;
|
FsGlobalAccessLogMode = config.System.FsGlobalAccessLogMode;
|
||||||
OpenglDebugLevel = (int)config.Logger.GraphicsDebugLevel.Value;
|
OpenglDebugLevel = (int)config.Logger.GraphicsDebugLevel.Value;
|
||||||
|
|
||||||
|
// Multiplayer
|
||||||
MultiplayerModeIndex = (int)config.Multiplayer.Mode.Value;
|
MultiplayerModeIndex = (int)config.Multiplayer.Mode.Value;
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
EnableGdbStub = config.Debug.EnableGdbStub.Value;
|
||||||
|
GDBStubPort = config.Debug.GdbStubPort.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveSettings()
|
public void SaveSettings()
|
||||||
|
@ -578,9 +605,14 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
config.System.FsGlobalAccessLogMode.Value = FsGlobalAccessLogMode;
|
config.System.FsGlobalAccessLogMode.Value = FsGlobalAccessLogMode;
|
||||||
config.Logger.GraphicsDebugLevel.Value = (GraphicsDebugLevel)OpenglDebugLevel;
|
config.Logger.GraphicsDebugLevel.Value = (GraphicsDebugLevel)OpenglDebugLevel;
|
||||||
|
|
||||||
|
// Multiplayer
|
||||||
config.Multiplayer.LanInterfaceId.Value = _networkInterfaces[NetworkInterfaceList[NetworkInterfaceIndex]];
|
config.Multiplayer.LanInterfaceId.Value = _networkInterfaces[NetworkInterfaceList[NetworkInterfaceIndex]];
|
||||||
config.Multiplayer.Mode.Value = (MultiplayerMode)MultiplayerModeIndex;
|
config.Multiplayer.Mode.Value = (MultiplayerMode)MultiplayerModeIndex;
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
config.Debug.EnableGdbStub.Value = EnableGdbStub;
|
||||||
|
config.Debug.GdbStubPort.Value = GDBStubPort;
|
||||||
|
|
||||||
config.ToFileFormat().SaveConfig(Program.ConfigurationPath);
|
config.ToFileFormat().SaveConfig(Program.ConfigurationPath);
|
||||||
|
|
||||||
MainWindow.UpdateGraphicsConfig();
|
MainWindow.UpdateGraphicsConfig();
|
||||||
|
|
54
src/Ryujinx/UI/Views/Settings/SettingsDebugView.axaml
Normal file
54
src/Ryujinx/UI/Views/Settings/SettingsDebugView.axaml
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
<UserControl
|
||||||
|
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsDebugView"
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||||
|
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||||
|
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
x:DataType="viewModels:SettingsViewModel">
|
||||||
|
<Design.DataContext>
|
||||||
|
<viewModels:SettingsViewModel />
|
||||||
|
</Design.DataContext>
|
||||||
|
<ScrollViewer
|
||||||
|
Name="DebugPage"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
HorizontalScrollBarVisibility="Disabled"
|
||||||
|
VerticalScrollBarVisibility="Auto">
|
||||||
|
<Border Classes="settings">
|
||||||
|
<StackPanel
|
||||||
|
Margin="10"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Orientation="Vertical"
|
||||||
|
Spacing="10">
|
||||||
|
<TextBlock Classes="h1" Text="{locale:Locale SettingsTabDebugTitle}" />
|
||||||
|
<StackPanel
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Orientation="Vertical">
|
||||||
|
<CheckBox IsChecked="{Binding EnableGdbStub}">
|
||||||
|
<TextBlock Text="{locale:Locale SettingsTabDebugEnableGDBStub}"
|
||||||
|
ToolTip.Tip="{locale:Locale GDBStubToggleTooltip}" />
|
||||||
|
</CheckBox>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<TextBlock VerticalAlignment="Center"
|
||||||
|
Text="{locale:Locale GDBStubPort}"
|
||||||
|
Width="250" />
|
||||||
|
<ui:NumberBox Value="{Binding GDBStubPort}"
|
||||||
|
Width="350"
|
||||||
|
SmallChange="1"
|
||||||
|
LargeChange="10"
|
||||||
|
SimpleNumberFormat="F0"
|
||||||
|
SpinButtonPlacementMode="Inline"
|
||||||
|
Minimum="1024"
|
||||||
|
Maximum="65535" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</ScrollViewer>
|
||||||
|
</UserControl>
|
13
src/Ryujinx/UI/Views/Settings/SettingsDebugView.axaml.cs
Normal file
13
src/Ryujinx/UI/Views/Settings/SettingsDebugView.axaml.cs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
using Avalonia.Controls;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.UI.Views.Settings
|
||||||
|
{
|
||||||
|
public partial class SettingsDebugView : UserControl
|
||||||
|
{
|
||||||
|
public SettingsDebugView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
<settings:SettingsAudioView Name="AudioPage" />
|
<settings:SettingsAudioView Name="AudioPage" />
|
||||||
<settings:SettingsNetworkView Name="NetworkPage" />
|
<settings:SettingsNetworkView Name="NetworkPage" />
|
||||||
<settings:SettingsLoggingView Name="LoggingPage" />
|
<settings:SettingsLoggingView Name="LoggingPage" />
|
||||||
|
<settings:SettingsDebugView Name="DebugPage" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<ui:NavigationView
|
<ui:NavigationView
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
|
@ -96,6 +97,10 @@
|
||||||
Content="{locale:Locale SettingsTabLogging}"
|
Content="{locale:Locale SettingsTabLogging}"
|
||||||
Tag="LoggingPage"
|
Tag="LoggingPage"
|
||||||
IconSource="Document" />
|
IconSource="Document" />
|
||||||
|
<ui:NavigationViewItem
|
||||||
|
Content="{locale:Locale SettingsTabDebug}"
|
||||||
|
Tag="DebugPage"
|
||||||
|
IconSource="Star" />
|
||||||
</ui:NavigationView.MenuItems>
|
</ui:NavigationView.MenuItems>
|
||||||
<ui:NavigationView.Styles>
|
<ui:NavigationView.Styles>
|
||||||
<Style Selector="Grid#PlaceholderGrid">
|
<Style Selector="Grid#PlaceholderGrid">
|
||||||
|
|
|
@ -87,6 +87,9 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
case "LoggingPage":
|
case "LoggingPage":
|
||||||
NavPanel.Content = LoggingPage;
|
NavPanel.Content = LoggingPage;
|
||||||
break;
|
break;
|
||||||
|
case "DebugPage":
|
||||||
|
NavPanel.Content = DebugPage;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue