示例#1
0
        private string GetChunkLevelLabel(ChunkLevelEnum e)
        {
            switch (e)
            {
            case ChunkLevelEnum.None:
                return("None".Translate());

            case ChunkLevelEnum.Low:
                return("StoragePriorityLow".Translate().CapitalizeFirst());

            case ChunkLevelEnum.Normal:
                return("StoragePriorityNormal".Translate().CapitalizeFirst());
            }
            return("CM.Random".Translate());
        }
示例#2
0
        public void DoWindowContents(Rect rect, MSFieldValues fv)
        {
            float half       = rect.width * 0.5f;
            float width      = half - 10f;
            float innerWidth = width - 16;
            float baseY      = rect.y + 5;

            // Terrain
            float y = baseY;

            Widgets.Label(new Rect(0, y, innerWidth, 28), "CM.TerrainType".Translate());
            y += 30;
            WindowUtil.DrawEnumSelection(0, ref y, "CM.ChunksLevel", ChunkLevel, GetChunkLevelLabel, e => ChunkLevel = e);
            Widgets.BeginScrollView(new Rect(rect.x, y, width, rect.height - y), ref terrainScroll, new Rect(0, 0, innerWidth, lastYTerrain));
            lastYTerrain = 0;
            for (int i = 0; i < fv.TerrainFieldValues.Count; ++i)
            {
                if (i < 4)
                {
                    WindowUtil.DrawInputWithSlider(0, ref lastYTerrain, fv.TerrainFieldValues[i], "PowerConsumptionLow".Translate().CapitalizeFirst(), "PowerConsumptionHigh".Translate().CapitalizeFirst());
                }
                else
                {
                    WindowUtil.DrawInputRandomizableWithSlider(0, ref lastYTerrain, fv.TerrainFieldValues[i] as RandomizableFieldValue <float>);
                }
                lastYTerrain += 5;
            }
            Widgets.EndScrollView();

            // Things
            y = baseY;
            Widgets.Label(new Rect(half, y, width, 28), "CM.ThingType".Translate());
            y += 30;

            WindowUtil.DrawBoolInput(half, ref y, "CM.WallsMadeFromLocal".Translate(), AreWallsMadeFromLocal, v => AreWallsMadeFromLocal = v);
            y += 5;
            Widgets.Label(new Rect(half, y, width, 28), "CM.Multipliers".Translate());
            y += 30;
            Widgets.BeginScrollView(new Rect(half, y, width, rect.height - y), ref thingsScroll, new Rect(0, 0, width - 16, lastYThings));
            lastYThings = 0;
            foreach (var v in fv.ThingsFieldValues)
            {
                WindowUtil.DrawInputRandomizableWithSlider(0, ref lastYThings, v);
            }

            /*if (ModsConfig.IdeologyActive)
             * {
             *  Widgets.Label(new Rect(0, lastYThings, width - 16, 28), "CM.AncientThingsEnabled".Translate() + ":");
             *  lastYThings += 30;
             *  CheckBox(5, ref lastYThings, "CM.AncientUtilBuilding".Translate(), ref EnableAncientUtilBuildings);
             *  CheckBox(5, ref lastYThings, "CM.AncientMechanoidRemains".Translate(), ref EnableAncientMechanoidRemains);
             *  CheckBox(5, ref lastYThings, "CM.AncientTurrets".Translate(), ref EnableAncientTurrets);
             *  CheckBox(5, ref lastYThings, "CM.AncientMechs".Translate(), ref EnableAncientMechs);
             *  CheckBox(5, ref lastYThings, "CM.AncientLandingPad".Translate(), ref EnableAncientLandingPad);
             *  CheckBox(5, ref lastYThings, "CM.AncientFences".Translate(), ref EnableAncientFences);
             * }*/
            Widgets.EndScrollView();
        }