mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-30 01:29:48 -06:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
8b75ce1d98 | |||
509f6d738c | |||
f3efada444 | |||
b20613661c | |||
2facad4be3 | |||
741eba2798 | |||
59b3ff7802 | |||
c0cc3c4188 |
2
.github/workflows/nightly_pr_comment.yml
vendored
2
.github/workflows/nightly_pr_comment.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
||||
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v6
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const {owner, repo} = context.repo;
|
||||
|
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@ -33,10 +33,11 @@ jobs:
|
||||
id: version_info
|
||||
run: |
|
||||
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
|
||||
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- name: Create tag
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.rest.git.createRef({
|
||||
@ -51,6 +52,7 @@ jobs:
|
||||
with:
|
||||
name: ${{ steps.version_info.outputs.build_version }}
|
||||
tag: ${{ steps.version_info.outputs.build_version }}
|
||||
body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}"
|
||||
omitBodyDuringUpdate: true
|
||||
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
|
||||
repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
|
||||
@ -79,6 +81,7 @@ jobs:
|
||||
id: version_info
|
||||
run: |
|
||||
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
|
||||
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
|
||||
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
@ -132,6 +135,7 @@ jobs:
|
||||
name: ${{ steps.version_info.outputs.build_version }}
|
||||
artifacts: "release_output/*.tar.gz,release_output/*.zip"
|
||||
tag: ${{ steps.version_info.outputs.build_version }}
|
||||
body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}"
|
||||
omitBodyDuringUpdate: true
|
||||
allowUpdates: true
|
||||
replacesArtifacts: true
|
||||
@ -170,6 +174,7 @@ jobs:
|
||||
id: version_info
|
||||
run: |
|
||||
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
|
||||
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
|
||||
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Configure for release
|
||||
@ -196,6 +201,7 @@ jobs:
|
||||
name: ${{ steps.version_info.outputs.build_version }}
|
||||
artifacts: "publish_ava/*.tar.gz, publish_headless/*.tar.gz"
|
||||
tag: ${{ steps.version_info.outputs.build_version }}
|
||||
body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}"
|
||||
omitBodyDuringUpdate: true
|
||||
allowUpdates: true
|
||||
replacesArtifacts: true
|
||||
|
@ -3,7 +3,7 @@ using System.Numerics;
|
||||
|
||||
namespace Ryujinx.Graphics.Texture.Astc
|
||||
{
|
||||
internal struct IntegerEncoded
|
||||
internal struct IntegerEncoded(IntegerEncoded.EIntegerEncoding encoding, int numBits)
|
||||
{
|
||||
internal const int StructSize = 8;
|
||||
private static readonly IntegerEncoded[] _encodings;
|
||||
@ -15,11 +15,11 @@ namespace Ryujinx.Graphics.Texture.Astc
|
||||
Trit,
|
||||
}
|
||||
|
||||
readonly EIntegerEncoding _encoding;
|
||||
public byte NumberBits { get; private set; }
|
||||
public byte TritValue { get; private set; }
|
||||
public byte QuintValue { get; private set; }
|
||||
public int BitValue { get; private set; }
|
||||
readonly EIntegerEncoding _encoding = encoding;
|
||||
public byte NumberBits { get; } = (byte)numBits;
|
||||
public byte TritValue { get; private set; } = 0;
|
||||
public byte QuintValue { get; private set; } = 0;
|
||||
public int BitValue { get; private set; } = 0;
|
||||
|
||||
static IntegerEncoded()
|
||||
{
|
||||
@ -31,15 +31,6 @@ namespace Ryujinx.Graphics.Texture.Astc
|
||||
}
|
||||
}
|
||||
|
||||
public IntegerEncoded(EIntegerEncoding encoding, int numBits)
|
||||
{
|
||||
_encoding = encoding;
|
||||
NumberBits = (byte)numBits;
|
||||
BitValue = 0;
|
||||
TritValue = 0;
|
||||
QuintValue = 0;
|
||||
}
|
||||
|
||||
public readonly bool MatchesEncoding(IntegerEncoded other)
|
||||
{
|
||||
return _encoding == other._encoding && NumberBits == other.NumberBits;
|
||||
|
@ -15,14 +15,8 @@ namespace Ryujinx.HLE.HOS.Applets
|
||||
|
||||
ResultCode GetResult();
|
||||
|
||||
bool DrawTo(RenderingSurfaceInfo surfaceInfo, IVirtualMemoryManager destination, ulong position)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool DrawTo(RenderingSurfaceInfo surfaceInfo, IVirtualMemoryManager destination, ulong position) => false;
|
||||
|
||||
static T ReadStruct<T>(ReadOnlySpan<byte> data) where T : unmanaged
|
||||
{
|
||||
return MemoryMarshal.Cast<byte, T>(data)[0];
|
||||
}
|
||||
static T ReadStruct<T>(ReadOnlySpan<byte> data) where T : unmanaged => MemoryMarshal.Cast<byte, T>(data)[0];
|
||||
}
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
|
||||
{
|
||||
// NOTE: This call reset two internal fields to 0 and one internal field to "true".
|
||||
// It seems to be used only with software keyboard inline.
|
||||
// Since we doesn't support applets for now, it's fine to stub it.
|
||||
// Since we don't support applets for now, it's fine to stub it.
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceAm);
|
||||
|
||||
|
@ -83,6 +83,7 @@ namespace Ryujinx.Input.SDL2
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
_driver = null;
|
||||
}
|
||||
}
|
||||
|
@ -171,6 +171,7 @@ namespace Ryujinx.Input.SDL2
|
||||
return;
|
||||
}
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
_isDisposed = true;
|
||||
}
|
||||
}
|
||||
|
@ -2,18 +2,13 @@ using System;
|
||||
|
||||
namespace Ryujinx.Input.HLE
|
||||
{
|
||||
public class InputManager : IDisposable
|
||||
public class InputManager(IGamepadDriver keyboardDriver, IGamepadDriver gamepadDriver)
|
||||
: IDisposable
|
||||
{
|
||||
public IGamepadDriver KeyboardDriver { get; private set; }
|
||||
public IGamepadDriver GamepadDriver { get; private set; }
|
||||
public IGamepadDriver KeyboardDriver { get; } = keyboardDriver;
|
||||
public IGamepadDriver GamepadDriver { get; } = gamepadDriver;
|
||||
public IGamepadDriver MouseDriver { get; private set; }
|
||||
|
||||
public InputManager(IGamepadDriver keyboardDriver, IGamepadDriver gamepadDriver)
|
||||
{
|
||||
KeyboardDriver = keyboardDriver;
|
||||
GamepadDriver = gamepadDriver;
|
||||
}
|
||||
|
||||
public void SetMouseDriver(IGamepadDriver mouseDriver)
|
||||
{
|
||||
MouseDriver?.Dispose();
|
||||
|
@ -19,7 +19,7 @@ namespace Ryujinx.UI.App.Common
|
||||
{
|
||||
public class ApplicationData
|
||||
{
|
||||
public static Func<string> LocalizedNever = () => "Never";
|
||||
public static Func<string> LocalizedNever { get; set; } = () => "Never";
|
||||
|
||||
public bool Favorite { get; set; }
|
||||
public byte[] Icon { get; set; }
|
||||
|
@ -86,6 +86,8 @@ namespace Ryujinx.UI.Common
|
||||
});
|
||||
}
|
||||
|
||||
public static void SwitchToMainState() => _discordClient?.SetPresence(_discordPresenceMain);
|
||||
|
||||
private static string TruncateToByteLength(string input)
|
||||
{
|
||||
if (Encoding.UTF8.GetByteCount(input) <= ApplicationByteLimit)
|
||||
|
@ -4,6 +4,8 @@ using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Platform;
|
||||
using Avalonia.Styling;
|
||||
using Avalonia.Threading;
|
||||
using FluentAvalonia.UI.Windowing;
|
||||
using Gommon;
|
||||
using Ryujinx.Ava.Common;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.UI.Helpers;
|
||||
@ -24,6 +26,15 @@ namespace Ryujinx.Ava
|
||||
? $"Ryujinx {Program.Version}"
|
||||
: $"Ryujinx {Program.Version} - {LocaleManager.Instance[windowTitleKey.Value]}";
|
||||
|
||||
public static MainWindow MainWindow => Current!
|
||||
.ApplicationLifetime.Cast<IClassicDesktopStyleApplicationLifetime>()
|
||||
.MainWindow.Cast<MainWindow>();
|
||||
|
||||
public static void SetTaskbarProgress(TaskBarProgressBarState state) => MainWindow.PlatformFeatures.SetTaskBarProgressBarState(state);
|
||||
public static void SetTaskbarProgressValue(ulong current, ulong total) => MainWindow.PlatformFeatures.SetTaskBarProgressBarValue(current, total);
|
||||
public static void SetTaskbarProgressValue(long current, long total) => SetTaskbarProgressValue(Convert.ToUInt64(current), Convert.ToUInt64(total));
|
||||
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
Name = FormatTitle();
|
||||
@ -62,8 +73,7 @@ namespace Ryujinx.Ava
|
||||
|
||||
private void ShowRestartDialog()
|
||||
{
|
||||
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
||||
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
_ = Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
@ -82,7 +92,6 @@ namespace Ryujinx.Ava
|
||||
}
|
||||
}
|
||||
});
|
||||
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
||||
}
|
||||
|
||||
private void ThemeChanged_Event(object sender, ReactiveEventArgs<string> e)
|
||||
@ -134,16 +143,9 @@ namespace Ryujinx.Ava
|
||||
_ => ThemeVariant.Default,
|
||||
};
|
||||
|
||||
public static ThemeVariant DetectSystemTheme()
|
||||
{
|
||||
if (Application.Current is App app)
|
||||
{
|
||||
var colorValues = app.PlatformSettings.GetColorValues();
|
||||
|
||||
return ConvertThemeVariant(colorValues.ThemeVariant);
|
||||
}
|
||||
|
||||
return ThemeVariant.Default;
|
||||
}
|
||||
public static ThemeVariant DetectSystemTheme() =>
|
||||
Current is App { PlatformSettings: not null } app
|
||||
? ConvertThemeVariant(app.PlatformSettings.GetColorValues().ThemeVariant)
|
||||
: ThemeVariant.Default;
|
||||
}
|
||||
}
|
||||
|
@ -498,6 +498,7 @@ namespace Ryujinx.Ava
|
||||
public void Stop()
|
||||
{
|
||||
_isActive = false;
|
||||
DiscordIntegrationModule.SwitchToMainState();
|
||||
}
|
||||
|
||||
private void Exit()
|
||||
@ -511,6 +512,7 @@ namespace Ryujinx.Ava
|
||||
|
||||
_isStopped = true;
|
||||
_isActive = false;
|
||||
DiscordIntegrationModule.SwitchToMainState();
|
||||
}
|
||||
|
||||
public void DisposeContext()
|
||||
@ -965,7 +967,7 @@ namespace Ryujinx.Ava
|
||||
_viewModel.WindowState = WindowState.FullScreen;
|
||||
}
|
||||
|
||||
if (_viewModel.WindowState == WindowState.FullScreen)
|
||||
if (_viewModel.WindowState is WindowState.FullScreen)
|
||||
{
|
||||
_viewModel.ShowMenuAndStatusBar = false;
|
||||
}
|
||||
@ -1136,7 +1138,7 @@ namespace Ryujinx.Ava
|
||||
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
if (_keyboardInterface.GetKeyboardStateSnapshot().IsPressed(Key.Delete) && _viewModel.WindowState != WindowState.FullScreen)
|
||||
if (_keyboardInterface.GetKeyboardStateSnapshot().IsPressed(Key.Delete) && _viewModel.WindowState is not WindowState.FullScreen)
|
||||
{
|
||||
Device.Processes.ActiveApplication.DiskCacheLoadState?.Cancel();
|
||||
}
|
||||
|
@ -466,7 +466,7 @@ namespace Ryujinx.Modules
|
||||
using Stream updateFileStream = File.Open(updateFile, FileMode.Create);
|
||||
|
||||
long totalBytes = response.Content.Headers.ContentLength.Value;
|
||||
long byteWritten = 0;
|
||||
long bytesWritten = 0;
|
||||
|
||||
byte[] buffer = new byte[32 * 1024];
|
||||
|
||||
@ -479,9 +479,10 @@ namespace Ryujinx.Modules
|
||||
break;
|
||||
}
|
||||
|
||||
byteWritten += readSize;
|
||||
bytesWritten += readSize;
|
||||
|
||||
taskDialog.SetProgressBarState(GetPercentage(byteWritten, totalBytes), TaskDialogProgressState.Normal);
|
||||
taskDialog.SetProgressBarState(GetPercentage(bytesWritten, totalBytes), TaskDialogProgressState.Normal);
|
||||
App.SetTaskbarProgressValue(bytesWritten, totalBytes);
|
||||
|
||||
updateFileStream.Write(buffer, 0, readSize);
|
||||
}
|
||||
|
@ -198,9 +198,6 @@ namespace Ryujinx.Ava.UI.Applet
|
||||
return showDetails;
|
||||
}
|
||||
|
||||
public IDynamicTextInputHandler CreateDynamicTextInputHandler()
|
||||
{
|
||||
return new AvaloniaDynamicTextInputHandler(_parent);
|
||||
}
|
||||
public IDynamicTextInputHandler CreateDynamicTextInputHandler() => new AvaloniaDynamicTextInputHandler(_parent);
|
||||
}
|
||||
}
|
||||
|
@ -102,14 +102,8 @@ namespace Ryujinx.Ava.UI.Applet
|
||||
|
||||
public bool TextProcessingEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return Volatile.Read(ref _canProcessInput);
|
||||
}
|
||||
set
|
||||
{
|
||||
Volatile.Write(ref _canProcessInput, value);
|
||||
}
|
||||
get => Volatile.Read(ref _canProcessInput);
|
||||
set => Volatile.Write(ref _canProcessInput, value);
|
||||
}
|
||||
|
||||
public event DynamicTextChangedHandler TextChangedEvent;
|
||||
@ -135,23 +129,19 @@ namespace Ryujinx.Ava.UI.Applet
|
||||
});
|
||||
}
|
||||
|
||||
public void SetText(string text, int cursorBegin)
|
||||
{
|
||||
public void SetText(string text, int cursorBegin) =>
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
_hiddenTextBox.Text = text;
|
||||
_hiddenTextBox.CaretIndex = cursorBegin;
|
||||
});
|
||||
}
|
||||
|
||||
public void SetText(string text, int cursorBegin, int cursorEnd)
|
||||
{
|
||||
public void SetText(string text, int cursorBegin, int cursorEnd) =>
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
_hiddenTextBox.Text = text;
|
||||
_hiddenTextBox.SelectionStart = cursorBegin;
|
||||
_hiddenTextBox.SelectionEnd = cursorEnd;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,16 +12,7 @@
|
||||
x:DataType="applet:ControllerAppletDialog">
|
||||
<Grid
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
VerticalAlignment="Stretch" RowDefinitions="Auto,*,Auto" ColumnDefinitions="*,Auto">
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
|
@ -17,16 +17,7 @@
|
||||
<Grid
|
||||
Margin="20"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
VerticalAlignment="Stretch" RowDefinitions="Auto,*,Auto" ColumnDefinitions="Auto,*">
|
||||
<Image
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="2"
|
||||
|
@ -12,18 +12,7 @@
|
||||
<Grid
|
||||
Margin="20"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
VerticalAlignment="Stretch" RowDefinitions="Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="Auto,*">
|
||||
<Image
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="5"
|
||||
|
@ -84,7 +84,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||
return await ShowContentDialog(title, content, primaryButton, secondaryButton, closeButton, primaryButtonResult, deferResetEvent, deferCloseAction);
|
||||
}
|
||||
|
||||
public static Task<UserResult> ShowDeferredContentDialog(
|
||||
public static async Task<UserResult> ShowDeferredContentDialog(
|
||||
Window window,
|
||||
string title,
|
||||
string primaryText,
|
||||
@ -98,7 +98,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||
{
|
||||
bool startedDeferring = false;
|
||||
|
||||
return ShowTextDialog(
|
||||
return await ShowTextDialog(
|
||||
title,
|
||||
primaryText,
|
||||
secondaryText,
|
||||
@ -209,14 +209,14 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||
closeButton,
|
||||
(int)Symbol.Important);
|
||||
|
||||
internal static Task<UserResult> CreateConfirmationDialog(
|
||||
internal static async Task<UserResult> CreateConfirmationDialog(
|
||||
string primaryText,
|
||||
string secondaryText,
|
||||
string acceptButtonText,
|
||||
string cancelButtonText,
|
||||
string title,
|
||||
UserResult primaryButtonResult = UserResult.Yes)
|
||||
=> ShowTextDialog(
|
||||
=> await ShowTextDialog(
|
||||
string.IsNullOrWhiteSpace(title) ? LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle] : title,
|
||||
primaryText,
|
||||
secondaryText,
|
||||
@ -226,16 +226,16 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||
(int)Symbol.Help,
|
||||
primaryButtonResult);
|
||||
|
||||
internal static Task<UserResult> CreateLocalizedConfirmationDialog(string primaryText, string secondaryText)
|
||||
=> CreateConfirmationDialog(
|
||||
internal static async Task<UserResult> CreateLocalizedConfirmationDialog(string primaryText, string secondaryText)
|
||||
=> await CreateConfirmationDialog(
|
||||
primaryText,
|
||||
secondaryText,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogYes],
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogNo],
|
||||
LocaleManager.Instance[LocaleKeys.RyujinxConfirm]);
|
||||
|
||||
internal static Task CreateUpdaterInfoDialog(string primary, string secondaryText)
|
||||
=> ShowTextDialog(
|
||||
internal static async Task CreateUpdaterInfoDialog(string primary, string secondaryText)
|
||||
=> await ShowTextDialog(
|
||||
LocaleManager.Instance[LocaleKeys.DialogUpdaterTitle],
|
||||
primary,
|
||||
secondaryText,
|
||||
@ -244,8 +244,8 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
(int)Symbol.Important);
|
||||
|
||||
internal static Task CreateWarningDialog(string primary, string secondaryText)
|
||||
=> ShowTextDialog(
|
||||
internal static async Task CreateWarningDialog(string primary, string secondaryText)
|
||||
=> await ShowTextDialog(
|
||||
LocaleManager.Instance[LocaleKeys.DialogWarningTitle],
|
||||
primary,
|
||||
secondaryText,
|
||||
@ -254,11 +254,11 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
(int)Symbol.Important);
|
||||
|
||||
internal static Task CreateErrorDialog(string errorMessage, string secondaryErrorMessage = "")
|
||||
internal static async Task CreateErrorDialog(string errorMessage, string secondaryErrorMessage = "")
|
||||
{
|
||||
Logger.Error?.Print(LogClass.Application, errorMessage);
|
||||
|
||||
return ShowTextDialog(
|
||||
await ShowTextDialog(
|
||||
LocaleManager.Instance[LocaleKeys.DialogErrorTitle],
|
||||
LocaleManager.Instance[LocaleKeys.DialogErrorMessage],
|
||||
errorMessage,
|
||||
@ -399,11 +399,9 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Task ShowWindowAsync(Window dialogWindow, Window mainWindow = null)
|
||||
public static async Task ShowWindowAsync(Window dialogWindow, Window mainWindow = null)
|
||||
{
|
||||
mainWindow ??= GetMainWindow();
|
||||
|
||||
return dialogWindow.ShowDialog(_contentDialogOverlayWindow ?? mainWindow);
|
||||
await dialogWindow.ShowDialog(_contentDialogOverlayWindow ?? mainWindow ?? GetMainWindow());
|
||||
}
|
||||
|
||||
private static Window GetMainWindow()
|
||||
|
@ -47,7 +47,7 @@ namespace Ryujinx.Ava.UI.Models
|
||||
TitleId = info.ProgramId;
|
||||
UserId = info.UserId;
|
||||
|
||||
var appData = MainWindow.MainWindowViewModel.Applications.FirstOrDefault(x => x.IdString.Equals(TitleIdString, StringComparison.OrdinalIgnoreCase));
|
||||
var appData = App.MainWindow.ViewModel.Applications.FirstOrDefault(x => x.IdString.Equals(TitleIdString, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
InGameList = appData != null;
|
||||
|
||||
|
@ -1,15 +1,10 @@
|
||||
using Avalonia.Media.Imaging;
|
||||
using Avalonia.Platform;
|
||||
using Avalonia.Styling;
|
||||
using Avalonia.Threading;
|
||||
using Ryujinx.Ava.Common;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Common.Utilities;
|
||||
using Ryujinx.UI.Common.Configuration;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
@ -76,10 +71,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
DiscordLogo = LoadBitmap($"{basePath}Logo_Discord_{themeSuffix}?assembly=Ryujinx.UI.Common");
|
||||
}
|
||||
|
||||
private Bitmap LoadBitmap(string uri)
|
||||
{
|
||||
return new Bitmap(Avalonia.Platform.AssetLoader.Open(new Uri(uri)));
|
||||
}
|
||||
private static Bitmap LoadBitmap(string uri) => new(Avalonia.Platform.AssetLoader.Open(new Uri(uri)));
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
private readonly string _amiiboJsonPath;
|
||||
private readonly byte[] _amiiboLogoBytes;
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly StyleableAppWindow _owner;
|
||||
private readonly AmiiboWindow _owner;
|
||||
|
||||
private Bitmap _amiiboImage;
|
||||
private List<AmiiboApi> _amiiboList;
|
||||
@ -49,7 +49,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
private static readonly AmiiboJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
||||
|
||||
public AmiiboWindowViewModel(StyleableAppWindow owner, string lastScannedAmiiboId, string titleId)
|
||||
public AmiiboWindowViewModel(AmiiboWindow owner, string lastScannedAmiiboId, string titleId)
|
||||
{
|
||||
_owner = owner;
|
||||
|
||||
@ -186,6 +186,22 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public void Scan()
|
||||
{
|
||||
if (AmiiboSelectedIndex > -1)
|
||||
{
|
||||
_owner.ScannedAmiibo = AmiiboList[AmiiboSelectedIndex];
|
||||
_owner.IsScanned = true;
|
||||
_owner.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
_owner.IsScanned = false;
|
||||
_owner.Close();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
|
@ -110,6 +110,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
public ApplicationData ListSelectedApplication;
|
||||
public ApplicationData GridSelectedApplication;
|
||||
|
||||
public MainWindow Window { get; init; }
|
||||
|
||||
internal AppHost AppHost { get; set; }
|
||||
|
||||
public MainWindowViewModel()
|
||||
@ -1424,7 +1426,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public async Task ExitCurrentState()
|
||||
{
|
||||
if (WindowState == WindowState.FullScreen)
|
||||
if (WindowState is WindowState.FullScreen)
|
||||
{
|
||||
ToggleFullscreen();
|
||||
}
|
||||
@ -1710,6 +1712,28 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
});
|
||||
}
|
||||
|
||||
public async Task OpenAmiiboWindow()
|
||||
{
|
||||
if (!IsAmiiboRequested)
|
||||
return;
|
||||
|
||||
if (AppHost.Device.System.SearchingForAmiibo(out int deviceId))
|
||||
{
|
||||
string titleId = AppHost.Device.Processes.ActiveApplication.ProgramIdText.ToUpper();
|
||||
AmiiboWindow window = new(ShowAll, LastScannedAmiiboId, titleId);
|
||||
|
||||
await window.ShowDialog(Window);
|
||||
|
||||
if (window.IsScanned)
|
||||
{
|
||||
ShowAll = window.ViewModel.ShowAllAmiibo;
|
||||
LastScannedAmiiboId = window.ScannedAmiibo.GetId();
|
||||
|
||||
AppHost.Device.System.ScanAmiibo(deviceId, LastScannedAmiiboId, window.ViewModel.UseRandomUuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ToggleFullscreen()
|
||||
{
|
||||
if (Environment.TickCount64 - LastFullscreenToggle < HotKeyPressDelayMs)
|
||||
@ -1719,7 +1743,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
LastFullscreenToggle = Environment.TickCount64;
|
||||
|
||||
if (WindowState == WindowState.FullScreen)
|
||||
if (WindowState is not WindowState.Normal)
|
||||
{
|
||||
WindowState = WindowState.Normal;
|
||||
|
||||
@ -1738,7 +1762,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
IsFullScreen = WindowState == WindowState.FullScreen;
|
||||
IsFullScreen = WindowState is WindowState.FullScreen;
|
||||
}
|
||||
|
||||
public static void SaveConfig()
|
||||
|
@ -240,6 +240,7 @@
|
||||
Click="OpenAmiiboWindow"
|
||||
Header="{locale:Locale MenuBarActionsScanAmiibo}"
|
||||
Icon="{icon:Icon mdi-cube-scan}"
|
||||
InputGesture="Ctrl + A"
|
||||
IsEnabled="{Binding IsAmiiboRequested}" />
|
||||
<MenuItem
|
||||
Command="{Binding TakeScreenshot}"
|
||||
|
@ -143,27 +143,8 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||
}
|
||||
}
|
||||
|
||||
public async void OpenAmiiboWindow(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!ViewModel.IsAmiiboRequested)
|
||||
return;
|
||||
|
||||
if (ViewModel.AppHost.Device.System.SearchingForAmiibo(out int deviceId))
|
||||
{
|
||||
string titleId = ViewModel.AppHost.Device.Processes.ActiveApplication.ProgramIdText.ToUpper();
|
||||
AmiiboWindow window = new(ViewModel.ShowAll, ViewModel.LastScannedAmiiboId, titleId);
|
||||
|
||||
await window.ShowDialog(Window);
|
||||
|
||||
if (window.IsScanned)
|
||||
{
|
||||
ViewModel.ShowAll = window.ViewModel.ShowAllAmiibo;
|
||||
ViewModel.LastScannedAmiiboId = window.ScannedAmiibo.GetId();
|
||||
|
||||
ViewModel.AppHost.Device.System.ScanAmiibo(deviceId, ViewModel.LastScannedAmiiboId, window.ViewModel.UseRandomUuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
public async void OpenAmiiboWindow(object sender, RoutedEventArgs e)
|
||||
=> await ViewModel.OpenAmiiboWindow();
|
||||
|
||||
public async void OpenCheatManagerForCurrentApp(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
@ -29,12 +29,7 @@
|
||||
Margin="5"
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding EnableNonGameRunningControls}">
|
||||
<Grid Margin="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Margin="0" ColumnDefinitions="Auto,Auto,*">
|
||||
<Button
|
||||
Width="25"
|
||||
Height="25"
|
||||
|
@ -2,6 +2,8 @@ using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Threading;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.UI.Windows;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
@ -27,6 +29,11 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||
{
|
||||
Window = window;
|
||||
DataContext = window.ViewModel;
|
||||
LocaleManager.Instance.LocaleChanged += () => Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
if (Window.ViewModel.EnableNonGameRunningControls)
|
||||
Refresh_OnClick(null, null);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,10 +55,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||
ConfigurationState.Instance.Graphics.AspectRatio.Value = (int)aspectRatio + 1 > Enum.GetNames(typeof(AspectRatio)).Length - 1 ? AspectRatio.Fixed4x3 : aspectRatio + 1;
|
||||
}
|
||||
|
||||
private void Refresh_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Window.LoadApplications();
|
||||
}
|
||||
private void Refresh_OnClick(object sender, RoutedEventArgs e) => Window.LoadApplications();
|
||||
|
||||
private void VolumeStatus_OnPointerWheelChanged(object sender, PointerWheelEventArgs e)
|
||||
{
|
||||
|
@ -18,32 +18,17 @@
|
||||
<Design.DataContext>
|
||||
<viewModel:AboutWindowViewModel />
|
||||
</Design.DataContext>
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ColumnDefinitions="Auto,Auto,*">
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
VerticalAlignment="Stretch" RowDefinitions="Auto,*,Auto">
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Spacing="10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Orientation="Horizontal"
|
||||
@ -84,7 +69,6 @@
|
||||
Text="{Binding Version}"
|
||||
TextAlignment="Center" />
|
||||
<Border
|
||||
|
||||
Height="1"
|
||||
Margin="0,20, 0, 20"
|
||||
HorizontalAlignment="Stretch"
|
||||
@ -156,11 +140,7 @@
|
||||
<Grid
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
VerticalAlignment="Stretch" RowDefinitions="Auto,Auto">
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Margin="0,10,0,0"
|
||||
|
@ -22,18 +22,8 @@
|
||||
<Design.DataContext>
|
||||
<viewModels:AmiiboWindowViewModel />
|
||||
</Design.DataContext>
|
||||
<Grid Margin="15" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1" HorizontalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid RowDefinitions="Auto,Auto,*,Auto" Margin="15" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
|
||||
<Grid ColumnDefinitions="*,*" Grid.Row="1" HorizontalAlignment="Stretch" >
|
||||
<StackPanel Spacing="10" Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock VerticalAlignment="Center" Text="{locale:Locale AmiiboSeriesLabel}" />
|
||||
<ComboBox SelectedIndex="{Binding SeriesSelectedIndex}" ItemsSource="{Binding AmiiboSeries}" MinWidth="100" />
|
||||
@ -51,24 +41,27 @@
|
||||
TextAlignment="Center" />
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
<Grid Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Margin="10" Grid.Column="0" VerticalContentAlignment="Center" IsChecked="{Binding ShowAllAmiibo}"
|
||||
<Grid Grid.Row="3" ColumnDefinitions="Auto,Auto,*,Auto,Auto">
|
||||
<CheckBox Margin="10" Grid.Column="0" VerticalContentAlignment="Center"
|
||||
IsChecked="{Binding ShowAllAmiibo}"
|
||||
Content="{locale:Locale AmiiboOptionsShowAllLabel}" />
|
||||
<CheckBox Margin="10" VerticalContentAlignment="Center" Grid.Column="1" IsChecked="{Binding UseRandomUuid}"
|
||||
<CheckBox HotKey="H"
|
||||
Margin="10" VerticalContentAlignment="Center" Grid.Column="1"
|
||||
IsChecked="{Binding UseRandomUuid}"
|
||||
Content="{locale:Locale AmiiboOptionsUsRandomTagLabel}" />
|
||||
|
||||
<Button Grid.Column="3" IsEnabled="{Binding EnableScanning}" Width="80"
|
||||
Content="{locale:Locale AmiiboScanButtonLabel}" Name="ScanButton"
|
||||
<Button Grid.Column="3"
|
||||
IsEnabled="{Binding EnableScanning}"
|
||||
Width="80"
|
||||
Name="ScanButton"
|
||||
HotKey="Return"
|
||||
Content="{locale:Locale AmiiboScanButtonLabel}"
|
||||
Click="ScanButton_Click" />
|
||||
<Button Grid.Column="4" Margin="10,0" Width="80" Content="{locale:Locale InputDialogCancel}"
|
||||
<Button Grid.Column="4"
|
||||
Margin="10,0"
|
||||
Width="80"
|
||||
Name="CancelButton"
|
||||
HotKey="Escape"
|
||||
Content="{locale:Locale InputDialogCancel}"
|
||||
Click="CancelButton_Click" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
@ -9,13 +9,11 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
{
|
||||
public AmiiboWindow(bool showAll, string lastScannedAmiiboId, string titleId)
|
||||
{
|
||||
ViewModel = new AmiiboWindowViewModel(this, lastScannedAmiiboId, titleId)
|
||||
DataContext = ViewModel = new AmiiboWindowViewModel(this, lastScannedAmiiboId, titleId)
|
||||
{
|
||||
ShowAllAmiibo = showAll,
|
||||
};
|
||||
|
||||
DataContext = ViewModel;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
Title = App.FormatTitle(LocaleKeys.Amiibo);
|
||||
@ -23,9 +21,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
|
||||
public AmiiboWindow()
|
||||
{
|
||||
ViewModel = new AmiiboWindowViewModel(this, string.Empty, string.Empty);
|
||||
|
||||
DataContext = ViewModel;
|
||||
DataContext = ViewModel = new AmiiboWindowViewModel(this, string.Empty, string.Empty);
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
@ -37,23 +33,10 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
|
||||
public bool IsScanned { get; set; }
|
||||
public AmiiboApi ScannedAmiibo { get; set; }
|
||||
public AmiiboWindowViewModel ViewModel { get; set; }
|
||||
public AmiiboWindowViewModel ViewModel;
|
||||
|
||||
private void ScanButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (ViewModel.AmiiboSelectedIndex > -1)
|
||||
{
|
||||
ScannedAmiibo = ViewModel.AmiiboList[ViewModel.AmiiboSelectedIndex];
|
||||
IsScanned = true;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
private void ScanButton_Click(object sender, RoutedEventArgs e) => ViewModel.Scan();
|
||||
|
||||
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
IsScanned = false;
|
||||
|
||||
Close();
|
||||
}
|
||||
private void CancelButton_Click(object sender, RoutedEventArgs e) => ViewModel.Cancel();
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<window:StyleableAppWindow
|
||||
<window:StyleableAppWindow
|
||||
x:Class="Ryujinx.Ava.UI.Windows.CheatWindow"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@ -20,18 +20,7 @@
|
||||
<Setter Property="IsExpanded" Value="True" />
|
||||
</Style>
|
||||
</Window.Styles>
|
||||
<Grid Name="CheatGrid" Margin="15">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Name="CheatGrid" Margin="15" RowDefinitions="Auto,Auto,Auto,*,Auto" ColumnDefinitions="*,*">
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
@ -109,6 +98,7 @@
|
||||
Name="SaveButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
HotKey="Ctrl+S"
|
||||
Command="{Binding Save}"
|
||||
IsVisible="{Binding !NoCheatsFound}">
|
||||
<TextBlock Text="{locale:Locale SettingsButtonSave}" />
|
||||
@ -117,6 +107,7 @@
|
||||
Name="CancelButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
HotKey="Escape"
|
||||
Command="{Binding Close}">
|
||||
<TextBlock Text="{locale:Locale InputDialogCancel}" />
|
||||
</Button>
|
||||
|
@ -21,6 +21,7 @@
|
||||
x:DataType="viewModels:MainWindowViewModel"
|
||||
mc:Ignorable="d"
|
||||
WindowStartupLocation="Manual"
|
||||
Icon="resm:Ryujinx.UI.Common.Resources.Logo_Ryujinx.png?assembly=Ryujinx.UI.Common"
|
||||
Focusable="True">
|
||||
<Window.Styles>
|
||||
<Style Selector="TitleBar:fullscreen">
|
||||
@ -39,23 +40,13 @@
|
||||
<KeyBinding Gesture="Ctrl+Cmd+F" Command="{Binding ToggleFullscreen}" />
|
||||
<KeyBinding Gesture="F9" Command="{Binding ToggleDockMode}" />
|
||||
<KeyBinding Gesture="Escape" Command="{Binding ExitCurrentState}" />
|
||||
<KeyBinding Gesture="Ctrl+A" Command="{Binding OpenAmiiboWindow}" />
|
||||
</Window.KeyBindings>
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RowDefinitions="*">
|
||||
<helpers:OffscreenTextBox IsEnabled="False" Opacity="0" Name="HiddenTextBox" IsHitTestVisible="False" IsTabStop="False" />
|
||||
<Grid
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
VerticalAlignment="Stretch" ColumnDefinitions="*" RowDefinitions="Auto,*,Auto">
|
||||
<StackPanel
|
||||
Name="MenuBar"
|
||||
MinHeight="35"
|
||||
@ -78,11 +69,8 @@
|
||||
BorderThickness="0,0,0,0"
|
||||
DockPanel.Dock="Top"
|
||||
IsVisible="{Binding ShowContent}">
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="GameLibrary">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="GameLibrary"
|
||||
RowDefinitions="Auto,*">
|
||||
<main:MainViewControls
|
||||
Name="ViewControls"
|
||||
Grid.Row="0"/>
|
||||
@ -116,11 +104,7 @@
|
||||
Margin="40"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding ShowLoadProgress}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
IsVisible="{Binding ShowLoadProgress}" ColumnDefinitions="Auto,*">
|
||||
<Border
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="0"
|
||||
@ -143,12 +127,7 @@
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding ShowLoadProgress}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
IsVisible="{Binding ShowLoadProgress}" RowDefinitions="Auto,Auto,Auto">
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Margin="10"
|
||||
|
@ -37,8 +37,6 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
{
|
||||
public partial class MainWindow : StyleableAppWindow
|
||||
{
|
||||
internal static MainWindowViewModel MainWindowViewModel { get; private set; }
|
||||
|
||||
public MainWindowViewModel ViewModel { get; }
|
||||
|
||||
internal readonly AvaHostUIHandler UiHandler;
|
||||
@ -71,7 +69,10 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
DataContext = ViewModel = MainWindowViewModel = new MainWindowViewModel();
|
||||
DataContext = ViewModel = new MainWindowViewModel
|
||||
{
|
||||
Window = this
|
||||
};
|
||||
|
||||
InitializeComponent();
|
||||
Load();
|
||||
@ -184,7 +185,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
ViewModel.ShowContent = true;
|
||||
ViewModel.IsLoadingIndeterminate = false;
|
||||
|
||||
if (startFullscreen && ViewModel.WindowState != WindowState.FullScreen)
|
||||
if (startFullscreen && ViewModel.WindowState is not WindowState.FullScreen)
|
||||
{
|
||||
ViewModel.ToggleFullscreen();
|
||||
}
|
||||
@ -196,7 +197,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
ViewModel.ShowLoadProgress = true;
|
||||
ViewModel.IsLoadingIndeterminate = true;
|
||||
|
||||
if (startFullscreen && ViewModel.WindowState != WindowState.FullScreen)
|
||||
if (startFullscreen && ViewModel.WindowState is not WindowState.FullScreen)
|
||||
{
|
||||
ViewModel.ToggleFullscreen();
|
||||
}
|
||||
|
@ -14,21 +14,11 @@
|
||||
x:CompileBindings="True"
|
||||
x:DataType="viewModels:ModManagerViewModel"
|
||||
Focusable="True">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
<Panel
|
||||
Margin="0 0 0 10"
|
||||
Grid.Row="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid ColumnDefinitions="Auto,Auto,*">
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Text="{Binding ModCount}" />
|
||||
|
@ -14,7 +14,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
{
|
||||
public partial class ModManagerWindow : UserControl
|
||||
{
|
||||
public ModManagerViewModel ViewModel;
|
||||
public readonly ModManagerViewModel ViewModel;
|
||||
|
||||
public ModManagerWindow()
|
||||
{
|
||||
|
@ -21,12 +21,7 @@
|
||||
<Design.DataContext>
|
||||
<viewModels:SettingsViewModel />
|
||||
</Design.DataContext>
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="600">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="600" RowDefinitions="Auto,*,Auto">
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Grid.Row="1"
|
||||
|
@ -10,14 +10,13 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
{
|
||||
public partial class SettingsWindow : StyleableAppWindow
|
||||
{
|
||||
internal SettingsViewModel ViewModel { get; set; }
|
||||
internal readonly SettingsViewModel ViewModel;
|
||||
|
||||
public SettingsWindow(VirtualFileSystem virtualFileSystem, ContentManager contentManager)
|
||||
{
|
||||
Title = App.FormatTitle(LocaleKeys.Settings);
|
||||
|
||||
ViewModel = new SettingsViewModel(virtualFileSystem, contentManager);
|
||||
DataContext = ViewModel;
|
||||
DataContext = ViewModel = new SettingsViewModel(virtualFileSystem, contentManager);
|
||||
|
||||
ViewModel.CloseWindow += Close;
|
||||
ViewModel.SaveSettingsEvent += SaveSettings;
|
||||
@ -28,8 +27,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
|
||||
public SettingsWindow()
|
||||
{
|
||||
ViewModel = new SettingsViewModel();
|
||||
DataContext = ViewModel;
|
||||
DataContext = ViewModel = new SettingsViewModel();
|
||||
|
||||
InitializeComponent();
|
||||
Load();
|
||||
|
@ -1,13 +1,9 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Media.Imaging;
|
||||
using Avalonia.Platform;
|
||||
using FluentAvalonia.UI.Windowing;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.UI.Common.Configuration;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Ryujinx.Ava.UI.Windows
|
||||
{
|
||||
|
@ -17,12 +17,7 @@
|
||||
<UserControl.Resources>
|
||||
<helpers:TitleUpdateLabelConverter x:Key="TitleUpdateLabel" />
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Margin="0 0 0 10"
|
||||
|
Reference in New Issue
Block a user