Compare commits

..

3 Commits

7 changed files with 100 additions and 34 deletions

View File

@@ -42,7 +42,7 @@
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.3-build14" />
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
<PackageVersion Include="Gommon" Version="2.7.1.1" />
<PackageVersion Include="Gommon" Version="2.7.1" />
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
<PackageVersion Include="Sep" Version="0.6.0" />
<PackageVersion Include="shaderc.net" Version="0.1.0" />

View File

@@ -20,4 +20,42 @@ if command -v gamemoderun > /dev/null 2>&1; then
COMMAND="$COMMAND gamemoderun"
fi
exec $COMMAND "$SCRIPT_DIR/$RYUJINX_BIN" "$@"
# Check if user already has a manual Avalonia scaling override or session type is x11.
if [[ -n "${AVALONIA_GLOBAL_SCALE_FACTOR-}" || "$(echo "$XDG_SESSION_TYPE")" == "x11" ]]; then
echo "Scaling: Performed by environment, skipping." >&2
else
# Query monitor config directly (GNOME), default display only.
if [[ "$(echo "$XDG_CURRENT_DESKTOP")" == "GNOME" && -f ~/.config/monitors.xml ]] then
echo -n 'Scaling: Monitor config located, querying scale...' >&2
SCALING="$(grep '<scale' ~/.config/monitors.xml -m 1 | cut -f2 -d">"|cut -f1 -d"<")"
SCALING="${SCALING##* }"
echo "found! Factor: ${SCALING}" >&2
# Fallback to X DPI query for others.
# Plasma handles this fine, GNOME will always round up e.g. 1.25 -> 2.00.
elif command -v xrdb >/dev/null; then
echo -n 'Scaling: Attempting to get scaling from X DPI value...' >&2
dpi="$(xrdb -get Xft.dpi)"
if [[ -n "${dpi}" ]]; then
SCALING=$(echo "scale=2; ${dpi}/96" | bc)
fi
echo "found! Factor: ${SCALING}"
# Query kscreen-doctor for Plasma as a fallback.
elif [[ "$(echo "$XDG_CURRENT_DESKTOP")" == "KDE" ]] && command -v kscreen-doctor >/dev/null; then
echo -n 'Scaling: Attempting to get Plasma desktop scaling factor...' >&2
SCALING="$(kscreen-doctor --outputs | grep "Scale" -m 1)"
SCALING="${SCALING##* }"
SCALING=$(echo $SCALING | sed 's/\x1B\[[0-9;]*m//g') # Trim ANSI chars from ksd output.
echo "found! Factor: ${SCALING}"
fi
if [[ -z "${SCALING-}" || "${SCALING-}" == "0" ]]; then
echo 'Unset invalid scaling value' >&2
SCALING="1"
fi
COMMAND="$COMMAND AVALONIA_GLOBAL_SCALE_FACTOR=$SCALING"
fi
exec $COMMAND "$SCRIPT_DIR/$RYUJINX_BIN" "$@"

View File

@@ -4647,6 +4647,56 @@
"zh_TW": "正體中文 (建議)"
}
},
{
"ID": "SettingsTabSystemSystemLanguageSwedish",
"Translations": {
"ar_SA": "",
"de_DE": "",
"el_GR": "",
"en_US": "Swedish",
"es_ES": "",
"fr_FR": "",
"he_IL": "",
"it_IT": "",
"ja_JP": "",
"ko_KR": "스웨덴어",
"no_NO": "Svensk",
"pl_PL": "",
"pt_BR": "Sueco",
"ru_RU": "",
"sv_SE": "Svenska",
"th_TH": "",
"tr_TR": "",
"uk_UA": "",
"zh_CN": "瑞典语",
"zh_TW": ""
}
},
{
"ID": "SettingsTabSystemSystemLanguageNorwegian",
"Translations": {
"ar_SA": "",
"de_DE": "",
"el_GR": "",
"en_US": "Norwegian",
"es_ES": "",
"fr_FR": "",
"he_IL": "",
"it_IT": "",
"ja_JP": "",
"ko_KR": "노르웨이어",
"no_NO": "Norsk",
"pl_PL": "",
"pt_BR": "Norueguês",
"ru_RU": "",
"sv_SE": "Norska",
"th_TH": "",
"tr_TR": "",
"uk_UA": "",
"zh_CN": "挪威语",
"zh_TW": ""
}
},
{
"ID": "SettingsTabSystemSystemTimeZone",
"Translations": {
@@ -24073,4 +24123,4 @@
}
}
]
}
}

View File

@@ -793,7 +793,7 @@ namespace Ryujinx.Ava.UI.ViewModels
return false;
}
public async Task HandleFirmwareInstallation(string filename)
private async Task HandleFirmwareInstallation(string filename)
{
try
{

View File

@@ -133,6 +133,12 @@
<ComboBoxItem>
<TextBlock Text="{ext:Locale SettingsTabSystemSystemLanguageBrazilianPortuguese}" />
</ComboBoxItem>
<ComboBoxItem>
<TextBlock Text="{ext:Locale SettingsTabSystemSystemLanguageSwedish}" />
</ComboBoxItem>
<ComboBoxItem>
<TextBlock Text="{ext:Locale SettingsTabSystemSystemLanguageNorwegian}" />
</ComboBoxItem>
</ComboBox>
</StackPanel>
<StackPanel

View File

@@ -139,21 +139,8 @@ namespace Ryujinx.Ava.UI.Windows
base.OnApplyTemplate(e);
NotificationHelper.SetNotificationManager(this);
Executor.ExecuteBackgroundAsync(async () =>
{
await ShowIntelMacWarningAsync();
FilePath firmwarePath = CommandLineState.FirmwareToInstallPathArg;
if (firmwarePath is not null)
{
if ((firmwarePath.ExistsAsFile && firmwarePath.Extension is "xci" or "zip") ||
firmwarePath.ExistsAsDirectory)
await Dispatcher.UIThread.InvokeAsync(() =>
ViewModel.HandleFirmwareInstallation(firmwarePath));
else
Logger.Notice.Print(LogClass.UI, "Invalid firmware type provided. Path must be a directory, or a .zip or .xci file.");
}
});
Executor.ExecuteBackgroundAsync(ShowIntelMacWarningAsync);
}
private void OnScalingChanged(object sender, EventArgs e)

View File

@@ -1,4 +1,3 @@
using Gommon;
using Ryujinx.Common.Logging;
using System.Collections.Generic;
@@ -14,7 +13,6 @@ namespace Ryujinx.Ava.Utilities
public static string OverrideBackendThreading { get; private set; }
public static string OverrideHideCursor { get; private set; }
public static string BaseDirPathArg { get; private set; }
public static FilePath FirmwareToInstallPathArg { get; private set; }
public static string Profile { get; private set; }
public static string LaunchPathArg { get; private set; }
public static string LaunchApplicationId { get; private set; }
@@ -43,19 +41,6 @@ namespace Ryujinx.Ava.Utilities
BaseDirPathArg = args[++i];
arguments.Add(arg);
arguments.Add(args[i]);
break;
case "--install-firmware":
if (i + 1 >= args.Length)
{
Logger.Error?.Print(LogClass.Application, $"Invalid option '{arg}'");
continue;
}
FirmwareToInstallPathArg = new FilePath(args[++i]);
arguments.Add(arg);
arguments.Add(args[i]);
break;