public void Refresh() { if (minion != null) { portrait.SetIdentityObject(minion, true); string empty = string.Empty; MinionIdentity minionIdentity = minion as MinionIdentity; hatDropDown.gameObject.SetActive(true); if ((Object)minionIdentity != (Object)null) { MinionResume component = minionIdentity.GetComponent <MinionResume>(); int availableSkillpoints = component.AvailableSkillpoints; int totalSkillPointsGained = component.TotalSkillPointsGained; masteryPoints.text = ((availableSkillpoints <= 0) ? "0" : GameUtil.ApplyBoldString(GameUtil.ColourizeString(new Color(0.5f, 1f, 0.5f, 1f), availableSkillpoints.ToString()))); AttributeInstance attributeInstance = Db.Get().Attributes.QualityOfLife.Lookup(component); AttributeInstance attributeInstance2 = Db.Get().Attributes.QualityOfLifeExpectation.Lookup(component); morale.text = $"{attributeInstance.GetTotalValue()}/{attributeInstance2.GetTotalValue()}"; RefreshToolTip(component); List <IListableOption> list = new List <IListableOption>(); foreach (KeyValuePair <string, bool> item in component.MasteryBySkillID) { if (item.Value) { list.Add(new SkillListable(item.Key)); } } hatDropDown.Initialize(list, OnHatDropEntryClick, hatDropDownSort, hatDropEntryRefreshAction, false, minion); empty = ((!string.IsNullOrEmpty(component.TargetHat)) ? component.TargetHat : component.CurrentHat); } else { StoredMinionIdentity storedMinionIdentity = minion as StoredMinionIdentity; ToolTip component2 = GetComponent <ToolTip>(); component2.ClearMultiStringTooltip(); component2.AddMultiStringTooltip(string.Format(UI.TABLESCREENS.INFORMATION_NOT_AVAILABLE_TOOLTIP, storedMinionIdentity.GetStorageReason(), minion.GetProperName()), null); empty = ((!string.IsNullOrEmpty(storedMinionIdentity.targetHat)) ? storedMinionIdentity.targetHat : storedMinionIdentity.currentHat); masteryPoints.text = UI.TABLESCREENS.NA; morale.text = UI.TABLESCREENS.NA; } SetColor((skillsScreen.CurrentlySelectedMinion != minion) ? unselected_color : selected_color); HierarchyReferences component3 = GetComponent <HierarchyReferences>(); RefreshHat(empty); component3.GetReference("openButton").gameObject.SetActive((Object)minionIdentity != (Object)null); } }
private string HoverChangeRowPriorityButton(object widget_go_obj, int delta) { GameObject widget_go = widget_go_obj as GameObject; LocString locString = null; LocString locString2 = null; string text = null; TableRow widgetRow = GetWidgetRow(widget_go); switch (widgetRow.rowType) { case TableRow.RowType.Header: Debug.Assert(false); return(null); case TableRow.RowType.Default: locString = UI.JOBSSCREEN.INCREASE_ROW_PRIORITY_NEW_MINION_TOOLTIP; locString2 = UI.JOBSSCREEN.DECREASE_ROW_PRIORITY_NEW_MINION_TOOLTIP; break; case TableRow.RowType.Minion: locString = UI.JOBSSCREEN.INCREASE_ROW_PRIORITY_MINION_TOOLTIP; locString2 = UI.JOBSSCREEN.DECREASE_ROW_PRIORITY_MINION_TOOLTIP; text = widgetRow.GetIdentity().GetProperName(); break; case TableRow.RowType.StoredMinon: { StoredMinionIdentity storedMinionIdentity = widgetRow.GetIdentity() as StoredMinionIdentity; if ((UnityEngine.Object)storedMinionIdentity != (UnityEngine.Object)null) { return(string.Format(UI.JOBSSCREEN.CANNOT_ADJUST_PRIORITY, storedMinionIdentity.GetProperName(), storedMinionIdentity.GetStorageReason())); } break; } } LocString locString3 = (delta <= 0) ? locString2 : locString; string text2 = locString3.ToString(); if (text != null) { text2 = text2.Replace("{Name}", text); } return(text2); }
private void StoredMinionTooltip(IAssignableIdentity minion, ToolTip tooltip) { StoredMinionIdentity storedMinionIdentity = minion as StoredMinionIdentity; if ((UnityEngine.Object)storedMinionIdentity != (UnityEngine.Object)null) { tooltip.AddMultiStringTooltip(string.Format(UI.TABLESCREENS.INFORMATION_NOT_AVAILABLE_TOOLTIP, storedMinionIdentity.GetStorageReason(), storedMinionIdentity.GetProperName()), null); } }