Esempio n. 1
0
        //Saving game
        public override void ExposeData()
        {
            base.ExposeData();

            //  Scribe_Deep.LookDeep(ref shieldField, "shieldField");

            Scribe_Values.LookValue(ref m_BlockIndirect_Active, "m_BlockIndirect_Active");
            Scribe_Values.LookValue(ref m_BlockDirect_Active, "m_BlockDirect_Active");
            Scribe_Values.LookValue(ref m_FireSupression_Active, "m_FireSupression_Active");
            Scribe_Values.LookValue(ref m_RepairMode_Active, "m_RepairMode_Active");
            Scribe_Values.LookValue(ref m_ShowVisually_Active, "m_ShowVisually_Active");
            Scribe_Values.LookValue(ref m_InterceptDropPod_Active, "m_InterceptDropPod_Active");

            Scribe_Values.LookValue(ref m_BlockIndirect_Avalable, "m_BlockIndirect_Avalable");
            Scribe_Values.LookValue(ref m_BlockDirect_Avalable, "m_BlockDirect_Avalable");
            Scribe_Values.LookValue(ref m_FireSupression_Avalable, "m_FireSupression_Avalable");
            Scribe_Values.LookValue(ref m_InterceptDropPod_Avalable, "m_InterceptDropPod_Avalable");

            Scribe_Values.LookValue(ref m_StructuralIntegrityMode, "m_StructuralIntegrityMode");

            Scribe_Values.LookValue(ref m_FieldIntegrity_Max, "m_FieldIntegrity_Max");
            Scribe_Values.LookValue(ref m_FieldIntegrity_Initial, "m_FieldIntegrity_Initial");
            Scribe_Values.LookValue(ref m_Field_Radius, "m_Field_Radius");

            Scribe_Values.LookValue(ref m_PowerRequired_Charging, "m_PowerRequired_Charging");
            Scribe_Values.LookValue(ref m_PowerRequired_Sustaining, "m_PowerRequired_Sustaining");

            Scribe_Values.LookValue(ref m_RechargeTickDelayInterval, "m_shieldRechargeTickDelay");
            Scribe_Values.LookValue(ref m_RecoverWarmupDelayTicks, "m_shieldRecoverWarmup");
            Scribe_Values.LookValue(ref m_StructuralIntegrityMode, "m_StructuralIntegrityMode");
            Scribe_Values.LookValue(ref m_StructuralIntegrityMode, "m_StructuralIntegrityMode");

            Scribe_Values.LookValue(ref m_ColourRed, "m_colourRed");
            Scribe_Values.LookValue(ref m_ColourGreen, "m_colourGreen");
            Scribe_Values.LookValue(ref m_ColourBlue, "m_colourBlue");

            Scribe_Values.LookValue(ref m_WarmupTicksRemaining, "m_WarmupTicksRemaining");

            Scribe_Values.LookValue(ref m_CurrentStatus, "m_CurrentStatus");
            Scribe_Values.LookValue(ref m_FieldIntegrity_Current, "m_FieldIntegrity_Current");
        }
Esempio n. 2
0
        public override void ExposeData()
        {
            base.ExposeData();
            Scribe_Values.LookValue <TerraformerState>(ref this.terraformerState, "terraformerState");
            Scribe_Values.LookValue <int>(ref this.ticksCounter, "ticksCounter");
            Scribe_Values.LookValue <int>(ref this.totalTicksCounter, "totalTicksCounter");
            Scribe_Values.LookValue <bool>(ref this.deployingLightTurretsIsDone, "deployingLightTurretsIsDone");
            Scribe_Values.LookValue <bool>(ref this.deployingHeavyTurretsIsDone, "deployingHeavyTurretsIsDone");
            Scribe_Values.LookValue <bool>(ref this.invasionIsDone, "invasionIsDone");

            // Landing.
            Scribe_Values.LookValue <int>(ref this.foundationRange, "foundationRange");

            // Pylons.
            for (int pylonIndex = 0; pylonIndex < 8; pylonIndex++)
            {
                Scribe_Values.LookValue <bool>(ref this.pylonIsConstructed[pylonIndex], "pylonIsConstructed" + pylonIndex.ToString());
            }
            Scribe_Collections.LookList <Thing>(ref this.pylonsList, "pylonsList", LookMode.MapReference);
            Scribe_Values.LookValue <bool>(ref this.pylonConstructionIsInProgress, "pylonConstructionIsInProgress");
            Scribe_Values.LookValue <int>(ref this.currentPylonIndex, "currentPylonIndex");

            // Thunderstorm.
            Scribe_Values.LookValue <int>(ref this.terraformingThunderstormDurationInTicks, "terraformingThunderstormDurationInTicks");
            Scribe_Values.LookValue <int>(ref this.terraformingThunderstormNextStartTicks, "terraformingThunderstormNextStartTicks");
            Scribe_Defs.LookDef <WeatherDef>(ref this.desiredWeather, "desiredWeather");

            // Colony interraction.
            Scribe_Values.LookValue <bool>(ref Building_MechanoidTerraformer.studyIsCompleted, "studyIsCompleted");
            Scribe_Values.LookValue <ReverseEngineeringState>(ref this.reverseEngineeringState, "reverseEngineeringState");
            if (this.reverseEngineeringState >= Building_MechanoidTerraformer.ReverseEngineeringState.StudyCompleted)
            {
                this.def.label = "Mechanoid terraformer";
            }
            Scribe_Values.LookValue <int>(ref this.studyCounter, "studyCounter");
            Scribe_Values.LookValue <bool>(ref this.studyIsPaused, "studyIsPaused");
            Scribe_Values.LookValue <int>(ref this.reroutingCounter, "reroutingCounter");
            Scribe_Values.LookValue <bool>(ref this.reroutingIsPaused, "reroutingIsPaused");
            Scribe_Values.LookValue <int>(ref this.extractionCounter, "extractingCounter");
            Scribe_Values.LookValue <bool>(ref this.extractionIsPaused, "extractingIsPaused");
        }
Esempio n. 3
0
        public override void ExposeData()
        {
            base.ExposeData();
            Scribe_Values.LookValue <IntVec3>(ref this.landingPadCenter, "landingPadCenter");
            Scribe_Values.LookValue <Rot4>(ref this.landingPadRotation, "landingPadRotation");
            Scribe_Values.LookValue <IntVec3>(ref this.outpostCenter, "outpostCenter");

            Scribe_Values.LookValue <int>(ref this.requestedOfficersNumber, "requestedOfficersNumber");
            Scribe_Values.LookValue <int>(ref this.requestedHeavyGuardsNumber, "requestedHeavyGuardsNumber");
            Scribe_Values.LookValue <int>(ref this.requestedGuardsNumber, "requestedGuardsNumber");
            Scribe_Values.LookValue <int>(ref this.requestedScoutsNumber, "requestedScoutsNumber");
            Scribe_Values.LookValue <int>(ref this.requestedTechniciansNumber, "requestedTechniciansNumber");
            Scribe_Values.LookValue <int>(ref this.nextSupplyShipLandingDateInTicks, "nextSupplyShipLandingDateInTicks");

            Scribe_Values.LookValue <int>(ref this.nextLordUpdateDateInTicks, "nextLordUpdateDateInTicks");

            Scribe_Values.LookValue <int>(ref this.ticksToNextRotation, "ticksToNextRotation");
            Scribe_Values.LookValue <float>(ref this.dishRotation, "dishRotation");
            Scribe_Values.LookValue <bool>(ref this.clockwiseRotation, "clockwiseRotation");
            Scribe_Values.LookValue <int>(ref this.ticksToRotationEnd, "ticksToRotationEnd");
        }
        //
        // Static Methods
        //
        public static void SaveToFile(PrepareCarefully loadout, Page_ConfigureStartingPawnsCarefully page, string colonistName)
        {
            try {
                Scribe.InitWriting(ColonistFiles.FilePathForSavedColonist(colonistName), "colonist");
                string versionStringFull = "3";
                Scribe_Values.LookValue <string>(ref versionStringFull, "version", null, false);
                string modString = GenText.ToCommaList(Enumerable.Select <ModContentPack, string>(LoadedModManager.RunningMods, (Func <ModContentPack, string>)(mod => mod.Name)), true);
                Scribe_Values.LookValue <string>(ref modString, "mods", null, false);

                SaveRecordPawnV3 pawn = new SaveRecordPawnV3(page.SelectedPawn);
                Scribe_Deep.LookDeep <SaveRecordPawnV3>(ref pawn, "colonist");
            }
            catch (Exception e) {
                Log.Error("Failed to save preset file");
                throw e;
            }
            finally {
                Scribe.FinalizeWriting();
                Scribe.mode = LoadSaveMode.Inactive;
            }
        }
        /// <summary>
        /// Save and load variables (stored in savegame data).
        /// </summary>
        public override void ExposeData()
        {
            base.ExposeData();

            // Breeding parameters.
            Scribe_Defs.LookDef <ThingDef>(ref breedingSpeciesDef, "breedingSpeciesDef");
            Scribe_Values.LookValue <int>(ref breedingDuratinInTicks, "breedingDuratinInTicks");
            Scribe_Values.LookValue <int>(ref breedingProgressInTicks, "breedingProgressInTicks");
            Scribe_Values.LookValue <bool>(ref breedingIsFinished, "breedingIsFinished");

            // Food.
            Scribe_Values.LookValue <int>(ref nextFeedingDateInTicks, "nextFeedingDateInTicks");
            Scribe_Values.LookValue <bool>(ref foodIsAvailable, "foodIsAvailable");

            // Water quality.
            Scribe_Values.LookValue <float>(ref waterQuality, "waterQuality");
            Scribe_Values.LookValue <int>(ref microFungusRemainingDurationInTicks, "microFungusRemainingDurationInTicks");

            // Fishes health.
            Scribe_Values.LookValue <int>(ref fishesHealthInPercent, "fishesHealthInPercent");
        }
        public override void ExposeData()
        {
            // scribe base things
            base.ExposeData();

            // references first, because of the stupid bug in CrossRefResolver.
            Scribe_References.LookReference(ref HuntingGrounds, "HuntingGrounds");

            // must be after references, because reasons.
            Scribe_Deep.LookDeep(ref Trigger, "trigger", manager);

            // settings, human meat is stored in the trigger's thingfilter.
            Scribe_Collections.LookDictionary(ref AllowedAnimals, "AllowedAnimals", LookMode.Def, LookMode.Value);
            Scribe_Values.LookValue(ref UnforbidCorpses, "UnforbidCorpses", true);

            // don't store history in import/export mode.
            if (Manager.LoadSaveMode == Manager.Modes.Normal)
            {
                Scribe_Deep.LookDeep(ref History, "History");
            }
        }
Esempio n. 7
0
        public override void PostExposeData()
        {
            base.PostExposeData();
            Scribe_Collections.LookList <PsykerPower>(ref this.allPowers, "allPowers", LookMode.Deep, new object[0]);
            Scribe_Collections.LookList <PsykerPower>(ref this.temporaryApparelPowers, "temporaryApparelPowers", LookMode.Deep, new object[0]);
            Scribe_Collections.LookList <PsykerPower>(ref this.temporaryWeaponPowers, "temporaryWeaponPowers", LookMode.Deep, new object[0]);
            Scribe_Collections.LookList <PsykerPower>(ref this.Powers, "Powers", LookMode.Deep, new object[0]);
            Scribe_Collections.LookList <PsykerPower>(ref this.allPowers, "allPowers", LookMode.Deep, new object[0]);

            Scribe_Values.LookValue <int>(ref this.TicksToCast, "TicksToCast", 0, false);
            Scribe_Values.LookValue <int>(ref this.TicksToCastMax, "TicksToCastMax", 1, false);
            Scribe_Values.LookValue <float>(ref this.TicksToCastPercentage, "TicksToCastPercentage", 1, false);
            Scribe_Values.LookValue <bool>(ref this.IsActive, "IsActive", false, false);
            Scribe_Values.LookValue <bool>(ref this.ShotFired, "ShotFired", true, false);
            //          Scribe_Deep.LookDeep<Verb_CastWarpPower>(ref this.curVerb, "curVerb", null);
            //          Scribe_TargetInfo.LookTargetInfo(ref this.CurTarget, "CurTarget", null);

            //         Scribe_Deep.LookDeep<PsykerPowerManager>(ref this.PowerManager, "PowerManager", new object[]
            //             {
            //               this
            //             });
        }
Esempio n. 8
0
        /*
         * *** End of class variables ***
         */

        //Keep track of new variables
        public override void ExposeData()
        {
            base.ExposeData();
            if (Scribe.mode == LoadSaveMode.Saving && launcher != null && launcher.Destroyed)
            {
                launcher = null;
            }
            Scribe_Values.LookValue(ref origin, "origin", default(Vector3), false);
            Scribe_Values.LookValue(ref destination, "destination", default(Vector3), false);
            Scribe_References.LookReference(ref assignedTarget, "assignedTarget");
            Scribe_Values.LookValue(ref canFreeIntercept, "canFreeIntercept", false, false);
            Scribe_Defs.LookDef(ref equipmentDef, "equipmentDef");
            Scribe_References.LookReference(ref launcher, "launcher");
            Scribe_References.LookReference(ref assignedMissTargetInt, "assignedMissTarget");
            Scribe_Values.LookValue(ref landed, "landed", false, false);
            Scribe_Values.LookValue(ref ticksToImpact, "ticksToImpact", 0, false);

            //Here be new variables
            Scribe_Values.LookValue(ref shotAngle, "shotAngle", 0f, true);
            Scribe_Values.LookValue(ref shotAngle, "shotHeight", 0f, true);
            Scribe_Values.LookValue(ref shotSpeed, "shotSpeed", 0f, true);
        }
Esempio n. 9
0
            public void ExposeData()
            {
                Scribe_Values.LookValue(ref label, "label");
                Scribe_Values.LookValue(ref size, "size", 100);
                Scribe_Values.LookValue(ref lineColor, "color", Color.white);
                Scribe_Values.LookValue(ref ThingCount.count, "thingCount_count");
                Scribe_Defs.LookDef(ref ThingCount.thingDef, "thingCount_def");

                var periods = new List <Period>(pages.Keys);

                foreach (Period period in periods)
                {
                    List <int> values = pages[period];
                    Utilities.Scribe_IntArray(ref values, period.ToString());

#if DEBUG_SCRIBE
                    Log.Message(Scribe.mode + " for " + label + ", daycount: " + pages[Period.Day].Count);
#endif

                    pages[period] = values;
                }
            }
Esempio n. 10
0
        public override void ExposeData()
        {
            base.ExposeData();
            // TODO: migrate HelpShown to HugsLib invisible setting.
            Scribe_Values.LookValue(ref id, "id", -1, true);
            Scribe_Values.LookValue(ref HelpShown, "HelpShown", false);
            Scribe_Deep.LookDeep(ref _stack, "JobStack", this);

            foreach (ManagerTab tab in ManagerTabs)
            {
                var exposableTab = tab as IExposable;
                if (exposableTab != null)
                {
                    Scribe_Deep.LookDeep(ref exposableTab, tab.Label, this);
                }
            }

            if (_stack == null)
            {
                _stack = new JobStack(this);
            }
        }
Esempio n. 11
0
        //Saving game
        public override void ExposeData()
        {
            //Log.Message("Expose Data start");
            base.ExposeData();

            //Scribe_Deep.LookDeep(ref listOfThingLists, "listOfThingLists");

            Scribe_Values.LookValue <int>(ref currentCapacitorCharge, "currentCapacitorCharge");
            Scribe_Values.LookValue <int>(ref requiredCapacitorCharge, "requiredCapacitorCharge");
            Scribe_Values.LookValue <int>(ref chargeSpeed, "chargeSpeed");


            /*Scribe_Values.LookValue<bool>(ref DropPodDeepStrike, "DropPodDeepStrike");
             * Scribe_Values.LookValue<bool>(ref DropPodAddUnits, "DropPodAddUnits");
             * Scribe_Values.LookValue<bool>(ref DropPodAddResources, "DropPodAddResources");*/

            //Log.Message("Expose Data - look list");
            Scribe_Collections.LookList <Thing>(ref listOfBufferThings, "listOfBufferThings", LookMode.Deep);
            //Scribe_Collections.LookList<Thing>(ref listOfOffworldThings, "listOfOffworldThings", LookMode.Deep, (object)null);

            //Log.Message("Expose Data about to start");
        }
Esempio n. 12
0
        public override void ExposeData()
        {
            // if we're saving create the current list.
            if (Scribe.mode == LoadSaveMode.Saving)
            {
                _priorities = CreateSaveablePriorities();
            }

            // Scribe away!
            Scribe_Collections.LookList(ref _priorities, "Priorities", LookMode.Deep);
            Scribe_Values.LookValue(ref userWarned, "warned");

            // If we're loading, put these into the game.
            if (Scribe.mode == LoadSaveMode.ResolvingCrossRefs)
            {
                // first make a backup of XML defined priorities.
                CreateXMLPrioritiesIfNotExists();

                // then load the saved priorities.
                LoadPriorities(_priorities);
            }
        }
        public override void            ExposeData()
        {
            base.ExposeData();

            Scribe_Values.LookValue(ref visible, "visible");
            if (Scribe.mode == LoadSaveMode.Saving)
            {   // Scribing directly as a rect causing extra formatting '(x:#, y:#, width:#, height:#)' which throws errors on load
                var rectStr = string.Format(
                    "({0},{1},{2},{3})",
                    Window_MiniMap.minimapRect.x,
                    Window_MiniMap.minimapRect.y,
                    Window_MiniMap.minimapRect.width,
                    Window_MiniMap.minimapRect.height
                    );
                Scribe_Values.LookValue(ref rectStr, "minimapRect");
            }
            else if (Scribe.mode == LoadSaveMode.LoadingVars)
            {
                Scribe_Values.LookValue(ref Window_MiniMap.minimapRect, "minimapRect");
                var window = GetWindow;
                if (
                    (visible) &&
                    (window != null)
                    )
                {
                    window.windowRect = Window_MiniMap.minimapRect;
                }
            }

            if (Scribe.mode == LoadSaveMode.Saving)
            {
                ExposeDataSave();
            }
            else if (Scribe.mode == LoadSaveMode.LoadingVars)
            {
                ExposeDataLoad();
            }
        }
Esempio n. 14
0
        public static bool LoadFromFile(PrepareCarefully loadout, string presetName)
        {
            string version = "";
            bool   result  = false;

            try {
                Scribe.InitLoading(PresetFiles.FilePathForSavedPreset(presetName));
                Scribe_Values.LookValue <string>(ref version, "version", "unknown", false);
            }
            catch (Exception e) {
                Log.Error("Failed to load preset file");
                throw e;
            }
            finally {
                Scribe.mode = LoadSaveMode.Inactive;
            }

            if ("1".Equals(version))
            {
                Messages.Message("EdB.PrepareCarefully.PresetVersionNotSupported".Translate(), MessageSound.SeriousAlert);
                return(false);
            }
            else if ("2".Equals(version))
            {
                Messages.Message("EdB.PrepareCarefully.PresetVersionNotSupported".Translate(), MessageSound.SeriousAlert);
                return(false);
            }
            else if ("3".Equals(version))
            {
                result = new PresetLoaderVersion3().Load(loadout, presetName);
            }
            else
            {
                throw new Exception("Invalid preset version");
            }

            return(result);
        }
        public override void ExposeData()
        {
            base.ExposeData();
            Scribe_Values.LookValue( ref Count, "Count" );
            Scribe_Values.LookValue( ref MaxUpperThreshold, "MaxUpperThreshold" );
            Scribe_Values.LookValue( ref Op, "Operator" );
            Scribe_Deep.LookDeep( ref ThresholdFilter, "ThresholdFilter" );

            // stockpile needs special treatment - is not referenceable.
            if ( Scribe.mode == LoadSaveMode.Saving )
            {
                _stockpile_scribe = stockpile?.ToString() ?? "null";
            }
            Scribe_Values.LookValue( ref _stockpile_scribe, "Stockpile", "null" );
            if ( Scribe.mode == LoadSaveMode.PostLoadInit )
            {
                stockpile =
                    manager.map.zoneManager.AllZones.FirstOrDefault(
                                                                    z =>
                                                                    z is Zone_Stockpile && z.label == _stockpile_scribe )
                    as Zone_Stockpile;
            }
        }
Esempio n. 16
0
        public override void ExposeData()
        {
            base.ExposeData();
            //        Scribe_Deep.LookDeep<PatronInfo>(ref this.patronInfo, "patronInfo", new object());
            Scribe_Values.LookValue <bool>(ref this.NoPatron, "NoPatron", true, false);
            Scribe_Values.LookValue <bool>(ref this.IsImmune, "IsImmune", false, false);
            Scribe_Values.LookValue <string>(ref this.patronInfo.PatronName, "PatronName", "Emperor", false);


            //        Scribe_Collections.LookList<SoulTrait>(ref this.SoulTraits, "SoulTraits", LookMode.Deep, new object[0]);
            Scribe_Collections.LookList <Pawn>(ref this.OpposingDevotees, "OpposingDevotees", LookMode.Deep, new object[0]);

            Scribe_Values.LookValue <ChaosGods>(ref this.Patron, "Patron", ChaosGods.Undivided, false);

            //         Scribe_Values.LookValue<PsykerPowerLevel>(ref this.PsykerPowerLevel, "PsykerPowerLevel", PsykerPowerLevel.Rho, false);
            Scribe_Values.LookValue <CulturalToleranceCategory>(ref this.CulturalTolerance, "CulturalTolerance", CulturalToleranceCategory.Neutral, false);

            //        Scribe_Deep.LookDeep<AfflictionProperty>(ref this.PawnAfflictionProps, "PawnAfflictionProps", null);
            Scribe_Deep.LookDeep <SoulTrait>(ref this.DevotionTrait, "DevotionTrait", new object[]
            {
                CorruptionDefOfs.Devotion,
                this.DevotionTrait.SDegree
            });
        }
Esempio n. 17
0
        /// <summary>
        /// This writes the status variables to and from the savegame
        /// </summary>
        public override void ExposeData()
        {
            base.ExposeData();

            //Scribe_Values.LookValue(ref transmitsPower, "transmitsPowerActive");
            Scribe_Values.LookValue(ref autoSwitchOnPawnActive, "autoSwitchOnPawnActive");
            Scribe_Values.LookValue(ref autoSwitchOnEnemyActive, "autoSwitchOnEnemyActive");
            Scribe_Values.LookValue(ref autoSwitchOffEnemyActive, "autoSwitchOffEnemyActive");
            Scribe_Values.LookValue(ref autoSwitchTimerActive, "autoSwitchTimerActive");
            Scribe_Values.LookValue(ref autoSwitchTimerOnTime, "autoSwitchTimerOnTime");
            Scribe_Values.LookValue(ref autoSwitchTimerOffTime, "autoSwitchTimerOffTime");
            Scribe_Values.LookValue(ref pawnSearchModeDistanceActive, "pawnSearchModeDistanceActive");

            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                if (this.flickableComp == null)
                {
                    this.flickableComp = base.GetComp <CompFlickable>();
                }
            }

            // Initialized
            init = true;
        }
Esempio n. 18
0
        public void ExposeData()
        {
            if (Scribe.mode == LoadSaveMode.Saving)
            {
                _assignedWorkersScribeID = _assignedBills.Values.Select(b => b.GetUniqueLoadID()).ToList();
                _assignedBillsScribeID   = _assignedBills.Keys.Select(b => b.GetUniqueLoadID()).ToList();
            }

            Scribe_Values.LookValue(ref BillGiverSelection, "BillGiverSelection");
            Scribe_Values.LookValue(ref UserBillGiverCount, "UserBillGiverCount");
            Scribe_References.LookReference(ref AreaRestriction, "AreaRestriction");
            Scribe_Collections.LookList(ref _assignedBillsScribeID, "AssignedBills", LookMode.Value);
            Scribe_Collections.LookList(ref _assignedWorkersScribeID, "AssignedWorkers", LookMode.Value);
            // TODO: Validate ref
            Scribe_Collections.LookList(ref SpecificBillGivers, "SpecificBillGivers", LookMode.Reference);

            // rather complicated post-load workaround to find buildings by unique ID, since the scribe won't do things the simple way.
            // i.e. scribing dictionary with reference keys and values does not appear to work.
            // since buildings dont appear in the standard finding methods at this point, set a flag to initialize assignedbillgivers the next time Assigned bill givers is called.
            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                _assignedBillGiversInitialized = false;
            }
        }
Esempio n. 19
0
 public override void PostExposeData()
 {
     base.PostExposeData();
     Scribe_Values.LookValue <bool>(ref this.IsSpawned, "IsSpawned", true, false);
 }
        public override void PostExposeData()
        {
            base.PostExposeData();

            Scribe_Values.LookValue(ref netTemp, "netTemp", 999);
        }
Esempio n. 21
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.LookValue <int>(ref this.storedFlour, "storedFlour", storedFlourMax);
 }
Esempio n. 22
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.LookValue <int>(ref maxItem, "maxItem", (int)this.GetStatValue(backpackMaxItem));
     Scribe_Values.LookValue <int>(ref numOfSavedItems, "numOfSavedItems", 0);
 }
Esempio n. 23
0
 public void ExposeData()
 {
     Scribe_Collections.LookDictionary <PsykerPowerLevel, int>(ref this.PowerLevelSlots, "PowerLevelSlots", LookMode.Value, LookMode.Value);
     Scribe_Values.LookValue <CompPsyker>(ref this.compPsyker, "compPsyker", null);
 }
Esempio n. 24
0
 /// <summary>
 /// Saves and loads internal state variables (stored in savegame data).
 /// </summary>
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.LookValue <ForceFieldState>(ref forceFieldState, "forceFieldState", ForceFieldState.Offline);
     Scribe_Values.LookValue <float>(ref forceFieldCharge, "forceFieldCharge");
 }
Esempio n. 25
0
 public override void ExposeData()
 {
     Scribe_Values.LookValue(ref dest, "dest", default(IntVec3));
     Scribe_Values.LookValue(ref destAssigned, "destAssigned", false);
     Scribe_Values.LookValue(ref percentRequired, "percentRequired", 1);
 }
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.LookValue(ref Net, "net", true);
 }
Esempio n. 27
0
 public override void PostExposeData()
 {
     Scribe_Values.LookValue <bool>(ref this.glowOnInt, "glowOn", false, false);
 }
Esempio n. 28
0
        public static void LoadHostData(MCMHost host)
        {
            var filePath = HostFilePath(host);

            if (!File.Exists(filePath))
            {
                return;
            }

            try
            {
                // Open it for reading
                Scribe.InitLoading(filePath);
                if (Scribe.mode == LoadSaveMode.LoadingVars)
                {
                    // Version check
                    string version = "";
                    Scribe_Values.LookValue <string>(ref version, "ccl_version");

                    bool okToLoad = true;
                    var  result   = Version.Compare(version);
                    if (result == Version.VersionCompare.GreaterThanMax)
                    {
                        CCL_Log.Trace(
                            Verbosity.NonFatalErrors,
                            string.Format("Data for {0} is newer ({1}) than the version you are using ({2}).", host.Label, version, Version.Current.ToString()),
                            "Mod Configuration Menu");
                        okToLoad = false;
                    }
                    else if (result == Version.VersionCompare.Invalid)
                    {
                        CCL_Log.Trace(
                            Verbosity.NonFatalErrors,
                            string.Format("Data for {0} is corrupt and will be discarded", host.Label),
                            "Mod Configuration Menu");
                        okToLoad = false;
                    }

                    if (okToLoad)
                    {
                        // Call the worker scribe
                        var args = new object[]
                        {
                            host.Label,
                            host.worker
                        };
                        Scribe_Deep.LookDeep <MCMHost>(ref host, host.key, args);
                    }
                }
            }
            catch (Exception e)
            {
                CCL_Log.Trace(
                    Verbosity.NonFatalErrors,
                    string.Format("Unexpected error scribing data for mod {0}\n{1}", host.Label, e.ToString()),
                    "Mod Configuration Menu");
            }
            finally
            {
                // Finish
                Scribe.FinalizeLoading();
                Scribe.mode = LoadSaveMode.Inactive;
            }
        }
Esempio n. 29
0
 public new void ExposeData()
 {
     Scribe_Values.LookValue(ref lastTalkTime, "lastTalkTime", -9999);
 }
Esempio n. 30
0
 public void ExposeData()
 {
     Scribe_Collections.LookList <Thing>(ref this.containedThings, "containedThings", LookMode.Deep, new object[0]);
     Scribe_Values.LookValue <int>(ref this.openDelay, "openDelay", 110, false);
     Scribe_Values.LookValue <bool>(ref this.leaveSlag, "leaveSlag", false, false);
 }