public static void Initialize() { var settingsDB = PlayerSettingsDB.Get(); bool loaded = settingsDB.Load(); if (loaded) { settingsDB.SaveBackup(); } else { Logger.WriteLine("Warning: failed to load player settings!"); } if (!string.IsNullOrEmpty(settingsDB.forcedLanguage)) { LocalizationDB.SetCurrentUserLanguage(settingsDB.forcedLanguage); } if (settingsDB.useXInput) { XInputStub.StartPolling(); } CloudStorage = new GoogleDriveService( GoogleClientIdentifiers.Keys, new GoogleOAuth2.Token() { refreshToken = settingsDB.cloudToken }); }
public void SetTextByLangugage() { if (text == null) { return; } LocalizationDB data = DatabaseLoader.Instance.GetLanguage(key); if (data == null) { return; } int languageKey = PlayerPrefs.GetInt(PlayerPrefKeys.LanguageKey, (int)LanguageType.Korean); //한글 if (languageKey == 0) { text.font = Language.Instance.KoreanFont; text.text = data.Korean; if (SetTextBigger == true) { text.fontSize = originTextSize + 15; } if (FixPosition == false) { this.transform.localPosition = originPosition + Vector3.up * 10f; } } //영어 else { text.font = Language.Instance.EnglishFont; text.text = data.English; if (SetTextSmaller == true) { text.fontSize = originTextSize - 15; } else { text.fontSize = originTextSize; } this.transform.localPosition = originPosition; } }
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { LocalizationDB database = LocalizationDB.Instance; if (!database) { Debug.LogWarning("Couldn't find LocalizationDB. This is normal if the projects opens for the first time. Otherwise check if LocalizationDS exists."); return; } var settings = database.GetImportSettings(); if (!settings.InitForImport()) { Debug.LogWarning("Input folder and/or output folder not set for Localization import!", database); return; } //TODO: handle deleted and moved assets: HandleImportedAssets(importedAssets, settings); database.ReloadCurrentLanguage(); }
private bool LoadAssets() { bool bResult = false; try { var resManager = new ResourceManager("FFTriadBuddy.Properties.Resources", Assembly.GetExecutingAssembly()); var assets = (byte[])resManager.GetObject("assets"); if (AssetManager.Get().Init(assets)) { LocalizationDB.SetCurrentUserLanguage(CultureInfo.CurrentCulture.Name); bResult = TriadCardDB.Get().Load(); bResult = bResult && TriadNpcDB.Get().Load(); bResult = bResult && ImageHashDB.Get().Load(); bResult = bResult && TriadTournamentDB.Get().Load(); bResult = bResult && LocalizationDB.Get().Load(); if (bResult) { SettingsModel.Initialize(); IconDB.Get().Load(); ModelProxyDB.Get().Load(); TriadGameSession.StaticInitialize(); } } } catch (Exception ex) { Logger.WriteLine("Init failed: " + ex); bResult = false; } return(bResult); }
private void OpenLocaFile() { LocalizationDB.OpenLocaFileAtRawPath(_path); }