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(); }
public void DoWindowContents(Rect inRect, List <FieldValue <float> > fvs) { float y = inRect.y; foreach (var fv in fvs) { WindowUtil.DrawInputWithSlider(inRect.x, ref y, fv); } }
public void DoWindowContents(Rect rect, WSFieldValues fv) { Init(); float y = rect.y; Widgets.Label(new Rect(rect.x, y, rect.width, 28), "CM.StoneTypes".Translate()); y += 30; foreach (var v in fv.StoneMinMaxBuffers) { WindowUtil.DrawIntInput(rect.x, ref y, v); } if (StoneMin < 1) { StoneMin = 1; } if (StoneMax < StoneMin) { StoneMax = StoneMin; } y += 20; Widgets.Label(new Rect(rect.x, y, rect.width, 28), "CM.StoneCommonality".Translate()); y += 30; Widgets.Label(new Rect(rect.x, y, 100, 28), "Randomize".Translate()); Widgets.Checkbox(new Vector2(rect.x + 110, y - 2), ref CommonalityRandom); y += 30; if (!CommonalityRandom) { Widgets.BeginScrollView(new Rect(rect.x, y, rect.width, rect.height - y), ref scroll, new Rect(0, 0, rect.width - rect.x - 16, lastY)); lastY = 0; foreach (var v in fv.CommonalityBuffers) { WindowUtil.DrawInputWithSlider(rect.x, ref lastY, v); } Widgets.EndScrollView(); } }