private void OnHatDropEntryClick(IListableOption skill, object data) { MinionIdentity minionIdentity = currentlySelectedMinion as MinionIdentity; if (!((UnityEngine.Object)minionIdentity == (UnityEngine.Object)null)) { MinionResume component = minionIdentity.GetComponent <MinionResume>(); string s = "hat_role_none"; if (skill != null) { selectedHat.sprite = Assets.GetSprite((skill as SkillListable).skillHat); if ((UnityEngine.Object)component != (UnityEngine.Object)null) { s = (skill as SkillListable).skillHat; component.SetHats(component.CurrentHat, s); if (component.OwnsHat(s)) { new PutOnHatChore(component, Db.Get().ChoreTypes.SwitchHat); } } } else { selectedHat.sprite = Assets.GetSprite(s); if ((UnityEngine.Object)component != (UnityEngine.Object)null) { component.SetHats(component.CurrentHat, null); component.ApplyTargetHat(); } } foreach (SkillMinionWidget minionWidget in minionWidgets) { if (minionWidget.minion == currentlySelectedMinion) { minionWidget.RefreshHat(component.TargetHat); } } } }
private void OnHatDropEntryClick(IListableOption skill, object data) { MinionIdentity minionIdentity = minion as MinionIdentity; if (!((Object)minionIdentity == (Object)null)) { MinionResume component = minionIdentity.GetComponent <MinionResume>(); if (skill != null) { HierarchyReferences component2 = GetComponent <HierarchyReferences>(); component2.GetReference("selectedHat").GetComponent <Image>().sprite = Assets.GetSprite((skill as SkillListable).skillHat); if ((Object)component != (Object)null) { string skillHat = (skill as SkillListable).skillHat; component.SetHats(component.CurrentHat, skillHat); if (component.OwnsHat(skillHat)) { new PutOnHatChore(component, Db.Get().ChoreTypes.SwitchHat); } } } else { HierarchyReferences component3 = GetComponent <HierarchyReferences>(); component3.GetReference("selectedHat").GetComponent <Image>().sprite = Assets.GetSprite("hat_role_none"); if ((Object)component != (Object)null) { component.SetHats(component.CurrentHat, null); component.ApplyTargetHat(); } } if (minion == skillsScreen.CurrentlySelectedMinion) { skillsScreen.selectedHat.sprite = Assets.GetSprite((!string.IsNullOrEmpty(component.TargetHat)) ? component.TargetHat : "hat_role_none"); } } }