public override void Initialize() { ShouldBeScaled = false; ButtonsCount = FrameButtonsCount.Two; ShortUpperLine = true; saves = new Elements.SavesLoadsList((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y - 35); saves.onElementSelected += new Elements.SavesLoadsList.SaveLoadEvent(saves_onElementSelected); controls.Add(saves); lTitle = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "Load Sandbox"); lTitle.foreground = Color.White; controls.Add(lTitle); bdelete = new Elements.MenuButton((int)(Position.X + Size.X) - 240, (int)(Position.Y + Size.Y) - 23, 120, 23, "Delete"); bdelete.Font = ButtonFont; bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick); controls.Add(bdelete); bload = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23, 120, 23, "Load"); bload.Font = ButtonFont; bload.onClicked += new Elements.Button.ClickedEventHandler(loadClick); controls.Add(bload); base.Initialize(); }
public Elements.MenuButton[] GetButtonsForHandbook(bool tutorial) { Elements.MenuButton[] m; var a = System.IO.Directory.GetDirectories("Content/Encyclopedia/"); m = new Elements.MenuButton[a.Length]; int curind = 0; for (int i = 0; i < a.Length; i++) { if (!a[i].EndsWith("/Resources")) { m[curind] = new Elements.MenuButton(GetDirnameForPath(a[i])) { frameScene = GUIEngine.s_handbook }; m[curind].tag = a[i]; m[curind].onClicked += new Elements.Button.ClickedEventHandler(Handbook_Topic_onClicked); curind++; } } m[a.Length - 1] = new Elements.MenuButton("Back"); m[a.Length - 1].onClicked += new Elements.Button.ClickedEventHandler(Handbook_Back_onClicked); m[a.Length - 1].tag = (byte)(tutorial ? 0 : currentState.items[0] == items[0] ? 1 : 2); CalculateLocations(m); return(m); }
public override void Initialize() { ShouldBeScaled = false; ButtonsCount = FrameButtonsCount.Two; ShortUpperLine = true; saves = new Elements.SavesLoadsList((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y - 35); saves.onElementSelected += new Elements.SavesLoadsList.SaveLoadEvent(saves_onElementSelected); controls.Add(saves); lTitle = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "Load Sandbox"); lTitle.foreground = Color.White; controls.Add(lTitle); bdelete = new Elements.MenuButton((int)(Position.X + Size.X) - 240, (int)(Position.Y + Size.Y) - 23, 120, 23, "Delete"); bdelete.Font = ButtonFont; bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick); controls.Add(bdelete); bload = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23, 120, 23, "Load"); bload.Font = ButtonFont; bload.onClicked += new Elements.Button.ClickedEventHandler(loadClick); controls.Add(bload); base.Initialize(); }
public override void Initialize() { ButtonsCount = FrameButtonsCount.One; #region ControlButtons res = new Elements.MenuButton("Reset"); res.Position = new Vector2((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23); res.Size = new Vector2(120, 23); res.Font = ButtonFont; res.onClicked += new Elements.Button.ClickedEventHandler(resClick); controls.Add(res); #endregion for (int i = 0; i < l.Length; i++) { tl[i] = new Elements.Label((int)Position.X + 10, (int)Position.Y + 10 + i * 40, ""); tl[i].font = ResourceManager.Load <SpriteFont>("Fonts/LiberationSans_14"); tl[i].foreground = Color.White; controls.Add(tl[i]); } tl[0].text = "Wires placed: "; tl[1].text = "Components placed: "; tl[2].text = "Times started: "; tl[3].text = "Components Removed: "; tl[4].text = "Wires burned: "; tl[5].text = "Buttons clicked: "; tl[6].text = "Text entered: "; tl[7].text = "Game start: "; for (int i = 0; i < l.Length; i++) { if (tl[i].size.X > mw) { mw = (int)tl[i].size.X; } } mw += 85; for (int i = 0; i < l.Length; i++) { l[i] = new Elements.Label((int)Position.X + mw, (int)Position.Y + 10 + i * 40, ""); l[i].font = ResourceManager.Load <SpriteFont>("Fonts/LiberationSans_14"); l[i].foreground = Color.White; controls.Add(l[i]); } base.Initialize(); }
public override void Initialize() { ButtonsCount = FrameButtonsCount.One; #region ControlButtons res = new Elements.MenuButton("Reset"); res.Position = new Vector2((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23); res.Size = new Vector2(120, 23); res.Font = ButtonFont; res.onClicked += new Elements.Button.ClickedEventHandler(resClick); controls.Add(res); #endregion for (int i = 0; i < l.Length; i++) { tl[i] = new Elements.Label((int)Position.X + 10, (int)Position.Y + 10 + i * 40, ""); tl[i].font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_14"); tl[i].foreground = Color.White; controls.Add(tl[i]); } tl[0].text = "Wires placed: "; tl[1].text = "Components placed: "; tl[2].text = "Times started: "; tl[3].text = "Components Removed: "; tl[4].text = "Wires burned: "; tl[5].text = "Buttons clicked: "; tl[6].text = "Text entered: "; tl[7].text = "Game start: "; for (int i = 0; i < l.Length; i++) { if (tl[i].size.X > mw) mw = (int)tl[i].size.X; } mw += 85; for (int i = 0; i < l.Length; i++) { l[i] = new Elements.Label((int)Position.X + mw, (int)Position.Y + 10 + i * 40, ""); l[i].font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_14"); l[i].foreground = Color.White; controls.Add(l[i]); } base.Initialize(); }
public new void Initialize() { font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_18"); ShouldBeScaled = false; Layer = 650; bok = new Elements.MenuButton(680, 0, 400, 30, "Got it!"); bok.Font = font; bok.TextOffset = new Vector2(0, 3); bok.onClicked += new Elements.Button.ClickedEventHandler(bokClick); controls.Add(bok); lAvalable = new Elements.Label(0, 0, "Avalable components:"); lAvalable.foreground = Color.White; controls.Add(lAvalable); lPurpose = new Elements.Label(0, 0, "Objective:"); lPurpose.foreground = Color.White; controls.Add(lPurpose); base.Initialize(); }
public override void Initialize() { ShouldBeScaled = false; ButtonsCount = FrameButtonsCount.Two; saves = new Elements.ListBox((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y - 35); saves.onDoubleClicked += new Elements.ListBox.DoubleClickedEventHandler(saves_onDoubleClicked); controls.Add(saves); bdelete = new Elements.MenuButton((int)(Position.X + Size.X) - 240, (int)(Position.Y + Size.Y) - 23, 120, 23, "Delete"); bdelete.Font = ButtonFont; bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick); controls.Add(bdelete); bload = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23, 120, 23, "Load"); bload.Font = ButtonFont; bload.onClicked += new Elements.Button.ClickedEventHandler(loadClick); controls.Add(bload); base.Initialize(); }
public override void Initialize() { ShouldBeScaled = false; ButtonsCount = FrameButtonsCount.Two; saves = new Elements.ListBox((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y - 35); saves.onDoubleClicked += new Elements.ListBox.DoubleClickedEventHandler(saves_onDoubleClicked); controls.Add(saves); bdelete = new Elements.MenuButton((int)(Position.X + Size.X) - 240, (int)(Position.Y + Size.Y) - 23, 120, 23, "Delete"); bdelete.Font = ButtonFont; bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick); controls.Add(bdelete); bload = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23, 120, 23, "Load"); bload.Font = ButtonFont; bload.onClicked += new Elements.Button.ClickedEventHandler(loadClick); controls.Add(bload); base.Initialize(); }
public override void Initialize() { ButtonsCount = FrameButtonsCount.One; article = new Encyclopedia.Article(); article.position = Position + new Vector2(260, 23 + 96); article.Size = Size - new Vector2(260, 23 + 96) - new Vector2(26, 28); article.view.OnPageLoaded += new Elements.HTMLViewer.PageLoaded(view_OnPageLoaded); lFolder = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, ""); lFolder.foreground = Color.White; controls.Add(lFolder); sbFileList = new Elements.ScrollBar((int)Position.X + 278 - 7, (int)Position.Y + 100, 16, (int)Size.Y - 100 - 7); sbFileList.MaxValue = 10000; sbFileList.MinValue = 0; sbFileList.Value = 0; sbFileList.IsVertical = true; sbFileList.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(sbFileList_onValueChanged); controls.Add(sbFileList); sbArticle = new Elements.ScrollBar((int)(Position.X + Size.X) - 8, (int)Position.Y + 100, 16, (int)Size.Y - 89 - 100 - 7); sbArticle.MaxValue = 1; sbArticle.MinValue = 0; sbArticle.Value = 0; sbArticle.IsVertical = true; sbArticle.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(sbArticle_onValueChanged); controls.Add(sbArticle); goToLink = new Elements.MenuButton((int)(Position.X + Size.X - 120), (int)(Position.Y + Size.Y - 23), 120, 23, "Link"); goToLink.isEnabled = false; goToLink.Font = ButtonFont; goToLink.onClicked += new Elements.Button.ClickedEventHandler(gotolink_onClicked); controls.Add(goToLink); base.Initialize(); }
public override void Initialize() { ButtonsCount = FrameButtonsCount.Two; ShouldBeScaled = false; saves = new Elements.SavesLoadsList((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y - 35); saves.onElementSelected += new Elements.SavesLoadsList.SaveLoadEvent(saves_onElementSelected); saves.onSelectedIndexChanged += new Elements.SavesLoadsList.SelectionEvent(saves_onSelectedIndexChanged); controls.Add(saves); lTitle = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "Save"); lTitle.foreground = Color.White; controls.Add(lTitle); bdelete = new Elements.MenuButton((int)(Position.X + Size.X) - 240, (int)(Position.Y + Size.Y) - 23, 120, 23, "Delete"); bdelete.Font = ButtonFont; bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick); controls.Add(bdelete); bsave = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23, 120, 23, "Save"); bsave.Font = ButtonFont; bsave.onClicked += new Elements.Button.ClickedEventHandler(saveClick); controls.Add(bsave); tb = new Elements.TextBox((int)saves.position.X, (int)bsave.position.Y, (int)saves.size.X, 23, ""); tb.onTextChanged += new Elements.TextBox.TextChangedEventHandler(tb_onTextChanged); tb.BackgroundColor = Color.White * 0.2f; tb.ForegroundColor = Color.White; tb.CursorColor = Color.White; tb.Multiline = false; tb.BGAsColor = true; controls.Add(tb); base.Initialize(); }
public override void Initialize() { ButtonsCount = FrameButtonsCount.One; article = new Encyclopedia.Article(); article.position = Position + new Vector2(260, 23 + 96); article.Size = Size - new Vector2(260, 23 + 96) - new Vector2(26, 28); article.view.OnPageLoaded += new Elements.HTMLViewer.PageLoaded(view_OnPageLoaded); lFolder = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, ""); lFolder.foreground = Color.White; controls.Add(lFolder); sbFileList = new Elements.ScrollBar((int)Position.X + 278 - 7, (int)Position.Y + 100, 16, (int)Size.Y - 100 - 7); sbFileList.MaxValue = 10000; sbFileList.MinValue = 0; sbFileList.Value = 0; sbFileList.IsVertical = true; sbFileList.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(sbFileList_onValueChanged); controls.Add(sbFileList); sbArticle = new Elements.ScrollBar((int)(Position.X + Size.X) - 8, (int)Position.Y + 100, 16, (int)Size.Y - 89 - 100 - 7); sbArticle.MaxValue = 1; sbArticle.MinValue = 0; sbArticle.Value = 0; sbArticle.IsVertical = true; sbArticle.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(sbArticle_onValueChanged); controls.Add(sbArticle); goToLink = new Elements.MenuButton((int)(Position.X + Size.X - 120), (int)(Position.Y + Size.Y - 23), 120, 23, "Link"); goToLink.isEnabled = false; goToLink.Font = ButtonFont; goToLink.onClicked += new Elements.Button.ClickedEventHandler(gotolink_onClicked); controls.Add(goToLink); base.Initialize(); }
public override void Initialize() { ButtonsCount = FrameButtonsCount.Two; ShouldBeScaled = false; saves = new Elements.SavesLoadsList((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y - 35); saves.onElementSelected += new Elements.SavesLoadsList.SaveLoadEvent(saves_onElementSelected); saves.onSelectedIndexChanged += new Elements.SavesLoadsList.SelectionEvent(saves_onSelectedIndexChanged); controls.Add(saves); lTitle = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "Save"); lTitle.foreground = Color.White; controls.Add(lTitle); bdelete = new Elements.MenuButton((int)(Position.X + Size.X) - 240, (int)(Position.Y + Size.Y) - 23, 120, 23, "Delete"); bdelete.Font = ButtonFont; bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick); controls.Add(bdelete); bsave = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23, 120, 23, "Save"); bsave.Font = ButtonFont; bsave.onClicked += new Elements.Button.ClickedEventHandler(saveClick); controls.Add(bsave); tb = new Elements.TextBox((int)saves.position.X, (int)bsave.position.Y, (int)saves.size.X, 23, ""); tb.onTextChanged += new Elements.TextBox.TextChangedEventHandler(tb_onTextChanged); tb.BackgroundColor = Color.White * 0.2f; tb.ForegroundColor = Color.White; tb.CursorColor = Color.White; tb.Multiline = false; tb.BGAsColor = true; controls.Add(tb); base.Initialize(); }
public new void Initialize() { font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_18"); ShouldBeScaled = false; Layer = 650; bok = new Elements.MenuButton(680, 0, 400, 30, "Got it!"); bok.Font = font; bok.TextOffset = new Vector2(0, 3); bok.onClicked += new Elements.Button.ClickedEventHandler(bokClick); controls.Add(bok); lAvalable = new Elements.Label(0, 0, "Avalable components:"); lAvalable.foreground = Color.White; controls.Add(lAvalable); lPurpose = new Elements.Label(0, 0, "Objective:"); lPurpose.foreground = Color.White; controls.Add(lPurpose); base.Initialize(); }
public override void Initialize() { ButtonsCount = FrameButtonsCount.One; #region MaxRes var a = GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.GetEnumerator(); a.MoveNext(); maxw = a.Current.Width; maxh = a.Current.Height; a.MoveNext(); while (true)//DO NOT TOUCH THIS CYCLE OR ELSE MONO GETS SCARED!!! { try { if (a.Current == null) break; } catch { System.Threading.Thread.Sleep(1); } try { if (a.Current == null) break; } catch { break; } try { if (a.Current.Width > maxw) maxw = a.Current.Width; if (a.Current.Height > maxh) maxh = a.Current.Height; } catch { } a.MoveNext(); } #endregion #region Resoulutions l_aspectRatio = new Elements.Label((int)Position.X + 5, (int)Position.Y + 5, "Aspect ratio:"); l_aspectRatio.foreground = Color.White; controls.Add(l_aspectRatio); co_aspectRation = new Elements.ComboBox((int)Position.X + 150, (int)Position.Y + 7, 120, 24); co_aspectRation.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(ar_onElementSelected); controls.Add(co_aspectRation); co_aspectRation.ItemsAdd("4*3"); co_aspectRation.ItemsAdd("5*3"); if (maxw >= 1280 && maxh >= 720) co_aspectRation.ItemsAdd("16*9"); if (maxw >= 1280 && maxh >= 800) co_aspectRation.ItemsAdd("16*10"); l_resolution = new Elements.Label((int)Position.X + 5, (int)Position.Y + 35, "Resolution:"); l_resolution.foreground = Color.White; controls.Add(l_resolution); co_resolution = new Elements.ComboBox((int)Position.X + 150, (int)Position.Y + 37, 120, 24); co_resolution.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(res_onElementSelected); controls.Add(co_resolution); cb_fullscreen = new Elements.CheckBox((int)Position.X + 5, (int)Position.Y + 65, 200, 20, "FullScreen", false); cb_fullscreen.foreground = Color.White; cb_fullscreen.onCheckedChanged += new Elements.CheckBox.CheckBoxCheckedHandler(cb_fullscreen_onCheckedChanged); controls.Add(cb_fullscreen); b_apply = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23, 120, 23, "Apply"); b_apply.Font = ButtonFont; b_apply.onClicked += new Elements.Button.ClickedEventHandler(apply_onClicked); controls.Add(b_apply); #endregion cb_drawgrig = new Elements.CheckBox((int)Position.X + 5, (int)Position.Y + 95, 200, 20, "Draw grid", false); cb_drawgrig.foreground = Color.White; cb_drawgrig.onCheckedChanged += new Elements.CheckBox.CheckBoxCheckedHandler(cb_drawgrig_onCheckedChanged); controls.Add(cb_drawgrig); cb_warning = new Elements.CheckBox((int)Position.X + 5, (int)Position.Y + 125, 200, 20, "Show intro warning", false); cb_warning.foreground = Color.White; cb_warning.onCheckedChanged += new Elements.CheckBox.CheckBoxCheckedHandler(cb_warning_onCheckedChanged); controls.Add(cb_warning); base.Initialize(); }
public override void Initialize() { ButtonsCount = FrameButtonsCount.One; #region MaxRes var a = GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.GetEnumerator(); a.MoveNext(); maxw = a.Current.Width; maxh = a.Current.Height; a.MoveNext(); while (true)//DO NOT TOUCH THIS CYCLE OR ELSE MONO GETS SCARED!!! { try { if (a.Current == null) { break; } } catch { System.Threading.Thread.Sleep(1); } try { if (a.Current == null) { break; } } catch { break; } try { if (a.Current.Width > maxw) { maxw = a.Current.Width; } if (a.Current.Height > maxh) { maxh = a.Current.Height; } } catch { } a.MoveNext(); } #endregion #region Resoulutions l_aspectRatio = new Elements.Label((int)Position.X + 5, (int)Position.Y + 5, "Aspect ratio:"); l_aspectRatio.foreground = Color.White; controls.Add(l_aspectRatio); co_aspectRation = new Elements.ComboBox((int)Position.X + 150, (int)Position.Y + 7, 120, 24); co_aspectRation.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(ar_onElementSelected); controls.Add(co_aspectRation); co_aspectRation.ItemsAdd("4*3"); co_aspectRation.ItemsAdd("5*3"); if (maxw >= 1280 && maxh >= 720) { co_aspectRation.ItemsAdd("16*9"); } if (maxw >= 1280 && maxh >= 800) { co_aspectRation.ItemsAdd("16*10"); } l_resolution = new Elements.Label((int)Position.X + 5, (int)Position.Y + 35, "Resolution:"); l_resolution.foreground = Color.White; controls.Add(l_resolution); co_resolution = new Elements.ComboBox((int)Position.X + 150, (int)Position.Y + 37, 120, 24); co_resolution.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(res_onElementSelected); controls.Add(co_resolution); cb_fullscreen = new Elements.CheckBox((int)Position.X + 5, (int)Position.Y + 65, 200, 20, "FullScreen", false); cb_fullscreen.foreground = Color.White; cb_fullscreen.onCheckedChanged += new Elements.CheckBox.CheckBoxCheckedHandler(cb_fullscreen_onCheckedChanged); controls.Add(cb_fullscreen); b_apply = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23, 120, 23, "Apply"); b_apply.Font = ButtonFont; b_apply.onClicked += new Elements.Button.ClickedEventHandler(apply_onClicked); controls.Add(b_apply); #endregion cb_drawgrig = new Elements.CheckBox((int)Position.X + 5, (int)Position.Y + 95, 200, 20, "Draw grid", false); cb_drawgrig.foreground = Color.White; cb_drawgrig.onCheckedChanged += new Elements.CheckBox.CheckBoxCheckedHandler(cb_drawgrig_onCheckedChanged); controls.Add(cb_drawgrig); cb_warning = new Elements.CheckBox((int)Position.X + 5, (int)Position.Y + 125, 200, 20, "Show intro warning", false); cb_warning.foreground = Color.White; cb_warning.onCheckedChanged += new Elements.CheckBox.CheckBoxCheckedHandler(cb_warning_onCheckedChanged); controls.Add(cb_warning); base.Initialize(); }
public Elements.MenuButton[] GetButtonsForHandbook(bool tutorial) { Elements.MenuButton[] m; var a = System.IO.Directory.GetDirectories("Content/Encyclopedia/"); m = new Elements.MenuButton[a.Length]; int curind = 0; for (int i = 0; i < a.Length; i++) { if (!a[i].EndsWith("/Resources")) { m[curind] = new Elements.MenuButton(GetDirnameForPath(a[i])) { frameScene = GUIEngine.s_handbook }; m[curind].tag = a[i]; m[curind].onClicked += new Elements.Button.ClickedEventHandler(Handbook_Topic_onClicked); curind++; } } m[a.Length - 1] = new Elements.MenuButton("Back"); m[a.Length - 1].onClicked += new Elements.Button.ClickedEventHandler(Handbook_Back_onClicked); m[a.Length - 1].tag = (byte)(tutorial ? 0 : currentState.items[0] == items[0] ? 1 : 2); CalculateLocations(m); return m; }