示例#1
0
            public static void Postfix(BuildingStatusItems __instance)
            {
                // Building cords
                Z.coordinates = new StatusItem("ZCoordinates", "ZTRANSPORT", "",
                                               StatusItem.IconType.Info,
                                               NotificationType.Neutral,
                                               false,
                                               OverlayModes.None.ID);
                Z.coordinates.resolveStringCallback = (str, data) => {
                    int          x, y;
                    ZTransporter transporter = (ZTransporter)data;
                    Grid.CellToXY(Grid.PosToCell(transporter), out x, out y);
                    return(str.Replace("{X}", x.ToString())
                           .Replace("{Y}", y.ToString()));
                };
                __instance.Add(Z.coordinates);


                // Connected status
                Z.notConnected = new StatusItem("ZNotConnected",
                                                "ZTRANSPORT", "",
                                                StatusItem.IconType.Exclamation,
                                                NotificationType.BadMinor,
                                                false,
                                                OverlayModes.None.ID);
                Z.notConnected.resolveStringCallback = (str, data) => {
                    string ererrroroor = (string)data;
                    return(str.Replace("{REASON}", ererrroroor));
                };
                Z.notConnected.AddNotification();
                __instance.Add(Z.notConnected);


                // Drop box sending status
                Z.dropBoxSending = new StatusItem("ZDropBoxStatus",
                                                  "ZTRANSPORT", "",
                                                  StatusItem.IconType.Info,
                                                  NotificationType.Neutral,
                                                  false,
                                                  OverlayModes.None.ID);
                Z.dropBoxSending.resolveStringCallback = (str, data) => {
                    int object_count = (int)data;
                    return(str.Replace("{COUNT}", object_count.ToString()));
                };
                __instance.Add(Z.dropBoxSending);
            }
    public override void Initialize()
    {
        base.Initialize();
        Urges                  = new Urges();
        AssignableSlots        = new AssignableSlots();
        StateMachineCategories = new StateMachineCategories();
        Personalities          = new Personalities();
        Faces                  = new Faces();
        Shirts                 = new Shirts();
        Expressions            = new Expressions(Root);
        Thoughts               = new Thoughts(Root);
        Deaths                 = new Deaths(Root);
        StatusItemCategories   = new StatusItemCategories(Root);
        Techs                  = new Techs(Root);
        Techs.Load(researchTreeFile);
        TechTreeTitles = new TechTreeTitles(Root);
        TechTreeTitles.Load(researchTreeFile);
        TechItems             = new TechItems(Root);
        Accessories           = new Accessories(Root);
        AccessorySlots        = new AccessorySlots(Root, null, null, null);
        ScheduleBlockTypes    = new ScheduleBlockTypes(Root);
        ScheduleGroups        = new ScheduleGroups(Root);
        RoomTypeCategories    = new RoomTypeCategories(Root);
        RoomTypes             = new RoomTypes(Root);
        ArtifactDropRates     = new ArtifactDropRates(Root);
        SpaceDestinationTypes = new SpaceDestinationTypes(Root);
        Diseases            = new Diseases(Root);
        Sicknesses          = new Database.Sicknesses(Root);
        SkillPerks          = new SkillPerks(Root);
        SkillGroups         = new SkillGroups(Root);
        Skills              = new Skills(Root);
        ColonyAchievements  = new ColonyAchievements(Root);
        MiscStatusItems     = new MiscStatusItems(Root);
        CreatureStatusItems = new CreatureStatusItems(Root);
        BuildingStatusItems = new BuildingStatusItems(Root);
        ChoreTypes          = new ChoreTypes(Root);
        Effect effect = new Effect("CenterOfAttention", DUPLICANTS.MODIFIERS.CENTEROFATTENTION.NAME, DUPLICANTS.MODIFIERS.CENTEROFATTENTION.TOOLTIP, 0f, true, true, false, null, 0f, null);

        effect.Add(new AttributeModifier("StressDelta", -0.008333334f, DUPLICANTS.MODIFIERS.CENTEROFATTENTION.NAME, false, false, true));
        effects.Add(effect);
        CollectResources(Root, ResourceTable);
    }
 static void Postfix(BuildingStatusItems __instance)
 {
     __instance.Pipe.resolveStringCallback = delegate(string str, object data)
     {
         Conduit obj   = (Conduit)data;
         int     cell2 = Grid.PosToCell(obj);
         ConduitFlow.ConduitContents contents2 = obj.GetFlowManager().GetContents(cell2);
         string text3 = BUILDING.STATUSITEMS.PIPECONTENTS.EMPTY;
         if (contents2.mass > 0f)
         {
             Element element3 = ElementLoader.FindElementByHash(contents2.element);
             text3 = string.Format(BUILDING.STATUSITEMS.PIPECONTENTS.CONTENTS, GameUtil.GetFormattedMass(contents2.mass), element3.name, GameUtil.GetFormattedTemperature(contents2.temperature));
             if (contents2.diseaseIdx != byte.MaxValue)
             {
                 text3 += string.Format(BUILDING.STATUSITEMS.PIPECONTENTS.CONTENTS_WITH_DISEASE, GameUtil.GetFormattedDisease(contents2.diseaseIdx, contents2.diseaseCount, color: true));
             }
         }
         str = str.Replace("{Contents}", text3);
         return(str);
     };
 }