public void DoWindowContents(Rect rect) { if (WorldSettings == null) { WorldSettings = new WorldSettings(); } if (MapSettings == null) { MapSettings = new MapSettings(); } if (CurrentSettings == null) { CurrentSettings = new CurrentSettings(); } string label; if (toShow == ToShow.None) { label = "WorldChooseButton".Translate(); } else if (toShow == ToShow.World) { label = WorldSettings.Name; } else { label = MapSettings.Name; } if (Widgets.ButtonText(new Rect(rect.x, rect.y, 300, 28), label)) { List <FloatMenuOption> l = new List <FloatMenuOption>(3) { new FloatMenuOption(WorldSettings.Name, () => { toShow = ToShow.World; }), new FloatMenuOption(MapSettings.Name, () => { toShow = ToShow.Map; }) }; if (Current.Game != null) { l.Add(new FloatMenuOption(CurrentSettings.Name, () => { toShow = ToShow.CurrentGame; })); } Find.WindowStack.Add(new FloatMenu(l)); } rect.y += 30f; if (toShow == ToShow.World) { if (wsFieldValues == null) { wsFieldValues = WorldSettings.GetFieldValues(); } WorldSettings.DoWindowContents(rect, wsFieldValues); } else if (toShow == ToShow.Map) { if (msFieldValues == null) { msFieldValues = MapSettings.GetFieldValues(); } MapSettings.DoWindowContents(rect, msFieldValues); } else if (toShow == ToShow.CurrentGame) { if (cgFieldValues == null) { cgFieldValues = CurrentSettings.GetFieldValues(); } CurrentSettings.DoWindowContents(rect, cgFieldValues); } }
public override void FinalizeInit() { base.FinalizeInit(); CurrentSettings.ApplySettings(AnimalMultiplier, PlantMultiplier); }