コード例 #1
0
    public void UpdateName(GameObject representedObject)
    {
        Entry entry = GetEntry(representedObject);

        if (entry != null)
        {
            KSelectable component = representedObject.GetComponent <KSelectable>();
            entry.display_go.name = component.GetProperName() + " character overlay";
            LocText componentInChildren = entry.display_go.GetComponentInChildren <LocText>();
            if ((UnityEngine.Object)componentInChildren != (UnityEngine.Object)null)
            {
                componentInChildren.text = component.GetProperName();
                if ((UnityEngine.Object)representedObject.GetComponent <RocketModule>() != (UnityEngine.Object)null)
                {
                    componentInChildren.text = representedObject.GetComponent <RocketModule>().GetParentRocketName();
                }
            }
        }
    }
コード例 #2
0
        private string ResolveString(string str, object data)
        {
            if (smi == null)
            {
                Debug.LogWarning("Attempting to resolve string when smi is null");
                return(str);
            }
            KSelectable component = base.gameObject.GetComponent <KSelectable>();

            str = str.Replace("{Descriptor}", string.Format(DUPLICANTS.DISEASES.STATUS_ITEM_TOOLTIP.DESCRIPTOR, Strings.Get("STRINGS.DUPLICANTS.DISEASES.SEVERITY." + modifier.severity.ToString().ToUpper()), Strings.Get("STRINGS.DUPLICANTS.DISEASES.TYPE." + modifier.sicknessType.ToString().ToUpper())));
            str = str.Replace("{Infectee}", component.GetProperName());
            str = str.Replace("{InfectionSource}", string.Format(DUPLICANTS.DISEASES.STATUS_ITEM_TOOLTIP.INFECTION_SOURCE, exposureInfo.sourceInfo));
            if (modifier.severity <= Sickness.Severity.Minor)
            {
                str = str.Replace("{Duration}", string.Format(DUPLICANTS.DISEASES.STATUS_ITEM_TOOLTIP.DURATION, GameUtil.GetFormattedCycles(GetInfectedTimeRemaining(), "F1")));
            }
            else if (modifier.severity == Sickness.Severity.Major)
            {
                str = str.Replace("{Duration}", string.Format(DUPLICANTS.DISEASES.STATUS_ITEM_TOOLTIP.DURATION, GameUtil.GetFormattedCycles(GetInfectedTimeRemaining(), "F1")));
                str = (IsDoctored ? str.Replace("{Doctor}", DUPLICANTS.DISEASES.STATUS_ITEM_TOOLTIP.DOCTORED) : str.Replace("{Doctor}", DUPLICANTS.DISEASES.STATUS_ITEM_TOOLTIP.BEDREST));
            }
            else if (modifier.severity >= Sickness.Severity.Critical)
            {
                if (!IsDoctored)
                {
                    str = str.Replace("{Duration}", string.Format(DUPLICANTS.DISEASES.STATUS_ITEM_TOOLTIP.FATALITY, GameUtil.GetFormattedCycles(GetFatalityTimeRemaining(), "F1")));
                    str = str.Replace("{Doctor}", DUPLICANTS.DISEASES.STATUS_ITEM_TOOLTIP.DOCTOR_REQUIRED);
                }
                else
                {
                    str = str.Replace("{Duration}", string.Format(DUPLICANTS.DISEASES.STATUS_ITEM_TOOLTIP.DURATION, GameUtil.GetFormattedCycles(GetInfectedTimeRemaining(), "F1")));
                    str = str.Replace("{Doctor}", DUPLICANTS.DISEASES.STATUS_ITEM_TOOLTIP.DOCTORED);
                }
            }
            List <Descriptor> symptoms = modifier.GetSymptoms();
            string            text     = string.Empty;

            foreach (Descriptor item in symptoms)
            {
                Descriptor current = item;
                if (!string.IsNullOrEmpty(text))
                {
                    text += "\n";
                }
                text = text + "    • " + current.text;
            }
            str = str.Replace("{Symptoms}", text);
            str = Regex.Replace(str, "{[^}]*}", string.Empty);
            return(str);
        }
コード例 #3
0
    public Notification CreateOverheatedNotification()
    {
        KSelectable component = GetComponent <KSelectable>();

        return(new Notification(MISC.NOTIFICATIONS.BUILDINGOVERHEATED.NAME, NotificationType.BadMinor, HashedString.Invalid, (List <Notification> notificationList, object data) => MISC.NOTIFICATIONS.BUILDINGOVERHEATED.TOOLTIP + notificationList.ReduceMessages(false), "/t• " + component.GetProperName(), false, 0f, null, null, null));
    }
コード例 #4
0
    public Notification CreateDamageNotification()
    {
        KSelectable component = GetComponent <KSelectable>();

        return(new Notification(BUILDING.STATUSITEMS.ANGERDAMAGE.NOTIFICATION, NotificationType.BadMinor, HashedString.Invalid, (List <Notification> notificationList, object data) => BUILDING.STATUSITEMS.ANGERDAMAGE.NOTIFICATION_TOOLTIP + notificationList.ReduceMessages(false), component.GetProperName(), false, 0f, null, null, null));
    }