0
0
Fork 0

System Language can be configurable. (#535)

This commit is contained in:
WilliamWsyHK 2018-12-27 23:08:34 +08:00 committed by emmauss
parent 5d14040e66
commit 5b029ae7a2
3 changed files with 23 additions and 3 deletions

View file

@ -54,8 +54,6 @@ namespace Ryujinx.HLE.HOS.SystemState
public SystemStateMgr() public SystemStateMgr()
{ {
SetLanguage(SystemLanguage.AmericanEnglish);
SetAudioOutputAsBuiltInSpeaker(); SetAudioOutputAsBuiltInSpeaker();
_profiles = new ConcurrentDictionary<string, UserProfile>(); _profiles = new ConcurrentDictionary<string, UserProfile>();
@ -71,7 +69,20 @@ namespace Ryujinx.HLE.HOS.SystemState
{ {
DesiredLanguageCode = GetLanguageCode((int)language); DesiredLanguageCode = GetLanguageCode((int)language);
DesiredTitleLanguage = Enum.Parse<TitleLanguage>(Enum.GetName(typeof(SystemLanguage), language)); switch (language)
{
case SystemLanguage.Taiwanese:
case SystemLanguage.TraditionalChinese:
DesiredTitleLanguage = TitleLanguage.Taiwanese;
break;
case SystemLanguage.Chinese:
case SystemLanguage.SimplifiedChinese:
DesiredTitleLanguage = TitleLanguage.Chinese;
break;
default:
DesiredTitleLanguage = Enum.Parse<TitleLanguage>(Enum.GetName(typeof(SystemLanguage), language));
break;
}
} }
public void SetAudioOutputAsTv() public void SetAudioOutputAsTv()

View file

@ -1,6 +1,7 @@
using LibHac; using LibHac;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.HLE; using Ryujinx.HLE;
using Ryujinx.HLE.HOS.SystemState;
using Ryujinx.HLE.Input; using Ryujinx.HLE.Input;
using Ryujinx.UI.Input; using Ryujinx.UI.Input;
using System; using System;
@ -61,6 +62,10 @@ namespace Ryujinx
} }
} }
SystemLanguage SetLanguage = Enum.Parse<SystemLanguage>(parser.Value("System_Language"));
device.System.State.SetLanguage(SetLanguage);
device.System.State.DockedMode = Convert.ToBoolean(parser.Value("Docked_Mode")); device.System.State.DockedMode = Convert.ToBoolean(parser.Value("Docked_Mode"));
device.EnableDeviceVsync = Convert.ToBoolean(parser.Value("Enable_Vsync")); device.EnableDeviceVsync = Convert.ToBoolean(parser.Value("Enable_Vsync"));

View file

@ -22,6 +22,10 @@ Logging_Enable_Error = true
#Filtered log classes, seperated by ", ", eg. `Logging_Filtered_Classes = Loader, ServiceFS` #Filtered log classes, seperated by ", ", eg. `Logging_Filtered_Classes = Loader, ServiceFS`
Logging_Filtered_Classes = Logging_Filtered_Classes =
#System Language list: https://gist.github.com/HorrorTroll/b6e4a88d774c3c9b3bdf54d79a7ca43b
#Change System Language
System_Language = AmericanEnglish
#Enable or Disable Docked Mode #Enable or Disable Docked Mode
Docked_Mode = false Docked_Mode = false