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