Inheritance: ModSettings, ICloneable
Exemple #1
0
 public override void ExposeData()
 {
     var defaults = new CoreSettings();
     Scribe_Values.Look(ref stdDev, "stdDev", defaults.stdDev);
     Scribe_Values.Look(ref mean, "mean", defaults.mean);
     Scribe_Values.Look(ref mutationStdDev, "mutationStdDev", defaults.mutationStdDev);
     Scribe_Values.Look(ref mutationMean, "mutationMean", defaults.mutationMean);
     Scribe_Values.Look(ref humanMode, "humanMode", defaults.humanMode);
     Scribe_Values.Look(ref omniscientMode, "omniscientMode", defaults.omniscientMode);
     Scribe_Values.Look(ref bestGeneChance, "bestGeneChance", defaults.bestGeneChance);
 }
        public static void DoSettings(CoreSettings settings, Rect rect)
        {
            float curY = 80;

            Rect generationGraph = new Rect(rect.width / 2 + 10, 0, rect.width / 2 - 10, 0);
            Rect mutationGraph   = new Rect(rect.width / 2 + 10, 0, rect.width / 2 - 10, 0);

            Listing_Standard listingStandard = new Listing_Standard();

            listingStandard.Begin(new Rect(10, curY, rect.width / 2 - 10, 400f));

            generationGraph.y = listingStandard.CurHeight;

            listingStandard.Label("AG.Settings1".Translate(), -1f, "AG.Settings1Tooltip".Translate());
            listingStandard.Label("AG.Mean".Translate() + " : " + (settings.mean * 100).ToString("F0"));
            settings.mean = listingStandard.Slider(settings.mean, 0f, 2f);
            listingStandard.Label("AG.StandardDeviation".Translate() + " : " + (settings.stdDev * 100).ToString("F0"));
            settings.stdDev = listingStandard.Slider(settings.stdDev, 0f, 0.5f);

            generationGraph.height = listingStandard.CurHeight - generationGraph.y;

            listingStandard.Gap(20f);

            mutationGraph.y = listingStandard.CurHeight;

            listingStandard.Label("AG.Settings2".Translate(), -1f, "AG.Settings2Tooltip".Translate());
            listingStandard.Label("AG.Mean".Translate() + " : " + (settings.mutationMean * 100).ToString("F0"));
            settings.mutationMean = listingStandard.Slider(settings.mutationMean, -0.25f, 0.25f);
            listingStandard.Label("AG.StandardDeviation".Translate() + " : " + (settings.mutationStdDev * 100).ToString("F0"));
            settings.mutationStdDev = listingStandard.Slider(settings.mutationStdDev, 0f, 0.5f);

            mutationGraph.height = listingStandard.CurHeight - mutationGraph.y;

            listingStandard.Gap(20f);

            generationGraph.y += curY;
            mutationGraph.y   += curY;

            listingStandard.Label("AnimalGenetics.ChanceInheritBestGene".Translate() + " : " + (settings.bestGeneChance * 100).ToString("F0"));
            settings.bestGeneChance = listingStandard.Slider(settings.bestGeneChance, 0.0f, 1.0f);

            listingStandard.End();

            DrawGraph(generationGraph, 0, 200, settings.mean * 100, settings.stdDev * 100);
            DrawGraph(mutationGraph, -25, 25, settings.mutationMean * 100, settings.mutationStdDev * 100);

            curY += listingStandard.CurHeight;

            Listing_Standard listingStandard2 = new Listing_Standard();

            listingStandard2.Begin(new Rect(0, curY, rect.width / 2 - 10, 250f));

            listingStandard2.Gap(30f);
            listingStandard2.CheckboxLabeled("AG.HumanlikeGenes".Translate(), ref settings.humanMode, "AG.HumanlikeGenesTooltip".Translate());
            listingStandard2.CheckboxLabeled("AG.Omniscient".Translate(), ref settings.omniscientMode, "AG.OmniscientTooltip".Translate());

            if (listingStandard2.ButtonText("AG.DefaultSettings".Translate()))
            {
                settings.Reset();
            }

            listingStandard2.Gap(30f);
            listingStandard2.End();
        }
Exemple #3
0
 public AnimalGenetics(World world) : base(world)
 {
     Settings = (CoreSettings)AnimalGeneticsSettings.InitialCore.Clone();
 }