public static bool ShowRendererDropdown(DropDownButtonWidget dropdown, GraphicSettings s) { var options = new Dictionary<string, string>() { { "OpenGL", "Gl" }, { "Cg Toolkit", "Cg" }, }; Func<string, ScrollItemWidget, ScrollItemWidget> setupItem = (o, itemTemplate) => { var item = ScrollItemWidget.Setup(itemTemplate, () => s.Renderer == options[o], () => s.Renderer = options[o]); item.Get<LabelWidget>("LABEL").GetText = () => o; return item; }; dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 500, options.Keys, setupItem); return true; }
public static bool ShowWindowModeDropdown(DropDownButtonWidget dropdown, GraphicSettings s) { var options = new Dictionary<string, WindowMode>() { { "Pseudo-Fullscreen", WindowMode.PseudoFullscreen }, { "Fullscreen", WindowMode.Fullscreen }, { "Windowed", WindowMode.Windowed }, }; Func<string, ScrollItemWidget, ScrollItemWidget> setupItem = (o, itemTemplate) => { var item = ScrollItemWidget.Setup(itemTemplate, () => s.Mode == options[o], () => s.Mode = options[o]); item.Get<LabelWidget>("LABEL").GetText = () => o; return item; }; dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 500, options.Keys, setupItem); return true; }
Action ResetDisplayPanel(Widget panel) { var ds = Game.Settings.Graphics; var gs = Game.Settings.Game; var dds = new GraphicSettings(); var dgs = new GameSettings(); return () => { gs.ShowShellmap = dgs.ShowShellmap; ds.CapFramerate = dds.CapFramerate; Game.SetIdealFrameTime(ds.MaxFramerate); ds.MaxFramerate = dds.MaxFramerate; ds.Language = dds.Language; ds.Mode = dds.Mode; ds.WindowedSize = dds.WindowedSize; ds.PixelDouble = dds.PixelDouble; worldRenderer.Viewport.Zoom = ds.PixelDouble ? 2 : 1; }; }