public void AddCharacterButton(JamJSONCharacterEntry charData, string subRegion, string realmName, bool online) { this.m_characterEntry = charData; GameObject gameObject = Object.Instantiate <GameObject>(this.charListItemPrefab); gameObject.transform.SetParent(this.charListContents.transform, false); CharacterListButton component = gameObject.GetComponent <CharacterListButton>(); component.SetGUID(charData.PlayerGuid); component.m_characterEntry = charData; component.m_subRegion = subRegion; Sprite sprite = GeneralHelpers.LoadClassIcon((int)charData.ClassID); if (sprite != null) { component.m_characterClassIcon.sprite = sprite; } component.m_characterName.text = charData.Name; bool flag = online; if (!charData.HasMobileAccess) { component.m_subtext.text = StaticDB.GetString("REQUIRES_CLASS_HALL", null); component.m_subtext.color = Color.red; flag = false; } else if (realmName == "unknown") { component.m_subtext.text = string.Empty; flag = false; } else { if (online) { component.m_subtext.text = realmName; } else { component.m_subtext.text = realmName + " (" + StaticDB.GetString("OFFLINE", null) + ")"; } component.m_subtext.color = Color.yellow; } component.m_subtext.gameObject.SetActive(true); if (!flag) { Button component2 = gameObject.GetComponent <Button>(); component2.interactable = false; component.m_characterName.color = Color.grey; component.m_characterLevel.color = Color.grey; } int num = (int)charData.ExperienceLevel; if (num < 1) { num = 1; } component.m_characterLevel.text = GeneralHelpers.TextOrderString(CharacterListView.m_levelText, num.ToString()); }
public void AddCharacterButton(JamJSONCharacterEntry charData, string subRegion, string realmName, bool online) { this.m_characterEntry = charData; GameObject gameObject = Object.Instantiate <GameObject>(this.charListItemPrefab); gameObject.get_transform().SetParent(this.charListContents.get_transform(), false); CharacterListButton component = gameObject.GetComponent <CharacterListButton>(); component.SetGUID(charData.PlayerGuid); component.m_characterEntry = charData; component.m_subRegion = subRegion; Sprite sprite = GeneralHelpers.LoadClassIcon((int)charData.ClassID); if (sprite != null) { component.m_characterClassIcon.set_sprite(sprite); } component.m_characterName.set_text(charData.Name); bool flag = online; if (!charData.HasMobileAccess) { component.m_missingRequirement.set_text(StaticDB.GetString("REQUIRES_CLASS_HALL", null)); component.m_missingRequirement.set_color(Color.get_red()); flag = false; } else if (realmName == "unknown") { component.m_missingRequirement.set_text(string.Empty); flag = false; } else { if (online) { component.m_missingRequirement.set_text(realmName); } else { component.m_missingRequirement.set_text(realmName + " (" + StaticDB.GetString("OFFLINE", null) + ")"); } component.m_missingRequirement.set_color(Color.get_yellow()); } component.m_missingRequirement.get_gameObject().SetActive(true); if (!flag) { Button component2 = gameObject.GetComponent <Button>(); component2.set_interactable(false); component.m_characterName.set_color(Color.get_grey()); component.m_characterLevel.set_color(Color.get_grey()); } int num = (int)charData.ExperienceLevel; if (num < 1) { num = 1; } component.m_characterLevel.set_text(GeneralHelpers.TextOrderString(CharacterListView.m_levelText, num.ToString())); }
public void AddCharacterButton(JamJSONCharacterEntry charData, string subRegion, string realmName, bool online) { if (this.m_characterListPanel != null) { this.m_characterListPanel.m_characterListView.AddCharacterButton(charData, subRegion, realmName, online); } if (this.m_characterListPopup != null) { this.m_characterListPopup.m_characterListView.AddCharacterButton(charData, subRegion, realmName, online); } }
public void CopyCharacterEntry(JamJSONCharacterEntry characterEntry) { this.PlayerGuid = characterEntry.PlayerGuid; this.CharacterName = characterEntry.Name; this.LastActiveTime = characterEntry.LastActiveTime; this.HasMobileAccess = characterEntry.HasMobileAccess; this.RaceID = characterEntry.RaceID; this.SexID = characterEntry.SexID; this.VirtualRealmAddress = characterEntry.VirtualRealmAddress; this.CommunityID = characterEntry.CommunityID; this.Level = (int)characterEntry.ExperienceLevel; }