Exemplo n.º 1
0
        static void BillInterfaceCard(Bill __instance)
        {
            SyncBillSuspended.Watch(__instance);
            SyncBillSkillRange.Watch(__instance);
            SyncIngredientSearchRadius.Watch(__instance);

            SyncBillProduction.Watch(__instance);
        }
Exemplo n.º 2
0
 static void HealthCardUtility(Pawn pawn)
 {
     if (pawn.playerSettings != null)
     {
         SyncMedCare.Watch(pawn);
         SyncSelfTend.Watch(pawn);
     }
 }
Exemplo n.º 3
0
        private static void PreFillTab(ITab __instance, ref object[] __state)
        {
            if (MP.IsInMultiplayer)
            {
                __state = new object[2];

                var soul = pawnSoulITabSoulToShowGetter.Invoke(__instance, Array.Empty <object>());

                if (soul != null)
                {
                    MP.WatchBegin();
                    var prayerTracker = compSoulPrayerTrackerField(soul);
                    prayerTrackerAllowPrayingSync.Watch(prayerTracker);
                    prayerTrackerShowPrayerSync.Watch(prayerTracker);
                    __state[0] = true;


                    var favourTracker = compSoulFavourTrackerField(soul);
                    var favoursList   = soulFavourTrackerFavoursField(favourTracker);

                    var favorValues = new float[favoursList.Count];
                    for (var i = 0; i < favoursList.Count; i++)
                    {
                        favorValues[i] = favourProgressFavourValueField(favoursList[i]);
                    }

                    __state[1] = favorValues;
                }
                else
                {
                    __state[0] = false;
                }
            }
        }
Exemplo n.º 4
0
        static void WatchPrefix(ITab_Pawn_Visitor __instance)
        {
            if (MP.IsInMultiplayer)
            {
                MP.WatchBegin();

                Pawn pawn = __instance.SelPawn;

                object comp = GetCompMethod.Invoke(pawn, null);

                _chat.Watch(comp);
                _recruit.Watch(comp);
                _arrived.Watch(comp);
                _sentAway.Watch(comp);

                _areaGuest.Watch(comp);
                _areaShop.Watch(comp);

                object worldComp = GetMapCompMethod.Invoke(null, new object[] { pawn.Map });

                _defMode.Watch(worldComp);
                _defAreaGuest.Watch(worldComp);
                _defAreaShop.Watch(worldComp);
            }
        }
 // UGLY UGLY this is so UGLY! Yet... it works.
 static void CaptureTheMemory(object __result)
 {
     if (watching)
     {
         primaryWeaponModeSyncField.Watch(__result);
     }
 }
Exemplo n.º 6
0
 static void WatchBillPaused(Bill __instance)
 {
     if (__instance is Bill_Production)
     {
         SyncBillPaused.Watch(__instance);
     }
 }
Exemplo n.º 7
0
 static void CheckboxLabeled()
 {
     // Watched here to get reset asap and not trigger any side effects
     if (SyncMarkers.manualPriorities)
     {
         SyncUseWorkPriorities.Watch();
     }
 }
Exemplo n.º 8
0
 static void PsychicEntropyLimiterToggle(PsychicEntropyGizmo __instance)
 {
     if (__instance?.tracker?.Pawn != null)
     {
         SyncPsychicEntropyLimit.Watch(__instance.tracker.Pawn);
         SyncPsychicEntropyTargetFocus.Watch(__instance.tracker.pawn);
     }
 }
 // Used to watch for changes to the temple name
 private static void RenameTemplePrefix(Building ___Altar)
 {
     if (MP.enabled)
     {
         MP.WatchBegin();
         altarNameSyncField.Watch(___Altar);
     }
 }
 private static void PreSyncBombType(ThingComp __instance)
 {
     if (MP.IsInMultiplayer)
     {
         MP.WatchBegin();
         bombTypeSync.Watch(__instance);
     }
 }
Exemplo n.º 11
0
        private static void PreDoHeader()
        {
            if (!MP.IsInMultiplayer)
            {
                return;
            }

            MP.WatchBegin();
            foreach (var syncField in syncDefaultCare)
            {
                syncField.Watch();
            }
            foreach (var pawn in mainTabGetter().table.PawnsListForReading)
            {
                syncMedCare.Watch(pawn);
            }
        }
Exemplo n.º 12
0
        static void ITab_Pawn_Visitor(ITab __instance)
        {
            Pawn pawn = __instance.SelPawn;

            SyncMedCare.Watch(pawn);
            SyncInteractionMode.Watch(pawn);
            SyncSlaveInteractionMode.Watch(pawn);
            SyncIdeoForConversion.Watch(pawn);
        }
 private static void CommonSensePatchPrefix(Thing thing)
 {
     if (MP.IsInMultiplayer)
     {
         MP.WatchBegin();
         var comp = getCompUnlockerCheckerMethod.Invoke(null, new object[] { thing, false, false });
         shouldUnloadSyncField.Watch(comp);
     }
 }
Exemplo n.º 14
0
        static void DrawLockPrefix(object __instance, object handler)
        {
            if (MP.IsInMultiplayer)
            {
                MP.WatchBegin();

                autoLockOnManualSwapSyncField.Watch(handler);
            }
        }
Exemplo n.º 15
0
        public static void Watch(ref ExtendedOutfit outfit)
        {
            selectedOutfitId = outfit.uniqueId;

            targetTemperaturesOverride.Watch(outfit);
            targetTemperatures.Watch(outfit);
            PenaltyWornByCorpse.Watch(outfit);
            AutoWorkPriorities.Watch(outfit);
            selectedStatPrioritySF.Watch(Instance);
        }
Exemplo n.º 16
0
        static void Dialog_RewardPrefsConfigPatches()
        {
            IEnumerable <Faction> visibleInViewOrder = Find.FactionManager.AllFactionsVisibleInViewOrder;

            foreach (Faction faction in visibleInViewOrder)
            {
                SyncFactionAcceptRoyalFavor.Watch(faction);
                SyncFactionAcceptGoodwill.Watch(faction);
            }
        }
Exemplo n.º 17
0
        private static void PreDoHeader(PawnTable table)
        {
            if (!MP.IsInMultiplayer)
            {
                return;
            }

            MP.WatchBegin();
            foreach (var pawn in table.PawnsListForReading)
            {
                var comp = pawn.comps.FirstOrDefault(c => c.GetType() == compHandlerSettingsType);
                if (comp == null)
                {
                    continue;
                }
                modeField.Watch(comp);
                levelField.Watch(comp);
            }
        }
        private static void PreDoWindowContents(Window __instance)
        {
            if (!MP.IsInMultiplayer)
            {
                return;
            }

            MP.WatchBegin();
            newFacepaintComboSync.Watch(__instance);
            coloursTiedSync.Watch();
        }
Exemplo n.º 19
0
        static void TransferableAdjustTo(Transferable trad)
        {
            var session = MpTradeSession.current ??
                          (Multiplayer.Client != null ? Multiplayer.WorldComp.splitSession : null) ??
                          (ISessionWithTransferables)CaravanFormingProxy.drawing?.Session ??
                          TransporterLoadingProxy.drawing?.Session;

            if (session != null)
            {
                SyncTradeableCount.Watch(new MpTransferableReference(session, trad));
            }
        }
Exemplo n.º 20
0
        private static void PreDrawOptions()
        {
            if (!MP.IsInMultiplayer)
            {
                return;
            }

            MP.WatchBegin();
            var target = medicalCareField();

            diseaseMarginField.Watch(target);
            minorWoundsThresholdField.Watch(target);
            diseaseThresholdField.Watch(target);
        }
        private static void PrePsykerDoWindowContents(Window __instance, ref object[] __state)
        {
            if (MP.IsInMultiplayer)
            {
                var comp = psykerWindowCompField.GetValue(__instance);
                // SyncField
                MP.WatchBegin();
                compPsykerXpSyncField.Watch(comp);

                // Copy all the currently learned minor disciplines, we'll check later if there were any changes
                var list = (IList)compPsykerMinorDisciplinesField.GetValue(comp);
                __state = new object[list.Count];
                list.CopyTo(__state, 0);
            }
        }
Exemplo n.º 22
0
        static void WatchPolicyLabels()
        {
            if (SyncMarkers.dialogOutfit != null)
            {
                SyncOutfitLabel.Watch(SyncMarkers.dialogOutfit.Outfit);
            }

            if (SyncMarkers.drugPolicy != null)
            {
                SyncDrugPolicyLabel.Watch(SyncMarkers.drugPolicy);
            }

            if (SyncMarkers.foodRestriction != null)
            {
                SyncFoodRestrictionLabel.Watch(SyncMarkers.foodRestriction.Food);
            }
        }
Exemplo n.º 23
0
        static void DialogBillConfig(Dialog_BillConfig __instance)
        {
            Bill_Production bill = __instance.bill;

            SyncBillSuspended.Watch(bill);
            SyncBillSkillRange.Watch(bill);
            SyncIngredientSearchRadius.Watch(bill);

            SyncBillProduction.Watch(bill);

            if (bill.recipe.ProducedThingDef != null)
            {
                SyncBillIncludeCriteria.Watch(bill);
                SyncBillIncludeHpRange.Watch(bill);
                SyncBillIncludeQualityRange.Watch(bill);
            }
        }
Exemplo n.º 24
0
 static void PlaySettingsControls()
 {
     SyncAutoHomeArea.Watch();
     SyncAutoRebuild.Watch();
 }
Exemplo n.º 25
0
 static void WatchDryadCaste(Dialog_ChangeDryadCaste __instance)
 {
     SyncDryadCaste.Watch(__instance.treeConnection);
 }
Exemplo n.º 26
0
 static void WatchTreeConnectionStrength(Gizmo_PruningConfig __instance)
 {
     SyncDesiredTreeConnectionStrength.Watch(__instance.connection);
 }
Exemplo n.º 27
0
 static void DrawAutoCutOptions(CompAnimalPenMarker marker)
 {
     SyncAnimalPenAutocut.Watch(marker);
 }
Exemplo n.º 28
0
 [MpPrefix(typeof(Command_SetNeuralSuperchargerAutoUse), nameof(Command_SetNeuralSuperchargerAutoUse.ProcessInput), 2)] // Set to use for everyone
 static void WatchNeuralSuperchargerMode(Command_SetNeuralSuperchargerAutoUse __instance)
 {
     SyncNeuralSuperchargerMode.Watch(__instance.comp);
 }
Exemplo n.º 29
0
 static void CaravanHealthDoRow(Pawn p)
 {
     SyncBeCarried.Watch(p);
 }
Exemplo n.º 30
0
 static void RenameZone(Dialog_RenameZone __instance)
 {
     SyncZoneLabel.Watch(__instance.zone);
 }