示例#1
0
    public override string GetTooltip(Attribute master, AttributeInstance instance)
    {
        string            tooltip           = base.GetTooltip(master, instance);
        AttributeInstance attributeInstance = Db.Get().Attributes.QualityOfLifeExpectation.Lookup(instance.gameObject);

        tooltip = tooltip + "\n\n" + string.Format(DUPLICANTS.ATTRIBUTES.QUALITYOFLIFE.TOOLTIP_EXPECTATION, GetFormattedValue(attributeInstance.GetTotalDisplayValue(), GameUtil.TimeSlice.None, instance.gameObject));
        float num = instance.GetTotalDisplayValue() - attributeInstance.GetTotalDisplayValue();

        if (!(num >= 0f))
        {
            return(tooltip + "\n\n" + DUPLICANTS.ATTRIBUTES.QUALITYOFLIFE.TOOLTIP_EXPECTATION_UNDER);
        }
        return(tooltip + "\n\n" + DUPLICANTS.ATTRIBUTES.QUALITYOFLIFE.TOOLTIP_EXPECTATION_OVER);
    }
 public override string GetFormattedAttribute(AttributeInstance instance)
 {
     return(GetFormattedValue(instance.GetTotalDisplayValue(), GameUtil.TimeSlice.None, instance.gameObject));
 }
    private void ShowMinimumMoraleRequirement(bool success, ColonyAchievementRequirement req)
    {
        MinimumMorale minimumMorale = req as MinimumMorale;

        if (minimumMorale != null)
        {
            if (success)
            {
                ShowRequirement(success, req);
            }
            else
            {
                IEnumerator enumerator = Components.MinionAssignablesProxy.GetEnumerator();
                try
                {
                    while (enumerator.MoveNext())
                    {
                        MinionAssignablesProxy minionAssignablesProxy = (MinionAssignablesProxy)enumerator.Current;
                        GameObject             targetGameObject       = minionAssignablesProxy.GetTargetGameObject();
                        if ((UnityEngine.Object)targetGameObject != (UnityEngine.Object)null && !targetGameObject.HasTag(GameTags.Dead))
                        {
                            AttributeInstance attributeInstance = Db.Get().Attributes.QualityOfLife.Lookup(targetGameObject.GetComponent <MinionModifiers>());
                            if (attributeInstance != null)
                            {
                                HierarchyReferences nextRequirementWidget = GetNextRequirementWidget();
                                if (attributeInstance.GetTotalValue() >= (float)minimumMorale.minimumMorale)
                                {
                                    SetIcon(statusSuccessIcon, Color.green, nextRequirementWidget);
                                }
                                else
                                {
                                    ShowIcon(false, nextRequirementWidget);
                                }
                                SetDescription(string.Format(COLONY_ACHIEVEMENTS.MISC_REQUIREMENTS.STATUS.MORALE, targetGameObject.GetProperName(), attributeInstance.GetTotalDisplayValue()), nextRequirementWidget);
                            }
                        }
                    }
                }
                finally
                {
                    IDisposable disposable;
                    if ((disposable = (enumerator as IDisposable)) != null)
                    {
                        disposable.Dispose();
                    }
                }
            }
        }
    }
示例#4
0
    public override string GetFormattedAttribute(AttributeInstance instance)
    {
        AttributeInstance attributeInstance = Db.Get().Attributes.QualityOfLifeExpectation.Lookup(instance.gameObject);

        return(string.Format(DUPLICANTS.ATTRIBUTES.QUALITYOFLIFE.DESC_FORMAT, GetFormattedValue(instance.GetTotalDisplayValue(), GameUtil.TimeSlice.None, instance.gameObject), GetFormattedValue(attributeInstance.GetTotalDisplayValue(), GameUtil.TimeSlice.None, instance.gameObject)));
    }