Esempio n. 1
0
    protected override void OnCompleteWork(Worker worker)
    {
        base.OnCompleteWork(worker);
        assignable.Unassign();
        MinionResume component = worker.GetComponent <MinionResume>();

        if ((Object)component != (Object)null)
        {
            component.ResetSkillLevels(true);
            component.SetHats(component.CurrentHat, null);
            component.ApplyTargetHat();
            notification = new Notification(MISC.NOTIFICATIONS.RESETSKILL.NAME, NotificationType.Good, HashedString.Invalid, (List <Notification> notificationList, object data) => MISC.NOTIFICATIONS.RESETSKILL.TOOLTIP + notificationList.ReduceMessages(false), null, true, 0f, null, null, null);
            worker.GetComponent <Notifier>().Add(notification, string.Empty);
        }
    }
Esempio n. 2
0
    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);
                }
            }
        }
    }
Esempio n. 3
0
    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");
            }
        }
    }