private void DrawGeneralRefreshAndLanguageOptions()
 {
     GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
     {
         if (DGUI.Button.Dynamic.DrawIconButton(Styles.GetStyle(Styles.StyleName.IconFaMagic), UILabels.Refresh, Size.S, TextAlign.Left, DGUI.Colors.DarkOrLightColorName, DGUI.Colors.LightOrDarkColorName, DGUI.Properties.SingleLineHeight + DGUI.Properties.Space(2), false))
         {
             DoozyAssetsProcessor.Run();
             DGUI.Properties.ExitGUI();
         }
         GUILayout.FlexibleSpace();
         GUI.enabled = false;
         {
             DGUI.Icon.Draw(Styles.GetStyle(Styles.StyleName.IconFaLanguage), 28, DGUI.Properties.SingleLineHeight, DGUI.Colors.LightOrDarkColorName);
             Engine.Language currentLanguage = LanguagePack.CurrentLanguage;
             EditorGUI.BeginChangeCheck();
             GUILayout.BeginVertical();
             GUILayout.Space(0);
             currentLanguage = (Engine.Language)EditorGUILayout.EnumPopup(currentLanguage, GUILayout.Width(DGUI.Properties.DefaultFieldWidth * 3));
             GUILayout.EndVertical();
             if (EditorGUI.EndChangeCheck())
             {
                 if (currentLanguage != Engine.Language.Unknown)
                 {
                     LanguagePack.CurrentLanguage = currentLanguage;
                 }
             }
         }
         GUI.enabled = true;
     }
     GUILayout.EndHorizontal();
 }
Exemplo n.º 2
0
 private void DrawGeneralLanguageOption()
 {
     GUI.enabled = false;
     GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
     {
         GUILayout.FlexibleSpace();
         DGUI.Icon.Draw(Styles.GetStyle(Styles.StyleName.IconFaLanguage), 28, DGUI.Properties.SingleLineHeight, DGUI.Colors.LightOrDarkColorName);
         Engine.Language currentLanguage = LanguagePack.CurrentLanguage;
         EditorGUI.BeginChangeCheck();
         GUILayout.BeginVertical();
         GUILayout.Space(0);
         currentLanguage = (Engine.Language)EditorGUILayout.EnumPopup(currentLanguage, GUILayout.Width(DGUI.Properties.DefaultFieldWidth * 3));
         GUILayout.EndVertical();
         if (EditorGUI.EndChangeCheck())
         {
             if (currentLanguage != Engine.Language.Unknown)
             {
                 LanguagePack.CurrentLanguage = currentLanguage;
             }
         }
     }
     GUILayout.EndHorizontal();
     GUI.enabled = true;
 }
Exemplo n.º 3
0
 private static void SaveLanguagePreference(string prefsKey, Engine.Language language)
 {
     PlayerPrefs.SetInt(prefsKey, (int)language);
     PlayerPrefs.Save();
 }
Exemplo n.º 4
0
 private static void SaveLanguagePreference(Engine.Language language)
 {
     SaveLanguagePreference(CURRENT_LANGUAGE_PREFS_KEY, language);
 }