예제 #1
0
 public static void ActivateLocale(string localeCode, ContentManager content)
 {
     if (localeCode == "en-us")
     {
         LocaleTerms.ClearForEnUS();
     }
     else
     {
         string str1 = "Content/Locales/" + localeCode + "/UI_Terms.txt";
         string path = "Content/Locales/" + localeCode + "/Hacknet_UI_Terms.txt";
         if (!File.Exists(str1))
         {
             if (!File.Exists(path))
             {
                 throw new NotSupportedException("Locale " + localeCode + " does not exist or is not supported");
             }
             str1 = path;
         }
         LocaleTerms.ReadInTerms(str1, true);
         if (DLC1SessionUpgrader.HasDLC1Installed)
         {
             string str2 = "Content/Locales/" + localeCode + "/DLC/Hacknet_UI_Terms.txt";
             if (File.Exists(str2))
             {
                 LocaleTerms.ReadInTerms(str2, false);
             }
         }
     }
     Settings.ActiveLocale = localeCode;
     LocaleFontLoader.LoadFontConfigForLocale(localeCode, content);
     FileEntry.init(content);
 }
예제 #2
0
 public static void LoadFontConfigForLocale(string locale, ContentManager content)
 {
     if (!GuiData.LocaleFontConfigs.ContainsKey(locale))
     {
         GuiData.LocaleFontConfigs.Add(locale, LocaleFontLoader.LoadFontConfigSetForLocale(locale, "", content));
     }
     GuiData.ActivateFontConfig(GuiData.ActiveFontConfig.name);
     GuiData.UITinyfont  = GuiData.LocaleFontConfigs[locale][0].tinyFont;
     GuiData.UISmallfont = GuiData.LocaleFontConfigs[locale][0].smallFont;
 }