void SetEscapeMenuState(EscapeMenuState state) { Language language = game.language; escapemenustate = state; WidgetsClear(); if (state == EscapeMenuState.Main) { MainSet(); MakeSimpleOptions(20, 50); } else if (state == EscapeMenuState.Options) { OptionsSet(); MakeSimpleOptions(20, 50); } else if (state == EscapeMenuState.Graphics) { GraphicsSet(); MakeSimpleOptions(20, 50); } else if (state == EscapeMenuState.Other) { OtherSet(); MakeSimpleOptions(20, 50); } else if (state == EscapeMenuState.Keys) { KeysSet(); int fontsize = 12; int textheight = 20; MakeSimpleOptions(fontsize, textheight); } }
void SetEscapeMenuState(EscapeMenuState state) { LanguageCi language = game.language; escapemenustate = state; WidgetsClear(); if (state == EscapeMenuState.Main) { MainSet(); MakeSimpleOptions(fontEscapeMenu, 50); } else if (state == EscapeMenuState.Options) { OptionsSet(); MakeSimpleOptions(fontEscapeMenu, 50); } else if (state == EscapeMenuState.Graphics) { GraphicsSet(); MakeSimpleOptions(fontEscapeMenu, 50); } else if (state == EscapeMenuState.Other) { OtherSet(); MakeSimpleOptions(fontEscapeMenu, 50); } else if (state == EscapeMenuState.Keys) { KeysSet(); FontCi fontKeys = FontCi.Create("Arial", 12, 0); int textheight = 20; MakeSimpleOptions(fontKeys, textheight); } }
void SetEscapeMenuState(EscapeMenuState state) { escapemenustate = state; widgets.Clear(); if (state == EscapeMenuState.Main) { AddButton("Return to game", (a, b) => { GuiStateBackToGame(); }); AddButton("Options", (a, b) => { SetEscapeMenuState(EscapeMenuState.Options); }); AddButton("Exit", (a, b) => { d_Exit.exit = true; this.d_MainWindow.Exit(); }); MakeSimpleOptions(20, 50); } else if (state == EscapeMenuState.Options) { AddButton("Graphics", (a, b) => { SetEscapeMenuState(EscapeMenuState.Graphics); }); AddButton("Keys", (a, b) => { SetEscapeMenuState(EscapeMenuState.Keys); }); AddButton("Other", (a, b) => { SetEscapeMenuState(EscapeMenuState.Other); }); AddButton("Return to main menu", (a, b) => { SaveOptions(); SetEscapeMenuState(EscapeMenuState.Main); }); MakeSimpleOptions(20, 50); } else if (state == EscapeMenuState.Graphics) { AddButton("Shadows: " + (d_CurrentShadows.ShadowsFull ? "ON" : "OFF"), (a, b) => { d_CurrentShadows.ShadowsFull = !d_CurrentShadows.ShadowsFull; RedrawAllBlocks(); }); AddButton("View distance: " + (d_Config3d.viewdistance), (a, b) => { ToggleFog(); }); AddButton("Use server textures (restart): " + (options.UseServerTextures ? "ON" : "OFF"), (a, b) => { options.UseServerTextures = !options.UseServerTextures; }); AddButton("Font: " + (d_TextRenderer.NewFont ? "2" : "1"), (a, b) => { d_TextRenderer.NewFont = !d_TextRenderer.NewFont; d_The3d.cachedTextTextures.Clear(); }); AddButton("Return to options menu", (a, b) => { SetEscapeMenuState(EscapeMenuState.Options); }); MakeSimpleOptions(20, 50); } else if (state == EscapeMenuState.Other) { AddButton("Sound: " + (d_Audio.Enabled ? "ON" : "OFF"), (a, b) => { d_Audio.Enabled = !d_Audio.Enabled; }); AddButton("Return to options menu", (a, b) => { SetEscapeMenuState(EscapeMenuState.Options); }); MakeSimpleOptions(20, 50); } else if (state == EscapeMenuState.Keys) { int fontsize = 12; int textheight = 20; for (int i = 0; i < keyhelps.Length; i++) { int ii = i; //a copy for closure int defaultkey = keyhelps[i].DefaultKey; int key = defaultkey; if (options.Keys.ContainsKey(defaultkey)) { key = options.Keys[defaultkey]; } AddButton(keyhelps[i].Text + ": " + KeyName(key), (a, b) => { keyselectid = ii; }); } AddButton("Default keys", (a, b) => { options.Keys.Clear(); }); AddButton("Return to options menu", (a, b) => { SetEscapeMenuState(EscapeMenuState.Options); }); MakeSimpleOptions(fontsize, textheight); } }
void SetEscapeMenuState(EscapeMenuState state) { escapemenustate = state; widgets.Clear(); if (state == EscapeMenuState.Main) { AddButton("Return to game",(a, b) => { GuiStateBackToGame(); }); AddButton("Options", (a, b) => { SetEscapeMenuState(EscapeMenuState.Options); }); AddButton("Exit", (a, b) => { d_Exit.exit = true; this.d_MainWindow.Exit(); }); MakeSimpleOptions(20, 50); } else if (state == EscapeMenuState.Options) { AddButton("Graphics", (a, b) => { SetEscapeMenuState(EscapeMenuState.Graphics); }); AddButton("Keys", (a, b) => { SetEscapeMenuState(EscapeMenuState.Keys); }); AddButton("Other", (a, b) => { SetEscapeMenuState(EscapeMenuState.Other); }); AddButton("Return to main menu", (a, b) => { SaveOptions(); SetEscapeMenuState(EscapeMenuState.Main); }); MakeSimpleOptions(20, 50); } else if (state == EscapeMenuState.Graphics) { AddButton("Shadows: " + (d_CurrentShadows.ShadowsFull ? "ON" : "OFF"), (a, b) => { d_CurrentShadows.ShadowsFull = !d_CurrentShadows.ShadowsFull; RedrawAllBlocks(); }); AddButton("View distance: " + (d_Config3d.viewdistance), (a, b) => { ToggleFog(); }); AddButton("Use server textures (restart): " + (options.UseServerTextures ? "ON" : "OFF"), (a, b) => { options.UseServerTextures = !options.UseServerTextures; }); AddButton("Font: " + (d_TextRenderer.NewFont ? "2" : "1"), (a, b) => { d_TextRenderer.NewFont = !d_TextRenderer.NewFont; d_The3d.cachedTextTextures.Clear(); }); AddButton("Return to options menu", (a, b) => { SetEscapeMenuState(EscapeMenuState.Options); }); MakeSimpleOptions(20, 50); } else if (state == EscapeMenuState.Other) { AddButton("Sound: " + (d_Audio.Enabled ? "ON" : "OFF"), (a, b) => { d_Audio.Enabled = !d_Audio.Enabled; }); AddButton("Return to options menu", (a, b) => { SetEscapeMenuState(EscapeMenuState.Options); }); MakeSimpleOptions(20, 50); } else if (state == EscapeMenuState.Keys) { int fontsize = 12; int textheight = 20; for (int i = 0; i < keyhelps.Length; i++) { int ii = i; //a copy for closure int defaultkey = keyhelps[i].DefaultKey; int key = defaultkey; if (options.Keys.ContainsKey(defaultkey)) { key = options.Keys[defaultkey]; } AddButton(keyhelps[i].Text + ": " + KeyName(key), (a, b) => { keyselectid = ii; }); } AddButton("Default keys", (a, b) => { options.Keys.Clear(); }); AddButton("Return to options menu", (a, b) => { SetEscapeMenuState(EscapeMenuState.Options); }); MakeSimpleOptions(fontsize, textheight); } }