mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-09-11 20:37:35 +00:00
Compare commits
81 Commits
Canary-1.2
...
1.2.81
Author | SHA1 | Date | |
---|---|---|---|
|
13d411e4de | ||
|
9f53b07491 | ||
|
cd8113dadf | ||
|
9089c4ffe5 | ||
|
fe9d8d05bd | ||
|
880a8ae748 | ||
|
11531dacb6 | ||
|
3974739ed3 | ||
|
440a3447fb | ||
|
65374ed6cb | ||
|
789d6ab959 | ||
|
182db31343 | ||
|
ea296b134d | ||
|
bf584442b2 | ||
|
cb7c294dbf | ||
|
eaf1e7efd2 | ||
|
471e7ed2e4 | ||
|
ad3e80b383 | ||
|
ed64a63094 | ||
|
8df7ba2d56 | ||
|
e743d78115 | ||
|
04ba762710 | ||
|
f42b2ed59d | ||
|
d135385cab | ||
|
b360f4e721 | ||
|
a1c0c70ec2 | ||
|
290ac405ac | ||
|
bbd64fd5f0 | ||
|
09446fd80e | ||
|
4f014a89cf | ||
|
6482e566ab | ||
|
7fcd9b792e | ||
|
e676fd8b17 | ||
|
dd16e3cee1 | ||
|
31e5f74e05 | ||
|
f2f099bddb | ||
|
2616dc57fb | ||
|
0cdf7cfe21 | ||
|
2ecf999569 | ||
|
b612fc5155 | ||
|
25eb545409 | ||
|
52269964b6 | ||
|
ccdddac8fc | ||
|
1bc30bf3ba | ||
|
4868fface8 | ||
|
6fca4492d0 | ||
|
ade2f256e0 | ||
|
580b150c9a | ||
|
e6bad52945 | ||
|
beda3206e0 | ||
|
2f93a0f706 | ||
|
80f44d9547 | ||
|
b08e5db6d8 | ||
|
6a291d4116 | ||
|
6fc827fe67 | ||
|
6cd4866d76 | ||
|
4d7ca5c0f0 | ||
|
a375faecc1 | ||
|
1728b0f20c | ||
|
5aa071c59b | ||
|
1018c9db8b | ||
|
01ccd18726 | ||
|
abfbc6f4bc | ||
|
6a4bc02d7a | ||
|
814c0526d2 | ||
|
a5a4ef38e6 | ||
|
c17e3bfcdf | ||
|
017f46f318 | ||
|
fd4d801bfd | ||
|
f1dee50275 | ||
|
c2ae49eb47 | ||
|
47c71966d0 | ||
|
f9e8f4bc29 | ||
|
7694c8c046 | ||
|
0dd789e8a5 | ||
|
4e0aafd005 | ||
|
c5091f499e | ||
|
41c8fd8194 | ||
|
d4a7ee25ea | ||
|
3141c560fb | ||
|
de341b285b |
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -22,7 +22,7 @@ body:
|
|||||||
id: log
|
id: log
|
||||||
attributes:
|
attributes:
|
||||||
label: Log file
|
label: Log file
|
||||||
description: A log file will help our developers to better diagnose and fix the issue.
|
description: "A log file will help our developers to better diagnose and fix the issue. UPLOAD THE FILE. DO NOT COPY AND PASTE THE FILE'S CONTENT."
|
||||||
placeholder: Logs files can be found under "Logs" folder in Ryujinx program folder. They can also be accessed by opening Ryujinx, then going to File > Open Logs Folder. You can drag and drop the log on to the text area (do not copy paste).
|
placeholder: Logs files can be found under "Logs" folder in Ryujinx program folder. They can also be accessed by opening Ryujinx, then going to File > Open Logs Folder. You can drag and drop the log on to the text area (do not copy paste).
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -129,11 +129,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
global-json-file: global.json
|
global-json-file: global.json
|
||||||
|
|
||||||
- name: Setup LLVM 14
|
- name: Setup LLVM 17
|
||||||
run: |
|
run: |
|
||||||
wget https://apt.llvm.org/llvm.sh
|
wget https://apt.llvm.org/llvm.sh
|
||||||
chmod +x llvm.sh
|
chmod +x llvm.sh
|
||||||
sudo ./llvm.sh 14
|
sudo ./llvm.sh 17
|
||||||
|
|
||||||
- name: Install rcodesign
|
- name: Install rcodesign
|
||||||
run: |
|
run: |
|
||||||
|
6
.github/workflows/canary.yml
vendored
6
.github/workflows/canary.yml
vendored
@@ -202,7 +202,7 @@ jobs:
|
|||||||
|
|
||||||
macos_release:
|
macos_release:
|
||||||
name: Release MacOS universal
|
name: Release MacOS universal
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -210,11 +210,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
global-json-file: global.json
|
global-json-file: global.json
|
||||||
|
|
||||||
- name: Setup LLVM 15
|
- name: Setup LLVM 17
|
||||||
run: |
|
run: |
|
||||||
wget https://apt.llvm.org/llvm.sh
|
wget https://apt.llvm.org/llvm.sh
|
||||||
chmod +x llvm.sh
|
chmod +x llvm.sh
|
||||||
sudo ./llvm.sh 15
|
sudo ./llvm.sh 17
|
||||||
|
|
||||||
- name: Install rcodesign
|
- name: Install rcodesign
|
||||||
run: |
|
run: |
|
||||||
|
16
.github/workflows/release.yml
vendored
16
.github/workflows/release.yml
vendored
@@ -3,16 +3,6 @@ name: Release job
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs: {}
|
inputs: {}
|
||||||
push:
|
|
||||||
branches: [ release ]
|
|
||||||
paths-ignore:
|
|
||||||
- '.github/**'
|
|
||||||
- 'docs/**'
|
|
||||||
- 'assets/**'
|
|
||||||
- '*.yml'
|
|
||||||
- '*.json'
|
|
||||||
- '*.config'
|
|
||||||
- '*.md'
|
|
||||||
|
|
||||||
concurrency: release
|
concurrency: release
|
||||||
|
|
||||||
@@ -193,7 +183,7 @@ jobs:
|
|||||||
|
|
||||||
macos_release:
|
macos_release:
|
||||||
name: Release MacOS universal
|
name: Release MacOS universal
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -201,11 +191,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
global-json-file: global.json
|
global-json-file: global.json
|
||||||
|
|
||||||
- name: Setup LLVM 15
|
- name: Setup LLVM 17
|
||||||
run: |
|
run: |
|
||||||
wget https://apt.llvm.org/llvm.sh
|
wget https://apt.llvm.org/llvm.sh
|
||||||
chmod +x llvm.sh
|
chmod +x llvm.sh
|
||||||
sudo ./llvm.sh 15
|
sudo ./llvm.sh 17
|
||||||
|
|
||||||
- name: Install rcodesign
|
- name: Install rcodesign
|
||||||
run: |
|
run: |
|
||||||
|
@@ -3,13 +3,13 @@
|
|||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageVersion Include="Avalonia" Version="11.0.10" />
|
<PackageVersion Include="Avalonia" Version="11.0.13" />
|
||||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.0.10" />
|
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.0.13" />
|
||||||
<PackageVersion Include="Avalonia.Desktop" Version="11.0.10" />
|
<PackageVersion Include="Avalonia.Desktop" Version="11.0.13" />
|
||||||
<PackageVersion Include="Avalonia.Diagnostics" Version="11.0.10" />
|
<PackageVersion Include="Avalonia.Diagnostics" Version="11.0.13" />
|
||||||
<PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="11.0.10" />
|
<PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="11.0.13" />
|
||||||
<PackageVersion Include="Avalonia.Svg" Version="11.0.0.18" />
|
<PackageVersion Include="Avalonia.Svg" Version="11.0.0.19" />
|
||||||
<PackageVersion Include="Avalonia.Svg.Skia" Version="11.0.0.18" />
|
<PackageVersion Include="Avalonia.Svg.Skia" Version="11.0.0.19" />
|
||||||
<PackageVersion Include="Microsoft.Build.Framework" Version="17.11.4" />
|
<PackageVersion Include="Microsoft.Build.Framework" Version="17.11.4" />
|
||||||
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.12.6" />
|
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.12.6" />
|
||||||
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<PackageVersion Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="9.4.0"/>
|
<PackageVersion Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="9.4.0"/>
|
||||||
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
|
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
|
||||||
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0"/>
|
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0"/>
|
||||||
<PackageVersion Include="Concentus" Version="2.2.0" />
|
<PackageVersion Include="Concentus" Version="2.2.2" />
|
||||||
<PackageVersion Include="DiscordRichPresence" Version="1.2.1.24" />
|
<PackageVersion Include="DiscordRichPresence" Version="1.2.1.24" />
|
||||||
<PackageVersion Include="DynamicData" Version="9.0.4" />
|
<PackageVersion Include="DynamicData" Version="9.0.4" />
|
||||||
<PackageVersion Include="FluentAvaloniaUI" Version="2.0.5" />
|
<PackageVersion Include="FluentAvaloniaUI" Version="2.0.5" />
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<PackageVersion Include="LibHac" Version="0.19.0" />
|
<PackageVersion Include="LibHac" Version="0.19.0" />
|
||||||
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
|
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
|
||||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
|
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
|
||||||
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.1.2" />
|
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.3.0" />
|
||||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
|
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
|
||||||
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
|
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
|
||||||
<PackageVersion Include="MsgPack.Cli" Version="1.0.1" />
|
<PackageVersion Include="MsgPack.Cli" Version="1.0.1" />
|
||||||
@@ -48,11 +48,11 @@
|
|||||||
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
||||||
<PackageVersion Include="SharpMetal" Version="1.0.0-preview21" />
|
<PackageVersion Include="SharpMetal" Version="1.0.0-preview21" />
|
||||||
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
|
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
|
||||||
<PackageVersion Include="Silk.NET.Vulkan" Version="2.21.0" />
|
<PackageVersion Include="Silk.NET.Vulkan" Version="2.22.0" />
|
||||||
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.21.0" />
|
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.22.0" />
|
||||||
<PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.21.0" />
|
<PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.22.0" />
|
||||||
<PackageVersion Include="SkiaSharp" Version="2.88.7" />
|
<PackageVersion Include="SkiaSharp" Version="2.88.9" />
|
||||||
<PackageVersion Include="SkiaSharp.NativeAssets.Linux" Version="2.88.7" />
|
<PackageVersion Include="SkiaSharp.NativeAssets.Linux" Version="2.88.9" />
|
||||||
<PackageVersion Include="SPB" Version="0.0.4-build32" />
|
<PackageVersion Include="SPB" Version="0.0.4-build32" />
|
||||||
<PackageVersion Include="System.IO.Hashing" Version="9.0.0" />
|
<PackageVersion Include="System.IO.Hashing" Version="9.0.0" />
|
||||||
<PackageVersion Include="System.Management" Version="9.0.0" />
|
<PackageVersion Include="System.Management" Version="9.0.0" />
|
||||||
|
@@ -19,7 +19,7 @@ if platform.system() == "Darwin":
|
|||||||
else:
|
else:
|
||||||
OTOOL = shutil.which("llvm-otool")
|
OTOOL = shutil.which("llvm-otool")
|
||||||
if OTOOL is None:
|
if OTOOL is None:
|
||||||
for llvm_ver in [15, 14, 13]:
|
for llvm_ver in [17, 16, 15, 14, 13]:
|
||||||
otool_path = shutil.which(f"llvm-otool-{llvm_ver}")
|
otool_path = shutil.which(f"llvm-otool-{llvm_ver}")
|
||||||
if otool_path is not None:
|
if otool_path is not None:
|
||||||
OTOOL = otool_path
|
OTOOL = otool_path
|
||||||
|
@@ -26,7 +26,7 @@ else:
|
|||||||
LIPO = shutil.which("llvm-lipo")
|
LIPO = shutil.which("llvm-lipo")
|
||||||
|
|
||||||
if LIPO is None:
|
if LIPO is None:
|
||||||
for llvm_ver in [15, 14, 13]:
|
for llvm_ver in [17, 16, 15, 14, 13]:
|
||||||
lipo_path = shutil.which(f"llvm-lipo-{llvm_ver}")
|
lipo_path = shutil.which(f"llvm-lipo-{llvm_ver}")
|
||||||
if lipo_path is not None:
|
if lipo_path is not None:
|
||||||
LIPO = lipo_path
|
LIPO = lipo_path
|
||||||
|
@@ -67,11 +67,11 @@ python3 "$BASE_DIR/distribution/macos/construct_universal_dylib.py" "$ARM64_APP_
|
|||||||
|
|
||||||
if ! [ -x "$(command -v lipo)" ];
|
if ! [ -x "$(command -v lipo)" ];
|
||||||
then
|
then
|
||||||
if ! [ -x "$(command -v llvm-lipo-14)" ];
|
if ! [ -x "$(command -v llvm-lipo-17)" ];
|
||||||
then
|
then
|
||||||
LIPO=llvm-lipo
|
LIPO=llvm-lipo
|
||||||
else
|
else
|
||||||
LIPO=llvm-lipo-14
|
LIPO=llvm-lipo-17
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
LIPO=lipo
|
LIPO=lipo
|
||||||
|
@@ -62,11 +62,11 @@ python3 "$BASE_DIR/distribution/macos/construct_universal_dylib.py" "$ARM64_OUTP
|
|||||||
|
|
||||||
if ! [ -x "$(command -v lipo)" ];
|
if ! [ -x "$(command -v lipo)" ];
|
||||||
then
|
then
|
||||||
if ! [ -x "$(command -v llvm-lipo-14)" ];
|
if ! [ -x "$(command -v llvm-lipo-17)" ];
|
||||||
then
|
then
|
||||||
LIPO=llvm-lipo
|
LIPO=llvm-lipo
|
||||||
else
|
else
|
||||||
LIPO=llvm-lipo-14
|
LIPO=llvm-lipo-17
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
LIPO=lipo
|
LIPO=lipo
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
<key>CSResourcesFileMapped</key>
|
<key>CSResourcesFileMapped</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>Copyright © 2018 - 2023 Ryujinx Team and Contributors.</string>
|
<string>Copyright © 2018 - 2025 Ryujinx Team and Contributors.</string>
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
<string>public.app-category.games</string>
|
<string>public.app-category.games</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
File diff suppressed because it is too large
Load Diff
10
src/Ryujinx.Common/RyujinxException.cs
Normal file
10
src/Ryujinx.Common/RyujinxException.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Ryujinx.Common
|
||||||
|
{
|
||||||
|
public class RyujinxException : Exception
|
||||||
|
{
|
||||||
|
public RyujinxException(string message) : base(message)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
using Gommon;
|
using Gommon;
|
||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -14,6 +14,7 @@ namespace Ryujinx.Common
|
|||||||
{
|
{
|
||||||
switch (currentBackend)
|
switch (currentBackend)
|
||||||
{
|
{
|
||||||
|
case GraphicsBackend.Metal when !OperatingSystem.IsMacOS():
|
||||||
case GraphicsBackend.OpenGl when OperatingSystem.IsMacOS():
|
case GraphicsBackend.OpenGl when OperatingSystem.IsMacOS():
|
||||||
return GraphicsBackend.Vulkan;
|
return GraphicsBackend.Vulkan;
|
||||||
case GraphicsBackend.Vulkan or GraphicsBackend.OpenGl or GraphicsBackend.Metal:
|
case GraphicsBackend.Vulkan or GraphicsBackend.OpenGl or GraphicsBackend.Metal:
|
||||||
@@ -28,18 +29,28 @@ namespace Ryujinx.Common
|
|||||||
|
|
||||||
public static readonly string[] GreatMetalTitles =
|
public static readonly string[] GreatMetalTitles =
|
||||||
[
|
[
|
||||||
"01006f8002326000", // Animal Crossings: New Horizons
|
"010076f0049a2000", // Bayonetta
|
||||||
"01009bf0072d4000", // Captain Toad: Treasure Tracker
|
|
||||||
"0100a5c00d162000", // Cuphead
|
"0100a5c00d162000", // Cuphead
|
||||||
"010023800d64a000", // Deltarune
|
"010023800d64a000", // Deltarune
|
||||||
|
"01003a30012c0000", // LEGO City Undercover
|
||||||
"010028600EBDA000", // Mario 3D World
|
"010028600EBDA000", // Mario 3D World
|
||||||
"0100152000022000", // Mario Kart 8 Deluxe
|
"0100152000022000", // Mario Kart 8 Deluxe
|
||||||
"01005CA01580E000", // Persona 5
|
"010075a016a3a000", // Persona 4 Arena Ultimax
|
||||||
"0100187003A36000", // Pokémon: Let's Go, Evoli!
|
"0100187003A36000", // Pokémon: Let's Go, Eevee!
|
||||||
"010003f003a34000", // Pokémon: Let's Go, Pikachu!
|
"010003f003a34000", // Pokémon: Let's Go, Pikachu!
|
||||||
"01008C0016544000", // Sea of Stars
|
"01008C0016544000", // Sea of Stars
|
||||||
"01006A800016E000", // Smash Ultimate
|
"01006A800016E000", // Smash Ultimate
|
||||||
"0100000000010000", // Super Mario Odyessy
|
"01006bb00c6f0000", // The Legend of Zelda: Link's Awakening
|
||||||
|
|
||||||
|
// These ones have small issues, but those happen on Vulkan as well:
|
||||||
|
"01006f8002326000", // Animal Crossings: New Horizons
|
||||||
|
"01009bf0072d4000", // Captain Toad: Treasure Tracker
|
||||||
|
"01009510001ca000", // Fast RMX
|
||||||
|
"01005CA01580E000", // Persona 5 Royale
|
||||||
|
"0100000000010000", // Super Mario Odyssey
|
||||||
|
|
||||||
|
//Isaac claims it has a issue in level 2, but I am not able to replicate it on my M3. More testing would be appreciated:
|
||||||
|
"010015100b514000", // Super Mario Bros. Wonder
|
||||||
];
|
];
|
||||||
|
|
||||||
public static string GetDiscordGameAsset(string titleId)
|
public static string GetDiscordGameAsset(string titleId)
|
||||||
@@ -47,93 +58,117 @@ namespace Ryujinx.Common
|
|||||||
|
|
||||||
public static readonly string[] DiscordGameAssetKeys =
|
public static readonly string[] DiscordGameAssetKeys =
|
||||||
[
|
[
|
||||||
"010055d009f78000", // Fire Emblem: Three Houses
|
//All games are in Alphabetical order by Game name.
|
||||||
"0100a12011cc8000", // Fire Emblem: Shadow Dragon
|
|
||||||
|
//Dragon Quest Franchise
|
||||||
|
"010008900705c000", // Dragon Quest Builders
|
||||||
|
"010042000a986000", // Dragon Quest Builders 2
|
||||||
|
|
||||||
|
//Fire Emblem Franchise
|
||||||
"0100a6301214e000", // Fire Emblem Engage
|
"0100a6301214e000", // Fire Emblem Engage
|
||||||
|
"0100a12011cc8000", // Fire Emblem: Shadow Dragon
|
||||||
|
"010055d009f78000", // Fire Emblem: Three Houses
|
||||||
"0100f15003e64000", // Fire Emblem Warriors
|
"0100f15003e64000", // Fire Emblem Warriors
|
||||||
"010071f0143ea000", // Fire Emblem Warriors: Three Hopes
|
"010071f0143ea000", // Fire Emblem Warriors: Three Hopes
|
||||||
|
|
||||||
"01007e3006dda000", // Kirby Star Allies
|
//Kirby Franchise
|
||||||
"01004d300c5ae000", // Kirby and the Forgotten Land
|
"01004d300c5ae000", // Kirby and the Forgotten Land
|
||||||
"01006b601380e000", // Kirby's Return to Dream Land Deluxe
|
|
||||||
"01003fb00c5a8000", // Super Kirby Clash
|
|
||||||
"0100227010460000", // Kirby Fighters 2
|
|
||||||
"0100a8e016236000", // Kirby's Dream Buffet
|
"0100a8e016236000", // Kirby's Dream Buffet
|
||||||
|
"0100227010460000", // Kirby Fighters 2
|
||||||
|
"01006b601380e000", // Kirby's Return to Dream Land Deluxe
|
||||||
|
"01007e3006dda000", // Kirby Star Allies
|
||||||
|
"01003fb00c5a8000", // Super Kirby Clash
|
||||||
|
|
||||||
|
|
||||||
|
//The Zelda Franchise
|
||||||
|
"01000b900d8b0000", // Cadence of Hyrule
|
||||||
|
"0100ae00096ea000", // Hyrule Warriors: Definitive Edition
|
||||||
|
"01002b00111a2000", // Hyrule Warriors: Age of Calamity
|
||||||
"01007ef00011e000", // The Legend of Zelda: Breath of the Wild
|
"01007ef00011e000", // The Legend of Zelda: Breath of the Wild
|
||||||
"01006bb00c6f0000", // The Legend of Zelda: Link's Awakening
|
"01006bb00c6f0000", // The Legend of Zelda: Link's Awakening
|
||||||
"01002da013484000", // The Legend of Zelda: Skyward Sword HD
|
"01002da013484000", // The Legend of Zelda: Skyward Sword HD
|
||||||
"0100f2c0115b6000", // The Legend of Zelda: Tears of the Kingdom
|
"0100f2c0115b6000", // The Legend of Zelda: Tears of the Kingdom
|
||||||
"01008cf01baac000", // The Legend of Zelda: Echoes of Wisdom
|
"01008cf01baac000", // The Legend of Zelda: Echoes of Wisdom
|
||||||
"01000b900d8b0000", // Cadence of Hyrule
|
|
||||||
"0100ae00096ea000", // Hyrule Warriors: Definitive Edition
|
|
||||||
"01002b00111a2000", // Hyrule Warriors: Age of Calamity
|
|
||||||
|
|
||||||
|
|
||||||
|
//Luigi Franchise
|
||||||
"010048701995e000", // Luigi's Mansion 2 HD
|
"010048701995e000", // Luigi's Mansion 2 HD
|
||||||
"0100dca0064a6000", // Luigi's Mansion 3
|
"0100dca0064a6000", // Luigi's Mansion 3
|
||||||
|
|
||||||
|
//Metroid Franchise
|
||||||
"010093801237c000", // Metroid Dread
|
"010093801237c000", // Metroid Dread
|
||||||
"010012101468c000", // Metroid Prime Remastered
|
"010012101468c000", // Metroid Prime Remastered
|
||||||
|
|
||||||
"0100000000010000", // SUPER MARIO ODYSSEY
|
//Monster Hunter Franchise
|
||||||
"0100ea80032ea000", // Super Mario Bros. U Deluxe
|
"0100770008dd8000", // Monster Hunter Generations Ultimate
|
||||||
"01009b90006dc000", // Super Mario Maker 2
|
"0100b04011742000", // Monster Hunter Rise
|
||||||
"010049900f546000", // Super Mario 3D All-Stars
|
|
||||||
"010049900F546001", // ^ 64
|
//Mario Franchise
|
||||||
"010049900F546002", // ^ Sunshine
|
|
||||||
"010049900F546003", // ^ Galaxy
|
|
||||||
"010028600ebda000", // Super Mario 3D World + Bowser's Fury
|
|
||||||
"010015100b514000", // Super Mario Bros. Wonder
|
|
||||||
"0100152000022000", // Mario Kart 8 Deluxe
|
|
||||||
"010036b0034e4000", // Super Mario Party
|
|
||||||
"01006fe013472000", // Mario Party Superstars
|
|
||||||
"0100965017338000", // Super Mario Party Jamboree
|
|
||||||
"01006d0017f7a000", // Mario & Luigi: Brothership
|
"01006d0017f7a000", // Mario & Luigi: Brothership
|
||||||
|
"010003000e146000", // Mario & Sonic at the Olympic Games Tokyo 2020
|
||||||
"010067300059a000", // Mario + Rabbids: Kingdom Battle
|
"010067300059a000", // Mario + Rabbids: Kingdom Battle
|
||||||
"0100317013770000", // Mario + Rabbids: Sparks of Hope
|
"0100317013770000", // Mario + Rabbids: Sparks of Hope
|
||||||
|
"0100c9c00e25c000", // Mario Golf: Super Rush
|
||||||
|
"0100152000022000", // Mario Kart 8 Deluxe
|
||||||
|
"01006fe013472000", // Mario Party Superstars
|
||||||
|
"010019401051c000", // Mario Strikers: Battle League
|
||||||
|
"0100bde00862a000", // Mario Tennis Aces
|
||||||
|
"0100b99019412000", // Mario vs. Donkey Kong
|
||||||
|
"010049900f546000", // Super Mario 3D All-Stars
|
||||||
|
"010028600ebda000", // Super Mario 3D World + Bowser's Fury
|
||||||
|
"010049900F546001", // Super Mario 64
|
||||||
|
"0100ea80032ea000", // Super Mario Bros. U Deluxe
|
||||||
|
"010015100b514000", // Super Mario Bros. Wonder
|
||||||
|
"010049900F546003", // Super Mario Galaxy
|
||||||
|
"01009b90006dc000", // Super Mario Maker 2
|
||||||
|
"0100000000010000", // SUPER MARIO ODYSSEY
|
||||||
|
"010036b0034e4000", // Super Mario Party
|
||||||
|
"0100965017338000", // Super Mario Party Jamboree
|
||||||
|
"0100bc0018138000", // Super Mario RPG
|
||||||
|
"010049900F546002", // Super Mario Sunshine
|
||||||
"0100a3900c3e2000", // Paper Mario: The Origami King
|
"0100a3900c3e2000", // Paper Mario: The Origami King
|
||||||
"0100ecd018ebe000", // Paper Mario: The Thousand-Year Door
|
"0100ecd018ebe000", // Paper Mario: The Thousand-Year Door
|
||||||
"0100bc0018138000", // Super Mario RPG
|
|
||||||
"0100bde00862a000", // Mario Tennis Aces
|
|
||||||
"0100c9c00e25c000", // Mario Golf: Super Rush
|
|
||||||
"010019401051c000", // Mario Strikers: Battle League
|
|
||||||
"010003000e146000", // Mario & Sonic at the Olympic Games Tokyo 2020
|
|
||||||
"0100b99019412000", // Mario vs. Donkey Kong
|
|
||||||
|
|
||||||
|
//Pikmin Franchise
|
||||||
"0100aa80194b0000", // Pikmin 1
|
"0100aa80194b0000", // Pikmin 1
|
||||||
"0100d680194b2000", // Pikmin 2
|
"0100d680194b2000", // Pikmin 2
|
||||||
"0100f4c009322000", // Pikmin 3 Deluxe
|
"0100f4c009322000", // Pikmin 3 Deluxe
|
||||||
"0100b7c00933a000", // Pikmin 4
|
"0100b7c00933a000", // Pikmin 4
|
||||||
|
|
||||||
"010003f003a34000", // Pokémon: Let's Go Pikachu!
|
//The Pokémon Franchise
|
||||||
"0100187003a36000", // Pokémon: Let's Go Eevee!
|
"0100f4300bf2c000", // New Pokémon Snap
|
||||||
"0100abf008968000", // Pokémon Sword
|
|
||||||
"01008db008c2c000", // Pokémon Shield
|
|
||||||
"0100000011d90000", // Pokémon Brilliant Diamond
|
"0100000011d90000", // Pokémon Brilliant Diamond
|
||||||
"010018e011d92000", // Pokémon Shining Pearl
|
|
||||||
"01001f5010dfa000", // Pokémon Legends: Arceus
|
"01001f5010dfa000", // Pokémon Legends: Arceus
|
||||||
|
"01003d200baa2000", // Pokémon Mystery Dungeon - Rescue Team DX
|
||||||
"0100a3d008c5c000", // Pokémon Scarlet
|
"0100a3d008c5c000", // Pokémon Scarlet
|
||||||
|
"01008db008c2c000", // Pokémon Shield
|
||||||
|
"010018e011d92000", // Pokémon Shining Pearl
|
||||||
|
"0100abf008968000", // Pokémon Sword
|
||||||
"01008f6008c5e000", // Pokémon Violet
|
"01008f6008c5e000", // Pokémon Violet
|
||||||
"0100b3f000be2000", // Pokkén Tournament DX
|
"0100b3f000be2000", // Pokkén Tournament DX
|
||||||
"0100f4300bf2c000", // New Pokémon Snap
|
"0100187003a36000", // Pokémon: Let's Go Eevee!
|
||||||
|
"010003f003a34000", // Pokémon: Let's Go Pikachu!
|
||||||
|
|
||||||
"01003bc0000a0000", // Splatoon 2 (US)
|
//Splatoon Franchise
|
||||||
"0100f8f0000a2000", // Splatoon 2 (EU)
|
"0100f8f0000a2000", // Splatoon 2 (EU)
|
||||||
"01003c700009c000", // Splatoon 2 (JP)
|
"01003c700009c000", // Splatoon 2 (JP)
|
||||||
|
"01003bc0000a0000", // Splatoon 2 (US)
|
||||||
"0100c2500fc20000", // Splatoon 3
|
"0100c2500fc20000", // Splatoon 3
|
||||||
"0100ba0018500000", // Splatoon 3: Splatfest World Premiere
|
"0100ba0018500000", // Splatoon 3: Splatfest World Premiere
|
||||||
|
|
||||||
"010040600c5ce000", // Tetris 99
|
//NSO Membership games
|
||||||
"0100277011f1a000", // Super Mario Bros. 35
|
|
||||||
"0100ad9012510000", // PAC-MAN 99
|
|
||||||
"0100ccf019c8c000", // F-ZERO 99
|
"0100ccf019c8c000", // F-ZERO 99
|
||||||
"0100d870045b6000", // NES - Nintendo Switch Online
|
|
||||||
"01008d300c50c000", // SNES - Nintendo Switch Online
|
|
||||||
"0100c9a00ece6000", // N64 - Nintendo Switch Online
|
|
||||||
"0100e0601c632000", // N64 - Nintendo Switch Online 18+
|
|
||||||
"0100c62011050000", // GB - Nintendo Switch Online
|
"0100c62011050000", // GB - Nintendo Switch Online
|
||||||
"010012f017576000", // GBA - Nintendo Switch Online
|
"010012f017576000", // GBA - Nintendo Switch Online
|
||||||
|
"0100c9a00ece6000", // N64 - Nintendo Switch Online
|
||||||
|
"0100e0601c632000", // N64 - Nintendo Switch Online 18+
|
||||||
|
"0100d870045b6000", // NES - Nintendo Switch Online
|
||||||
|
"0100ad9012510000", // PAC-MAN 99
|
||||||
|
"010040600c5ce000", // Tetris 99
|
||||||
|
"01008d300c50c000", // SNES - Nintendo Switch Online
|
||||||
|
"0100277011f1a000", // Super Mario Bros. 35
|
||||||
|
|
||||||
|
//Misc Nintendo 1st party games
|
||||||
"01000320000cc000", // 1-2 Switch
|
"01000320000cc000", // 1-2 Switch
|
||||||
"0100300012f2a000", // Advance Wars 1+2: Re-Boot Camp
|
"0100300012f2a000", // Advance Wars 1+2: Re-Boot Camp
|
||||||
"01006f8002326000", // Animal Crossing: New Horizons
|
"01006f8002326000", // Animal Crossing: New Horizons
|
||||||
@@ -148,33 +183,44 @@ namespace Ryujinx.Common
|
|||||||
"01006a800016e000", // Super Smash Bros. Ultimate
|
"01006a800016e000", // Super Smash Bros. Ultimate
|
||||||
"0100a9400c9c2000", // Tokyo Mirage Sessions #FE Encore
|
"0100a9400c9c2000", // Tokyo Mirage Sessions #FE Encore
|
||||||
|
|
||||||
|
//Bayonetta Franchise
|
||||||
"010076f0049a2000", // Bayonetta
|
"010076f0049a2000", // Bayonetta
|
||||||
"01007960049a0000", // Bayonetta 2
|
"01007960049a0000", // Bayonetta 2
|
||||||
"01004a4010fea000", // Bayonetta 3
|
"01004a4010fea000", // Bayonetta 3
|
||||||
"0100cf5010fec000", // Bayonetta Origins: Cereza and the Lost Demon
|
"0100cf5010fec000", // Bayonetta Origins: Cereza and the Lost Demon
|
||||||
|
|
||||||
|
//Persona Franchise
|
||||||
"0100dcd01525a000", // Persona 3 Portable
|
"0100dcd01525a000", // Persona 3 Portable
|
||||||
"010062b01525c000", // Persona 4 Golden
|
|
||||||
"010075a016a3a000", // Persona 4 Arena Ultimax
|
"010075a016a3a000", // Persona 4 Arena Ultimax
|
||||||
|
"010062b01525c000", // Persona 4 Golden
|
||||||
"01005ca01580e000", // Persona 5 Royal
|
"01005ca01580e000", // Persona 5 Royal
|
||||||
"0100801011c3e000", // Persona 5 Strikers
|
"0100801011c3e000", // Persona 5 Strikers
|
||||||
"010087701b092000", // Persona 5 Tactica
|
"010087701b092000", // Persona 5 Tactica
|
||||||
|
|
||||||
"01009aa000faa000", // Sonic Mania
|
//Sonic Franchise
|
||||||
"01004ad014bf0000", // Sonic Frontiers
|
"01004ad014bf0000", // Sonic Frontiers
|
||||||
|
"01009aa000faa000", // Sonic Mania
|
||||||
"01005ea01c0fc000", // SONIC X SHADOW GENERATIONS
|
"01005ea01c0fc000", // SONIC X SHADOW GENERATIONS
|
||||||
"01005ea01c0fc001", // ^
|
"01005ea01c0fc001", // ^
|
||||||
|
|
||||||
|
//Xenoblade Franchise
|
||||||
|
"0100ff500e34a000", // Xenoblade Chronicles - Definitive Edition
|
||||||
|
"0100e95004038000", // Xenoblade Chronicles 2
|
||||||
|
"010074f013262000", // Xenoblade Chronicles 3
|
||||||
|
|
||||||
|
//Misc Games
|
||||||
"010056e00853a000", // A Hat in Time
|
"010056e00853a000", // A Hat in Time
|
||||||
|
"0100fd1014726000", // Baldurs Gate: Dark Alliance
|
||||||
"0100dbf01000a000", // Burnout Paradise Remastered
|
"0100dbf01000a000", // Burnout Paradise Remastered
|
||||||
"0100744001588000", // Cars 3: Driven to Win
|
"0100744001588000", // Cars 3: Driven to Win
|
||||||
"0100b41013c82000", // Cruis'n Blast
|
"0100b41013c82000", // Cruis'n Blast
|
||||||
|
"010085900337e000", // Death Squared
|
||||||
"01001b300b9be000", // Diablo III: Eternal Collection
|
"01001b300b9be000", // Diablo III: Eternal Collection
|
||||||
"01008c8012920000", // Dying Light Platinum Edition
|
"01008c8012920000", // Dying Light Platinum Edition
|
||||||
"01001cc01b2d4000", // Goat Simulator 3
|
"01001cc01b2d4000", // Goat Simulator 3
|
||||||
|
"01003620068ea000", // Hand of Fate 2
|
||||||
|
"010085500130a000", // Lego City: Undercover
|
||||||
"010073c01af34000", // LEGO Horizon Adventures
|
"010073c01af34000", // LEGO Horizon Adventures
|
||||||
"0100770008dd8000", // Monster Hunter Generations Ultimate
|
|
||||||
"0100b04011742000", // Monster Hunter Rise
|
|
||||||
"0100853015e86000", // No Man's Sky
|
"0100853015e86000", // No Man's Sky
|
||||||
"01007bb017812000", // Portal
|
"01007bb017812000", // Portal
|
||||||
"0100abd01785c000", // Portal 2
|
"0100abd01785c000", // Portal 2
|
||||||
@@ -190,6 +236,8 @@ namespace Ryujinx.Common
|
|||||||
"01000a10041ea000", // The Elder Scrolls V: Skyrim
|
"01000a10041ea000", // The Elder Scrolls V: Skyrim
|
||||||
"010057a01e4d4000", // TSUKIHIME -A piece of blue glass moon-
|
"010057a01e4d4000", // TSUKIHIME -A piece of blue glass moon-
|
||||||
"010080b00ad66000", // Undertale
|
"010080b00ad66000", // Undertale
|
||||||
|
"010069401adb8000", // Unicorn Overlord
|
||||||
|
"0100534009ff2000", // Yonder - The cloud catcher chronicles
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -118,7 +118,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
|||||||
private static string GetDiskCachePath()
|
private static string GetDiskCachePath()
|
||||||
{
|
{
|
||||||
return GraphicsConfig.EnableShaderCache && GraphicsConfig.TitleId != null
|
return GraphicsConfig.EnableShaderCache && GraphicsConfig.TitleId != null
|
||||||
? Path.Combine(AppDataManager.GamesDirPath, GraphicsConfig.TitleId, "cache", "shader")
|
? Path.Combine(AppDataManager.GamesDirPath, GraphicsConfig.TitleId.ToLower(), "cache", "shader")
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -92,7 +92,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
DriverId.MesaDozen => "Dozen",
|
DriverId.MesaDozen => "Dozen",
|
||||||
DriverId.MesaNvk => "NVK",
|
DriverId.MesaNvk => "NVK",
|
||||||
DriverId.ImaginationOpenSourceMesa => "Imagination (Open)",
|
DriverId.ImaginationOpenSourceMesa => "Imagination (Open)",
|
||||||
DriverId.MesaAgxv => "Honeykrisp",
|
DriverId.MesaHoneykrisp => "Honeykrisp",
|
||||||
_ => id.ToString(),
|
_ => id.ToString(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -27,9 +27,19 @@ namespace Ryujinx.HLE.HOS.Applets
|
|||||||
_normalSession = normalSession;
|
_normalSession = normalSession;
|
||||||
_interactiveSession = interactiveSession;
|
_interactiveSession = interactiveSession;
|
||||||
|
|
||||||
// TODO(jduncanator): Parse PlayerSelectConfig from input data
|
UserProfile selected = _system.Device.UIHandler.ShowPlayerSelectDialog();
|
||||||
_normalSession.Push(BuildResponse());
|
if (selected == null)
|
||||||
|
{
|
||||||
|
_normalSession.Push(BuildResponse());
|
||||||
|
}
|
||||||
|
else if (selected.UserId == new UserId("00000000000000000000000000000080"))
|
||||||
|
{
|
||||||
|
_normalSession.Push(BuildGuestResponse());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_normalSession.Push(BuildResponse(selected));
|
||||||
|
}
|
||||||
AppletStateChanged?.Invoke(this, null);
|
AppletStateChanged?.Invoke(this, null);
|
||||||
|
|
||||||
_system.ReturnFocus();
|
_system.ReturnFocus();
|
||||||
@@ -37,16 +47,34 @@ namespace Ryujinx.HLE.HOS.Applets
|
|||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] BuildResponse()
|
private byte[] BuildResponse(UserProfile selectedUser)
|
||||||
{
|
{
|
||||||
UserProfile currentUser = _system.AccountManager.LastOpenedUser;
|
|
||||||
|
|
||||||
using MemoryStream stream = MemoryStreamManager.Shared.GetStream();
|
using MemoryStream stream = MemoryStreamManager.Shared.GetStream();
|
||||||
using BinaryWriter writer = new(stream);
|
using BinaryWriter writer = new(stream);
|
||||||
|
|
||||||
writer.Write((ulong)PlayerSelectResult.Success);
|
writer.Write((ulong)PlayerSelectResult.Success);
|
||||||
|
|
||||||
currentUser.UserId.Write(writer);
|
selectedUser.UserId.Write(writer);
|
||||||
|
|
||||||
|
return stream.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte[] BuildGuestResponse()
|
||||||
|
{
|
||||||
|
using MemoryStream stream = MemoryStreamManager.Shared.GetStream();
|
||||||
|
using BinaryWriter writer = new(stream);
|
||||||
|
|
||||||
|
writer.Write(new byte());
|
||||||
|
|
||||||
|
return stream.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte[] BuildResponse()
|
||||||
|
{
|
||||||
|
using MemoryStream stream = MemoryStreamManager.Shared.GetStream();
|
||||||
|
using BinaryWriter writer = new(stream);
|
||||||
|
|
||||||
|
writer.Write((ulong)PlayerSelectResult.Failure);
|
||||||
|
|
||||||
return stream.ToArray();
|
return stream.ToArray();
|
||||||
}
|
}
|
||||||
|
@@ -176,9 +176,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||||||
AllowedCpuCoresMask = GetMaskFromMinMax(lowestCpuCore, highestCpuCore);
|
AllowedCpuCoresMask = GetMaskFromMinMax(lowestCpuCore, highestCpuCore);
|
||||||
AllowedThreadPriosMask = GetMaskFromMinMax(lowestThreadPrio, highestThreadPrio);
|
AllowedThreadPriosMask = GetMaskFromMinMax(lowestThreadPrio, highestThreadPrio);
|
||||||
|
|
||||||
if (isApplication && lowestCpuCore == 0 && highestCpuCore != 2)
|
if (isApplication)
|
||||||
Ryujinx.Common.Logging.Logger.Error?.Print(Ryujinx.Common.Logging.LogClass.Application, $"Application requested cores with index range {lowestCpuCore} to {highestCpuCore}! Report this to @LotP on the Ryujinx/Ryubing discord server (discord.gg/ryujinx)!");
|
|
||||||
else if (isApplication)
|
|
||||||
Ryujinx.Common.Logging.Logger.Info?.Print(Ryujinx.Common.Logging.LogClass.Application, $"Application requested cores with index range {lowestCpuCore} to {highestCpuCore}");
|
Ryujinx.Common.Logging.Logger.Info?.Print(Ryujinx.Common.Logging.LogClass.Application, $"Application requested cores with index range {lowestCpuCore} to {highestCpuCore}");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@@ -56,7 +56,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
|||||||
ProfilesJson profilesJson = JsonHelper.DeserializeFromFile(_profilesJsonPath, _serializerContext.ProfilesJson);
|
ProfilesJson profilesJson = JsonHelper.DeserializeFromFile(_profilesJsonPath, _serializerContext.ProfilesJson);
|
||||||
|
|
||||||
return profilesJson.Profiles
|
return profilesJson.Profiles
|
||||||
.FindFirst(profile => profile.AccountState == AccountState.Open)
|
.FindFirst(profile => profile.UserId == profilesJson.LastOpened)
|
||||||
.Convert(profileJson => new UserProfile(new UserId(profileJson.UserId), profileJson.Name,
|
.Convert(profileJson => new UserProfile(new UserId(profileJson.UserId), profileJson.Name,
|
||||||
profileJson.Image, profileJson.LastModifiedTimestamp));
|
profileJson.Image, profileJson.LastModifiedTimestamp));
|
||||||
}
|
}
|
||||||
|
BIN
src/Ryujinx.HLE/HOS/Services/Account/Acc/GuestUserImage.jpg
Normal file
BIN
src/Ryujinx.HLE/HOS/Services/Account/Acc/GuestUserImage.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.8 KiB |
@@ -703,6 +703,18 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CommandCmif(92)]
|
||||||
|
// SetGestureOutputRanges(pid, ushort Unknown0)
|
||||||
|
public ResultCode SetGestureOutputRanges(ServiceCtx context)
|
||||||
|
{
|
||||||
|
ulong pid = context.Request.HandleDesc.PId;
|
||||||
|
ushort unknown0 = context.RequestData.ReadUInt16();
|
||||||
|
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceHid, new { pid, unknown0 });
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
[CommandCmif(100)]
|
[CommandCmif(100)]
|
||||||
// SetSupportedNpadStyleSet(pid, nn::applet::AppletResourceUserId, nn::hid::NpadStyleTag)
|
// SetSupportedNpadStyleSet(pid, nn::applet::AppletResourceUserId, nn::hid::NpadStyleTag)
|
||||||
public ResultCode SetSupportedNpadStyleSet(ServiceCtx context)
|
public ResultCode SetSupportedNpadStyleSet(ServiceCtx context)
|
||||||
|
@@ -244,6 +244,15 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
|||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CommandCmif(68)]
|
||||||
|
// GetSerialNumber() -> buffer<nn::settings::system::SerialNumber, 0x16>
|
||||||
|
public ResultCode GetSerialNumber(ServiceCtx context)
|
||||||
|
{
|
||||||
|
context.ResponseData.Write(Encoding.ASCII.GetBytes("RYU00000000000"));
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
[CommandCmif(77)]
|
[CommandCmif(77)]
|
||||||
// GetDeviceNickName() -> buffer<nn::settings::system::DeviceNickName, 0x16>
|
// GetDeviceNickName() -> buffer<nn::settings::system::DeviceNickName, 0x16>
|
||||||
public ResultCode GetDeviceNickName(ServiceCtx context)
|
public ResultCode GetDeviceNickName(ServiceCtx context)
|
||||||
|
@@ -51,6 +51,9 @@ namespace Ryujinx.HLE.HOS.Services.Spl
|
|||||||
|
|
||||||
context.ResponseData.Write(configValue);
|
context.ResponseData.Write(configValue);
|
||||||
|
|
||||||
|
if (result == SmcResult.Success)
|
||||||
|
return ResultCode.Success;
|
||||||
|
|
||||||
return (ResultCode)((int)result << 9) | ResultCode.ModuleId;
|
return (ResultCode)((int)result << 9) | ResultCode.ModuleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,7 +26,17 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||||||
|
|
||||||
private ulong _latestPid;
|
private ulong _latestPid;
|
||||||
|
|
||||||
public ProcessResult ActiveApplication => _processesByPid[_latestPid];
|
public ProcessResult ActiveApplication
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!_processesByPid.TryGetValue(_latestPid, out ProcessResult value))
|
||||||
|
throw new RyujinxException(
|
||||||
|
$"The HLE Process map did not have a process with ID {_latestPid}. Are you missing firmware?");
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public ProcessLoader(Switch device)
|
public ProcessLoader(Switch device)
|
||||||
{
|
{
|
||||||
|
@@ -48,6 +48,7 @@
|
|||||||
<EmbeddedResource Include="HOS\Applets\SoftwareKeyboard\Resources\Icon_BtnB.png" />
|
<EmbeddedResource Include="HOS\Applets\SoftwareKeyboard\Resources\Icon_BtnB.png" />
|
||||||
<EmbeddedResource Include="HOS\Applets\SoftwareKeyboard\Resources\Icon_KeyF6.png" />
|
<EmbeddedResource Include="HOS\Applets\SoftwareKeyboard\Resources\Icon_KeyF6.png" />
|
||||||
<EmbeddedResource Include="HOS\Services\Account\Acc\DefaultUserImage.jpg" />
|
<EmbeddedResource Include="HOS\Services\Account\Acc\DefaultUserImage.jpg" />
|
||||||
|
<EmbeddedResource Include="HOS\Services\Account\Acc\GuestUserImage.jpg" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using Ryujinx.HLE.HOS.Applets;
|
using Ryujinx.HLE.HOS.Applets;
|
||||||
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||||
using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy.Types;
|
using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy.Types;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.UI
|
namespace Ryujinx.HLE.UI
|
||||||
@@ -59,5 +60,11 @@ namespace Ryujinx.HLE.UI
|
|||||||
/// Gets fonts and colors used by the host.
|
/// Gets fonts and colors used by the host.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IHostUITheme HostUITheme { get; }
|
IHostUITheme HostUITheme { get; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Displays the player select dialog and returns the selected profile.
|
||||||
|
/// </summary>
|
||||||
|
UserProfile ShowPlayerSelectDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,36 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="Resources\Controller_JoyConLeft.svg" />
|
|
||||||
<None Remove="Resources\Controller_JoyConPair.svg" />
|
|
||||||
<None Remove="Resources\Controller_JoyConRight.svg" />
|
|
||||||
<None Remove="Resources\Controller_ProCon.svg" />
|
|
||||||
<None Remove="Resources\Icon_NCA.png" />
|
|
||||||
<None Remove="Resources\Icon_NRO.png" />
|
|
||||||
<None Remove="Resources\Icon_NSO.png" />
|
|
||||||
<None Remove="Resources\Icon_NSP.png" />
|
|
||||||
<None Remove="Resources\Icon_XCI.png" />
|
|
||||||
<None Remove="Resources\Logo_Amiibo.png" />
|
|
||||||
<None Remove="Resources\Logo_Discord.png" />
|
|
||||||
<None Remove="Resources\Logo_GitHub.png" />
|
|
||||||
<None Remove="Resources\Logo_Ryujinx.png" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="DiscordRichPresence" />
|
|
||||||
<PackageReference Include="DynamicData" />
|
|
||||||
<PackageReference Include="securifybv.ShellLink" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Ryujinx.Common\Ryujinx.Common.csproj" />
|
|
||||||
<ProjectReference Include="..\Ryujinx.HLE\Ryujinx.HLE.csproj" />
|
|
||||||
<ProjectReference Include="..\Ryujinx.Graphics.Vulkan\Ryujinx.Graphics.Vulkan.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@@ -489,7 +489,7 @@ namespace Ryujinx.Ava
|
|||||||
|
|
||||||
Dispatcher.UIThread.InvokeAsync(() =>
|
Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device.Processes.ActiveApplication, Program.Version);
|
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowTitleBar);
|
||||||
});
|
});
|
||||||
|
|
||||||
_viewModel.SetUiProgressHandlers(Device);
|
_viewModel.SetUiProgressHandlers(Device);
|
||||||
@@ -674,7 +674,7 @@ namespace Ryujinx.Ava
|
|||||||
|
|
||||||
public async Task<bool> LoadGuestApplication(BlitStruct<ApplicationControlProperty>? customNacpData = null)
|
public async Task<bool> LoadGuestApplication(BlitStruct<ApplicationControlProperty>? customNacpData = null)
|
||||||
{
|
{
|
||||||
InitializeSwitchInstance();
|
InitEmulatedSwitch();
|
||||||
MainWindow.UpdateGraphicsConfig();
|
MainWindow.UpdateGraphicsConfig();
|
||||||
|
|
||||||
SystemVersion firmwareVersion = ContentManager.GetCurrentFirmwareVersion();
|
SystemVersion firmwareVersion = ContentManager.GetCurrentFirmwareVersion();
|
||||||
@@ -758,6 +758,8 @@ namespace Ryujinx.Ava
|
|||||||
romFsFiles = Directory.GetFiles(ApplicationPath, "*.romfs");
|
romFsFiles = Directory.GetFiles(ApplicationPath, "*.romfs");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Logger.Notice.Print(LogClass.Application, $"Loading unpacked content archive from '{ApplicationPath}'.");
|
||||||
|
|
||||||
if (romFsFiles.Length > 0)
|
if (romFsFiles.Length > 0)
|
||||||
{
|
{
|
||||||
Logger.Info?.Print(LogClass.Application, "Loading as cart with RomFS.");
|
Logger.Info?.Print(LogClass.Application, "Loading as cart with RomFS.");
|
||||||
@@ -783,6 +785,8 @@ namespace Ryujinx.Ava
|
|||||||
}
|
}
|
||||||
else if (File.Exists(ApplicationPath))
|
else if (File.Exists(ApplicationPath))
|
||||||
{
|
{
|
||||||
|
Logger.Notice.Print(LogClass.Application, $"Loading content archive from '{ApplicationPath}'.");
|
||||||
|
|
||||||
switch (Path.GetExtension(ApplicationPath).ToLowerInvariant())
|
switch (Path.GetExtension(ApplicationPath).ToLowerInvariant())
|
||||||
{
|
{
|
||||||
case ".xci":
|
case ".xci":
|
||||||
@@ -872,7 +876,7 @@ namespace Ryujinx.Ava
|
|||||||
Device?.System.TogglePauseEmulation(false);
|
Device?.System.TogglePauseEmulation(false);
|
||||||
|
|
||||||
_viewModel.IsPaused = false;
|
_viewModel.IsPaused = false;
|
||||||
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version);
|
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowTitleBar);
|
||||||
Logger.Info?.Print(LogClass.Emulation, "Emulation was resumed");
|
Logger.Info?.Print(LogClass.Emulation, "Emulation was resumed");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -881,11 +885,11 @@ namespace Ryujinx.Ava
|
|||||||
Device?.System.TogglePauseEmulation(true);
|
Device?.System.TogglePauseEmulation(true);
|
||||||
|
|
||||||
_viewModel.IsPaused = true;
|
_viewModel.IsPaused = true;
|
||||||
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, LocaleManager.Instance[LocaleKeys.Paused]);
|
_viewModel.Title = TitleHelper.ActiveApplicationTitle(Device?.Processes.ActiveApplication, Program.Version, !ConfigurationState.Instance.ShowTitleBar, LocaleManager.Instance[LocaleKeys.Paused]);
|
||||||
Logger.Info?.Print(LogClass.Emulation, "Emulation was paused");
|
Logger.Info?.Print(LogClass.Emulation, "Emulation was paused");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeSwitchInstance()
|
private void InitEmulatedSwitch()
|
||||||
{
|
{
|
||||||
// Initialize KeySet.
|
// Initialize KeySet.
|
||||||
VirtualFileSystem.ReloadKeySet();
|
VirtualFileSystem.ReloadKeySet();
|
||||||
@@ -1040,7 +1044,7 @@ namespace Ryujinx.Ava
|
|||||||
_viewModel.WindowState = WindowState.FullScreen;
|
_viewModel.WindowState = WindowState.FullScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_viewModel.WindowState is WindowState.FullScreen)
|
if (_viewModel.WindowState is WindowState.FullScreen || _viewModel.StartGamesWithoutUI)
|
||||||
{
|
{
|
||||||
_viewModel.ShowMenuAndStatusBar = false;
|
_viewModel.ShowMenuAndStatusBar = false;
|
||||||
}
|
}
|
||||||
|
13
src/Ryujinx/Assets/Styles/CheckboxMenuItemStyle.axaml
Normal file
13
src/Ryujinx/Assets/Styles/CheckboxMenuItemStyle.axaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<Styles xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<Style Selector="MenuItem.withCheckbox Viewbox#PART_IconPresenter">
|
||||||
|
<Setter Property="MaxHeight" Value="36" />
|
||||||
|
<Setter Property="MinHeight" Value="36" />
|
||||||
|
<Setter Property="MaxWidth" Value="36" />
|
||||||
|
<Setter Property="MinWidth" Value="36" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="MenuItem.withCheckbox ContentPresenter#PART_HeaderPresenter">
|
||||||
|
<Setter Property="Padding" Value="-10,0,0,0" />
|
||||||
|
</Style>
|
||||||
|
</Styles>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
using Avalonia.Controls.Notifications;
|
|
||||||
using Avalonia.Platform.Storage;
|
using Avalonia.Platform.Storage;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
|
using Gommon;
|
||||||
using LibHac;
|
using LibHac;
|
||||||
using LibHac.Account;
|
using LibHac.Account;
|
||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
@@ -15,6 +15,7 @@ using LibHac.Tools.FsSystem.NcaUtils;
|
|||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.UI.Controls;
|
using Ryujinx.Ava.UI.Controls;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
|
using Ryujinx.Ava.Utilities;
|
||||||
using Ryujinx.Ava.Utilities.Configuration;
|
using Ryujinx.Ava.Utilities.Configuration;
|
||||||
using Ryujinx.Common.Helper;
|
using Ryujinx.Common.Helper;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
@@ -296,21 +297,149 @@ namespace Ryujinx.Ava.Common
|
|||||||
extractorThread.Start();
|
extractorThread.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ExtractAoc(string destination, string updateFilePath, string updateName)
|
||||||
|
{
|
||||||
|
var cancellationToken = new CancellationTokenSource();
|
||||||
|
|
||||||
|
UpdateWaitWindow waitingDialog = new(
|
||||||
|
RyujinxApp.FormatTitle(LocaleKeys.DialogNcaExtractionTitle),
|
||||||
|
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogNcaExtractionMessage, NcaSectionType.Data, Path.GetFileName(updateFilePath)),
|
||||||
|
cancellationToken);
|
||||||
|
|
||||||
|
Thread extractorThread = new(() =>
|
||||||
|
{
|
||||||
|
Dispatcher.UIThread.Post(waitingDialog.Show);
|
||||||
|
|
||||||
|
using FileStream file = new(updateFilePath, FileMode.Open, FileAccess.Read);
|
||||||
|
|
||||||
|
Nca publicDataNca = null;
|
||||||
|
|
||||||
|
string extension = Path.GetExtension(updateFilePath).ToLower();
|
||||||
|
if (extension is ".nsp")
|
||||||
|
{
|
||||||
|
var pfsTemp = new PartitionFileSystem();
|
||||||
|
pfsTemp.Initialize(file.AsStorage()).ThrowIfFailure();
|
||||||
|
IFileSystem pfs = pfsTemp;
|
||||||
|
|
||||||
|
foreach (DirectoryEntryEx fileEntry in pfs.EnumerateEntries("/", "*.nca"))
|
||||||
|
{
|
||||||
|
using var ncaFile = new UniqueRef<IFile>();
|
||||||
|
|
||||||
|
pfs.OpenFile(ref ncaFile.Ref, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
|
||||||
|
|
||||||
|
Nca nca = new(_virtualFileSystem.KeySet, ncaFile.Get.AsStorage());
|
||||||
|
if (nca.Header.ContentType is NcaContentType.PublicData && nca.SectionExists(NcaSectionType.Data))
|
||||||
|
{
|
||||||
|
publicDataNca = nca;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (publicDataNca is null)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Application, "Extraction failure. The NCA was not present in the selected file");
|
||||||
|
|
||||||
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||||
|
{
|
||||||
|
waitingDialog.Close();
|
||||||
|
|
||||||
|
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogNcaExtractionMainNcaNotFoundErrorMessage]);
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IntegrityCheckLevel checkLevel = ConfigurationState.Instance.System.EnableFsIntegrityChecks
|
||||||
|
? IntegrityCheckLevel.ErrorOnInvalid
|
||||||
|
: IntegrityCheckLevel.None;
|
||||||
|
|
||||||
|
int index = Nca.GetSectionIndexFromType(NcaSectionType.Data, publicDataNca.Header.ContentType);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IFileSystem ncaFileSystem = publicDataNca.OpenFileSystem(index, IntegrityCheckLevel.ErrorOnInvalid);
|
||||||
|
|
||||||
|
FileSystemClient fsClient = _horizonClient.Fs;
|
||||||
|
|
||||||
|
string source = DateTime.Now.ToFileTime().ToString()[10..];
|
||||||
|
string output = DateTime.Now.ToFileTime().ToString()[10..];
|
||||||
|
|
||||||
|
using var uniqueSourceFs = new UniqueRef<IFileSystem>(ncaFileSystem);
|
||||||
|
using var uniqueOutputFs = new UniqueRef<IFileSystem>(new LocalFileSystem(destination));
|
||||||
|
|
||||||
|
fsClient.Register(source.ToU8Span(), ref uniqueSourceFs.Ref);
|
||||||
|
fsClient.Register(output.ToU8Span(), ref uniqueOutputFs.Ref);
|
||||||
|
|
||||||
|
(Result? resultCode, bool canceled) = CopyDirectory(fsClient, $"{source}:/", $"{output}:/", cancellationToken.Token);
|
||||||
|
|
||||||
|
if (!canceled)
|
||||||
|
{
|
||||||
|
if (resultCode.Value.IsFailure())
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Application, $"LibHac returned error code: {resultCode.Value.ErrorCode}");
|
||||||
|
|
||||||
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||||
|
{
|
||||||
|
waitingDialog.Close();
|
||||||
|
|
||||||
|
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogNcaExtractionCheckLogErrorMessage]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else if (resultCode.Value.IsSuccess())
|
||||||
|
{
|
||||||
|
Dispatcher.UIThread.Post(waitingDialog.Close);
|
||||||
|
|
||||||
|
NotificationHelper.ShowInformation(
|
||||||
|
RyujinxApp.FormatTitle(LocaleKeys.DialogNcaExtractionTitle),
|
||||||
|
$"{updateName}\n\n{LocaleManager.Instance[LocaleKeys.DialogNcaExtractionSuccessMessage]}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fsClient.Unmount(source.ToU8Span());
|
||||||
|
fsClient.Unmount(output.ToU8Span());
|
||||||
|
}
|
||||||
|
catch (ArgumentException ex)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Application, $"{ex.Message}");
|
||||||
|
|
||||||
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||||
|
{
|
||||||
|
waitingDialog.Close();
|
||||||
|
|
||||||
|
await ContentDialogHelper.CreateErrorDialog(ex.Message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
{
|
||||||
|
Name = "GUI.AocExtractorThread",
|
||||||
|
IsBackground = true,
|
||||||
|
};
|
||||||
|
extractorThread.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task ExtractAoc(IStorageProvider storageProvider, string updateFilePath, string updateName)
|
||||||
|
{
|
||||||
|
Optional<IStorageFolder> result = await storageProvider.OpenSingleFolderPickerAsync(new FolderPickerOpenOptions
|
||||||
|
{
|
||||||
|
Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle]
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!result.HasValue) return;
|
||||||
|
|
||||||
|
ExtractAoc(result.Value.Path.LocalPath, updateFilePath, updateName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static async Task ExtractSection(IStorageProvider storageProvider, NcaSectionType ncaSectionType, string titleFilePath, string titleName, int programIndex = 0)
|
public static async Task ExtractSection(IStorageProvider storageProvider, NcaSectionType ncaSectionType, string titleFilePath, string titleName, int programIndex = 0)
|
||||||
{
|
{
|
||||||
var result = await storageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
Optional<IStorageFolder> result = await storageProvider.OpenSingleFolderPickerAsync(new FolderPickerOpenOptions
|
||||||
{
|
{
|
||||||
Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle],
|
Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle]
|
||||||
AllowMultiple = false,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (result.Count == 0)
|
if (!result.HasValue) return;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ExtractSection(result[0].Path.LocalPath, ncaSectionType, titleFilePath, titleName, programIndex);
|
ExtractSection(result.Value.Path.LocalPath, ncaSectionType, titleFilePath, titleName, programIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static (Result? result, bool canceled) CopyDirectory(FileSystemClient fs, string sourcePath, string destPath, CancellationToken token)
|
public static (Result? result, bool canceled) CopyDirectory(FileSystemClient fs, string sourcePath, string destPath, CancellationToken token)
|
||||||
|
@@ -6,7 +6,7 @@ namespace Ryujinx.Ava.Common.Models
|
|||||||
public bool IsBundled { get; } = System.IO.Path.GetExtension(ContainerPath)?.ToLower() == ".xci";
|
public bool IsBundled { get; } = System.IO.Path.GetExtension(ContainerPath)?.ToLower() == ".xci";
|
||||||
|
|
||||||
public string FileName => System.IO.Path.GetFileName(ContainerPath);
|
public string FileName => System.IO.Path.GetFileName(ContainerPath);
|
||||||
public string TitleIdStr => TitleId.ToString("x16");
|
public string TitleIdStr => TitleId.ToString("x16").ToUpper();
|
||||||
public ulong TitleIdBase => TitleId & ~0x1FFFUL;
|
public ulong TitleIdBase => TitleId & ~0x1FFFUL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,11 +4,11 @@ namespace Ryujinx.Ava.Common
|
|||||||
{
|
{
|
||||||
public static class ThemeManager
|
public static class ThemeManager
|
||||||
{
|
{
|
||||||
public static event EventHandler ThemeChanged;
|
public static event Action ThemeChanged;
|
||||||
|
|
||||||
public static void OnThemeChanged()
|
public static void OnThemeChanged()
|
||||||
{
|
{
|
||||||
ThemeChanged?.Invoke(null, EventArgs.Empty);
|
ThemeChanged?.Invoke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
using DiscordRPC;
|
using DiscordRPC;
|
||||||
|
using Gommon;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using Humanizer.Localisation;
|
using Humanizer.Localisation;
|
||||||
|
using Ryujinx.Ava.Utilities;
|
||||||
using Ryujinx.Ava.Utilities.AppLibrary;
|
using Ryujinx.Ava.Utilities.AppLibrary;
|
||||||
using Ryujinx.Ava.Utilities.Configuration;
|
using Ryujinx.Ava.Utilities.Configuration;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
@@ -45,16 +47,7 @@ namespace Ryujinx.Ava
|
|||||||
};
|
};
|
||||||
|
|
||||||
ConfigurationState.Instance.EnableDiscordIntegration.Event += Update;
|
ConfigurationState.Instance.EnableDiscordIntegration.Event += Update;
|
||||||
TitleIDs.CurrentApplication.Event += (_, e) =>
|
TitleIDs.CurrentApplication.Event += (_, e) => Use(e.NewValue);
|
||||||
{
|
|
||||||
if (e.NewValue)
|
|
||||||
SwitchToPlayingState(
|
|
||||||
ApplicationLibrary.LoadAndSaveMetaData(e.NewValue),
|
|
||||||
Switch.Shared.Processes.ActiveApplication
|
|
||||||
);
|
|
||||||
else
|
|
||||||
SwitchToMainState();
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Update(object sender, ReactiveEventArgs<bool> evnt)
|
private static void Update(object sender, ReactiveEventArgs<bool> evnt)
|
||||||
@@ -75,11 +68,23 @@ namespace Ryujinx.Ava
|
|||||||
_discordClient = new DiscordRpcClient(ApplicationId);
|
_discordClient = new DiscordRpcClient(ApplicationId);
|
||||||
|
|
||||||
_discordClient.Initialize();
|
_discordClient.Initialize();
|
||||||
_discordClient.SetPresence(_discordPresenceMain);
|
|
||||||
|
Use(TitleIDs.CurrentApplication);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Use(Optional<string> titleId)
|
||||||
|
{
|
||||||
|
if (titleId.TryGet(out string tid))
|
||||||
|
SwitchToPlayingState(
|
||||||
|
ApplicationLibrary.LoadAndSaveMetaData(tid),
|
||||||
|
Switch.Shared.Processes.ActiveApplication
|
||||||
|
);
|
||||||
|
else
|
||||||
|
SwitchToMainState();
|
||||||
|
}
|
||||||
|
|
||||||
private static void SwitchToPlayingState(ApplicationMetadata appMeta, ProcessResult procRes)
|
private static void SwitchToPlayingState(ApplicationMetadata appMeta, ProcessResult procRes)
|
||||||
{
|
{
|
||||||
_discordClient?.SetPresence(new RichPresence
|
_discordClient?.SetPresence(new RichPresence
|
||||||
@@ -93,7 +98,7 @@ namespace Ryujinx.Ava
|
|||||||
},
|
},
|
||||||
Details = TruncateToByteLength($"Playing {appMeta.Title}"),
|
Details = TruncateToByteLength($"Playing {appMeta.Title}"),
|
||||||
State = appMeta.LastPlayed.HasValue && appMeta.TimePlayed.TotalSeconds > 5
|
State = appMeta.LastPlayed.HasValue && appMeta.TimePlayed.TotalSeconds > 5
|
||||||
? $"Total play time: {appMeta.TimePlayed.Humanize(2, false, maxUnit: TimeUnit.Hour)}"
|
? $"Total play time: {ValueFormatUtils.FormatTimeSpan(appMeta.TimePlayed)}"
|
||||||
: "Never played",
|
: "Never played",
|
||||||
Timestamps = Timestamps.Now
|
Timestamps = Timestamps.Now
|
||||||
});
|
});
|
||||||
|
@@ -229,8 +229,6 @@ namespace Ryujinx.Headless
|
|||||||
_enableKeyboard = option.EnableKeyboard;
|
_enableKeyboard = option.EnableKeyboard;
|
||||||
_enableMouse = option.EnableMouse;
|
_enableMouse = option.EnableMouse;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LoadPlayerConfiguration(option.InputProfile1Name, option.InputId1, PlayerIndex.Player1);
|
LoadPlayerConfiguration(option.InputProfile1Name, option.InputId1, PlayerIndex.Player1);
|
||||||
LoadPlayerConfiguration(option.InputProfile2Name, option.InputId2, PlayerIndex.Player2);
|
LoadPlayerConfiguration(option.InputProfile2Name, option.InputId2, PlayerIndex.Player2);
|
||||||
LoadPlayerConfiguration(option.InputProfile3Name, option.InputId3, PlayerIndex.Player3);
|
LoadPlayerConfiguration(option.InputProfile3Name, option.InputId3, PlayerIndex.Player3);
|
||||||
@@ -301,7 +299,10 @@ namespace Ryujinx.Headless
|
|||||||
_userChannelPersistence.ShouldRestart = false;
|
_userChannelPersistence.ShouldRestart = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_inputManager.Dispose();
|
try
|
||||||
|
{
|
||||||
|
_inputManager.Dispose();
|
||||||
|
} catch {}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -338,12 +339,12 @@ namespace Ryujinx.Headless
|
|||||||
{
|
{
|
||||||
string label = state switch
|
string label = state switch
|
||||||
{
|
{
|
||||||
LoadState => $"PTC : {current}/{total}",
|
LoadState => "PTC",
|
||||||
ShaderCacheState => $"Shaders : {current}/{total}",
|
ShaderCacheState => "Shaders",
|
||||||
_ => throw new ArgumentException($"Unknown Progress Handler type {typeof(T)}"),
|
_ => throw new ArgumentException($"Unknown Progress Handler type {typeof(T)}")
|
||||||
};
|
};
|
||||||
|
|
||||||
Logger.Info?.Print(LogClass.Application, label);
|
Logger.Info?.Print(LogClass.Application, $"{label} : {current}/{total}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static WindowBase CreateWindow(Options options)
|
private static WindowBase CreateWindow(Options options)
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB |
@@ -1,21 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace Ryujinx.Headless
|
|
||||||
{
|
|
||||||
class StatusUpdatedEventArgs(
|
|
||||||
string vSyncMode,
|
|
||||||
string dockedMode,
|
|
||||||
string aspectRatio,
|
|
||||||
string gameStatus,
|
|
||||||
string fifoStatus,
|
|
||||||
string gpuName)
|
|
||||||
: EventArgs
|
|
||||||
{
|
|
||||||
public string VSyncMode = vSyncMode;
|
|
||||||
public string DockedMode = dockedMode;
|
|
||||||
public string AspectRatio = aspectRatio;
|
|
||||||
public string GameStatus = gameStatus;
|
|
||||||
public string FifoStatus = fifoStatus;
|
|
||||||
public string GpuName = gpuName;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -26,7 +26,7 @@ namespace Ryujinx.Headless
|
|||||||
bool ignoreControllerApplet)
|
bool ignoreControllerApplet)
|
||||||
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet) { }
|
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet) { }
|
||||||
|
|
||||||
public override SDL_WindowFlags GetWindowFlags() => SDL_WindowFlags.SDL_WINDOW_METAL;
|
public override SDL_WindowFlags WindowFlags => SDL_WindowFlags.SDL_WINDOW_METAL;
|
||||||
|
|
||||||
protected override void InitializeWindowRenderer()
|
protected override void InitializeWindowRenderer()
|
||||||
{
|
{
|
@@ -109,7 +109,6 @@ namespace Ryujinx.Headless
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly GraphicsDebugLevel _glLogLevel;
|
|
||||||
private SDL2OpenGLContext _openGLContext;
|
private SDL2OpenGLContext _openGLContext;
|
||||||
|
|
||||||
public OpenGLWindow(
|
public OpenGLWindow(
|
||||||
@@ -121,15 +120,14 @@ namespace Ryujinx.Headless
|
|||||||
bool ignoreControllerApplet)
|
bool ignoreControllerApplet)
|
||||||
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet)
|
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet)
|
||||||
{
|
{
|
||||||
_glLogLevel = glLogLevel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override SDL_WindowFlags GetWindowFlags() => SDL_WindowFlags.SDL_WINDOW_OPENGL;
|
public override SDL_WindowFlags WindowFlags => SDL_WindowFlags.SDL_WINDOW_OPENGL;
|
||||||
|
|
||||||
protected override void InitializeWindowRenderer()
|
protected override void InitializeWindowRenderer()
|
||||||
{
|
{
|
||||||
// Ensure to not share this context with other contexts before this point.
|
// Ensure to not share this context with other contexts before this point.
|
||||||
SetupOpenGLAttributes(false, _glLogLevel);
|
SetupOpenGLAttributes(false, GlLogLevel);
|
||||||
nint context = SDL_GL_CreateContext(WindowHandle);
|
nint context = SDL_GL_CreateContext(WindowHandle);
|
||||||
CheckResult(SDL_GL_SetSwapInterval(1));
|
CheckResult(SDL_GL_SetSwapInterval(1));
|
||||||
|
|
@@ -10,8 +10,6 @@ namespace Ryujinx.Headless
|
|||||||
{
|
{
|
||||||
class VulkanWindow : WindowBase
|
class VulkanWindow : WindowBase
|
||||||
{
|
{
|
||||||
private readonly GraphicsDebugLevel _glLogLevel;
|
|
||||||
|
|
||||||
public VulkanWindow(
|
public VulkanWindow(
|
||||||
InputManager inputManager,
|
InputManager inputManager,
|
||||||
GraphicsDebugLevel glLogLevel,
|
GraphicsDebugLevel glLogLevel,
|
||||||
@@ -21,10 +19,9 @@ namespace Ryujinx.Headless
|
|||||||
bool ignoreControllerApplet)
|
bool ignoreControllerApplet)
|
||||||
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet)
|
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet)
|
||||||
{
|
{
|
||||||
_glLogLevel = glLogLevel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override SDL_WindowFlags GetWindowFlags() => SDL_WindowFlags.SDL_WINDOW_VULKAN;
|
public override SDL_WindowFlags WindowFlags => SDL_WindowFlags.SDL_WINDOW_VULKAN;
|
||||||
|
|
||||||
protected override void InitializeWindowRenderer() { }
|
protected override void InitializeWindowRenderer() { }
|
||||||
|
|
@@ -1,14 +1,15 @@
|
|||||||
using Humanizer;
|
using Humanizer;
|
||||||
using LibHac.Tools.Fs;
|
|
||||||
using Ryujinx.Ava;
|
using Ryujinx.Ava;
|
||||||
|
using Ryujinx.Ava.UI.Models;
|
||||||
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Configuration.Hid;
|
using Ryujinx.Common.Configuration.Hid;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Graphics.GAL;
|
using Ryujinx.Graphics.GAL;
|
||||||
using Ryujinx.Graphics.GAL.Multithreading;
|
using Ryujinx.Graphics.GAL.Multithreading;
|
||||||
using Ryujinx.Graphics.Gpu;
|
|
||||||
using Ryujinx.Graphics.OpenGL;
|
using Ryujinx.Graphics.OpenGL;
|
||||||
using Ryujinx.HLE.HOS.Applets;
|
using Ryujinx.HLE.HOS.Applets;
|
||||||
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||||
using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy.Types;
|
using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy.Types;
|
||||||
using Ryujinx.HLE.UI;
|
using Ryujinx.HLE.UI;
|
||||||
using Ryujinx.Input;
|
using Ryujinx.Input;
|
||||||
@@ -26,6 +27,7 @@ using static SDL2.SDL;
|
|||||||
using AntiAliasing = Ryujinx.Common.Configuration.AntiAliasing;
|
using AntiAliasing = Ryujinx.Common.Configuration.AntiAliasing;
|
||||||
using ScalingFilter = Ryujinx.Common.Configuration.ScalingFilter;
|
using ScalingFilter = Ryujinx.Common.Configuration.ScalingFilter;
|
||||||
using Switch = Ryujinx.HLE.Switch;
|
using Switch = Ryujinx.HLE.Switch;
|
||||||
|
using UserProfile = Ryujinx.HLE.HOS.Services.Account.Acc.UserProfile;
|
||||||
|
|
||||||
namespace Ryujinx.Headless
|
namespace Ryujinx.Headless
|
||||||
{
|
{
|
||||||
@@ -53,8 +55,6 @@ namespace Ryujinx.Headless
|
|||||||
public Switch Device { get; private set; }
|
public Switch Device { get; private set; }
|
||||||
public IRenderer Renderer { get; private set; }
|
public IRenderer Renderer { get; private set; }
|
||||||
|
|
||||||
public event EventHandler<StatusUpdatedEventArgs> StatusUpdatedEvent;
|
|
||||||
|
|
||||||
protected nint WindowHandle { get; set; }
|
protected nint WindowHandle { get; set; }
|
||||||
|
|
||||||
public IHostUITheme HostUITheme { get; }
|
public IHostUITheme HostUITheme { get; }
|
||||||
@@ -72,7 +72,7 @@ namespace Ryujinx.Headless
|
|||||||
protected SDL2MouseDriver MouseDriver;
|
protected SDL2MouseDriver MouseDriver;
|
||||||
private readonly InputManager _inputManager;
|
private readonly InputManager _inputManager;
|
||||||
private readonly IKeyboard _keyboardInterface;
|
private readonly IKeyboard _keyboardInterface;
|
||||||
private readonly GraphicsDebugLevel _glLogLevel;
|
protected readonly GraphicsDebugLevel GlLogLevel;
|
||||||
private readonly Stopwatch _chrono;
|
private readonly Stopwatch _chrono;
|
||||||
private readonly long _ticksPerFrame;
|
private readonly long _ticksPerFrame;
|
||||||
private readonly CancellationTokenSource _gpuCancellationTokenSource;
|
private readonly CancellationTokenSource _gpuCancellationTokenSource;
|
||||||
@@ -104,7 +104,7 @@ namespace Ryujinx.Headless
|
|||||||
NpadManager = _inputManager.CreateNpadManager();
|
NpadManager = _inputManager.CreateNpadManager();
|
||||||
TouchScreenManager = _inputManager.CreateTouchScreenManager();
|
TouchScreenManager = _inputManager.CreateTouchScreenManager();
|
||||||
_keyboardInterface = (IKeyboard)_inputManager.KeyboardDriver.GetGamepad("0");
|
_keyboardInterface = (IKeyboard)_inputManager.KeyboardDriver.GetGamepad("0");
|
||||||
_glLogLevel = glLogLevel;
|
GlLogLevel = glLogLevel;
|
||||||
_chrono = new Stopwatch();
|
_chrono = new Stopwatch();
|
||||||
_ticksPerFrame = Stopwatch.Frequency / TargetFps;
|
_ticksPerFrame = Stopwatch.Frequency / TargetFps;
|
||||||
_gpuCancellationTokenSource = new CancellationTokenSource();
|
_gpuCancellationTokenSource = new CancellationTokenSource();
|
||||||
@@ -137,7 +137,7 @@ namespace Ryujinx.Headless
|
|||||||
|
|
||||||
private void SetWindowIcon()
|
private void SetWindowIcon()
|
||||||
{
|
{
|
||||||
Stream iconStream = typeof(Program).Assembly.GetManifestResourceStream("HeadlessLogo");
|
Stream iconStream = EmbeddedResources.GetStream("Ryujinx/Assets/UIImages/Logo_Ryujinx.png");
|
||||||
byte[] iconBytes = new byte[iconStream!.Length];
|
byte[] iconBytes = new byte[iconStream!.Length];
|
||||||
|
|
||||||
if (iconStream.Read(iconBytes, 0, iconBytes.Length) != iconBytes.Length)
|
if (iconStream.Read(iconBytes, 0, iconBytes.Length) != iconBytes.Length)
|
||||||
@@ -191,7 +191,7 @@ namespace Ryujinx.Headless
|
|||||||
FullscreenFlag = SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP;
|
FullscreenFlag = SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowHandle = SDL_CreateWindow($"Ryujinx {Program.Version}{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}", SDL_WINDOWPOS_CENTERED_DISPLAY(DisplayId), SDL_WINDOWPOS_CENTERED_DISPLAY(DisplayId), Width, Height, DefaultFlags | FullscreenFlag | GetWindowFlags());
|
WindowHandle = SDL_CreateWindow($"Ryujinx {Program.Version}{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}", SDL_WINDOWPOS_CENTERED_DISPLAY(DisplayId), SDL_WINDOWPOS_CENTERED_DISPLAY(DisplayId), Width, Height, DefaultFlags | FullscreenFlag | WindowFlags);
|
||||||
|
|
||||||
if (WindowHandle == nint.Zero)
|
if (WindowHandle == nint.Zero)
|
||||||
{
|
{
|
||||||
@@ -246,7 +246,7 @@ namespace Ryujinx.Headless
|
|||||||
|
|
||||||
protected abstract void SwapBuffers();
|
protected abstract void SwapBuffers();
|
||||||
|
|
||||||
public abstract SDL_WindowFlags GetWindowFlags();
|
public abstract SDL_WindowFlags WindowFlags { get; }
|
||||||
|
|
||||||
private string GetGpuDriverName()
|
private string GetGpuDriverName()
|
||||||
{
|
{
|
||||||
@@ -268,7 +268,7 @@ namespace Ryujinx.Headless
|
|||||||
{
|
{
|
||||||
InitializeWindowRenderer();
|
InitializeWindowRenderer();
|
||||||
|
|
||||||
Device.Gpu.Renderer.Initialize(_glLogLevel);
|
Device.Gpu.Renderer.Initialize(GlLogLevel);
|
||||||
|
|
||||||
InitializeRenderer();
|
InitializeRenderer();
|
||||||
|
|
||||||
@@ -308,21 +308,6 @@ namespace Ryujinx.Headless
|
|||||||
|
|
||||||
if (_ticks >= _ticksPerFrame)
|
if (_ticks >= _ticksPerFrame)
|
||||||
{
|
{
|
||||||
string dockedMode = Device.System.State.DockedMode ? "Docked" : "Handheld";
|
|
||||||
float scale = GraphicsConfig.ResScale;
|
|
||||||
if (scale != 1)
|
|
||||||
{
|
|
||||||
dockedMode += $" ({scale}x)";
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusUpdatedEvent?.Invoke(this, new StatusUpdatedEventArgs(
|
|
||||||
Device.VSyncMode.ToString(),
|
|
||||||
dockedMode,
|
|
||||||
Device.Configuration.AspectRatio.ToText(),
|
|
||||||
$"{Device.Statistics.GetGameFrameRate():00.00} FPS ({Device.Statistics.GetGameFrameTime():00.00} ms)",
|
|
||||||
$"FIFO: {Device.Statistics.GetFifoPercent():0.00} %",
|
|
||||||
$"GPU: {_gpuDriverName}"));
|
|
||||||
|
|
||||||
_ticks = Math.Min(_ticks - _ticksPerFrame, _ticksPerFrame);
|
_ticks = Math.Min(_ticks - _ticksPerFrame, _ticksPerFrame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -572,5 +557,10 @@ namespace Ryujinx.Headless
|
|||||||
SDL2Driver.Instance.Dispose();
|
SDL2Driver.Instance.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public UserProfile ShowPlayerSelectDialog()
|
||||||
|
{
|
||||||
|
return AccountSaveDataManager.GetLastUsedUser();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -21,6 +21,7 @@ using Ryujinx.Graphics.Vulkan.MoltenVK;
|
|||||||
using Ryujinx.Headless;
|
using Ryujinx.Headless;
|
||||||
using Ryujinx.SDL2.Common;
|
using Ryujinx.SDL2.Common;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
@@ -229,13 +230,16 @@ namespace Ryujinx.Ava
|
|||||||
internal static void PrintSystemInfo()
|
internal static void PrintSystemInfo()
|
||||||
{
|
{
|
||||||
Logger.Notice.Print(LogClass.Application, $"{RyujinxApp.FullAppName} Version: {Version}");
|
Logger.Notice.Print(LogClass.Application, $"{RyujinxApp.FullAppName} Version: {Version}");
|
||||||
|
Logger.Notice.Print(LogClass.Application, $".NET Runtime: {RuntimeInformation.FrameworkDescription}");
|
||||||
SystemInfo.Gather().Print();
|
SystemInfo.Gather().Print();
|
||||||
|
|
||||||
var enabledLogLevels = Logger.GetEnabledLevels().ToArray();
|
Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {
|
||||||
|
Logger.GetEnabledLevels()
|
||||||
Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(enabledLogLevels.Length is 0
|
.FormatCollection(
|
||||||
? "<None>"
|
x => x.ToString(),
|
||||||
: enabledLogLevels.JoinToString(", "))}");
|
separator: ", ",
|
||||||
|
emptyCollectionFallback: "<None>")
|
||||||
|
}");
|
||||||
|
|
||||||
Logger.Notice.Print(LogClass.Application,
|
Logger.Notice.Print(LogClass.Application,
|
||||||
AppDataManager.Mode == AppDataManager.LaunchMode.Custom
|
AppDataManager.Mode == AppDataManager.LaunchMode.Custom
|
||||||
@@ -243,16 +247,33 @@ namespace Ryujinx.Ava
|
|||||||
: $"Launch Mode: {AppDataManager.Mode}");
|
: $"Launch Mode: {AppDataManager.Mode}");
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void ProcessUnhandledException(object sender, Exception ex, bool isTerminating)
|
internal static void ProcessUnhandledException(object sender, Exception initialException, bool isTerminating)
|
||||||
{
|
{
|
||||||
Logger.Log log = Logger.Error ?? Logger.Notice;
|
Logger.Log log = Logger.Error ?? Logger.Notice;
|
||||||
string message = $"Unhandled exception caught: {ex}";
|
|
||||||
|
|
||||||
// ReSharper disable once ConstantConditionalAccessQualifier
|
List<Exception> exceptions = [];
|
||||||
if (sender?.GetType()?.AsPrettyString() is { } senderName)
|
|
||||||
log.Print(LogClass.Application, message, senderName);
|
if (initialException is AggregateException ae)
|
||||||
|
{
|
||||||
|
exceptions.AddRange(ae.InnerExceptions);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
log.PrintMsg(LogClass.Application, message);
|
{
|
||||||
|
exceptions.Add(initialException);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var e in exceptions)
|
||||||
|
{
|
||||||
|
string message = $"Unhandled exception caught: {e}";
|
||||||
|
// ReSharper disable once ConstantConditionalAccessQualifier
|
||||||
|
if (sender?.GetType()?.AsPrettyString() is { } senderName)
|
||||||
|
log.Print(LogClass.Application, message, senderName);
|
||||||
|
else
|
||||||
|
log.PrintMsg(LogClass.Application, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isTerminating)
|
if (isTerminating)
|
||||||
Exit();
|
Exit();
|
||||||
|
@@ -123,12 +123,13 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</AvaloniaResource>
|
</AvaloniaResource>
|
||||||
<AvaloniaResource Include="Assets\Styles\Styles.xaml" />
|
<AvaloniaResource Include="Assets\Styles\Styles.xaml" />
|
||||||
|
<AvaloniaResource Include="Assets\Styles\CheckboxMenuItemStyle.axaml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Assets\locales.json" />
|
<None Remove="Assets\locales.json" />
|
||||||
<None Remove="Assets\Styles\Styles.xaml" />
|
|
||||||
<None Remove="Assets\Styles\Themes.xaml" />
|
<None Remove="Assets\Styles\Themes.xaml" />
|
||||||
|
<None Remove="Assets\Styles\CheckboxMenuItemStyle.xaml" />
|
||||||
<None Remove="Assets\Icons\Controller_JoyConLeft.svg" />
|
<None Remove="Assets\Icons\Controller_JoyConLeft.svg" />
|
||||||
<None Remove="Assets\Icons\Controller_JoyConPair.svg" />
|
<None Remove="Assets\Icons\Controller_JoyConPair.svg" />
|
||||||
<None Remove="Assets\Icons\Controller_JoyConRight.svg" />
|
<None Remove="Assets\Icons\Controller_JoyConRight.svg" />
|
||||||
@@ -150,6 +151,7 @@
|
|||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Assets\locales.json" />
|
<EmbeddedResource Include="Assets\locales.json" />
|
||||||
<EmbeddedResource Include="Assets\Styles\Styles.xaml" />
|
<EmbeddedResource Include="Assets\Styles\Styles.xaml" />
|
||||||
|
<EmbeddedResource Include="Assets\Styles\CheckboxMenuItemStyle.axaml" />
|
||||||
<EmbeddedResource Include="Assets\Icons\Controller_JoyConLeft.svg" />
|
<EmbeddedResource Include="Assets\Icons\Controller_JoyConLeft.svg" />
|
||||||
<EmbeddedResource Include="Assets\Icons\Controller_JoyConPair.svg" />
|
<EmbeddedResource Include="Assets\Icons\Controller_JoyConPair.svg" />
|
||||||
<EmbeddedResource Include="Assets\Icons\Controller_JoyConRight.svg" />
|
<EmbeddedResource Include="Assets\Icons\Controller_JoyConRight.svg" />
|
||||||
@@ -166,7 +168,6 @@
|
|||||||
<EmbeddedResource Include="Assets\UIImages\Logo_GitHub_Light.png" />
|
<EmbeddedResource Include="Assets\UIImages\Logo_GitHub_Light.png" />
|
||||||
<EmbeddedResource Include="Assets\UIImages\Logo_Ryujinx.png" />
|
<EmbeddedResource Include="Assets\UIImages\Logo_Ryujinx.png" />
|
||||||
<EmbeddedResource Include="Assets\UIImages\Logo_Ryujinx_AntiAlias.png" />
|
<EmbeddedResource Include="Assets\UIImages\Logo_Ryujinx_AntiAlias.png" />
|
||||||
<EmbeddedResource Include="Headless\Ryujinx.bmp" LogicalName="HeadlessLogo" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AdditionalFiles Include="Assets\locales.json" />
|
<AdditionalFiles Include="Assets\locales.json" />
|
||||||
@@ -174,4 +175,5 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Assets\Fonts\Mono\" />
|
<Folder Include="Assets\Fonts\Mono\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -16,5 +16,6 @@
|
|||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
<sty:FluentAvaloniaTheme PreferUserAccentColor="True" PreferSystemTheme="False" />
|
<sty:FluentAvaloniaTheme PreferUserAccentColor="True" PreferSystemTheme="False" />
|
||||||
<StyleInclude Source="/Assets/Styles/Styles.xaml" />
|
<StyleInclude Source="/Assets/Styles/Styles.xaml" />
|
||||||
|
<StyleInclude Source="/Assets/Styles/CheckboxMenuItemStyle.axaml"/>
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
</Application>
|
</Application>
|
||||||
|
@@ -1,17 +1,24 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
using FluentAvalonia.UI.Controls;
|
using FluentAvalonia.UI.Controls;
|
||||||
|
using Gommon;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.UI.Controls;
|
using Ryujinx.Ava.UI.Controls;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
|
using Ryujinx.Ava.UI.ViewModels.Input;
|
||||||
using Ryujinx.Ava.UI.Windows;
|
using Ryujinx.Ava.UI.Windows;
|
||||||
using Ryujinx.Ava.Utilities.Configuration;
|
using Ryujinx.Ava.Utilities.Configuration;
|
||||||
|
using Ryujinx.Common;
|
||||||
using Ryujinx.HLE;
|
using Ryujinx.HLE;
|
||||||
using Ryujinx.HLE.HOS.Applets;
|
using Ryujinx.HLE.HOS.Applets;
|
||||||
using Ryujinx.HLE.HOS.Applets.SoftwareKeyboard;
|
using Ryujinx.HLE.HOS.Applets.SoftwareKeyboard;
|
||||||
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||||
using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy.Types;
|
using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy.Types;
|
||||||
using Ryujinx.HLE.UI;
|
using Ryujinx.HLE.UI;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Applet
|
namespace Ryujinx.Ava.UI.Applet
|
||||||
@@ -253,5 +260,59 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IDynamicTextInputHandler CreateDynamicTextInputHandler() => new AvaloniaDynamicTextInputHandler(_parent);
|
public IDynamicTextInputHandler CreateDynamicTextInputHandler() => new AvaloniaDynamicTextInputHandler(_parent);
|
||||||
|
|
||||||
|
public UserProfile ShowPlayerSelectDialog()
|
||||||
|
{
|
||||||
|
UserId selected = UserId.Null;
|
||||||
|
byte[] defaultGuestImage = EmbeddedResources.Read("Ryujinx.HLE/HOS/Services/Account/Acc/GuestUserImage.jpg");
|
||||||
|
UserProfile guest = new UserProfile(new UserId("00000000000000000000000000000080"), "Guest", defaultGuestImage);
|
||||||
|
|
||||||
|
ManualResetEvent dialogCloseEvent = new(false);
|
||||||
|
|
||||||
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||||
|
{
|
||||||
|
ObservableCollection<BaseModel> profiles = [];
|
||||||
|
NavigationDialogHost nav = new();
|
||||||
|
|
||||||
|
_parent.AccountManager.GetAllUsers()
|
||||||
|
.OrderBy(x => x.Name)
|
||||||
|
.ForEach(profile => profiles.Add(new Models.UserProfile(profile, nav)));
|
||||||
|
|
||||||
|
profiles.Add(new Models.UserProfile(guest, nav));
|
||||||
|
UserSelectorDialogViewModel viewModel = new()
|
||||||
|
{
|
||||||
|
Profiles = profiles,
|
||||||
|
SelectedUserId = _parent.AccountManager.LastOpenedUser.UserId
|
||||||
|
};
|
||||||
|
UserSelectorDialog content = new(viewModel);
|
||||||
|
(selected, _) = await UserSelectorDialog.ShowInputDialog(content);
|
||||||
|
|
||||||
|
dialogCloseEvent.Set();
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogCloseEvent.WaitOne();
|
||||||
|
|
||||||
|
UserProfile profile = _parent.AccountManager.LastOpenedUser;
|
||||||
|
if (selected == guest.UserId)
|
||||||
|
{
|
||||||
|
profile = guest;
|
||||||
|
}
|
||||||
|
else if (selected == UserId.Null)
|
||||||
|
{
|
||||||
|
profile = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (UserProfile p in _parent.AccountManager.GetAllUsers())
|
||||||
|
{
|
||||||
|
if (p.UserId == selected)
|
||||||
|
{
|
||||||
|
profile = p;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return profile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
121
src/Ryujinx/UI/Applet/UserSelectorDialog.axaml
Normal file
121
src/Ryujinx/UI/Applet/UserSelectorDialog.axaml
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="Ryujinx.Ava.UI.Applet.UserSelectorDialog"
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
||||||
|
xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models"
|
||||||
|
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||||
|
d:DesignHeight="450"
|
||||||
|
MinWidth="500"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Focusable="True"
|
||||||
|
x:DataType="viewModels:UserSelectorDialogViewModel">
|
||||||
|
|
||||||
|
<UserControl.Resources>
|
||||||
|
<helpers:BitmapArrayValueConverter x:Key="ByteImage" />
|
||||||
|
</UserControl.Resources>
|
||||||
|
|
||||||
|
<Design.DataContext>
|
||||||
|
<viewModels:UserSelectorDialogViewModel />
|
||||||
|
</Design.DataContext>
|
||||||
|
|
||||||
|
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Border
|
||||||
|
CornerRadius="5"
|
||||||
|
BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
|
||||||
|
BorderThickness="1">
|
||||||
|
|
||||||
|
<ListBox
|
||||||
|
MaxHeight="300"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Background="Transparent"
|
||||||
|
ItemsSource="{Binding Profiles}"
|
||||||
|
SelectionChanged="ProfilesList_SelectionChanged">
|
||||||
|
|
||||||
|
<ListBox.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<WrapPanel
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Orientation="Horizontal" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ListBox.ItemsPanel>
|
||||||
|
|
||||||
|
<ListBox.Styles>
|
||||||
|
<Style Selector="ListBoxItem">
|
||||||
|
<Setter Property="Margin" Value="5 5 0 5" />
|
||||||
|
<Setter Property="CornerRadius" Value="5" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="Rectangle#SelectionIndicator">
|
||||||
|
<Setter Property="Opacity" Value="0" />
|
||||||
|
</Style>
|
||||||
|
</ListBox.Styles>
|
||||||
|
|
||||||
|
<ListBox.DataTemplates>
|
||||||
|
<DataTemplate
|
||||||
|
DataType="models:UserProfile">
|
||||||
|
<Grid
|
||||||
|
PointerEntered="Grid_PointerEntered"
|
||||||
|
PointerExited="Grid_OnPointerExited">
|
||||||
|
<Border
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
ClipToBounds="True"
|
||||||
|
CornerRadius="5"
|
||||||
|
Background="{Binding BackgroundColor}">
|
||||||
|
<StackPanel
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch">
|
||||||
|
<Image
|
||||||
|
Width="96"
|
||||||
|
Height="96"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Source="{Binding Image, Converter={StaticResource ByteImage}}" />
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
MaxWidth="90"
|
||||||
|
Text="{Binding Name}"
|
||||||
|
TextAlignment="Center"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
TextTrimming="CharacterEllipsis"
|
||||||
|
MaxLines="2"
|
||||||
|
Margin="5" />
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate
|
||||||
|
DataType="viewModels:BaseModel">
|
||||||
|
<Panel
|
||||||
|
Height="118"
|
||||||
|
Width="96">
|
||||||
|
<Panel.Styles>
|
||||||
|
<Style Selector="Panel">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource ListBoxBackground}" />
|
||||||
|
</Style>
|
||||||
|
</Panel.Styles>
|
||||||
|
</Panel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.DataTemplates>
|
||||||
|
</ListBox>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<StackPanel
|
||||||
|
Grid.Row="1"
|
||||||
|
Margin="0 24 0 0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="10">
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
123
src/Ryujinx/UI/Applet/UserSelectorDialog.axaml.cs
Normal file
123
src/Ryujinx/UI/Applet/UserSelectorDialog.axaml.cs
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Input;
|
||||||
|
using FluentAvalonia.UI.Controls;
|
||||||
|
using Ryujinx.Ava.Common.Locale;
|
||||||
|
using Ryujinx.Ava.UI.Controls;
|
||||||
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
|
using Ryujinx.Ava.UI.ViewModels.Input;
|
||||||
|
using Ryujinx.Common.Logging;
|
||||||
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UserProfile = Ryujinx.Ava.UI.Models.UserProfile;
|
||||||
|
using UserProfileSft = Ryujinx.HLE.HOS.Services.Account.Acc.UserProfile;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.UI.Applet
|
||||||
|
{
|
||||||
|
public partial class UserSelectorDialog : UserControl, INotifyPropertyChanged
|
||||||
|
{
|
||||||
|
public UserSelectorDialogViewModel ViewModel { get; set; }
|
||||||
|
|
||||||
|
public UserSelectorDialog(UserSelectorDialogViewModel viewModel)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
ViewModel = viewModel;
|
||||||
|
DataContext = ViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Grid_PointerEntered(object sender, PointerEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is Grid { DataContext: UserProfile profile })
|
||||||
|
{
|
||||||
|
profile.IsPointerOver = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Grid_OnPointerExited(object sender, PointerEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is Grid { DataContext: UserProfile profile })
|
||||||
|
{
|
||||||
|
profile.IsPointerOver = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProfilesList_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is ListBox listBox)
|
||||||
|
{
|
||||||
|
int selectedIndex = listBox.SelectedIndex;
|
||||||
|
|
||||||
|
if (selectedIndex >= 0 && selectedIndex < ViewModel.Profiles.Count)
|
||||||
|
{
|
||||||
|
if (ViewModel.Profiles[selectedIndex] is UserProfile userProfile)
|
||||||
|
{
|
||||||
|
ViewModel.SelectedUserId = userProfile.UserId;
|
||||||
|
Logger.Info?.Print(LogClass.UI, $"Selected user: {userProfile.UserId}");
|
||||||
|
|
||||||
|
ObservableCollection<BaseModel> newProfiles = [];
|
||||||
|
|
||||||
|
foreach (var item in ViewModel.Profiles)
|
||||||
|
{
|
||||||
|
if (item is UserProfile originalItem)
|
||||||
|
{
|
||||||
|
var profile = new UserProfileSft(originalItem.UserId, originalItem.Name, originalItem.Image);
|
||||||
|
|
||||||
|
if (profile.UserId == ViewModel.SelectedUserId)
|
||||||
|
{
|
||||||
|
profile.AccountState = AccountState.Open;
|
||||||
|
}
|
||||||
|
|
||||||
|
newProfiles.Add(new UserProfile(profile, new NavigationDialogHost()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ViewModel.Profiles = newProfiles;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<(UserId Id, bool Result)> ShowInputDialog(UserSelectorDialog content)
|
||||||
|
{
|
||||||
|
ContentDialog contentDialog = new()
|
||||||
|
{
|
||||||
|
Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle],
|
||||||
|
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.Continue],
|
||||||
|
SecondaryButtonText = string.Empty,
|
||||||
|
CloseButtonText = LocaleManager.Instance[LocaleKeys.Cancel],
|
||||||
|
Content = content,
|
||||||
|
Padding = new Thickness(0)
|
||||||
|
};
|
||||||
|
|
||||||
|
UserId result = UserId.Null;
|
||||||
|
bool input = false;
|
||||||
|
|
||||||
|
void Handler(ContentDialog sender, ContentDialogClosedEventArgs eventArgs)
|
||||||
|
{
|
||||||
|
if (eventArgs.Result == ContentDialogResult.Primary)
|
||||||
|
{
|
||||||
|
if (contentDialog.Content is UserSelectorDialog view)
|
||||||
|
{
|
||||||
|
result = view.ViewModel.SelectedUserId;
|
||||||
|
input = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = UserId.Null;
|
||||||
|
input = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
contentDialog.Closed += Handler;
|
||||||
|
|
||||||
|
await ContentDialogHelper.ShowAsync(contentDialog);
|
||||||
|
|
||||||
|
return (result, input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -106,6 +106,10 @@
|
|||||||
Click="ExtractApplicationRomFs_Click"
|
Click="ExtractApplicationRomFs_Click"
|
||||||
Header="{ext:Locale GameListContextMenuExtractDataRomFS}"
|
Header="{ext:Locale GameListContextMenuExtractDataRomFS}"
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuExtractDataRomFSToolTip}" />
|
ToolTip.Tip="{ext:Locale GameListContextMenuExtractDataRomFSToolTip}" />
|
||||||
|
<MenuItem
|
||||||
|
Click="ExtractAocRomFs_Click"
|
||||||
|
Header="{ext:Locale GameListContextMenuExtractDataAocRomFS}"
|
||||||
|
ToolTip.Tip="{ext:Locale GameListContextMenuExtractDataAocRomFSToolTip}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="ExtractApplicationLogo_Click"
|
Click="ExtractApplicationLogo_Click"
|
||||||
Header="{ext:Locale GameListContextMenuExtractDataLogo}"
|
Header="{ext:Locale GameListContextMenuExtractDataLogo}"
|
||||||
|
@@ -3,10 +3,13 @@ using Avalonia.Interactivity;
|
|||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
using Avalonia.Platform.Storage;
|
using Avalonia.Platform.Storage;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
|
using FluentAvalonia.UI.Controls;
|
||||||
|
using LibHac;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Tools.FsSystem.NcaUtils;
|
using LibHac.Tools.FsSystem.NcaUtils;
|
||||||
using Ryujinx.Ava.Common;
|
using Ryujinx.Ava.Common;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
|
using Ryujinx.Ava.Common.Models;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.ViewModels;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
using Ryujinx.Ava.UI.Windows;
|
using Ryujinx.Ava.UI.Windows;
|
||||||
@@ -14,6 +17,7 @@ using Ryujinx.Ava.Utilities;
|
|||||||
using Ryujinx.Ava.Utilities.AppLibrary;
|
using Ryujinx.Ava.Utilities.AppLibrary;
|
||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Helper;
|
using Ryujinx.Common.Helper;
|
||||||
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.HOS;
|
using Ryujinx.HLE.HOS;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
using System;
|
using System;
|
||||||
@@ -247,7 +251,7 @@ namespace Ryujinx.Ava.UI.Controls
|
|||||||
{
|
{
|
||||||
if (sender is MenuItem { DataContext: MainWindowViewModel { SelectedApplication: not null } viewModel })
|
if (sender is MenuItem { DataContext: MainWindowViewModel { SelectedApplication: not null } viewModel })
|
||||||
{
|
{
|
||||||
string shaderCacheDir = Path.Combine(AppDataManager.GamesDirPath, viewModel.SelectedApplication.IdString, "cache", "shader");
|
string shaderCacheDir = Path.Combine(AppDataManager.GamesDirPath, viewModel.SelectedApplication.IdString.ToLower(), "cache", "shader");
|
||||||
|
|
||||||
if (!Directory.Exists(shaderCacheDir))
|
if (!Directory.Exists(shaderCacheDir))
|
||||||
{
|
{
|
||||||
@@ -280,6 +284,22 @@ namespace Ryujinx.Ava.UI.Controls
|
|||||||
viewModel.SelectedApplication.Name);
|
viewModel.SelectedApplication.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async void ExtractAocRomFs_Click(object sender, RoutedEventArgs args)
|
||||||
|
{
|
||||||
|
if (sender is not MenuItem { DataContext: MainWindowViewModel { SelectedApplication: not null } viewModel })
|
||||||
|
return;
|
||||||
|
|
||||||
|
DownloadableContentModel selectedDlc = await DlcSelectView.Show(viewModel.SelectedApplication.IdBase, viewModel.ApplicationLibrary);
|
||||||
|
|
||||||
|
if (selectedDlc is not null)
|
||||||
|
{
|
||||||
|
await ApplicationHelper.ExtractAoc(
|
||||||
|
viewModel.StorageProvider,
|
||||||
|
selectedDlc.ContainerPath,
|
||||||
|
selectedDlc.FileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async void ExtractApplicationLogo_Click(object sender, RoutedEventArgs args)
|
public async void ExtractApplicationLogo_Click(object sender, RoutedEventArgs args)
|
||||||
{
|
{
|
||||||
if (sender is not MenuItem { DataContext: MainWindowViewModel { SelectedApplication: not null } viewModel })
|
if (sender is not MenuItem { DataContext: MainWindowViewModel { SelectedApplication: not null } viewModel })
|
||||||
|
@@ -2,11 +2,10 @@
|
|||||||
x:Class="Ryujinx.Ava.UI.Controls.ApplicationListView"
|
x:Class="Ryujinx.Ava.UI.Controls.ApplicationListView"
|
||||||
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"
|
||||||
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
Focusable="True"
|
Focusable="True"
|
||||||
|
67
src/Ryujinx/UI/Controls/DlcSelectView.axaml
Normal file
67
src/Ryujinx/UI/Controls/DlcSelectView.axaml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:helpers="using:Ryujinx.Ava.UI.Helpers"
|
||||||
|
xmlns:ext="using:Ryujinx.Ava.Common.Markup"
|
||||||
|
xmlns:models="using:Ryujinx.Ava.Common.Models"
|
||||||
|
xmlns:viewModels="using:Ryujinx.Ava.UI.ViewModels"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="Ryujinx.Ava.UI.Controls.DlcSelectView"
|
||||||
|
x:DataType="viewModels:DlcSelectViewModel">
|
||||||
|
<Grid RowDefinitions="*,Auto,*">
|
||||||
|
<TextBlock
|
||||||
|
Classes="h1"
|
||||||
|
Margin="5, -5, 0, 15"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Text="{ext:Locale ExtractAocListHeader}" />
|
||||||
|
<ScrollViewer Grid.Row="2">
|
||||||
|
<ListBox
|
||||||
|
AutoScrollToSelectedItem="False"
|
||||||
|
SelectionMode="Single"
|
||||||
|
Background="Transparent"
|
||||||
|
SelectedItem="{Binding SelectedDlc}"
|
||||||
|
ItemsSource="{Binding Dlcs}">
|
||||||
|
<ListBox.DataTemplates>
|
||||||
|
<DataTemplate
|
||||||
|
DataType="models:DownloadableContentModel">
|
||||||
|
<Panel Margin="10" Background="Transparent">
|
||||||
|
<Grid ColumnDefinitions="*,Auto">
|
||||||
|
<Grid
|
||||||
|
Grid.Column="0" ColumnDefinitions="*,Auto">
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
MaxLines="2"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
TextTrimming="CharacterEllipsis">
|
||||||
|
<TextBlock.Text>
|
||||||
|
<MultiBinding Converter="{x:Static helpers:DownloadableContentLabelConverter.Instance}">
|
||||||
|
<Binding Path="FileName" />
|
||||||
|
<Binding Path="IsBundled" />
|
||||||
|
</MultiBinding>
|
||||||
|
</TextBlock.Text>
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="10, 0, 0, 0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding TitleIdStr}" />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Panel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.DataTemplates>
|
||||||
|
<ListBox.Styles>
|
||||||
|
<Style Selector="ListBoxItem">
|
||||||
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
</Style>
|
||||||
|
</ListBox.Styles>
|
||||||
|
</ListBox>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
51
src/Ryujinx/UI/Controls/DlcSelectView.axaml.cs
Normal file
51
src/Ryujinx/UI/Controls/DlcSelectView.axaml.cs
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
using Avalonia.Styling;
|
||||||
|
using FluentAvalonia.UI.Controls;
|
||||||
|
using Ryujinx.Ava.Common.Locale;
|
||||||
|
using Ryujinx.Ava.Common.Models;
|
||||||
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
|
using Ryujinx.Ava.Utilities.AppLibrary;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.UI.Controls
|
||||||
|
{
|
||||||
|
public partial class DlcSelectView : UserControl
|
||||||
|
{
|
||||||
|
public DlcSelectView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#nullable enable
|
||||||
|
public static async Task<DownloadableContentModel?> Show(ulong selectedTitleId, ApplicationLibrary appLibrary)
|
||||||
|
#nullable disable
|
||||||
|
{
|
||||||
|
DlcSelectViewModel viewModel = new(selectedTitleId, appLibrary);
|
||||||
|
|
||||||
|
ContentDialog contentDialog = new()
|
||||||
|
{
|
||||||
|
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.Continue],
|
||||||
|
SecondaryButtonText = string.Empty,
|
||||||
|
CloseButtonText = string.Empty,
|
||||||
|
Content = new DlcSelectView { DataContext = viewModel }
|
||||||
|
};
|
||||||
|
|
||||||
|
Style closeButton = new(x => x.Name("CloseButton"));
|
||||||
|
closeButton.Setters.Add(new Setter(WidthProperty, 80d));
|
||||||
|
|
||||||
|
Style closeButtonParent = new(x => x.Name("CommandSpace"));
|
||||||
|
closeButtonParent.Setters.Add(new Setter(HorizontalAlignmentProperty,
|
||||||
|
Avalonia.Layout.HorizontalAlignment.Right));
|
||||||
|
|
||||||
|
contentDialog.Styles.Add(closeButton);
|
||||||
|
contentDialog.Styles.Add(closeButtonParent);
|
||||||
|
|
||||||
|
await ContentDialogHelper.ShowAsync(contentDialog);
|
||||||
|
|
||||||
|
return viewModel.SelectedDlc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -69,7 +69,7 @@ namespace Ryujinx.Ava.UI.Controls
|
|||||||
VirtualFileSystem ownerVirtualFileSystem,
|
VirtualFileSystem ownerVirtualFileSystem,
|
||||||
HorizonClient ownerHorizonClient)
|
HorizonClient ownerHorizonClient)
|
||||||
{
|
{
|
||||||
var content = new NavigationDialogHost(ownerAccountManager, ownerContentManager, ownerVirtualFileSystem, ownerHorizonClient);
|
NavigationDialogHost content = new(ownerAccountManager, ownerContentManager, ownerVirtualFileSystem, ownerHorizonClient);
|
||||||
ContentDialog contentDialog = new()
|
ContentDialog contentDialog = new()
|
||||||
{
|
{
|
||||||
Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle],
|
Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle],
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
Title="Ryujinx - Waiting"
|
Title="Ryujinx - Waiting"
|
||||||
SizeToContent="WidthAndHeight"
|
SizeToContent="WidthAndHeight"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
|
CanResize="False"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Focusable="True">
|
Focusable="True">
|
||||||
<Grid
|
<Grid
|
||||||
|
48
src/Ryujinx/UI/Helpers/Commands.cs
Normal file
48
src/Ryujinx/UI/Helpers/Commands.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
using CommunityToolkit.Mvvm.Input;
|
||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.UI.Helpers
|
||||||
|
{
|
||||||
|
#nullable enable
|
||||||
|
public static class Commands
|
||||||
|
{
|
||||||
|
public static RelayCommand Create(Action action)
|
||||||
|
=> new(action);
|
||||||
|
public static RelayCommand CreateConditional(Action action, Func<bool> canExecute)
|
||||||
|
=> new(action, canExecute);
|
||||||
|
|
||||||
|
public static RelayCommand<T> Create<T>(Action<T?> action)
|
||||||
|
=> new(action);
|
||||||
|
public static RelayCommand<T> CreateConditional<T>(Action<T?> action, Predicate<T?> canExecute)
|
||||||
|
=> new(action, canExecute);
|
||||||
|
|
||||||
|
public static AsyncRelayCommand Create(Func<Task> action)
|
||||||
|
=> new(action, AsyncRelayCommandOptions.None);
|
||||||
|
public static AsyncRelayCommand CreateConcurrent(Func<Task> action)
|
||||||
|
=> new(action, AsyncRelayCommandOptions.AllowConcurrentExecutions);
|
||||||
|
public static AsyncRelayCommand CreateSilentFail(Func<Task> action)
|
||||||
|
=> new(action, AsyncRelayCommandOptions.FlowExceptionsToTaskScheduler);
|
||||||
|
|
||||||
|
public static AsyncRelayCommand<T> Create<T>(Func<T?, Task> action)
|
||||||
|
=> new(action, AsyncRelayCommandOptions.None);
|
||||||
|
public static AsyncRelayCommand<T> CreateConcurrent<T>(Func<T?, Task> action)
|
||||||
|
=> new(action, AsyncRelayCommandOptions.AllowConcurrentExecutions);
|
||||||
|
public static AsyncRelayCommand<T> CreateSilentFail<T>(Func<T?, Task> action)
|
||||||
|
=> new(action, AsyncRelayCommandOptions.FlowExceptionsToTaskScheduler);
|
||||||
|
|
||||||
|
public static AsyncRelayCommand CreateConditional(Func<Task> action, Func<bool> canExecute)
|
||||||
|
=> new(action, canExecute, AsyncRelayCommandOptions.None);
|
||||||
|
public static AsyncRelayCommand CreateConcurrentConditional(Func<Task> action, Func<bool> canExecute)
|
||||||
|
=> new(action, canExecute, AsyncRelayCommandOptions.AllowConcurrentExecutions);
|
||||||
|
public static AsyncRelayCommand CreateSilentFailConditional(Func<Task> action, Func<bool> canExecute)
|
||||||
|
=> new(action, canExecute, AsyncRelayCommandOptions.FlowExceptionsToTaskScheduler);
|
||||||
|
|
||||||
|
public static AsyncRelayCommand<T> CreateConditional<T>(Func<T?, Task> action, Predicate<T?> canExecute)
|
||||||
|
=> new(action, canExecute, AsyncRelayCommandOptions.None);
|
||||||
|
public static AsyncRelayCommand<T> CreateConcurrentConditional<T>(Func<T?, Task> action, Predicate<T?> canExecute)
|
||||||
|
=> new(action, canExecute, AsyncRelayCommandOptions.AllowConcurrentExecutions);
|
||||||
|
public static AsyncRelayCommand<T> CreateSilentFailConditional<T>(Func<T?, Task> action, Predicate<T?> canExecute)
|
||||||
|
=> new(action, canExecute, AsyncRelayCommandOptions.FlowExceptionsToTaskScheduler);
|
||||||
|
}
|
||||||
|
}
|
@@ -1,152 +1,53 @@
|
|||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using Ryujinx.Ava.UI.ViewModels;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
using Ryujinx.Common.Configuration.Hid;
|
using Ryujinx.Common.Configuration.Hid;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Models.Input
|
namespace Ryujinx.Ava.UI.Models.Input
|
||||||
{
|
{
|
||||||
public class HotkeyConfig : BaseModel
|
public partial class HotkeyConfig : BaseModel
|
||||||
{
|
{
|
||||||
private Key _toggleVSyncMode;
|
[ObservableProperty] private Key _toggleVSyncMode;
|
||||||
public Key ToggleVSyncMode
|
|
||||||
{
|
|
||||||
get => _toggleVSyncMode;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_toggleVSyncMode = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Key _screenshot;
|
[ObservableProperty] private Key _screenshot;
|
||||||
public Key Screenshot
|
|
||||||
{
|
|
||||||
get => _screenshot;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_screenshot = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Key _showUI;
|
[ObservableProperty] private Key _showUI;
|
||||||
public Key ShowUI
|
|
||||||
{
|
|
||||||
get => _showUI;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_showUI = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Key _pause;
|
[ObservableProperty] private Key _pause;
|
||||||
public Key Pause
|
|
||||||
{
|
|
||||||
get => _pause;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_pause = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Key _toggleMute;
|
[ObservableProperty] private Key _toggleMute;
|
||||||
public Key ToggleMute
|
|
||||||
{
|
|
||||||
get => _toggleMute;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_toggleMute = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Key _resScaleUp;
|
[ObservableProperty] private Key _resScaleUp;
|
||||||
public Key ResScaleUp
|
|
||||||
{
|
|
||||||
get => _resScaleUp;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_resScaleUp = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Key _resScaleDown;
|
[ObservableProperty] private Key _resScaleDown;
|
||||||
public Key ResScaleDown
|
|
||||||
{
|
|
||||||
get => _resScaleDown;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_resScaleDown = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Key _volumeUp;
|
[ObservableProperty] private Key _volumeUp;
|
||||||
public Key VolumeUp
|
|
||||||
{
|
|
||||||
get => _volumeUp;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_volumeUp = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Key _volumeDown;
|
[ObservableProperty] private Key _volumeDown;
|
||||||
public Key VolumeDown
|
|
||||||
{
|
|
||||||
get => _volumeDown;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_volumeDown = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Key _customVSyncIntervalIncrement;
|
[ObservableProperty] private Key _customVSyncIntervalIncrement;
|
||||||
public Key CustomVSyncIntervalIncrement
|
|
||||||
{
|
|
||||||
get => _customVSyncIntervalIncrement;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_customVSyncIntervalIncrement = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Key _customVSyncIntervalDecrement;
|
[ObservableProperty] private Key _customVSyncIntervalDecrement;
|
||||||
public Key CustomVSyncIntervalDecrement
|
|
||||||
{
|
|
||||||
get => _customVSyncIntervalDecrement;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_customVSyncIntervalDecrement = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public HotkeyConfig(KeyboardHotkeys config)
|
public HotkeyConfig(KeyboardHotkeys config)
|
||||||
{
|
{
|
||||||
if (config != null)
|
if (config == null)
|
||||||
{
|
return;
|
||||||
ToggleVSyncMode = config.ToggleVSyncMode;
|
|
||||||
Screenshot = config.Screenshot;
|
ToggleVSyncMode = config.ToggleVSyncMode;
|
||||||
ShowUI = config.ShowUI;
|
Screenshot = config.Screenshot;
|
||||||
Pause = config.Pause;
|
ShowUI = config.ShowUI;
|
||||||
ToggleMute = config.ToggleMute;
|
Pause = config.Pause;
|
||||||
ResScaleUp = config.ResScaleUp;
|
ToggleMute = config.ToggleMute;
|
||||||
ResScaleDown = config.ResScaleDown;
|
ResScaleUp = config.ResScaleUp;
|
||||||
VolumeUp = config.VolumeUp;
|
ResScaleDown = config.ResScaleDown;
|
||||||
VolumeDown = config.VolumeDown;
|
VolumeUp = config.VolumeUp;
|
||||||
CustomVSyncIntervalIncrement = config.CustomVSyncIntervalIncrement;
|
VolumeDown = config.VolumeDown;
|
||||||
CustomVSyncIntervalDecrement = config.CustomVSyncIntervalDecrement;
|
CustomVSyncIntervalIncrement = config.CustomVSyncIntervalIncrement;
|
||||||
}
|
CustomVSyncIntervalDecrement = config.CustomVSyncIntervalDecrement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeyboardHotkeys GetConfig()
|
public KeyboardHotkeys GetConfig() =>
|
||||||
{
|
new()
|
||||||
var config = new KeyboardHotkeys
|
|
||||||
{
|
{
|
||||||
ToggleVSyncMode = ToggleVSyncMode,
|
ToggleVSyncMode = ToggleVSyncMode,
|
||||||
Screenshot = Screenshot,
|
Screenshot = Screenshot,
|
||||||
@@ -160,8 +61,5 @@ namespace Ryujinx.Ava.UI.Models.Input
|
|||||||
CustomVSyncIntervalIncrement = CustomVSyncIntervalIncrement,
|
CustomVSyncIntervalIncrement = CustomVSyncIntervalIncrement,
|
||||||
CustomVSyncIntervalDecrement = CustomVSyncIntervalDecrement,
|
CustomVSyncIntervalDecrement = CustomVSyncIntervalDecrement,
|
||||||
};
|
};
|
||||||
|
|
||||||
return config;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -22,5 +22,22 @@ namespace Ryujinx.Ava.UI.Models
|
|||||||
FifoStatus = fifoStatus;
|
FifoStatus = fifoStatus;
|
||||||
ShaderCount = shaderCount;
|
ShaderCount = shaderCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
if (obj is not StatusUpdatedEventArgs suea) return false;
|
||||||
|
return
|
||||||
|
VSyncMode == suea.VSyncMode &&
|
||||||
|
VolumeStatus == suea.VolumeStatus &&
|
||||||
|
DockedMode == suea.DockedMode &&
|
||||||
|
AspectRatio == suea.AspectRatio &&
|
||||||
|
GameStatus == suea.GameStatus &&
|
||||||
|
FifoStatus == suea.FifoStatus &&
|
||||||
|
ShaderCount == suea.ShaderCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
=> HashCode.Combine(VSyncMode, VolumeStatus, AspectRatio, DockedMode, FifoStatus, GameStatus, ShaderCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
ThemeManager.ThemeChanged += ThemeManager_ThemeChanged;
|
ThemeManager.ThemeChanged += ThemeManager_ThemeChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ThemeManager_ThemeChanged(object sender, EventArgs e)
|
private void ThemeManager_ThemeChanged()
|
||||||
{
|
{
|
||||||
Dispatcher.UIThread.Post(() => UpdateLogoTheme(ConfigurationState.Instance.UI.BaseStyle.Value));
|
Dispatcher.UIThread.Post(() => UpdateLogoTheme(ConfigurationState.Instance.UI.BaseStyle.Value));
|
||||||
}
|
}
|
||||||
|
25
src/Ryujinx/UI/ViewModels/DlcSelectViewModel.cs
Normal file
25
src/Ryujinx/UI/ViewModels/DlcSelectViewModel.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using Ryujinx.Ava.Common.Models;
|
||||||
|
using Ryujinx.Ava.Utilities.AppLibrary;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
{
|
||||||
|
public partial class DlcSelectViewModel : BaseModel
|
||||||
|
{
|
||||||
|
[ObservableProperty] private DownloadableContentModel[] _dlcs;
|
||||||
|
#nullable enable
|
||||||
|
[ObservableProperty] private DownloadableContentModel? _selectedDlc;
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
public DlcSelectViewModel(ulong titleId, ApplicationLibrary appLibrary)
|
||||||
|
{
|
||||||
|
_dlcs = appLibrary.DownloadableContents.Items
|
||||||
|
.Where(x => x.Dlc.TitleIdBase == titleId)
|
||||||
|
.Select(x => x.Dlc)
|
||||||
|
.OrderBy(it => it.IsBundled ? 0 : 1)
|
||||||
|
.ThenBy(it => it.TitleId)
|
||||||
|
.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,21 +1,13 @@
|
|||||||
using Avalonia.Svg.Skia;
|
using Avalonia.Svg.Skia;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using Ryujinx.Ava.UI.Models.Input;
|
using Ryujinx.Ava.UI.Models.Input;
|
||||||
using Ryujinx.Ava.UI.Views.Input;
|
using Ryujinx.Ava.UI.Views.Input;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.ViewModels.Input
|
namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||||
{
|
{
|
||||||
public class ControllerInputViewModel : BaseModel
|
public partial class ControllerInputViewModel : BaseModel
|
||||||
{
|
{
|
||||||
private GamepadInputConfig _config;
|
[ObservableProperty] private GamepadInputConfig _config;
|
||||||
public GamepadInputConfig Config
|
|
||||||
{
|
|
||||||
get => _config;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_config = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool _isLeft;
|
private bool _isLeft;
|
||||||
public bool IsLeft
|
public bool IsLeft
|
||||||
@@ -43,16 +35,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
public bool HasSides => IsLeft ^ IsRight;
|
public bool HasSides => IsLeft ^ IsRight;
|
||||||
|
|
||||||
private SvgImage _image;
|
[ObservableProperty] private SvgImage _image;
|
||||||
public SvgImage Image
|
|
||||||
{
|
|
||||||
get => _image;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_image = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public readonly InputViewModel ParentModel;
|
public readonly InputViewModel ParentModel;
|
||||||
|
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Collections;
|
using Avalonia.Collections;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.ApplicationLifetimes;
|
|
||||||
using Avalonia.Svg.Skia;
|
using Avalonia.Svg.Skia;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.Input;
|
using Ryujinx.Ava.Input;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
@@ -32,7 +31,7 @@ using Key = Ryujinx.Common.Configuration.Hid.Key;
|
|||||||
|
|
||||||
namespace Ryujinx.Ava.UI.ViewModels.Input
|
namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||||
{
|
{
|
||||||
public class InputViewModel : BaseModel, IDisposable
|
public partial class InputViewModel : BaseModel, IDisposable
|
||||||
{
|
{
|
||||||
private const string Disabled = "disabled";
|
private const string Disabled = "disabled";
|
||||||
private const string ProControllerResource = "Ryujinx/Assets/Icons/Controller_ProCon.svg";
|
private const string ProControllerResource = "Ryujinx/Assets/Icons/Controller_ProCon.svg";
|
||||||
@@ -48,8 +47,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
private int _controller;
|
private int _controller;
|
||||||
private string _controllerImage;
|
private string _controllerImage;
|
||||||
private int _device;
|
private int _device;
|
||||||
private object _configViewModel;
|
[ObservableProperty] private object _configViewModel;
|
||||||
private string _profileName;
|
[ObservableProperty] private string _profileName;
|
||||||
private bool _isLoaded;
|
private bool _isLoaded;
|
||||||
|
|
||||||
private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
||||||
@@ -73,17 +72,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
public bool IsModified { get; set; }
|
public bool IsModified { get; set; }
|
||||||
public event Action NotifyChangesEvent;
|
public event Action NotifyChangesEvent;
|
||||||
|
|
||||||
public object ConfigViewModel
|
|
||||||
{
|
|
||||||
get => _configViewModel;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_configViewModel = value;
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public PlayerIndex PlayerIdChoose
|
public PlayerIndex PlayerIdChoose
|
||||||
{
|
{
|
||||||
get => _playerIdChoose;
|
get => _playerIdChoose;
|
||||||
@@ -200,16 +188,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ProfileName
|
|
||||||
{
|
|
||||||
get => _profileName; set
|
|
||||||
{
|
|
||||||
_profileName = value;
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Device
|
public int Device
|
||||||
{
|
{
|
||||||
get => _device;
|
get => _device;
|
||||||
|
@@ -1,20 +1,12 @@
|
|||||||
using Avalonia.Svg.Skia;
|
using Avalonia.Svg.Skia;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using Ryujinx.Ava.UI.Models.Input;
|
using Ryujinx.Ava.UI.Models.Input;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.ViewModels.Input
|
namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||||
{
|
{
|
||||||
public class KeyboardInputViewModel : BaseModel
|
public partial class KeyboardInputViewModel : BaseModel
|
||||||
{
|
{
|
||||||
private KeyboardInputConfig _config;
|
[ObservableProperty] private KeyboardInputConfig _config;
|
||||||
public KeyboardInputConfig Config
|
|
||||||
{
|
|
||||||
get => _config;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_config = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool _isLeft;
|
private bool _isLeft;
|
||||||
public bool IsLeft
|
public bool IsLeft
|
||||||
@@ -42,16 +34,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
public bool HasSides => IsLeft ^ IsRight;
|
public bool HasSides => IsLeft ^ IsRight;
|
||||||
|
|
||||||
private SvgImage _image;
|
[ObservableProperty] private SvgImage _image;
|
||||||
public SvgImage Image
|
|
||||||
{
|
|
||||||
get => _image;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_image = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public readonly InputViewModel ParentModel;
|
public readonly InputViewModel ParentModel;
|
||||||
|
|
||||||
|
@@ -1,93 +1,23 @@
|
|||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.ViewModels.Input
|
namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||||
{
|
{
|
||||||
public class MotionInputViewModel : BaseModel
|
public partial class MotionInputViewModel : BaseModel
|
||||||
{
|
{
|
||||||
private int _slot;
|
[ObservableProperty] private int _slot;
|
||||||
public int Slot
|
|
||||||
{
|
|
||||||
get => _slot;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_slot = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int _altSlot;
|
[ObservableProperty] private int _altSlot;
|
||||||
public int AltSlot
|
|
||||||
{
|
|
||||||
get => _altSlot;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_altSlot = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private string _dsuServerHost;
|
[ObservableProperty] private string _dsuServerHost;
|
||||||
public string DsuServerHost
|
|
||||||
{
|
|
||||||
get => _dsuServerHost;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_dsuServerHost = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int _dsuServerPort;
|
[ObservableProperty] private int _dsuServerPort;
|
||||||
public int DsuServerPort
|
|
||||||
{
|
|
||||||
get => _dsuServerPort;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_dsuServerPort = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool _mirrorInput;
|
[ObservableProperty] private bool _mirrorInput;
|
||||||
public bool MirrorInput
|
|
||||||
{
|
|
||||||
get => _mirrorInput;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_mirrorInput = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int _sensitivity;
|
[ObservableProperty] private int _sensitivity;
|
||||||
public int Sensitivity
|
|
||||||
{
|
|
||||||
get => _sensitivity;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_sensitivity = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private double _gryoDeadzone;
|
[ObservableProperty] private double _gyroDeadzone;
|
||||||
public double GyroDeadzone
|
|
||||||
{
|
|
||||||
get => _gryoDeadzone;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_gryoDeadzone = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool _enableCemuHookMotion;
|
[ObservableProperty] private bool _enableCemuHookMotion;
|
||||||
public bool EnableCemuHookMotion
|
|
||||||
{
|
|
||||||
get => _enableCemuHookMotion;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_enableCemuHookMotion = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,27 +1,11 @@
|
|||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.ViewModels.Input
|
namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||||
{
|
{
|
||||||
public class RumbleInputViewModel : BaseModel
|
public partial class RumbleInputViewModel : BaseModel
|
||||||
{
|
{
|
||||||
private float _strongRumble;
|
[ObservableProperty] private float _strongRumble;
|
||||||
public float StrongRumble
|
|
||||||
{
|
|
||||||
get => _strongRumble;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_strongRumble = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private float _weakRumble;
|
[ObservableProperty] private float _weakRumble;
|
||||||
public float WeakRumble
|
|
||||||
{
|
|
||||||
get => _weakRumble;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_weakRumble = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,6 @@ using Ryujinx.HLE.HOS.Services.Account.Acc;
|
|||||||
using Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption;
|
using Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption;
|
||||||
using Ryujinx.HLE.UI;
|
using Ryujinx.HLE.UI;
|
||||||
using Ryujinx.Input.HLE;
|
using Ryujinx.Input.HLE;
|
||||||
using Silk.NET.Vulkan;
|
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -489,6 +488,19 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool StartGamesWithoutUI
|
||||||
|
{
|
||||||
|
get => ConfigurationState.Instance.UI.StartNoUI;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ConfigurationState.Instance.UI.StartNoUI.Value = value;
|
||||||
|
|
||||||
|
ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath);
|
||||||
|
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool ShowConsole
|
public bool ShowConsole
|
||||||
{
|
{
|
||||||
get => ConfigurationState.Instance.UI.ShowConsole;
|
get => ConfigurationState.Instance.UI.ShowConsole;
|
||||||
@@ -625,6 +637,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
ApplicationSort.FileSize => LocaleManager.Instance[LocaleKeys.GameListHeaderFileSize],
|
ApplicationSort.FileSize => LocaleManager.Instance[LocaleKeys.GameListHeaderFileSize],
|
||||||
ApplicationSort.Path => LocaleManager.Instance[LocaleKeys.GameListHeaderPath],
|
ApplicationSort.Path => LocaleManager.Instance[LocaleKeys.GameListHeaderPath],
|
||||||
ApplicationSort.Favorite => LocaleManager.Instance[LocaleKeys.CommonFavorite],
|
ApplicationSort.Favorite => LocaleManager.Instance[LocaleKeys.CommonFavorite],
|
||||||
|
ApplicationSort.TitleId => LocaleManager.Instance[LocaleKeys.DlcManagerTableHeadingTitleIdLabel],
|
||||||
_ => string.Empty,
|
_ => string.Empty,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -695,6 +708,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
public IHostUIHandler UiHandler { get; internal set; }
|
public IHostUIHandler UiHandler { get; internal set; }
|
||||||
public bool IsSortedByFavorite => SortMode == ApplicationSort.Favorite;
|
public bool IsSortedByFavorite => SortMode == ApplicationSort.Favorite;
|
||||||
public bool IsSortedByTitle => SortMode == ApplicationSort.Title;
|
public bool IsSortedByTitle => SortMode == ApplicationSort.Title;
|
||||||
|
public bool IsSortedByTitleId => SortMode == ApplicationSort.TitleId;
|
||||||
public bool IsSortedByDeveloper => SortMode == ApplicationSort.Developer;
|
public bool IsSortedByDeveloper => SortMode == ApplicationSort.Developer;
|
||||||
public bool IsSortedByLastPlayed => SortMode == ApplicationSort.LastPlayed;
|
public bool IsSortedByLastPlayed => SortMode == ApplicationSort.LastPlayed;
|
||||||
public bool IsSortedByTimePlayed => SortMode == ApplicationSort.TotalTimePlayed;
|
public bool IsSortedByTimePlayed => SortMode == ApplicationSort.TotalTimePlayed;
|
||||||
@@ -727,6 +741,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
ApplicationSort.FileSize => CreateComparer(IsAscending, app => app.FileSize),
|
ApplicationSort.FileSize => CreateComparer(IsAscending, app => app.FileSize),
|
||||||
ApplicationSort.Path => CreateComparer(IsAscending, app => app.Path),
|
ApplicationSort.Path => CreateComparer(IsAscending, app => app.Path),
|
||||||
ApplicationSort.Favorite => CreateComparer(IsAscending, app => new AppListFavoriteComparable(app)),
|
ApplicationSort.Favorite => CreateComparer(IsAscending, app => new AppListFavoriteComparable(app)),
|
||||||
|
ApplicationSort.TitleId => CreateComparer(IsAscending, app => app.Id),
|
||||||
_ => null,
|
_ => null,
|
||||||
#pragma warning restore IDE0055
|
#pragma warning restore IDE0055
|
||||||
};
|
};
|
||||||
@@ -1196,6 +1211,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
StartGamesInFullscreen = !StartGamesInFullscreen;
|
StartGamesInFullscreen = !StartGamesInFullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ToggleStartGamesWithoutUI()
|
||||||
|
{
|
||||||
|
StartGamesWithoutUI = !StartGamesWithoutUI;
|
||||||
|
}
|
||||||
|
|
||||||
public void ToggleShowConsole()
|
public void ToggleShowConsole()
|
||||||
{
|
{
|
||||||
ShowConsole = !ShowConsole;
|
ShowConsole = !ShowConsole;
|
||||||
@@ -1642,10 +1662,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
public async Task OpenAmiiboWindow()
|
public async Task OpenAmiiboWindow()
|
||||||
{
|
{
|
||||||
if (!IsAmiiboRequested)
|
if (AppHost.Device.System.SearchingForAmiibo(out int deviceId) && IsGameRunning)
|
||||||
return;
|
|
||||||
|
|
||||||
if (AppHost.Device.System.SearchingForAmiibo(out int deviceId))
|
|
||||||
{
|
{
|
||||||
string titleId = AppHost.Device.Processes.ActiveApplication.ProgramIdText.ToUpper();
|
string titleId = AppHost.Device.Processes.ActiveApplication.ProgramIdText.ToUpper();
|
||||||
AmiiboWindow window = new(ShowAll, LastScannedAmiiboId, titleId);
|
AmiiboWindow window = new(ShowAll, LastScannedAmiiboId, titleId);
|
||||||
@@ -1663,10 +1680,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
}
|
}
|
||||||
public async Task OpenBinFile()
|
public async Task OpenBinFile()
|
||||||
{
|
{
|
||||||
if (!IsAmiiboRequested)
|
if (AppHost.Device.System.SearchingForAmiibo(out _) && IsGameRunning)
|
||||||
return;
|
|
||||||
|
|
||||||
if (AppHost.Device.System.SearchingForAmiibo(out int deviceId))
|
|
||||||
{
|
{
|
||||||
var result = await StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
var result = await StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||||
{
|
{
|
||||||
|
14
src/Ryujinx/UI/ViewModels/UserSelectorDialogViewModel.cs
Normal file
14
src/Ryujinx/UI/ViewModels/UserSelectorDialogViewModel.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
{
|
||||||
|
public partial class UserSelectorDialogViewModel : BaseModel
|
||||||
|
{
|
||||||
|
|
||||||
|
[ObservableProperty] private UserId _selectedUserId;
|
||||||
|
|
||||||
|
[ObservableProperty] private ObservableCollection<BaseModel> _profiles = [];
|
||||||
|
}
|
||||||
|
}
|
@@ -81,25 +81,16 @@
|
|||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding ToggleFullscreen}"
|
Command="{Binding ToggleFullscreen}"
|
||||||
Header="{ext:Locale MenuBarOptionsToggleFullscreen}"
|
Header="{ext:Locale MenuBarOptionsToggleFullscreen}"
|
||||||
|
Classes="withCheckbox"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
Icon="{ext:Icon fa-solid fa-expand}"
|
Icon="{ext:Icon fa-solid fa-expand}"
|
||||||
InputGesture="F11">
|
InputGesture="F11">
|
||||||
<MenuItem.Styles>
|
|
||||||
<Style Selector="Viewbox#PART_IconPresenter">
|
|
||||||
<Setter Property="MaxHeight" Value="36" />
|
|
||||||
<Setter Property="MinHeight" Value="36" />
|
|
||||||
<Setter Property="MaxWidth" Value="36" />
|
|
||||||
<Setter Property="MinWidth" Value="36" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="ContentPresenter#PART_HeaderPresenter">
|
|
||||||
<Setter Property="Padding" Value="-10,0,0,0" />
|
|
||||||
</Style>
|
|
||||||
</MenuItem.Styles>
|
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Padding="0"
|
Padding="0"
|
||||||
Command="{Binding ToggleStartGamesInFullscreen}"
|
Command="{Binding ToggleStartGamesInFullscreen}"
|
||||||
Header="{ext:Locale MenuBarOptionsStartGamesInFullscreen}">
|
Header="{ext:Locale MenuBarOptionsStartGamesInFullscreen}"
|
||||||
|
Classes="withCheckbox">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<CheckBox
|
<CheckBox
|
||||||
MinWidth="{DynamicResource CheckBoxSize}"
|
MinWidth="{DynamicResource CheckBoxSize}"
|
||||||
@@ -107,23 +98,26 @@
|
|||||||
IsChecked="{Binding StartGamesInFullscreen, Mode=TwoWay}"
|
IsChecked="{Binding StartGamesInFullscreen, Mode=TwoWay}"
|
||||||
Padding="0" />
|
Padding="0" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
<MenuItem.Styles>
|
</MenuItem>
|
||||||
<Style Selector="Viewbox#PART_IconPresenter">
|
<MenuItem
|
||||||
<Setter Property="MaxHeight" Value="36" />
|
Padding="0"
|
||||||
<Setter Property="MinHeight" Value="36" />
|
Command="{Binding ToggleStartGamesWithoutUI}"
|
||||||
<Setter Property="MaxWidth" Value="36" />
|
Header="{ext:Locale MenuBarOptionsStartGamesWithoutUI}"
|
||||||
<Setter Property="MinWidth" Value="36" />
|
Classes="withCheckbox">
|
||||||
</Style>
|
<MenuItem.Icon>
|
||||||
<Style Selector="ContentPresenter#PART_HeaderPresenter">
|
<CheckBox
|
||||||
<Setter Property="Padding" Value="-10,0,0,0" />
|
MinWidth="{DynamicResource CheckBoxSize}"
|
||||||
</Style>
|
MinHeight="{DynamicResource CheckBoxSize}"
|
||||||
</MenuItem.Styles>
|
IsChecked="{Binding StartGamesWithoutUI, Mode=TwoWay}"
|
||||||
|
Padding="0" />
|
||||||
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Padding="0"
|
Padding="0"
|
||||||
IsVisible="{Binding ShowConsoleVisible}"
|
IsVisible="{Binding ShowConsoleVisible}"
|
||||||
Command="{Binding ToggleShowConsole}"
|
Command="{Binding ToggleShowConsole}"
|
||||||
Header="{ext:Locale MenuBarOptionsShowConsole}">
|
Header="{ext:Locale MenuBarOptionsShowConsole}"
|
||||||
|
Classes="withCheckbox">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<CheckBox
|
<CheckBox
|
||||||
MinWidth="{DynamicResource CheckBoxSize}"
|
MinWidth="{DynamicResource CheckBoxSize}"
|
||||||
@@ -131,35 +125,14 @@
|
|||||||
IsChecked="{Binding ShowConsole, Mode=TwoWay}"
|
IsChecked="{Binding ShowConsole, Mode=TwoWay}"
|
||||||
Padding="0" />
|
Padding="0" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
<MenuItem.Styles>
|
|
||||||
<Style Selector="Viewbox#PART_IconPresenter">
|
|
||||||
<Setter Property="MaxHeight" Value="36" />
|
|
||||||
<Setter Property="MinHeight" Value="36" />
|
|
||||||
<Setter Property="MaxWidth" Value="36" />
|
|
||||||
<Setter Property="MinWidth" Value="36" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="ContentPresenter#PART_HeaderPresenter">
|
|
||||||
<Setter Property="Padding" Value="-10,0,0,0" />
|
|
||||||
</Style>
|
|
||||||
</MenuItem.Styles>
|
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<Separator/>
|
<Separator/>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Name="ChangeLanguageMenuItem"
|
Name="ChangeLanguageMenuItem"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
Header="{ext:Locale MenuBarOptionsChangeLanguage}"
|
Header="{ext:Locale MenuBarOptionsChangeLanguage}"
|
||||||
Icon="{ext:Icon fa-solid fa-language}">
|
Icon="{ext:Icon fa-solid fa-language}"
|
||||||
<MenuItem.Styles>
|
Classes="withCheckbox">
|
||||||
<Style Selector="Viewbox#PART_IconPresenter">
|
|
||||||
<Setter Property="MaxHeight" Value="36" />
|
|
||||||
<Setter Property="MinHeight" Value="36" />
|
|
||||||
<Setter Property="MaxWidth" Value="36" />
|
|
||||||
<Setter Property="MinWidth" Value="36" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="ContentPresenter#PART_HeaderPresenter">
|
|
||||||
<Setter Property="Padding" Value="-10,0,0,0" />
|
|
||||||
</Style>
|
|
||||||
</MenuItem.Styles>
|
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Name="ToggleFileTypesMenuItem"
|
Name="ToggleFileTypesMenuItem"
|
||||||
@@ -171,18 +144,8 @@
|
|||||||
Padding="0"
|
Padding="0"
|
||||||
Header="{ext:Locale MenuBarOptionsSettings}"
|
Header="{ext:Locale MenuBarOptionsSettings}"
|
||||||
Icon="{ext:Icon fa-solid fa-gear}"
|
Icon="{ext:Icon fa-solid fa-gear}"
|
||||||
ToolTip.Tip="{ext:Locale OpenSettingsTooltip}">
|
ToolTip.Tip="{ext:Locale OpenSettingsTooltip}"
|
||||||
<MenuItem.Styles>
|
Classes="withCheckbox">
|
||||||
<Style Selector="Viewbox#PART_IconPresenter">
|
|
||||||
<Setter Property="MaxHeight" Value="36" />
|
|
||||||
<Setter Property="MinHeight" Value="36" />
|
|
||||||
<Setter Property="MaxWidth" Value="36" />
|
|
||||||
<Setter Property="MinWidth" Value="36" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="ContentPresenter#PART_HeaderPresenter">
|
|
||||||
<Setter Property="Padding" Value="-10,0,0,0" />
|
|
||||||
</Style>
|
|
||||||
</MenuItem.Styles>
|
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding ManageProfiles}"
|
Command="{Binding ManageProfiles}"
|
||||||
@@ -190,25 +153,15 @@
|
|||||||
Header="{ext:Locale MenuBarOptionsManageUserProfiles}"
|
Header="{ext:Locale MenuBarOptionsManageUserProfiles}"
|
||||||
Icon="{ext:Icon mdi-account}"
|
Icon="{ext:Icon mdi-account}"
|
||||||
IsEnabled="{Binding EnableNonGameRunningControls}"
|
IsEnabled="{Binding EnableNonGameRunningControls}"
|
||||||
ToolTip.Tip="{ext:Locale OpenProfileManagerTooltip}">
|
ToolTip.Tip="{ext:Locale OpenProfileManagerTooltip}"
|
||||||
<MenuItem.Styles>
|
Classes="withCheckbox">
|
||||||
<Style Selector="Viewbox#PART_IconPresenter">
|
|
||||||
<Setter Property="MaxHeight" Value="36" />
|
|
||||||
<Setter Property="MinHeight" Value="36" />
|
|
||||||
<Setter Property="MaxWidth" Value="36" />
|
|
||||||
<Setter Property="MinWidth" Value="36" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="ContentPresenter#PART_HeaderPresenter">
|
|
||||||
<Setter Property="Padding" Value="-10,0,0,0" />
|
|
||||||
</Style>
|
|
||||||
</MenuItem.Styles>
|
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Name="ActionsMenuItem"
|
Name="ActionsMenuItem"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Header="{ext:Locale MenuBarActions}"
|
Header="{ext:Locale MenuBarActions}"
|
||||||
IsEnabled="{Binding IsGameRunning}">
|
IsVisible="{Binding !EnableNonGameRunningControls}">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Name="PauseEmulationMenuItem"
|
Name="PauseEmulationMenuItem"
|
||||||
Header="{ext:Locale MenuBarOptionsPauseEmulation}"
|
Header="{ext:Locale MenuBarOptionsPauseEmulation}"
|
||||||
@@ -265,21 +218,21 @@
|
|||||||
Icon="{ext:Icon fa-solid fa-code}"
|
Icon="{ext:Icon fa-solid fa-code}"
|
||||||
IsEnabled="{Binding IsGameRunning}" />
|
IsEnabled="{Binding IsGameRunning}" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarTools}">
|
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarActions}" IsVisible="{Binding EnableNonGameRunningControls}">
|
||||||
<MenuItem Header="{ext:Locale MenuBarToolsInstallKeys}" Icon="{ext:Icon fa-solid fa-key}" IsEnabled="{Binding EnableNonGameRunningControls}">
|
<MenuItem Header="{ext:Locale MenuBarActionsInstallKeys}" Icon="{ext:Icon fa-solid fa-key}">
|
||||||
<MenuItem Command="{Binding InstallKeysFromFile}" Header="{ext:Locale MenuBarFileToolsInstallKeysFromFile}" Icon="{ext:Icon mdi-file-cog}" />
|
<MenuItem Command="{Binding InstallKeysFromFile}" Header="{ext:Locale MenuBarFileActionsInstallKeysFromFile}" Icon="{ext:Icon mdi-file-cog}" />
|
||||||
<MenuItem Command="{Binding InstallKeysFromFolder}" Header="{ext:Locale MenuBarFileToolsInstallKeysFromFolder}" Icon="{ext:Icon mdi-folder-cog}" />
|
<MenuItem Command="{Binding InstallKeysFromFolder}" Header="{ext:Locale MenuBarFileActionsInstallKeysFromFolder}" Icon="{ext:Icon mdi-folder-cog}" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="{ext:Locale MenuBarToolsInstallFirmware}" Icon="{ext:Icon fa-solid fa-download}" IsEnabled="{Binding EnableNonGameRunningControls}">
|
<MenuItem Header="{ext:Locale MenuBarActionsInstallFirmware}" Icon="{ext:Icon fa-solid fa-download}">
|
||||||
<MenuItem Command="{Binding InstallFirmwareFromFile}" Header="{ext:Locale MenuBarFileToolsInstallFirmwareFromFile}" Icon="{ext:Icon mdi-file-cog}" />
|
<MenuItem Command="{Binding InstallFirmwareFromFile}" Header="{ext:Locale MenuBarActionsInstallFirmwareFromFile}" Icon="{ext:Icon mdi-file-cog}" />
|
||||||
<MenuItem Command="{Binding InstallFirmwareFromFolder}" Header="{ext:Locale MenuBarFileToolsInstallFirmwareFromDirectory}" Icon="{ext:Icon mdi-folder-cog}" />
|
<MenuItem Command="{Binding InstallFirmwareFromFolder}" Header="{ext:Locale MenuBarActionsInstallFirmwareFromDirectory}" Icon="{ext:Icon mdi-folder-cog}" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="{ext:Locale MenuBarToolsManageFileTypes}" IsVisible="{Binding ManageFileTypesVisible}">
|
<MenuItem Header="{ext:Locale MenuBarActionsManageFileTypes}" IsVisible="{Binding ManageFileTypesVisible}">
|
||||||
<MenuItem Name="InstallFileTypesMenuItem" Header="{ext:Locale MenuBarToolsInstallFileTypes}" IsEnabled="{Binding AreMimeTypesRegistered, Converter={x:Static BoolConverters.Not}}" />
|
<MenuItem Name="InstallFileTypesMenuItem" Header="{ext:Locale MenuBarActionsInstallFileTypes}" IsEnabled="{Binding AreMimeTypesRegistered, Converter={x:Static BoolConverters.Not}}" />
|
||||||
<MenuItem Name="UninstallFileTypesMenuItem" Header="{ext:Locale MenuBarToolsUninstallFileTypes}" IsEnabled="{Binding AreMimeTypesRegistered}" />
|
<MenuItem Name="UninstallFileTypesMenuItem" Header="{ext:Locale MenuBarActionsUninstallFileTypes}" IsEnabled="{Binding AreMimeTypesRegistered}" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem Name="XciTrimmerMenuItem" Header="{ext:Locale MenuBarToolsXCITrimmer}" IsEnabled="{Binding EnableNonGameRunningControls}" Icon="{ext:Icon fa-solid fa-scissors}" />
|
<MenuItem Name="XciTrimmerMenuItem" Header="{ext:Locale MenuBarActionsXCITrimmer}" Icon="{ext:Icon fa-solid fa-scissors}" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarView}">
|
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarView}">
|
||||||
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarViewWindow}">
|
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarViewWindow}">
|
||||||
|
@@ -37,20 +37,20 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
ToggleFileTypesMenuItem.ItemsSource = GenerateToggleFileTypeItems();
|
ToggleFileTypesMenuItem.ItemsSource = GenerateToggleFileTypeItems();
|
||||||
ChangeLanguageMenuItem.ItemsSource = GenerateLanguageMenuItems();
|
ChangeLanguageMenuItem.ItemsSource = GenerateLanguageMenuItems();
|
||||||
|
|
||||||
MiiAppletMenuItem.Command = new AsyncRelayCommand(OpenMiiApplet);
|
MiiAppletMenuItem.Command = Commands.Create(OpenMiiApplet);
|
||||||
CloseRyujinxMenuItem.Command = new RelayCommand(CloseWindow);
|
CloseRyujinxMenuItem.Command = Commands.Create(CloseWindow);
|
||||||
OpenSettingsMenuItem.Command = new AsyncRelayCommand(OpenSettings);
|
OpenSettingsMenuItem.Command = Commands.Create(OpenSettings);
|
||||||
PauseEmulationMenuItem.Command = new RelayCommand(() => ViewModel.AppHost?.Pause());
|
PauseEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.Pause());
|
||||||
ResumeEmulationMenuItem.Command = new RelayCommand(() => ViewModel.AppHost?.Resume());
|
ResumeEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.Resume());
|
||||||
StopEmulationMenuItem.Command = new AsyncRelayCommand(() => ViewModel.AppHost?.ShowExitPrompt().OrCompleted());
|
StopEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.ShowExitPrompt().OrCompleted());
|
||||||
CheatManagerMenuItem.Command = new AsyncRelayCommand(OpenCheatManagerForCurrentApp);
|
CheatManagerMenuItem.Command = Commands.CreateSilentFail(OpenCheatManagerForCurrentApp);
|
||||||
InstallFileTypesMenuItem.Command = new AsyncRelayCommand(InstallFileTypes);
|
InstallFileTypesMenuItem.Command = Commands.Create(InstallFileTypes);
|
||||||
UninstallFileTypesMenuItem.Command = new AsyncRelayCommand(UninstallFileTypes);
|
UninstallFileTypesMenuItem.Command = Commands.Create(UninstallFileTypes);
|
||||||
XciTrimmerMenuItem.Command = new AsyncRelayCommand(() => XCITrimmerWindow.Show(ViewModel));
|
XciTrimmerMenuItem.Command = Commands.Create(XCITrimmerWindow.Show);
|
||||||
AboutWindowMenuItem.Command = new AsyncRelayCommand(AboutWindow.Show);
|
AboutWindowMenuItem.Command = Commands.Create(AboutWindow.Show);
|
||||||
CompatibilityListMenuItem.Command = new AsyncRelayCommand(CompatibilityList.Show);
|
CompatibilityListMenuItem.Command = Commands.Create(CompatibilityList.Show);
|
||||||
|
|
||||||
UpdateMenuItem.Command = new AsyncRelayCommand(async () =>
|
UpdateMenuItem.Command = Commands.Create(async () =>
|
||||||
{
|
{
|
||||||
if (Updater.CanUpdate(true))
|
if (Updater.CanUpdate(true))
|
||||||
await Updater.BeginUpdateAsync(true);
|
await Updater.BeginUpdateAsync(true);
|
||||||
@@ -58,12 +58,12 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
|
|
||||||
FaqMenuItem.Command =
|
FaqMenuItem.Command =
|
||||||
SetupGuideMenuItem.Command =
|
SetupGuideMenuItem.Command =
|
||||||
LdnGuideMenuItem.Command = new RelayCommand<string>(OpenHelper.OpenUrl);
|
LdnGuideMenuItem.Command = Commands.Create<string>(OpenHelper.OpenUrl);
|
||||||
|
|
||||||
WindowSize720PMenuItem.Command =
|
WindowSize720PMenuItem.Command =
|
||||||
WindowSize1080PMenuItem.Command =
|
WindowSize1080PMenuItem.Command =
|
||||||
WindowSize1440PMenuItem.Command =
|
WindowSize1440PMenuItem.Command =
|
||||||
WindowSize2160PMenuItem.Command = new RelayCommand<string>(ChangeWindowSize);
|
WindowSize2160PMenuItem.Command = Commands.Create<string>(ChangeWindowSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<CheckBox> GenerateToggleFileTypeItems() =>
|
private IEnumerable<CheckBox> GenerateToggleFileTypeItems() =>
|
||||||
@@ -138,14 +138,14 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
ViewModel.LoadConfigurableHotKeys();
|
ViewModel.LoadConfigurableHotKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readonly AppletMetadata MiiApplet = new("miiEdit", 0x0100000000001009);
|
public AppletMetadata MiiApplet => new(ViewModel.ContentManager, "miiEdit", 0x0100000000001009);
|
||||||
|
|
||||||
public async Task OpenMiiApplet()
|
public async Task OpenMiiApplet()
|
||||||
{
|
{
|
||||||
if (MiiApplet.CanStart(ViewModel.ContentManager, out var appData, out var nacpData))
|
if (!MiiApplet.CanStart(out var appData, out var nacpData))
|
||||||
{
|
return;
|
||||||
await ViewModel.LoadApplication(appData, ViewModel.IsFullScreen || ViewModel.StartGamesInFullscreen, nacpData);
|
|
||||||
}
|
await ViewModel.LoadApplication(appData, ViewModel.IsFullScreen || ViewModel.StartGamesInFullscreen, nacpData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task OpenCheatManagerForCurrentApp()
|
public async Task OpenCheatManagerForCurrentApp()
|
||||||
|
@@ -105,6 +105,12 @@
|
|||||||
GroupName="Sort"
|
GroupName="Sort"
|
||||||
IsChecked="{Binding IsSortedByTitle, Mode=OneTime}"
|
IsChecked="{Binding IsSortedByTitle, Mode=OneTime}"
|
||||||
Tag="Title" />
|
Tag="Title" />
|
||||||
|
<RadioButton
|
||||||
|
Checked="Sort_Checked"
|
||||||
|
Content="{ext:Locale DlcManagerTableHeadingTitleIdLabel}"
|
||||||
|
GroupName="Sort"
|
||||||
|
IsChecked="{Binding IsSortedByTitleId, Mode=OneTime}"
|
||||||
|
Tag="TitleId" />
|
||||||
<RadioButton
|
<RadioButton
|
||||||
Checked="Sort_Checked"
|
Checked="Sort_Checked"
|
||||||
Content="{ext:Locale GameListHeaderDeveloper}"
|
Content="{ext:Locale GameListHeaderDeveloper}"
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
<TextBlock
|
<TextBlock
|
||||||
Foreground="{DynamicResource SecondaryTextColor}"
|
Foreground="{DynamicResource SecondaryTextColor}"
|
||||||
TextDecorations="Underline"
|
TextDecorations="Underline"
|
||||||
Text="Game-specific hacks & tricks to alleviate performance issues or crashing. Will cause issues." />
|
Text="Highly specific hacks & tricks to alleviate performance issues, crashing, or freezing. Will cause issues." />
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Margin="0,10,0,0"
|
Margin="0,10,0,0"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
|
@@ -136,6 +136,12 @@
|
|||||||
<ComboBoxItem>
|
<ComboBoxItem>
|
||||||
<TextBlock Text="{ext:Locale SettingsTabSystemSystemLanguageBrazilianPortuguese}" />
|
<TextBlock Text="{ext:Locale SettingsTabSystemSystemLanguageBrazilianPortuguese}" />
|
||||||
</ComboBoxItem>
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabSystemSystemLanguageSwedish}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabSystemSystemLanguageNorwegian}" />
|
||||||
|
</ComboBoxItem>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
|
@@ -114,8 +114,7 @@
|
|||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
MinWidth="90"
|
MinWidth="90"
|
||||||
Margin="10,0,0,0"
|
Margin="10,0,0,0"
|
||||||
ToolTip.Tip="{ext:Locale AddGameDirTooltip}"
|
ToolTip.Tip="{ext:Locale AddGameDirTooltip}">
|
||||||
Click="AddGameDirButton_OnClick">
|
|
||||||
<TextBlock HorizontalAlignment="Center"
|
<TextBlock HorizontalAlignment="Center"
|
||||||
Text="{ext:Locale SettingsTabGeneralAdd}" />
|
Text="{ext:Locale SettingsTabGeneralAdd}" />
|
||||||
</Button>
|
</Button>
|
||||||
@@ -168,8 +167,7 @@
|
|||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
MinWidth="90"
|
MinWidth="90"
|
||||||
Margin="10,0,0,0"
|
Margin="10,0,0,0"
|
||||||
ToolTip.Tip="{ext:Locale AddAutoloadDirTooltip}"
|
ToolTip.Tip="{ext:Locale AddAutoloadDirTooltip}">
|
||||||
Click="AddAutoloadDirButton_OnClick">
|
|
||||||
<TextBlock HorizontalAlignment="Center"
|
<TextBlock HorizontalAlignment="Center"
|
||||||
Text="{ext:Locale SettingsTabGeneralAdd}" />
|
Text="{ext:Locale SettingsTabGeneralAdd}" />
|
||||||
</Button>
|
</Button>
|
||||||
|
@@ -1,12 +1,17 @@
|
|||||||
|
using Avalonia.Collections;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Platform.Storage;
|
using Avalonia.Platform.Storage;
|
||||||
using Avalonia.VisualTree;
|
using Avalonia.VisualTree;
|
||||||
|
using Gommon;
|
||||||
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.ViewModels;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
|
using Ryujinx.Ava.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Views.Settings
|
namespace Ryujinx.Ava.UI.Views.Settings
|
||||||
{
|
{
|
||||||
@@ -18,31 +23,39 @@ namespace Ryujinx.Ava.UI.Views.Settings
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
ShowTitleBarBox.IsVisible = OperatingSystem.IsWindows();
|
ShowTitleBarBox.IsVisible = OperatingSystem.IsWindows();
|
||||||
|
AddGameDirButton.Command =
|
||||||
|
Commands.Create(() => AddDirButton(GameDirPathBox, ViewModel.GameDirectories, true));
|
||||||
|
AddAutoloadDirButton.Command =
|
||||||
|
Commands.Create(() => AddDirButton(AutoloadDirPathBox, ViewModel.AutoloadDirectories, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void AddGameDirButton_OnClick(object sender, RoutedEventArgs e)
|
private async Task AddDirButton(TextBox addDirBox, AvaloniaList<string> directories, bool isGameList)
|
||||||
{
|
{
|
||||||
string path = GameDirPathBox.Text;
|
string path = addDirBox.Text;
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(path) && Directory.Exists(path) && !ViewModel.GameDirectories.Contains(path))
|
if (!string.IsNullOrWhiteSpace(path) && Directory.Exists(path) && !directories.Contains(path))
|
||||||
{
|
{
|
||||||
ViewModel.GameDirectories.Add(path);
|
directories.Add(path);
|
||||||
ViewModel.GameDirectoryChanged = true;
|
|
||||||
|
addDirBox.Clear();
|
||||||
|
|
||||||
|
if (isGameList)
|
||||||
|
ViewModel.GameDirectoryChanged = true;
|
||||||
|
else
|
||||||
|
ViewModel.AutoloadDirectoryChanged = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (this.GetVisualRoot() is Window window)
|
Optional<IStorageFolder> folder = await RyujinxApp.MainWindow.ViewModel.StorageProvider.OpenSingleFolderPickerAsync();
|
||||||
{
|
|
||||||
var result = await window.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
|
||||||
{
|
|
||||||
AllowMultiple = false,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (result.Count > 0)
|
if (folder.HasValue)
|
||||||
{
|
{
|
||||||
ViewModel.GameDirectories.Add(result[0].Path.LocalPath);
|
directories.Add(folder.Value.Path.LocalPath);
|
||||||
|
|
||||||
|
if (isGameList)
|
||||||
ViewModel.GameDirectoryChanged = true;
|
ViewModel.GameDirectoryChanged = true;
|
||||||
}
|
else
|
||||||
|
ViewModel.AutoloadDirectoryChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,33 +76,6 @@ namespace Ryujinx.Ava.UI.Views.Settings
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void AddAutoloadDirButton_OnClick(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
string path = AutoloadDirPathBox.Text;
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(path) && Directory.Exists(path) && !ViewModel.AutoloadDirectories.Contains(path))
|
|
||||||
{
|
|
||||||
ViewModel.AutoloadDirectories.Add(path);
|
|
||||||
ViewModel.AutoloadDirectoryChanged = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (this.GetVisualRoot() is Window window)
|
|
||||||
{
|
|
||||||
var result = await window.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
|
||||||
{
|
|
||||||
AllowMultiple = false,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (result.Count > 0)
|
|
||||||
{
|
|
||||||
ViewModel.AutoloadDirectories.Add(result[0].Path.LocalPath);
|
|
||||||
ViewModel.AutoloadDirectoryChanged = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RemoveAutoloadDirButton_OnClick(object sender, RoutedEventArgs e)
|
private void RemoveAutoloadDirButton_OnClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
int oldIndex = AutoloadDirsList.SelectedIndex;
|
int oldIndex = AutoloadDirsList.SelectedIndex;
|
||||||
|
@@ -14,9 +14,6 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
x:DataType="viewModels:DownloadableContentManagerViewModel"
|
x:DataType="viewModels:DownloadableContentManagerViewModel"
|
||||||
Focusable="True">
|
Focusable="True">
|
||||||
<UserControl.Resources>
|
|
||||||
<helpers:DownloadableContentLabelConverter x:Key="DownloadableContentLabel" />
|
|
||||||
</UserControl.Resources>
|
|
||||||
<Grid RowDefinitions="Auto,Auto,*,Auto">
|
<Grid RowDefinitions="Auto,Auto,*,Auto">
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
@@ -89,7 +86,7 @@
|
|||||||
<ListBox.DataTemplates>
|
<ListBox.DataTemplates>
|
||||||
<DataTemplate
|
<DataTemplate
|
||||||
DataType="models:DownloadableContentModel">
|
DataType="models:DownloadableContentModel">
|
||||||
<Panel Margin="10">
|
<Panel Margin="10" Background="Transparent">
|
||||||
<Grid ColumnDefinitions="*,Auto">
|
<Grid ColumnDefinitions="*,Auto">
|
||||||
<Grid
|
<Grid
|
||||||
Grid.Column="0" ColumnDefinitions="*,Auto">
|
Grid.Column="0" ColumnDefinitions="*,Auto">
|
||||||
@@ -101,7 +98,7 @@
|
|||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
TextTrimming="CharacterEllipsis">
|
TextTrimming="CharacterEllipsis">
|
||||||
<TextBlock.Text>
|
<TextBlock.Text>
|
||||||
<MultiBinding Converter="{StaticResource DownloadableContentLabel}">
|
<MultiBinding Converter="{x:Static helpers:DownloadableContentLabelConverter.Instance}">
|
||||||
<Binding Path="FileName" />
|
<Binding Path="FileName" />
|
||||||
<Binding Path="IsBundled" />
|
<Binding Path="IsBundled" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
@@ -112,7 +109,7 @@
|
|||||||
Margin="10 0"
|
Margin="10 0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{Binding TitleId}" />
|
Text="{Binding TitleIdStr}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
|
@@ -2,6 +2,8 @@ using Avalonia.Controls;
|
|||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Styling;
|
using Avalonia.Styling;
|
||||||
using FluentAvalonia.UI.Controls;
|
using FluentAvalonia.UI.Controls;
|
||||||
|
using LibHac.Tools.FsSystem.NcaUtils;
|
||||||
|
using Ryujinx.Ava.Common;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.Common.Models;
|
using Ryujinx.Ava.Common.Models;
|
||||||
using Ryujinx.Ava.UI.ViewModels;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
|
@@ -32,6 +32,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reactive.Linq;
|
using System.Reactive.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Runtime.Versioning;
|
using System.Runtime.Versioning;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -136,6 +137,8 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
base.OnApplyTemplate(e);
|
base.OnApplyTemplate(e);
|
||||||
|
|
||||||
NotificationHelper.SetNotificationManager(this);
|
NotificationHelper.SetNotificationManager(this);
|
||||||
|
|
||||||
|
Executor.ExecuteBackgroundAsync(ShowIntelMacWarningAsync);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnScalingChanged(object sender, EventArgs e)
|
private void OnScalingChanged(object sender, EventArgs e)
|
||||||
@@ -164,7 +167,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ApplicationLibrary_LdnGameDataReceived(object sender, LdnGameDataReceivedEventArgs e)
|
private void ApplicationLibrary_LdnGameDataReceived(LdnGameDataReceivedEventArgs e)
|
||||||
{
|
{
|
||||||
Dispatcher.UIThread.Post(() =>
|
Dispatcher.UIThread.Post(() =>
|
||||||
{
|
{
|
||||||
@@ -408,13 +411,10 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
{
|
{
|
||||||
StatusBarView.VolumeStatus.Click += VolumeStatus_CheckedChanged;
|
StatusBarView.VolumeStatus.Click += VolumeStatus_CheckedChanged;
|
||||||
|
|
||||||
|
ApplicationGrid.DataContext = ApplicationList.DataContext = ViewModel;
|
||||||
|
|
||||||
ApplicationGrid.ApplicationOpened += Application_Opened;
|
ApplicationGrid.ApplicationOpened += Application_Opened;
|
||||||
|
|
||||||
ApplicationGrid.DataContext = ViewModel;
|
|
||||||
|
|
||||||
ApplicationList.ApplicationOpened += Application_Opened;
|
ApplicationList.ApplicationOpened += Application_Opened;
|
||||||
|
|
||||||
ApplicationList.DataContext = ViewModel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetWindowSizePosition()
|
private void SetWindowSizePosition()
|
||||||
@@ -691,6 +691,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
ApplicationLibrary.LoadApplications(ConfigurationState.Instance.UI.GameDirs);
|
ApplicationLibrary.LoadApplications(ConfigurationState.Instance.UI.GameDirs);
|
||||||
|
|
||||||
var autoloadDirs = ConfigurationState.Instance.UI.AutoloadDirs.Value;
|
var autoloadDirs = ConfigurationState.Instance.UI.AutoloadDirs.Value;
|
||||||
|
autoloadDirs.ForEach(dir => Logger.Info?.Print(LogClass.Application, $"Auto loading DLC & updates from: {dir}"));
|
||||||
if (autoloadDirs.Count > 0)
|
if (autoloadDirs.Count > 0)
|
||||||
{
|
{
|
||||||
var updatesLoaded = ApplicationLibrary.AutoLoadTitleUpdates(autoloadDirs, out int updatesRemoved);
|
var updatesLoaded = ApplicationLibrary.AutoLoadTitleUpdates(autoloadDirs, out int updatesRemoved);
|
||||||
@@ -734,5 +735,20 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
(int)Symbol.Checkmark);
|
(int)Symbol.Checkmark);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool _intelMacWarningShown = !(OperatingSystem.IsMacOS() &&
|
||||||
|
(RuntimeInformation.OSArchitecture == Architecture.X64 ||
|
||||||
|
RuntimeInformation.OSArchitecture == Architecture.X86));
|
||||||
|
|
||||||
|
public static async Task ShowIntelMacWarningAsync()
|
||||||
|
{
|
||||||
|
if (_intelMacWarningShown) return;
|
||||||
|
|
||||||
|
await Dispatcher.UIThread.InvokeAsync(async () => await ContentDialogHelper.CreateWarningDialog(
|
||||||
|
"Intel Mac Warning",
|
||||||
|
"Intel Macs are not supported and will not work properly.\nIf you continue, do not come to our Discord asking for support;\nand do not report bugs on the GitHub. They will be closed."));
|
||||||
|
|
||||||
|
_intelMacWarningShown = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -28,15 +28,15 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task Show(MainWindowViewModel mainWindowViewModel)
|
public static async Task Show()
|
||||||
{
|
{
|
||||||
ContentDialog contentDialog = new()
|
ContentDialog contentDialog = new()
|
||||||
{
|
{
|
||||||
PrimaryButtonText = string.Empty,
|
PrimaryButtonText = string.Empty,
|
||||||
SecondaryButtonText = string.Empty,
|
SecondaryButtonText = string.Empty,
|
||||||
CloseButtonText = string.Empty,
|
CloseButtonText = string.Empty,
|
||||||
Content = new XCITrimmerWindow(mainWindowViewModel),
|
Content = new XCITrimmerWindow(RyujinxApp.MainWindow.ViewModel),
|
||||||
Title = string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmerWindowTitle]),
|
Title = LocaleManager.Instance[LocaleKeys.XCITrimmerWindowTitle]
|
||||||
};
|
};
|
||||||
|
|
||||||
Style bottomBorder = new(x => x.OfType<Grid>().Name("DialogSpace").Child().OfType<Border>());
|
Style bottomBorder = new(x => x.OfType<Grid>().Name("DialogSpace").Child().OfType<Border>());
|
||||||
|
@@ -88,6 +88,8 @@ namespace Ryujinx.Ava
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Logger.Info?.Print(LogClass.Application, "Checking for updates.");
|
||||||
|
|
||||||
// Get latest version number from GitHub API
|
// Get latest version number from GitHub API
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -141,6 +143,8 @@ namespace Ryujinx.Ava
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Logger.Info?.Print(LogClass.Application, "Up to date.");
|
||||||
|
|
||||||
_running = false;
|
_running = false;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -214,6 +218,8 @@ namespace Ryujinx.Ava
|
|||||||
? $"Canary {currentVersion} -> Canary {newVersion}"
|
? $"Canary {currentVersion} -> Canary {newVersion}"
|
||||||
: $"{currentVersion} -> {newVersion}";
|
: $"{currentVersion} -> {newVersion}";
|
||||||
|
|
||||||
|
Logger.Info?.Print(LogClass.Application, $"Version found: {newVersionString}");
|
||||||
|
|
||||||
RequestUserToUpdate:
|
RequestUserToUpdate:
|
||||||
// Show a message asking the user if they want to update
|
// Show a message asking the user if they want to update
|
||||||
UserResult shouldUpdate = await ContentDialogHelper.CreateUpdaterChoiceDialog(
|
UserResult shouldUpdate = await ContentDialogHelper.CreateUpdaterChoiceDialog(
|
||||||
|
@@ -45,7 +45,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
public const string DefaultLanPlayWebHost = "ryuldnweb.vudjun.com";
|
public const string DefaultLanPlayWebHost = "ryuldnweb.vudjun.com";
|
||||||
public Language DesiredLanguage { get; set; }
|
public Language DesiredLanguage { get; set; }
|
||||||
public event EventHandler<ApplicationCountUpdatedEventArgs> ApplicationCountUpdated;
|
public event EventHandler<ApplicationCountUpdatedEventArgs> ApplicationCountUpdated;
|
||||||
public event EventHandler<LdnGameDataReceivedEventArgs> LdnGameDataReceived;
|
public event Action<LdnGameDataReceivedEventArgs> LdnGameDataReceived;
|
||||||
|
|
||||||
public readonly IObservableCache<ApplicationData, ulong> Applications;
|
public readonly IObservableCache<ApplicationData, ulong> Applications;
|
||||||
public readonly IObservableCache<(TitleUpdateModel TitleUpdate, bool IsSelected), TitleUpdateModel> TitleUpdates;
|
public readonly IObservableCache<(TitleUpdateModel TitleUpdate, bool IsSelected), TitleUpdateModel> TitleUpdates;
|
||||||
@@ -779,7 +779,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
using HttpClient httpClient = new HttpClient();
|
using HttpClient httpClient = new HttpClient();
|
||||||
string ldnGameDataArrayString = await httpClient.GetStringAsync($"https://{ldnWebHost}/api/public_games");
|
string ldnGameDataArrayString = await httpClient.GetStringAsync($"https://{ldnWebHost}/api/public_games");
|
||||||
ldnGameDataArray = JsonHelper.Deserialize(ldnGameDataArrayString, _ldnDataSerializerContext.IEnumerableLdnGameData);
|
ldnGameDataArray = JsonHelper.Deserialize(ldnGameDataArrayString, _ldnDataSerializerContext.IEnumerableLdnGameData);
|
||||||
LdnGameDataReceived?.Invoke(null, new LdnGameDataReceivedEventArgs
|
LdnGameDataReceived?.Invoke(new LdnGameDataReceivedEventArgs
|
||||||
{
|
{
|
||||||
LdnData = ldnGameDataArray
|
LdnData = ldnGameDataArray
|
||||||
});
|
});
|
||||||
@@ -787,7 +787,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.Warning?.Print(LogClass.Application, $"Failed to fetch the public games JSON from the API. Player and game count in the game list will be unavailable.\n{ex.Message}");
|
Logger.Warning?.Print(LogClass.Application, $"Failed to fetch the public games JSON from the API. Player and game count in the game list will be unavailable.\n{ex.Message}");
|
||||||
LdnGameDataReceived?.Invoke(null, new LdnGameDataReceivedEventArgs
|
LdnGameDataReceived?.Invoke(new LdnGameDataReceivedEventArgs
|
||||||
{
|
{
|
||||||
LdnData = Array.Empty<LdnGameData>()
|
LdnData = Array.Empty<LdnGameData>()
|
||||||
});
|
});
|
||||||
@@ -795,7 +795,7 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LdnGameDataReceived?.Invoke(null, new LdnGameDataReceivedEventArgs
|
LdnGameDataReceived?.Invoke(new LdnGameDataReceivedEventArgs
|
||||||
{
|
{
|
||||||
LdnData = Array.Empty<LdnGameData>()
|
LdnData = Array.Empty<LdnGameData>()
|
||||||
});
|
});
|
||||||
@@ -840,7 +840,6 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Remove any downloadable content which can no longer be located on disk
|
// Remove any downloadable content which can no longer be located on disk
|
||||||
Logger.Notice.Print(LogClass.Application, $"Removing non-existing Title DLCs");
|
|
||||||
var dlcToRemove = _downloadableContents.Items
|
var dlcToRemove = _downloadableContents.Items
|
||||||
.Where(dlc => !File.Exists(dlc.Dlc.ContainerPath))
|
.Where(dlc => !File.Exists(dlc.Dlc.ContainerPath))
|
||||||
.ToList();
|
.ToList();
|
||||||
@@ -852,8 +851,6 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
|
|
||||||
foreach (string appDir in appDirs)
|
foreach (string appDir in appDirs)
|
||||||
{
|
{
|
||||||
Logger.Notice.Print(LogClass.Application, $"Auto loading DLC from: {appDir}");
|
|
||||||
|
|
||||||
if (_cancellationToken.Token.IsCancellationRequested)
|
if (_cancellationToken.Token.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
return newDlcLoaded;
|
return newDlcLoaded;
|
||||||
@@ -956,7 +953,6 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
var titleIdsToRefresh = new HashSet<ulong>();
|
var titleIdsToRefresh = new HashSet<ulong>();
|
||||||
|
|
||||||
// Remove any updates which can no longer be located on disk
|
// Remove any updates which can no longer be located on disk
|
||||||
Logger.Notice.Print(LogClass.Application, $"Removing non-existing Title Updates");
|
|
||||||
var updatesToRemove = _titleUpdates.Items
|
var updatesToRemove = _titleUpdates.Items
|
||||||
.Where(it => !File.Exists(it.TitleUpdate.Path))
|
.Where(it => !File.Exists(it.TitleUpdate.Path))
|
||||||
.ToList();
|
.ToList();
|
||||||
@@ -971,8 +967,6 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
|
|
||||||
foreach (string appDir in appDirs)
|
foreach (string appDir in appDirs)
|
||||||
{
|
{
|
||||||
Logger.Notice.Print(LogClass.Application, $"Auto loading updates from: {appDir}");
|
|
||||||
|
|
||||||
if (_cancellationToken.Token.IsCancellationRequested)
|
if (_cancellationToken.Token.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
return numUpdatesLoaded;
|
return numUpdatesLoaded;
|
||||||
|
@@ -54,5 +54,9 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
appControl = new BlitStruct<ApplicationControlProperty>(0);
|
appControl = new BlitStruct<ApplicationControlProperty>(0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanStart(out ApplicationData appData,
|
||||||
|
out BlitStruct<ApplicationControlProperty> appControl)
|
||||||
|
=> CanStart(null, out appData, out appControl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,9 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
|
|
||||||
public class CompatibilityCsv
|
public class CompatibilityCsv
|
||||||
{
|
{
|
||||||
static CompatibilityCsv()
|
static CompatibilityCsv() => Load();
|
||||||
|
|
||||||
|
public static void Load()
|
||||||
{
|
{
|
||||||
using Stream csvStream = Assembly.GetExecutingAssembly()
|
using Stream csvStream = Assembly.GetExecutingAssembly()
|
||||||
.GetManifestResourceStream("RyujinxGameCompatibilityList")!;
|
.GetManifestResourceStream("RyujinxGameCompatibilityList")!;
|
||||||
@@ -37,15 +39,31 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
using SepReader reader = Sep.Reader().From(csvStream);
|
using SepReader reader = Sep.Reader().From(csvStream);
|
||||||
ColumnIndices columnIndices = new(reader.Header.IndexOf);
|
ColumnIndices columnIndices = new(reader.Header.IndexOf);
|
||||||
|
|
||||||
Entries = reader
|
_entries = reader
|
||||||
.Enumerate(row => new CompatibilityEntry(ref columnIndices, row))
|
.Enumerate(row => new CompatibilityEntry(ref columnIndices, row))
|
||||||
.OrderBy(it => it.GameName)
|
.OrderBy(it => it.GameName)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
Logger.Debug?.Print(LogClass.UI, "Compatibility CSV loaded.", "LoadCompatCsv");
|
Logger.Debug?.Print(LogClass.UI, "Compatibility CSV loaded.", "LoadCompatibility");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CompatibilityEntry[] Entries { get; private set; }
|
public static void Unload()
|
||||||
|
{
|
||||||
|
_entries = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static CompatibilityEntry[] _entries;
|
||||||
|
|
||||||
|
public static CompatibilityEntry[] Entries
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_entries == null)
|
||||||
|
Load();
|
||||||
|
|
||||||
|
return _entries;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CompatibilityEntry
|
public class CompatibilityEntry
|
||||||
@@ -57,7 +75,7 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
? titleIdRow
|
? titleIdRow
|
||||||
: default(Optional<string>);
|
: default(Optional<string>);
|
||||||
|
|
||||||
GameName = ColStr(row[indices.GameName]).Trim().Trim('"');
|
GameName = ColStr(row[indices.GameName]);
|
||||||
|
|
||||||
Labels = ColStr(row[indices.Labels]).Split(';');
|
Labels = ColStr(row[indices.Labels]).Split(';');
|
||||||
Status = ColStr(row[indices.Status]).ToLower() switch
|
Status = ColStr(row[indices.Status]).ToLower() switch
|
||||||
@@ -92,7 +110,6 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
.OrElse(new string(' ', 16));
|
.OrElse(new string(' ', 16));
|
||||||
|
|
||||||
public string FormattedIssueLabels => Labels
|
public string FormattedIssueLabels => Labels
|
||||||
.Where(it => !it.StartsWithIgnoreCase("status"))
|
|
||||||
.Select(FormatLabelName)
|
.Select(FormatLabelName)
|
||||||
.JoinToString(", ");
|
.JoinToString(", ");
|
||||||
|
|
||||||
|
@@ -1,11 +1,8 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Styling;
|
using Avalonia.Styling;
|
||||||
using FluentAvalonia.UI.Controls;
|
using FluentAvalonia.UI.Controls;
|
||||||
using nietras.SeparatedValues;
|
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using System.IO;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Utilities.Compat
|
namespace Ryujinx.Ava.Utilities.Compat
|
||||||
@@ -35,6 +32,8 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
contentDialog.Styles.Add(closeButtonParent);
|
contentDialog.Styles.Add(closeButtonParent);
|
||||||
|
|
||||||
await ContentDialogHelper.ShowAsync(contentDialog);
|
await ContentDialogHelper.ShowAsync(contentDialog);
|
||||||
|
|
||||||
|
CompatibilityCsv.Unload();
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompatibilityList()
|
public CompatibilityList()
|
||||||
|
@@ -1,19 +1,18 @@
|
|||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using ExCSS;
|
|
||||||
using Gommon;
|
using Gommon;
|
||||||
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
using Ryujinx.Ava.Utilities.AppLibrary;
|
using Ryujinx.Ava.Utilities.AppLibrary;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Utilities.Compat
|
namespace Ryujinx.Ava.Utilities.Compat
|
||||||
{
|
{
|
||||||
public partial class CompatibilityViewModel : ObservableObject
|
public class CompatibilityViewModel : BaseModel
|
||||||
{
|
{
|
||||||
[ObservableProperty] private bool _onlyShowOwnedGames = true;
|
private bool _onlyShowOwnedGames = true;
|
||||||
|
|
||||||
private IEnumerable<CompatibilityEntry> _currentEntries = CompatibilityCsv.Entries;
|
private IEnumerable<CompatibilityEntry> _currentEntries = CompatibilityCsv.Entries;
|
||||||
private readonly string[] _ownedGameTitleIds = [];
|
private string[] _ownedGameTitleIds = [];
|
||||||
private readonly ApplicationLibrary _appLibrary;
|
|
||||||
|
|
||||||
public IEnumerable<CompatibilityEntry> CurrentEntries => OnlyShowOwnedGames
|
public IEnumerable<CompatibilityEntry> CurrentEntries => OnlyShowOwnedGames
|
||||||
? _currentEntries.Where(x =>
|
? _currentEntries.Where(x =>
|
||||||
@@ -24,14 +23,23 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
|
|
||||||
public CompatibilityViewModel(ApplicationLibrary appLibrary)
|
public CompatibilityViewModel(ApplicationLibrary appLibrary)
|
||||||
{
|
{
|
||||||
_appLibrary = appLibrary;
|
appLibrary.ApplicationCountUpdated += (_, _)
|
||||||
_ownedGameTitleIds = appLibrary.Applications.Keys.Select(x => x.ToString("X16")).ToArray();
|
=> _ownedGameTitleIds = appLibrary.Applications.Keys.Select(x => x.ToString("X16")).ToArray();
|
||||||
|
|
||||||
PropertyChanged += (_, args) =>
|
_ownedGameTitleIds = appLibrary.Applications.Keys.Select(x => x.ToString("X16")).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool OnlyShowOwnedGames
|
||||||
|
{
|
||||||
|
get => _onlyShowOwnedGames;
|
||||||
|
set
|
||||||
{
|
{
|
||||||
if (args.PropertyName is nameof(OnlyShowOwnedGames))
|
OnPropertyChanging();
|
||||||
OnPropertyChanged(nameof(CurrentEntries));
|
OnPropertyChanging(nameof(CurrentEntries));
|
||||||
};
|
_onlyShowOwnedGames = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
OnPropertyChanged(nameof(CurrentEntries));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Search(string searchTerm)
|
public void Search(string searchTerm)
|
||||||
|
@@ -17,7 +17,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current version of the file format
|
/// The current version of the file format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const int CurrentVersion = 59;
|
public const int CurrentVersion = 60;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Version of the configuration file format
|
/// Version of the configuration file format
|
||||||
@@ -351,6 +351,11 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool StartFullscreen { get; set; }
|
public bool StartFullscreen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Start games with UI hidden
|
||||||
|
/// </summary>
|
||||||
|
public bool StartNoUI { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Show console window
|
/// Show console window
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@@ -127,6 +127,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
UI.GridSize.Value = cff.GridSize;
|
UI.GridSize.Value = cff.GridSize;
|
||||||
UI.ApplicationSort.Value = cff.ApplicationSort;
|
UI.ApplicationSort.Value = cff.ApplicationSort;
|
||||||
UI.StartFullscreen.Value = cff.StartFullscreen;
|
UI.StartFullscreen.Value = cff.StartFullscreen;
|
||||||
|
UI.StartNoUI.Value = cff.StartNoUI;
|
||||||
UI.ShowConsole.Value = cff.ShowConsole;
|
UI.ShowConsole.Value = cff.ShowConsole;
|
||||||
UI.WindowStartup.WindowSizeWidth.Value = cff.WindowStartup.WindowSizeWidth;
|
UI.WindowStartup.WindowSizeWidth.Value = cff.WindowStartup.WindowSizeWidth;
|
||||||
UI.WindowStartup.WindowSizeHeight.Value = cff.WindowStartup.WindowSizeHeight;
|
UI.WindowStartup.WindowSizeHeight.Value = cff.WindowStartup.WindowSizeHeight;
|
||||||
@@ -414,7 +415,8 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
// This was accidentally enabled by default when it was PRed. That is not what we want,
|
// This was accidentally enabled by default when it was PRed. That is not what we want,
|
||||||
// so as a compromise users who want to use it will simply need to re-enable it once after updating.
|
// so as a compromise users who want to use it will simply need to re-enable it once after updating.
|
||||||
cff.IgnoreApplet = false;
|
cff.IgnoreApplet = false;
|
||||||
})
|
}),
|
||||||
|
(60, static cff => cff.StartNoUI = false)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -152,6 +152,11 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ReactiveObject<bool> StartFullscreen { get; private set; }
|
public ReactiveObject<bool> StartFullscreen { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Start games with UI hidden
|
||||||
|
/// </summary>
|
||||||
|
public ReactiveObject<bool> StartNoUI { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hide / Show Console Window
|
/// Hide / Show Console Window
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -192,6 +197,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
WindowStartup = new WindowStartupSettings();
|
WindowStartup = new WindowStartupSettings();
|
||||||
BaseStyle = new ReactiveObject<string>();
|
BaseStyle = new ReactiveObject<string>();
|
||||||
StartFullscreen = new ReactiveObject<bool>();
|
StartFullscreen = new ReactiveObject<bool>();
|
||||||
|
StartNoUI = new ReactiveObject<bool>();
|
||||||
GameListViewMode = new ReactiveObject<int>();
|
GameListViewMode = new ReactiveObject<int>();
|
||||||
ShowNames = new ReactiveObject<bool>();
|
ShowNames = new ReactiveObject<bool>();
|
||||||
GridSize = new ReactiveObject<int>();
|
GridSize = new ReactiveObject<int>();
|
||||||
|
@@ -125,6 +125,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
ApplicationSort = UI.ApplicationSort,
|
ApplicationSort = UI.ApplicationSort,
|
||||||
IsAscendingOrder = UI.IsAscendingOrder,
|
IsAscendingOrder = UI.IsAscendingOrder,
|
||||||
StartFullscreen = UI.StartFullscreen,
|
StartFullscreen = UI.StartFullscreen,
|
||||||
|
StartNoUI = UI.StartNoUI,
|
||||||
ShowConsole = UI.ShowConsole,
|
ShowConsole = UI.ShowConsole,
|
||||||
EnableKeyboard = Hid.EnableKeyboard,
|
EnableKeyboard = Hid.EnableKeyboard,
|
||||||
EnableMouse = Hid.EnableMouse,
|
EnableMouse = Hid.EnableMouse,
|
||||||
@@ -233,6 +234,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
|
|||||||
UI.ApplicationSort.Value = 0;
|
UI.ApplicationSort.Value = 0;
|
||||||
UI.IsAscendingOrder.Value = true;
|
UI.IsAscendingOrder.Value = true;
|
||||||
UI.StartFullscreen.Value = false;
|
UI.StartFullscreen.Value = false;
|
||||||
|
UI.StartNoUI.Value = false;
|
||||||
UI.ShowConsole.Value = true;
|
UI.ShowConsole.Value = true;
|
||||||
UI.WindowStartup.WindowSizeWidth.Value = 1280;
|
UI.WindowStartup.WindowSizeWidth.Value = 1280;
|
||||||
UI.WindowStartup.WindowSizeHeight.Value = 760;
|
UI.WindowStartup.WindowSizeHeight.Value = 760;
|
||||||
|
47
src/Ryujinx/Utilities/StorageProviderExtensions.cs
Normal file
47
src/Ryujinx/Utilities/StorageProviderExtensions.cs
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
using Avalonia.Platform.Storage;
|
||||||
|
using Gommon;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.Utilities
|
||||||
|
{
|
||||||
|
public static class StorageProviderExtensions
|
||||||
|
{
|
||||||
|
public static async Task<Optional<IStorageFolder>> OpenSingleFolderPickerAsync(this IStorageProvider storageProvider, FolderPickerOpenOptions openOptions = null) =>
|
||||||
|
await storageProvider.OpenFolderPickerAsync(FixOpenOptions(openOptions, false))
|
||||||
|
.Then(folders => folders.FindFirst());
|
||||||
|
|
||||||
|
public static async Task<Optional<IStorageFile>> OpenSingleFilePickerAsync(this IStorageProvider storageProvider, FilePickerOpenOptions openOptions = null) =>
|
||||||
|
await storageProvider.OpenFilePickerAsync(FixOpenOptions(openOptions, false))
|
||||||
|
.Then(files => files.FindFirst());
|
||||||
|
|
||||||
|
public static async Task<Optional<IReadOnlyList<IStorageFolder>>> OpenMultiFolderPickerAsync(this IStorageProvider storageProvider, FolderPickerOpenOptions openOptions = null) =>
|
||||||
|
await storageProvider.OpenFolderPickerAsync(FixOpenOptions(openOptions, true))
|
||||||
|
.Then(folders => folders.Count > 0 ? Optional.Of(folders) : default);
|
||||||
|
|
||||||
|
public static async Task<Optional<IReadOnlyList<IStorageFile>>> OpenMultiFilePickerAsync(this IStorageProvider storageProvider, FilePickerOpenOptions openOptions = null) =>
|
||||||
|
await storageProvider.OpenFilePickerAsync(FixOpenOptions(openOptions, true))
|
||||||
|
.Then(files => files.Count > 0 ? Optional.Of(files) : default);
|
||||||
|
|
||||||
|
private static FilePickerOpenOptions FixOpenOptions(this FilePickerOpenOptions openOptions, bool allowMultiple)
|
||||||
|
{
|
||||||
|
if (openOptions is null)
|
||||||
|
return new FilePickerOpenOptions { AllowMultiple = allowMultiple };
|
||||||
|
|
||||||
|
openOptions.AllowMultiple = allowMultiple;
|
||||||
|
|
||||||
|
return openOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static FolderPickerOpenOptions FixOpenOptions(this FolderPickerOpenOptions openOptions, bool allowMultiple)
|
||||||
|
{
|
||||||
|
if (openOptions is null)
|
||||||
|
return new FolderPickerOpenOptions { AllowMultiple = allowMultiple };
|
||||||
|
|
||||||
|
openOptions.AllowMultiple = allowMultiple;
|
||||||
|
|
||||||
|
return openOptions;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -4,7 +4,7 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
{
|
{
|
||||||
public static class TitleHelper
|
public static class TitleHelper
|
||||||
{
|
{
|
||||||
public static string ActiveApplicationTitle(ProcessResult activeProcess, string applicationVersion, string pauseString = "")
|
public static string ActiveApplicationTitle(ProcessResult activeProcess, string applicationVersion, bool customTitlebar, string pauseString = "")
|
||||||
{
|
{
|
||||||
if (activeProcess == null)
|
if (activeProcess == null)
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
@@ -14,7 +14,9 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
string titleIdSection = $" ({activeProcess.ProgramIdText.ToUpper()})";
|
string titleIdSection = $" ({activeProcess.ProgramIdText.ToUpper()})";
|
||||||
string titleArchSection = activeProcess.Is64Bit ? " (64-bit)" : " (32-bit)";
|
string titleArchSection = activeProcess.Is64Bit ? " (64-bit)" : " (32-bit)";
|
||||||
|
|
||||||
string appTitle = $"Ryujinx {applicationVersion} -{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}";
|
string appTitle = customTitlebar
|
||||||
|
? $"Ryujinx {applicationVersion}\n{titleNameSection.Trim()}\n{titleVersionSection.Trim()}\n{titleIdSection.Trim()}{titleArchSection}"
|
||||||
|
: $"Ryujinx {applicationVersion} -{titleNameSection}{titleVersionSection}{titleIdSection}{titleArchSection}";
|
||||||
|
|
||||||
return !string.IsNullOrEmpty(pauseString)
|
return !string.IsNullOrEmpty(pauseString)
|
||||||
? appTitle + $" ({pauseString})"
|
? appTitle + $" ({pauseString})"
|
||||||
|
Reference in New Issue
Block a user