Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
84d0ca5645 | |||
31b8d413d5 | |||
6e02cac952 | |||
3a3380fa25 | |||
2d252db0a7 | |||
7f8a3541eb | |||
b34de74f81 | |||
5811d121df | |||
6eb85e846f | |||
c5bddfeab8 | |||
70ec5def9c | |||
7853faa334 | |||
b7fb474bfe | |||
2fa6413ed8 | |||
4523a73f75 | |||
f4c47f3c9a | |||
7d9a5feccb | |||
14ae4e276f | |||
3af42d6c7e | |||
bccf5e8b5a |
@ -55,7 +55,6 @@ namespace Ryujinx.Ava
|
||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
var result = await ContentDialogHelper.CreateConfirmationDialog(
|
||||
(desktop.MainWindow as MainWindow).SettingsWindow,
|
||||
LocaleManager.Instance["DialogThemeRestartMessage"],
|
||||
LocaleManager.Instance["DialogThemeRestartSubMessage"],
|
||||
LocaleManager.Instance["InputDialogYes"],
|
||||
|
@ -417,10 +417,12 @@ namespace Ryujinx.Ava
|
||||
{
|
||||
if (userError == UserError.NoFirmware)
|
||||
{
|
||||
string message = string.Format(LocaleManager.Instance["DialogFirmwareInstallEmbeddedMessage"], firmwareVersion.VersionString);
|
||||
string message = string.Format(LocaleManager.Instance["DialogFirmwareInstallEmbeddedMessage"],
|
||||
firmwareVersion.VersionString);
|
||||
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(_parent,
|
||||
LocaleManager.Instance["DialogFirmwareNoFirmwareInstalledMessage"], message, LocaleManager.Instance["InputDialogYes"], LocaleManager.Instance["InputDialogNo"], "");
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(
|
||||
LocaleManager.Instance["DialogFirmwareNoFirmwareInstalledMessage"], message,
|
||||
LocaleManager.Instance["InputDialogYes"], LocaleManager.Instance["InputDialogNo"], "");
|
||||
|
||||
if (result != UserResult.Yes)
|
||||
{
|
||||
@ -450,12 +452,12 @@ namespace Ryujinx.Ava
|
||||
|
||||
string message = string.Format(LocaleManager.Instance["DialogFirmwareInstallEmbeddedSuccessMessage"], firmwareVersion.VersionString);
|
||||
|
||||
await ContentDialogHelper.CreateInfoDialog(_parent,
|
||||
string.Format(LocaleManager.Instance["DialogFirmwareInstalledMessage"], firmwareVersion.VersionString),
|
||||
message,
|
||||
LocaleManager.Instance["InputDialogOk"],
|
||||
"",
|
||||
LocaleManager.Instance["RyujinxInfo"]);
|
||||
await ContentDialogHelper.CreateInfoDialog(
|
||||
string.Format(LocaleManager.Instance["DialogFirmwareInstalledMessage"], firmwareVersion.VersionString),
|
||||
message,
|
||||
LocaleManager.Instance["InputDialogOk"],
|
||||
"",
|
||||
LocaleManager.Instance["RyujinxInfo"]);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -879,7 +881,7 @@ namespace Ryujinx.Ava
|
||||
}
|
||||
|
||||
_dialogShown = true;
|
||||
shouldExit = await ContentDialogHelper.CreateStopEmulationDialog(_parent);
|
||||
shouldExit = await ContentDialogHelper.CreateStopEmulationDialog();
|
||||
|
||||
_dialogShown = false;
|
||||
}
|
||||
@ -896,7 +898,7 @@ namespace Ryujinx.Ava
|
||||
{
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
_parent.Cursor = _isMouseInRenderer ? InvisibleCursor : Cursor.Default;
|
||||
_parent.Cursor = _isMouseInRenderer ? InvisibleCursor : Cursor.Default;
|
||||
});
|
||||
}
|
||||
else
|
||||
|
@ -109,21 +109,21 @@
|
||||
"SettingsTabSystemSystemLanguageTraditionalChinese": "Traditional Chinese",
|
||||
"SettingsTabSystemSystemTimeZone": "System TimeZone:",
|
||||
"SettingsTabSystemSystemTime": "System Time:",
|
||||
"SettingsTabSystemEnableVsync": "Enable VSync",
|
||||
"SettingsTabSystemEnablePptc": "Enable PPTC (Profiled Persistent Translation Cache)",
|
||||
"SettingsTabSystemEnableFsIntegrityChecks": "Enable FS Integrity Checks",
|
||||
"SettingsTabSystemEnableVsync": "VSync",
|
||||
"SettingsTabSystemEnablePptc": "PPTC (Profiled Persistent Translation Cache)",
|
||||
"SettingsTabSystemEnableFsIntegrityChecks": "FS Integrity Checks",
|
||||
"SettingsTabSystemAudioBackend": "Audio Backend:",
|
||||
"SettingsTabSystemAudioBackendDummy": "Dummy",
|
||||
"SettingsTabSystemAudioBackendOpenAL": "OpenAL",
|
||||
"SettingsTabSystemAudioBackendSoundIO": "SoundIO",
|
||||
"SettingsTabSystemAudioBackendSDL2": "SDL2",
|
||||
"SettingsTabSystemHacks": "Hacks",
|
||||
"SettingsTabSystemHacksNote": " - These many cause instabilities",
|
||||
"SettingsTabSystemExpandDramSize": "Expand DRAM size to 6GB",
|
||||
"SettingsTabSystemHacksNote": " (may cause instability)",
|
||||
"SettingsTabSystemExpandDramSize": "Expand DRAM Size to 6GB",
|
||||
"SettingsTabSystemIgnoreMissingServices": "Ignore Missing Services",
|
||||
"SettingsTabGraphics": "Graphics",
|
||||
"SettingsTabGraphicsEnhancements": "Enhancements",
|
||||
"SettingsTabGraphicsEnableShaderCache": "Enable Shader Cache",
|
||||
"SettingsTabGraphicsEnableShaderCache": "Shader Cache",
|
||||
"SettingsTabGraphicsAnisotropicFiltering": "Anisotropic Filtering:",
|
||||
"SettingsTabGraphicsAnisotropicFilteringAuto": "Auto",
|
||||
"SettingsTabGraphicsAnisotropicFiltering2x": "2x",
|
||||
@ -164,7 +164,7 @@
|
||||
"SettingsTabLoggingOpenglLogLevelAll": "All",
|
||||
"SettingsTabLoggingEnableDebugLogs": "Enable Debug Logs",
|
||||
"SettingsTabInput": "Input",
|
||||
"SettingsTabInputEnableDockedMode": "Enable Docked Mode",
|
||||
"SettingsTabInputEnableDockedMode": "Docked Mode",
|
||||
"SettingsTabInputDirectKeyboardAccess": "Direct Keyboard Access",
|
||||
"SettingsButtonSave": "Save",
|
||||
"SettingsButtonClose": "Close",
|
||||
@ -256,8 +256,8 @@
|
||||
"UserProfilesSaveProfileName": "Save Profile Name",
|
||||
"UserProfilesChangeProfileImage": "Change Profile Image",
|
||||
"UserProfilesAvailableUserProfiles": "Available User Profiles:",
|
||||
"UserProfilesAddNewProfile": "Add New Profile",
|
||||
"UserProfilesDeleteSelectedProfile": "Delete Selected Profile",
|
||||
"UserProfilesAddNewProfile": "Create Profile",
|
||||
"UserProfilesDeleteSelectedProfile": "Delete Selected",
|
||||
"UserProfilesClose": "Close",
|
||||
"ProfileImageSelectionTitle": "Profile Image Selection",
|
||||
"ProfileImageSelectionHeader": "Choose a profile Image",
|
||||
@ -418,52 +418,52 @@
|
||||
"OrderDescending": "Descending",
|
||||
"SettingsTabGraphicsFeatures": "Features",
|
||||
"ErrorWindowTitle": "Error Window",
|
||||
"ToggleDiscordTooltip": "Enables or disables Discord Rich Presence",
|
||||
"ToggleDiscordTooltip": "Choose whether or not to display Ryujinx on your \"currently playing\" Discord activity",
|
||||
"AddGameDirBoxTooltip": "Enter a game directory to add to the list",
|
||||
"AddGameDirTooltip": "Add a game directory to the list",
|
||||
"RemoveGameDirTooltip": "Remove selected game directory",
|
||||
"CustomThemeCheckTooltip": "Enable or disable custom themes in the GUI",
|
||||
"CustomThemeCheckTooltip": "Use a custom Avalonia theme for the GUI to change the appearance of the emulator menus",
|
||||
"CustomThemePathTooltip": "Path to custom GUI theme",
|
||||
"CustomThemeBrowseTooltip": "Browse for a custom GUI theme",
|
||||
"DockModeToggleTooltip": "Enable or disable Docked Mode",
|
||||
"DirectKeyboardTooltip": "Enable or disable \"direct keyboard access (HID) support\" (Provides games access to your keyboard as a text entry device)",
|
||||
"DirectMouseTooltip": "Enable or disable \"direct mouse access (HID) support\" (Provides games access to your mouse as a pointing device)",
|
||||
"DockModeToggleTooltip": "Docked mode makes the emulated system behave as a docked Nintendo Switch. This improves graphical fidelity in most games. Conversely, disabling this will make the emulated system behave as a handheld Nintendo Switch, reducing graphics quality.\n\nConfigure player 1 controls if planning to use docked mode; configure handheld controls if planning to use handheld mode.\n\nLeave ON if unsure.",
|
||||
"DirectKeyboardTooltip": "Direct keyboard access (HID) support. Provides games access to your keyboard as a text entry device.",
|
||||
"DirectMouseTooltip": "Direct mouse access (HID) support. Provides games access to your mouse as a pointing device.",
|
||||
"RegionTooltip": "Change System Region",
|
||||
"LanguageTooltip": "Change System Language",
|
||||
"TimezoneTooltip": "Change System TimeZone",
|
||||
"TimeTooltip": "Change System Time",
|
||||
"VSyncToggleTooltip": "Enables or disables Vertical Sync",
|
||||
"PptcToggleTooltip": "Enables or disables PPTC",
|
||||
"FsIntegrityToggleTooltip": "Enables integrity checks on Game content files",
|
||||
"AudioBackendTooltip": "Change Audio Backend",
|
||||
"MemoryManagerTooltip": "Change how guest memory is mapped and accessed. Greatly affects emulated CPU performance.",
|
||||
"VSyncToggleTooltip": "Emulated console's Vertical Sync. Essentially a frame-limiter for the majority of games; disabling it may cause games to run at higher speed or make loading screens take longer or get stuck.\n\nCan be toggled in-game with a hotkey of your preference. We recommend doing this if you plan on disabling it.\n\nLeave ON if unsure.",
|
||||
"PptcToggleTooltip": "Saves translated JIT functions so that they do not need to be translated every time the game loads.\n\nReduces stuttering and significantly speeds up boot times after the first boot of a game.\n\nLeave ON if unsure.",
|
||||
"FsIntegrityToggleTooltip": "Checks for corrupt files when booting a game, and if corrupt files are detected, displays a hash error in the log.\n\nHas no impact on performance and is meant to help troubleshooting.\n\nLeave ON if unsure.",
|
||||
"AudioBackendTooltip": "Changes the backend used to render audio.\n\nSDL2 is the preferred one, while OpenAL and SoundIO are used as fallbacks. Dummy will have no sound.\n\nSet to SDL2 if unsure.",
|
||||
"MemoryManagerTooltip": "Change how guest memory is mapped and accessed. Greatly affects emulated CPU performance.\n\nSet to HOST UNCHECKED if unsure.",
|
||||
"MemoryManagerSoftwareTooltip": "Use a software page table for address translation. Highest accuracy but slowest performance.",
|
||||
"MemoryManagerHostTooltip": "Directly map memory in the host address space. Much faster JIT compilation and execution.",
|
||||
"MemoryManagerUnsafeTooltip": "Directly map memory, but do not mask the address within the guest address space before access. Faster, but at the cost of safety. The guest application can access memory from anywhere in Ryujinx, so only run programs you trust with this mode.",
|
||||
"DRamTooltip": "Expands the amount of memory on the emulated system from 4GB to 6GB",
|
||||
"IgnoreMissingServicesTooltip": "Enable or disable ignoring missing services option",
|
||||
"GraphicsBackendThreadingTooltip": "Enable Graphics Backend Multithreading",
|
||||
"GalThreadingTooltip": "Executes graphics backend commands on a second thread. Allows runtime multithreading of shader compilation, reduces stuttering, and improves performance on drivers without multithreading support of their own. Slightly varying peak performance on drivers with multithreading. Ryujinx may need to be restarted to correctly disable driver built-in multithreading, or you may need to do it manually to get the best performance.",
|
||||
"ShaderCacheToggleTooltip": "Enables or disables Shader Cache",
|
||||
"DRamTooltip": "Increases the amount of memory on the emulated system from 4GB to 6GB.\n\nThis is only useful for higher-resolution texture packs or 4k resolution mods. Does NOT improve performance.\n\nLeave OFF if unsure.",
|
||||
"IgnoreMissingServicesTooltip": "Ignores unimplemented Horizon OS services. This may help in bypassing crashes when booting certain games.\n\nLeave OFF if unsure.",
|
||||
"GraphicsBackendThreadingTooltip": "Executes graphics backend commands on a second thread.\n\nSpeeds up shader compilation, reduces stuttering, and improves performance on GPU drivers without multithreading support of their own. Slightly better performance on drivers with multithreading.\n\nSet to AUTO if unsure.",
|
||||
"GalThreadingTooltip": "Executes graphics backend commands on a second thread.\n\nSpeeds up shader compilation, reduces stuttering, and improves performance on GPU drivers without multithreading support of their own. Slightly better performance on drivers with multithreading.\n\nSet to AUTO if unsure.",
|
||||
"ShaderCacheToggleTooltip": "Saves a disk shader cache which reduces stuttering in subsequent runs.\n\nLeave ON if unsure.",
|
||||
"ResolutionScaleTooltip": "Resolution Scale applied to applicable render targets",
|
||||
"ResolutionScaleEntryTooltip": "Floating point resolution scale, such as 1.5. Non-integral scales are more likely to cause issues or crash.",
|
||||
"AnisotropyTooltip": "Level of Anisotropic Filtering (set to Auto to use the value requested by the game)",
|
||||
"AspectRatioTooltip": "Aspect Ratio applied to the renderer window.",
|
||||
"ShaderDumpPathTooltip": "Graphics Shaders Dump Path",
|
||||
"FileLogTooltip": "Enables or disables logging to a file on disk",
|
||||
"StubLogTooltip": "Enables printing stub log messages",
|
||||
"InfoLogTooltip": "Enables printing info log messages",
|
||||
"WarnLogTooltip": "Enables printing warning log messages",
|
||||
"ErrorLogTooltip": "Enables printing error log messages",
|
||||
"TraceLogTooltip": "Enables printing trace log messages",
|
||||
"GuestLogTooltip": "Enables printing guest log messages",
|
||||
"FileAccessLogTooltip": "Enables printing file access log messages",
|
||||
"FileLogTooltip": "Saves console logging to a log file on disk. Does not affect performance.",
|
||||
"StubLogTooltip": "Prints stub log messages in the console. Does not affect performance.",
|
||||
"InfoLogTooltip": "Prints info log messages in the console. Does not affect performance.",
|
||||
"WarnLogTooltip": "Prints warning log messages in the console. Does not affect performance.",
|
||||
"ErrorLogTooltip": "Prints error log messages in the console. Does not affect performance.",
|
||||
"TraceLogTooltip": "Prints trace log messages in the console. Does not affect performance.",
|
||||
"GuestLogTooltip": "Prints guest log messages in the console. Does not affect performance.",
|
||||
"FileAccessLogTooltip": "Prints file access log messages in the console.",
|
||||
"FSAccessLogModeTooltip": "Enables FS access log output to the console. Possible modes are 0-3",
|
||||
"DeveloperOptionTooltip": "Use with care",
|
||||
"OpenGlLogLevel": "Requires appropriate log levels enabled",
|
||||
"DebugLogTooltip": "Enables printing debug log messages",
|
||||
"LoadApplicationFileTooltip": "Open a file chooser to choose a Switch compatible file to load",
|
||||
"LoadApplicationFolderTooltip": "Open a file chooser to choose a Switch compatible, unpacked application to load",
|
||||
"DebugLogTooltip": "Prints debug log messages in the console.\n\nOnly use this if specifically instructed by a staff member, as it will make logs difficult to read and worsen emulator performance.",
|
||||
"LoadApplicationFileTooltip": "Open a file explorer to choose a Switch compatible file to load",
|
||||
"LoadApplicationFolderTooltip": "Open a file explorer to choose a Switch compatible, unpacked application to load",
|
||||
"OpenRyujinxFolderTooltip": "Open Ryujinx filesystem folder",
|
||||
"OpenRyujinxLogsTooltip": "Opens the folder where logs are written to",
|
||||
"ExitTooltip": "Exit Ryujinx",
|
||||
@ -478,8 +478,8 @@
|
||||
"AboutRyujinxContributorsButtonHeader": "See All Contributors",
|
||||
"SettingsTabSystemAudioVolume": "Volume: ",
|
||||
"AudioVolumeTooltip": "Change Audio Volume",
|
||||
"SettingsTabSystemEnableInternetAccess": "Enable Guest Internet Access",
|
||||
"EnableInternetAccessTooltip": "Enables guest Internet access. If enabled, the application will behave as if the emulated Switch console was connected to the Internet. Note that in some cases, applications may still access the Internet even with this option disabled",
|
||||
"SettingsTabSystemEnableInternetAccess": "Guest Internet Access/LAN Mode",
|
||||
"EnableInternetAccessTooltip": "Allows the emulated application to connect to the Internet.\n\nGames with a LAN mode can connect to each other when this is enabled and the systems are connected to the same access point. This includes real consoles as well.\n\nDoes NOT allow connecting to Nintendo servers. May cause crashing in certain games that try to connect to the Internet.\n\nLeave OFF if unsure.",
|
||||
"GameListContextMenuManageCheatToolTip": "Manage Cheats",
|
||||
"GameListContextMenuManageCheat": "Manage Cheats",
|
||||
"ControllerSettingsStickRange": "Range:",
|
||||
@ -494,10 +494,10 @@
|
||||
"DialogUpdaterFlatpakNotSupportedMessage": "Please update Ryujinx via FlatHub.",
|
||||
"UpdaterDisabledWarningTitle": "Updater Disabled!",
|
||||
"GameListContextMenuOpenSdModsDirectory": "Open Atmosphere Mods Directory",
|
||||
"GameListContextMenuOpenSdModsDirectoryToolTip": "Opens the alternative SD card Atmosphere directory which contains Application's Mods",
|
||||
"GameListContextMenuOpenSdModsDirectoryToolTip": "Opens the alternative SD card Atmosphere directory which contains Application's Mods. Useful for mods that are packaged for real hardware.",
|
||||
"ControllerSettingsRotate90": "Rotate 90° Clockwise",
|
||||
"IconSize": "Icon Size",
|
||||
"IconSizeTooltip": "Change the size of game icon",
|
||||
"IconSizeTooltip": "Change the size of game icons",
|
||||
"MenuBarOptionsShowConsole": "Show Console",
|
||||
"ShaderCachePurgeError": "Error purging shader cache at {0}: {1}",
|
||||
"UserErrorNoKeys": "Keys not found",
|
||||
@ -553,6 +553,27 @@
|
||||
"SettingsTabHotkeysToggleMuteHotkey": "Mute:",
|
||||
"ControllerMotionTitle": "Motion Control Settings",
|
||||
"ControllerRumbleTitle": "Rumble Settings",
|
||||
"SettingsSelectThemeFileDialogTitle" : "Select Theme File",
|
||||
"SettingsXamlThemeFile" : "Xaml Theme File"
|
||||
"SettingsSelectThemeFileDialogTitle": "Select Theme File",
|
||||
"SettingsXamlThemeFile": "Xaml Theme File",
|
||||
"AvatarWindowTitle": "Manage Accounts - Avatar",
|
||||
"Amiibo": "Amiibo",
|
||||
"Unknown": "Unknown",
|
||||
"Usage": "Usage",
|
||||
"Writable": "Writable",
|
||||
"SelectDlcDialogTitle": "Select DLC files",
|
||||
"SelectUpdateDialogTitle": "Select update files",
|
||||
"UserProfileWindowTitle": "Manage User Profiles",
|
||||
"CheatWindowTitle": "Manage Game Cheats",
|
||||
"DlcWindowTitle": "Manage Game DLC",
|
||||
"UpdateWindowTitle": "Manage Game Updates",
|
||||
"CheatWindowHeading": "Cheats Available for {0} [{1}]",
|
||||
"DlcWindowHeading": "DLC Available for {0} [{1}]",
|
||||
"UserProfilesEditProfile": "Edit Selected",
|
||||
"Cancel": "Cancel",
|
||||
"Save": "Save",
|
||||
"Discard": "Discard",
|
||||
"UserProfilesSetProfileImage": "Set Profile Image",
|
||||
"UserProfileEmptyNameError": "Name is required",
|
||||
"UserProfileNoImageError": "Profile image must be set",
|
||||
"GameUpdateWindowHeading": "Updates Available for {0} [{1}]"
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
{
|
||||
"MenuBarFileOpenApplet": "Abrir applet",
|
||||
"MenuBarFileOpenAppletOpenMiiAppletToolTip": "Abre el editor de Mii en modo autónomo",
|
||||
"SettingsTabInputDirectMouseAccess": "Acceso directo al ratón",
|
||||
@ -109,9 +109,9 @@
|
||||
"SettingsTabSystemSystemLanguageTraditionalChinese": "Chino tradicional",
|
||||
"SettingsTabSystemSystemTimeZone": "Zona horaria del sistema:",
|
||||
"SettingsTabSystemSystemTime": "Hora del sistema:",
|
||||
"SettingsTabSystemEnableVsync": "Habilitar sincronización vertical",
|
||||
"SettingsTabSystemEnablePptc": "Habilitar PPTC (Profiled Persistent Translation Cache)",
|
||||
"SettingsTabSystemEnableFsIntegrityChecks": "Habilitar comprobaciones de integridad FS",
|
||||
"SettingsTabSystemEnableVsync": "Sincronización vertical",
|
||||
"SettingsTabSystemEnablePptc": "PPTC (Profiled Persistent Translation Cache)",
|
||||
"SettingsTabSystemEnableFsIntegrityChecks": "Comprobar integridad de los archivos",
|
||||
"SettingsTabSystemAudioBackend": "Motor de audio:",
|
||||
"SettingsTabSystemAudioBackendDummy": "Dummy",
|
||||
"SettingsTabSystemAudioBackendOpenAL": "OpenAL",
|
||||
@ -120,10 +120,10 @@
|
||||
"SettingsTabSystemHacks": "Hacks",
|
||||
"SettingsTabSystemHacksNote": " - Pueden causar inestabilidad",
|
||||
"SettingsTabSystemExpandDramSize": "Expandir DRAM a 6GB",
|
||||
"SettingsTabSystemIgnoreMissingServices": "Ignorar falta de servicios",
|
||||
"SettingsTabSystemIgnoreMissingServices": "Ignorar servicios no implementados",
|
||||
"SettingsTabGraphics": "Gráficos",
|
||||
"SettingsTabGraphicsEnhancements": "Mejoras",
|
||||
"SettingsTabGraphicsEnableShaderCache": "Habilitar caché de sombreadores",
|
||||
"SettingsTabGraphicsEnableShaderCache": "Caché de sombreadores",
|
||||
"SettingsTabGraphicsAnisotropicFiltering": "Filtro anisotrópico:",
|
||||
"SettingsTabGraphicsAnisotropicFilteringAuto": "Auto",
|
||||
"SettingsTabGraphicsAnisotropicFiltering2x": "x2",
|
||||
@ -152,6 +152,7 @@
|
||||
"SettingsTabLoggingEnableInfoLogs": "Habilitar registros de Info",
|
||||
"SettingsTabLoggingEnableWarningLogs": "Habilitar registros de Advertencia",
|
||||
"SettingsTabLoggingEnableErrorLogs": "Habilitar registros de Error",
|
||||
"SettingsTabLoggingEnableTraceLogs": "Habilitar registros de Rastro",
|
||||
"SettingsTabLoggingEnableGuestLogs": "Habilitar registros de Guest",
|
||||
"SettingsTabLoggingEnableFsAccessLogs": "Habilitar registros de Fs Access",
|
||||
"SettingsTabLoggingFsGlobalAccessLogMode": "Modo de registros Fs Global Access:",
|
||||
@ -163,7 +164,7 @@
|
||||
"SettingsTabLoggingOpenglLogLevelAll": "Todo",
|
||||
"SettingsTabLoggingEnableDebugLogs": "Habilitar registros de debug",
|
||||
"SettingsTabInput": "Entrada",
|
||||
"SettingsTabInputEnableDockedMode": "Habilitar modo acoplado (dock/TV)",
|
||||
"SettingsTabInputEnableDockedMode": "Modo dock/TV",
|
||||
"SettingsTabInputDirectKeyboardAccess": "Acceso directo al teclado",
|
||||
"SettingsButtonSave": "Guardar",
|
||||
"SettingsButtonClose": "Cerrar",
|
||||
@ -312,8 +313,8 @@
|
||||
"DialogUpdaterConvertFailedMessage": "No se pudo convertir la versión actual de Ryujinx.",
|
||||
"DialogUpdaterCancelUpdateMessage": "¡Cancelando actualización!",
|
||||
"DialogUpdaterAlreadyOnLatestVersionMessage": "¡Ya tienes la versión más reciente de Ryujinx!",
|
||||
"DialogUpdaterFailedToGetVersionMessage": "Ha ocurrido un error al intentar obtener información de versión desde AppVeyor.",
|
||||
"DialogUpdaterConvertFailedAppveyorMessage": "No se pudo convertir la versión de Ryujinx recibida de AppVeyor.",
|
||||
"DialogUpdaterFailedToGetVersionMessage": "Ha ocurrido un error al intentar obtener información de versión desde GitHub Release. Esto puede ocurrir cuando una nueva versión está siendo compilada por GitHub Actions. Inténtalo de nuevo en unos minutos.",
|
||||
"DialogUpdaterConvertFailedGithubMessage": "No se pudo convertir la versión de Ryujinx recibida de GitHub Release.",
|
||||
"DialogUpdaterDownloadingMessage": "Descargando actualización...",
|
||||
"DialogUpdaterExtractionMessage": "Extrayendo actualización...",
|
||||
"DialogUpdaterRenamingMessage": "Renombrando actualización...",
|
||||
@ -417,49 +418,50 @@
|
||||
"OrderDescending": "Descendente",
|
||||
"SettingsTabGraphicsFeatures": "Funcionalidades",
|
||||
"ErrorWindowTitle": "Ventana de error",
|
||||
"ToggleDiscordTooltip": "Activa o desactiva la presencia enriquecida de Discord",
|
||||
"ToggleDiscordTooltip": "Elige si muestras Ryujinx o no en tu actividad de Discord cuando lo estés usando",
|
||||
"AddGameDirBoxTooltip": "Elige un directorio de juegos para mostrar en la ventana principal",
|
||||
"AddGameDirTooltip": "Agrega un directorio de juegos a la lista",
|
||||
"RemoveGameDirTooltip": "Quita el directorio seleccionado de la lista",
|
||||
"CustomThemeCheckTooltip": "Activa o desactiva los temas personalizados para la interfaz",
|
||||
"CustomThemePathTooltip": "Carpeta que contiene los temas personalizados para la interfaz",
|
||||
"CustomThemeBrowseTooltip": "Busca un tema personalizado para la interfaz",
|
||||
"DockModeToggleTooltip": "Activa o desactiva el modo TV de la Nintendo Switch",
|
||||
"DockModeToggleTooltip": "El modo dock o modo TV hace que la consola emulada se comporte como una Nintendo Switch en su dock. Esto mejora la calidad gráfica en la mayoría de los juegos. Del mismo modo, si lo desactivas, el sistema emulado se comportará como una Nintendo Switch en modo portátil, reduciendo la cálidad de los gráficos.\n\nConfigura los controles de \"Jugador\" 1 si planeas jugar en modo dock/TV; configura los controles de \"Portátil\" si planeas jugar en modo portátil.\n\nActívalo si no sabes qué hacer.",
|
||||
"DirectKeyboardTooltip": "Activa o desactiva \"soporte para acceso directo al teclado (HID)\" (Permite a los juegos utilizar tu teclado como entrada de texto)",
|
||||
"DirectMouseTooltip": "Activa o desactiva \"soporte para acceso directo al ratón (HID)\" (Permite a los juegos utilizar tu ratón como cursor)",
|
||||
"RegionTooltip": "Cambia la región del sistema",
|
||||
"LanguageTooltip": "Cambia el idioma del sistema",
|
||||
"TimezoneTooltip": "Cambia la zona horaria del sistema",
|
||||
"TimeTooltip": "Cambia la hora del sistema",
|
||||
"VSyncToggleTooltip": "Activa o desactiva la sincronización vertical",
|
||||
"PptcToggleTooltip": "Activa o desactiva la caché de PPTC",
|
||||
"FsIntegrityToggleTooltip": "Activa comprobaciones de integridad de los archivos de un juego",
|
||||
"AudioBackendTooltip": "Cambia el motor de audio",
|
||||
"MemoryManagerTooltip": "Cambia la forma de mapear y acceder a la memoria del guest. Afecta en gran medida al rendimiento de la CPU emulada.",
|
||||
"VSyncToggleTooltip": "Sincronización vertical del sistema emulado. A efectos prácticos es un límite de fotogramas para la mayoría de juegos; deshabilitarlo puede hacer que los juegos se aceleren o que las pantallas de carga tarden más o se atasquen.\n\nPuedes activar y desactivar esto mientras el emulador está funcionando con un atajo de teclado a tu elección. Recomendamos hacer esto en vez de deshabilitarlo.\n\nActívalo si no sabes qué hacer.",
|
||||
"PptcToggleTooltip": "Guarda funciones de JIT traducidas para que no sea necesario traducirlas cada vez que el juego carga.\n\nReduce los tirones y acelera significativamente el tiempo de inicio de los juegos después de haberlos ejecutado al menos una vez.\n\nActívalo si no sabes qué hacer.",
|
||||
"FsIntegrityToggleTooltip": "Comprueba si hay archivos corruptos en los juegos que ejecutes al abrirlos, y si detecta archivos corruptos, muestra un error de Hash en los registros.\n\nEsto no tiene impacto alguno en el rendimiento y está pensado para ayudar a resolver problemas.\n\nActívalo si no sabes qué hacer.",
|
||||
"AudioBackendTooltip": "Cambia el motor usado para renderizar audio.\n\nSDL2 es el preferido, mientras que OpenAL y SoundIO se usan si hay problemas con este. Dummy no produce audio.\n\nSelecciona SDL2 si no sabes qué hacer.",
|
||||
"MemoryManagerTooltip": "Cambia la forma de mapear y acceder a la memoria del guest. Afecta en gran medida al rendimiento de la CPU emulada.\n\nSelecciona \"Host sin verificación\" si no sabes qué hacer.",
|
||||
"MemoryManagerSoftwareTooltip": "Usa una tabla de paginación de software para traducir direcciones. Ofrece la precisión más exacta pero el rendimiento más lento.",
|
||||
"MemoryManagerHostTooltip": "Mapea la memoria directamente en la dirección de espacio del host. Compilación y ejecución JIT mucho más rápida.",
|
||||
"MemoryManagerUnsafeTooltip": "Mapea la memoria directamente, pero no enmascara la dirección dentro del espacio de dirección del guest antes del acceso. El modo más rápido, pero a costa de seguridad. La aplicación guest puede acceder a la memoria desde cualquier parte en Ryujinx, así que ejecuta solo programas en los que confíes cuando uses este modo.",
|
||||
"DRamTooltip": "Expande la memoria DRAM del sistema emulado de 4GB a 6GB. Utilizar solo con mods 4K.",
|
||||
"IgnoreMissingServicesTooltip": "Activa o desactiva un hack para ignorar servicios no implementados",
|
||||
"GraphicsBackendThreadingTooltip": "Activa el multihilado del motor gráfico",
|
||||
"GalThreadingTooltip": "Ejecuta los comandos del motor gráfico en un segundo hilo. Permite multihilar la compilación de sombreadores, reduce los tirones, y mejora el rendimiento en controladores gráficos sin necesidad de que utilicen su propio multihilado. Rendimiento máximo ligeramente variable en controladores gráficos que soporten multihilado. Ryujinx puede necesitar reiniciarse para desactivar correctamente el multihilado de tu controlador de gráficos, o puede que tengas que desactivarlo manualmente para lograr el mejor rendimiento posible.",
|
||||
"ShaderCacheToggleTooltip": "Activa o desactiva la caché de sombreadores",
|
||||
"DRamTooltip": "Expande la memoria DRAM del sistema emulado de 4GB a 6GB.\n\nUtilizar solo con packs de texturas HD o mods de resolución 4K. NO mejora el rendimiento.\n\nDesactívalo si no sabes qué hacer.",
|
||||
"IgnoreMissingServicesTooltip": "Hack para ignorar servicios no implementados del Horizon OS. Esto puede ayudar a sobrepasar crasheos cuando inicies ciertos juegos.\n\nDesactívalo si no sabes qué hacer.",
|
||||
"GraphicsBackendThreadingTooltip": "Ejecuta los comandos del motor gráfico en un segundo hilo. Acelera la compilación de sombreadores, reduce los tirones, y mejora el rendimiento en controladores gráficos que no realicen su propio multihilado. Rendimiento máximo ligeramente superior en controladores gráficos que soporten multihilado.\n\nSelecciona \"Auto\" si no sabes qué hacer.",
|
||||
"GalThreadingTooltip": "Ejecuta los comandos del motor gráfico en un segundo hilo. Acelera la compilación de sombreadores, reduce los tirones, y mejora el rendimiento en controladores gráficos que no realicen su propio multihilado. Rendimiento máximo ligeramente superior en controladores gráficos que soporten multihilado.\n\nSelecciona \"Auto\" si no sabes qué hacer.",
|
||||
"ShaderCacheToggleTooltip": "Guarda una caché de sombreadores en disco, la cual reduce los tirones a medida que vas jugando.\n\nActívalo si no sabes qué hacer.",
|
||||
"ResolutionScaleTooltip": "Escala de resolución aplicada a objetivos aplicables en el renderizado",
|
||||
"ResolutionScaleEntryTooltip": "Escalado de resolución de coma flotante, como por ejemplo 1,5. Los valores no íntegros pueden causar errores gráficos o crashes.",
|
||||
"AnisotropyTooltip": "Nivel de filtrado anisotrópico (selecciona Auto para utilizar el valor solicitado por el juego)",
|
||||
"AspectRatioTooltip": "Relación de aspecto aplicada a la ventana de renderizado.",
|
||||
"ShaderDumpPathTooltip": "Directorio en el cual se volcarán los sombreadores de los gráficos",
|
||||
"FileLogTooltip": "Activa o desactiva el guardado de registros en archivos en disco",
|
||||
"StubLogTooltip": "Activa mensajes de Stub en la consola",
|
||||
"InfoLogTooltip": "Activa mensajes de Info en la consola",
|
||||
"WarnLogTooltip": "Activa mensajes de Advertencia en la consola",
|
||||
"ErrorLogTooltip": "Activa mensajes de Error en la consola",
|
||||
"GuestLogTooltip": "Activa mensajes de Guest en la consola",
|
||||
"FileLogTooltip": "Guarda los registros de la consola en archivos en disco. No afectan al rendimiento.",
|
||||
"StubLogTooltip": "Escribe mensajes de Stub en la consola. No afectan al rendimiento.",
|
||||
"InfoLogTooltip": "Escribe mensajes de Info en la consola. No afectan al rendimiento.",
|
||||
"WarnLogTooltip": "Escribe mensajes de Advertencia en la consola. No afectan al rendimiento.",
|
||||
"ErrorLogTooltip": "Escribe mensajes de Error en la consola. No afectan al rendimiento.",
|
||||
"TraceLogTooltip": "Escribe mensajes de Rastro en la consola. No afectan al rendimiento.",
|
||||
"GuestLogTooltip": "Escribe mensajes de Guest en la consola. No afectan al rendimiento.",
|
||||
"FileAccessLogTooltip": "Activa mensajes de acceso a archivo en la consola",
|
||||
"FSAccessLogModeTooltip": "Activa registros FS Access en la consola. Los modos posibles son entre 0 y 3",
|
||||
"DeveloperOptionTooltip": "Usar con cuidado",
|
||||
"OpenGlLogLevel": "Requiere activar los niveles de registro apropiados",
|
||||
"DebugLogTooltip": "Activa mensajes de debug en la consola",
|
||||
"DebugLogTooltip": "Escribe mensajes de debug en la consola\n\nActiva esto solo si un miembro del equipo te lo pide expresamente, pues hará que el registro sea difícil de leer y empeorará el rendimiento del emulador.",
|
||||
"LoadApplicationFileTooltip": "Abre el explorador de archivos para elegir un archivo compatible con Switch para cargar",
|
||||
"LoadApplicationFolderTooltip": "Abre el explorador de archivos para elegir un archivo desempaquetado y compatible con Switch para cargar",
|
||||
"OpenRyujinxFolderTooltip": "Abre la carpeta de sistema de Ryujinx",
|
||||
@ -473,22 +475,98 @@
|
||||
"GridSize": "Tamaño de cuadrícula",
|
||||
"GridSizeTooltip": "Cambia el tamaño de los objetos en la cuadrícula",
|
||||
"SettingsTabSystemSystemLanguageBrazilianPortuguese": "Portugués brasileño",
|
||||
"AboutRyujinxContributorsButtonHeader" : "Ver todos los contribuidores",
|
||||
"AboutRyujinxContributorsButtonHeader": "Ver todos los contribuidores",
|
||||
"SettingsTabSystemAudioVolume": "Volumen: ",
|
||||
"AudioVolumeTooltip": "Ajusta el nivel de volumen",
|
||||
"SettingsTabSystemEnableInternetAccess": "Habilitar acceso a Internet del guest",
|
||||
"EnableInternetAccessTooltip": "Activa el acceso a Internet del guest. Cuando esté activo, la aplicación actuará como si la Nintendo Switch emulada estuviese conectada a Internet. Ten en cuenta que algunas aplicaciones pueden intentar acceder a Internet incluso con esta opción desactivada.",
|
||||
"GameListContextMenuManageCheatToolTip" : "Activa o desactiva los cheats",
|
||||
"GameListContextMenuManageCheat" : "Administrar cheats",
|
||||
"ControllerSettingsStickRange" : "Alcance:",
|
||||
"DialogStopEmulationTitle" : "Ryujinx - Detener emulación",
|
||||
"SettingsTabSystemEnableInternetAccess": "Conectar guest a Internet/Modo LAN",
|
||||
"EnableInternetAccessTooltip": "Permite a la aplicación emulada conectarse a Internet.\n\nLos juegos que tengan modo LAN podrán conectarse entre sí habilitando esta opción y estando conectados al mismo módem. Asimismo, esto permite conexiones con consolas reales.\n\nNO permite conectar con los servidores de Nintendo Online. Puede causar que ciertos juegos crasheen al intentar conectarse a sus servidores.\n\nDesactívalo si no estás seguro.",
|
||||
"GameListContextMenuManageCheatToolTip": "Activa o desactiva los cheats",
|
||||
"GameListContextMenuManageCheat": "Administrar cheats",
|
||||
"ControllerSettingsStickRange": "Alcance:",
|
||||
"DialogStopEmulationTitle": "Ryujinx - Detener emulación",
|
||||
"DialogStopEmulationMessage": "¿Seguro que quieres detener la emulación actual?",
|
||||
"SettingsTabCpu": "CPU",
|
||||
"SettingsTabAudio": "Audio",
|
||||
"SettingsTabNetwork": "Red",
|
||||
"SettingsTabNetworkConnection" : "Conexión de red",
|
||||
"SettingsTabCpuCache" : "Caché de CPU",
|
||||
"SettingsTabCpuMemory" : "Memoria de CPU",
|
||||
"ControllerMotionTitle": "Motion Control Settings",
|
||||
"ControllerRumbleTitle": "Rumble Settings"
|
||||
"SettingsTabNetworkConnection": "Conexión de red",
|
||||
"SettingsTabCpuCache": "Caché de CPU",
|
||||
"SettingsTabCpuMemory": "Memoria de CPU",
|
||||
"DialogUpdaterFlatpakNotSupportedMessage": "Por favor, actualiza Ryujinx a través de FlatHub.",
|
||||
"UpdaterDisabledWarningTitle": "¡Actualizador deshabilitado!",
|
||||
"GameListContextMenuOpenSdModsDirectory": "Abrir carpeta de mods Atmosphere",
|
||||
"GameListContextMenuOpenSdModsDirectoryToolTip": "Abre la carpeta alternativa de mods en la que puedes insertar mods de Atmosphere. Útil para mods que vengan organizados para uso en consola.",
|
||||
"ControllerSettingsRotate90": "Rotar 90° en el sentido de las agujas del reloj",
|
||||
"IconSize": "Tamaño de iconos",
|
||||
"IconSizeTooltip": "Cambia el tamaño de los iconos de juegos",
|
||||
"MenuBarOptionsShowConsole": "Mostrar consola",
|
||||
"ShaderCachePurgeError": "Error al eliminar la caché en {0}: {1}",
|
||||
"UserErrorNoKeys": "No se encontraron keys",
|
||||
"UserErrorNoFirmware": "No se encontró firmware",
|
||||
"UserErrorFirmwareParsingFailed": "Error al analizar el firmware",
|
||||
"UserErrorApplicationNotFound": "No se encontró la aplicación",
|
||||
"UserErrorUnknown": "Error desconocido",
|
||||
"UserErrorUndefined": "Error indefinido",
|
||||
"UserErrorNoKeysDescription": "Ryujinx no pudo encontrar tus 'prod.keys'.",
|
||||
"UserErrorNoFirmwareDescription": "Ryujinx no pudo encontrar un firmware instalado.",
|
||||
"UserErrorFirmwareParsingFailedDescription": "Ryujinx no pudo analizar el firmware. Normalmente esto ocurre debido a keys desfasadas.",
|
||||
"UserErrorApplicationNotFoundDescription": "Ryujinx no pudo encontrar una aplicación válida en ese camino.",
|
||||
"UserErrorUnknownDescription": "¡Ocurrió un error desconocido!",
|
||||
"UserErrorUndefinedDescription": "¡Ocurrió un error indefinido! Esto no debería pasar, por favor, ¡contacta con un desarrollador!",
|
||||
"OpenSetupGuideMessage": "Abrir la guía de instalación",
|
||||
"NoUpdate": "No actualizado",
|
||||
"TitleUpdateVersionLabel": "Versión {0} - {1}",
|
||||
"RyujinxInfo": "Ryujinx - Info",
|
||||
"RyujinxConfirm": "Ryujinx - Confirmación",
|
||||
"FileDialogAllTypes": "Todos los tipos",
|
||||
"Never": "Nunca",
|
||||
"SwkbdMinCharacters": "Debe tener al menos {0} caracteres",
|
||||
"SwkbdMinRangeCharacters": "Debe tener {0}-{1} caracteres",
|
||||
"SoftwareKeyboard": "Teclado de software",
|
||||
"DialogControllerAppletMessagePlayerRange": "La aplicación require {0} jugador(es) con:\n\nTYPES: {1}\n\nPLAYERS: {2}\n\n{3}Por favor abre las opciones y reconfigura los dispositivos de entrada o presiona 'Cerrar'.",
|
||||
"DialogControllerAppletMessage": "La aplicación require exactamente {0} jugador(es) con:\n\nTYPES: {1}\n\nPLAYERS: {2}\n\n{3}Por favor abre las opciones y reconfigura los dispositivos de entrada o presiona 'Cerrar'.",
|
||||
"DialogControllerAppletDockModeSet": "Modo dock/TV activo. El control portátil también es inválido.\n\n",
|
||||
"UpdaterRenaming": "Renombrando archivos viejos...",
|
||||
"UpdaterRenameFailed": "El actualizador no pudo renombrar el archivo: {0}",
|
||||
"UpdaterAddingFiles": "Añadiendo nuevos archivos...",
|
||||
"UpdaterExtracting": "Extrayendo actualización...",
|
||||
"UpdaterDownloading": "Descargando actualización...",
|
||||
"Game": "Juego",
|
||||
"Docked": "Dock/TV",
|
||||
"Handheld": "Portátil",
|
||||
"ConnectionError": "Error de conexión.",
|
||||
"AboutPageDeveloperListMore": "{0} y más...",
|
||||
"ApiError": "Error de API.",
|
||||
"LoadingHeading": "Cargando {0}",
|
||||
"CompilingPPTC": "Compilando PTC",
|
||||
"CompilingShaders": "Compilando sombreadores",
|
||||
"AllKeyboards": "Todos los teclados",
|
||||
"OpenFileDialogTitle": "Selecciona un archivo soportado para cargar",
|
||||
"OpenFolderDialogTitle": "Selecciona una carpeta con un juego desempaquetado",
|
||||
"AllSupportedFormats": "Todos los formatos soportados",
|
||||
"RyujinxUpdater": "Actualizador de Ryujinx",
|
||||
"SettingsTabHotkeys": "Atajos de teclado",
|
||||
"SettingsTabHotkeysHotkeys": "Atajos de teclado",
|
||||
"SettingsTabHotkeysToggleVsyncHotkey": "Alternar la sincronización vertical:",
|
||||
"SettingsTabHotkeysScreenshotHotkey": "Captura de pantalla:",
|
||||
"SettingsTabHotkeysShowUiHotkey": "Mostrar interfaz:",
|
||||
"SettingsTabHotkeysPauseHotkey": "Pausar:",
|
||||
"SettingsTabHotkeysToggleMuteHotkey": "Silenciar:",
|
||||
"ControllerMotionTitle": "Opciones de controles de movimiento",
|
||||
"ControllerRumbleTitle": "Opciones de vibración",
|
||||
"SettingsSelectThemeFileDialogTitle": "Selecciona un archivo de tema",
|
||||
"SettingsXamlThemeFile": "Archivo de tema Xaml",
|
||||
"AvatarWindowTitle": "Administrar cuentas - Avatar",
|
||||
"Amiibo": "Amiibo",
|
||||
"Unknown": "Desconocido",
|
||||
"Usage": "Usage",
|
||||
"Writable": "Escribible",
|
||||
"SelectDlcDialogTitle": "Selecciona archivo(s) de DLC",
|
||||
"SelectUpdateDialogTitle": "Selecciona archivo(s) de actualización",
|
||||
"UserProfileWindowTitle": "Administrar perfiles de usuario",
|
||||
"CheatWindowTitle": "Administrar cheats",
|
||||
"DlcWindowTitle": "Administrar contenido descargable",
|
||||
"UpdateWindowTitle": "Administrar actualizaciones",
|
||||
"CheatWindowHeading": "Cheats disponibles para {0} [{1}]",
|
||||
"DlcWindowHeading": "Contenido descargable disponible para {0} [{1}]",
|
||||
"GameUpdateWindowHeading": "Actualizaciones disponibles para {0} [{1}]"
|
||||
}
|
||||
|
@ -1,34 +1,34 @@
|
||||
{
|
||||
"MenuBarFileOpenApplet": "打开小程序",
|
||||
"MenuBarFileOpenAppletOpenMiiAppletToolTip": "打开独立的Mii小程序",
|
||||
"MenuBarFileOpenAppletOpenMiiAppletToolTip": "打开独立的 Mii 小程序",
|
||||
"SettingsTabInputDirectMouseAccess": "直通鼠标操作",
|
||||
"SettingsTabSystemMemoryManagerMode": "内存管理模式:",
|
||||
"SettingsTabSystemMemoryManagerModeSoftware": "软件",
|
||||
"SettingsTabSystemMemoryManagerModeHost": "本机 (快速)",
|
||||
"SettingsTabSystemMemoryManagerModeHostUnchecked": "跳过检查的本机 (最快速)",
|
||||
"MenuBarFile": "文件(_F)",
|
||||
"MenuBarFileOpenFromFile": "加载文件中的程序(_L)",
|
||||
"MenuBarFileOpenUnpacked": "加载解包后的游戏(_U)",
|
||||
"MenuBarFileOpenEmuFolder": "打开Ryujinx文件夹",
|
||||
"SettingsTabSystemMemoryManagerModeHostUnchecked": "跳过检查的本机 (最快)",
|
||||
"MenuBarFile": "文件",
|
||||
"MenuBarFileOpenFromFile": "加载文件",
|
||||
"MenuBarFileOpenUnpacked": "加载解包后的游戏",
|
||||
"MenuBarFileOpenEmuFolder": "打开 Ryujinx 文件夹",
|
||||
"MenuBarFileOpenLogsFolder": "打开日志文件夹",
|
||||
"MenuBarFileExit": "退出(_E)",
|
||||
"MenuBarFileExit": "退出",
|
||||
"MenuBarOptions": "选项",
|
||||
"MenuBarOptionsToggleFullscreen": "切换全屏",
|
||||
"MenuBarOptionsStartGamesInFullscreen": "以全屏模式启动游戏",
|
||||
"MenuBarOptionsStopEmulation": "中止模拟",
|
||||
"MenuBarOptionsSettings": "设置(_S)",
|
||||
"MenuBarOptionsManageUserProfiles": "管理用户账户(_M)",
|
||||
"MenuBarActions": "行动(_A)",
|
||||
"MenuBarOptionsStartGamesInFullscreen": "全屏模式启动游戏",
|
||||
"MenuBarOptionsStopEmulation": "停止模拟",
|
||||
"MenuBarOptionsSettings": "设置",
|
||||
"MenuBarOptionsManageUserProfiles": "管理用户账户",
|
||||
"MenuBarActions": "操作",
|
||||
"MenuBarOptionsSimulateWakeUpMessage": "模拟唤醒消息",
|
||||
"MenuBarActionsScanAmiibo": "扫描Amiibo",
|
||||
"MenuBarTools": "工具(_T)",
|
||||
"MenuBarActionsScanAmiibo": "扫描 Amiibo",
|
||||
"MenuBarTools": "工具",
|
||||
"MenuBarToolsInstallFirmware": "安装固件",
|
||||
"MenuBarFileToolsInstallFirmwareFromFile": "从 XCI 或 ZIP 安装固件",
|
||||
"MenuBarFileToolsInstallFirmwareFromDirectory": "从文件夹安装固件",
|
||||
"MenuBarHelp": "帮助",
|
||||
"MenuBarHelpCheckForUpdates": "检查更新",
|
||||
"MenuBarHelpAbout": "关于",
|
||||
"MenuSearch": "搜索...",
|
||||
"MenuSearch": "搜索……",
|
||||
"GameListHeaderFavorite": "收藏",
|
||||
"GameListHeaderIcon": "图标",
|
||||
"GameListHeaderApplication": "名称",
|
||||
@ -43,13 +43,13 @@
|
||||
"GameListContextMenuOpenUserSaveDirectoryToolTip": "打开储存游戏存档的目录",
|
||||
"GameListContextMenuOpenUserDeviceDirectory": "打开应用系统目录",
|
||||
"GameListContextMenuOpenUserDeviceDirectoryToolTip": "打开包含游戏系统设置的目录",
|
||||
"GameListContextMenuOpenUserBcatDirectory": "打开BCAT目录",
|
||||
"GameListContextMenuOpenUserBcatDirectoryToolTip": "打开包含游戏BCAT数据的目录",
|
||||
"GameListContextMenuOpenUserBcatDirectory": "打开 BCAT 目录",
|
||||
"GameListContextMenuOpenUserBcatDirectoryToolTip": "打开包含游戏 BCAT 数据的目录",
|
||||
"GameListContextMenuManageTitleUpdates": "管理游戏更新",
|
||||
"GameListContextMenuManageTitleUpdatesToolTip": "打开更新管理窗口",
|
||||
"GameListContextMenuManageDlc": "管理DLC",
|
||||
"GameListContextMenuManageDlc": "管理 DLC",
|
||||
"GameListContextMenuManageDlcToolTip": "打开 DLC 管理窗口",
|
||||
"GameListContextMenuOpenModsDirectory": "打开MOD目录",
|
||||
"GameListContextMenuOpenModsDirectory": "打开 MOD 目录",
|
||||
"GameListContextMenuOpenModsDirectoryToolTip": "打开存放游戏MOD的目录",
|
||||
"GameListContextMenuCacheManagement": "缓存管理",
|
||||
"GameListContextMenuCacheManagementPurgePptc": "清除 PPTC 缓存",
|
||||
@ -72,10 +72,10 @@
|
||||
"Settings": "设置",
|
||||
"SettingsTabGeneral": "用户界面",
|
||||
"SettingsTabGeneralGeneral": "常规",
|
||||
"SettingsTabGeneralEnableDiscordRichPresence": "启用Discord在线状态展示",
|
||||
"SettingsTabGeneralEnableDiscordRichPresence": "启用 Discord 在线状态展示",
|
||||
"SettingsTabGeneralCheckUpdatesOnLaunch": "自动检查更新",
|
||||
"SettingsTabGeneralShowConfirmExitDialog": "显示 \"确认退出\" 对话框",
|
||||
"SettingsTabGeneralHideCursorOnIdle": "空闲时隐藏鼠标",
|
||||
"SettingsTabGeneralHideCursorOnIdle": "自动隐藏鼠标",
|
||||
"SettingsTabGeneralGameDirectories": "游戏目录",
|
||||
"SettingsTabGeneralAdd": "添加",
|
||||
"SettingsTabGeneralRemove": "删除",
|
||||
@ -119,7 +119,7 @@
|
||||
"SettingsTabSystemAudioBackendSDL2": "SDL2",
|
||||
"SettingsTabSystemHacks": "修正",
|
||||
"SettingsTabSystemHacksNote": " - 会引起模拟器不稳定",
|
||||
"SettingsTabSystemExpandDramSize": "将模拟RAM大小扩展至 6GB",
|
||||
"SettingsTabSystemExpandDramSize": "将模拟RAM大小扩展到 6GB",
|
||||
"SettingsTabSystemIgnoreMissingServices": "忽略缺少的服务",
|
||||
"SettingsTabGraphics": "图像",
|
||||
"SettingsTabGraphicsEnhancements": "增强",
|
||||
@ -184,12 +184,12 @@
|
||||
"ControllerSettingsDeviceDisabled": "关闭",
|
||||
"ControllerSettingsControllerType": "手柄类型",
|
||||
"ControllerSettingsControllerTypeHandheld": "掌机",
|
||||
"ControllerSettingsControllerTypeProController": "Pro手柄",
|
||||
"ControllerSettingsControllerTypeProController": "Pro 手柄",
|
||||
"ControllerSettingsControllerTypeJoyConPair": "JoyCon",
|
||||
"ControllerSettingsControllerTypeJoyConLeft": "左JoyCon",
|
||||
"ControllerSettingsControllerTypeJoyConRight": "右JoyCon",
|
||||
"ControllerSettingsControllerTypeJoyConLeft": "左 JoyCon",
|
||||
"ControllerSettingsControllerTypeJoyConRight": "右 JoyCon",
|
||||
"ControllerSettingsProfile": "预设",
|
||||
"ControllerSettingsProfileDefault": "默认",
|
||||
"ControllerSettingsProfileDefault": "Default",
|
||||
"ControllerSettingsLoad": "加载",
|
||||
"ControllerSettingsAdd": "新建",
|
||||
"ControllerSettingsRemove": "删除",
|
||||
@ -243,19 +243,17 @@
|
||||
"ControllerSettingsMisc": "其他",
|
||||
"ControllerSettingsTriggerThreshold": "扳机阈值:",
|
||||
"ControllerSettingsMotion": "体感",
|
||||
"ControllerSettingsCemuHook": "CemuHook",
|
||||
"ControllerSettingsMotionEnableMotionControls": "启用体感操作",
|
||||
"ControllerSettingsMotionUseCemuhookCompatibleMotion": "使用CemuHook体感协议",
|
||||
"ControllerSettingsMotionUseCemuhookCompatibleMotion": "使用 CemuHook 体感协议",
|
||||
"ControllerSettingsMotionControllerSlot": "手柄:",
|
||||
"ControllerSettingsMotionMirrorInput": "镜像操作",
|
||||
"ControllerSettingsMotionRightJoyConSlot": "右JoyCon:",
|
||||
"ControllerSettingsMotionServerHost": "服务器Host:",
|
||||
"ControllerSettingsMotionRightJoyConSlot": "右 JoyCon:",
|
||||
"ControllerSettingsMotionServerHost": "服务器 Host:",
|
||||
"ControllerSettingsMotionGyroSensitivity": "陀螺仪敏感度:",
|
||||
"ControllerSettingsMotionGyroDeadzone": "陀螺仪死区:",
|
||||
"ControllerSettingsSave": "保存",
|
||||
"ControllerSettingsClose": "关闭",
|
||||
"UserProfilesSelectedUserProfile": "选择用户账户:",
|
||||
"UserProfilesSaveProfileName": "保存账户名",
|
||||
"UserProfilesSelectedUserProfile": "选择的用户账户:",
|
||||
"UserProfilesSaveProfileName": "保存名称",
|
||||
"UserProfilesChangeProfileImage": "更换头像",
|
||||
"UserProfilesAvailableUserProfiles": "现有的账户:",
|
||||
"UserProfilesAddNewProfile": "新建账户",
|
||||
@ -281,7 +279,7 @@
|
||||
"ControllerSettingsSaveProfileToolTip": "保存预设",
|
||||
"MenuBarFileToolsTakeScreenshot": "保存截图",
|
||||
"MenuBarFileToolsHideUi": "隐藏UI",
|
||||
"GameListContextMenuToggleFavorite": "标记为收藏",
|
||||
"GameListContextMenuToggleFavorite": "收藏",
|
||||
"GameListContextMenuToggleFavoriteToolTip": "启用或取消收藏标记",
|
||||
"SettingsTabGeneralTheme": "主题",
|
||||
"SettingsTabGeneralThemeCustomTheme": "自选主题路径",
|
||||
@ -290,9 +288,8 @@
|
||||
"SettingsTabGeneralThemeBaseStyleLight": "浅色",
|
||||
"SettingsTabGeneralThemeEnableCustomTheme": "使用自选主题界面",
|
||||
"ButtonBrowse": "浏览",
|
||||
"ControllerSettingsMotionConfigureCemuHookSettings": "配置CemuHook体感",
|
||||
"ControllerSettingsConfigureGeneral": "配置",
|
||||
"ControllerSettingsRumble": "震动",
|
||||
"ControllerSettingsRumbleEnable": "启用震动",
|
||||
"ControllerSettingsRumbleStrongMultiplier": "强震动调节",
|
||||
"ControllerSettingsRumbleWeakMultiplier": "弱震动调节",
|
||||
"DialogMessageSaveNotAvailableMessage": "没有{0} [{1:x16}]的游戏存档",
|
||||
@ -302,9 +299,9 @@
|
||||
"DialogErrorTitle": "Ryujinx - 错误",
|
||||
"DialogWarningTitle": "Ryujinx - 警告",
|
||||
"DialogExitTitle": "Ryujinx - 关闭",
|
||||
"DialogErrorMessage": "Ryujinx遇到了错误",
|
||||
"DialogExitMessage": "是否关闭Ryujinx?",
|
||||
"DialogExitSubMessage": "所有未保存的进度会丢失!",
|
||||
"DialogErrorMessage": "Ryujinx 遇到了错误",
|
||||
"DialogExitMessage": "是否关闭 Ryujinx?",
|
||||
"DialogExitSubMessage": "未保存的进度会丢失",
|
||||
"DialogMessageCreateSaveErrorMessage": "创建特定的存档时出错: {0}",
|
||||
"DialogMessageFindSaveErrorMessage": "查找特定的存档时出错: {0}",
|
||||
"FolderDialogExtractTitle": "选择要解压到的文件夹",
|
||||
@ -315,9 +312,9 @@
|
||||
"DialogNcaExtractionSuccessMessage": "提取成功。",
|
||||
"DialogUpdaterConvertFailedMessage": "无法转换当前 Ryujinx 版本。",
|
||||
"DialogUpdaterCancelUpdateMessage": "更新取消!",
|
||||
"DialogUpdaterAlreadyOnLatestVersionMessage": "您使用的Ryujinx是最新版本。",
|
||||
"DialogUpdaterFailedToGetVersionMessage": "尝试从 Github 获取版本信息时无效。可能由于 GitHub Actions 正在编译新版本。请过几分钟重试。",
|
||||
"DialogUpdaterConvertFailedGithubMessage": "无法转换从 Github 接收到的 Ryujinx 版本转换。",
|
||||
"DialogUpdaterAlreadyOnLatestVersionMessage": "您使用的 Ryujinx 是最新版本。",
|
||||
"DialogUpdaterFailedToGetVersionMessage": "尝试从 Github 获取版本信息时无效。\\n可能由于 GitHub Actions 正在编译新版本。请过几分钟重试。",
|
||||
"DialogUpdaterConvertFailedGithubMessage": "无法转换从 Github 接收到的 Ryujinx 版本。",
|
||||
"DialogUpdaterDownloadingMessage": "下载新版本中...",
|
||||
"DialogUpdaterExtractionMessage": "正在提取更新...",
|
||||
"DialogUpdaterRenamingMessage": "正在删除旧文件...",
|
||||
@ -328,7 +325,7 @@
|
||||
"DialogUpdaterArchNotSupportedSubMessage": "(仅支持 x64 系统)",
|
||||
"DialogUpdaterNoInternetMessage": "没有连接到互联网",
|
||||
"DialogUpdaterNoInternetSubMessage": "请确保互联网连接正常。",
|
||||
"DialogUpdaterDirtyBuildMessage": "不能更新第三方版本的 Ryujinx!",
|
||||
"DialogUpdaterDirtyBuildMessage": "不能更新非官方版本的 Ryujinx!",
|
||||
"DialogUpdaterDirtyBuildSubMessage": "如果希望使用受支持的版本,请您在 https://ryujinx.org/ 下载。",
|
||||
"DialogRestartRequiredMessage": "需要重启模拟器",
|
||||
"DialogThemeRestartMessage": "主题设置已保存。需要重新启动才能生效。",
|
||||
@ -344,7 +341,7 @@
|
||||
"DialogErrorAppletErrorExceptionMessage": "显示错误对话框时出错: {0}",
|
||||
"DialogUserErrorDialogMessage": "{0}: {1}",
|
||||
"DialogUserErrorDialogInfoMessage": "\n有关修复此错误的更多信息,可以遵循我们的设置指南。",
|
||||
"DialogUserErrorDialogTitle": "Ryujinx错误 ({0})",
|
||||
"DialogUserErrorDialogTitle": "Ryujinx 错误 ({0})",
|
||||
"DialogAmiiboApiTitle": "Amiibo API",
|
||||
"DialogAmiiboApiFailFetchMessage": "从 API 获取信息时出错。",
|
||||
"DialogAmiiboApiConnectErrorMessage": "无法连接到 Amiibo API 服务器。服务器可能已关闭,或者您没有网络连接。",
|
||||
@ -357,7 +354,7 @@
|
||||
"DialogPPTCDeletionErrorMessage": "清除位于{0}的 PPTC 缓存时出错: {1}",
|
||||
"DialogShaderDeletionMessage": "您即将删除:\n\n{0}的着色器缓存\n\n确定吗?",
|
||||
"DialogShaderDeletionErrorMessage": "清除位于{0}的着色器缓存时出错: {1}",
|
||||
"DialogRyujinxErrorMessage": "Ryujinx遇到错误",
|
||||
"DialogRyujinxErrorMessage": "Ryujinx 遇到错误",
|
||||
"DialogInvalidTitleIdErrorMessage": "UI 错误:所选游戏没有有效的标题ID",
|
||||
"DialogFirmwareInstallerFirmwareNotFoundErrorMessage": "路径{0}找不到有效的系统固件。",
|
||||
"DialogFirmwareInstallerFirmwareInstallTitle": "安装固件{0}",
|
||||
@ -376,11 +373,11 @@
|
||||
"DialogPerformanceCheckLoggingEnabledConfirmMessage": "为了获得最佳性能,建议禁用跟踪日志记录。您是否要立即禁用?",
|
||||
"DialogPerformanceCheckShaderDumpEnabledMessage": "您启用了着色器转储,仅供开发人员使用。",
|
||||
"DialogPerformanceCheckShaderDumpEnabledConfirmMessage": "为了获得最佳性能,建议禁用着色器转储。您是否要立即禁用?",
|
||||
"DialogLoadAppGameAlreadyLoadedMessage": "当前已加载有游戏",
|
||||
"DialogLoadAppGameAlreadyLoadedMessage": "已有游戏正在运行",
|
||||
"DialogLoadAppGameAlreadyLoadedSubMessage": "请停止模拟或关闭程序,再启动另一个游戏。",
|
||||
"DialogUpdateAddUpdateErrorMessage": "选择的文件不包含所选游戏的更新!",
|
||||
"DialogSettingsBackendThreadingWarningTitle": "警告 - 后端多线程",
|
||||
"DialogSettingsBackendThreadingWarningMessage": "改变此选项后必须重启 Ryujinx 才能生效。根据您的硬件,您开启该选项时,可能需要手动禁用驱动程序本身的GL多线程。",
|
||||
"DialogSettingsBackendThreadingWarningMessage": "改变此选项后必须重启 Ryujinx 才能生效。\\n根据您的硬件,您开启该选项时,可能需要手动禁用驱动程序本身的GL多线程。",
|
||||
"SettingsTabGraphicsFeaturesOptions": "功能",
|
||||
"SettingsTabGraphicsBackendMultithreading": "后端多线程:",
|
||||
"CommonAuto": "自动(推荐)",
|
||||
@ -391,23 +388,23 @@
|
||||
"DialogProfileInvalidProfileNameErrorMessage": "文件名包含无效字符,请重试。",
|
||||
"MenuBarOptionsPauseEmulation": "暂停",
|
||||
"MenuBarOptionsResumeEmulation": "继续",
|
||||
"AboutUrlTooltipMessage": "在浏览器中打开Ryujinx的官网。",
|
||||
"AboutDisclaimerMessage": "Ryujinx以任何方式都与Nintendo™以及任何商业伙伴没有关联",
|
||||
"AboutAmiiboDisclaimerMessage": "我们的Amiibo模拟使用了\nAmiiboAPI (www.amiiboapi.com) ",
|
||||
"AboutPatreonUrlTooltipMessage": "在浏览器中打开Ryujinx的Patreon赞助页。",
|
||||
"AboutGithubUrlTooltipMessage": "在浏览器中打开Ryujinx的GitHub代码库。",
|
||||
"AboutDiscordUrlTooltipMessage": "在浏览器中打开Ryujinx的Discord邀请链接。",
|
||||
"AboutTwitterUrlTooltipMessage": "在浏览器中打开Ryujinx的Twitter主页。",
|
||||
"AboutUrlTooltipMessage": "在浏览器中打开 Ryujinx 的官网。",
|
||||
"AboutDisclaimerMessage": "Ryujinx 以任何方式与Nintendo™及其任何商业伙伴都没有关联",
|
||||
"AboutAmiiboDisclaimerMessage": "我们的 Amiibo 模拟使用了\nAmiiboAPI (www.amiiboapi.com) ",
|
||||
"AboutPatreonUrlTooltipMessage": "在浏览器中打开 Ryujinx 的 Patreon 赞助页。",
|
||||
"AboutGithubUrlTooltipMessage": "在浏览器中打开 Ryujinx 的 GitHub 代码库。",
|
||||
"AboutDiscordUrlTooltipMessage": "在浏览器中打开 Ryujinx 的 Discord 邀请链接。",
|
||||
"AboutTwitterUrlTooltipMessage": "在浏览器中打开 Ryujinx 的 Twitter 主页。",
|
||||
"AboutRyujinxAboutTitle": "关于:",
|
||||
"AboutRyujinxAboutContent": "Ryujinx是Nintendo Switch™的模拟器.\n您可以在Patreon上支持Ryujinx。\n关注Twitter或者Discord可以获取模拟器最新动态。\n如果您对开发感兴趣,欢迎来GitHub和Discord加入我们!",
|
||||
"AboutRyujinxAboutContent": "Ryujinx是一款Nintendo Switch™模拟器。\n您可以在 Patreon 上赞助 Ryujinx。\n关注 Twitter 或 Discord 可以获取模拟器最新动态。\n如果您对开发感兴趣,欢迎来 GitHub 和 Discord 加入我们!",
|
||||
"AboutRyujinxMaintainersTitle": "由以下作者维护:",
|
||||
"AboutRyujinxMaintainersContentTooltipMessage": "在浏览器中打开贡献者的网页",
|
||||
"AboutRyujinxSupprtersTitle": "感谢Patreon的赞助者:",
|
||||
"AmiiboSeriesLabel": "Amiibo系列",
|
||||
"AboutRyujinxSupprtersTitle": "感谢 Patreon 的赞助者:",
|
||||
"AmiiboSeriesLabel": "Amiibo 系列",
|
||||
"AmiiboCharacterLabel": "角色",
|
||||
"AmiiboScanButtonLabel": "扫描",
|
||||
"AmiiboOptionsShowAllLabel": "显示所有 Amiibo",
|
||||
"AmiiboOptionsUsRandomTagLabel": "修正: 使用随机标记的Uuid",
|
||||
"AmiiboOptionsUsRandomTagLabel": "修正:使用随机标记的 Uuid",
|
||||
"DlcManagerTableHeadingEnabledLabel": "启用",
|
||||
"DlcManagerTableHeadingTitleIdLabel": "游戏ID",
|
||||
"DlcManagerTableHeadingContainerPathLabel": "文件夹路径",
|
||||
@ -421,59 +418,59 @@
|
||||
"OrderDescending": "从大到小",
|
||||
"SettingsTabGraphicsFeatures": "额外功能",
|
||||
"ErrorWindowTitle": "错误窗口",
|
||||
"ToggleDiscordTooltip": "启用或关闭Discord详细在线状态展示",
|
||||
"ToggleDiscordTooltip": "启用或关闭 Discord 详细在线状态展示",
|
||||
"AddGameDirBoxTooltip": "输入要添加的游戏目录",
|
||||
"AddGameDirTooltip": "添加游戏目录到列表中",
|
||||
"RemoveGameDirTooltip": "移除选中的目录",
|
||||
"CustomThemeCheckTooltip": "启用或关闭自定义主题",
|
||||
"CustomThemePathTooltip": "自定义主题的目录",
|
||||
"CustomThemeBrowseTooltip": "查找自定义主题",
|
||||
"DockModeToggleTooltip": "是否开启Swith的主机模式",
|
||||
"DirectKeyboardTooltip": "是否开启\"直连键盘访问(HID)支持\" (部分游戏可以使用您的键盘输入文字)",
|
||||
"DirectMouseTooltip": "是否开启\"直连鼠标访问(HID)支持\" (部分游戏可以使用您的鼠标导航)",
|
||||
"DockModeToggleTooltip": "是否开启 Switch 的主机模式",
|
||||
"DirectKeyboardTooltip": "是否开启\"直连键盘访问(HID)支持\"\n(部分游戏可以使用您的键盘输入文字)",
|
||||
"DirectMouseTooltip": "是否开启\"直连鼠标访问(HID)支持\"\n(部分游戏可以使用您的鼠标导航)",
|
||||
"RegionTooltip": "更改系统区域",
|
||||
"LanguageTooltip": "更改系统语言",
|
||||
"TimezoneTooltip": "更改系统时区",
|
||||
"TimeTooltip": "更改系统时钟",
|
||||
"VSyncToggleTooltip": "开启可以消除帧撕裂,关闭可以提高性能",
|
||||
"PptcToggleTooltip": "开启以后减少游戏启动时间",
|
||||
"VSyncToggleTooltip": "关闭后,部分使用动态帧率的游戏可以超过60Hz的刷新率",
|
||||
"PptcToggleTooltip": "开启以后减少游戏启动时间和卡顿",
|
||||
"FsIntegrityToggleTooltip": "是否检查游戏文件内容的完整性",
|
||||
"AudioBackendTooltip": "默认推荐SDL,但每种音频后端对各类游戏兼容性可能不同",
|
||||
"MemoryManagerTooltip": "改变Switch内存映射到电脑内存的方式,会影响CPU性能消耗",
|
||||
"AudioBackendTooltip": "默认推荐SDL,但每种音频后端对各类游戏兼容性不同,遇到音频问题可以尝试切换后端",
|
||||
"MemoryManagerTooltip": "改变 Switch 内存映射到电脑内存的方式,会影响CPU性能消耗",
|
||||
"MemoryManagerSoftwareTooltip": "使用软件内存页管理,最精确但是速度最慢",
|
||||
"MemoryManagerHostTooltip": "直接映射内存页到电脑内存,JIT效率很高",
|
||||
"MemoryManagerUnsafeTooltip": "直接映射内存页,但是不检查内存溢出,JIT效率最高。Ryujinx可以访问任何位置的内存,所以相对不安全。此模式下只应运行您信任的游戏或软件(即官方游戏)",
|
||||
"DRamTooltip": "扩展模拟的Switch内存为6GB,某些高清纹理MOD或4K MOD需要此选项",
|
||||
"MemoryManagerHostTooltip": "直接映射内存页到电脑内存,JIT效率高",
|
||||
"MemoryManagerUnsafeTooltip": "直接映射内存页,但不检查内存溢出,JIT效率最高。\nRyujinx可以访问任何位置的内存,因而相对不安全。此模式下只应运行您信任的游戏或软件(即官方游戏)",
|
||||
"DRamTooltip": "扩展模拟的 Switch 内存为6GB。\n某些高清纹理MOD或4K MOD需要此选项",
|
||||
"IgnoreMissingServicesTooltip": "忽略某些未实现的系统服务,少部分游戏需要此选项才能启动",
|
||||
"GraphicsBackendThreadingTooltip": "启用后端多线程",
|
||||
"GalThreadingTooltip": "使用模拟器自带的多线程调度,减少着色器编译的卡顿,并提高驱动程序的性能(尤其是缺失多线程的AMD)。NVIDIA用户需要重启模拟器才能禁用驱动本身的多线程,否则您需手动执行禁用获得最佳性能",
|
||||
"ShaderCacheToggleTooltip": "开启后缓存着色器到硬盘,减少画面卡顿",
|
||||
"GalThreadingTooltip": "使用模拟器自带的多线程调度,减少着色器编译的卡顿,并提高驱动程序的性能(尤其是缺失多线程的AMD)。\nNVIDIA用户需要重启模拟器才能禁用驱动本身的多线程,否则您需手动执行禁用获得最佳性能",
|
||||
"ShaderCacheToggleTooltip": "开启后缓存着色器到本地,减少游戏卡顿",
|
||||
"ResolutionScaleTooltip": "缩放渲染的分辨率",
|
||||
"ResolutionScaleEntryTooltip": "尽量使用如1.5的浮点倍数。非整数的倍率易引起错误",
|
||||
"AnisotropyTooltip": "各向异性过滤等级。能提高倾斜视角纹理的清晰度('自动'使用游戏默认指定的等级)",
|
||||
"AspectRatioTooltip": "模拟器渲染窗口的宽高比",
|
||||
"ResolutionScaleEntryTooltip": "尽量使用例如1.5的浮点倍数。非整数的倍率易引起 BUG",
|
||||
"AnisotropyTooltip": "各向异性过滤等级。提高倾斜视角纹理的清晰度\n('自动'使用游戏默认指定的等级)",
|
||||
"AspectRatioTooltip": "渲染窗口的宽高比",
|
||||
"ShaderDumpPathTooltip": "转储图形着色器的路径",
|
||||
"FileLogTooltip": "是否保存日志文件到硬盘",
|
||||
"StubLogTooltip": "记录stub消息",
|
||||
"InfoLogTooltip": "记录info消息",
|
||||
"WarnLogTooltip": "记录warning消息",
|
||||
"ErrorLogTooltip": "记录error消息",
|
||||
"TraceLogTooltip": "记录trace消息",
|
||||
"GuestLogTooltip": "记录guest消息",
|
||||
"StubLogTooltip": "记录Stub消息",
|
||||
"InfoLogTooltip": "记录Info消息",
|
||||
"WarnLogTooltip": "记录Warning消息",
|
||||
"ErrorLogTooltip": "记录Error消息",
|
||||
"TraceLogTooltip": "记录Trace消息",
|
||||
"GuestLogTooltip": "记录Guest消息",
|
||||
"FileAccessLogTooltip": "记录文件访问消息",
|
||||
"FSAccessLogModeTooltip": "记录FS访问消息,输出到控制台。可选的模式是0-3",
|
||||
"DeveloperOptionTooltip": "使用请谨慎",
|
||||
"OpenGlLogLevel": "需要打开适当的日志等级",
|
||||
"DebugLogTooltip": "记录debug消息",
|
||||
"LoadApplicationFileTooltip": "选择Switch格式的游戏并加载",
|
||||
"LoadApplicationFolderTooltip": "选择一个解包后格式的Switch游戏并加载",
|
||||
"OpenRyujinxFolderTooltip": "打开Ryujinx系统目录",
|
||||
"DebugLogTooltip": "记录Debug消息",
|
||||
"LoadApplicationFileTooltip": "选择 Switch 支持的游戏格式并加载",
|
||||
"LoadApplicationFolderTooltip": "选择解包后的 Switch 游戏并加载",
|
||||
"OpenRyujinxFolderTooltip": "打开 Ryujinx 系统目录",
|
||||
"OpenRyujinxLogsTooltip": "打开日志存放的目录",
|
||||
"ExitTooltip": "关闭Ryujinx",
|
||||
"ExitTooltip": "关闭 Ryujinx",
|
||||
"OpenSettingsTooltip": "打开设置窗口",
|
||||
"OpenProfileManagerTooltip": "打开用户账号管理器",
|
||||
"StopEmulationTooltip": "停止运行当前游戏并回到选择界面",
|
||||
"CheckUpdatesTooltip": "检查新版本Ryujinx",
|
||||
"OpenProfileManagerTooltip": "打开用户账户管理界面",
|
||||
"StopEmulationTooltip": "停止运行当前游戏并回到主界面",
|
||||
"CheckUpdatesTooltip": "检查 Ryujinx 新版本",
|
||||
"OpenAboutTooltip": "打开'关于'窗口",
|
||||
"GridSize": "网格尺寸",
|
||||
"GridSizeTooltip": "调整网格模式的大小",
|
||||
@ -482,7 +479,7 @@
|
||||
"SettingsTabSystemAudioVolume": "音量: ",
|
||||
"AudioVolumeTooltip": "调节音量",
|
||||
"SettingsTabSystemEnableInternetAccess": "启用网络连接",
|
||||
"EnableInternetAccessTooltip": "开启互联网访问。此选项打开后,效果类似于Switch连接到互联网的状态。注意即使此选项关闭,应用程序也偶尔有可能连接到网络",
|
||||
"EnableInternetAccessTooltip": "开启互联网访问。此选项打开后,效果类似于 Switch 连接到互联网的状态。\n注意即使此选项关闭,应用程序偶尔也有可能连接到网络",
|
||||
"GameListContextMenuManageCheatToolTip": "管理金手指",
|
||||
"GameListContextMenuManageCheat": "管理金手指",
|
||||
"ControllerSettingsStickRange": "范围",
|
||||
@ -496,8 +493,8 @@
|
||||
"SettingsTabCpuMemory": "CPU 内存",
|
||||
"DialogUpdaterFlatpakNotSupportedMessage": "请通过 FlatHub 更新 Ryujinx。",
|
||||
"UpdaterDisabledWarningTitle": "更新已禁用!",
|
||||
"GameListContextMenuOpenSdModsDirectory": "打开Atmosphere MOD目录",
|
||||
"GameListContextMenuOpenSdModsDirectoryToolTip": "打开包含应用程序MOD的其他Atmosphere SD卡目录",
|
||||
"GameListContextMenuOpenSdModsDirectory": "打开 Atmosphere MOD 目录",
|
||||
"GameListContextMenuOpenSdModsDirectoryToolTip": "打开包含应用程序 MOD 的额外 Atmosphere SD 卡目录",
|
||||
"ControllerSettingsRotate90": "顺时针旋转 90°",
|
||||
"IconSize": "图标尺寸",
|
||||
"IconSizeTooltip": "更改游戏图标大小",
|
||||
@ -509,14 +506,14 @@
|
||||
"UserErrorApplicationNotFound": "找不到应用程序",
|
||||
"UserErrorUnknown": "未知错误",
|
||||
"UserErrorUndefined": "未定义错误",
|
||||
"UserErrorNoKeysDescription": "Ryujinx找不到 'prod.keys' 文件",
|
||||
"UserErrorNoFirmwareDescription": "Ryujinx找不到任何已安装的固件",
|
||||
"UserErrorFirmwareParsingFailedDescription": "Ryujinx无法解密选择的固件。通常是由于过旧的密钥。",
|
||||
"UserErrorApplicationNotFoundDescription": "Ryujinx在选中路径找不到有效的应用程序。",
|
||||
"UserErrorNoKeysDescription": "Ryujinx 找不到 'prod.keys' 文件",
|
||||
"UserErrorNoFirmwareDescription": "Ryujinx 找不到任何已安装的固件",
|
||||
"UserErrorFirmwareParsingFailedDescription": "Ryujinx 无法解密选择的固件。这通常是由于密钥过旧。",
|
||||
"UserErrorApplicationNotFoundDescription": "Ryujinx 在选中路径找不到有效的应用程序。",
|
||||
"UserErrorUnknownDescription": "发生未知错误!",
|
||||
"UserErrorUndefinedDescription": "发生了未定义错误!此类错误不应出现,请联系开发人员!",
|
||||
"OpenSetupGuideMessage": "打开设置教程",
|
||||
"NoUpdate": "没有新版",
|
||||
"NoUpdate": "无更新",
|
||||
"TitleUpdateVersionLabel": "版本 {0} - {1}",
|
||||
"RyujinxInfo": "Ryujinx - 信息",
|
||||
"RyujinxConfirm": "Ryujinx - 确认",
|
||||
@ -527,7 +524,7 @@
|
||||
"SoftwareKeyboard": "软件键盘",
|
||||
"DialogControllerAppletMessagePlayerRange": "游戏需要 {0} 个玩家()持有:\n\nTYPES: {1}\n\nPLAYERS: {2}\n\n{3}请打开设置界面,配置手柄;或者关闭窗口。",
|
||||
"DialogControllerAppletMessage": "游戏需要刚好 {0} 个玩家()持有 with:\n\nTYPES: {1}\n\nPLAYERS: {2}\n\n{3}请打开设置界面,配置手柄;或者关闭窗口。",
|
||||
"DialogControllerAppletDockModeSet": "现在处于主机模式,无法使用掌机操作方式\n\n",
|
||||
"DialogControllerAppletDockModeSet": "目前处于主机模式,无法使用掌机操作方式\n\n",
|
||||
"UpdaterRenaming": "正在删除旧文件...",
|
||||
"UpdaterRenameFailed": "更新过程中无法重命名文件: {0}",
|
||||
"UpdaterAddingFiles": "安装更新中...",
|
||||
@ -537,14 +534,39 @@
|
||||
"Docked": "主机模式",
|
||||
"Handheld": "掌机模式",
|
||||
"ConnectionError": "连接错误。",
|
||||
"AboutPageDeveloperListMore": "{0} 以及等人...",
|
||||
"AboutPageDeveloperListMore": "{0} 等开发者...",
|
||||
"ApiError": "API错误。",
|
||||
"LoadingHeading": "正在加载 {0}",
|
||||
"CompilingPPTC": "编译PPTC中",
|
||||
"LoadingHeading": "正在启动 {0}",
|
||||
"CompilingPPTC": "编译PPTC缓存中",
|
||||
"CompilingShaders": "编译着色器中",
|
||||
"AllKeyboards": "所有键盘",
|
||||
"OpenFileDialogTitle": "选择支持的文件格式",
|
||||
"OpenFolderDialogTitle": "选择一个包含解包游戏的文件夹",
|
||||
"AllSupportedFormats": "全部支持的格式",
|
||||
"RyujinxUpdater": "Ryujinx 更新程序"
|
||||
}
|
||||
"RyujinxUpdater": "Ryujinx 更新程序",
|
||||
"SettingsTabHotkeys": "快捷键",
|
||||
"SettingsTabHotkeysHotkeys": "键盘快捷键",
|
||||
"SettingsTabHotkeysToggleVsyncHotkey": "切换VSync",
|
||||
"SettingsTabHotkeysScreenshotHotkey": "截屏",
|
||||
"SettingsTabHotkeysShowUiHotkey": "隐藏UI",
|
||||
"SettingsTabHotkeysPauseHotkey": "暂停",
|
||||
"SettingsTabHotkeysToggleMuteHotkey": "静音",
|
||||
"ControllerMotionTitle": "体感操作设置",
|
||||
"ControllerRumbleTitle": "震动设置",
|
||||
"SettingsSelectThemeFileDialogTitle": "选择主题文件",
|
||||
"SettingsXamlThemeFile": "Xaml 主题文件",
|
||||
"AvatarWindowTitle": "管理账户 - 头像",
|
||||
"Amiibo": "Amiibo",
|
||||
"Unknown": "未知",
|
||||
"Usage": "使用",
|
||||
"Writable": "可写入",
|
||||
"SelectDlcDialogTitle": "选择 DLC 文件",
|
||||
"SelectUpdateDialogTitle": "选择更新文件",
|
||||
"UserProfileWindowTitle": "管理用户账户",
|
||||
"CheatWindowTitle": "管理游戏金手指",
|
||||
"DlcWindowTitle": "管理游戏 DLC",
|
||||
"UpdateWindowTitle": "管理游戏更新",
|
||||
"CheatWindowHeading": "适用于 {0} [{1}] 的金手指",
|
||||
"DlcWindowHeading": "适用于 {0} [{1}] 的 DLC",
|
||||
"GameUpdateWindowHeading": "适用于 {0} [{1}] 的更新"
|
||||
}
|
||||
|
572
Ryujinx.Ava/Assets/Locales/zh_TW.json
Normal file
572
Ryujinx.Ava/Assets/Locales/zh_TW.json
Normal file
@ -0,0 +1,572 @@
|
||||
{
|
||||
"MenuBarFileOpenApplet": "打開小程式",
|
||||
"MenuBarFileOpenAppletOpenMiiAppletToolTip": "打開獨立的 Mii 小程式",
|
||||
"SettingsTabInputDirectMouseAccess": "直通滑鼠操作",
|
||||
"SettingsTabSystemMemoryManagerMode": "記憶體管理模式:",
|
||||
"SettingsTabSystemMemoryManagerModeSoftware": "軟體",
|
||||
"SettingsTabSystemMemoryManagerModeHost": "Host (快速)",
|
||||
"SettingsTabSystemMemoryManagerModeHostUnchecked": "Host 略過檢查 (最快,但較不安全)",
|
||||
"MenuBarFile": "_檔案",
|
||||
"MenuBarFileOpenFromFile": "_載入檔案",
|
||||
"MenuBarFileOpenUnpacked": "載入_解包後的遊戲",
|
||||
"MenuBarFileOpenEmuFolder": "開啟 Ryujinx 資料夾",
|
||||
"MenuBarFileOpenLogsFolder": "開啟日誌資料夾",
|
||||
"MenuBarFileExit": "_退出",
|
||||
"MenuBarOptions": "選項",
|
||||
"MenuBarOptionsToggleFullscreen": "切換全螢幕模式",
|
||||
"MenuBarOptionsStartGamesInFullscreen": "使用全螢幕模式啟動遊戲",
|
||||
"MenuBarOptionsStopEmulation": "停止模擬",
|
||||
"MenuBarOptionsSettings": "_設定",
|
||||
"MenuBarOptionsManageUserProfiles": "_管理使用者帳號",
|
||||
"MenuBarActions": "_動作",
|
||||
"MenuBarOptionsSimulateWakeUpMessage": "模擬喚醒訊息",
|
||||
"MenuBarActionsScanAmiibo": "掃描 Amiibo",
|
||||
"MenuBarTools": "_工具",
|
||||
"MenuBarToolsInstallFirmware": "安裝韌體",
|
||||
"MenuBarFileToolsInstallFirmwareFromFile": "從 XCI 或 ZIP 安裝韌體",
|
||||
"MenuBarFileToolsInstallFirmwareFromDirectory": "從資料夾安裝韌體",
|
||||
"MenuBarHelp": "幫助",
|
||||
"MenuBarHelpCheckForUpdates": "檢查更新",
|
||||
"MenuBarHelpAbout": "關於",
|
||||
"MenuSearch": "搜尋...",
|
||||
"GameListHeaderFavorite": "收藏",
|
||||
"GameListHeaderIcon": "圖示",
|
||||
"GameListHeaderApplication": "名稱",
|
||||
"GameListHeaderDeveloper": "開發商",
|
||||
"GameListHeaderVersion": "版本",
|
||||
"GameListHeaderTimePlayed": "遊玩時間",
|
||||
"GameListHeaderLastPlayed": "上次遊玩",
|
||||
"GameListHeaderFileExtension": "副檔名",
|
||||
"GameListHeaderFileSize": "大小",
|
||||
"GameListHeaderPath": "路徑",
|
||||
"GameListContextMenuOpenUserSaveDirectory": "開啟使用者存檔資料夾",
|
||||
"GameListContextMenuOpenUserSaveDirectoryToolTip": "開啟儲存遊戲存檔的資料夾",
|
||||
"GameListContextMenuOpenUserDeviceDirectory": "開啟系統資料夾",
|
||||
"GameListContextMenuOpenUserDeviceDirectoryToolTip": "開啟包含遊戲系統設定的資料夾",
|
||||
"GameListContextMenuOpenUserBcatDirectory": "開啟 BCAT 資料夾",
|
||||
"GameListContextMenuOpenUserBcatDirectoryToolTip": "開啟包含遊戲 BCAT 資料的資料夾",
|
||||
"GameListContextMenuManageTitleUpdates": "管理遊戲更新",
|
||||
"GameListContextMenuManageTitleUpdatesToolTip": "開啟更新管理視窗",
|
||||
"GameListContextMenuManageDlc": "管理 DLC",
|
||||
"GameListContextMenuManageDlcToolTip": "開啟 DLC 管理視窗",
|
||||
"GameListContextMenuOpenModsDirectory": "開啟模組資料夾",
|
||||
"GameListContextMenuOpenModsDirectoryToolTip": "開啟存放遊戲模組的資料夾",
|
||||
"GameListContextMenuCacheManagement": "快取管理",
|
||||
"GameListContextMenuCacheManagementPurgePptc": "清除 PPTC 快取",
|
||||
"GameListContextMenuCacheManagementPurgePptcToolTip": "刪除遊戲的 PPTC 快取",
|
||||
"GameListContextMenuCacheManagementPurgeShaderCache": "清除渲染器快取",
|
||||
"GameListContextMenuCacheManagementPurgeShaderCacheToolTip": "刪除遊戲的渲染器快取",
|
||||
"GameListContextMenuCacheManagementOpenPptcDirectory": "開啟 PPTC 資料夾",
|
||||
"GameListContextMenuCacheManagementOpenPptcDirectoryToolTip": "開啟包含遊戲 PPTC 快取的資料夾",
|
||||
"GameListContextMenuCacheManagementOpenShaderCacheDirectory": "開啟渲染器快取資料夾",
|
||||
"GameListContextMenuCacheManagementOpenShaderCacheDirectoryToolTip": "開啟包含應用程式渲染器快取的資料夾",
|
||||
"GameListContextMenuExtractData": "提取資料",
|
||||
"GameListContextMenuExtractDataExeFS": "ExeFS",
|
||||
"GameListContextMenuExtractDataExeFSToolTip": "從遊戲的目前狀態中提取 ExeFS 分區(包含更新)",
|
||||
"GameListContextMenuExtractDataRomFS": "RomFS",
|
||||
"GameListContextMenuExtractDataRomFSToolTip": "從遊戲的目前狀態中提取 RomFS 分區(包含更新)",
|
||||
"GameListContextMenuExtractDataLogo": "圖示",
|
||||
"GameListContextMenuExtractDataLogoToolTip": "從遊戲的目前狀態中提取圖示(包含更新)",
|
||||
"StatusBarGamesLoaded": "{0}/{1} 遊戲載入完成",
|
||||
"StatusBarSystemVersion": "系統版本: {0}",
|
||||
"Settings": "設定",
|
||||
"SettingsTabGeneral": "使用者介面",
|
||||
"SettingsTabGeneralGeneral": "一般",
|
||||
"SettingsTabGeneralEnableDiscordRichPresence": "啟用 Discord 動態狀態展示",
|
||||
"SettingsTabGeneralCheckUpdatesOnLaunch": "自動檢查更新",
|
||||
"SettingsTabGeneralShowConfirmExitDialog": "顯示 \"確認離開\" 對話框",
|
||||
"SettingsTabGeneralHideCursorOnIdle": "自動隱藏滑鼠",
|
||||
"SettingsTabGeneralGameDirectories": "遊戲資料夾",
|
||||
"SettingsTabGeneralAdd": "新增",
|
||||
"SettingsTabGeneralRemove": "刪除",
|
||||
"SettingsTabSystem": "系統",
|
||||
"SettingsTabSystemCore": "核心",
|
||||
"SettingsTabSystemSystemRegion": "系統區域:",
|
||||
"SettingsTabSystemSystemRegionJapan": "日本",
|
||||
"SettingsTabSystemSystemRegionUSA": "美國",
|
||||
"SettingsTabSystemSystemRegionEurope": "歐洲",
|
||||
"SettingsTabSystemSystemRegionAustralia": "澳洲",
|
||||
"SettingsTabSystemSystemRegionChina": "中國",
|
||||
"SettingsTabSystemSystemRegionKorea": "韓國",
|
||||
"SettingsTabSystemSystemRegionTaiwan": "台灣",
|
||||
"SettingsTabSystemSystemLanguage": "系統語言:",
|
||||
"SettingsTabSystemSystemLanguageJapanese": "日語",
|
||||
"SettingsTabSystemSystemLanguageAmericanEnglish": "美式英語",
|
||||
"SettingsTabSystemSystemLanguageFrench": "法語",
|
||||
"SettingsTabSystemSystemLanguageGerman": "德語",
|
||||
"SettingsTabSystemSystemLanguageItalian": "義大利語",
|
||||
"SettingsTabSystemSystemLanguageSpanish": "西班牙語",
|
||||
"SettingsTabSystemSystemLanguageChinese": "中文 (中國)",
|
||||
"SettingsTabSystemSystemLanguageKorean": "韓語",
|
||||
"SettingsTabSystemSystemLanguageDutch": "荷蘭語",
|
||||
"SettingsTabSystemSystemLanguagePortuguese": "葡萄牙語",
|
||||
"SettingsTabSystemSystemLanguageRussian": "俄語",
|
||||
"SettingsTabSystemSystemLanguageTaiwanese": "中文 (台灣)",
|
||||
"SettingsTabSystemSystemLanguageBritishEnglish": "英式英語",
|
||||
"SettingsTabSystemSystemLanguageCanadianFrench": "加拿大法語",
|
||||
"SettingsTabSystemSystemLanguageLatinAmericanSpanish": "拉美西班牙語",
|
||||
"SettingsTabSystemSystemLanguageSimplifiedChinese": "簡體中文 (推薦)",
|
||||
"SettingsTabSystemSystemLanguageTraditionalChinese": "繁體中文 (推薦)",
|
||||
"SettingsTabSystemSystemTimeZone": "系統時區:",
|
||||
"SettingsTabSystemSystemTime": "系統時鐘:",
|
||||
"SettingsTabSystemEnableVsync": "開啟 VSync",
|
||||
"SettingsTabSystemEnablePptc": "開啟 PPTC 快取",
|
||||
"SettingsTabSystemEnableFsIntegrityChecks": "開啟檔案系統完整性檢查",
|
||||
"SettingsTabSystemAudioBackend": "音訊後端:",
|
||||
"SettingsTabSystemAudioBackendDummy": "無",
|
||||
"SettingsTabSystemAudioBackendOpenAL": "OpenAL",
|
||||
"SettingsTabSystemAudioBackendSoundIO": "SoundIO",
|
||||
"SettingsTabSystemAudioBackendSDL2": "SDL2",
|
||||
"SettingsTabSystemHacks": "修正",
|
||||
"SettingsTabSystemHacksNote": " - 會引起模擬器不穩定",
|
||||
"SettingsTabSystemExpandDramSize": "將模擬記憶體大小擴充至 6GB",
|
||||
"SettingsTabSystemIgnoreMissingServices": "忽略缺少的服務",
|
||||
"SettingsTabGraphics": "圖形",
|
||||
"SettingsTabGraphicsEnhancements": "增強",
|
||||
"SettingsTabGraphicsEnableShaderCache": "啟用渲染器快取",
|
||||
"SettingsTabGraphicsAnisotropicFiltering": "各向異性過濾:",
|
||||
"SettingsTabGraphicsAnisotropicFilteringAuto": "自動",
|
||||
"SettingsTabGraphicsAnisotropicFiltering2x": "2x",
|
||||
"SettingsTabGraphicsAnisotropicFiltering4x": "4x",
|
||||
"SettingsTabGraphicsAnisotropicFiltering8x": "8x",
|
||||
"SettingsTabGraphicsAnisotropicFiltering16x": "16x",
|
||||
"SettingsTabGraphicsResolutionScale": "解析度縮放:",
|
||||
"SettingsTabGraphicsResolutionScaleCustom": "自訂 (不推薦)",
|
||||
"SettingsTabGraphicsResolutionScaleNative": "原生 (720p/1080p)",
|
||||
"SettingsTabGraphicsResolutionScale2x": "2x (1440p/2160p)",
|
||||
"SettingsTabGraphicsResolutionScale3x": "3x (2160p/3240p)",
|
||||
"SettingsTabGraphicsResolutionScale4x": "4x (2880p/4320p)",
|
||||
"SettingsTabGraphicsAspectRatio": "寬高比:",
|
||||
"SettingsTabGraphicsAspectRatio4x3": "4:3",
|
||||
"SettingsTabGraphicsAspectRatio16x9": "16:9",
|
||||
"SettingsTabGraphicsAspectRatio16x10": "16:10",
|
||||
"SettingsTabGraphicsAspectRatio21x9": "21:9",
|
||||
"SettingsTabGraphicsAspectRatio32x9": "32:9",
|
||||
"SettingsTabGraphicsAspectRatioStretch": "拉伸至螢幕大小",
|
||||
"SettingsTabGraphicsDeveloperOptions": "開發者選項",
|
||||
"SettingsTabGraphicsShaderDumpPath": "圖形渲染器轉儲路徑:",
|
||||
"SettingsTabLogging": "日誌",
|
||||
"SettingsTabLoggingLogging": "日誌",
|
||||
"SettingsTabLoggingEnableLoggingToFile": "儲存日誌為檔案",
|
||||
"SettingsTabLoggingEnableStubLogs": "記錄 Stub",
|
||||
"SettingsTabLoggingEnableInfoLogs": "記錄資訊",
|
||||
"SettingsTabLoggingEnableWarningLogs": "記錄警告",
|
||||
"SettingsTabLoggingEnableErrorLogs": "記錄錯誤",
|
||||
"SettingsTabLoggingEnableTraceLogs": "記錄 Trace",
|
||||
"SettingsTabLoggingEnableGuestLogs": "記錄 Guest",
|
||||
"SettingsTabLoggingEnableFsAccessLogs": "記錄檔案存取",
|
||||
"SettingsTabLoggingFsGlobalAccessLogMode": "記錄全域檔案存取模式:",
|
||||
"SettingsTabLoggingDeveloperOptions": "開發者選項 (警告: 會降低效能)",
|
||||
"SettingsTabLoggingOpenglLogLevel": "OpenGL 日誌級別:",
|
||||
"SettingsTabLoggingOpenglLogLevelNone": "無",
|
||||
"SettingsTabLoggingOpenglLogLevelError": "錯誤",
|
||||
"SettingsTabLoggingOpenglLogLevelPerformance": "減速",
|
||||
"SettingsTabLoggingOpenglLogLevelAll": "全部",
|
||||
"SettingsTabLoggingEnableDebugLogs": "啟用除錯日誌",
|
||||
"SettingsTabInput": "輸入",
|
||||
"SettingsTabInputEnableDockedMode": "Docked 模式",
|
||||
"SettingsTabInputDirectKeyboardAccess": "直通鍵盤控制",
|
||||
"SettingsButtonSave": "儲存",
|
||||
"SettingsButtonClose": "關閉",
|
||||
"SettingsButtonApply": "套用",
|
||||
"ControllerSettingsPlayer": "玩家",
|
||||
"ControllerSettingsPlayer1": "玩家 1",
|
||||
"ControllerSettingsPlayer2": "玩家 2",
|
||||
"ControllerSettingsPlayer3": "玩家 3",
|
||||
"ControllerSettingsPlayer4": "玩家 4",
|
||||
"ControllerSettingsPlayer5": "玩家 5",
|
||||
"ControllerSettingsPlayer6": "玩家 6",
|
||||
"ControllerSettingsPlayer7": "玩家 7",
|
||||
"ControllerSettingsPlayer8": "玩家 8",
|
||||
"ControllerSettingsHandheld": "掌機模式",
|
||||
"ControllerSettingsInputDevice": "輸入設備",
|
||||
"ControllerSettingsRefresh": "更新",
|
||||
"ControllerSettingsDeviceDisabled": "關閉",
|
||||
"ControllerSettingsControllerType": "手把類型",
|
||||
"ControllerSettingsControllerTypeHandheld": "掌機",
|
||||
"ControllerSettingsControllerTypeProController": "Pro 手把",
|
||||
"ControllerSettingsControllerTypeJoyConPair": "JoyCon",
|
||||
"ControllerSettingsControllerTypeJoyConLeft": "左 JoyCon",
|
||||
"ControllerSettingsControllerTypeJoyConRight": "右 JoyCon",
|
||||
"ControllerSettingsProfile": "預設",
|
||||
"ControllerSettingsProfileDefault": "預設",
|
||||
"ControllerSettingsLoad": "載入",
|
||||
"ControllerSettingsAdd": "建立",
|
||||
"ControllerSettingsRemove": "刪除",
|
||||
"ControllerSettingsButtons": "按鈕",
|
||||
"ControllerSettingsButtonA": "A",
|
||||
"ControllerSettingsButtonB": "B",
|
||||
"ControllerSettingsButtonX": "X",
|
||||
"ControllerSettingsButtonY": "Y",
|
||||
"ControllerSettingsButtonPlus": "+",
|
||||
"ControllerSettingsButtonMinus": "-",
|
||||
"ControllerSettingsDPad": "方向鍵",
|
||||
"ControllerSettingsDPadUp": "上",
|
||||
"ControllerSettingsDPadDown": "下",
|
||||
"ControllerSettingsDPadLeft": "左",
|
||||
"ControllerSettingsDPadRight": "右",
|
||||
"ControllerSettingsLStick": "左搖桿",
|
||||
"ControllerSettingsLStickButton": "按下",
|
||||
"ControllerSettingsLStickUp": "上",
|
||||
"ControllerSettingsLStickDown": "下",
|
||||
"ControllerSettingsLStickLeft": "左",
|
||||
"ControllerSettingsLStickRight": "右",
|
||||
"ControllerSettingsLStickStick": "桿",
|
||||
"ControllerSettingsLStickInvertXAxis": "反轉 X 方向",
|
||||
"ControllerSettingsLStickInvertYAxis": "反轉 Y 方向",
|
||||
"ControllerSettingsLStickDeadzone": "死區:",
|
||||
"ControllerSettingsRStick": "右搖桿",
|
||||
"ControllerSettingsRStickButton": "按下",
|
||||
"ControllerSettingsRStickUp": "上",
|
||||
"ControllerSettingsRStickDown": "下",
|
||||
"ControllerSettingsRStickLeft": "左",
|
||||
"ControllerSettingsRStickRight": "右",
|
||||
"ControllerSettingsRStickStick": "桿",
|
||||
"ControllerSettingsRStickInvertXAxis": "反轉 X 方向",
|
||||
"ControllerSettingsRStickInvertYAxis": "反轉 Y 方向",
|
||||
"ControllerSettingsRStickDeadzone": "死區:",
|
||||
"ControllerSettingsTriggersLeft": "左 Triggers",
|
||||
"ControllerSettingsTriggersRight": "右 Triggers",
|
||||
"ControllerSettingsTriggersButtonsLeft": "左 Triggers 鍵",
|
||||
"ControllerSettingsTriggersButtonsRight": "右 Triggers 鍵",
|
||||
"ControllerSettingsTriggers": "Triggers",
|
||||
"ControllerSettingsTriggerL": "L",
|
||||
"ControllerSettingsTriggerR": "R",
|
||||
"ControllerSettingsTriggerZL": "ZL",
|
||||
"ControllerSettingsTriggerZR": "ZR",
|
||||
"ControllerSettingsLeftSL": "SL",
|
||||
"ControllerSettingsLeftSR": "SR",
|
||||
"ControllerSettingsRightSL": "SL",
|
||||
"ControllerSettingsRightSR": "SR",
|
||||
"ControllerSettingsExtraButtonsLeft": "左按鍵",
|
||||
"ControllerSettingsExtraButtonsRight": "右按鍵",
|
||||
"ControllerSettingsMisc": "其他",
|
||||
"ControllerSettingsTriggerThreshold": "Triggers 閾值:",
|
||||
"ControllerSettingsMotion": "體感",
|
||||
"ControllerSettingsMotionUseCemuhookCompatibleMotion": "使用 CemuHook 體感協議",
|
||||
"ControllerSettingsMotionControllerSlot": "手把:",
|
||||
"ControllerSettingsMotionMirrorInput": "鏡像操作",
|
||||
"ControllerSettingsMotionRightJoyConSlot": "右 JoyCon:",
|
||||
"ControllerSettingsMotionServerHost": "伺服器 Host:",
|
||||
"ControllerSettingsMotionGyroSensitivity": "陀螺儀敏感度:",
|
||||
"ControllerSettingsMotionGyroDeadzone": "陀螺儀死區:",
|
||||
"ControllerSettingsSave": "儲存",
|
||||
"ControllerSettingsClose": "關閉",
|
||||
"UserProfilesSelectedUserProfile": "選擇使用者帳號:",
|
||||
"UserProfilesSaveProfileName": "儲存帳號名稱",
|
||||
"UserProfilesChangeProfileImage": "更換頭像",
|
||||
"UserProfilesAvailableUserProfiles": "現有的帳號:",
|
||||
"UserProfilesAddNewProfile": "建立帳號",
|
||||
"UserProfilesDeleteSelectedProfile": "刪除選擇的帳號",
|
||||
"UserProfilesClose": "關閉",
|
||||
"ProfileImageSelectionTitle": "頭像選擇",
|
||||
"ProfileImageSelectionHeader": "選擇合適的頭像圖片",
|
||||
"ProfileImageSelectionNote": "您可以導入自訂頭像,或從系統中選擇頭像",
|
||||
"ProfileImageSelectionImportImage": "導入圖片檔案",
|
||||
"ProfileImageSelectionSelectAvatar": "選擇系統頭像",
|
||||
"InputDialogTitle": "輸入對話框",
|
||||
"InputDialogOk": "完成",
|
||||
"InputDialogCancel": "取消",
|
||||
"InputDialogAddNewProfileTitle": "選擇使用者名稱",
|
||||
"InputDialogAddNewProfileHeader": "請輸入帳號名稱",
|
||||
"InputDialogAddNewProfileSubtext": "(最大長度: {0})",
|
||||
"AvatarChoose": "選擇",
|
||||
"AvatarSetBackgroundColor": "設定背景顏色",
|
||||
"AvatarClose": "關閉",
|
||||
"ControllerSettingsLoadProfileToolTip": "載入預設",
|
||||
"ControllerSettingsAddProfileToolTip": "新增預設",
|
||||
"ControllerSettingsRemoveProfileToolTip": "刪除預設",
|
||||
"ControllerSettingsSaveProfileToolTip": "儲存預設",
|
||||
"MenuBarFileToolsTakeScreenshot": "儲存截圖",
|
||||
"MenuBarFileToolsHideUi": "隱藏 UI",
|
||||
"GameListContextMenuToggleFavorite": "標記為收藏",
|
||||
"GameListContextMenuToggleFavoriteToolTip": "啟用或取消收藏標記",
|
||||
"SettingsTabGeneralTheme": "主題",
|
||||
"SettingsTabGeneralThemeCustomTheme": "自定主題路徑",
|
||||
"SettingsTabGeneralThemeBaseStyle": "主題樣式",
|
||||
"SettingsTabGeneralThemeBaseStyleDark": "深色模式",
|
||||
"SettingsTabGeneralThemeBaseStyleLight": "淺色模式",
|
||||
"SettingsTabGeneralThemeEnableCustomTheme": "使用自訂主題介面",
|
||||
"ButtonBrowse": "瀏覽",
|
||||
"ControllerSettingsConfigureGeneral": "配置",
|
||||
"ControllerSettingsRumble": "震動",
|
||||
"ControllerSettingsRumbleStrongMultiplier": "強震動調節",
|
||||
"ControllerSettingsRumbleWeakMultiplier": "弱震動調節",
|
||||
"DialogMessageSaveNotAvailableMessage": "沒有{0} [{1:x16}]的遊戲存檔",
|
||||
"DialogMessageSaveNotAvailableCreateSaveMessage": "是否建立該遊戲的存檔資料夾?",
|
||||
"DialogConfirmationTitle": "Ryujinx - 設定",
|
||||
"DialogUpdaterTitle": "Ryujinx - 更新",
|
||||
"DialogErrorTitle": "Ryujinx - 錯誤",
|
||||
"DialogWarningTitle": "Ryujinx - 警告",
|
||||
"DialogExitTitle": "Ryujinx - 關閉",
|
||||
"DialogErrorMessage": "Ryujinx 遇到了錯誤",
|
||||
"DialogExitMessage": "是否關閉 Ryujinx?",
|
||||
"DialogExitSubMessage": "所有未儲存的進度會遺失!",
|
||||
"DialogMessageCreateSaveErrorMessage": "建立特定的存檔時出錯: {0}",
|
||||
"DialogMessageFindSaveErrorMessage": "查找特定的存檔時出錯: {0}",
|
||||
"FolderDialogExtractTitle": "選擇要解壓到的資料夾",
|
||||
"DialogNcaExtractionMessage": "提取{1}的{0}分區...",
|
||||
"DialogNcaExtractionTitle": "Ryujinx - NCA分區提取",
|
||||
"DialogNcaExtractionMainNcaNotFoundErrorMessage": "提取失敗。所選檔案中不含主NCA檔案",
|
||||
"DialogNcaExtractionCheckLogErrorMessage": "提取失敗。請查看日誌檔案取得詳情。",
|
||||
"DialogNcaExtractionSuccessMessage": "提取成功。",
|
||||
"DialogUpdaterConvertFailedMessage": "無法轉換目前 Ryujinx 版本。",
|
||||
"DialogUpdaterCancelUpdateMessage": "更新取消!",
|
||||
"DialogUpdaterAlreadyOnLatestVersionMessage": "您使用的 Ryujinx 是最新版本。",
|
||||
"DialogUpdaterFailedToGetVersionMessage": "嘗試從 Github 取得版本訊息時無效。可能是因為 GitHub Actions 正在編譯新版本。請過幾分鐘重試。",
|
||||
"DialogUpdaterConvertFailedGithubMessage": "無法轉換從 Github 接收到的 Ryujinx 版本。",
|
||||
"DialogUpdaterDownloadingMessage": "下載新版本中...",
|
||||
"DialogUpdaterExtractionMessage": "正在提取更新...",
|
||||
"DialogUpdaterRenamingMessage": "正在刪除舊檔案...",
|
||||
"DialogUpdaterAddingFilesMessage": "安裝更新中...",
|
||||
"DialogUpdaterCompleteMessage": "更新成功!",
|
||||
"DialogUpdaterRestartMessage": "立即重啟 Ryujinx 完成更新?",
|
||||
"DialogUpdaterArchNotSupportedMessage": "您執行的系統架構不受支援!",
|
||||
"DialogUpdaterArchNotSupportedSubMessage": "(僅支援 x64 系統)",
|
||||
"DialogUpdaterNoInternetMessage": "沒有連接到網路",
|
||||
"DialogUpdaterNoInternetSubMessage": "請確保網路連接正常。",
|
||||
"DialogUpdaterDirtyBuildMessage": "不能更新非官方版本的 Ryujinx!",
|
||||
"DialogUpdaterDirtyBuildSubMessage": "如果希望使用受支援的版本,請您在 https://ryujinx.org/ 下載。",
|
||||
"DialogRestartRequiredMessage": "需要重啟模擬器",
|
||||
"DialogThemeRestartMessage": "主題設定已儲存。需要重新啟動才能生效。",
|
||||
"DialogThemeRestartSubMessage": "您是否要重啟?",
|
||||
"DialogFirmwareInstallEmbeddedMessage": "要安裝遊戲內建的韌體嗎?(韌體 {0})",
|
||||
"DialogFirmwareInstallEmbeddedSuccessMessage": "未找到已安裝的韌體,但 Ryujinx 可以從現有的遊戲安裝韌體{0}.\\n模擬器現在可以執行。",
|
||||
"DialogFirmwareNoFirmwareInstalledMessage": "未安裝韌體",
|
||||
"DialogFirmwareInstalledMessage": "已安裝韌體{0}",
|
||||
"DialogOpenSettingsWindowLabel": "打開設定視窗",
|
||||
"DialogControllerAppletTitle": "控制器小視窗",
|
||||
"DialogMessageDialogErrorExceptionMessage": "顯示訊息對話框時出錯: {0}",
|
||||
"DialogSoftwareKeyboardErrorExceptionMessage": "顯示軟體鍵盤時出錯: {0}",
|
||||
"DialogErrorAppletErrorExceptionMessage": "顯示錯誤對話框時出錯: {0}",
|
||||
"DialogUserErrorDialogMessage": "{0}: {1}",
|
||||
"DialogUserErrorDialogInfoMessage": "\n有關修復此錯誤的更多訊息,可以遵循我們的設定指南。",
|
||||
"DialogUserErrorDialogTitle": "Ryujinx 錯誤 ({0})",
|
||||
"DialogAmiiboApiTitle": "Amiibo API",
|
||||
"DialogAmiiboApiFailFetchMessage": "從 API 取得訊息時出錯。",
|
||||
"DialogAmiiboApiConnectErrorMessage": "無法連接到 Amiibo API 伺服器。伺服器可能已關閉,或者您沒有網路連接。",
|
||||
"DialogProfileInvalidProfileErrorMessage": "預設{0} 與目前輸入配置系統不相容。",
|
||||
"DialogProfileDefaultProfileOverwriteErrorMessage": "默認預設無法被覆蓋",
|
||||
"DialogProfileDeleteProfileTitle": "刪除預設",
|
||||
"DialogProfileDeleteProfileMessage": "刪除後不可恢復,確定嗎?",
|
||||
"DialogWarning": "警告",
|
||||
"DialogPPTCDeletionMessage": "您即將刪除:\n\n{0}的 PPTC 快取\n\n確定嗎?",
|
||||
"DialogPPTCDeletionErrorMessage": "清除位於{0}的 PPTC 快取時出錯: {1}",
|
||||
"DialogShaderDeletionMessage": "您即將刪除:\n\n{0}的渲染器快取\n\n確定嗎?",
|
||||
"DialogShaderDeletionErrorMessage": "清除位於{0}的渲染器快取時出錯: {1}",
|
||||
"DialogRyujinxErrorMessage": "Ryujinx 遇到錯誤",
|
||||
"DialogInvalidTitleIdErrorMessage": "UI 錯誤:所選遊戲沒有有效的標題ID",
|
||||
"DialogFirmwareInstallerFirmwareNotFoundErrorMessage": "路徑{0}找不到有效的系統韌體。",
|
||||
"DialogFirmwareInstallerFirmwareInstallTitle": "安裝韌體{0}",
|
||||
"DialogFirmwareInstallerFirmwareInstallMessage": "將安裝{0}版本的系統。",
|
||||
"DialogFirmwareInstallerFirmwareInstallSubMessage": "\n\n這將替換目前系統版本{0}。",
|
||||
"DialogFirmwareInstallerFirmwareInstallConfirmMessage": "\n\n確認進行?",
|
||||
"DialogFirmwareInstallerFirmwareInstallWaitMessage": "安裝韌體中...",
|
||||
"DialogFirmwareInstallerFirmwareInstallSuccessMessage": "成功安裝系統版本{0}。",
|
||||
"DialogUserProfileDeletionWarningMessage": "刪除後將沒有可選擇的使用者帳號",
|
||||
"DialogUserProfileDeletionConfirmMessage": "是否刪除選擇的帳號",
|
||||
"DialogControllerSettingsModifiedConfirmMessage": "目前的輸入預設已更新",
|
||||
"DialogControllerSettingsModifiedConfirmSubMessage": "要儲存嗎?",
|
||||
"DialogDlcLoadNcaErrorMessage": "{0}. 錯誤的檔案: {1}",
|
||||
"DialogDlcNoDlcErrorMessage": "選擇的檔案不包含所選遊戲的 DLC!",
|
||||
"DialogPerformanceCheckLoggingEnabledMessage": "您啟用了跟蹤日誌,僅供開發人員使用。",
|
||||
"DialogPerformanceCheckLoggingEnabledConfirmMessage": "為了獲得最佳效能,建議停用跟蹤日誌記錄。您是否要立即停用?",
|
||||
"DialogPerformanceCheckShaderDumpEnabledMessage": "您啟用了渲染器轉儲,僅供開發人員使用。",
|
||||
"DialogPerformanceCheckShaderDumpEnabledConfirmMessage": "為了獲得最佳效能,建議停用渲染器轉儲。您是否要立即停用?",
|
||||
"DialogLoadAppGameAlreadyLoadedMessage": "目前已載入有遊戲",
|
||||
"DialogLoadAppGameAlreadyLoadedSubMessage": "請停止模擬或關閉程式,再啟動另一個遊戲。",
|
||||
"DialogUpdateAddUpdateErrorMessage": "選擇的檔案不包含所選遊戲的更新!",
|
||||
"DialogSettingsBackendThreadingWarningTitle": "警告 - 後端多執行緒",
|
||||
"DialogSettingsBackendThreadingWarningMessage": "改變此選項後必須重啟 Ryujinx 才能生效。根據您的硬體,您開啟該選項時,可能需要手動停用驅動程式本身的GL多執行緒。",
|
||||
"SettingsTabGraphicsFeaturesOptions": "功能",
|
||||
"SettingsTabGraphicsBackendMultithreading": "後端多執行緒:",
|
||||
"CommonAuto": "自動(推薦)",
|
||||
"CommonOff": "關閉",
|
||||
"CommonOn": "打開",
|
||||
"InputDialogYes": "是",
|
||||
"InputDialogNo": "否",
|
||||
"DialogProfileInvalidProfileNameErrorMessage": "檔案名包含無效字元,請重試。",
|
||||
"MenuBarOptionsPauseEmulation": "暫停",
|
||||
"MenuBarOptionsResumeEmulation": "繼續",
|
||||
"AboutUrlTooltipMessage": "在瀏覽器中打開 Ryujinx 的官網。",
|
||||
"AboutDisclaimerMessage": "Ryujinx 以任何方式與 Nintendo™ 及其合作伙伴都沒有任何關聯。",
|
||||
"AboutAmiiboDisclaimerMessage": "我們的 Amiibo 模擬使用了\nAmiiboAPI (www.amiiboapi.com) ",
|
||||
"AboutPatreonUrlTooltipMessage": "在瀏覽器中打開 Ryujinx 的 Patreon 贊助頁。",
|
||||
"AboutGithubUrlTooltipMessage": "在瀏覽器中打開 Ryujinx 的 GitHub 儲存庫。",
|
||||
"AboutDiscordUrlTooltipMessage": "在瀏覽器中打開 Ryujinx 的 Discord 伺服器邀請連結。",
|
||||
"AboutTwitterUrlTooltipMessage": "在瀏覽器中打開 Ryujinx 的 Twitter 首頁。",
|
||||
"AboutRyujinxAboutTitle": "關於:",
|
||||
"AboutRyujinxAboutContent": "Ryujinx 是一款 Nintendo Switch™ 模擬器。\n您可以在 Patreon 上贊助 Ryujinx。\n關注 Twitter 或 Discord 可以取得模擬器最新動態。\n如果您對開發本軟體感興趣,歡迎來 GitHub 和 Discord 加入我們!",
|
||||
"AboutRyujinxMaintainersTitle": "由以下作者維護:",
|
||||
"AboutRyujinxMaintainersContentTooltipMessage": "在瀏覽器中打開貢獻者的網頁",
|
||||
"AboutRyujinxSupprtersTitle": "感謝 Patreon 的贊助者:",
|
||||
"AmiiboSeriesLabel": "Amiibo 系列",
|
||||
"AmiiboCharacterLabel": "角色",
|
||||
"AmiiboScanButtonLabel": "掃描",
|
||||
"AmiiboOptionsShowAllLabel": "顯示所有 Amiibo",
|
||||
"AmiiboOptionsUsRandomTagLabel": "修正: 使用隨機標記的 Uuid",
|
||||
"DlcManagerTableHeadingEnabledLabel": "啟用",
|
||||
"DlcManagerTableHeadingTitleIdLabel": "遊戲ID",
|
||||
"DlcManagerTableHeadingContainerPathLabel": "資料夾路徑",
|
||||
"DlcManagerTableHeadingFullPathLabel": "完整路徑",
|
||||
"DlcManagerRemoveAllButton": "全部刪除",
|
||||
"MenuBarOptionsChangeLanguage": "變更語言",
|
||||
"CommonSort": "排序",
|
||||
"CommonShowNames": "顯示名稱",
|
||||
"CommonFavorite": "收藏",
|
||||
"OrderAscending": "從小到大",
|
||||
"OrderDescending": "從大到小",
|
||||
"SettingsTabGraphicsFeatures": "額外功能",
|
||||
"ErrorWindowTitle": "錯誤視窗",
|
||||
"ToggleDiscordTooltip": "啟用或關閉 Discord 動態狀態展示",
|
||||
"AddGameDirBoxTooltip": "輸入要添加的遊戲資料夾",
|
||||
"AddGameDirTooltip": "添加遊戲資料夾到列表中",
|
||||
"RemoveGameDirTooltip": "移除選中的資料夾",
|
||||
"CustomThemeCheckTooltip": "啟用或關閉自訂主題",
|
||||
"CustomThemePathTooltip": "自訂主題的資料夾",
|
||||
"CustomThemeBrowseTooltip": "查找自訂主題",
|
||||
"DockModeToggleTooltip": "是否開啟 Switch 的 Docked 模式",
|
||||
"DirectKeyboardTooltip": "是否開啟\"直連鍵盤存取(HID) 支援\"\n(部分遊戲可以使用您的鍵盤輸入文字)",
|
||||
"DirectMouseTooltip": "是否開啟\"直連滑鼠存取(HID) 支援\"\n(部分遊戲可以使用您的滑鼠導航)",
|
||||
"RegionTooltip": "變更系統區域",
|
||||
"LanguageTooltip": "變更系統語言",
|
||||
"TimezoneTooltip": "變更系統時區",
|
||||
"TimeTooltip": "變更系統時鐘",
|
||||
"VSyncToggleTooltip": "關閉後,部分使用動態幀率的遊戲可以超過 60Hz 更新率",
|
||||
"PptcToggleTooltip": "開啟以後減少遊戲啟動時間和卡頓",
|
||||
"FsIntegrityToggleTooltip": "是否檢查遊戲檔案內容的完整性",
|
||||
"AudioBackendTooltip": "默認推薦SDL,但每種音訊後端對各類遊戲相容性不同,遇到音訊問題可以切換後端",
|
||||
"MemoryManagerTooltip": "改變 Switch 記憶體映射到電腦記憶體的方式,會影響CPU效能消耗",
|
||||
"MemoryManagerSoftwareTooltip": "使用軟體記憶體頁管理,最精確但是速度最慢",
|
||||
"MemoryManagerHostTooltip": "直接映射記憶體頁到電腦記憶體,JIT效率高",
|
||||
"MemoryManagerUnsafeTooltip": "直接映射記憶體頁,但是不檢查記憶體溢出,JIT效率最高。\nRyujinx可以存取任何位置的記憶體,因而相對不安全。此模式下只應執行您信任的遊戲或軟體(即官方遊戲)",
|
||||
"DRamTooltip": "擴展模擬的 Switch 記憶體為6GB,某些高畫質材質模組或 4K 模組需要此選項",
|
||||
"IgnoreMissingServicesTooltip": "忽略某些未實現的系統服務,少部分遊戲需要此選項才能啟動",
|
||||
"GraphicsBackendThreadingTooltip": "啟用後端多執行緒",
|
||||
"GalThreadingTooltip": "使用模擬器自帶的多執行緒調度,減少渲染器編譯的卡頓,並提高驅動程式的效能(尤其是缺失多執行緒的AMD)。\nNVIDIA使用者需要重啟模擬器才能停用驅動本身的多執行緒,否則您需手動執行停用獲得最佳效能",
|
||||
"ShaderCacheToggleTooltip": "開啟後快取渲染器到硬碟,減少遊戲卡頓",
|
||||
"ResolutionScaleTooltip": "縮放渲染的解析度",
|
||||
"ResolutionScaleEntryTooltip": "盡量使用如1.5的浮點倍數。非整數的倍率易引起錯誤",
|
||||
"AnisotropyTooltip": "各向異性過濾等級。提高傾斜視角材質的清晰度\n('自動'使用遊戲默認指定的等級)",
|
||||
"AspectRatioTooltip": "模擬器渲染視窗的寬高比",
|
||||
"ShaderDumpPathTooltip": "轉儲圖形渲染器的路徑",
|
||||
"FileLogTooltip": "是否儲存日誌檔案到硬碟",
|
||||
"StubLogTooltip": "記錄 Stub 訊息",
|
||||
"InfoLogTooltip": "記錄資訊訊息",
|
||||
"WarnLogTooltip": "記錄警告訊息",
|
||||
"ErrorLogTooltip": "記錄錯誤訊息",
|
||||
"TraceLogTooltip": "記錄 Trace 訊息",
|
||||
"GuestLogTooltip": "記錄 Guest 訊息",
|
||||
"FileAccessLogTooltip": "記錄檔案存取訊息",
|
||||
"FSAccessLogModeTooltip": "記錄 FS 存取訊息,輸出到控制台。可選的模式是0-3",
|
||||
"DeveloperOptionTooltip": "使用請謹慎",
|
||||
"OpenGlLogLevel": "需要打開適當的日誌等級",
|
||||
"DebugLogTooltip": "記錄Debug訊息",
|
||||
"LoadApplicationFileTooltip": "選擇 Switch 支援的遊戲格式並載入",
|
||||
"LoadApplicationFolderTooltip": "選擇解包後的 Switch 遊戲並載入",
|
||||
"OpenRyujinxFolderTooltip": "打開 Ryujinx 系統資料夾",
|
||||
"OpenRyujinxLogsTooltip": "打開日誌存放的資料夾",
|
||||
"ExitTooltip": "關閉 Ryujinx",
|
||||
"OpenSettingsTooltip": "打開設定視窗",
|
||||
"OpenProfileManagerTooltip": "打開使用者帳號管理器",
|
||||
"StopEmulationTooltip": "停止執行目前遊戲並回到選擇界面",
|
||||
"CheckUpdatesTooltip": "檢查 Ryujinx 新版本",
|
||||
"OpenAboutTooltip": "開啟關於視窗",
|
||||
"GridSize": "網格尺寸",
|
||||
"GridSizeTooltip": "調整網格模式的大小",
|
||||
"SettingsTabSystemSystemLanguageBrazilianPortuguese": "巴西葡萄牙語",
|
||||
"AboutRyujinxContributorsButtonHeader": "查看所有參與者",
|
||||
"SettingsTabSystemAudioVolume": "音量: ",
|
||||
"AudioVolumeTooltip": "調節音量",
|
||||
"SettingsTabSystemEnableInternetAccess": "啟用網路連接",
|
||||
"EnableInternetAccessTooltip": "開啟網路存取。此選項打開後,效果類似於 Switch 連接到網路的狀態。注意即使此選項關閉,應用程式偶爾也有可能連接到網路",
|
||||
"GameListContextMenuManageCheatToolTip": "管理金手指",
|
||||
"GameListContextMenuManageCheat": "管理金手指",
|
||||
"ControllerSettingsStickRange": "範圍",
|
||||
"DialogStopEmulationTitle": "Ryujinx - 停止模擬",
|
||||
"DialogStopEmulationMessage": "是否確定停止模擬?",
|
||||
"SettingsTabCpu": "CPU",
|
||||
"SettingsTabAudio": "音訊",
|
||||
"SettingsTabNetwork": "網路",
|
||||
"SettingsTabNetworkConnection": "網路連接",
|
||||
"SettingsTabCpuCache": "CPU 快取",
|
||||
"SettingsTabCpuMemory": "CPU 記憶體",
|
||||
"DialogUpdaterFlatpakNotSupportedMessage": "請透過 Flathub 更新 Ryujinx。",
|
||||
"UpdaterDisabledWarningTitle": "更新已停用!",
|
||||
"GameListContextMenuOpenSdModsDirectory": "打開 Atmosphere 模組資料夾",
|
||||
"GameListContextMenuOpenSdModsDirectoryToolTip": "打開包含應用程式模組的額外 Atmosphere SD卡資料夾",
|
||||
"ControllerSettingsRotate90": "順時針旋轉 90°",
|
||||
"IconSize": "圖示尺寸",
|
||||
"IconSizeTooltip": "變更遊戲圖示大小",
|
||||
"MenuBarOptionsShowConsole": "顯示控制台",
|
||||
"ShaderCachePurgeError": "清除渲染器快取時出錯: {0}: {1}",
|
||||
"UserErrorNoKeys": "找不到金鑰",
|
||||
"UserErrorNoFirmware": "找不到韌體",
|
||||
"UserErrorFirmwareParsingFailed": "韌體解析錯誤",
|
||||
"UserErrorApplicationNotFound": "找不到應用程式",
|
||||
"UserErrorUnknown": "未知錯誤",
|
||||
"UserErrorUndefined": "未定義錯誤",
|
||||
"UserErrorNoKeysDescription": "Ryujinx 找不到 『prod.keys』 檔案",
|
||||
"UserErrorNoFirmwareDescription": "Ryujinx 找不到任何已安裝的韌體",
|
||||
"UserErrorFirmwareParsingFailedDescription": "Ryujinx 無法解密選擇的韌體。這通常是由於金鑰過舊。",
|
||||
"UserErrorApplicationNotFoundDescription": "Ryujinx 在選中路徑找不到有效的應用程式。",
|
||||
"UserErrorUnknownDescription": "發生未知錯誤!",
|
||||
"UserErrorUndefinedDescription": "發生了未定義錯誤!此類錯誤不應出現,請聯絡開發人員!",
|
||||
"OpenSetupGuideMessage": "打開設定教學",
|
||||
"NoUpdate": "沒有新版本",
|
||||
"TitleUpdateVersionLabel": "版本 {0} - {1}",
|
||||
"RyujinxInfo": "Ryujinx - 訊息",
|
||||
"RyujinxConfirm": "Ryujinx - 確認",
|
||||
"FileDialogAllTypes": "全部類型",
|
||||
"Never": "從不",
|
||||
"SwkbdMinCharacters": "至少應為 {0} 個字長",
|
||||
"SwkbdMinRangeCharacters": "必須為 {0}-{1} 個字長",
|
||||
"SoftwareKeyboard": "軟體鍵盤",
|
||||
"DialogControllerAppletMessagePlayerRange": "遊戲需要 {0} 個玩家()持有:\n\nTYPES: {1}\n\nPLAYERS: {2}\n\n{3}請打開設定界面,配置手把;或者關閉視窗。",
|
||||
"DialogControllerAppletMessage": "遊戲需要剛好 {0} 個玩家()持有 with:\n\nTYPES: {1}\n\nPLAYERS: {2}\n\n{3}請打開設定界面,配置手把;或者關閉視窗。",
|
||||
"DialogControllerAppletDockModeSet": "現在處於主機模式,無法使用掌機操作方式\n\n",
|
||||
"UpdaterRenaming": "正在刪除舊檔案...",
|
||||
"UpdaterRenameFailed": "更新過程中無法重命名檔案: {0}",
|
||||
"UpdaterAddingFiles": "安裝更新中...",
|
||||
"UpdaterExtracting": "正在提取更新...",
|
||||
"UpdaterDownloading": "下載新版本中...",
|
||||
"Game": "遊戲",
|
||||
"Docked": "主機模式",
|
||||
"Handheld": "掌機模式",
|
||||
"ConnectionError": "連接錯誤。",
|
||||
"AboutPageDeveloperListMore": "{0} 等開發者...",
|
||||
"ApiError": "API 錯誤",
|
||||
"LoadingHeading": "正在啟動 {0}",
|
||||
"CompilingPPTC": "編譯 PPTC 快取中",
|
||||
"CompilingShaders": "編譯渲染器中",
|
||||
"AllKeyboards": "所有鍵盤",
|
||||
"OpenFileDialogTitle": "選擇支援的檔案格式",
|
||||
"OpenFolderDialogTitle": "選擇一個包含解包遊戲的資料夾",
|
||||
"AllSupportedFormats": "全部支援的格式",
|
||||
"RyujinxUpdater": "Ryujinx 更新程式",
|
||||
"SettingsTabHotkeys": "快捷鍵",
|
||||
"SettingsTabHotkeysHotkeys": "鍵盤快捷鍵",
|
||||
"SettingsTabHotkeysToggleVsyncHotkey": "切換垂直同步",
|
||||
"SettingsTabHotkeysScreenshotHotkey": "截圖",
|
||||
"SettingsTabHotkeysShowUiHotkey": "隱藏 UI",
|
||||
"SettingsTabHotkeysPauseHotkey": "暫停",
|
||||
"SettingsTabHotkeysToggleMuteHotkey": "靜音",
|
||||
"ControllerMotionTitle": "體感操作設定",
|
||||
"ControllerRumbleTitle": "震動設定",
|
||||
"SettingsSelectThemeFileDialogTitle": "選擇主題檔案",
|
||||
"SettingsXamlThemeFile": "Xaml 主題檔案",
|
||||
"AvatarWindowTitle": "管理帳號 - 頭像",
|
||||
"Amiibo": "Amiibo",
|
||||
"Unknown": "未知",
|
||||
"Usage": "用途",
|
||||
"Writable": "可寫入",
|
||||
"SelectDlcDialogTitle": "選擇 DLC 檔案",
|
||||
"SelectUpdateDialogTitle": "選擇更新檔",
|
||||
"UserProfileWindowTitle": "管理使用者設定檔",
|
||||
"CheatWindowTitle": "管理遊戲金手指",
|
||||
"DlcWindowTitle": "管理遊戲 DLC",
|
||||
"UpdateWindowTitle": "管理遊戲更新",
|
||||
"CheatWindowHeading": "金手指可用於 {0} [{1}]",
|
||||
"DlcWindowHeading": "DLC 可用於 {0} [{1}]",
|
||||
"GameUpdateWindowHeading": "更新可用於 {0} [{1}]"
|
||||
}
|
@ -54,5 +54,6 @@
|
||||
<Color x:Key="TextOnAccentFillColorPrimary">#FFFFFFFF</Color>
|
||||
<Color x:Key="SystemChromeWhiteColor">#FFFFFFFF</Color>
|
||||
<Color x:Key="ThemeForegroundColor">#FFFFFFFF</Color>
|
||||
<Color x:Key="MenuFlyoutPresenterBorderColor">#3D3D3D</Color>
|
||||
</Styles.Resources>
|
||||
</Styles>
|
@ -49,5 +49,6 @@
|
||||
<Color x:Key="TextOnAccentFillColorPrimary">#FFFFFFFF</Color>
|
||||
<Color x:Key="SystemChromeWhiteColor">#FFFFFFFF</Color>
|
||||
<Color x:Key="ThemeForegroundColor">#FF000000</Color>
|
||||
<Color x:Key="MenuFlyoutPresenterBorderColor">#C1C1C1</Color>
|
||||
</Styles.Resources>
|
||||
</Styles>
|
@ -221,6 +221,7 @@
|
||||
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundColor}" />
|
||||
</Style>
|
||||
<Styles.Resources>
|
||||
<SolidColorBrush x:Key="ThemeAccentColorBrush" Color="{DynamicResource SystemAccentColor}" />
|
||||
<StaticResource x:Key="ListViewItemBackgroundSelected" ResourceKey="ThemeAccentColorBrush" />
|
||||
<StaticResource x:Key="ListViewItemBackgroundPressed" ResourceKey="SystemAccentColorDark1" />
|
||||
<StaticResource x:Key="ListViewItemBackgroundPointerOver" ResourceKey="SystemAccentColorDark2" />
|
||||
@ -232,7 +233,7 @@
|
||||
Color="{DynamicResource SystemBaseMediumLowColor}" />
|
||||
<SolidColorBrush x:Key="DataGridSelectionBackgroundBrush" Color="{DynamicResource DataGridSelectionColor}" />
|
||||
<SolidColorBrush x:Key="MenuFlyoutPresenterBorderBrush" Color="{DynamicResource MenuFlyoutPresenterBorderColor}" />
|
||||
<SolidColorBrush x:Key="ThemeAccentColorBrush" Color="{DynamicResource SystemAccentColor}" />
|
||||
<SolidColorBrush x:Key="FlyoutBorderThemeBrush" Color="{DynamicResource MenuFlyoutPresenterBorderColor}" />
|
||||
<SolidColorBrush x:Key="ListBoxBackground" Color="{DynamicResource ThemeContentBackgroundColor}" />
|
||||
<SolidColorBrush x:Key="ThemeForegroundBrush" Color="{DynamicResource ThemeForegroundColor}" />
|
||||
<SolidColorBrush x:Key="ThemeAccentBrush4" Color="{DynamicResource ThemeAccentColor4}" />
|
||||
|
@ -23,6 +23,7 @@ using System;
|
||||
using System.Buffers;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using static LibHac.Fs.ApplicationSaveDataManagement;
|
||||
using Path = System.IO.Path;
|
||||
|
||||
@ -77,8 +78,11 @@ namespace Ryujinx.Ava.Common
|
||||
|
||||
if (result.IsFailure())
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner,
|
||||
string.Format(LocaleManager.Instance["DialogMessageCreateSaveErrorMessage"], result.ToStringWithName()));
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(
|
||||
string.Format(LocaleManager.Instance["DialogMessageCreateSaveErrorMessage"], result.ToStringWithName()));
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -94,8 +98,10 @@ namespace Ryujinx.Ava.Common
|
||||
return true;
|
||||
}
|
||||
|
||||
ContentDialogHelper.CreateErrorDialog(_owner,
|
||||
string.Format(LocaleManager.Instance["DialogMessageFindSaveErrorMessage"], result.ToStringWithName()));
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance["DialogMessageFindSaveErrorMessage"], result.ToStringWithName()));
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -137,7 +143,7 @@ namespace Ryujinx.Ava.Common
|
||||
}
|
||||
}
|
||||
|
||||
public static async void ExtractSection(NcaSectionType ncaSectionType, string titleFilePath,
|
||||
public static async Task ExtractSection(NcaSectionType ncaSectionType, string titleFilePath,
|
||||
int programIndex = 0)
|
||||
{
|
||||
OpenFolderDialog folderDialog = new() { Title = LocaleManager.Instance["FolderDialogExtractTitle"] };
|
||||
@ -153,7 +159,6 @@ namespace Ryujinx.Ava.Common
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(
|
||||
_owner,
|
||||
string.Format(LocaleManager.Instance["DialogNcaExtractionMessage"], ncaSectionType, Path.GetFileName(titleFilePath)),
|
||||
"",
|
||||
"",
|
||||
@ -222,9 +227,9 @@ namespace Ryujinx.Ava.Common
|
||||
{
|
||||
Logger.Error?.Print(LogClass.Application,
|
||||
"Extraction failure. The main NCA was not present in the selected file");
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner, LocaleManager.Instance["DialogNcaExtractionMainNcaNotFoundErrorMessage"]);
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogNcaExtractionMainNcaNotFoundErrorMessage"]);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -263,9 +268,9 @@ namespace Ryujinx.Ava.Common
|
||||
{
|
||||
Logger.Error?.Print(LogClass.Application,
|
||||
$"LibHac returned error code: {resultCode.Value.ErrorCode}");
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner, LocaleManager.Instance["DialogNcaExtractionCheckLogErrorMessage"]);
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogNcaExtractionCheckLogErrorMessage"]);
|
||||
});
|
||||
}
|
||||
else if (resultCode.Value.IsSuccess())
|
||||
@ -273,7 +278,6 @@ namespace Ryujinx.Ava.Common
|
||||
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateInfoDialog(
|
||||
_owner,
|
||||
LocaleManager.Instance["DialogNcaExtractionSuccessMessage"],
|
||||
"",
|
||||
LocaleManager.Instance["InputDialogOk"],
|
||||
@ -288,9 +292,9 @@ namespace Ryujinx.Ava.Common
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner, ex.Message);
|
||||
await ContentDialogHelper.CreateErrorDialog(ex.Message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -73,8 +73,11 @@ namespace Ryujinx.Modules
|
||||
}
|
||||
catch
|
||||
{
|
||||
ContentDialogHelper.CreateWarningDialog(mainWindow, LocaleManager.Instance["DialogUpdaterConvertFailedMessage"], LocaleManager.Instance["DialogUpdaterCancelUpdateMessage"]);
|
||||
Logger.Error?.Print(LogClass.Application, "Failed to convert the current Ryujinx version!");
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateWarningDialog(LocaleManager.Instance["DialogUpdaterConvertFailedMessage"], LocaleManager.Instance["DialogUpdaterCancelUpdateMessage"]);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
@ -106,7 +109,10 @@ namespace Ryujinx.Modules
|
||||
{
|
||||
if (showVersionUpToDate)
|
||||
{
|
||||
ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], "");
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateUpdaterInfoDialog(LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], "");
|
||||
});
|
||||
}
|
||||
|
||||
return;
|
||||
@ -121,7 +127,10 @@ namespace Ryujinx.Modules
|
||||
{
|
||||
if (showVersionUpToDate)
|
||||
{
|
||||
ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], "");
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateUpdaterInfoDialog(LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], "");
|
||||
});
|
||||
}
|
||||
|
||||
return;
|
||||
@ -131,7 +140,10 @@ namespace Ryujinx.Modules
|
||||
catch (Exception exception)
|
||||
{
|
||||
Logger.Error?.Print(LogClass.Application, exception.Message);
|
||||
ContentDialogHelper.CreateErrorDialog(mainWindow, LocaleManager.Instance["DialogUpdaterFailedToGetVersionMessage"]);
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogUpdaterFailedToGetVersionMessage"]);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
@ -142,8 +154,11 @@ namespace Ryujinx.Modules
|
||||
}
|
||||
catch
|
||||
{
|
||||
ContentDialogHelper.CreateWarningDialog(mainWindow, LocaleManager.Instance["DialogUpdaterConvertFailedGithubMessage"], LocaleManager.Instance["DialogUpdaterCancelUpdateMessage"]);
|
||||
Logger.Error?.Print(LogClass.Application, "Failed to convert the received Ryujinx version from Github!");
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateWarningDialog(LocaleManager.Instance["DialogUpdaterConvertFailedGithubMessage"], LocaleManager.Instance["DialogUpdaterCancelUpdateMessage"]);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
@ -152,7 +167,10 @@ namespace Ryujinx.Modules
|
||||
{
|
||||
if (showVersionUpToDate)
|
||||
{
|
||||
ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], "");
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateUpdaterInfoDialog(LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], "");
|
||||
});
|
||||
}
|
||||
|
||||
Running = false;
|
||||
@ -180,10 +198,12 @@ namespace Ryujinx.Modules
|
||||
_buildSize = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Show a message asking the user if they want to update
|
||||
UpdaterWindow updateDialog = new(mainWindow, newVersion, _buildUrl);
|
||||
await updateDialog.ShowDialog(mainWindow);
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
// Show a message asking the user if they want to update
|
||||
UpdaterWindow updateDialog = new(mainWindow, newVersion, _buildUrl);
|
||||
await updateDialog.ShowDialog(mainWindow);
|
||||
});
|
||||
}
|
||||
|
||||
private static HttpClient ConstructHttpClient()
|
||||
@ -522,6 +542,7 @@ namespace Ryujinx.Modules
|
||||
updateDialog.ButtonBox.IsVisible = true;
|
||||
}
|
||||
|
||||
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
||||
public static bool CanUpdate(bool showWarnings, StyleableWindow parent)
|
||||
{
|
||||
#if !DISABLE_UPDATER
|
||||
@ -529,7 +550,7 @@ namespace Ryujinx.Modules
|
||||
{
|
||||
if (showWarnings)
|
||||
{
|
||||
ContentDialogHelper.CreateWarningDialog(parent, LocaleManager.Instance["DialogUpdaterArchNotSupportedMessage"],
|
||||
ContentDialogHelper.CreateWarningDialog(LocaleManager.Instance["DialogUpdaterArchNotSupportedMessage"],
|
||||
LocaleManager.Instance["DialogUpdaterArchNotSupportedSubMessage"]);
|
||||
}
|
||||
|
||||
@ -540,7 +561,7 @@ namespace Ryujinx.Modules
|
||||
{
|
||||
if (showWarnings)
|
||||
{
|
||||
ContentDialogHelper.CreateWarningDialog(parent, LocaleManager.Instance["DialogUpdaterNoInternetMessage"],
|
||||
ContentDialogHelper.CreateWarningDialog(LocaleManager.Instance["DialogUpdaterNoInternetMessage"],
|
||||
LocaleManager.Instance["DialogUpdaterNoInternetSubMessage"]);
|
||||
}
|
||||
|
||||
@ -551,7 +572,7 @@ namespace Ryujinx.Modules
|
||||
{
|
||||
if (showWarnings)
|
||||
{
|
||||
ContentDialogHelper.CreateWarningDialog(parent, LocaleManager.Instance["DialogUpdaterDirtyBuildMessage"],
|
||||
ContentDialogHelper.CreateWarningDialog(LocaleManager.Instance["DialogUpdaterDirtyBuildMessage"],
|
||||
LocaleManager.Instance["DialogUpdaterDirtyBuildSubMessage"]);
|
||||
}
|
||||
|
||||
@ -564,19 +585,18 @@ namespace Ryujinx.Modules
|
||||
{
|
||||
if (ReleaseInformations.IsFlatHubBuild())
|
||||
{
|
||||
ContentDialogHelper.CreateWarningDialog(parent,
|
||||
LocaleManager.Instance["UpdaterDisabledWarningTitle"], LocaleManager.Instance["DialogUpdaterFlatpakNotSupportedMessage"]);
|
||||
ContentDialogHelper.CreateWarningDialog(LocaleManager.Instance["UpdaterDisabledWarningTitle"], LocaleManager.Instance["DialogUpdaterFlatpakNotSupportedMessage"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
ContentDialogHelper.CreateWarningDialog(parent,
|
||||
LocaleManager.Instance["UpdaterDisabledWarningTitle"], LocaleManager.Instance["DialogUpdaterDirtyBuildSubMessage"]);
|
||||
ContentDialogHelper.CreateWarningDialog(LocaleManager.Instance["UpdaterDisabledWarningTitle"], LocaleManager.Instance["DialogUpdaterDirtyBuildSubMessage"]);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
||||
|
||||
// NOTE: This method should always reflect the latest build layout.s
|
||||
private static IEnumerable<string> EnumerateFilesToDelete()
|
||||
|
@ -5,8 +5,6 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Version>1.0.0-dirty</Version>
|
||||
<TieredCompilation>false</TieredCompilation>
|
||||
<TieredCompilationQuickJit>false</TieredCompilationQuickJit>
|
||||
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
|
||||
<RootNamespace>Ryujinx.Ava</RootNamespace>
|
||||
<ApplicationIcon>Ryujinx.ico</ApplicationIcon>
|
||||
@ -28,9 +26,10 @@
|
||||
<PackageReference Include="jp2masa.Avalonia.Flexbox" Version="0.2.0" />
|
||||
<PackageReference Include="DynamicData" Version="7.9.4" />
|
||||
<PackageReference Include="FluentAvaloniaUI" Version="1.4.1" />
|
||||
<PackageReference Include="XamlNameReferenceGenerator" Version="1.3.4" />
|
||||
|
||||
<PackageReference Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'osx-x64'" />
|
||||
<PackageReference Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="4.4.0-build9" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'osx-x64'" />
|
||||
<PackageReference Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.1-build10" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'osx-x64'" />
|
||||
<PackageReference Include="OpenTK.Graphics" Version="4.7.2" />
|
||||
<PackageReference Include="SPB" Version="0.0.4-build17" />
|
||||
<PackageReference Include="SharpZipLib" Version="1.3.3" />
|
||||
@ -120,6 +119,7 @@
|
||||
<None Remove="Assets\Locales\ru_RU.json" />
|
||||
<None Remove="Assets\Locales\tr_TR.json" />
|
||||
<None Remove="Assets\Locales\zh_CN.json" />
|
||||
<None Remove="Assets\Locales\zh_TW.json" />
|
||||
<None Remove="Assets\Styles\Styles.xaml" />
|
||||
<None Remove="Assets\Styles\BaseDark.xaml" />
|
||||
<None Remove="Assets\Styles\BaseLight.xaml" />
|
||||
@ -137,6 +137,7 @@
|
||||
<EmbeddedResource Include="Assets\Locales\ru_RU.json" />
|
||||
<EmbeddedResource Include="Assets\Locales\tr_TR.json" />
|
||||
<EmbeddedResource Include="Assets\Locales\zh_CN.json" />
|
||||
<EmbeddedResource Include="Assets\Locales\zh_TW.json" />
|
||||
<EmbeddedResource Include="Assets\Styles\Styles.xaml" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -92,7 +92,7 @@ namespace Ryujinx.Ava.Ui.Applet
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_parent, string.Format(LocaleManager.Instance["DialogMessageDialogErrorExceptionMessage"], ex));
|
||||
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance["DialogMessageDialogErrorExceptionMessage"], ex));
|
||||
|
||||
dialogCloseEvent.Set();
|
||||
}
|
||||
@ -126,7 +126,7 @@ namespace Ryujinx.Ava.Ui.Applet
|
||||
catch (Exception ex)
|
||||
{
|
||||
error = true;
|
||||
ContentDialogHelper.CreateErrorDialog(_parent, string.Format(LocaleManager.Instance["DialogSoftwareKeyboardErrorExceptionMessage"], ex));
|
||||
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance["DialogSoftwareKeyboardErrorExceptionMessage"], ex));
|
||||
}
|
||||
finally
|
||||
{
|
||||
@ -181,7 +181,7 @@ namespace Ryujinx.Ava.Ui.Applet
|
||||
catch (Exception ex)
|
||||
{
|
||||
dialogCloseEvent.Set();
|
||||
ContentDialogHelper.CreateErrorDialog(_parent, string.Format(LocaleManager.Instance["DialogErrorAppletErrorExceptionMessage"], ex));
|
||||
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance["DialogErrorAppletErrorExceptionMessage"], ex));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Applet
|
||||
{
|
||||
internal class ErrorAppletWindow : StyleableWindow
|
||||
internal partial class ErrorAppletWindow : StyleableWindow
|
||||
{
|
||||
private readonly Window _owner;
|
||||
private object _buttonResponse;
|
||||
@ -50,8 +50,6 @@ namespace Ryujinx.Ava.Ui.Applet
|
||||
|
||||
public string Message { get; set; }
|
||||
|
||||
public StackPanel ButtonStack { get; set; }
|
||||
|
||||
private void AddButton(string label, object tag)
|
||||
{
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
@ -79,11 +77,5 @@ namespace Ryujinx.Ava.Ui.Applet
|
||||
|
||||
return _buttonResponse;
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
ButtonStack = this.FindControl<StackPanel>("ButtonStack");
|
||||
}
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Controls
|
||||
{
|
||||
internal class SwkbdAppletDialog : UserControl
|
||||
internal partial class SwkbdAppletDialog : UserControl
|
||||
{
|
||||
private Predicate<int> _checkLength;
|
||||
private int _inputMax;
|
||||
@ -30,6 +30,10 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
_placeholder = placeholder;
|
||||
InitializeComponent();
|
||||
|
||||
Input.Watermark = _placeholder;
|
||||
|
||||
Input.AddHandler(TextInputEvent, Message_TextInput, RoutingStrategies.Tunnel, true);
|
||||
|
||||
SetInputLengthValidation(0, int.MaxValue); // Disable by default.
|
||||
}
|
||||
|
||||
@ -43,23 +47,9 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
public string MainText { get; set; } = "";
|
||||
public string SecondaryText { get; set; } = "";
|
||||
|
||||
public TextBlock Error { get; private set; }
|
||||
public TextBox Input { get; set; }
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
Error = this.FindControl<TextBlock>("Error");
|
||||
Input = this.FindControl<TextBox>("Input");
|
||||
|
||||
Input.Watermark = _placeholder;
|
||||
|
||||
Input.AddHandler(TextInputEvent, Message_TextInput, RoutingStrategies.Tunnel, true);
|
||||
}
|
||||
|
||||
public static async Task<(UserResult Result, string Input)> ShowInputDialog(StyleableWindow window, string title, SoftwareKeyboardUiArgs args)
|
||||
{
|
||||
ContentDialog contentDialog = window.ContentDialog;
|
||||
ContentDialog contentDialog = new ContentDialog();
|
||||
|
||||
UserResult result = UserResult.Cancel;
|
||||
|
||||
|
@ -16,7 +16,6 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
private static bool _isChoiceDialogOpen;
|
||||
|
||||
private async static Task<UserResult> ShowContentDialog(
|
||||
StyleableWindow window,
|
||||
string title,
|
||||
string primaryText,
|
||||
string secondaryText,
|
||||
@ -28,35 +27,32 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
{
|
||||
UserResult result = UserResult.None;
|
||||
|
||||
ContentDialog contentDialog = window.ContentDialog;
|
||||
ContentDialog contentDialog = new ContentDialog();
|
||||
|
||||
await ShowDialog();
|
||||
|
||||
async Task ShowDialog()
|
||||
{
|
||||
if (contentDialog != null)
|
||||
contentDialog.Title = title;
|
||||
contentDialog.PrimaryButtonText = primaryButton;
|
||||
contentDialog.SecondaryButtonText = secondaryButton;
|
||||
contentDialog.CloseButtonText = closeButton;
|
||||
contentDialog.Content = CreateDialogTextContent(primaryText, secondaryText, iconSymbol);
|
||||
|
||||
contentDialog.PrimaryButtonCommand = MiniCommand.Create(() =>
|
||||
{
|
||||
contentDialog.Title = title;
|
||||
contentDialog.PrimaryButtonText = primaryButton;
|
||||
contentDialog.SecondaryButtonText = secondaryButton;
|
||||
contentDialog.CloseButtonText = closeButton;
|
||||
contentDialog.Content = CreateDialogTextContent(primaryText, secondaryText, iconSymbol);
|
||||
result = primaryButtonResult;
|
||||
});
|
||||
contentDialog.SecondaryButtonCommand = MiniCommand.Create(() =>
|
||||
{
|
||||
result = UserResult.No;
|
||||
});
|
||||
contentDialog.CloseButtonCommand = MiniCommand.Create(() =>
|
||||
{
|
||||
result = UserResult.Cancel;
|
||||
});
|
||||
|
||||
contentDialog.PrimaryButtonCommand = MiniCommand.Create(() =>
|
||||
{
|
||||
result = primaryButtonResult;
|
||||
});
|
||||
contentDialog.SecondaryButtonCommand = MiniCommand.Create(() =>
|
||||
{
|
||||
result = UserResult.No;
|
||||
});
|
||||
contentDialog.CloseButtonCommand = MiniCommand.Create(() =>
|
||||
{
|
||||
result = UserResult.Cancel;
|
||||
});
|
||||
|
||||
await contentDialog.ShowAsync(ContentDialogPlacement.Popup);
|
||||
};
|
||||
await contentDialog.ShowAsync(ContentDialogPlacement.Popup);
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -78,35 +74,30 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
|
||||
UserResult result = UserResult.None;
|
||||
|
||||
ContentDialog contentDialog = window.ContentDialog;
|
||||
|
||||
Window overlay = window;
|
||||
|
||||
if (contentDialog != null)
|
||||
ContentDialog contentDialog = new ContentDialog
|
||||
{
|
||||
contentDialog.PrimaryButtonClick += DeferClose;
|
||||
contentDialog.Title = title;
|
||||
contentDialog.PrimaryButtonText = primaryButton;
|
||||
contentDialog.SecondaryButtonText = secondaryButton;
|
||||
contentDialog.CloseButtonText = closeButton;
|
||||
contentDialog.Content = CreateDialogTextContent(primaryText, secondaryText, iconSymbol);
|
||||
|
||||
contentDialog.PrimaryButtonCommand = MiniCommand.Create(() =>
|
||||
Title = title,
|
||||
PrimaryButtonText = primaryButton,
|
||||
SecondaryButtonText = secondaryButton,
|
||||
CloseButtonText = closeButton,
|
||||
Content = CreateDialogTextContent(primaryText, secondaryText, iconSymbol),
|
||||
PrimaryButtonCommand = MiniCommand.Create(() =>
|
||||
{
|
||||
result = primaryButton == LocaleManager.Instance["InputDialogYes"] ? UserResult.Yes : UserResult.Ok;
|
||||
});
|
||||
contentDialog.SecondaryButtonCommand = MiniCommand.Create(() =>
|
||||
{
|
||||
contentDialog.PrimaryButtonClick -= DeferClose;
|
||||
result = UserResult.No;
|
||||
});
|
||||
contentDialog.CloseButtonCommand = MiniCommand.Create(() =>
|
||||
{
|
||||
contentDialog.PrimaryButtonClick -= DeferClose;
|
||||
result = UserResult.Cancel;
|
||||
});
|
||||
await contentDialog.ShowAsync(ContentDialogPlacement.Popup);
|
||||
}),
|
||||
};
|
||||
contentDialog.SecondaryButtonCommand = MiniCommand.Create(() =>
|
||||
{
|
||||
contentDialog.PrimaryButtonClick -= DeferClose;
|
||||
result = UserResult.No;
|
||||
});
|
||||
contentDialog.CloseButtonCommand = MiniCommand.Create(() =>
|
||||
{
|
||||
contentDialog.PrimaryButtonClick -= DeferClose;
|
||||
result = UserResult.Cancel;
|
||||
});
|
||||
contentDialog.PrimaryButtonClick += DeferClose;
|
||||
await contentDialog.ShowAsync(ContentDialogPlacement.Popup);
|
||||
|
||||
return result;
|
||||
|
||||
@ -141,7 +132,7 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
|
||||
if (doWhileDeferred != null)
|
||||
{
|
||||
await doWhileDeferred(overlay);
|
||||
await doWhileDeferred(window);
|
||||
|
||||
deferResetEvent.Set();
|
||||
}
|
||||
@ -191,7 +182,6 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
}
|
||||
|
||||
public static async Task<UserResult> CreateInfoDialog(
|
||||
StyleableWindow window,
|
||||
string primary,
|
||||
string secondaryText,
|
||||
string acceptButton,
|
||||
@ -199,7 +189,6 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
string title)
|
||||
{
|
||||
return await ShowContentDialog(
|
||||
window,
|
||||
title,
|
||||
primary,
|
||||
secondaryText,
|
||||
@ -210,7 +199,6 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
}
|
||||
|
||||
internal static async Task<UserResult> CreateConfirmationDialog(
|
||||
StyleableWindow window,
|
||||
string primaryText,
|
||||
string secondaryText,
|
||||
string acceptButtonText,
|
||||
@ -219,7 +207,6 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
UserResult primaryButtonResult = UserResult.Yes)
|
||||
{
|
||||
return await ShowContentDialog(
|
||||
window,
|
||||
string.IsNullOrWhiteSpace(title) ? LocaleManager.Instance["DialogConfirmationTitle"] : title,
|
||||
primaryText,
|
||||
secondaryText,
|
||||
@ -235,10 +222,9 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
return new(mainText, secondaryText);
|
||||
}
|
||||
|
||||
internal static async void CreateUpdaterInfoDialog(StyleableWindow window, string primary, string secondaryText)
|
||||
internal static async Task CreateUpdaterInfoDialog(string primary, string secondaryText)
|
||||
{
|
||||
await ShowContentDialog(
|
||||
window,
|
||||
LocaleManager.Instance["DialogUpdaterTitle"],
|
||||
primary,
|
||||
secondaryText,
|
||||
@ -248,24 +234,9 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
(int)Symbol.Important);
|
||||
}
|
||||
|
||||
internal static async void ShowNotAvailableMessage(StyleableWindow window)
|
||||
{
|
||||
// Temporary placeholder for features to be added
|
||||
await ShowContentDialog(
|
||||
window,
|
||||
"Feature Not Available",
|
||||
"The selected feature is not available in this version.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
LocaleManager.Instance["InputDialogOk"],
|
||||
(int)Symbol.Important);
|
||||
}
|
||||
|
||||
internal static async void CreateWarningDialog(StyleableWindow window, string primary, string secondaryText)
|
||||
internal static async Task CreateWarningDialog(string primary, string secondaryText)
|
||||
{
|
||||
await ShowContentDialog(
|
||||
window,
|
||||
LocaleManager.Instance["DialogWarningTitle"],
|
||||
primary,
|
||||
secondaryText,
|
||||
@ -275,12 +246,11 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
(int)Symbol.Important);
|
||||
}
|
||||
|
||||
internal static async void CreateErrorDialog(StyleableWindow owner, string errorMessage, string secondaryErrorMessage = "")
|
||||
internal static async Task CreateErrorDialog(string errorMessage, string secondaryErrorMessage = "")
|
||||
{
|
||||
Logger.Error?.Print(LogClass.Application, errorMessage);
|
||||
|
||||
await ShowContentDialog(
|
||||
owner,
|
||||
LocaleManager.Instance["DialogErrorTitle"],
|
||||
LocaleManager.Instance["DialogErrorMessage"],
|
||||
errorMessage,
|
||||
@ -290,7 +260,7 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
(int)Symbol.Dismiss);
|
||||
}
|
||||
|
||||
internal static async Task<bool> CreateChoiceDialog(StyleableWindow window, string title, string primary, string secondaryText)
|
||||
internal static async Task<bool> CreateChoiceDialog(string title, string primary, string secondaryText)
|
||||
{
|
||||
if (_isChoiceDialogOpen)
|
||||
{
|
||||
@ -301,7 +271,6 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
|
||||
UserResult response =
|
||||
await ShowContentDialog(
|
||||
window,
|
||||
title,
|
||||
primary,
|
||||
secondaryText,
|
||||
@ -316,19 +285,17 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
return response == UserResult.Yes;
|
||||
}
|
||||
|
||||
internal static async Task<bool> CreateExitDialog(StyleableWindow owner)
|
||||
internal static async Task<bool> CreateExitDialog()
|
||||
{
|
||||
return await CreateChoiceDialog(
|
||||
owner,
|
||||
LocaleManager.Instance["DialogExitTitle"],
|
||||
LocaleManager.Instance["DialogExitMessage"],
|
||||
LocaleManager.Instance["DialogExitSubMessage"]);
|
||||
}
|
||||
|
||||
internal static async Task<bool> CreateStopEmulationDialog(StyleableWindow owner)
|
||||
internal static async Task<bool> CreateStopEmulationDialog()
|
||||
{
|
||||
return await CreateChoiceDialog(
|
||||
owner,
|
||||
LocaleManager.Instance["DialogStopEmulationTitle"],
|
||||
LocaleManager.Instance["DialogStopEmulationMessage"],
|
||||
LocaleManager.Instance["DialogExitSubMessage"]);
|
||||
@ -338,12 +305,10 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
string title,
|
||||
string mainText,
|
||||
string subText,
|
||||
StyleableWindow owner,
|
||||
uint maxLength = int.MaxValue,
|
||||
string input = "")
|
||||
{
|
||||
var result = await InputDialog.ShowInputDialog(
|
||||
owner,
|
||||
title,
|
||||
mainText,
|
||||
input,
|
||||
|
@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Controls
|
||||
{
|
||||
public class InputDialog : UserControl
|
||||
public partial class InputDialog : UserControl
|
||||
{
|
||||
public string Message { get; set; }
|
||||
public string Input { get; set; }
|
||||
@ -24,8 +24,6 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
MaxLength = maxLength;
|
||||
|
||||
DataContext = this;
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public InputDialog()
|
||||
@ -33,33 +31,26 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
public static async Task<(UserResult Result, string Input)> ShowInputDialog(string title, string message,
|
||||
string input = "", string subMessage = "", uint maxLength = int.MaxValue)
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public static async Task<(UserResult Result, string Input)> ShowInputDialog(StyleableWindow window, string title, string message, string input = "", string subMessage = "", uint maxLength = int.MaxValue)
|
||||
{
|
||||
ContentDialog contentDialog = window.ContentDialog;
|
||||
|
||||
UserResult result = UserResult.Cancel;
|
||||
|
||||
InputDialog content = new InputDialog(message, input = "", subMessage = "", maxLength);
|
||||
|
||||
if (contentDialog != null)
|
||||
InputDialog content = new InputDialog(message, input, subMessage, maxLength);
|
||||
ContentDialog contentDialog = new ContentDialog
|
||||
{
|
||||
contentDialog.Title = title;
|
||||
contentDialog.PrimaryButtonText = LocaleManager.Instance["InputDialogOk"];
|
||||
contentDialog.SecondaryButtonText = "";
|
||||
contentDialog.CloseButtonText = LocaleManager.Instance["InputDialogCancel"];
|
||||
contentDialog.Content = content;
|
||||
contentDialog.PrimaryButtonCommand = MiniCommand.Create(() =>
|
||||
Title = title,
|
||||
PrimaryButtonText = LocaleManager.Instance["InputDialogOk"],
|
||||
SecondaryButtonText = "",
|
||||
CloseButtonText = LocaleManager.Instance["InputDialogCancel"],
|
||||
Content = content,
|
||||
PrimaryButtonCommand = MiniCommand.Create(() =>
|
||||
{
|
||||
result = UserResult.Ok;
|
||||
input = content.Input;
|
||||
});
|
||||
await contentDialog.ShowAsync();
|
||||
}
|
||||
})
|
||||
};
|
||||
await contentDialog.ShowAsync();
|
||||
|
||||
return (result, input);
|
||||
}
|
||||
|
10
Ryujinx.Ava/Ui/Controls/NavigationDialogHost.axaml
Normal file
10
Ryujinx.Ava/Ui/Controls/NavigationDialogHost.axaml
Normal file
@ -0,0 +1,10 @@
|
||||
<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:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Ryujinx.Ava.Ui.Controls.NavigationDialogHost">
|
||||
<ui:Frame HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
x:Name="ContentFrame" />
|
||||
</UserControl>
|
85
Ryujinx.Ava/Ui/Controls/NavigationDialogHost.axaml.cs
Normal file
85
Ryujinx.Ava/Ui/Controls/NavigationDialogHost.axaml.cs
Normal file
@ -0,0 +1,85 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Ui.ViewModels;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Controls
|
||||
{
|
||||
public partial class NavigationDialogHost : UserControl
|
||||
{
|
||||
public AccountManager AccountManager { get; }
|
||||
public ContentManager ContentManager { get; }
|
||||
public UserProfileViewModel ViewModel { get; set; }
|
||||
|
||||
public NavigationDialogHost()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public NavigationDialogHost(AccountManager accountManager, ContentManager contentManager,
|
||||
VirtualFileSystem virtualFileSystem)
|
||||
{
|
||||
AccountManager = accountManager;
|
||||
ContentManager = contentManager;
|
||||
ViewModel = new UserProfileViewModel(this);
|
||||
|
||||
|
||||
if (contentManager.GetCurrentFirmwareVersion() != null)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
AvatarProfileViewModel.PreloadAvatars(contentManager, virtualFileSystem);
|
||||
});
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void GoBack(object parameter = null)
|
||||
{
|
||||
if (ContentFrame.BackStack.Count > 0)
|
||||
{
|
||||
ContentFrame.GoBack();
|
||||
}
|
||||
|
||||
ViewModel.LoadProfiles();
|
||||
}
|
||||
|
||||
public void Navigate(Type sourcePageType, object parameter)
|
||||
{
|
||||
ContentFrame.Navigate(sourcePageType, parameter);
|
||||
}
|
||||
|
||||
public static async Task Show(AccountManager ownerAccountManager, ContentManager ownerContentManager, VirtualFileSystem ownerVirtualFileSystem)
|
||||
{
|
||||
var content = new NavigationDialogHost(ownerAccountManager, ownerContentManager, ownerVirtualFileSystem);
|
||||
ContentDialog contentDialog = new ContentDialog
|
||||
{
|
||||
Title = LocaleManager.Instance["UserProfileWindowTitle"],
|
||||
PrimaryButtonText = "",
|
||||
SecondaryButtonText = "",
|
||||
CloseButtonText = LocaleManager.Instance["UserProfilesClose"],
|
||||
Content = content,
|
||||
Padding = new Thickness(0)
|
||||
};
|
||||
|
||||
contentDialog.Closed += (sender, args) =>
|
||||
{
|
||||
content.ViewModel.Dispose();
|
||||
};
|
||||
|
||||
await contentDialog.ShowAsync();
|
||||
}
|
||||
|
||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
||||
{
|
||||
base.OnAttachedToVisualTree(e);
|
||||
|
||||
Navigate(typeof(UserSelector), this);
|
||||
}
|
||||
}
|
||||
}
|
31
Ryujinx.Ava/Ui/Controls/ProfileImageSelectionDialog.axaml
Normal file
31
Ryujinx.Ava/Ui/Controls/ProfileImageSelectionDialog.axaml
Normal file
@ -0,0 +1,31 @@
|
||||
<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"
|
||||
mc:Ignorable="d"
|
||||
xmlns:Locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||
x:Class="Ryujinx.Ava.Ui.Controls.ProfileImageSelectionDialog">
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="5,10,5, 5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="70" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock FontWeight="Bold" FontSize="18" HorizontalAlignment="Center" Grid.Row="1"
|
||||
Text="{Locale:Locale ProfileImageSelectionHeader}" />
|
||||
<TextBlock FontWeight="Bold" Grid.Row="2" Margin="10" MaxWidth="400" TextWrapping="Wrap"
|
||||
HorizontalAlignment="Center" TextAlignment="Center" Text="{Locale:Locale ProfileImageSelectionNote}" />
|
||||
<StackPanel Margin="5,0" Spacing="10" Grid.Row="4" HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button Name="Import" Click="Import_OnClick" Width="200">
|
||||
<TextBlock Text="{Locale:Locale ProfileImageSelectionImportImage}" />
|
||||
</Button>
|
||||
<Button Name="SelectFirmwareImage" IsEnabled="{Binding FirmwareFound}" Click="SelectFirmwareImage_OnClick"
|
||||
Width="200">
|
||||
<TextBlock Text="{Locale:Locale ProfileImageSelectionSelectAvatar}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
105
Ryujinx.Ava/Ui/Controls/ProfileImageSelectionDialog.axaml.cs
Normal file
105
Ryujinx.Ava/Ui/Controls/ProfileImageSelectionDialog.axaml.cs
Normal file
@ -0,0 +1,105 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.VisualTree;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using FluentAvalonia.UI.Navigation;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Ui.Models;
|
||||
using Ryujinx.Ava.Ui.Windows;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.Processing;
|
||||
using System.IO;
|
||||
using Image = SixLabors.ImageSharp.Image;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Controls
|
||||
{
|
||||
public partial class ProfileImageSelectionDialog : UserControl
|
||||
{
|
||||
private ContentManager _contentManager;
|
||||
private NavigationDialogHost _parent;
|
||||
private TempProfile _profile;
|
||||
|
||||
public bool FirmwareFound => _contentManager.GetCurrentFirmwareVersion() != null;
|
||||
|
||||
public ProfileImageSelectionDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
AddHandler(Frame.NavigatedToEvent, (s, e) =>
|
||||
{
|
||||
NavigatedTo(e);
|
||||
}, RoutingStrategies.Direct);
|
||||
}
|
||||
|
||||
private void NavigatedTo(NavigationEventArgs arg)
|
||||
{
|
||||
if (Program.PreviewerDetached)
|
||||
{
|
||||
switch (arg.NavigationMode)
|
||||
{
|
||||
case NavigationMode.New:
|
||||
(_parent, _profile) = ((NavigationDialogHost, TempProfile))arg.Parameter;
|
||||
_contentManager = _parent.ContentManager;
|
||||
break;
|
||||
case NavigationMode.Back:
|
||||
_parent.GoBack();
|
||||
break;
|
||||
}
|
||||
|
||||
DataContext = this;
|
||||
}
|
||||
}
|
||||
|
||||
private async void Import_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenFileDialog dialog = new();
|
||||
dialog.Filters.Add(new FileDialogFilter
|
||||
{
|
||||
Name = LocaleManager.Instance["AllSupportedFormats"],
|
||||
Extensions = { "jpg", "jpeg", "png", "bmp" }
|
||||
});
|
||||
dialog.Filters.Add(new FileDialogFilter { Name = "JPEG", Extensions = { "jpg", "jpeg" } });
|
||||
dialog.Filters.Add(new FileDialogFilter { Name = "PNG", Extensions = { "png" } });
|
||||
dialog.Filters.Add(new FileDialogFilter { Name = "BMP", Extensions = { "bmp" } });
|
||||
|
||||
dialog.AllowMultiple = false;
|
||||
|
||||
string[] image = await dialog.ShowAsync(((TopLevel)_parent.GetVisualRoot()) as Window);
|
||||
|
||||
if (image != null)
|
||||
{
|
||||
if (image.Length > 0)
|
||||
{
|
||||
string imageFile = image[0];
|
||||
|
||||
_profile.Image = ProcessProfileImage(File.ReadAllBytes(imageFile));
|
||||
}
|
||||
|
||||
_parent.GoBack();
|
||||
}
|
||||
}
|
||||
|
||||
private void SelectFirmwareImage_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (FirmwareFound)
|
||||
{
|
||||
_parent.Navigate(typeof(AvatarWindow), (_parent, _profile));
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] ProcessProfileImage(byte[] buffer)
|
||||
{
|
||||
using (Image image = Image.Load(buffer))
|
||||
{
|
||||
image.Mutate(x => x.Resize(256, 256));
|
||||
|
||||
using (MemoryStream streamJpg = new())
|
||||
{
|
||||
image.SaveAsJpeg(streamJpg);
|
||||
|
||||
return streamJpg.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@ using Ryujinx.Ava.Ui.Windows;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Controls
|
||||
{
|
||||
public class UpdateWaitWindow : StyleableWindow
|
||||
public partial class UpdateWaitWindow : StyleableWindow
|
||||
{
|
||||
public UpdateWaitWindow(string primaryText, string secondaryText) : this()
|
||||
{
|
||||
@ -21,15 +21,5 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
this.AttachDevTools();
|
||||
#endif
|
||||
}
|
||||
|
||||
public TextBlock PrimaryText { get; private set; }
|
||||
public TextBlock SecondaryText { get; private set; }
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
PrimaryText = this.FindControl<TextBlock>("PrimaryText");
|
||||
SecondaryText = this.FindControl<TextBlock>("SecondaryText");
|
||||
}
|
||||
}
|
||||
}
|
55
Ryujinx.Ava/Ui/Controls/UserEditor.axaml
Normal file
55
Ryujinx.Ava/Ui/Controls/UserEditor.axaml
Normal file
@ -0,0 +1,55 @@
|
||||
<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"
|
||||
mc:Ignorable="d"
|
||||
Padding="0"
|
||||
Margin="0"
|
||||
xmlns:Locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.Ui.ViewModels"
|
||||
xmlns:models="clr-namespace:Ryujinx.Ava.Ui.Models"
|
||||
xmlns:controls="clr-namespace:Ryujinx.Ava.Ui.Controls"
|
||||
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
x:Class="Ryujinx.Ava.Ui.Controls.UserEditor">
|
||||
<UserControl.Resources>
|
||||
<controls:BitmapArrayValueConverter x:Key="ByteImage" />
|
||||
</UserControl.Resources>
|
||||
<Grid Margin="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Vertical" VerticalAlignment="Stretch" HorizontalAlignment="Left">
|
||||
<Image
|
||||
Margin="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
Height="96" Width="96"
|
||||
Name="ProfileImage"
|
||||
Source="{Binding Image, Converter={StaticResource ByteImage}}" />
|
||||
<Button Margin="5" Content="{Locale:Locale UserProfilesChangeProfileImage}"
|
||||
Name="ChangePictureButton"
|
||||
Click="ChangePictureButton_Click"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
<Button Margin="5" Content="{Locale:Locale UserProfilesSetProfileImage}"
|
||||
Name="AddPictureButton"
|
||||
Click="ChangePictureButton_Click"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="0" Orientation="Vertical" HorizontalAlignment="Stretch" Grid.Column="1" Spacing="10"
|
||||
Margin="5, 10">
|
||||
<TextBox Name="NameBox" Width="300" Text="{Binding Name}" MaxLength="{Binding MaxProfileNameLength}"
|
||||
HorizontalAlignment="Stretch" />
|
||||
<TextBlock Text="{Binding UserId}" Name="IdLabel" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Orientation="Horizontal" Spacing="10" HorizontalAlignment="Right">
|
||||
<Button Content="{Locale:Locale Save}" Name="SaveButton" Click="SaveButton_Click"/>
|
||||
<Button HorizontalAlignment="Right" Content="{Locale:Locale Discard}"
|
||||
Name="CloseButton" Click="CloseButton_Click"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
123
Ryujinx.Ava/Ui/Controls/UserEditor.axaml.cs
Normal file
123
Ryujinx.Ava/Ui/Controls/UserEditor.axaml.cs
Normal file
@ -0,0 +1,123 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Interactivity;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using FluentAvalonia.UI.Navigation;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Ui.Models;
|
||||
using UserProfile = Ryujinx.Ava.Ui.Models.UserProfile;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Controls
|
||||
{
|
||||
public partial class UserEditor : UserControl
|
||||
{
|
||||
private NavigationDialogHost _parent;
|
||||
private UserProfile _profile;
|
||||
private bool _isNewUser;
|
||||
|
||||
public TempProfile TempProfile { get; set; }
|
||||
public uint MaxProfileNameLength => 0x20;
|
||||
|
||||
public UserEditor()
|
||||
{
|
||||
InitializeComponent();
|
||||
AddHandler(Frame.NavigatedToEvent, (s, e) =>
|
||||
{
|
||||
NavigatedTo(e);
|
||||
}, RoutingStrategies.Direct);
|
||||
}
|
||||
|
||||
private void NavigatedTo(NavigationEventArgs arg)
|
||||
{
|
||||
if (Program.PreviewerDetached)
|
||||
{
|
||||
switch (arg.NavigationMode)
|
||||
{
|
||||
case NavigationMode.New:
|
||||
var args = ((NavigationDialogHost parent, UserProfile profile, bool isNewUser))arg.Parameter;
|
||||
_isNewUser = args.isNewUser;
|
||||
if (!_isNewUser)
|
||||
{
|
||||
_profile = args.profile;
|
||||
TempProfile = new TempProfile(_profile);
|
||||
}
|
||||
else
|
||||
{
|
||||
TempProfile = new TempProfile();
|
||||
}
|
||||
|
||||
_parent = args.parent;
|
||||
break;
|
||||
}
|
||||
|
||||
DataContext = TempProfile;
|
||||
|
||||
AddPictureButton.IsVisible = _isNewUser;
|
||||
IdLabel.IsVisible = !_isNewUser;
|
||||
ChangePictureButton.IsVisible = !_isNewUser;
|
||||
}
|
||||
}
|
||||
|
||||
private void CloseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_parent?.GoBack();
|
||||
}
|
||||
|
||||
private void SaveButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DataValidationErrors.ClearErrors(NameBox);
|
||||
bool isInvalid = false;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(TempProfile.Name))
|
||||
{
|
||||
DataValidationErrors.SetError(NameBox, new DataValidationException(LocaleManager.Instance["UserProfileEmptyNameError"]));
|
||||
|
||||
isInvalid = true;
|
||||
}
|
||||
|
||||
if (TempProfile.Image == null)
|
||||
{
|
||||
ContentDialogHelper.CreateWarningDialog(LocaleManager.Instance["UserProfileNoImageError"], "");
|
||||
|
||||
isInvalid = true;
|
||||
}
|
||||
|
||||
if(isInvalid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_profile != null)
|
||||
{
|
||||
_profile.Name = TempProfile.Name;
|
||||
_profile.Image = TempProfile.Image;
|
||||
_profile.UpdateState();
|
||||
_parent.AccountManager.SetUserName(_profile.UserId, _profile.Name);
|
||||
_parent.AccountManager.SetUserImage(_profile.UserId, _profile.Image);
|
||||
}
|
||||
else if (_isNewUser)
|
||||
{
|
||||
_parent.AccountManager.AddUser(TempProfile.Name, TempProfile.Image);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_parent?.GoBack();
|
||||
}
|
||||
|
||||
public void SelectProfileImage()
|
||||
{
|
||||
_parent.Navigate(typeof(ProfileImageSelectionDialog), (_parent, TempProfile));
|
||||
}
|
||||
|
||||
private void ChangePictureButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_profile != null || _isNewUser)
|
||||
{
|
||||
SelectProfileImage();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -75,7 +75,7 @@ namespace Ryujinx.Ava.Ui.Controls
|
||||
|
||||
string setupButtonLabel = isInSetupGuide ? LocaleManager.Instance["OpenSetupGuideMessage"] : "";
|
||||
|
||||
var result = await ContentDialogHelper.CreateInfoDialog(owner,
|
||||
var result = await ContentDialogHelper.CreateInfoDialog(
|
||||
string.Format(LocaleManager.Instance["DialogUserErrorDialogMessage"], errorCode, GetErrorTitle(error)),
|
||||
GetErrorDescription(error) + (isInSetupGuide
|
||||
? LocaleManager.Instance["DialogUserErrorDialogInfoMessage"]
|
||||
|
90
Ryujinx.Ava/Ui/Controls/UserSelector.axaml
Normal file
90
Ryujinx.Ava/Ui/Controls/UserSelector.axaml
Normal file
@ -0,0 +1,90 @@
|
||||
<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:flex="clr-namespace:Avalonia.Flexbox;assembly=Avalonia.Flexbox"
|
||||
xmlns:Locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.Ui.ViewModels"
|
||||
xmlns:controls="clr-namespace:Ryujinx.Ava.Ui.Controls"
|
||||
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Ryujinx.Ava.Ui.Controls.UserSelector">
|
||||
<UserControl.Resources>
|
||||
<controls:BitmapArrayValueConverter x:Key="ByteImage" />
|
||||
</UserControl.Resources>
|
||||
<Design.DataContext>
|
||||
<viewModels:UserProfileViewModel />
|
||||
</Design.DataContext>
|
||||
<Grid HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="5" Items="{Binding Profiles}"
|
||||
DoubleTapped="ProfilesList_DoubleTapped"
|
||||
SelectionChanged="SelectingItemsControl_SelectionChanged">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<flex:FlexPanel
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
AlignContent="FlexStart"
|
||||
JustifyContent="Center" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Border
|
||||
Margin="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="5">
|
||||
<Grid Margin="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image
|
||||
Grid.Row="0"
|
||||
Margin="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
Height="96" Width="96"
|
||||
Source="{Binding Image, Converter={StaticResource ByteImage}}" />
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Height="30"
|
||||
Margin="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Stretch"
|
||||
Text="{Binding Name}"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border HorizontalAlignment="Left" VerticalAlignment="Top"
|
||||
IsVisible="{Binding IsOpened}"
|
||||
Background="LimeGreen"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Margin="5"
|
||||
CornerRadius="5" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,0" Spacing="10" HorizontalAlignment="Center">
|
||||
<Button Content="{Locale:Locale UserProfilesAddNewProfile}" Command="{Binding AddUser}" />
|
||||
<Button IsEnabled="{Binding IsSelectedProfiledEditable}"
|
||||
Content="{Locale:Locale UserProfilesEditProfile}" Command="{Binding EditUser}" />
|
||||
<Button IsEnabled="{Binding IsSelectedProfileDeletable}"
|
||||
Content="{Locale:Locale UserProfilesDeleteSelectedProfile}" Command="{Binding DeleteUser}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
79
Ryujinx.Ava/Ui/Controls/UserSelector.axaml.cs
Normal file
79
Ryujinx.Ava/Ui/Controls/UserSelector.axaml.cs
Normal file
@ -0,0 +1,79 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using FluentAvalonia.UI.Navigation;
|
||||
using Ryujinx.Ava.Ui.ViewModels;
|
||||
using UserProfile = Ryujinx.Ava.Ui.Models.UserProfile;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Controls
|
||||
{
|
||||
public partial class UserSelector : UserControl
|
||||
{
|
||||
private NavigationDialogHost _parent;
|
||||
public UserProfileViewModel ViewModel { get; set; }
|
||||
|
||||
public UserSelector()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (Program.PreviewerDetached)
|
||||
{
|
||||
AddHandler(Frame.NavigatedToEvent, (s, e) =>
|
||||
{
|
||||
NavigatedTo(e);
|
||||
}, Avalonia.Interactivity.RoutingStrategies.Direct);
|
||||
}
|
||||
}
|
||||
|
||||
private void NavigatedTo(NavigationEventArgs arg)
|
||||
{
|
||||
if (Program.PreviewerDetached)
|
||||
{
|
||||
switch (arg.NavigationMode)
|
||||
{
|
||||
case NavigationMode.New:
|
||||
_parent = (NavigationDialogHost)arg.Parameter;
|
||||
ViewModel = _parent.ViewModel;
|
||||
break;
|
||||
}
|
||||
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
}
|
||||
|
||||
private void ProfilesList_DoubleTapped(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is ListBox listBox)
|
||||
{
|
||||
int selectedIndex = listBox.SelectedIndex;
|
||||
|
||||
if (selectedIndex >= 0 && selectedIndex < ViewModel.Profiles.Count)
|
||||
{
|
||||
ViewModel.SelectedProfile = ViewModel.Profiles[selectedIndex];
|
||||
|
||||
_parent?.AccountManager?.OpenUser(ViewModel.SelectedProfile.UserId);
|
||||
|
||||
ViewModel.LoadProfiles();
|
||||
|
||||
foreach (UserProfile profile in ViewModel.Profiles)
|
||||
{
|
||||
profile.UpdateState();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SelectingItemsControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (sender is ListBox listBox)
|
||||
{
|
||||
int selectedIndex = listBox.SelectedIndex;
|
||||
|
||||
if (selectedIndex >= 0 && selectedIndex < ViewModel.Profiles.Count)
|
||||
{
|
||||
ViewModel.HighlightedProfile = ViewModel.Profiles[selectedIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
72
Ryujinx.Ava/Ui/Models/Amiibo.cs
Normal file
72
Ryujinx.Ava/Ui/Models/Amiibo.cs
Normal file
@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Models
|
||||
{
|
||||
public class Amiibo
|
||||
{
|
||||
public struct AmiiboJson
|
||||
{
|
||||
[JsonPropertyName("amiibo")] public List<AmiiboApi> Amiibo { get; set; }
|
||||
[JsonPropertyName("lastUpdated")] public DateTime LastUpdated { get; set; }
|
||||
}
|
||||
|
||||
public struct AmiiboApi
|
||||
{
|
||||
[JsonPropertyName("name")] public string Name { get; set; }
|
||||
[JsonPropertyName("head")] public string Head { get; set; }
|
||||
[JsonPropertyName("tail")] public string Tail { get; set; }
|
||||
[JsonPropertyName("image")] public string Image { get; set; }
|
||||
[JsonPropertyName("amiiboSeries")] public string AmiiboSeries { get; set; }
|
||||
[JsonPropertyName("character")] public string Character { get; set; }
|
||||
[JsonPropertyName("gameSeries")] public string GameSeries { get; set; }
|
||||
[JsonPropertyName("type")] public string Type { get; set; }
|
||||
|
||||
[JsonPropertyName("release")] public Dictionary<string, string> Release { get; set; }
|
||||
|
||||
[JsonPropertyName("gamesSwitch")] public List<AmiiboApiGamesSwitch> GamesSwitch { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public string GetId()
|
||||
{
|
||||
return Head + Tail;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is AmiiboApi amiibo)
|
||||
{
|
||||
return amiibo.Head + amiibo.Tail == Head + Tail;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public class AmiiboApiGamesSwitch
|
||||
{
|
||||
[JsonPropertyName("amiiboUsage")] public List<AmiiboApiUsage> AmiiboUsage { get; set; }
|
||||
|
||||
[JsonPropertyName("gameID")] public List<string> GameId { get; set; }
|
||||
|
||||
[JsonPropertyName("gameName")] public string GameName { get; set; }
|
||||
}
|
||||
|
||||
public class AmiiboApiUsage
|
||||
{
|
||||
[JsonPropertyName("Usage")] public string Usage { get; set; }
|
||||
|
||||
[JsonPropertyName("write")] public bool Write { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
37
Ryujinx.Ava/Ui/Models/CheatModel.cs
Normal file
37
Ryujinx.Ava/Ui/Models/CheatModel.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using Ryujinx.Ava.Ui.ViewModels;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Models
|
||||
{
|
||||
public class CheatModel : BaseModel
|
||||
{
|
||||
private bool _isEnabled;
|
||||
|
||||
public event EventHandler<bool> EnableToggled;
|
||||
|
||||
public CheatModel(string name, string buildId, bool isEnabled)
|
||||
{
|
||||
Name = name;
|
||||
BuildId = buildId;
|
||||
IsEnabled = isEnabled;
|
||||
}
|
||||
|
||||
public bool IsEnabled
|
||||
{
|
||||
get => _isEnabled;
|
||||
set
|
||||
{
|
||||
_isEnabled = value;
|
||||
EnableToggled?.Invoke(this, _isEnabled);
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string BuildId { get; }
|
||||
|
||||
public string BuildIdKey => $"{BuildId}-{Name}";
|
||||
public string Name { get; }
|
||||
|
||||
public string CleanName => Name.Substring(1, Name.Length - 8);
|
||||
}
|
||||
}
|
51
Ryujinx.Ava/Ui/Models/CheatsList.cs
Normal file
51
Ryujinx.Ava/Ui/Models/CheatsList.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Models
|
||||
{
|
||||
public class CheatsList : ObservableCollection<CheatModel>
|
||||
{
|
||||
public CheatsList(string buildId, string path)
|
||||
{
|
||||
BuildId = buildId;
|
||||
Path = path;
|
||||
CollectionChanged += CheatsList_CollectionChanged;
|
||||
}
|
||||
|
||||
private void CheatsList_CollectionChanged(object sender,
|
||||
NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
if (e.Action == NotifyCollectionChangedAction.Add)
|
||||
{
|
||||
(e.NewItems[0] as CheatModel).EnableToggled += Item_EnableToggled;
|
||||
}
|
||||
}
|
||||
|
||||
private void Item_EnableToggled(object sender, bool e)
|
||||
{
|
||||
OnPropertyChanged(new PropertyChangedEventArgs(nameof(IsEnabled)));
|
||||
}
|
||||
|
||||
public string BuildId { get; }
|
||||
public string Path { get; }
|
||||
|
||||
public bool IsEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ToList().TrueForAll(x => x.IsEnabled);
|
||||
}
|
||||
set
|
||||
{
|
||||
foreach (var cheat in this)
|
||||
{
|
||||
cheat.IsEnabled = value;
|
||||
}
|
||||
|
||||
OnPropertyChanged(new PropertyChangedEventArgs(nameof(IsEnabled)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
18
Ryujinx.Ava/Ui/Models/DlcModel.cs
Normal file
18
Ryujinx.Ava/Ui/Models/DlcModel.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace Ryujinx.Ava.Ui.Models
|
||||
{
|
||||
public class DlcModel
|
||||
{
|
||||
public bool IsEnabled { get; set; }
|
||||
public string TitleId { get; }
|
||||
public string ContainerPath { get; }
|
||||
public string FullPath { get; }
|
||||
|
||||
public DlcModel(string titleId, string containerPath, string fullPath, bool isEnabled)
|
||||
{
|
||||
TitleId = titleId;
|
||||
ContainerPath = containerPath;
|
||||
FullPath = fullPath;
|
||||
IsEnabled = isEnabled;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Ava.Ui.Models
|
||||
{
|
||||
internal class ProfileImageModel
|
||||
public class ProfileImageModel
|
||||
{
|
||||
public ProfileImageModel(string name, byte[] data)
|
||||
{
|
||||
|
55
Ryujinx.Ava/Ui/Models/TempProfile.cs
Normal file
55
Ryujinx.Ava/Ui/Models/TempProfile.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using Ryujinx.Ava.Ui.ViewModels;
|
||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Models
|
||||
{
|
||||
public class TempProfile : BaseModel
|
||||
{
|
||||
private readonly UserProfile _profile;
|
||||
private byte[] _image = null;
|
||||
private string _name = String.Empty;
|
||||
private UserId _userId;
|
||||
|
||||
public byte[] Image
|
||||
{
|
||||
get => _image;
|
||||
set
|
||||
{
|
||||
_image = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public UserId UserId
|
||||
{
|
||||
get => _userId;
|
||||
set
|
||||
{
|
||||
_userId = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get => _name;
|
||||
set
|
||||
{
|
||||
_name = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public TempProfile(UserProfile profile)
|
||||
{
|
||||
_profile = profile;
|
||||
|
||||
Image = profile.Image;
|
||||
Name = profile.Name;
|
||||
UserId = profile.UserId;
|
||||
}
|
||||
|
||||
public TempProfile(){}
|
||||
}
|
||||
}
|
@ -9,8 +9,11 @@ namespace Ryujinx.Ava.Ui.Models
|
||||
public bool IsNoUpdate { get; }
|
||||
public ApplicationControlProperty Control { get; }
|
||||
public string Path { get; }
|
||||
public string Label => IsNoUpdate ? LocaleManager.Instance["NoUpdate"] :
|
||||
string.Format(LocaleManager.Instance["TitleUpdateVersionLabel"], Control.DisplayVersionString.ToString(), Path);
|
||||
|
||||
public string Label => IsNoUpdate
|
||||
? LocaleManager.Instance["NoUpdate"]
|
||||
: string.Format(LocaleManager.Instance["TitleUpdateVersionLabel"], Control.DisplayVersionString.ToString(),
|
||||
Path);
|
||||
|
||||
public TitleUpdateModel(ApplicationControlProperty control, string path, bool isNoUpdate = false)
|
||||
{
|
||||
|
61
Ryujinx.Ava/Ui/Models/UserProfile.cs
Normal file
61
Ryujinx.Ava/Ui/Models/UserProfile.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using Ryujinx.Ava.Ui.ViewModels;
|
||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||
using Profile = Ryujinx.HLE.HOS.Services.Account.Acc.UserProfile;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Models
|
||||
{
|
||||
public class UserProfile : BaseModel
|
||||
{
|
||||
private readonly Profile _profile;
|
||||
private byte[] _image;
|
||||
private string _name;
|
||||
private UserId _userId;
|
||||
|
||||
public byte[] Image
|
||||
{
|
||||
get => _image;
|
||||
set
|
||||
{
|
||||
_image = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public UserId UserId
|
||||
{
|
||||
get => _userId;
|
||||
set
|
||||
{
|
||||
_userId = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get => _name;
|
||||
set
|
||||
{
|
||||
_name = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public UserProfile(Profile profile)
|
||||
{
|
||||
_profile = profile;
|
||||
|
||||
Image = profile.Image;
|
||||
Name = profile.Name;
|
||||
UserId = profile.UserId;
|
||||
}
|
||||
|
||||
public bool IsOpened => _profile.AccountState == AccountState.Open;
|
||||
|
||||
public void UpdateState()
|
||||
{
|
||||
OnPropertyChanged(nameof(IsOpened));
|
||||
OnPropertyChanged(nameof(Name));
|
||||
}
|
||||
}
|
||||
}
|
450
Ryujinx.Ava/Ui/ViewModels/AmiiboWindowViewModel.cs
Normal file
450
Ryujinx.Ava/Ui/ViewModels/AmiiboWindowViewModel.cs
Normal file
@ -0,0 +1,450 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Collections;
|
||||
using Avalonia.Media.Imaging;
|
||||
using Avalonia.Threading;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Ui.Controls;
|
||||
using Ryujinx.Ava.Ui.Models;
|
||||
using Ryujinx.Ava.Ui.Windows;
|
||||
using Ryujinx.Common;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.ViewModels
|
||||
{
|
||||
public class AmiiboWindowViewModel : BaseModel, IDisposable
|
||||
{
|
||||
private const string DefaultJson = "{ \"amiibo\": [] }";
|
||||
private const float AmiiboImageSize = 350f;
|
||||
|
||||
private readonly string _amiiboJsonPath;
|
||||
private readonly byte[] _amiiboLogoBytes;
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly StyleableWindow _owner;
|
||||
|
||||
private Bitmap _amiiboImage;
|
||||
private List<Amiibo.AmiiboApi> _amiiboList;
|
||||
private AvaloniaList<Amiibo.AmiiboApi> _amiibos;
|
||||
private ObservableCollection<string> _amiiboSeries;
|
||||
|
||||
private int _amiiboSelectedIndex;
|
||||
private int _seriesSelectedIndex;
|
||||
private bool _enableScanning;
|
||||
private bool _showAllAmiibo;
|
||||
private bool _useRandomUuid;
|
||||
private string _usage;
|
||||
|
||||
public AmiiboWindowViewModel(StyleableWindow owner, string lastScannedAmiiboId, string titleId)
|
||||
{
|
||||
_owner = owner;
|
||||
_httpClient = new HttpClient { Timeout = TimeSpan.FromMilliseconds(5000) };
|
||||
LastScannedAmiiboId = lastScannedAmiiboId;
|
||||
TitleId = titleId;
|
||||
|
||||
Directory.CreateDirectory(Path.Join(AppDataManager.BaseDirPath, "system", "amiibo"));
|
||||
|
||||
_amiiboJsonPath = Path.Join(AppDataManager.BaseDirPath, "system", "amiibo", "Amiibo.json");
|
||||
_amiiboList = new List<Amiibo.AmiiboApi>();
|
||||
_amiiboSeries = new ObservableCollection<string>();
|
||||
_amiibos = new AvaloniaList<Amiibo.AmiiboApi>();
|
||||
|
||||
_amiiboLogoBytes = EmbeddedResources.Read("Ryujinx.Ui.Common/Resources/Logo_Amiibo.png");
|
||||
|
||||
_ = LoadContentAsync();
|
||||
}
|
||||
|
||||
public AmiiboWindowViewModel() { }
|
||||
|
||||
public string TitleId { get; set; }
|
||||
public string LastScannedAmiiboId { get; set; }
|
||||
|
||||
public UserResult Response { get; private set; }
|
||||
|
||||
public bool UseRandomUuid
|
||||
{
|
||||
get => _useRandomUuid;
|
||||
set
|
||||
{
|
||||
_useRandomUuid = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowAllAmiibo
|
||||
{
|
||||
get => _showAllAmiibo;
|
||||
set
|
||||
{
|
||||
_showAllAmiibo = value;
|
||||
|
||||
#pragma warning disable 4014
|
||||
ParseAmiiboData();
|
||||
#pragma warning restore 4014
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public AvaloniaList<Amiibo.AmiiboApi> AmiiboList
|
||||
{
|
||||
get => _amiibos;
|
||||
set
|
||||
{
|
||||
_amiibos = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<string> AmiiboSeries
|
||||
{
|
||||
get => _amiiboSeries;
|
||||
set
|
||||
{
|
||||
_amiiboSeries = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int SeriesSelectedIndex
|
||||
{
|
||||
get => _seriesSelectedIndex;
|
||||
set
|
||||
{
|
||||
_seriesSelectedIndex = value;
|
||||
|
||||
FilterAmiibo();
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int AmiiboSelectedIndex
|
||||
{
|
||||
get => _amiiboSelectedIndex;
|
||||
set
|
||||
{
|
||||
_amiiboSelectedIndex = value;
|
||||
|
||||
EnableScanning = _amiiboSelectedIndex >= 0 && _amiiboSelectedIndex < _amiibos.Count;
|
||||
|
||||
SetAmiiboDetails();
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public Bitmap AmiiboImage
|
||||
{
|
||||
get => _amiiboImage;
|
||||
set
|
||||
{
|
||||
_amiiboImage = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string Usage
|
||||
{
|
||||
get => _usage;
|
||||
set
|
||||
{
|
||||
_usage = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool EnableScanning
|
||||
{
|
||||
get => _enableScanning;
|
||||
set
|
||||
{
|
||||
_enableScanning = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_httpClient.Dispose();
|
||||
}
|
||||
|
||||
private async Task LoadContentAsync()
|
||||
{
|
||||
string amiiboJsonString = DefaultJson;
|
||||
|
||||
if (File.Exists(_amiiboJsonPath))
|
||||
{
|
||||
amiiboJsonString = File.ReadAllText(_amiiboJsonPath);
|
||||
|
||||
if (await NeedsUpdate(JsonSerializer.Deserialize<Amiibo.AmiiboJson>(amiiboJsonString).LastUpdated))
|
||||
{
|
||||
amiiboJsonString = await DownloadAmiiboJson();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
amiiboJsonString = await DownloadAmiiboJson();
|
||||
}
|
||||
catch
|
||||
{
|
||||
ShowInfoDialog();
|
||||
}
|
||||
}
|
||||
|
||||
_amiiboList = JsonSerializer.Deserialize<Amiibo.AmiiboJson>(amiiboJsonString).Amiibo;
|
||||
_amiiboList = _amiiboList.OrderBy(amiibo => amiibo.AmiiboSeries).ToList();
|
||||
|
||||
ParseAmiiboData();
|
||||
}
|
||||
|
||||
private void ParseAmiiboData()
|
||||
{
|
||||
_amiiboSeries.Clear();
|
||||
_amiibos.Clear();
|
||||
|
||||
for (int i = 0; i < _amiiboList.Count; i++)
|
||||
{
|
||||
if (!_amiiboSeries.Contains(_amiiboList[i].AmiiboSeries))
|
||||
{
|
||||
if (!ShowAllAmiibo)
|
||||
{
|
||||
foreach (Amiibo.AmiiboApiGamesSwitch game in _amiiboList[i].GamesSwitch)
|
||||
{
|
||||
if (game != null)
|
||||
{
|
||||
if (game.GameId.Contains(TitleId))
|
||||
{
|
||||
AmiiboSeries.Add(_amiiboList[i].AmiiboSeries);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AmiiboSeries.Add(_amiiboList[i].AmiiboSeries);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (LastScannedAmiiboId != "")
|
||||
{
|
||||
SelectLastScannedAmiibo();
|
||||
}
|
||||
else
|
||||
{
|
||||
SeriesSelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void SelectLastScannedAmiibo()
|
||||
{
|
||||
Amiibo.AmiiboApi scanned = _amiiboList.FirstOrDefault(amiibo => amiibo.GetId() == LastScannedAmiiboId);
|
||||
|
||||
SeriesSelectedIndex = AmiiboSeries.IndexOf(scanned.AmiiboSeries);
|
||||
AmiiboSelectedIndex = AmiiboList.IndexOf(scanned);
|
||||
}
|
||||
|
||||
private void FilterAmiibo()
|
||||
{
|
||||
_amiibos.Clear();
|
||||
|
||||
if (_seriesSelectedIndex < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<Amiibo.AmiiboApi> amiiboSortedList = _amiiboList
|
||||
.Where(amiibo => amiibo.AmiiboSeries == _amiiboSeries[SeriesSelectedIndex])
|
||||
.OrderBy(amiibo => amiibo.Name).ToList();
|
||||
|
||||
for (int i = 0; i < amiiboSortedList.Count; i++)
|
||||
{
|
||||
if (!_amiibos.Contains(amiiboSortedList[i]))
|
||||
{
|
||||
if (!_showAllAmiibo)
|
||||
{
|
||||
foreach (Amiibo.AmiiboApiGamesSwitch game in amiiboSortedList[i].GamesSwitch)
|
||||
{
|
||||
if (game != null)
|
||||
{
|
||||
if (game.GameId.Contains(TitleId))
|
||||
{
|
||||
_amiibos.Add(amiiboSortedList[i]);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_amiibos.Add(amiiboSortedList[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AmiiboSelectedIndex = 0;
|
||||
}
|
||||
|
||||
private void SetAmiiboDetails()
|
||||
{
|
||||
ResetAmiiboPreview();
|
||||
|
||||
Usage = string.Empty;
|
||||
|
||||
if (_amiiboSelectedIndex < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Amiibo.AmiiboApi selected = _amiibos[_amiiboSelectedIndex];
|
||||
|
||||
string imageUrl = _amiiboList.FirstOrDefault(amiibo => amiibo.Equals(selected)).Image;
|
||||
|
||||
string usageString = "";
|
||||
|
||||
for (int i = 0; i < _amiiboList.Count; i++)
|
||||
{
|
||||
if (_amiiboList[i].Equals(selected))
|
||||
{
|
||||
bool writable = false;
|
||||
|
||||
foreach (Amiibo.AmiiboApiGamesSwitch item in _amiiboList[i].GamesSwitch)
|
||||
{
|
||||
if (item.GameId.Contains(TitleId))
|
||||
{
|
||||
foreach (Amiibo.AmiiboApiUsage usageItem in item.AmiiboUsage)
|
||||
{
|
||||
usageString += Environment.NewLine +
|
||||
$"- {usageItem.Usage.Replace("/", Environment.NewLine + "-")}";
|
||||
|
||||
writable = usageItem.Write;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (usageString.Length == 0)
|
||||
{
|
||||
usageString = LocaleManager.Instance["Unknown"] + ".";
|
||||
}
|
||||
|
||||
Usage = $"{LocaleManager.Instance["Usage"]} {(writable ? $" ({LocaleManager.Instance["Writable"]})" : "")} : {usageString}";
|
||||
}
|
||||
}
|
||||
|
||||
_ = UpdateAmiiboPreview(imageUrl);
|
||||
}
|
||||
|
||||
private async Task<bool> NeedsUpdate(DateTime oldLastModified)
|
||||
{
|
||||
try
|
||||
{
|
||||
HttpResponseMessage response =
|
||||
await _httpClient.SendAsync(new HttpRequestMessage(HttpMethod.Head, "https://amiibo.ryujinx.org/"));
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
return response.Content.Headers.LastModified != oldLastModified;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
ShowInfoDialog();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<string> DownloadAmiiboJson()
|
||||
{
|
||||
HttpResponseMessage response = await _httpClient.GetAsync("https://amiibo.ryujinx.org/");
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string amiiboJsonString = await response.Content.ReadAsStringAsync();
|
||||
|
||||
using (FileStream dlcJsonStream = File.Create(_amiiboJsonPath, 4096, FileOptions.WriteThrough))
|
||||
{
|
||||
dlcJsonStream.Write(Encoding.UTF8.GetBytes(amiiboJsonString));
|
||||
}
|
||||
|
||||
return amiiboJsonString;
|
||||
}
|
||||
|
||||
await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance["DialogAmiiboApiTitle"],
|
||||
LocaleManager.Instance["DialogAmiiboApiFailFetchMessage"],
|
||||
LocaleManager.Instance["InputDialogOk"],
|
||||
"",
|
||||
LocaleManager.Instance["RyujinxInfo"]);
|
||||
|
||||
Close();
|
||||
|
||||
return DefaultJson;
|
||||
}
|
||||
|
||||
private void Close()
|
||||
{
|
||||
Dispatcher.UIThread.Post(_owner.Close);
|
||||
}
|
||||
|
||||
private async Task UpdateAmiiboPreview(string imageUrl)
|
||||
{
|
||||
HttpResponseMessage response = await _httpClient.GetAsync(imageUrl);
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
byte[] amiiboPreviewBytes = await response.Content.ReadAsByteArrayAsync();
|
||||
using (MemoryStream memoryStream = new(amiiboPreviewBytes))
|
||||
{
|
||||
Bitmap bitmap = new(memoryStream);
|
||||
|
||||
double ratio = Math.Min(AmiiboImageSize / bitmap.Size.Width,
|
||||
AmiiboImageSize / bitmap.Size.Height);
|
||||
|
||||
int resizeHeight = (int)(bitmap.Size.Height * ratio);
|
||||
int resizeWidth = (int)(bitmap.Size.Width * ratio);
|
||||
|
||||
AmiiboImage = bitmap.CreateScaledBitmap(new PixelSize(resizeWidth, resizeHeight));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ResetAmiiboPreview()
|
||||
{
|
||||
using (MemoryStream memoryStream = new(_amiiboLogoBytes))
|
||||
{
|
||||
Bitmap bitmap = new(memoryStream);
|
||||
|
||||
AmiiboImage = bitmap;
|
||||
}
|
||||
}
|
||||
|
||||
private async void ShowInfoDialog()
|
||||
{
|
||||
await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance["DialogAmiiboApiTitle"],
|
||||
LocaleManager.Instance["DialogAmiiboApiConnectErrorMessage"],
|
||||
LocaleManager.Instance["InputDialogOk"],
|
||||
"",
|
||||
LocaleManager.Instance["RyujinxInfo"]);
|
||||
}
|
||||
}
|
||||
}
|
363
Ryujinx.Ava/Ui/ViewModels/AvatarProfileViewModel.cs
Normal file
363
Ryujinx.Ava/Ui/ViewModels/AvatarProfileViewModel.cs
Normal file
@ -0,0 +1,363 @@
|
||||
using Avalonia.Media;
|
||||
using DynamicData;
|
||||
using LibHac.Common;
|
||||
using LibHac.Fs;
|
||||
using LibHac.Fs.Fsa;
|
||||
using LibHac.FsSystem;
|
||||
using LibHac.Ncm;
|
||||
using LibHac.Tools.Fs;
|
||||
using LibHac.Tools.FsSystem;
|
||||
using LibHac.Tools.FsSystem.NcaUtils;
|
||||
using Ryujinx.Ava.Ui.Models;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.Formats.Png;
|
||||
using SixLabors.ImageSharp.PixelFormats;
|
||||
using SixLabors.ImageSharp.Processing;
|
||||
using System;
|
||||
using System.Buffers.Binary;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Color = Avalonia.Media.Color;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.ViewModels
|
||||
{
|
||||
internal class AvatarProfileViewModel : BaseModel, IDisposable
|
||||
{
|
||||
private const int MaxImageTasks = 4;
|
||||
|
||||
private static readonly Dictionary<string, byte[]> _avatarStore = new();
|
||||
private static bool _isPreloading;
|
||||
private static Action _loadCompleteAction;
|
||||
|
||||
private ObservableCollection<ProfileImageModel> _images;
|
||||
private Color _backgroundColor = Colors.White;
|
||||
|
||||
private int _selectedIndex;
|
||||
private int _imagesLoaded;
|
||||
private bool _isActive;
|
||||
private byte[] _selectedImage;
|
||||
private bool _isIndeterminate = true;
|
||||
|
||||
public bool IsActive
|
||||
{
|
||||
get => _isActive;
|
||||
set => _isActive = value;
|
||||
}
|
||||
|
||||
public AvatarProfileViewModel()
|
||||
{
|
||||
_images = new ObservableCollection<ProfileImageModel>();
|
||||
}
|
||||
|
||||
public AvatarProfileViewModel(Action loadCompleteAction)
|
||||
{
|
||||
_images = new ObservableCollection<ProfileImageModel>();
|
||||
|
||||
if (_isPreloading)
|
||||
{
|
||||
_loadCompleteAction = loadCompleteAction;
|
||||
}
|
||||
else
|
||||
{
|
||||
ReloadImages();
|
||||
}
|
||||
}
|
||||
|
||||
public Color BackgroundColor
|
||||
{
|
||||
get => _backgroundColor;
|
||||
set
|
||||
{
|
||||
_backgroundColor = value;
|
||||
|
||||
IsActive = false;
|
||||
|
||||
ReloadImages();
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<ProfileImageModel> Images
|
||||
{
|
||||
get => _images;
|
||||
set
|
||||
{
|
||||
_images = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsIndeterminate
|
||||
{
|
||||
get => _isIndeterminate;
|
||||
set
|
||||
{
|
||||
_isIndeterminate = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int ImageCount => _avatarStore.Count;
|
||||
|
||||
public int ImagesLoaded
|
||||
{
|
||||
get => _imagesLoaded;
|
||||
set
|
||||
{
|
||||
_imagesLoaded = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int SelectedIndex
|
||||
{
|
||||
get => _selectedIndex;
|
||||
set
|
||||
{
|
||||
_selectedIndex = value;
|
||||
|
||||
if (_selectedIndex == -1)
|
||||
{
|
||||
SelectedImage = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedImage = _images[_selectedIndex].Data;
|
||||
}
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] SelectedImage
|
||||
{
|
||||
get => _selectedImage;
|
||||
private set => _selectedImage = value;
|
||||
}
|
||||
|
||||
public void ReloadImages()
|
||||
{
|
||||
if (_isPreloading)
|
||||
{
|
||||
IsIndeterminate = false;
|
||||
return;
|
||||
}
|
||||
Task.Run(() =>
|
||||
{
|
||||
IsActive = true;
|
||||
|
||||
Images.Clear();
|
||||
int selectedIndex = _selectedIndex;
|
||||
int index = 0;
|
||||
|
||||
ImagesLoaded = 0;
|
||||
IsIndeterminate = false;
|
||||
|
||||
var keys = _avatarStore.Keys.ToList();
|
||||
|
||||
var newImages = new List<ProfileImageModel>();
|
||||
var tasks = new List<Task>();
|
||||
|
||||
for (int i = 0; i < MaxImageTasks; i++)
|
||||
{
|
||||
var start = i;
|
||||
tasks.Add(Task.Run(() => ImageTask(start)));
|
||||
}
|
||||
|
||||
Task.WaitAll(tasks.ToArray());
|
||||
|
||||
Images.AddRange(newImages);
|
||||
|
||||
void ImageTask(int start)
|
||||
{
|
||||
for (int i = start; i < keys.Count; i += MaxImageTasks)
|
||||
{
|
||||
if (!IsActive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var key = keys[i];
|
||||
var image = _avatarStore[keys[i]];
|
||||
|
||||
var data = ProcessImage(image);
|
||||
newImages.Add(new ProfileImageModel(key, data));
|
||||
if (index++ == selectedIndex)
|
||||
{
|
||||
SelectedImage = data;
|
||||
}
|
||||
|
||||
Interlocked.Increment(ref _imagesLoaded);
|
||||
OnPropertyChanged(nameof(ImagesLoaded));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private byte[] ProcessImage(byte[] data)
|
||||
{
|
||||
using (MemoryStream streamJpg = new())
|
||||
{
|
||||
Image avatarImage = Image.Load(data, new PngDecoder());
|
||||
|
||||
avatarImage.Mutate(x => x.BackgroundColor(new Rgba32(BackgroundColor.R,
|
||||
BackgroundColor.G,
|
||||
BackgroundColor.B,
|
||||
BackgroundColor.A)));
|
||||
avatarImage.SaveAsJpeg(streamJpg);
|
||||
|
||||
return streamJpg.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static void PreloadAvatars(ContentManager contentManager, VirtualFileSystem virtualFileSystem)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_avatarStore.Count > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_isPreloading = true;
|
||||
|
||||
string contentPath =
|
||||
contentManager.GetInstalledContentPath(0x010000000000080A, StorageId.BuiltInSystem,
|
||||
NcaContentType.Data);
|
||||
string avatarPath = virtualFileSystem.SwitchPathToSystemPath(contentPath);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(avatarPath))
|
||||
{
|
||||
using (IStorage ncaFileStream = new LocalStorage(avatarPath, FileAccess.Read, FileMode.Open))
|
||||
{
|
||||
Nca nca = new(virtualFileSystem.KeySet, ncaFileStream);
|
||||
IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.ErrorOnInvalid);
|
||||
|
||||
foreach (DirectoryEntryEx item in romfs.EnumerateEntries())
|
||||
{
|
||||
// TODO: Parse DatabaseInfo.bin and table.bin files for more accuracy.
|
||||
if (item.Type == DirectoryEntryType.File && item.FullPath.Contains("chara") &&
|
||||
item.FullPath.Contains("szs"))
|
||||
{
|
||||
using var file = new UniqueRef<IFile>();
|
||||
|
||||
romfs.OpenFile(ref file.Ref(), ("/" + item.FullPath).ToU8Span(), OpenMode.Read)
|
||||
.ThrowIfFailure();
|
||||
|
||||
using (MemoryStream stream = new())
|
||||
using (MemoryStream streamPng = new())
|
||||
{
|
||||
file.Get.AsStream().CopyTo(stream);
|
||||
|
||||
stream.Position = 0;
|
||||
|
||||
Image avatarImage = Image.LoadPixelData<Rgba32>(DecompressYaz0(stream), 256, 256);
|
||||
|
||||
avatarImage.SaveAsPng(streamPng);
|
||||
|
||||
_avatarStore.Add(item.FullPath, streamPng.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isPreloading = false;
|
||||
_loadCompleteAction?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] DecompressYaz0(Stream stream)
|
||||
{
|
||||
using (BinaryReader reader = new(stream))
|
||||
{
|
||||
reader.ReadInt32(); // Magic
|
||||
|
||||
uint decodedLength = BinaryPrimitives.ReverseEndianness(reader.ReadUInt32());
|
||||
|
||||
reader.ReadInt64(); // Padding
|
||||
|
||||
byte[] input = new byte[stream.Length - stream.Position];
|
||||
stream.Read(input, 0, input.Length);
|
||||
|
||||
uint inputOffset = 0;
|
||||
|
||||
byte[] output = new byte[decodedLength];
|
||||
uint outputOffset = 0;
|
||||
|
||||
ushort mask = 0;
|
||||
byte header = 0;
|
||||
|
||||
while (outputOffset < decodedLength)
|
||||
{
|
||||
if ((mask >>= 1) == 0)
|
||||
{
|
||||
header = input[inputOffset++];
|
||||
mask = 0x80;
|
||||
}
|
||||
|
||||
if ((header & mask) != 0)
|
||||
{
|
||||
if (outputOffset == output.Length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
output[outputOffset++] = input[inputOffset++];
|
||||
}
|
||||
else
|
||||
{
|
||||
byte byte1 = input[inputOffset++];
|
||||
byte byte2 = input[inputOffset++];
|
||||
|
||||
uint dist = (uint)((byte1 & 0xF) << 8) | byte2;
|
||||
uint position = outputOffset - (dist + 1);
|
||||
|
||||
uint length = (uint)byte1 >> 4;
|
||||
if (length == 0)
|
||||
{
|
||||
length = (uint)input[inputOffset++] + 0x12;
|
||||
}
|
||||
else
|
||||
{
|
||||
length += 2;
|
||||
}
|
||||
|
||||
uint gap = outputOffset - position;
|
||||
uint nonOverlappingLength = length;
|
||||
|
||||
if (nonOverlappingLength > gap)
|
||||
{
|
||||
nonOverlappingLength = gap;
|
||||
}
|
||||
|
||||
Buffer.BlockCopy(output, (int)position, output, (int)outputOffset, (int)nonOverlappingLength);
|
||||
outputOffset += nonOverlappingLength;
|
||||
position += nonOverlappingLength;
|
||||
length -= nonOverlappingLength;
|
||||
|
||||
while (length-- > 0)
|
||||
{
|
||||
output[outputOffset++] = output[position++];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_loadCompleteAction = null;
|
||||
IsActive = false;
|
||||
}
|
||||
}
|
||||
}
|
@ -327,12 +327,12 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
|
||||
public async void ShowMotionConfig()
|
||||
{
|
||||
await MotionSettingsWindow.Show(this, _owner.GetVisualRoot() as StyleableWindow);
|
||||
await MotionSettingsWindow.Show(this);
|
||||
}
|
||||
|
||||
public async void ShowRumbleConfig()
|
||||
{
|
||||
await RumbleSettingsWindow.Show(this, _owner.GetVisualRoot() as StyleableWindow);
|
||||
await RumbleSettingsWindow.Show(this);
|
||||
}
|
||||
|
||||
private void LoadInputDriver()
|
||||
@ -658,7 +658,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
return config;
|
||||
}
|
||||
|
||||
public void LoadProfile()
|
||||
public async void LoadProfile()
|
||||
{
|
||||
if (Device == 0)
|
||||
{
|
||||
@ -700,10 +700,10 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
catch (JsonException) { }
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner.GetVisualRoot() as StyleableWindow,
|
||||
String.Format(LocaleManager.Instance["DialogProfileInvalidProfileErrorMessage"], ProfileName));
|
||||
Logger.Error?.Print(LogClass.Configuration, $"Profile {ProfileName} is incompatible with the current input configuration system.");
|
||||
|
||||
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance["DialogProfileInvalidProfileErrorMessage"], ProfileName));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -736,7 +736,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
|
||||
if (ProfileName == LocaleManager.Instance["ControllerSettingsProfileDefault"])
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner.GetVisualRoot() as StyleableWindow, LocaleManager.Instance["DialogProfileDefaultProfileOverwriteErrorMessage"]);
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogProfileDefaultProfileOverwriteErrorMessage"]);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -769,7 +769,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
}
|
||||
else
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner.GetVisualRoot() as StyleableWindow, LocaleManager.Instance["DialogProfileInvalidProfileNameErrorMessage"]);
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogProfileInvalidProfileNameErrorMessage"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -782,7 +782,6 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
}
|
||||
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(
|
||||
_owner.GetVisualRoot() as StyleableWindow,
|
||||
LocaleManager.Instance["DialogProfileDeleteProfileTitle"],
|
||||
LocaleManager.Instance["DialogProfileDeleteProfileMessage"],
|
||||
LocaleManager.Instance["InputDialogYes"],
|
||||
|
@ -67,6 +67,8 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
private bool _isPaused;
|
||||
private bool _showContent = true;
|
||||
private bool _isLoadingIndeterminate = true;
|
||||
private bool _showAll;
|
||||
private string _lastScannedAmiiboId;
|
||||
private ReadOnlyObservableCollection<ApplicationData> _appsObservableList;
|
||||
|
||||
public string TitleName { get; internal set; }
|
||||
@ -533,6 +535,11 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowConsoleVisible
|
||||
{
|
||||
get => ConsoleHelper.SetConsoleWindowStateSupported;
|
||||
}
|
||||
|
||||
public ObservableCollection<ApplicationData> Applications
|
||||
{
|
||||
get => _applications;
|
||||
@ -695,15 +702,28 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenAmiiboWindow()
|
||||
public async void OpenAmiiboWindow()
|
||||
{
|
||||
if (!_isAmiiboRequested)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO : Implement Amiibo window
|
||||
ContentDialogHelper.ShowNotAvailableMessage(_owner);
|
||||
if (_owner.AppHost.Device.System.SearchingForAmiibo(out int deviceId))
|
||||
{
|
||||
string titleId = _owner.AppHost.Device.Application.TitleIdText.ToUpper();
|
||||
AmiiboWindow window = new(_showAll, _lastScannedAmiiboId, titleId);
|
||||
|
||||
await window.ShowDialog(_owner);
|
||||
|
||||
if (window.IsScanned)
|
||||
{
|
||||
_showAll = window.ViewModel.ShowAllAmiibo;
|
||||
_lastScannedAmiiboId = window.ScannedAmiibo.GetId();
|
||||
|
||||
_owner.AppHost.Device.System.ScanAmiibo(deviceId, _lastScannedAmiiboId, window.ViewModel.UseRandomUuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleShaderProgress(Switch emulationContext)
|
||||
@ -953,10 +973,9 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
LoadConfigurableHotKeys();
|
||||
}
|
||||
|
||||
public void ManageProfiles()
|
||||
public async void ManageProfiles()
|
||||
{
|
||||
// TODO : Implement Profiles window
|
||||
ContentDialogHelper.ShowNotAvailableMessage(_owner);
|
||||
await NavigationDialogHost.Show(_owner.AccountManager, _owner.ContentManager, _owner.VirtualFileSystem);
|
||||
}
|
||||
|
||||
public async void OpenAboutWindow()
|
||||
@ -1031,8 +1050,10 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
if (!ulong.TryParse(selection.TitleId, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
|
||||
out ulong titleIdNumber))
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner,
|
||||
LocaleManager.Instance["DialogRyujinxErrorMessage"], LocaleManager.Instance["DialogInvalidTitleIdErrorMessage"]);
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogRyujinxErrorMessage"], LocaleManager.Instance["DialogInvalidTitleIdErrorMessage"]);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1114,7 +1135,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
DirectoryInfo backupDir = new(Path.Combine(AppDataManager.GamesDirPath, selection.TitleId, "cache", "cpu", "1"));
|
||||
|
||||
// FIXME: Found a way to reproduce the bold effect on the title name (fork?).
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(_owner, LocaleManager.Instance["DialogWarning"],
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(LocaleManager.Instance["DialogWarning"],
|
||||
string.Format(LocaleManager.Instance["DialogPPTCDeletionMessage"], selection.TitleName), LocaleManager.Instance["InputDialogYes"], LocaleManager.Instance["InputDialogNo"], LocaleManager.Instance["RyujinxConfirm"]);
|
||||
|
||||
List<FileInfo> cacheFiles = new();
|
||||
@ -1139,7 +1160,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner, string.Format(LocaleManager.Instance["DialogPPTCDeletionErrorMessage"], file.Name, e));
|
||||
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance["DialogPPTCDeletionErrorMessage"], file.Name, e));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1177,7 +1198,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
DirectoryInfo shaderCacheDir = new(Path.Combine(AppDataManager.GamesDirPath, selection.TitleId, "cache", "shader"));
|
||||
|
||||
// FIXME: Found a way to reproduce the bold effect on the title name (fork?).
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(_owner, LocaleManager.Instance["DialogWarning"],
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(LocaleManager.Instance["DialogWarning"],
|
||||
string.Format(LocaleManager.Instance["DialogShaderDeletionMessage"], selection.TitleName), LocaleManager.Instance["InputDialogYes"], LocaleManager.Instance["InputDialogNo"], LocaleManager.Instance["RyujinxConfirm"]);
|
||||
|
||||
List<DirectoryInfo> oldCacheDirectories = new List<DirectoryInfo>();
|
||||
@ -1200,7 +1221,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner, string.Format(LocaleManager.Instance["DialogPPTCDeletionErrorMessage"], directory.Name, e));
|
||||
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance["DialogPPTCDeletionErrorMessage"], directory.Name, e));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1213,7 +1234,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner, string.Format(LocaleManager.Instance["ShaderCachePurgeError"], file.Name, e));
|
||||
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance["ShaderCachePurgeError"], file.Name, e));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1227,33 +1248,60 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenTitleUpdateManager()
|
||||
public async void OpenTitleUpdateManager()
|
||||
{
|
||||
// TODO : Implement Update window
|
||||
ContentDialogHelper.ShowNotAvailableMessage(_owner);
|
||||
var selection = SelectedApplication;
|
||||
|
||||
if (selection != null)
|
||||
{
|
||||
TitleUpdateWindow titleUpdateManager =
|
||||
new(_owner.VirtualFileSystem, selection.TitleId, selection.TitleName);
|
||||
|
||||
await titleUpdateManager.ShowDialog(_owner);
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenDlcManager()
|
||||
public async void OpenDlcManager()
|
||||
{
|
||||
// TODO : Implement Dlc window
|
||||
ContentDialogHelper.ShowNotAvailableMessage(_owner);
|
||||
var selection = SelectedApplication;
|
||||
|
||||
if (selection != null)
|
||||
{
|
||||
DlcManagerWindow dlcManager = new(_owner.VirtualFileSystem, ulong.Parse(selection.TitleId, NumberStyles.HexNumber), selection.TitleName);
|
||||
|
||||
await dlcManager.ShowDialog(_owner);
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenCheatManager()
|
||||
public async void OpenCheatManager()
|
||||
{
|
||||
// TODO : Implement cheat window
|
||||
ContentDialogHelper.ShowNotAvailableMessage(_owner);
|
||||
var selection = SelectedApplication;
|
||||
|
||||
if (selection != null)
|
||||
{
|
||||
CheatWindow cheatManager = new(_owner.VirtualFileSystem, selection.TitleId, selection.TitleName);
|
||||
|
||||
await cheatManager.ShowDialog(_owner);
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenCheatManagerForCurrentApp()
|
||||
public async void OpenCheatManagerForCurrentApp()
|
||||
{
|
||||
if (!IsGameRunning)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO : Implement cheat window
|
||||
ContentDialogHelper.ShowNotAvailableMessage(_owner);
|
||||
var application = _owner.AppHost.Device.Application;
|
||||
|
||||
if (application != null)
|
||||
{
|
||||
CheatWindow cheatManager = new(_owner.VirtualFileSystem, application.TitleIdText, application.TitleName);
|
||||
|
||||
await cheatManager.ShowDialog(_owner);
|
||||
|
||||
_owner.AppHost.Device.EnableCheats();
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenDeviceSaveDirectory()
|
||||
@ -1265,10 +1313,12 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
Task.Run(() =>
|
||||
{
|
||||
if (!ulong.TryParse(selection.TitleId, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
|
||||
out ulong titleIdNumber))
|
||||
out ulong titleIdNumber))
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner,
|
||||
LocaleManager.Instance["DialogRyujinxErrorMessage"], LocaleManager.Instance["DialogInvalidTitleIdErrorMessage"]);
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogRyujinxErrorMessage"], LocaleManager.Instance["DialogInvalidTitleIdErrorMessage"]);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1288,10 +1338,12 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
Task.Run(() =>
|
||||
{
|
||||
if (!ulong.TryParse(selection.TitleId, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
|
||||
out ulong titleIdNumber))
|
||||
out ulong titleIdNumber))
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner,
|
||||
LocaleManager.Instance["DialogRyujinxErrorMessage"], LocaleManager.Instance["DialogInvalidTitleIdErrorMessage"]);
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogRyujinxErrorMessage"], LocaleManager.Instance["DialogInvalidTitleIdErrorMessage"]);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1307,30 +1359,30 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
ApplicationHelper.OpenSaveDir(in filter, titleId, data.ControlHolder, data.TitleName);
|
||||
}
|
||||
|
||||
private void ExtractLogo()
|
||||
private async void ExtractLogo()
|
||||
{
|
||||
var selection = SelectedApplication;
|
||||
if (selection != null)
|
||||
{
|
||||
ApplicationHelper.ExtractSection(NcaSectionType.Logo, selection.Path);
|
||||
await ApplicationHelper.ExtractSection(NcaSectionType.Logo, selection.Path);
|
||||
}
|
||||
}
|
||||
|
||||
private void ExtractRomFs()
|
||||
private async void ExtractRomFs()
|
||||
{
|
||||
var selection = SelectedApplication;
|
||||
if (selection != null)
|
||||
{
|
||||
ApplicationHelper.ExtractSection(NcaSectionType.Data, selection.Path);
|
||||
await ApplicationHelper.ExtractSection(NcaSectionType.Data, selection.Path);
|
||||
}
|
||||
}
|
||||
|
||||
private void ExtractExeFs()
|
||||
private async void ExtractExeFs()
|
||||
{
|
||||
var selection = SelectedApplication;
|
||||
if (selection != null)
|
||||
{
|
||||
ApplicationHelper.ExtractSection(NcaSectionType.Code, selection.Path);
|
||||
await ApplicationHelper.ExtractSection(NcaSectionType.Code, selection.Path);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1339,7 +1391,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
_owner.Close();
|
||||
}
|
||||
|
||||
private async void HandleFirmwareInstallation(string path)
|
||||
private async Task HandleFirmwareInstallation(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1349,7 +1401,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
|
||||
if (firmwareVersion == null)
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner, string.Format(LocaleManager.Instance["DialogFirmwareInstallerFirmwareNotFoundErrorMessage"], filename));
|
||||
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance["DialogFirmwareInstallerFirmwareNotFoundErrorMessage"], filename));
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1369,7 +1421,6 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
dialogMessage += LocaleManager.Instance["DialogFirmwareInstallerFirmwareInstallConfirmMessage"];
|
||||
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(
|
||||
_owner,
|
||||
dialogTitle,
|
||||
dialogMessage,
|
||||
LocaleManager.Instance["InputDialogYes"],
|
||||
@ -1399,7 +1450,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
|
||||
string message = string.Format(LocaleManager.Instance["DialogFirmwareInstallerFirmwareInstallSuccessMessage"], firmwareVersion.VersionString);
|
||||
|
||||
await ContentDialogHelper.CreateInfoDialog(_owner, dialogTitle, message, LocaleManager.Instance["InputDialogOk"], "", LocaleManager.Instance["RyujinxInfo"]);
|
||||
await ContentDialogHelper.CreateInfoDialog(dialogTitle, message, LocaleManager.Instance["InputDialogOk"], "", LocaleManager.Instance["RyujinxInfo"]);
|
||||
Logger.Info?.Print(LogClass.Application, message);
|
||||
|
||||
// Purge Applet Cache.
|
||||
@ -1414,11 +1465,11 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
waitingDialog.Close();
|
||||
|
||||
ContentDialogHelper.CreateErrorDialog(_owner, ex.Message);
|
||||
await ContentDialogHelper.CreateErrorDialog(ex.Message);
|
||||
});
|
||||
}
|
||||
finally
|
||||
@ -1439,7 +1490,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(_owner, ex.Message);
|
||||
await ContentDialogHelper.CreateErrorDialog(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1454,7 +1505,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
|
||||
if (file != null && file.Length > 0)
|
||||
{
|
||||
HandleFirmwareInstallation(file[0]);
|
||||
await HandleFirmwareInstallation(file[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1466,7 +1517,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(folder))
|
||||
{
|
||||
HandleFirmwareInstallation(folder);
|
||||
await HandleFirmwareInstallation(folder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -63,8 +63,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
||||
{
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateInfoDialog(_owner,
|
||||
LocaleManager.Instance["DialogSettingsBackendThreadingWarningMessage"],
|
||||
await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance["DialogSettingsBackendThreadingWarningMessage"],
|
||||
"",
|
||||
"",
|
||||
LocaleManager.Instance["InputDialogOk"],
|
||||
|
142
Ryujinx.Ava/Ui/ViewModels/UserProfileViewModel.cs
Normal file
142
Ryujinx.Ava/Ui/ViewModels/UserProfileViewModel.cs
Normal file
@ -0,0 +1,142 @@
|
||||
using Avalonia.Threading;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Ui.Controls;
|
||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using UserProfile = Ryujinx.Ava.Ui.Models.UserProfile;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.ViewModels
|
||||
{
|
||||
public class UserProfileViewModel : BaseModel, IDisposable
|
||||
{
|
||||
private readonly NavigationDialogHost _owner;
|
||||
|
||||
private UserProfile _selectedProfile;
|
||||
private UserProfile _highlightedProfile;
|
||||
|
||||
public UserProfileViewModel()
|
||||
{
|
||||
Profiles = new ObservableCollection<UserProfile>();
|
||||
}
|
||||
|
||||
public UserProfileViewModel(NavigationDialogHost owner) : this()
|
||||
{
|
||||
_owner = owner;
|
||||
|
||||
LoadProfiles();
|
||||
}
|
||||
|
||||
public ObservableCollection<UserProfile> Profiles { get; set; }
|
||||
|
||||
public UserProfile SelectedProfile
|
||||
{
|
||||
get => _selectedProfile;
|
||||
set
|
||||
{
|
||||
_selectedProfile = value;
|
||||
|
||||
OnPropertyChanged(nameof(SelectedProfile));
|
||||
OnPropertyChanged(nameof(IsHighlightedProfileDeletable));
|
||||
OnPropertyChanged(nameof(IsHighlightedProfileEditable));
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsHighlightedProfileEditable =>
|
||||
_highlightedProfile != null;
|
||||
|
||||
public bool IsHighlightedProfileDeletable =>
|
||||
_highlightedProfile != null && _highlightedProfile.UserId != AccountManager.DefaultUserId;
|
||||
|
||||
public UserProfile HighlightedProfile
|
||||
{
|
||||
get => _highlightedProfile;
|
||||
set
|
||||
{
|
||||
_highlightedProfile = value;
|
||||
|
||||
OnPropertyChanged(nameof(HighlightedProfile));
|
||||
OnPropertyChanged(nameof(IsHighlightedProfileDeletable));
|
||||
OnPropertyChanged(nameof(IsHighlightedProfileEditable));
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public void LoadProfiles()
|
||||
{
|
||||
Profiles.Clear();
|
||||
|
||||
var profiles = _owner.AccountManager.GetAllUsers()
|
||||
.OrderByDescending(x => x.AccountState == AccountState.Open);
|
||||
|
||||
foreach (var profile in profiles)
|
||||
{
|
||||
Profiles.Add(new UserProfile(profile));
|
||||
}
|
||||
|
||||
SelectedProfile = Profiles.FirstOrDefault(x => x.UserId == _owner.AccountManager.LastOpenedUser.UserId);
|
||||
|
||||
if (SelectedProfile == null)
|
||||
{
|
||||
SelectedProfile = Profiles.First();
|
||||
|
||||
if (SelectedProfile != null)
|
||||
{
|
||||
_owner.AccountManager.OpenUser(_selectedProfile.UserId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AddUser()
|
||||
{
|
||||
UserProfile userProfile = null;
|
||||
_owner.Navigate(typeof(UserEditor), (this._owner, userProfile, true));
|
||||
}
|
||||
|
||||
public void EditUser()
|
||||
{
|
||||
_owner.Navigate(typeof(UserEditor), (this._owner, _highlightedProfile ?? SelectedProfile, false));
|
||||
}
|
||||
|
||||
public async void DeleteUser()
|
||||
{
|
||||
if (_highlightedProfile != null)
|
||||
{
|
||||
var lastUserId = _owner.AccountManager.LastOpenedUser.UserId;
|
||||
|
||||
if (_highlightedProfile.UserId == lastUserId)
|
||||
{
|
||||
// If we are deleting the currently open profile, then we must open something else before deleting.
|
||||
var profile = Profiles.FirstOrDefault(x => x.UserId != lastUserId);
|
||||
|
||||
if (profile == null)
|
||||
{
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogUserProfileDeletionWarningMessage"]);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_owner.AccountManager.OpenUser(profile.UserId);
|
||||
}
|
||||
|
||||
var result =
|
||||
await ContentDialogHelper.CreateConfirmationDialog(LocaleManager.Instance["DialogUserProfileDeletionConfirmMessage"], "",
|
||||
LocaleManager.Instance["InputDialogYes"], LocaleManager.Instance["InputDialogNo"], "");
|
||||
|
||||
if (result == UserResult.Yes)
|
||||
{
|
||||
_owner.AccountManager.DeleteUser(_highlightedProfile.UserId);
|
||||
}
|
||||
}
|
||||
|
||||
LoadProfiles();
|
||||
}
|
||||
}
|
||||
}
|
@ -17,43 +17,43 @@
|
||||
SizeToContent="Width"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
mc:Ignorable="d">
|
||||
<Grid
|
||||
<Grid
|
||||
Margin="15"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="20"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="3"
|
||||
Grid.Column="0"
|
||||
@ -61,21 +61,21 @@
|
||||
MinWidth="50"
|
||||
Margin="5,10,20,10"
|
||||
Source="resm:Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png?assembly=Ryujinx.Ui.Common" />
|
||||
<TextBlock
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Margin="0,20,0,0"
|
||||
FontSize="35"
|
||||
Text="Ryujinx"
|
||||
TextAlignment="Center" />
|
||||
<TextBlock
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Margin="0,0,0,0"
|
||||
FontSize="16"
|
||||
Text="(REE-YOU-JINX)"
|
||||
TextAlignment="Center" />
|
||||
<Button
|
||||
<Button
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="0"
|
||||
@ -83,27 +83,27 @@
|
||||
Background="Transparent"
|
||||
Click="Button_OnClick"
|
||||
Tag="https://www.ryujinx.org/">
|
||||
<TextBlock
|
||||
<TextBlock
|
||||
Text="www.ryujinx.org"
|
||||
TextAlignment="Center"
|
||||
TextDecorations="Underline"
|
||||
ToolTip.Tip="{locale:Locale AboutUrlTooltipMessage}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
</Button>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Version}"
|
||||
TextAlignment="Center" />
|
||||
<TextBlock
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
Margin="20"
|
||||
HorizontalAlignment="Center"
|
||||
MaxLines="2"
|
||||
Text="{locale:Locale AboutDisclaimerMessage}"
|
||||
TextAlignment="Center" />
|
||||
<TextBlock
|
||||
<TextBlock
|
||||
Name="AmiiboLabel"
|
||||
Grid.Row="3"
|
||||
Margin="20"
|
||||
@ -112,94 +112,94 @@
|
||||
PointerPressed="AmiiboLabel_OnPointerPressed"
|
||||
Text="{locale:Locale AboutAmiiboDisclaimerMessage}"
|
||||
TextAlignment="Center" />
|
||||
<StackPanel
|
||||
<StackPanel
|
||||
Grid.Row="4"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Spacing="10">
|
||||
<StackPanel Orientation="Vertical" ToolTip.Tip="{locale:Locale AboutPatreonUrlTooltipMessage}">
|
||||
<Button
|
||||
<StackPanel Orientation="Vertical" ToolTip.Tip="{locale:Locale AboutPatreonUrlTooltipMessage}">
|
||||
<Button
|
||||
Height="65"
|
||||
Background="Transparent"
|
||||
Click="Button_OnClick"
|
||||
Tag="https://www.patreon.com/ryujinx">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="resm:Ryujinx.Ui.Common.Resources.Logo_Patreon.png?assembly=Ryujinx.Ui.Common" />
|
||||
<TextBlock
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="resm:Ryujinx.Ui.Common.Resources.Logo_Patreon.png?assembly=Ryujinx.Ui.Common" />
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="0,5,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Text="Patreon" />
|
||||
</Grid>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical" ToolTip.Tip="{locale:Locale AboutGithubUrlTooltipMessage}">
|
||||
<Button
|
||||
</Grid>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical" ToolTip.Tip="{locale:Locale AboutGithubUrlTooltipMessage}">
|
||||
<Button
|
||||
Height="65"
|
||||
Background="Transparent"
|
||||
Click="Button_OnClick"
|
||||
Tag="https://github.com/Ryujinx/Ryujinx">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="resm:Ryujinx.Ui.Common.Resources.Logo_GitHub.png?assembly=Ryujinx.Ui.Common" />
|
||||
<TextBlock
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="resm:Ryujinx.Ui.Common.Resources.Logo_GitHub.png?assembly=Ryujinx.Ui.Common" />
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="0,5,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Text="GitHub" />
|
||||
</Grid>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical" ToolTip.Tip="{locale:Locale AboutDiscordUrlTooltipMessage}">
|
||||
<Button
|
||||
</Grid>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical" ToolTip.Tip="{locale:Locale AboutDiscordUrlTooltipMessage}">
|
||||
<Button
|
||||
Height="65"
|
||||
Background="Transparent"
|
||||
Click="Button_OnClick"
|
||||
Tag="https://discordapp.com/invite/N2FmfVc">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="resm:Ryujinx.Ui.Common.Resources.Logo_Discord.png?assembly=Ryujinx.Ui.Common" />
|
||||
<TextBlock
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="resm:Ryujinx.Ui.Common.Resources.Logo_Discord.png?assembly=Ryujinx.Ui.Common" />
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="0,5,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Text="Discord" />
|
||||
</Grid>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical" ToolTip.Tip="{locale:Locale AboutTwitterUrlTooltipMessage}">
|
||||
<Button
|
||||
</Grid>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical" ToolTip.Tip="{locale:Locale AboutTwitterUrlTooltipMessage}">
|
||||
<Button
|
||||
Height="65"
|
||||
Background="Transparent"
|
||||
Click="Button_OnClick"
|
||||
Tag="https://twitter.com/RyujinxEmu">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="resm:Ryujinx.Ui.Common.Resources.Logo_Twitter.png?assembly=Ryujinx.Ui.Common" />
|
||||
<TextBlock
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="resm:Ryujinx.Ui.Common.Resources.Logo_Twitter.png?assembly=Ryujinx.Ui.Common" />
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="0,5,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Text="Twitter" />
|
||||
</Grid>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Border
|
||||
</Grid>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="2"
|
||||
@ -207,62 +207,62 @@
|
||||
VerticalAlignment="Stretch"
|
||||
BorderBrush="White"
|
||||
BorderThickness="1,0,0,0">
|
||||
<Separator Width="0" />
|
||||
</Border>
|
||||
<Grid
|
||||
<Separator Width="0" />
|
||||
</Border>
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Margin="20"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock
|
||||
FontWeight="Bold"
|
||||
Text="{locale:Locale AboutRyujinxAboutTitle}"
|
||||
TextDecorations="Underline" />
|
||||
<TextBlock
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="20,5,5,5"
|
||||
LineHeight="20"
|
||||
Text="{locale:Locale AboutRyujinxAboutContent}" />
|
||||
<TextBlock
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
Margin="0,10,0,0"
|
||||
FontWeight="Bold"
|
||||
Text="{locale:Locale AboutRyujinxMaintainersTitle}"
|
||||
TextDecorations="Underline" />
|
||||
<TextBlock
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Margin="20,5,5,5"
|
||||
LineHeight="20"
|
||||
Text="{Binding Developers}" />
|
||||
<Button
|
||||
<Button
|
||||
Grid.Row="4"
|
||||
HorizontalAlignment="Right"
|
||||
Background="Transparent"
|
||||
Click="Button_OnClick"
|
||||
Tag="https://github.com/Ryujinx/Ryujinx/graphs/contributors?type=a">
|
||||
<TextBlock
|
||||
<TextBlock
|
||||
Text="{locale:Locale AboutRyujinxContributorsButtonHeader}"
|
||||
TextAlignment="Right"
|
||||
TextDecorations="Underline"
|
||||
ToolTip.Tip="{locale:Locale AboutRyujinxMaintainersContentTooltipMessage}" />
|
||||
</Button>
|
||||
<TextBlock
|
||||
</Button>
|
||||
<TextBlock
|
||||
Grid.Row="5"
|
||||
Margin="0,0,0,0"
|
||||
FontWeight="Bold"
|
||||
Text="{locale:Locale AboutRyujinxSupprtersTitle}"
|
||||
TextDecorations="Underline" />
|
||||
<Border
|
||||
<Border
|
||||
Grid.Row="6"
|
||||
Width="460"
|
||||
Height="200"
|
||||
@ -271,12 +271,12 @@
|
||||
VerticalAlignment="Stretch"
|
||||
BorderBrush="White"
|
||||
BorderThickness="1">
|
||||
<TextBlock
|
||||
<TextBlock
|
||||
Name="SupportersTextBlock"
|
||||
VerticalAlignment="Top"
|
||||
Text="{Binding Supporters}"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</window:StyleableWindow>
|
||||
|
@ -13,7 +13,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public class AboutWindow : StyleableWindow
|
||||
public partial class AboutWindow : StyleableWindow
|
||||
{
|
||||
public AboutWindow()
|
||||
{
|
||||
@ -39,15 +39,6 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
|
||||
public string Developers => string.Format(LocaleManager.Instance["AboutPageDeveloperListMore"], "gdkchan, Ac_K, Thog, rip in peri peri, LDj3SNuD, emmaus, Thealexbarney, Xpl0itR, GoffyDude, »jD«");
|
||||
|
||||
public TextBlock SupportersTextBlock { get; set; }
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
|
||||
SupportersTextBlock = this.FindControl<TextBlock>("SupportersTextBlock");
|
||||
}
|
||||
|
||||
private void Button_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button)
|
||||
|
68
Ryujinx.Ava/Ui/Windows/AmiiboWindow.axaml
Normal file
68
Ryujinx.Ava/Ui/Windows/AmiiboWindow.axaml
Normal file
@ -0,0 +1,68 @@
|
||||
<window:StyleableWindow 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"
|
||||
mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="350"
|
||||
x:Class="Ryujinx.Ava.Ui.Windows.AmiiboWindow"
|
||||
xmlns:window="clr-namespace:Ryujinx.Ava.Ui.Windows"
|
||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.Ui.ViewModels"
|
||||
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||
CanResize="False"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Width="800" MinHeight="650" Height="650"
|
||||
SizeToContent="Manual"
|
||||
MinWidth="600">
|
||||
<Design.DataContext>
|
||||
<viewModels:AmiiboWindowViewModel />
|
||||
</Design.DataContext>
|
||||
<Grid Margin="15" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1" HorizontalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Spacing="10" Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock VerticalAlignment="Center" Text="{locale:Locale AmiiboSeriesLabel}" />
|
||||
<ComboBox SelectedIndex="{Binding SeriesSelectedIndex}" Items="{Binding AmiiboSeries}" MinWidth="100" />
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="10" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<TextBlock VerticalAlignment="Center" Text="{locale:Locale AmiiboCharacterLabel}" />
|
||||
<ComboBox SelectedIndex="{Binding AmiiboSelectedIndex}" MinWidth="100" Items="{Binding AmiiboList}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<StackPanel Margin="20" Grid.Row="2">
|
||||
<Image Source="{Binding AmiiboImage}" Height="350" Width="350" HorizontalAlignment="Center" />
|
||||
<ScrollViewer MaxHeight="120" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"
|
||||
Margin="20" VerticalAlignment="Top" HorizontalAlignment="Stretch">
|
||||
<TextBlock TextWrapping="Wrap" Text="{Binding Usage}" HorizontalAlignment="Center"
|
||||
TextAlignment="Center" />
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
<Grid Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Margin="10" Grid.Column="0" VerticalContentAlignment="Center" IsChecked="{Binding ShowAllAmiibo}"
|
||||
Content="{locale:Locale AmiiboOptionsShowAllLabel}" />
|
||||
<CheckBox Margin="10" VerticalContentAlignment="Center" Grid.Column="1" IsChecked="{Binding UseRandomUuid}"
|
||||
Content="{locale:Locale AmiiboOptionsUsRandomTagLabel}" />
|
||||
|
||||
<Button Grid.Column="3" IsEnabled="{Binding EnableScanning}" Width="80"
|
||||
Content="{locale:Locale AmiiboScanButtonLabel}" Name="ScanButton"
|
||||
Click="ScanButton_Click" />
|
||||
<Button Grid.Column="4" Margin="10,0" Width="80" Content="{locale:Locale InputDialogCancel}"
|
||||
Name="CancelButton"
|
||||
Click="CancelButton_Click" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</window:StyleableWindow>
|
65
Ryujinx.Ava/Ui/Windows/AmiiboWindow.axaml.cs
Normal file
65
Ryujinx.Ava/Ui/Windows/AmiiboWindow.axaml.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Ui.Models;
|
||||
using Ryujinx.Ava.Ui.ViewModels;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public partial class AmiiboWindow : StyleableWindow
|
||||
{
|
||||
public AmiiboWindow(bool showAll, string lastScannedAmiiboId, string titleId)
|
||||
{
|
||||
ViewModel = new AmiiboWindowViewModel(this, lastScannedAmiiboId, titleId);
|
||||
|
||||
ViewModel.ShowAllAmiibo = showAll;
|
||||
|
||||
DataContext = ViewModel;
|
||||
|
||||
InitializeComponent();
|
||||
#if DEBUG
|
||||
this.AttachDevTools();
|
||||
#endif
|
||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["Amiibo"];
|
||||
}
|
||||
|
||||
public AmiiboWindow()
|
||||
{
|
||||
ViewModel = new AmiiboWindowViewModel(this, string.Empty, string.Empty);
|
||||
|
||||
DataContext = ViewModel;
|
||||
|
||||
InitializeComponent();
|
||||
#if DEBUG
|
||||
this.AttachDevTools();
|
||||
#endif
|
||||
if (Program.PreviewerDetached)
|
||||
{
|
||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["Amiibo"];
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsScanned { get; set; }
|
||||
public Amiibo.AmiiboApi ScannedAmiibo { get; set; }
|
||||
public AmiiboWindowViewModel ViewModel { get; set; }
|
||||
|
||||
private void ScanButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (ViewModel.AmiiboSelectedIndex > -1)
|
||||
{
|
||||
Amiibo.AmiiboApi amiibo = ViewModel.AmiiboList[ViewModel.AmiiboSelectedIndex];
|
||||
ScannedAmiibo = amiibo;
|
||||
IsScanned = true;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
IsScanned = false;
|
||||
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
52
Ryujinx.Ava/Ui/Windows/AvatarWindow.axaml
Normal file
52
Ryujinx.Ava/Ui/Windows/AvatarWindow.axaml
Normal file
@ -0,0 +1,52 @@
|
||||
<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:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="350"
|
||||
x:Class="Ryujinx.Ava.Ui.Windows.AvatarWindow"
|
||||
Margin="0"
|
||||
Padding="0"
|
||||
xmlns:Locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.Ui.ViewModels"
|
||||
xmlns:controls="clr-namespace:Ryujinx.Ava.Ui.Controls"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="viewModels:AvatarProfileViewModel">
|
||||
<Design.DataContext>
|
||||
<viewModels:AvatarProfileViewModel />
|
||||
</Design.DataContext>
|
||||
<UserControl.Resources>
|
||||
<controls:BitmapArrayValueConverter x:Key="ByteImage" />
|
||||
</UserControl.Resources>
|
||||
<Grid Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox Grid.Row="1" BorderThickness="0" SelectedIndex="{Binding SelectedIndex}" Height="400"
|
||||
Items="{Binding Images}" HorizontalAlignment="Stretch" VerticalAlignment="Center">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal" MaxWidth="700" Margin="0" HorizontalAlignment="Center" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Image Margin="5" Height="96" Width="96"
|
||||
Source="{Binding Data, Converter={StaticResource ByteImage}}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<ProgressBar Grid.Row="2" IsIndeterminate="{Binding IsIndeterminate}" Value="{Binding ImagesLoaded}" HorizontalAlignment="Stretch" Margin="5"
|
||||
Maximum="{Binding ImageCount}" Minimum="0" />
|
||||
<StackPanel Grid.Row="3" Orientation="Horizontal" Spacing="10" Margin="10" HorizontalAlignment="Center">
|
||||
<Button Content="{Locale:Locale AvatarChoose}" Width="200" Name="ChooseButton" Click="ChooseButton_OnClick" />
|
||||
<ui:ColorPickerButton Color="{Binding BackgroundColor, Mode=TwoWay}" Name="ColorButton" />
|
||||
<Button HorizontalAlignment="Right" Content="{Locale:Locale Discard}" Click="CloseButton_OnClick"
|
||||
Name="CloseButton"
|
||||
Width="200" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
77
Ryujinx.Ava/Ui/Windows/AvatarWindow.axaml.cs
Normal file
77
Ryujinx.Ava/Ui/Windows/AvatarWindow.axaml.cs
Normal file
@ -0,0 +1,77 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using FluentAvalonia.UI.Navigation;
|
||||
using Ryujinx.Ava.Ui.Controls;
|
||||
using Ryujinx.Ava.Ui.Models;
|
||||
using Ryujinx.Ava.Ui.ViewModels;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public partial class AvatarWindow : UserControl
|
||||
{
|
||||
private NavigationDialogHost _parent;
|
||||
private TempProfile _profile;
|
||||
|
||||
public AvatarWindow(ContentManager contentManager)
|
||||
{
|
||||
ContentManager = contentManager;
|
||||
|
||||
DataContext = ViewModel;
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public AvatarWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
AddHandler(Frame.NavigatedToEvent, (s, e) =>
|
||||
{
|
||||
NavigatedTo(e);
|
||||
}, RoutingStrategies.Direct);
|
||||
}
|
||||
|
||||
private void NavigatedTo(NavigationEventArgs arg)
|
||||
{
|
||||
if (Program.PreviewerDetached)
|
||||
{
|
||||
if (arg.NavigationMode == NavigationMode.New)
|
||||
{
|
||||
(_parent, _profile) = ((NavigationDialogHost, TempProfile))arg.Parameter;
|
||||
ContentManager = _parent.ContentManager;
|
||||
if (Program.PreviewerDetached)
|
||||
{
|
||||
ViewModel = new AvatarProfileViewModel(() => ViewModel.ReloadImages());
|
||||
}
|
||||
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ContentManager ContentManager { get; private set; }
|
||||
|
||||
internal AvatarProfileViewModel ViewModel { get; set; }
|
||||
|
||||
private void CloseButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.Dispose();
|
||||
|
||||
_parent.GoBack();
|
||||
}
|
||||
|
||||
private void ChooseButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (ViewModel.SelectedIndex > -1)
|
||||
{
|
||||
_profile.Image = ViewModel.SelectedImage;
|
||||
|
||||
ViewModel.Dispose();
|
||||
|
||||
_parent.GoBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
96
Ryujinx.Ava/Ui/Windows/CheatWindow.axaml
Normal file
96
Ryujinx.Ava/Ui/Windows/CheatWindow.axaml
Normal file
@ -0,0 +1,96 @@
|
||||
<window:StyleableWindow x:Class="Ryujinx.Ava.Ui.Windows.CheatWindow"
|
||||
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:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||
xmlns:model="clr-namespace:Ryujinx.Ava.Ui.Models"
|
||||
xmlns:window="clr-namespace:Ryujinx.Ava.Ui.Windows"
|
||||
mc:Ignorable="d"
|
||||
Width="500" MinHeight="500" Height="500"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
MinWidth="500">
|
||||
<Window.Styles>
|
||||
<Style Selector="TreeViewItem">
|
||||
<Setter Property="IsExpanded" Value="True" />
|
||||
</Style>
|
||||
</Window.Styles>
|
||||
<Grid Name="DlcGrid" Margin="15">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="20,15,20,20"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
MaxWidth="500"
|
||||
LineHeight="18"
|
||||
TextWrapping="Wrap"
|
||||
Text="{Binding Heading}"
|
||||
TextAlignment="Center" />
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Margin="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1">
|
||||
<TreeView Items="{Binding LoadedCheats}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Name="CheatsView"
|
||||
MinHeight="300">
|
||||
<TreeView.Styles>
|
||||
<Styles>
|
||||
<Style Selector="TreeViewItem:empty /template/ ItemsPresenter">
|
||||
<Setter Property="IsVisible" Value="False"/>
|
||||
</Style>
|
||||
</Styles>
|
||||
</TreeView.Styles>
|
||||
<TreeView.DataTemplates>
|
||||
<TreeDataTemplate DataType="model:CheatsList" ItemsSource="{Binding}">
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<CheckBox IsChecked="{Binding IsEnabled}" MinWidth="20" />
|
||||
<TextBlock Width="150"
|
||||
Text="{Binding BuildId}" />
|
||||
<TextBlock
|
||||
Text="{Binding Path}" />
|
||||
</StackPanel>
|
||||
</TreeDataTemplate>
|
||||
<DataTemplate x:DataType="model:CheatModel">
|
||||
<StackPanel Orientation="Horizontal" Margin="0" HorizontalAlignment="Left">
|
||||
<CheckBox IsChecked="{Binding IsEnabled}" Padding="0" Margin="5,0" MinWidth="20" />
|
||||
<TextBlock Text="{Binding CleanName}" VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</TreeView.DataTemplates>
|
||||
</TreeView>
|
||||
</Border>
|
||||
<DockPanel
|
||||
Grid.Row="3"
|
||||
Margin="0"
|
||||
HorizontalAlignment="Stretch">
|
||||
<DockPanel Margin="0" HorizontalAlignment="Right">
|
||||
<Button
|
||||
Name="SaveButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
IsVisible="{Binding !NoCheatsFound}"
|
||||
Command="{Binding Save}">
|
||||
<TextBlock Text="{locale:Locale SettingsButtonSave}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="CancelButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding Close}">
|
||||
<TextBlock Text="{locale:Locale InputDialogCancel}" />
|
||||
</Button>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</window:StyleableWindow>
|
132
Ryujinx.Ava/Ui/Windows/CheatWindow.axaml.cs
Normal file
132
Ryujinx.Ava/Ui/Windows/CheatWindow.axaml.cs
Normal file
@ -0,0 +1,132 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Collections;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Ui.Models;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.HOS;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public partial class CheatWindow : StyleableWindow
|
||||
{
|
||||
private readonly string _enabledCheatsPath;
|
||||
public bool NoCheatsFound { get; }
|
||||
|
||||
private AvaloniaList<CheatsList> LoadedCheats { get; }
|
||||
|
||||
public string Heading { get; }
|
||||
|
||||
public CheatWindow()
|
||||
{
|
||||
DataContext = this;
|
||||
|
||||
InitializeComponent();
|
||||
AttachDebugDevTools();
|
||||
|
||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["CheatWindowTitle"];
|
||||
}
|
||||
|
||||
public CheatWindow(VirtualFileSystem virtualFileSystem, string titleId, string titleName)
|
||||
{
|
||||
LoadedCheats = new AvaloniaList<CheatsList>();
|
||||
|
||||
Heading = string.Format(LocaleManager.Instance["CheatWindowHeading"], titleName, titleId.ToUpper());
|
||||
|
||||
InitializeComponent();
|
||||
#if DEBUG
|
||||
this.AttachDevTools();
|
||||
#endif
|
||||
|
||||
string modsBasePath = virtualFileSystem.ModLoader.GetModsBasePath();
|
||||
string titleModsPath = virtualFileSystem.ModLoader.GetTitleDir(modsBasePath, titleId);
|
||||
ulong titleIdValue = ulong.Parse(titleId, System.Globalization.NumberStyles.HexNumber);
|
||||
|
||||
_enabledCheatsPath = Path.Combine(titleModsPath, "cheats", "enabled.txt");
|
||||
|
||||
string[] enabled = { };
|
||||
|
||||
if (File.Exists(_enabledCheatsPath))
|
||||
{
|
||||
enabled = File.ReadAllLines(_enabledCheatsPath);
|
||||
}
|
||||
|
||||
int cheatAdded = 0;
|
||||
|
||||
var mods = new ModLoader.ModCache();
|
||||
|
||||
ModLoader.QueryContentsDir(mods, new DirectoryInfo(Path.Combine(modsBasePath, "contents")), titleIdValue);
|
||||
|
||||
string currentCheatFile = string.Empty;
|
||||
string buildId = string.Empty;
|
||||
string parentPath = string.Empty;
|
||||
|
||||
CheatsList currentGroup = null;
|
||||
|
||||
foreach (var cheat in mods.Cheats)
|
||||
{
|
||||
if (cheat.Path.FullName != currentCheatFile)
|
||||
{
|
||||
currentCheatFile = cheat.Path.FullName;
|
||||
parentPath = currentCheatFile.Replace(titleModsPath, "");
|
||||
|
||||
buildId = Path.GetFileNameWithoutExtension(currentCheatFile).ToUpper();
|
||||
currentGroup = new CheatsList(buildId, parentPath);
|
||||
|
||||
LoadedCheats.Add(currentGroup);
|
||||
}
|
||||
|
||||
var model = new CheatModel(cheat.Name, buildId, enabled.Contains($"{buildId}-{cheat.Name}"));
|
||||
currentGroup?.Add(model);
|
||||
|
||||
cheatAdded++;
|
||||
}
|
||||
|
||||
if (cheatAdded == 0)
|
||||
{
|
||||
NoCheatsFound = true;
|
||||
}
|
||||
|
||||
DataContext = this;
|
||||
|
||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["CheatWindowTitle"];
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
private void AttachDebugDevTools()
|
||||
{
|
||||
this.AttachDevTools();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
if (NoCheatsFound)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<string> enabledCheats = new List<string>();
|
||||
|
||||
foreach (var cheats in LoadedCheats)
|
||||
{
|
||||
foreach (var cheat in cheats)
|
||||
{
|
||||
if (cheat.IsEnabled)
|
||||
{
|
||||
enabledCheats.Add(cheat.BuildIdKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(_enabledCheatsPath));
|
||||
|
||||
File.WriteAllLines(_enabledCheatsPath, enabledCheats);
|
||||
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
@ -8,6 +8,7 @@ using Avalonia.Threading;
|
||||
using Avalonia.VisualTree;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Ui.Controls;
|
||||
using Ryujinx.Ava.Ui.Models;
|
||||
using Ryujinx.Ava.Ui.ViewModels;
|
||||
using Ryujinx.Common.Configuration.Hid;
|
||||
using Ryujinx.Common.Configuration.Hid.Controller;
|
||||
@ -23,11 +24,10 @@ using Key = Ryujinx.Input.Key;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public class ControllerSettingsWindow : UserControl
|
||||
public partial class ControllerSettingsWindow : UserControl
|
||||
{
|
||||
private bool _dialogOpen;
|
||||
|
||||
public Grid SettingButtons { get; set; }
|
||||
private ButtonKeyAssigner _currentAssigner;
|
||||
internal ControllerSettingsViewModel ViewModel { get; set; }
|
||||
|
||||
@ -47,13 +47,6 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
|
||||
SettingButtons = this.FindControl<Grid>("SettingButtons");
|
||||
}
|
||||
|
||||
protected override void OnPointerReleased(PointerReleasedEventArgs e)
|
||||
{
|
||||
base.OnPointerReleased(e);
|
||||
@ -127,9 +120,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
}
|
||||
else if (device.Type == Models.DeviceType.Controller)
|
||||
{
|
||||
InputConfig config = ConfigurationState.Instance.Hid.InputConfig.Value.Find(inputConfig => inputConfig.Id == ViewModel.SelectedGamepad.Id);
|
||||
|
||||
assigner = new GamepadButtonAssigner(ViewModel.SelectedGamepad, (config as StandardControllerInputConfig).TriggerThreshold, forStick);
|
||||
assigner = new GamepadButtonAssigner(ViewModel.SelectedGamepad, (ViewModel.Config as StandardControllerInputConfig).TriggerThreshold, forStick);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -166,7 +157,6 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
_dialogOpen = true;
|
||||
|
||||
var result = await ContentDialogHelper.CreateConfirmationDialog(
|
||||
this.GetVisualRoot() as StyleableWindow,
|
||||
LocaleManager.Instance["DialogControllerSettingsModifiedConfirmMessage"],
|
||||
LocaleManager.Instance["DialogControllerSettingsModifiedConfirmSubMessage"],
|
||||
LocaleManager.Instance["InputDialogYes"],
|
||||
@ -184,8 +174,8 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
|
||||
if (e.AddedItems.Count > 0)
|
||||
{
|
||||
(PlayerIndex key, _) = (KeyValuePair<PlayerIndex, string>)e.AddedItems[0];
|
||||
ViewModel.PlayerId = key;
|
||||
var player = (PlayerModel)e.AddedItems[0];
|
||||
ViewModel.PlayerId = player.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
132
Ryujinx.Ava/Ui/Windows/DlcManagerWindow.axaml
Normal file
132
Ryujinx.Ava/Ui/Windows/DlcManagerWindow.axaml
Normal file
@ -0,0 +1,132 @@
|
||||
<window:StyleableWindow
|
||||
x:Class="Ryujinx.Ava.Ui.Windows.DlcManagerWindow"
|
||||
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:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||
xmlns:window="clr-namespace:Ryujinx.Ava.Ui.Windows"
|
||||
SizeToContent="Height"
|
||||
Width="600" MinHeight="500" Height="500"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
MinWidth="600"
|
||||
mc:Ignorable="d">
|
||||
<Grid Name="DlcGrid" Margin="15">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="20,15,20,20"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
MaxWidth="500"
|
||||
LineHeight="18"
|
||||
TextWrapping="Wrap"
|
||||
Text="{Binding Heading}"
|
||||
TextAlignment="Center" />
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Margin="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1">
|
||||
<DataGrid
|
||||
MinHeight="200"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
Items="{Binding Dlcs}"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="90">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox
|
||||
Width="50"
|
||||
MinWidth="40"
|
||||
HorizontalAlignment="Right"
|
||||
IsChecked="{Binding IsEnabled}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.Header>
|
||||
<TextBlock Text="{locale:Locale DlcManagerTableHeadingEnabledLabel}" />
|
||||
</DataGridTemplateColumn.Header>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn
|
||||
Width="190"
|
||||
Binding="{Binding TitleId}"
|
||||
CanUserResize="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{locale:Locale DlcManagerTableHeadingTitleIdLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding ContainerPath}"
|
||||
CanUserResize="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{locale:Locale DlcManagerTableHeadingContainerPathLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding FullPath}"
|
||||
CanUserResize="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{locale:Locale DlcManagerTableHeadingFullPathLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Border>
|
||||
<DockPanel
|
||||
Grid.Row="3"
|
||||
Margin="0"
|
||||
HorizontalAlignment="Stretch">
|
||||
<DockPanel Margin="0" HorizontalAlignment="Left">
|
||||
<Button
|
||||
Name="AddButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding Add}">
|
||||
<TextBlock Text="{locale:Locale SettingsTabGeneralAdd}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="RemoveButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding RemoveSelected}">
|
||||
<TextBlock Text="{locale:Locale SettingsTabGeneralRemove}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="RemoveAllButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding RemoveAll}">
|
||||
<TextBlock Text="{locale:Locale DlcManagerRemoveAllButton}" />
|
||||
</Button>
|
||||
</DockPanel>
|
||||
<DockPanel Margin="0" HorizontalAlignment="Right">
|
||||
<Button
|
||||
Name="SaveButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding Save}">
|
||||
<TextBlock Text="{locale:Locale SettingsButtonSave}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="CancelButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding Close}">
|
||||
<TextBlock Text="{locale:Locale InputDialogCancel}" />
|
||||
</Button>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</window:StyleableWindow>
|
254
Ryujinx.Ava/Ui/Windows/DlcManagerWindow.axaml.cs
Normal file
254
Ryujinx.Ava/Ui/Windows/DlcManagerWindow.axaml.cs
Normal file
@ -0,0 +1,254 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Collections;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Threading;
|
||||
using LibHac.Common;
|
||||
using LibHac.Fs;
|
||||
using LibHac.Fs.Fsa;
|
||||
using LibHac.FsSystem;
|
||||
using LibHac.Tools.Fs;
|
||||
using LibHac.Tools.FsSystem;
|
||||
using LibHac.Tools.FsSystem.NcaUtils;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Ui.Controls;
|
||||
using Ryujinx.Ava.Ui.Models;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Utilities;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Path = System.IO.Path;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public partial class DlcManagerWindow : StyleableWindow
|
||||
{
|
||||
private readonly List<DlcContainer> _dlcContainerList;
|
||||
private readonly string _dlcJsonPath;
|
||||
|
||||
public VirtualFileSystem VirtualFileSystem { get; }
|
||||
|
||||
public AvaloniaList<DlcModel> Dlcs { get; set; }
|
||||
public ulong TitleId { get; }
|
||||
public string TitleName { get; }
|
||||
|
||||
public string Heading => string.Format(LocaleManager.Instance["DlcWindowHeading"], TitleName, TitleId.ToString("X16"));
|
||||
|
||||
public DlcManagerWindow()
|
||||
{
|
||||
DataContext = this;
|
||||
|
||||
InitializeComponent();
|
||||
AttachDebugDevTools();
|
||||
|
||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["DlcWindowTitle"];
|
||||
}
|
||||
|
||||
public DlcManagerWindow(VirtualFileSystem virtualFileSystem, ulong titleId, string titleName)
|
||||
{
|
||||
VirtualFileSystem = virtualFileSystem;
|
||||
TitleId = titleId;
|
||||
TitleName = titleName;
|
||||
|
||||
_dlcJsonPath = Path.Combine(AppDataManager.GamesDirPath, titleId.ToString("x16"), "dlc.json");
|
||||
|
||||
try
|
||||
{
|
||||
_dlcContainerList = JsonHelper.DeserializeFromFile<List<DlcContainer>>(_dlcJsonPath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
_dlcContainerList = new List<DlcContainer>();
|
||||
}
|
||||
|
||||
DataContext = this;
|
||||
|
||||
InitializeComponent();
|
||||
AttachDebugDevTools();
|
||||
|
||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["DlcWindowTitle"];
|
||||
|
||||
LoadDlcs();
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
private void AttachDebugDevTools()
|
||||
{
|
||||
this.AttachDevTools();
|
||||
}
|
||||
|
||||
private void LoadDlcs()
|
||||
{
|
||||
foreach (DlcContainer dlcContainer in _dlcContainerList)
|
||||
{
|
||||
using FileStream containerFile = File.OpenRead(dlcContainer.Path);
|
||||
|
||||
PartitionFileSystem pfs = new PartitionFileSystem(containerFile.AsStorage());
|
||||
|
||||
VirtualFileSystem.ImportTickets(pfs);
|
||||
|
||||
foreach (DlcNca dlcNca in dlcContainer.DlcNcaList)
|
||||
{
|
||||
using var ncaFile = new UniqueRef<IFile>();
|
||||
pfs.OpenFile(ref ncaFile.Ref(), dlcNca.Path.ToU8Span(), OpenMode.Read).ThrowIfFailure();
|
||||
|
||||
Nca nca = TryCreateNca(ncaFile.Get.AsStorage(), dlcContainer.Path);
|
||||
|
||||
if (nca != null)
|
||||
{
|
||||
Dlcs.Add(new DlcModel(nca.Header.TitleId.ToString("X16"), dlcContainer.Path, dlcNca.Path,
|
||||
dlcNca.Enabled));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Nca TryCreateNca(IStorage ncaStorage, string containerPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new Nca(VirtualFileSystem.KeySet, ncaStorage);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance[
|
||||
"DialogDlcLoadNcaErrorMessage"], ex.Message, containerPath));
|
||||
});
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private async Task AddDlc(string path)
|
||||
{
|
||||
if (!File.Exists(path) || Dlcs.FirstOrDefault(x => x.ContainerPath == path) != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
using (FileStream containerFile = File.OpenRead(path))
|
||||
{
|
||||
PartitionFileSystem pfs = new PartitionFileSystem(containerFile.AsStorage());
|
||||
bool containsDlc = false;
|
||||
|
||||
VirtualFileSystem.ImportTickets(pfs);
|
||||
|
||||
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 = TryCreateNca(ncaFile.Get.AsStorage(), path);
|
||||
|
||||
if (nca == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (nca.Header.ContentType == NcaContentType.PublicData)
|
||||
{
|
||||
if ((nca.Header.TitleId & 0xFFFFFFFFFFFFE000) != TitleId)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Dlcs.Add(new DlcModel(nca.Header.TitleId.ToString("X16"), path, fileEntry.FullPath, true));
|
||||
|
||||
containsDlc = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!containsDlc)
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogDlcNoDlcErrorMessage"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveDlcs(bool removeSelectedOnly = false)
|
||||
{
|
||||
if (removeSelectedOnly)
|
||||
{
|
||||
Dlcs.RemoveAll(Dlcs.Where(x => x.IsEnabled).ToList());
|
||||
}
|
||||
else
|
||||
{
|
||||
Dlcs.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveSelected()
|
||||
{
|
||||
RemoveDlcs(true);
|
||||
}
|
||||
|
||||
public void RemoveAll()
|
||||
{
|
||||
RemoveDlcs();
|
||||
}
|
||||
|
||||
public async void Add()
|
||||
{
|
||||
OpenFileDialog dialog = new OpenFileDialog() { Title = LocaleManager.Instance["SelectDlcDialogTitle"], AllowMultiple = true };
|
||||
|
||||
dialog.Filters.Add(new FileDialogFilter { Name = "NSP", Extensions = { "nsp" } });
|
||||
|
||||
string[] files = await dialog.ShowAsync(this);
|
||||
|
||||
if (files != null)
|
||||
{
|
||||
foreach (string file in files)
|
||||
{
|
||||
await AddDlc(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
_dlcContainerList.Clear();
|
||||
|
||||
DlcContainer container = default;
|
||||
|
||||
foreach (DlcModel dlc in Dlcs)
|
||||
{
|
||||
if (container.Path != dlc.ContainerPath)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(container.Path))
|
||||
{
|
||||
_dlcContainerList.Add(container);
|
||||
}
|
||||
|
||||
container = new DlcContainer { Path = dlc.ContainerPath, DlcNcaList = new List<DlcNca>() };
|
||||
}
|
||||
|
||||
container.DlcNcaList.Add(new DlcNca
|
||||
{
|
||||
Enabled = dlc.IsEnabled,
|
||||
TitleId = Convert.ToUInt64(dlc.TitleId, 16),
|
||||
Path = dlc.FullPath
|
||||
});
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(container.Path))
|
||||
{
|
||||
_dlcContainerList.Add(container);
|
||||
}
|
||||
|
||||
using (FileStream dlcJsonStream = File.Create(_dlcJsonPath, 4096, FileOptions.WriteThrough))
|
||||
{
|
||||
dlcJsonStream.Write(Encoding.UTF8.GetBytes(JsonHelper.Serialize(_dlcContainerList, true)));
|
||||
}
|
||||
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
@ -38,18 +38,6 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<controls:OffscreenTextBox Name="HiddenTextBox" Grid.Row="0" />
|
||||
<ContentControl
|
||||
Grid.Row="1"
|
||||
Focusable="False"
|
||||
IsVisible="False"
|
||||
KeyboardNavigation.IsTabStop="False">
|
||||
<ui:ContentDialog
|
||||
Name="ContentDialog"
|
||||
IsPrimaryButtonEnabled="True"
|
||||
IsSecondaryButtonEnabled="True"
|
||||
IsVisible="True"
|
||||
KeyboardNavigation.IsTabStop="False" />
|
||||
</ContentControl>
|
||||
<StackPanel Grid.Row="0" IsVisible="False">
|
||||
<controls:HotKeyControl Name="FullscreenHotKey" Command="{ReflectionBinding ToggleFullscreen}" />
|
||||
<controls:HotKeyControl Name="FullscreenHotKey2" Command="{ReflectionBinding ToggleFullscreen}" />
|
||||
@ -123,14 +111,20 @@
|
||||
Command="{ReflectionBinding ToggleFullscreen}"
|
||||
Header="{locale:Locale MenuBarOptionsToggleFullscreen}"
|
||||
InputGesture="F11" />
|
||||
<MenuItem Header="{locale:Locale MenuBarOptionsStartGamesInFullscreen}">
|
||||
<MenuItem>
|
||||
<MenuItem.Icon>
|
||||
<CheckBox IsChecked="{Binding StartGamesInFullscreen, Mode=TwoWay}" />
|
||||
<CheckBox IsChecked="{Binding StartGamesInFullscreen, Mode=TwoWay}"
|
||||
MinWidth="250">
|
||||
<TextBlock Text="{locale:Locale MenuBarOptionsStartGamesInFullscreen}"/>
|
||||
</CheckBox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="{locale:Locale MenuBarOptionsShowConsole}">
|
||||
<MenuItem IsVisible="{Binding ShowConsoleVisible}">
|
||||
<MenuItem.Icon>
|
||||
<CheckBox IsChecked="{Binding ShowConsole, Mode=TwoWay}" />
|
||||
<CheckBox IsChecked="{Binding ShowConsole, Mode=TwoWay}"
|
||||
MinWidth="250">
|
||||
<TextBlock Text="{locale:Locale MenuBarOptionsShowConsole}"/>
|
||||
</CheckBox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
@ -179,6 +173,10 @@
|
||||
Command="{ReflectionBinding ChangeLanguage}"
|
||||
CommandParameter="zh_CN"
|
||||
Header="Simplified Chinese" />
|
||||
<MenuItem
|
||||
Command="{ReflectionBinding ChangeLanguage}"
|
||||
CommandParameter="zh_TW"
|
||||
Header="Traditional Chinese (Taiwan)" />
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem
|
||||
|
@ -36,7 +36,7 @@ using InputManager = Ryujinx.Input.HLE.InputManager;
|
||||
using ProgressBar = Avalonia.Controls.ProgressBar;
|
||||
namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public class MainWindow : StyleableWindow
|
||||
public partial class MainWindow : StyleableWindow
|
||||
{
|
||||
private bool _canUpdate;
|
||||
private bool _isClosing;
|
||||
@ -62,22 +62,6 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
public InputManager InputManager { get; private set; }
|
||||
|
||||
internal RendererControl GlRenderer { get; private set; }
|
||||
public ContentControl ContentFrame { get; private set; }
|
||||
public TextBlock LoadStatus { get; private set; }
|
||||
public TextBlock FirmwareStatus { get; private set; }
|
||||
public TextBox SearchBox { get; private set; }
|
||||
public ProgressBar LoadProgressBar { get; private set; }
|
||||
public Menu Menu { get; private set; }
|
||||
public MenuItem UpdateMenuItem { get; private set; }
|
||||
public MenuItem ActionsMenuItem { get; private set; }
|
||||
public GameGridView GameGrid { get; private set; }
|
||||
public GameListView GameList { get; private set; }
|
||||
public OffscreenTextBox HiddenTextBox { get; private set; }
|
||||
public HotKeyControl FullscreenHotKey { get; private set; }
|
||||
public HotKeyControl FullscreenHotKey2 { get; private set; }
|
||||
public HotKeyControl DockToggleHotKey { get; private set; }
|
||||
public HotKeyControl ExitHotKey { get; private set; }
|
||||
public ToggleSplitButton VolumeStatus { get; set; }
|
||||
internal MainWindowViewModel ViewModel { get; private set; }
|
||||
public SettingsWindow SettingsWindow { get; set; }
|
||||
|
||||
@ -102,6 +86,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
DataContext = ViewModel;
|
||||
|
||||
InitializeComponent();
|
||||
Load();
|
||||
AttachDebugDevTools();
|
||||
|
||||
UiHandler = new AvaHostUiHandler(this);
|
||||
@ -120,8 +105,6 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
InputManager = new InputManager(new AvaloniaKeyboardDriver(this), new SDL2GamepadDriver());
|
||||
|
||||
LoadGameList();
|
||||
|
||||
CheckLaunchState();
|
||||
}
|
||||
|
||||
_rendererWaitEvent = new AutoResetEvent(false);
|
||||
@ -194,7 +177,9 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
string mainMessage = LocaleManager.Instance["DialogPerformanceCheckLoggingEnabledMessage"];
|
||||
string secondaryMessage = LocaleManager.Instance["DialogPerformanceCheckLoggingEnabledConfirmMessage"];
|
||||
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(this, mainMessage, secondaryMessage, LocaleManager.Instance["InputDialogYes"], LocaleManager.Instance["InputDialogNo"], LocaleManager.Instance["RyujinxConfirm"]);
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(mainMessage, secondaryMessage,
|
||||
LocaleManager.Instance["InputDialogYes"], LocaleManager.Instance["InputDialogNo"],
|
||||
LocaleManager.Instance["RyujinxConfirm"]);
|
||||
|
||||
if (result != UserResult.Yes)
|
||||
{
|
||||
@ -207,9 +192,12 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
if (!string.IsNullOrWhiteSpace(ConfigurationState.Instance.Graphics.ShadersDumpPath.Value))
|
||||
{
|
||||
string mainMessage = LocaleManager.Instance["DialogPerformanceCheckShaderDumpEnabledMessage"];
|
||||
string secondaryMessage = LocaleManager.Instance["DialogPerformanceCheckShaderDumpEnabledConfirmMessage"];
|
||||
string secondaryMessage =
|
||||
LocaleManager.Instance["DialogPerformanceCheckShaderDumpEnabledConfirmMessage"];
|
||||
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(this, mainMessage, secondaryMessage, LocaleManager.Instance["InputDialogYes"], LocaleManager.Instance["InputDialogNo"], LocaleManager.Instance["RyujinxConfirm"]);
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(mainMessage, secondaryMessage,
|
||||
LocaleManager.Instance["InputDialogYes"], LocaleManager.Instance["InputDialogNo"],
|
||||
LocaleManager.Instance["RyujinxConfirm"]);
|
||||
|
||||
if (result != UserResult.Yes)
|
||||
{
|
||||
@ -233,7 +221,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
if (AppHost != null)
|
||||
{
|
||||
await ContentDialogHelper.CreateInfoDialog(this,
|
||||
await ContentDialogHelper.CreateInfoDialog(
|
||||
LocaleManager.Instance["DialogLoadAppGameAlreadyLoadedMessage"],
|
||||
LocaleManager.Instance["DialogLoadAppGameAlreadyLoadedSubMessage"],
|
||||
LocaleManager.Instance["InputDialogOk"],
|
||||
@ -256,7 +244,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
|
||||
PrepareLoadScreen();
|
||||
|
||||
_mainViewContent = ContentFrame.Content as Control;
|
||||
_mainViewContent = Content.Content as Control;
|
||||
|
||||
GlRenderer = new RendererControl(3, 3, ConfigurationState.Instance.Logger.GraphicsDebugLevel);
|
||||
AppHost = new AppHost(GlRenderer, InputManager, path, VirtualFileSystem, ContentManager, AccountManager, _userChannelPersistence, this);
|
||||
@ -323,7 +311,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
ContentFrame.Content = GlRenderer;
|
||||
Content.Content = GlRenderer;
|
||||
|
||||
if (startFullscreen && WindowState != WindowState.FullScreen)
|
||||
{
|
||||
@ -367,9 +355,9 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
if (ContentFrame.Content != _mainViewContent)
|
||||
if (Content.Content != _mainViewContent)
|
||||
{
|
||||
ContentFrame.Content = _mainViewContent;
|
||||
Content.Content = _mainViewContent;
|
||||
}
|
||||
|
||||
ViewModel.ShowMenuAndStatusBar = true;
|
||||
@ -451,7 +439,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
RefreshFirmwareStatus();
|
||||
}
|
||||
|
||||
protected async void CheckLaunchState()
|
||||
protected void CheckLaunchState()
|
||||
{
|
||||
if (ShowKeyErrorOnLoad)
|
||||
{
|
||||
@ -470,7 +458,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
|
||||
if (ConfigurationState.Instance.CheckUpdatesOnStart.Value && Updater.CanUpdate(false, this))
|
||||
{
|
||||
await Updater.BeginParse(this, false).ContinueWith(task =>
|
||||
Updater.BeginParse(this, false).ContinueWith(task =>
|
||||
{
|
||||
Logger.Error?.Print(LogClass.Application, $"Updater Error: {task.Exception}");
|
||||
}, TaskContinuationOptions.OnlyOnFaulted);
|
||||
@ -503,27 +491,8 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
ViewModel.IsAppletMenuActive = hasApplet;
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
private void Load()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
|
||||
ContentFrame = this.FindControl<ContentControl>("Content");
|
||||
GameList = this.FindControl<GameListView>("GameList");
|
||||
LoadStatus = this.FindControl<TextBlock>("LoadStatus");
|
||||
FirmwareStatus = this.FindControl<TextBlock>("FirmwareStatus");
|
||||
LoadProgressBar = this.FindControl<ProgressBar>("LoadProgressBar");
|
||||
SearchBox = this.FindControl<TextBox>("SearchBox");
|
||||
Menu = this.FindControl<Menu>("Menu");
|
||||
UpdateMenuItem = this.FindControl<MenuItem>("UpdateMenuItem");
|
||||
GameGrid = this.FindControl<GameGridView>("GameGrid");
|
||||
HiddenTextBox = this.FindControl<OffscreenTextBox>("HiddenTextBox");
|
||||
FullscreenHotKey = this.FindControl<HotKeyControl>("FullscreenHotKey");
|
||||
FullscreenHotKey2 = this.FindControl<HotKeyControl>("FullscreenHotKey2");
|
||||
DockToggleHotKey = this.FindControl<HotKeyControl>("DockToggleHotKey");
|
||||
ExitHotKey = this.FindControl<HotKeyControl>("ExitHotKey");
|
||||
VolumeStatus = this.FindControl<ToggleSplitButton>("VolumeStatus");
|
||||
ActionsMenuItem = this.FindControl<MenuItem>("ActionsMenuItem");
|
||||
|
||||
VolumeStatus.Click += VolumeStatus_CheckedChanged;
|
||||
|
||||
GameGrid.ApplicationOpened += Application_Opened;
|
||||
@ -537,6 +506,13 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
LoadHotKeys();
|
||||
}
|
||||
|
||||
protected override void OnOpened(EventArgs e)
|
||||
{
|
||||
base.OnOpened(e);
|
||||
|
||||
CheckLaunchState();
|
||||
}
|
||||
|
||||
public static void UpdateGraphicsConfig()
|
||||
{
|
||||
int resScale = ConfigurationState.Instance.Graphics.ResScale;
|
||||
@ -705,7 +681,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
_isClosing = await ContentDialogHelper.CreateExitDialog(this);
|
||||
_isClosing = await ContentDialogHelper.CreateExitDialog();
|
||||
|
||||
if (_isClosing)
|
||||
{
|
||||
|
@ -9,13 +9,14 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public class MotionSettingsWindow : UserControl
|
||||
public partial class MotionSettingsWindow : UserControl
|
||||
{
|
||||
private readonly InputConfiguration<GamepadInputId, StickInputId> _viewmodel;
|
||||
|
||||
public MotionSettingsWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = _viewmodel;
|
||||
}
|
||||
|
||||
public MotionSettingsWindow(ControllerSettingsViewModel viewmodel)
|
||||
@ -36,46 +37,36 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
};
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
DataContext = _viewmodel;
|
||||
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public static async Task Show(ControllerSettingsViewModel viewmodel, StyleableWindow window)
|
||||
public static async Task Show(ControllerSettingsViewModel viewmodel)
|
||||
{
|
||||
ContentDialog contentDialog = window.ContentDialog;
|
||||
|
||||
string name = string.Empty;
|
||||
|
||||
MotionSettingsWindow content = new MotionSettingsWindow(viewmodel);
|
||||
|
||||
if (contentDialog != null)
|
||||
ContentDialog contentDialog = new ContentDialog
|
||||
{
|
||||
contentDialog.Title = LocaleManager.Instance["ControllerMotionTitle"];
|
||||
contentDialog.PrimaryButtonText = LocaleManager.Instance["ControllerSettingsSave"];
|
||||
contentDialog.SecondaryButtonText = "";
|
||||
contentDialog.CloseButtonText = LocaleManager.Instance["ControllerSettingsClose"];
|
||||
contentDialog.Content = content;
|
||||
contentDialog.PrimaryButtonClick += (sender, args) =>
|
||||
{
|
||||
var config = viewmodel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
||||
config.Slot = content._viewmodel.Slot;
|
||||
config.EnableMotion = content._viewmodel.EnableMotion;
|
||||
config.Sensitivity = content._viewmodel.Sensitivity;
|
||||
config.GyroDeadzone = content._viewmodel.GyroDeadzone;
|
||||
config.AltSlot = content._viewmodel.AltSlot;
|
||||
config.DsuServerHost = content._viewmodel.DsuServerHost;
|
||||
config.DsuServerPort = content._viewmodel.DsuServerPort;
|
||||
config.EnableCemuHookMotion = content._viewmodel.EnableCemuHookMotion;
|
||||
config.MirrorInput = content._viewmodel.MirrorInput;
|
||||
};
|
||||
Title = LocaleManager.Instance["ControllerMotionTitle"],
|
||||
PrimaryButtonText = LocaleManager.Instance["ControllerSettingsSave"],
|
||||
SecondaryButtonText = "",
|
||||
CloseButtonText = LocaleManager.Instance["ControllerSettingsClose"],
|
||||
Content = content
|
||||
};
|
||||
contentDialog.PrimaryButtonClick += (sender, args) =>
|
||||
{
|
||||
var config = viewmodel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
||||
config.Slot = content._viewmodel.Slot;
|
||||
config.EnableMotion = content._viewmodel.EnableMotion;
|
||||
config.Sensitivity = content._viewmodel.Sensitivity;
|
||||
config.GyroDeadzone = content._viewmodel.GyroDeadzone;
|
||||
config.AltSlot = content._viewmodel.AltSlot;
|
||||
config.DsuServerHost = content._viewmodel.DsuServerHost;
|
||||
config.DsuServerPort = content._viewmodel.DsuServerPort;
|
||||
config.EnableCemuHookMotion = content._viewmodel.EnableCemuHookMotion;
|
||||
config.MirrorInput = content._viewmodel.MirrorInput;
|
||||
};
|
||||
|
||||
await contentDialog.ShowAsync();
|
||||
}
|
||||
await contentDialog.ShowAsync();
|
||||
}
|
||||
}
|
||||
}
|
@ -9,13 +9,14 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public class RumbleSettingsWindow : UserControl
|
||||
public partial class RumbleSettingsWindow : UserControl
|
||||
{
|
||||
private readonly InputConfiguration<GamepadInputId, StickInputId> _viewmodel;
|
||||
|
||||
public RumbleSettingsWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = _viewmodel;
|
||||
}
|
||||
|
||||
public RumbleSettingsWindow(ControllerSettingsViewModel viewmodel)
|
||||
@ -24,44 +25,34 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
|
||||
_viewmodel = new InputConfiguration<GamepadInputId, StickInputId>()
|
||||
{
|
||||
StrongRumble = config.StrongRumble,
|
||||
WeakRumble = config.WeakRumble
|
||||
StrongRumble = config.StrongRumble, WeakRumble = config.WeakRumble
|
||||
};
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
DataContext = _viewmodel;
|
||||
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public static async Task Show(ControllerSettingsViewModel viewmodel, StyleableWindow window)
|
||||
public static async Task Show(ControllerSettingsViewModel viewmodel)
|
||||
{
|
||||
ContentDialog contentDialog = window.ContentDialog;
|
||||
|
||||
string name = string.Empty;
|
||||
|
||||
RumbleSettingsWindow content = new RumbleSettingsWindow(viewmodel);
|
||||
|
||||
if (contentDialog != null)
|
||||
ContentDialog contentDialog = new ContentDialog
|
||||
{
|
||||
contentDialog.Title = LocaleManager.Instance["ControllerRumbleTitle"];
|
||||
contentDialog.PrimaryButtonText = LocaleManager.Instance["ControllerSettingsSave"];
|
||||
contentDialog.SecondaryButtonText = "";
|
||||
contentDialog.CloseButtonText = LocaleManager.Instance["ControllerSettingsClose"];
|
||||
contentDialog.Content = content;
|
||||
contentDialog.PrimaryButtonClick += (sender, args) =>
|
||||
{
|
||||
var config = viewmodel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
||||
config.StrongRumble = content._viewmodel.StrongRumble;
|
||||
config.WeakRumble = content._viewmodel.WeakRumble;
|
||||
};
|
||||
|
||||
await contentDialog.ShowAsync();
|
||||
}
|
||||
Title = LocaleManager.Instance["ControllerRumbleTitle"],
|
||||
PrimaryButtonText = LocaleManager.Instance["ControllerSettingsSave"],
|
||||
SecondaryButtonText = "",
|
||||
CloseButtonText = LocaleManager.Instance["ControllerSettingsClose"],
|
||||
Content = content,
|
||||
};
|
||||
|
||||
contentDialog.PrimaryButtonClick += (sender, args) =>
|
||||
{
|
||||
var config = viewmodel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
||||
config.StrongRumble = content._viewmodel.StrongRumble;
|
||||
config.WeakRumble = content._viewmodel.WeakRumble;
|
||||
};
|
||||
|
||||
await contentDialog.ShowAsync();
|
||||
}
|
||||
}
|
||||
}
|
@ -31,16 +31,11 @@
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ContentControl
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Grid.Row="1"
|
||||
Focusable="False"
|
||||
IsVisible="False"
|
||||
KeyboardNavigation.IsTabStop="False">
|
||||
<ui:ContentDialog Name="ContentDialog"
|
||||
IsPrimaryButtonEnabled="True"
|
||||
IsSecondaryButtonEnabled="True"
|
||||
IsVisible="False" />
|
||||
</ContentControl>
|
||||
KeyboardNavigation.IsTabStop="False"/>
|
||||
<Grid Name="Pages" IsVisible="False" Grid.Row="2">
|
||||
<ScrollViewer Name="UiPage"
|
||||
Margin="0,0,10,0"
|
||||
|
@ -1,5 +1,6 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Presenters;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Data.Converters;
|
||||
@ -28,24 +29,8 @@ using TimeZone = Ryujinx.Ava.Ui.Models.TimeZone;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public class SettingsWindow : StyleableWindow
|
||||
public partial class SettingsWindow : StyleableWindow
|
||||
{
|
||||
private ListBox _gameList;
|
||||
private TextBox _pathBox;
|
||||
private AutoCompleteBox _timeZoneBox;
|
||||
private ControllerSettingsWindow _controllerSettings;
|
||||
|
||||
// Pages
|
||||
private Control _uiPage;
|
||||
private Control _inputPage;
|
||||
private Control _hotkeysPage;
|
||||
private Control _systemPage;
|
||||
private Control _cpuPage;
|
||||
private Control _graphicsPage;
|
||||
private Control _audioPage;
|
||||
private Control _networkPage;
|
||||
private Control _loggingPage;
|
||||
private NavigationView _navPanel;
|
||||
private ButtonKeyAssigner _currentAssigner;
|
||||
|
||||
internal SettingsViewModel ViewModel { get; set; }
|
||||
@ -58,6 +43,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
DataContext = ViewModel;
|
||||
|
||||
InitializeComponent();
|
||||
Load();
|
||||
AttachDebugDevTools();
|
||||
|
||||
FuncMultiValueConverter<string, string> converter = new(parts => string.Format("{0} {1} {2}", parts.ToArray()));
|
||||
@ -66,7 +52,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
tzMultiBinding.Bindings.Add(new Binding("Location"));
|
||||
tzMultiBinding.Bindings.Add(new Binding("Abbreviation"));
|
||||
|
||||
_timeZoneBox.ValueMemberBinding = tzMultiBinding;
|
||||
TimeZoneBox.ValueMemberBinding = tzMultiBinding;
|
||||
}
|
||||
|
||||
public SettingsWindow()
|
||||
@ -75,6 +61,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
DataContext = ViewModel;
|
||||
|
||||
InitializeComponent();
|
||||
Load();
|
||||
AttachDebugDevTools();
|
||||
}
|
||||
|
||||
@ -84,31 +71,11 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
this.AttachDevTools();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
private void Load()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
|
||||
_pathBox = this.FindControl<TextBox>("PathBox");
|
||||
_gameList = this.FindControl<ListBox>("GameList");
|
||||
_timeZoneBox = this.FindControl<AutoCompleteBox>("TimeZoneBox");
|
||||
_controllerSettings = this.FindControl<ControllerSettingsWindow>("ControllerSettings");
|
||||
|
||||
_uiPage = this.FindControl<Control>("UiPage");
|
||||
_inputPage = this.FindControl<Control>("InputPage");
|
||||
_hotkeysPage = this.FindControl<Control>("HotkeysPage");
|
||||
_systemPage = this.FindControl<Control>("SystemPage");
|
||||
_cpuPage = this.FindControl<Control>("CpuPage");
|
||||
_graphicsPage = this.FindControl<Control>("GraphicsPage");
|
||||
_audioPage = this.FindControl<Control>("AudioPage");
|
||||
_networkPage = this.FindControl<Control>("NetworkPage");
|
||||
_loggingPage = this.FindControl<Control>("LoggingPage");
|
||||
|
||||
var pageGrid = this.FindControl<Grid>("Pages");
|
||||
pageGrid.Children.Clear();
|
||||
|
||||
_navPanel = this.FindControl<NavigationView>("NavPanel");
|
||||
_navPanel.SelectionChanged += NavPanelOnSelectionChanged;
|
||||
_navPanel.SelectedItem = _navPanel.MenuItems.ElementAt(0);
|
||||
Pages.Children.Clear();
|
||||
NavPanel.SelectionChanged += NavPanelOnSelectionChanged;
|
||||
NavPanel.SelectedItem = NavPanel.MenuItems.ElementAt(0);
|
||||
}
|
||||
|
||||
private void Button_Checked(object sender, RoutedEventArgs e)
|
||||
@ -174,31 +141,31 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
switch (navitem.Tag.ToString())
|
||||
{
|
||||
case "UiPage":
|
||||
_navPanel.Content = _uiPage;
|
||||
NavPanel.Content = UiPage;
|
||||
break;
|
||||
case "InputPage":
|
||||
_navPanel.Content = _inputPage;
|
||||
NavPanel.Content = InputPage;
|
||||
break;
|
||||
case "HotkeysPage":
|
||||
_navPanel.Content = _hotkeysPage;
|
||||
NavPanel.Content = HotkeysPage;
|
||||
break;
|
||||
case "SystemPage":
|
||||
_navPanel.Content = _systemPage;
|
||||
NavPanel.Content = SystemPage;
|
||||
break;
|
||||
case "CpuPage":
|
||||
_navPanel.Content = _cpuPage;
|
||||
NavPanel.Content = CpuPage;
|
||||
break;
|
||||
case "GraphicsPage":
|
||||
_navPanel.Content = _graphicsPage;
|
||||
NavPanel.Content = GraphicsPage;
|
||||
break;
|
||||
case "AudioPage":
|
||||
_navPanel.Content = _audioPage;
|
||||
NavPanel.Content = AudioPage;
|
||||
break;
|
||||
case "NetworkPage":
|
||||
_navPanel.Content = _networkPage;
|
||||
NavPanel.Content = NetworkPage;
|
||||
break;
|
||||
case "LoggingPage":
|
||||
_navPanel.Content = _loggingPage;
|
||||
NavPanel.Content = LoggingPage;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -206,7 +173,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
|
||||
private async void AddButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string path = _pathBox.Text;
|
||||
string path = PathBox.Text;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(path) && Directory.Exists(path) && !ViewModel.GameDirectories.Contains(path))
|
||||
{
|
||||
@ -225,7 +192,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
|
||||
private void RemoveButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
List<string> selected = new(_gameList.SelectedItems.Cast<string>());
|
||||
List<string> selected = new(GameList.SelectedItems.Cast<string>());
|
||||
|
||||
foreach (string path in selected)
|
||||
{
|
||||
@ -279,7 +246,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
ViewModel.SaveSettings();
|
||||
|
||||
_controllerSettings?.SaveCurrentProfile();
|
||||
ControllerSettings?.SaveCurrentProfile();
|
||||
|
||||
if (Owner is MainWindow window)
|
||||
{
|
||||
@ -289,7 +256,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
_controllerSettings.Dispose();
|
||||
ControllerSettings.Dispose();
|
||||
_currentAssigner?.Cancel();
|
||||
_currentAssigner = null;
|
||||
base.OnClosed(e);
|
||||
|
@ -11,7 +11,6 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public class StyleableWindow : Window
|
||||
{
|
||||
public ContentDialog ContentDialog { get; private set; }
|
||||
public IBitmap IconImage { get; set; }
|
||||
|
||||
public StyleableWindow()
|
||||
@ -26,15 +25,9 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
IconImage = new Bitmap(stream);
|
||||
}
|
||||
|
||||
public void LoadDialog()
|
||||
{
|
||||
ContentDialog = this.FindControl<ContentDialog>("ContentDialog");
|
||||
}
|
||||
|
||||
protected override void OnOpened(EventArgs e)
|
||||
{
|
||||
base.OnOpened(e);
|
||||
ContentDialog = this.FindControl<ContentDialog>("ContentDialog");
|
||||
}
|
||||
|
||||
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
|
104
Ryujinx.Ava/Ui/Windows/TitleUpdateWindow.axaml
Normal file
104
Ryujinx.Ava/Ui/Windows/TitleUpdateWindow.axaml
Normal file
@ -0,0 +1,104 @@
|
||||
<window:StyleableWindow
|
||||
x:Class="Ryujinx.Ava.Ui.Windows.TitleUpdateWindow"
|
||||
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:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||
xmlns:window="clr-namespace:Ryujinx.Ava.Ui.Windows"
|
||||
SizeToContent="Height"
|
||||
Width="600" MinHeight="500" Height="500"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
MinWidth="600"
|
||||
mc:Ignorable="d">
|
||||
<Grid Margin="15">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="20,15,20,20"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
MaxWidth="500"
|
||||
LineHeight="18"
|
||||
TextWrapping="Wrap"
|
||||
Text="{Binding Heading}"
|
||||
TextAlignment="Center" />
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Margin="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1">
|
||||
<ScrollViewer
|
||||
Width="550"
|
||||
MinHeight="200"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<ItemsControl
|
||||
Margin="10"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Items="{Binding TitleUpdates}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<RadioButton Padding="8, 0" VerticalContentAlignment="Center" GroupName="Update" IsChecked="{Binding IsEnabled, Mode=TwoWay}">
|
||||
<Label Margin="0" VerticalAlignment="Center" Content="{Binding Label}" />
|
||||
</RadioButton>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
<DockPanel
|
||||
Grid.Row="3"
|
||||
Margin="0"
|
||||
HorizontalAlignment="Stretch">
|
||||
<DockPanel Margin="0" HorizontalAlignment="Left">
|
||||
<Button
|
||||
Name="AddButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding Add}">
|
||||
<TextBlock Text="{locale:Locale SettingsTabGeneralAdd}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="RemoveButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding RemoveSelected}">
|
||||
<TextBlock Text="{locale:Locale SettingsTabGeneralRemove}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="RemoveAllButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding RemoveAll}">
|
||||
<TextBlock Text="{locale:Locale DlcManagerRemoveAllButton}" />
|
||||
</Button>
|
||||
</DockPanel>
|
||||
<DockPanel Margin="0" HorizontalAlignment="Right">
|
||||
<Button
|
||||
Name="SaveButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding Save}">
|
||||
<TextBlock Text="{locale:Locale SettingsButtonSave}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="CancelButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding Close}">
|
||||
<TextBlock Text="{locale:Locale InputDialogCancel}" />
|
||||
</Button>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</window:StyleableWindow>
|
263
Ryujinx.Ava/Ui/Windows/TitleUpdateWindow.axaml.cs
Normal file
263
Ryujinx.Ava/Ui/Windows/TitleUpdateWindow.axaml.cs
Normal file
@ -0,0 +1,263 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Collections;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using LibHac.Common;
|
||||
using LibHac.Fs;
|
||||
using LibHac.Fs.Fsa;
|
||||
using LibHac.FsSystem;
|
||||
using LibHac.Tools.FsSystem.NcaUtils;
|
||||
using LibHac.Ns;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Ui.Controls;
|
||||
using Ryujinx.Ava.Ui.Models;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Utilities;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.HOS;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Path = System.IO.Path;
|
||||
using SpanHelpers = LibHac.Common.SpanHelpers;
|
||||
using LibHac.Tools.FsSystem;
|
||||
using Avalonia.Threading;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public partial class TitleUpdateWindow : StyleableWindow
|
||||
{
|
||||
private readonly string _updateJsonPath;
|
||||
private TitleUpdateMetadata _titleUpdateWindowData;
|
||||
|
||||
public VirtualFileSystem VirtualFileSystem { get; }
|
||||
|
||||
internal AvaloniaList<TitleUpdateModel> TitleUpdates { get; set; } = new AvaloniaList<TitleUpdateModel>();
|
||||
public string TitleId { get; }
|
||||
public string TitleName { get; }
|
||||
|
||||
public string Heading => string.Format(LocaleManager.Instance["GameUpdateWindowHeading"], TitleName, TitleId.ToUpper());
|
||||
|
||||
public TitleUpdateWindow()
|
||||
{
|
||||
DataContext = this;
|
||||
|
||||
InitializeComponent();
|
||||
AttachDebugDevTools();
|
||||
|
||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["UpdateWindowTitle"];
|
||||
}
|
||||
|
||||
public TitleUpdateWindow(VirtualFileSystem virtualFileSystem, string titleId, string titleName)
|
||||
{
|
||||
VirtualFileSystem = virtualFileSystem;
|
||||
TitleId = titleId;
|
||||
TitleName = titleName;
|
||||
|
||||
_updateJsonPath = Path.Combine(AppDataManager.GamesDirPath, titleId, "updates.json");
|
||||
|
||||
try
|
||||
{
|
||||
_titleUpdateWindowData = JsonHelper.DeserializeFromFile<TitleUpdateMetadata>(_updateJsonPath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
_titleUpdateWindowData = new TitleUpdateMetadata {Selected = "", Paths = new List<string>()};
|
||||
}
|
||||
|
||||
DataContext = this;
|
||||
|
||||
InitializeComponent();
|
||||
AttachDebugDevTools();
|
||||
|
||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["UpdateWindowTitle"];
|
||||
|
||||
LoadUpdates();
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
private void AttachDebugDevTools()
|
||||
{
|
||||
this.AttachDevTools();
|
||||
}
|
||||
|
||||
private void LoadUpdates()
|
||||
{
|
||||
TitleUpdates.Add(new TitleUpdateModel(default, string.Empty, true));
|
||||
|
||||
foreach (string path in _titleUpdateWindowData.Paths)
|
||||
{
|
||||
AddUpdate(path);
|
||||
}
|
||||
|
||||
if (_titleUpdateWindowData.Selected == "")
|
||||
{
|
||||
TitleUpdates[0].IsEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TitleUpdateModel selected = TitleUpdates.FirstOrDefault(x => x.Path == _titleUpdateWindowData.Selected);
|
||||
List<TitleUpdateModel> enabled = TitleUpdates.Where(x => x.IsEnabled).ToList();
|
||||
|
||||
foreach (TitleUpdateModel update in enabled)
|
||||
{
|
||||
update.IsEnabled = false;
|
||||
}
|
||||
|
||||
if (selected != null)
|
||||
{
|
||||
selected.IsEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
SortUpdates();
|
||||
}
|
||||
|
||||
private void AddUpdate(string path)
|
||||
{
|
||||
if (File.Exists(path) && !TitleUpdates.Any(x => x.Path == path))
|
||||
{
|
||||
using (FileStream file = new(path, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
PartitionFileSystem nsp = new PartitionFileSystem(file.AsStorage());
|
||||
|
||||
try
|
||||
{
|
||||
(Nca patchNca, Nca controlNca) =
|
||||
ApplicationLoader.GetGameUpdateDataFromPartition(VirtualFileSystem, nsp, TitleId, 0);
|
||||
|
||||
if (controlNca != null && patchNca != null)
|
||||
{
|
||||
ApplicationControlProperty controlData = new ApplicationControlProperty();
|
||||
|
||||
using var nacpFile = new UniqueRef<IFile>();
|
||||
|
||||
controlNca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None)
|
||||
.OpenFile(ref nacpFile.Ref(), "/control.nacp".ToU8Span(), OpenMode.Read)
|
||||
.ThrowIfFailure();
|
||||
nacpFile.Get.Read(out _, 0, SpanHelpers.AsByteSpan(ref controlData), ReadOption.None)
|
||||
.ThrowIfFailure();
|
||||
|
||||
TitleUpdates.Add(new TitleUpdateModel(controlData, path));
|
||||
}
|
||||
else
|
||||
{
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogUpdateAddUpdateErrorMessage"]);
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Dispatcher.UIThread.Post(async () =>
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance["DialogDlcLoadNcaErrorMessage"], ex.Message, path));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveUpdates(bool removeSelectedOnly = false)
|
||||
{
|
||||
if (removeSelectedOnly)
|
||||
{
|
||||
TitleUpdates.RemoveAll(TitleUpdates.Where(x => x.IsEnabled && !x.IsNoUpdate).ToList());
|
||||
}
|
||||
else
|
||||
{
|
||||
TitleUpdates.RemoveAll(TitleUpdates.Where(x => !x.IsNoUpdate).ToList());
|
||||
}
|
||||
|
||||
TitleUpdates.FirstOrDefault(x => x.IsNoUpdate).IsEnabled = true;
|
||||
|
||||
SortUpdates();
|
||||
}
|
||||
|
||||
public void RemoveSelected()
|
||||
{
|
||||
RemoveUpdates(true);
|
||||
}
|
||||
|
||||
public void RemoveAll()
|
||||
{
|
||||
RemoveUpdates();
|
||||
}
|
||||
|
||||
public async void Add()
|
||||
{
|
||||
OpenFileDialog dialog = new OpenFileDialog() { Title = LocaleManager.Instance["SelectUpdateDialogTitle"], AllowMultiple = true };
|
||||
|
||||
dialog.Filters.Add(new FileDialogFilter { Name = "NSP", Extensions = { "nsp" } });
|
||||
|
||||
string[] files = await dialog.ShowAsync(this);
|
||||
|
||||
if (files != null)
|
||||
{
|
||||
foreach (string file in files)
|
||||
{
|
||||
AddUpdate(file);
|
||||
}
|
||||
}
|
||||
|
||||
SortUpdates();
|
||||
}
|
||||
|
||||
private void SortUpdates()
|
||||
{
|
||||
var list = TitleUpdates.ToList();
|
||||
|
||||
list.Sort((first, second) =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(first.Control.DisplayVersionString.ToString()))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else if (string.IsNullOrEmpty(second.Control.DisplayVersionString.ToString()))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return Version.Parse(first.Control.DisplayVersionString.ToString())
|
||||
.CompareTo(Version.Parse(second.Control.DisplayVersionString.ToString())) * -1;
|
||||
});
|
||||
|
||||
TitleUpdates.Clear();
|
||||
|
||||
TitleUpdates.AddRange(list);
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
_titleUpdateWindowData.Paths.Clear();
|
||||
|
||||
_titleUpdateWindowData.Selected = "";
|
||||
|
||||
foreach (TitleUpdateModel update in TitleUpdates)
|
||||
{
|
||||
_titleUpdateWindowData.Paths.Add(update.Path);
|
||||
|
||||
if (update.IsEnabled)
|
||||
{
|
||||
_titleUpdateWindowData.Selected = update.Path;
|
||||
}
|
||||
}
|
||||
|
||||
using (FileStream dlcJsonStream = File.Create(_updateJsonPath, 4096, FileOptions.WriteThrough))
|
||||
{
|
||||
dlcJsonStream.Write(Encoding.UTF8.GetBytes(JsonHelper.Serialize(_titleUpdateWindowData, true)));
|
||||
}
|
||||
|
||||
if (Owner is MainWindow window)
|
||||
{
|
||||
window.ViewModel.LoadApplications();
|
||||
}
|
||||
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Ava.Ui.Windows
|
||||
{
|
||||
public class UpdaterWindow : StyleableWindow
|
||||
public partial class UpdaterWindow : StyleableWindow
|
||||
{
|
||||
private readonly string _buildUrl;
|
||||
private readonly MainWindow _mainWindow;
|
||||
@ -36,21 +36,6 @@ namespace Ryujinx.Ava.Ui.Windows
|
||||
_buildUrl = buildUrl;
|
||||
}
|
||||
|
||||
public TextBlock MainText { get; set; }
|
||||
public TextBlock SecondaryText { get; set; }
|
||||
public ProgressBar ProgressBar { get; set; }
|
||||
public StackPanel ButtonBox { get; set; }
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
|
||||
MainText = this.FindControl<TextBlock>("MainText");
|
||||
SecondaryText = this.FindControl<TextBlock>("SecondaryText");
|
||||
ProgressBar = this.FindControl<ProgressBar>("ProgressBar");
|
||||
ButtonBox = this.FindControl<StackPanel>("ButtonBox");
|
||||
}
|
||||
|
||||
[DllImport("libc", SetLastError = true)]
|
||||
private static extern int chmod(string path, uint mode);
|
||||
|
||||
|
@ -208,7 +208,6 @@ namespace Ryujinx.Graphics.Gpu.Engine.Dma
|
||||
}
|
||||
|
||||
ReadOnlySpan<byte> srcSpan = memoryManager.GetSpan(srcGpuVa + (ulong)srcBaseOffset, srcSize, true);
|
||||
Span<byte> dstSpan = memoryManager.GetSpan(dstGpuVa + (ulong)dstBaseOffset, dstSize).ToArray();
|
||||
|
||||
bool completeSource = IsTextureCopyComplete(src, srcLinear, srcBpp, srcStride, xCount, yCount);
|
||||
bool completeDest = IsTextureCopyComplete(dst, dstLinear, dstBpp, dstStride, xCount, yCount);
|
||||
@ -262,43 +261,63 @@ namespace Ryujinx.Graphics.Gpu.Engine.Dma
|
||||
target.SynchronizeMemory();
|
||||
target.SetData(data);
|
||||
target.SignalModified();
|
||||
|
||||
return;
|
||||
}
|
||||
else if (srcCalculator.LayoutMatches(dstCalculator))
|
||||
{
|
||||
srcSpan.CopyTo(dstSpan); // No layout conversion has to be performed, just copy the data entirely.
|
||||
|
||||
memoryManager.Write(dstGpuVa + (ulong)dstBaseOffset, dstSpan);
|
||||
|
||||
// No layout conversion has to be performed, just copy the data entirely.
|
||||
memoryManager.Write(dstGpuVa + (ulong)dstBaseOffset, srcSpan);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
unsafe bool Convert<T>(Span<byte> dstSpan, ReadOnlySpan<byte> srcSpan) where T : unmanaged
|
||||
{
|
||||
fixed (byte* dstPtr = dstSpan, srcPtr = srcSpan)
|
||||
if (srcLinear && dstLinear && srcBpp == dstBpp)
|
||||
{
|
||||
byte* dstBase = dstPtr - dstBaseOffset; // Layout offset is relative to the base, so we need to subtract the span's offset.
|
||||
byte* srcBase = srcPtr - srcBaseOffset;
|
||||
|
||||
// Optimized path for purely linear copies - we don't need to calculate every single byte offset,
|
||||
// and we can make use of Span.CopyTo which is very very fast (even compared to pointers)
|
||||
for (int y = 0; y < yCount; y++)
|
||||
{
|
||||
srcCalculator.SetY(srcRegionY + y);
|
||||
dstCalculator.SetY(dstRegionY + y);
|
||||
int srcOffset = srcCalculator.GetOffset(srcRegionX);
|
||||
int dstOffset = dstCalculator.GetOffset(dstRegionX);
|
||||
srcSpan.Slice(srcOffset - srcBaseOffset, xCount * srcBpp)
|
||||
.CopyTo(dstSpan.Slice(dstOffset - dstBaseOffset, xCount * dstBpp));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fixed (byte* dstPtr = dstSpan, srcPtr = srcSpan)
|
||||
{
|
||||
byte* dstBase = dstPtr - dstBaseOffset; // Layout offset is relative to the base, so we need to subtract the span's offset.
|
||||
byte* srcBase = srcPtr - srcBaseOffset;
|
||||
|
||||
for (int x = 0; x < xCount; x++)
|
||||
for (int y = 0; y < yCount; y++)
|
||||
{
|
||||
int srcOffset = srcCalculator.GetOffset(srcRegionX + x);
|
||||
int dstOffset = dstCalculator.GetOffset(dstRegionX + x);
|
||||
srcCalculator.SetY(srcRegionY + y);
|
||||
dstCalculator.SetY(dstRegionY + y);
|
||||
|
||||
*(T*)(dstBase + dstOffset) = *(T*)(srcBase + srcOffset);
|
||||
for (int x = 0; x < xCount; x++)
|
||||
{
|
||||
int srcOffset = srcCalculator.GetOffset(srcRegionX + x);
|
||||
int dstOffset = dstCalculator.GetOffset(dstRegionX + x);
|
||||
|
||||
*(T*)(dstBase + dstOffset) = *(T*)(srcBase + srcOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// OPT: This allocates a (potentially) huge temporary array and then copies an existing
|
||||
// region of memory into it, data that might get overwritten entirely anyways. Ideally this should
|
||||
// all be rewritten to use pooled arrays, but that gets complicated with packed data and strides
|
||||
Span<byte> dstSpan = memoryManager.GetSpan(dstGpuVa + (ulong)dstBaseOffset, dstSize).ToArray();
|
||||
|
||||
bool _ = srcBpp switch
|
||||
{
|
||||
1 => Convert<byte>(dstSpan, srcSpan),
|
||||
|
@ -174,6 +174,14 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
}
|
||||
}
|
||||
|
||||
if (info.Width == info.Height * info.Height)
|
||||
{
|
||||
// Possibly used for a "3D texture" drawn onto a 2D surface.
|
||||
// Some games do this to generate a tone mapping LUT without rendering into 3D texture slices.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
|
||||
private const ushort FileFormatVersionMajor = 1;
|
||||
private const ushort FileFormatVersionMinor = 1;
|
||||
private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor;
|
||||
private const uint CodeGenVersion = 3069;
|
||||
private const uint CodeGenVersion = 3472;
|
||||
|
||||
private const string SharedTocFileName = "shared.toc";
|
||||
private const string SharedDataFileName = "shared.data";
|
||||
|
@ -1,23 +1,21 @@
|
||||
using FFmpeg.AutoGen;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Graphics.Nvdec.FFmpeg.Native;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg
|
||||
{
|
||||
unsafe class FFmpegContext : IDisposable
|
||||
{
|
||||
private readonly AVCodec_decode _decodeFrame;
|
||||
private static readonly av_log_set_callback_callback _logFunc;
|
||||
private readonly FFCodec.AVCodec_decode _decodeFrame;
|
||||
private static readonly FFmpegApi.av_log_set_callback_callback _logFunc;
|
||||
private readonly AVCodec* _codec;
|
||||
private AVPacket* _packet;
|
||||
private AVCodecContext* _context;
|
||||
|
||||
public FFmpegContext(AVCodecID codecId)
|
||||
{
|
||||
_codec = ffmpeg.avcodec_find_decoder(codecId);
|
||||
_codec = FFmpegApi.avcodec_find_decoder(codecId);
|
||||
if (_codec == null)
|
||||
{
|
||||
Logger.Error?.PrintMsg(LogClass.FFmpeg, $"Codec wasn't found. Make sure you have the {codecId} codec present in your FFmpeg installation.");
|
||||
@ -25,7 +23,7 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg
|
||||
return;
|
||||
}
|
||||
|
||||
_context = ffmpeg.avcodec_alloc_context3(_codec);
|
||||
_context = FFmpegApi.avcodec_alloc_context3(_codec);
|
||||
if (_context == null)
|
||||
{
|
||||
Logger.Error?.PrintMsg(LogClass.FFmpeg, "Codec context couldn't be allocated.");
|
||||
@ -33,14 +31,14 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg
|
||||
return;
|
||||
}
|
||||
|
||||
if (ffmpeg.avcodec_open2(_context, _codec, null) != 0)
|
||||
if (FFmpegApi.avcodec_open2(_context, _codec, null) != 0)
|
||||
{
|
||||
Logger.Error?.PrintMsg(LogClass.FFmpeg, "Codec couldn't be opened.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_packet = ffmpeg.av_packet_alloc();
|
||||
_packet = FFmpegApi.av_packet_alloc();
|
||||
if (_packet == null)
|
||||
{
|
||||
Logger.Error?.PrintMsg(LogClass.FFmpeg, "Packet couldn't be allocated.");
|
||||
@ -48,52 +46,39 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg
|
||||
return;
|
||||
}
|
||||
|
||||
_decodeFrame = Marshal.GetDelegateForFunctionPointer<AVCodec_decode>(_codec->decode.Pointer);
|
||||
int avCodecRawVersion = FFmpegApi.avcodec_version();
|
||||
int avCodecMajorVersion = avCodecRawVersion >> 16;
|
||||
int avCodecMinorVersion = (avCodecRawVersion >> 8) & 0xFF;
|
||||
|
||||
// libavcodec 59.24 changed AvCodec to move its private API and also move the codec function to an union.
|
||||
if (avCodecMajorVersion > 59 || (avCodecMajorVersion == 59 && avCodecMinorVersion > 24))
|
||||
{
|
||||
_decodeFrame = Marshal.GetDelegateForFunctionPointer<FFCodec.AVCodec_decode>(((FFCodec*)_codec)->CodecCallback);
|
||||
}
|
||||
// libavcodec 59.x changed AvCodec private API layout.
|
||||
else if (avCodecMajorVersion == 59)
|
||||
{
|
||||
_decodeFrame = Marshal.GetDelegateForFunctionPointer<FFCodec.AVCodec_decode>(((FFCodecLegacy<AVCodec>*)_codec)->Decode);
|
||||
}
|
||||
// libavcodec 58.x and lower
|
||||
else
|
||||
{
|
||||
_decodeFrame = Marshal.GetDelegateForFunctionPointer<FFCodec.AVCodec_decode>(((FFCodecLegacy<AVCodecLegacy>*)_codec)->Decode);
|
||||
}
|
||||
}
|
||||
|
||||
static FFmpegContext()
|
||||
{
|
||||
SetRootPath();
|
||||
|
||||
_logFunc = Log;
|
||||
|
||||
// Redirect log output.
|
||||
ffmpeg.av_log_set_level(ffmpeg.AV_LOG_MAX_OFFSET);
|
||||
ffmpeg.av_log_set_callback(_logFunc);
|
||||
FFmpegApi.av_log_set_level(AVLog.MaxOffset);
|
||||
FFmpegApi.av_log_set_callback(_logFunc);
|
||||
}
|
||||
|
||||
private static void SetRootPath()
|
||||
private static void Log(void* ptr, AVLog level, string format, byte* vl)
|
||||
{
|
||||
if (OperatingSystem.IsLinux())
|
||||
{
|
||||
// Configure FFmpeg search path
|
||||
Process lddProcess = Process.Start(new ProcessStartInfo
|
||||
{
|
||||
FileName = "/bin/sh",
|
||||
Arguments = "-c \"ldd $(which ffmpeg 2>/dev/null) | grep libavfilter\" 2>/dev/null",
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = true
|
||||
});
|
||||
|
||||
string lddOutput = lddProcess.StandardOutput.ReadToEnd();
|
||||
|
||||
lddProcess.WaitForExit();
|
||||
lddProcess.Close();
|
||||
|
||||
if (lddOutput.Contains(" => "))
|
||||
{
|
||||
ffmpeg.RootPath = Path.GetDirectoryName(lddOutput.Split(" => ")[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Error?.PrintMsg(LogClass.FFmpeg, "FFmpeg wasn't found. Make sure that you have it installed and up to date.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void Log(void* p0, int level, string format, byte* vl)
|
||||
{
|
||||
if (level > ffmpeg.av_log_get_level())
|
||||
if (level > FFmpegApi.av_log_get_level())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -102,65 +87,67 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg
|
||||
byte* lineBuffer = stackalloc byte[lineSize];
|
||||
int printPrefix = 1;
|
||||
|
||||
ffmpeg.av_log_format_line(p0, level, format, vl, lineBuffer, lineSize, &printPrefix);
|
||||
FFmpegApi.av_log_format_line(ptr, level, format, vl, lineBuffer, lineSize, &printPrefix);
|
||||
|
||||
string line = Marshal.PtrToStringAnsi((IntPtr)lineBuffer).Trim();
|
||||
|
||||
switch (level)
|
||||
{
|
||||
case ffmpeg.AV_LOG_PANIC:
|
||||
case ffmpeg.AV_LOG_FATAL:
|
||||
case ffmpeg.AV_LOG_ERROR:
|
||||
case AVLog.Panic:
|
||||
case AVLog.Fatal:
|
||||
case AVLog.Error:
|
||||
Logger.Error?.Print(LogClass.FFmpeg, line);
|
||||
break;
|
||||
case ffmpeg.AV_LOG_WARNING:
|
||||
case AVLog.Warning:
|
||||
Logger.Warning?.Print(LogClass.FFmpeg, line);
|
||||
break;
|
||||
case ffmpeg.AV_LOG_INFO:
|
||||
case AVLog.Info:
|
||||
Logger.Info?.Print(LogClass.FFmpeg, line);
|
||||
break;
|
||||
case ffmpeg.AV_LOG_VERBOSE:
|
||||
case ffmpeg.AV_LOG_DEBUG:
|
||||
case ffmpeg.AV_LOG_TRACE:
|
||||
case AVLog.Verbose:
|
||||
case AVLog.Debug:
|
||||
Logger.Debug?.Print(LogClass.FFmpeg, line);
|
||||
break;
|
||||
case AVLog.Trace:
|
||||
Logger.Trace?.Print(LogClass.FFmpeg, line);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public int DecodeFrame(Surface output, ReadOnlySpan<byte> bitstream)
|
||||
{
|
||||
ffmpeg.av_frame_unref(output.Frame);
|
||||
FFmpegApi.av_frame_unref(output.Frame);
|
||||
|
||||
int result;
|
||||
int gotFrame;
|
||||
|
||||
fixed (byte* ptr = bitstream)
|
||||
{
|
||||
_packet->data = ptr;
|
||||
_packet->size = bitstream.Length;
|
||||
_packet->Data = ptr;
|
||||
_packet->Size = bitstream.Length;
|
||||
result = _decodeFrame(_context, output.Frame, &gotFrame, _packet);
|
||||
}
|
||||
|
||||
if (gotFrame == 0)
|
||||
{
|
||||
ffmpeg.av_frame_unref(output.Frame);
|
||||
FFmpegApi.av_frame_unref(output.Frame);
|
||||
|
||||
// If the frame was not delivered, it was probably delayed.
|
||||
// Get the next delayed frame by passing a 0 length packet.
|
||||
_packet->data = null;
|
||||
_packet->size = 0;
|
||||
_packet->Data = null;
|
||||
_packet->Size = 0;
|
||||
result = _decodeFrame(_context, output.Frame, &gotFrame, _packet);
|
||||
|
||||
// We need to set B frames to 0 as we already consumed all delayed frames.
|
||||
// This prevents the decoder from trying to return a delayed frame next time.
|
||||
_context->has_b_frames = 0;
|
||||
_context->HasBFrames = 0;
|
||||
}
|
||||
|
||||
ffmpeg.av_packet_unref(_packet);
|
||||
FFmpegApi.av_packet_unref(_packet);
|
||||
|
||||
if (gotFrame == 0)
|
||||
{
|
||||
ffmpeg.av_frame_unref(output.Frame);
|
||||
FFmpegApi.av_frame_unref(output.Frame);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -172,14 +159,14 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg
|
||||
{
|
||||
fixed (AVPacket** ppPacket = &_packet)
|
||||
{
|
||||
ffmpeg.av_packet_free(ppPacket);
|
||||
FFmpegApi.av_packet_free(ppPacket);
|
||||
}
|
||||
|
||||
ffmpeg.avcodec_close(_context);
|
||||
FFmpegApi.avcodec_close(_context);
|
||||
|
||||
fixed (AVCodecContext** ppContext = &_context)
|
||||
{
|
||||
ffmpeg.avcodec_free_context(ppContext);
|
||||
FFmpegApi.avcodec_free_context(ppContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using FFmpeg.AutoGen;
|
||||
using Ryujinx.Graphics.Nvdec.FFmpeg.Native;
|
||||
using Ryujinx.Graphics.Video;
|
||||
using System;
|
||||
|
||||
|
25
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVCodec.cs
Normal file
25
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVCodec.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||
{
|
||||
struct AVCodec
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
public unsafe byte* Name;
|
||||
public unsafe byte* LongName;
|
||||
public int Type;
|
||||
public AVCodecID Id;
|
||||
public int Capabilities;
|
||||
public byte MaxLowRes;
|
||||
public unsafe AVRational* SupportedFramerates;
|
||||
public IntPtr PixFmts;
|
||||
public IntPtr SupportedSamplerates;
|
||||
public IntPtr SampleFmts;
|
||||
// Deprecated
|
||||
public unsafe ulong* ChannelLayouts;
|
||||
public unsafe IntPtr PrivClass;
|
||||
public IntPtr Profiles;
|
||||
public unsafe byte* WrapperName;
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
}
|
171
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVCodecContext.cs
Normal file
171
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVCodecContext.cs
Normal file
@ -0,0 +1,171 @@
|
||||
using Ryujinx.Common.Memory;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||
{
|
||||
struct AVCodecContext
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
public unsafe IntPtr AvClass;
|
||||
public int LogLevelOffset;
|
||||
public int CodecType;
|
||||
public unsafe AVCodecLegacy* Codec;
|
||||
public AVCodecID CodecId;
|
||||
public uint CodecTag;
|
||||
public IntPtr PrivData;
|
||||
public IntPtr Internal;
|
||||
public IntPtr Opaque;
|
||||
public long BitRate;
|
||||
public int BitRateTolerance;
|
||||
public int GlobalQuality;
|
||||
public int CompressionLevel;
|
||||
public int Flags;
|
||||
public int Flags2;
|
||||
public IntPtr ExtraData;
|
||||
public int ExtraDataSize;
|
||||
public AVRational TimeBase;
|
||||
public int TicksPerFrame;
|
||||
public int Delay;
|
||||
public int Width;
|
||||
public int Height;
|
||||
public int CodedWidth;
|
||||
public int CodedHeight;
|
||||
public int GopSize;
|
||||
public int PixFmt;
|
||||
public IntPtr DrawHorizBand;
|
||||
public IntPtr GetFormat;
|
||||
public int MaxBFrames;
|
||||
public float BQuantFactor;
|
||||
public float BQuantOffset;
|
||||
public int HasBFrames;
|
||||
public float IQuantFactor;
|
||||
public float IQuantOffset;
|
||||
public float LumiMasking;
|
||||
public float TemporalCplxMasking;
|
||||
public float SpatialCplxMasking;
|
||||
public float PMasking;
|
||||
public float DarkMasking;
|
||||
public int SliceCount;
|
||||
public IntPtr SliceOffset;
|
||||
public AVRational SampleAspectRatio;
|
||||
public int MeCmp;
|
||||
public int MeSubCmp;
|
||||
public int MbCmp;
|
||||
public int IldctCmp;
|
||||
public int DiaSize;
|
||||
public int LastPredictorCount;
|
||||
public int MePreCmp;
|
||||
public int PreDiaSize;
|
||||
public int MeSubpelQuality;
|
||||
public int MeRange;
|
||||
public int SliceFlags;
|
||||
public int MbDecision;
|
||||
public IntPtr IntraMatrix;
|
||||
public IntPtr InterMatrix;
|
||||
public int IntraDcPrecision;
|
||||
public int SkipTop;
|
||||
public int SkipBottom;
|
||||
public int MbLmin;
|
||||
public int MbLmax;
|
||||
public int BidirRefine;
|
||||
public int KeyintMin;
|
||||
public int Refs;
|
||||
public int Mv0Threshold;
|
||||
public int ColorPrimaries;
|
||||
public int ColorPrc;
|
||||
public int Colorspace;
|
||||
public int ColorRange;
|
||||
public int ChromaSampleLocation;
|
||||
public int Slices;
|
||||
public int FieldOrder;
|
||||
public int SampleRate;
|
||||
public int Channels;
|
||||
public int SampleFmt;
|
||||
public int FrameSize;
|
||||
public int FrameNumber;
|
||||
public int BlockAlign;
|
||||
public int CutOff;
|
||||
public ulong ChannelLayout;
|
||||
public ulong RequestChannelLayout;
|
||||
public int AudioServiceType;
|
||||
public int RequestSampleFmt;
|
||||
public IntPtr GetBuffer2;
|
||||
public float QCompress;
|
||||
public float QBlur;
|
||||
public int QMin;
|
||||
public int QMax;
|
||||
public int MaxQdiff;
|
||||
public int RcBufferSize;
|
||||
public int RcOverrideCount;
|
||||
public IntPtr RcOverride;
|
||||
public long RcMaxRate;
|
||||
public long RcMinRate;
|
||||
public float RcMax_available_vbv_use;
|
||||
public float RcMin_vbv_overflow_use;
|
||||
public int RcInitialBufferOccupancy;
|
||||
public int Trellis;
|
||||
public IntPtr StatsOut;
|
||||
public IntPtr StatsIn;
|
||||
public int WorkaroundBugs;
|
||||
public int StrictStdCompliance;
|
||||
public int ErrorConcealment;
|
||||
public int Debug;
|
||||
public int ErrRecognition;
|
||||
public long ReorderedOpaque;
|
||||
public IntPtr HwAccel;
|
||||
public IntPtr HwAccelContext;
|
||||
public Array8<ulong> Error;
|
||||
public int DctAlgo;
|
||||
public int IdctAlgo;
|
||||
public int BitsPerCodedSample;
|
||||
public int BitsPerRawSample;
|
||||
public int LowRes;
|
||||
public int ThreadCount;
|
||||
public int ThreadType;
|
||||
public int ActiveThreadType;
|
||||
public int ThreadSafeCallbacks;
|
||||
public IntPtr Execute;
|
||||
public IntPtr Execute2;
|
||||
public int NsseWeight;
|
||||
public int Profile;
|
||||
public int Level;
|
||||
public int SkipLoopFilter;
|
||||
public int SkipIdct;
|
||||
public int SkipFrame;
|
||||
public IntPtr SubtitleHeader;
|
||||
public int SubtitleHeaderSize;
|
||||
public int InitialPadding;
|
||||
public AVRational Framerate;
|
||||
public int SwPixFmt;
|
||||
public AVRational PktTimebase;
|
||||
public IntPtr CodecDescriptor;
|
||||
public long PtsCorrectionNumFaultyPts;
|
||||
public long PtsCorrectionNumFaultyDts;
|
||||
public long PtsCorrectionLastPts;
|
||||
public long PtsCorrectionLastDts;
|
||||
public IntPtr SubCharenc;
|
||||
public int SubCharencMode;
|
||||
public int SkipAlpha;
|
||||
public int SeekPreroll;
|
||||
public int DebugMv;
|
||||
public IntPtr ChromaIntraMatrix;
|
||||
public IntPtr DumpSeparator;
|
||||
public IntPtr CodecWhitelist;
|
||||
public uint Properties;
|
||||
public IntPtr CodedSideData;
|
||||
public int NbCodedSideData;
|
||||
public IntPtr HwFramesCtx;
|
||||
public int SubTextFormat;
|
||||
public int TrailingPadding;
|
||||
public long MaxPixels;
|
||||
public IntPtr HwDeviceCtx;
|
||||
public int HwAccelFlags;
|
||||
public int applyCropping;
|
||||
public int ExtraHwFrames;
|
||||
public int DiscardDamagedPercentage;
|
||||
public long MaxSamples;
|
||||
public int ExportSideData;
|
||||
public IntPtr GetEncodeBuffer;
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
}
|
8
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVCodecID.cs
Normal file
8
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVCodecID.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||
{
|
||||
enum AVCodecID
|
||||
{
|
||||
AV_CODEC_ID_H264 = 27,
|
||||
AV_CODEC_ID_VP8 = 139,
|
||||
}
|
||||
}
|
26
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVCodecLegacy.cs
Normal file
26
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVCodecLegacy.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||
{
|
||||
struct AVCodecLegacy
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
public unsafe byte* Name;
|
||||
public unsafe byte* LongName;
|
||||
public int Type;
|
||||
public AVCodecID Id;
|
||||
public int Capabilities;
|
||||
public byte MaxLowRes;
|
||||
public unsafe AVRational* SupportedFramerates;
|
||||
public IntPtr PixFmts;
|
||||
public IntPtr SupportedSamplerates;
|
||||
public IntPtr SampleFmts;
|
||||
// Deprecated
|
||||
public unsafe ulong* ChannelLayouts;
|
||||
public unsafe IntPtr PrivClass;
|
||||
public IntPtr Profiles;
|
||||
public unsafe byte* WrapperName;
|
||||
public IntPtr ChLayouts;
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
}
|
37
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVFrame.cs
Normal file
37
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVFrame.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using Ryujinx.Common.Memory;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||
{
|
||||
struct AVFrame
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
public Array8<IntPtr> Data;
|
||||
public Array8<int> LineSize;
|
||||
public IntPtr ExtendedData;
|
||||
public int Width;
|
||||
public int Height;
|
||||
public int NumSamples;
|
||||
public int Format;
|
||||
public int KeyFrame;
|
||||
public int PictureType;
|
||||
public AVRational SampleAspectRatio;
|
||||
public long Pts;
|
||||
public long PktDts;
|
||||
public AVRational TimeBase;
|
||||
public int CodedPictureNumber;
|
||||
public int DisplayPictureNumber;
|
||||
public int Quality;
|
||||
public IntPtr Opaque;
|
||||
public int RepeatPicture;
|
||||
public int InterlacedFrame;
|
||||
public int TopFieldFirst;
|
||||
public int PaletteHasChanged;
|
||||
public long ReorderedOpaque;
|
||||
public int SampleRate;
|
||||
public ulong ChannelLayout;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
// NOTE: There is more after, but the layout kind of changed a bit and we don't need more than this. This is safe as we only manipulate this behind a reference.
|
||||
}
|
||||
}
|
15
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVLog.cs
Normal file
15
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVLog.cs
Normal file
@ -0,0 +1,15 @@
|
||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||
{
|
||||
enum AVLog
|
||||
{
|
||||
Panic = 0,
|
||||
Fatal = 8,
|
||||
Error = 16,
|
||||
Warning = 24,
|
||||
Info = 32,
|
||||
Verbose = 40,
|
||||
Debug = 48,
|
||||
Trace = 56,
|
||||
MaxOffset = 64
|
||||
}
|
||||
}
|
26
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVPacket.cs
Normal file
26
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVPacket.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
|
||||
using AVBufferRef = System.IntPtr;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||
{
|
||||
struct AVPacket
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
public unsafe AVBufferRef *Buf;
|
||||
public long Pts;
|
||||
public long Dts;
|
||||
public unsafe byte* Data;
|
||||
public int Size;
|
||||
public int StreamIndex;
|
||||
public int Flags;
|
||||
public IntPtr SizeData;
|
||||
public int SizeDataElems;
|
||||
public long Duration;
|
||||
public long Position;
|
||||
public IntPtr Opaque;
|
||||
public unsafe AVBufferRef *OpaqueRef;
|
||||
public AVRational TimeBase;
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
}
|
8
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVRational.cs
Normal file
8
Ryujinx.Graphics.Nvdec.FFmpeg/Native/AVRational.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||
{
|
||||
public struct AVRational
|
||||
{
|
||||
public int Numerator;
|
||||
public int Denominator;
|
||||
}
|
||||
}
|
23
Ryujinx.Graphics.Nvdec.FFmpeg/Native/FFCodec.cs
Normal file
23
Ryujinx.Graphics.Nvdec.FFmpeg/Native/FFCodec.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||
{
|
||||
struct FFCodec
|
||||
{
|
||||
public unsafe delegate int AVCodec_decode(AVCodecContext* avctx, void* outdata, int* got_frame_ptr, AVPacket* avpkt);
|
||||
|
||||
#pragma warning disable CS0649
|
||||
public AVCodec Base;
|
||||
public int CapsInternalOrCbType;
|
||||
public int PrivDataSize;
|
||||
public IntPtr UpdateThreadContext;
|
||||
public IntPtr UpdateThreadContextForUser;
|
||||
public IntPtr Defaults;
|
||||
public IntPtr InitStaticData;
|
||||
public IntPtr Init;
|
||||
public IntPtr CodecCallback;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
// NOTE: There is more after, but the layout kind of changed a bit and we don't need more than this. This is safe as we only manipulate this behind a reference.
|
||||
}
|
||||
}
|
23
Ryujinx.Graphics.Nvdec.FFmpeg/Native/FFCodecLegacy.cs
Normal file
23
Ryujinx.Graphics.Nvdec.FFmpeg/Native/FFCodecLegacy.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||
{
|
||||
struct FFCodecLegacy<T> where T: struct
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
public T Base;
|
||||
public uint CapsInternalOrCbType;
|
||||
public int PrivDataSize;
|
||||
public IntPtr UpdateThreadContext;
|
||||
public IntPtr UpdateThreadContextForUser;
|
||||
public IntPtr Defaults;
|
||||
public IntPtr InitStaticData;
|
||||
public IntPtr Init;
|
||||
public IntPtr EncodeSub;
|
||||
public IntPtr Encode2;
|
||||
public IntPtr Decode;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
// NOTE: There is more after, but the layout kind of changed a bit and we don't need more than this. This is safe as we only manipulate this behind a reference.
|
||||
}
|
||||
}
|
129
Ryujinx.Graphics.Nvdec.FFmpeg/Native/FFmpegApi.cs
Normal file
129
Ryujinx.Graphics.Nvdec.FFmpeg/Native/FFmpegApi.cs
Normal file
@ -0,0 +1,129 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||
{
|
||||
static class FFmpegApi
|
||||
{
|
||||
public const string AvCodecLibraryName = "avcodec";
|
||||
public const string AvUtilLibraryName = "avutil";
|
||||
|
||||
private static readonly Dictionary<string, (int, int)> _librariesWhitelist = new Dictionary<string, (int, int)>
|
||||
{
|
||||
{ AvCodecLibraryName, (58, 59) },
|
||||
{ AvUtilLibraryName, (56, 57) }
|
||||
};
|
||||
|
||||
private static string FormatLibraryNameForCurrentOs(string libraryName, int version)
|
||||
{
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
return $"{libraryName}-{version}.dll";
|
||||
}
|
||||
else if (OperatingSystem.IsLinux())
|
||||
{
|
||||
return $"lib{libraryName}.so.{version}";
|
||||
}
|
||||
else if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
return $"lib{libraryName}.{version}.dylib";
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException($"Unsupported OS for FFmpeg: {RuntimeInformation.RuntimeIdentifier}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static bool TryLoadWhitelistedLibrary(string libraryName, Assembly assembly, DllImportSearchPath? searchPath, out IntPtr handle)
|
||||
{
|
||||
handle = IntPtr.Zero;
|
||||
|
||||
if (_librariesWhitelist.TryGetValue(libraryName, out var value))
|
||||
{
|
||||
(int minVersion, int maxVersion) = value;
|
||||
|
||||
for (int version = maxVersion; version >= minVersion; version--)
|
||||
{
|
||||
if (NativeLibrary.TryLoad(FormatLibraryNameForCurrentOs(libraryName, version), assembly, searchPath, out handle))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static FFmpegApi()
|
||||
{
|
||||
NativeLibrary.SetDllImportResolver(typeof(FFmpegApi).Assembly, (name, assembly, path) =>
|
||||
{
|
||||
IntPtr handle;
|
||||
|
||||
if (name == AvUtilLibraryName && TryLoadWhitelistedLibrary(AvUtilLibraryName, assembly, path, out handle))
|
||||
{
|
||||
return handle;
|
||||
}
|
||||
else if (name == AvCodecLibraryName && TryLoadWhitelistedLibrary(AvCodecLibraryName, assembly, path, out handle))
|
||||
{
|
||||
return handle;
|
||||
}
|
||||
|
||||
return IntPtr.Zero;
|
||||
});
|
||||
}
|
||||
|
||||
public unsafe delegate void av_log_set_callback_callback(void* a0, AVLog level, [MarshalAs(UnmanagedType.LPUTF8Str)] string a2, byte* a3);
|
||||
|
||||
[DllImport(AvUtilLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern AVFrame* av_frame_alloc();
|
||||
|
||||
[DllImport(AvUtilLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern void av_frame_unref(AVFrame* frame);
|
||||
|
||||
[DllImport(AvUtilLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern void av_free(AVFrame* frame);
|
||||
|
||||
[DllImport(AvUtilLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern void av_log_set_level(AVLog level);
|
||||
|
||||
[DllImport(AvUtilLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern void av_log_set_callback(av_log_set_callback_callback callback);
|
||||
|
||||
[DllImport(AvUtilLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern AVLog av_log_get_level();
|
||||
|
||||
[DllImport(AvUtilLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern void av_log_format_line(void* ptr, AVLog level, [MarshalAs(UnmanagedType.LPUTF8Str)] string fmt, byte* vl, byte* line, int lineSize, int* printPrefix);
|
||||
|
||||
[DllImport(AvCodecLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern AVCodec* avcodec_find_decoder(AVCodecID id);
|
||||
|
||||
[DllImport(AvCodecLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern AVCodecContext* avcodec_alloc_context3(AVCodec* codec);
|
||||
|
||||
[DllImport(AvCodecLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern int avcodec_open2(AVCodecContext* avctx, AVCodec* codec, void **options);
|
||||
|
||||
[DllImport(AvCodecLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern int avcodec_close(AVCodecContext* avctx);
|
||||
|
||||
[DllImport(AvCodecLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern void avcodec_free_context(AVCodecContext** avctx);
|
||||
|
||||
[DllImport(AvCodecLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern AVPacket* av_packet_alloc();
|
||||
|
||||
[DllImport(AvCodecLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern void av_packet_unref(AVPacket* pkt);
|
||||
|
||||
[DllImport(AvCodecLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern void av_packet_free(AVPacket** pkt);
|
||||
|
||||
[DllImport(AvCodecLibraryName, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static unsafe extern int avcodec_version();
|
||||
}
|
||||
}
|
@ -1,14 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FFmpeg.AutoGen" Version="4.4.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Ryujinx.Common\Ryujinx.Common.csproj" />
|
||||
<ProjectReference Include="..\Ryujinx.Graphics.Video\Ryujinx.Graphics.Video.csproj" />
|
||||
|
@ -1,4 +1,4 @@
|
||||
using FFmpeg.AutoGen;
|
||||
using Ryujinx.Graphics.Nvdec.FFmpeg.Native;
|
||||
using Ryujinx.Graphics.Video;
|
||||
using System;
|
||||
|
||||
@ -11,31 +11,31 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg
|
||||
public int RequestedWidth { get; }
|
||||
public int RequestedHeight { get; }
|
||||
|
||||
public Plane YPlane => new Plane((IntPtr)Frame->data[0], Stride * Height);
|
||||
public Plane UPlane => new Plane((IntPtr)Frame->data[1], UvStride * UvHeight);
|
||||
public Plane VPlane => new Plane((IntPtr)Frame->data[2], UvStride * UvHeight);
|
||||
public Plane YPlane => new Plane((IntPtr)Frame->Data[0], Stride * Height);
|
||||
public Plane UPlane => new Plane((IntPtr)Frame->Data[1], UvStride * UvHeight);
|
||||
public Plane VPlane => new Plane((IntPtr)Frame->Data[2], UvStride * UvHeight);
|
||||
|
||||
public FrameField Field => Frame->interlaced_frame != 0 ? FrameField.Interlaced : FrameField.Progressive;
|
||||
public FrameField Field => Frame->InterlacedFrame != 0 ? FrameField.Interlaced : FrameField.Progressive;
|
||||
|
||||
public int Width => Frame->width;
|
||||
public int Height => Frame->height;
|
||||
public int Stride => Frame->linesize[0];
|
||||
public int Width => Frame->Width;
|
||||
public int Height => Frame->Height;
|
||||
public int Stride => Frame->LineSize[0];
|
||||
public int UvWidth => (Width + 1) >> 1;
|
||||
public int UvHeight => (Height + 1) >> 1;
|
||||
public int UvStride => Frame->linesize[1];
|
||||
public int UvStride => Frame->LineSize[1];
|
||||
|
||||
public Surface(int width, int height)
|
||||
{
|
||||
RequestedWidth = width;
|
||||
RequestedHeight = height;
|
||||
|
||||
Frame = ffmpeg.av_frame_alloc();
|
||||
Frame = FFmpegApi.av_frame_alloc();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
ffmpeg.av_frame_unref(Frame);
|
||||
ffmpeg.av_free(Frame);
|
||||
FFmpegApi.av_frame_unref(Frame);
|
||||
FFmpegApi.av_free(Frame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using FFmpeg.AutoGen;
|
||||
using Ryujinx.Graphics.Nvdec.FFmpeg.Native;
|
||||
using Ryujinx.Graphics.Video;
|
||||
using System;
|
||||
|
||||
|
@ -92,7 +92,11 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||
pushOpInfo.Consumers.Add(rightBlock, local);
|
||||
}
|
||||
|
||||
rightBlock.SyncTargets.Union(SyncTargets);
|
||||
foreach ((ulong key, SyncTarget value) in SyncTargets)
|
||||
{
|
||||
rightBlock.SyncTargets.Add(key, value);
|
||||
}
|
||||
|
||||
SyncTargets.Clear();
|
||||
|
||||
// Move push ops.
|
||||
|
@ -340,7 +340,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||
{
|
||||
InstConditional condOp = new InstConditional(op.RawOpCode);
|
||||
|
||||
if (op.Name == InstName.Exit && condOp.Ccc != Ccc.T)
|
||||
if ((op.Name == InstName.Bra || op.Name == InstName.Exit) && condOp.Ccc != Ccc.T)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -672,6 +672,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||
// Make sure we found the correct address,
|
||||
// the push and pop instruction types must match, so:
|
||||
// - BRK can only consume addresses pushed by PBK.
|
||||
// - CONT can only consume addresses pushed by PCNT.
|
||||
// - SYNC can only consume addresses pushed by SSY.
|
||||
if (found)
|
||||
{
|
||||
|
@ -45,12 +45,12 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
||||
if (isFP64)
|
||||
{
|
||||
return context.PackDouble2x32(
|
||||
context.Config.CreateCbuf(cbufSlot, cbufOffset),
|
||||
context.Config.CreateCbuf(cbufSlot, cbufOffset + 1));
|
||||
Cbuf(cbufSlot, cbufOffset),
|
||||
Cbuf(cbufSlot, cbufOffset + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
return context.Config.CreateCbuf(cbufSlot, cbufOffset);
|
||||
return Cbuf(cbufSlot, cbufOffset);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -300,6 +300,11 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
||||
|
||||
if (operand.Type != OperandType.LocalVariable)
|
||||
{
|
||||
if (operand.Type == OperandType.ConstantBuffer)
|
||||
{
|
||||
Config.SetUsedConstantBuffer(operand.GetCbufSlot());
|
||||
}
|
||||
|
||||
return new AstOperand(operand);
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
||||
{
|
||||
Operand addrLow = operation.GetSource(0);
|
||||
|
||||
Operand baseAddrLow = config.CreateCbuf(0, GetStorageCbOffset(config.Stage, storageIndex));
|
||||
Operand baseAddrLow = Cbuf(0, GetStorageCbOffset(config.Stage, storageIndex));
|
||||
|
||||
Operand baseAddrTrunc = Local();
|
||||
|
||||
@ -152,7 +152,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
||||
{
|
||||
Operand addrLow = operation.GetSource(0);
|
||||
|
||||
Operand baseAddrLow = config.CreateCbuf(0, UbeBaseOffset + storageIndex * StorageDescSize);
|
||||
Operand baseAddrLow = Cbuf(0, UbeBaseOffset + storageIndex * StorageDescSize);
|
||||
|
||||
Operand baseAddrTrunc = Local();
|
||||
|
||||
|
@ -45,6 +45,11 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
||||
|
||||
if (!(node.Value is Operation operation) || isUnused)
|
||||
{
|
||||
if (node.Value is PhiNode phi && !isUnused)
|
||||
{
|
||||
isUnused = PropagatePhi(phi);
|
||||
}
|
||||
|
||||
if (isUnused)
|
||||
{
|
||||
RemoveNode(block, node);
|
||||
@ -101,6 +106,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
||||
{
|
||||
// Propagate copy source operand to all uses of
|
||||
// the destination operand.
|
||||
|
||||
Operand dest = copyOp.Dest;
|
||||
Operand src = copyOp.GetSource(0);
|
||||
|
||||
@ -118,6 +124,53 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
||||
}
|
||||
}
|
||||
|
||||
private static bool PropagatePhi(PhiNode phi)
|
||||
{
|
||||
// If all phi sources are the same, we can propagate it and remove the phi.
|
||||
|
||||
Operand firstSrc = phi.GetSource(0);
|
||||
|
||||
for (int index = 1; index < phi.SourcesCount; index++)
|
||||
{
|
||||
if (!IsSameOperand(firstSrc, phi.GetSource(index)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// All sources are equal, we can propagate the value.
|
||||
|
||||
Operand dest = phi.Dest;
|
||||
|
||||
INode[] uses = dest.UseOps.ToArray();
|
||||
|
||||
foreach (INode useNode in uses)
|
||||
{
|
||||
for (int index = 0; index < useNode.SourcesCount; index++)
|
||||
{
|
||||
if (useNode.GetSource(index) == dest)
|
||||
{
|
||||
useNode.SetSource(index, firstSrc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static bool IsSameOperand(Operand x, Operand y)
|
||||
{
|
||||
if (x.Type != y.Type || x.Value != y.Value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return x.Type == OperandType.Attribute ||
|
||||
x.Type == OperandType.AttributePerPatch ||
|
||||
x.Type == OperandType.Constant ||
|
||||
x.Type == OperandType.ConstantBuffer;
|
||||
}
|
||||
|
||||
private static bool PropagatePack(Operation packOp)
|
||||
{
|
||||
// Propagate pack source operands to uses by unpack
|
||||
|
@ -75,9 +75,9 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||
|
||||
int cbOffset = GetStorageCbOffset(config.Stage, slot);
|
||||
|
||||
Operand baseAddrLow = config.CreateCbuf(0, cbOffset);
|
||||
Operand baseAddrHigh = config.CreateCbuf(0, cbOffset + 1);
|
||||
Operand size = config.CreateCbuf(0, cbOffset + 2);
|
||||
Operand baseAddrLow = Cbuf(0, cbOffset);
|
||||
Operand baseAddrHigh = Cbuf(0, cbOffset + 1);
|
||||
Operand size = Cbuf(0, cbOffset + 2);
|
||||
|
||||
Operand offset = PrependOperation(Instruction.Subtract, addrLow, baseAddrLow);
|
||||
Operand borrow = PrependOperation(Instruction.CompareLessU32, addrLow, baseAddrLow);
|
||||
@ -164,7 +164,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||
|
||||
bool isBindless = (texOp.Flags & TextureFlags.Bindless) != 0;
|
||||
|
||||
bool isCoordNormalized = !isBindless && config.GpuAccessor.QueryTextureCoordNormalized(texOp.Handle, texOp.CbufSlot);
|
||||
bool isCoordNormalized = isBindless || config.GpuAccessor.QueryTextureCoordNormalized(texOp.Handle, texOp.CbufSlot);
|
||||
|
||||
if (!hasInvalidOffset && isCoordNormalized)
|
||||
{
|
||||
|
@ -360,12 +360,6 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||
UsedFeatures |= flags;
|
||||
}
|
||||
|
||||
public Operand CreateCbuf(int slot, int offset)
|
||||
{
|
||||
SetUsedConstantBuffer(slot);
|
||||
return OperandHelper.Cbuf(slot, offset);
|
||||
}
|
||||
|
||||
public void SetUsedConstantBuffer(int slot)
|
||||
{
|
||||
_usedConstantBuffers |= 1 << slot;
|
||||
|
@ -184,18 +184,35 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
|
||||
|
||||
public LinuxError Receive(out int receiveSize, Span<byte> buffer, BsdSocketFlags flags)
|
||||
{
|
||||
LinuxError result;
|
||||
|
||||
bool shouldBlockAfterOperation = false;
|
||||
|
||||
try
|
||||
{
|
||||
if (Blocking && flags.HasFlag(BsdSocketFlags.DontWait))
|
||||
{
|
||||
Blocking = false;
|
||||
shouldBlockAfterOperation = true;
|
||||
}
|
||||
|
||||
receiveSize = Socket.Receive(buffer, ConvertBsdSocketFlags(flags));
|
||||
|
||||
return LinuxError.SUCCESS;
|
||||
result = LinuxError.SUCCESS;
|
||||
}
|
||||
catch (SocketException exception)
|
||||
{
|
||||
receiveSize = -1;
|
||||
|
||||
return WinSockHelper.ConvertError((WsaError)exception.ErrorCode);
|
||||
result = WinSockHelper.ConvertError((WsaError)exception.ErrorCode);
|
||||
}
|
||||
|
||||
if (shouldBlockAfterOperation)
|
||||
{
|
||||
Blocking = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public LinuxError ReceiveFrom(out int receiveSize, Span<byte> buffer, int size, BsdSocketFlags flags, out IPEndPoint remoteEndPoint)
|
||||
@ -304,7 +321,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
|
||||
return LinuxError.EOPNOTSUPP;
|
||||
}
|
||||
|
||||
int value = MemoryMarshal.Read<int>(optionValue);
|
||||
int value = optionValue.Length >= 4 ? MemoryMarshal.Read<int>(optionValue) : MemoryMarshal.Read<byte>(optionValue);
|
||||
|
||||
if (option == BsdSocketOption.SoLinger)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
@ -6,13 +6,11 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Version>1.0.0-dirty</Version>
|
||||
<TieredCompilation>false</TieredCompilation>
|
||||
<TieredCompilationQuickJit>false</TieredCompilationQuickJit>
|
||||
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="4.4.0-build7" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'osx-x64'" />
|
||||
<PackageReference Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.1-build10" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'osx-x64'" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -6,8 +6,6 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Version>1.0.0-dirty</Version>
|
||||
<TieredCompilation>false</TieredCompilation>
|
||||
<TieredCompilationQuickJit>false</TieredCompilationQuickJit>
|
||||
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
|
||||
<!-- As we already provide GTK3 on Windows via GtkSharp.Dependencies this is redundant. -->
|
||||
<SkipGtkInstall>true</SkipGtkInstall>
|
||||
@ -21,7 +19,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="GtkSharp" Version="3.22.25.128" />
|
||||
<PackageReference Include="GtkSharp.Dependencies" Version="1.1.1" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'osx-x64'" />
|
||||
<PackageReference Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="4.4.0-build9" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'osx-x64'" />
|
||||
<PackageReference Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.1-build10" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'osx-x64'" />
|
||||
<PackageReference Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'osx-x64'" />
|
||||
<PackageReference Include="OpenTK.Graphics" Version="4.7.2" />
|
||||
<PackageReference Include="SPB" Version="0.0.4-build17" />
|
||||
|
@ -1509,7 +1509,7 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="_internetToggle">
|
||||
<property name="label" translatable="yes">Enable guest Internet access</property>
|
||||
<property name="label" translatable="yes">Enable Guest Internet Access</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
@ -1643,7 +1643,7 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="_mmHostUnsafe">
|
||||
<property name="label" translatable="yes">Host unchecked (fastest, unsafe)</property>
|
||||
<property name="label" translatable="yes">Host Unchecked (fastest, unsafe)</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
@ -1725,7 +1725,7 @@
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="margin-bottom">5</property>
|
||||
<property name="label" translatable="yes"> - These may cause instability</property>
|
||||
<property name="label" translatable="yes"> (may cause instability)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@ -1749,7 +1749,7 @@
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="_expandRamToggle">
|
||||
<property name="label" translatable="yes">Expand DRAM size to 6GB</property>
|
||||
<property name="label" translatable="yes">Expand DRAM Size to 6GB</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
|
Reference in New Issue
Block a user