private BannerManager() { this._bannerIconGroups = new List <BannerIconGroup>(); this._colorPalette = new Dictionary <int, BannerColor>(); this.BannerIconGroups = this._bannerIconGroups.GetReadOnlyList <BannerIconGroup>(); this.ReadOnlyColorPalette = this._colorPalette.GetReadOnlyDictionary <int, BannerColor>(); }
private static void LoadFunctionsOnLanguageChange(string languageId) { MBTextManager.TextContext.ResetFunctions(); MBReadOnlyDictionary <string, string> functionsOfLanguage = LocalizedTextManager.GetFunctionsOfLanguage(languageId); if (functionsOfLanguage == null) { return; } foreach (KeyValuePair <string, string> keyValuePair in functionsOfLanguage) { MBTextManager.SetFunction(keyValuePair.Key, keyValuePair.Value); } }
public void Deserialize(XmlNode xmlNode) { this._allIcons = new Dictionary <int, BannerIconData>(); this._availableIcons = new Dictionary <int, BannerIconData>(); this._allBackgrounds = new Dictionary <int, string>(); this.AllIcons = new MBReadOnlyDictionary <int, BannerIconData>(this._allIcons); this.AvailableIcons = new MBReadOnlyDictionary <int, BannerIconData>(this._availableIcons); this.AllBackgrounds = new MBReadOnlyDictionary <int, string>(this._allBackgrounds); this.Id = Convert.ToInt32(xmlNode.Attributes["id"].Value); this.Name = new TextObject(xmlNode.Attributes["name"].Value); this.IsPattern = Convert.ToBoolean(xmlNode.Attributes["is_pattern"].Value); foreach (XmlNode childNode in xmlNode.ChildNodes) { if (childNode.Name == "Icon") { int int32 = Convert.ToInt32(childNode.Attributes["id"].Value); string materialName = childNode.Attributes["material_name"].Value; int textureIndex = int.Parse(childNode.Attributes["texture_index"].Value); if (!this._allIcons.ContainsKey(int32)) { this._allIcons.Add(int32, new BannerIconData(materialName, textureIndex)); } if (childNode.Attributes["is_reserved"] == null || !Convert.ToBoolean(childNode.Attributes["is_reserved"].Value)) { this._availableIcons.Add(int32, new BannerIconData(materialName, textureIndex)); } } else if (childNode.Name == "Background") { int int32 = Convert.ToInt32(childNode.Attributes["id"].Value); string str = childNode.Attributes["mesh_name"].Value; if (childNode.Attributes["is_base_background"] != null && Convert.ToBoolean(childNode.Attributes["is_base_background"].Value)) { BannerManager.Instance.SetBaseBackgroundId(int32); } if (!this._allBackgrounds.ContainsKey(int32)) { this._allBackgrounds.Add(int32, str); } } } }