public DebugMenu(string rootLabel) { IsOpen = false; nodeDic = new Dictionary<string, DebugMenuNode>(); menuStack = new Stack<DebugMenuNode>(); RootNode = new DebugMenuNodeInternal() { Label = rootLabel, Selectable = false, }; nodeDic[RootNode.Label] = RootNode; menuStack.Push(RootNode); }
void InitDebugMenuGraphicsOption() { var graphicsOptionNode = new DebugMenuNodeInternal() { Label = "描画オプション", ExecFunc = GraphicsOptionBase.Instance.GetCurrentSetting, }; DebugMenu.AddChild(DebugMenu.RootNode.Label, graphicsOptionNode); var graphicsOptionLabel = DebugMenu.RootNode.Label + "." + graphicsOptionNode.Label; DebugMenu.AddChild(graphicsOptionLabel, new DebugMenuNodeExecutable() { Label = "適用", ExecFunc = GraphicsOptionBase.Instance.Apply, }); DebugMenu.AddChild(graphicsOptionLabel, new DebugMenuNodeTunableBool { Label = "VSync有効", Getter = () => { return GraphicsOptionBase.Instance.VSyncEnable; }, Setter = (value) => { GraphicsOptionBase.Instance.VSyncEnable = value; }, }); DebugMenu.AddChild(graphicsOptionLabel, new DebugMenuNodeTunableBool { Label = "MSAA有効", Getter = () => { return GraphicsOptionBase.Instance.MSAAEnable; }, Setter = (value) => { GraphicsOptionBase.Instance.MSAAEnable = value; }, }); DebugMenu.AddChild(graphicsOptionLabel, new DebugMenuNodeTunableBool { Label = "フルスクリーン", Getter = () => { return GraphicsOptionBase.Instance.IsFullScreen; }, Setter = (value) => { GraphicsOptionBase.Instance.IsFullScreen = value; }, }); var resolutionNode = new DebugMenuNodeSelectable { Label = "解像度", }; foreach (var resolution in GraphicsOptionBase.Instance.Resolutions) { resolutionNode.AddChoice( string.Format("{0}x{1}", resolution.Width, resolution.Height), () => { GraphicsOptionBase.Instance.Resolution.Width = resolution.Width; GraphicsOptionBase.Instance.Resolution.Height = resolution.Height; }); } DebugMenu.AddChild(graphicsOptionLabel, resolutionNode); }