/// <summary> /// Attempts to connect to the server /// </summary> /// <param name="timeToWait">The amount of seconds to wait for a connection to be made</param> /// <returns>True if a connection is made, false otherwise</returns> public bool Connect_Existing_Account(string email, string password, int secondsToWait, TextBox statusTextBox) { NetOutgoingMessage outgoingMessage; NetIncomingMessage incomingMessage; byte messageID; outgoingMessage = netClient.CreateMessage(); outgoingMessage.Write((byte)PacketType.Account_Login_Request); outgoingMessage.Write(email.ToLower()); outgoingMessage.Write(password); serverConnection = netClient.Connect(serverIp, serverPort, outgoingMessage); DateTime timeNow = DateTime.Now; DateTime timeoutTime = timeNow.AddSeconds(secondsToWait); while (DateTime.Now < timeoutTime || playerID != -1) { while ((incomingMessage = netClient.ReadMessage()) != null) { messageID = incomingMessage.ReadByte(); if (messageID == (byte)PacketType.Account_Login_Response) { bool successful = incomingMessage.ReadBoolean(); string statusUpdate = incomingMessage.ReadString(); statusTextBox.Text = statusUpdate; return successful; } } } statusTextBox.Text = "Unable to connect to server."; return false; }
/// <summary>Creates a new instance of TextBox.</summary> /// <param name="toClone">The TextBox to clone.</param> public TextBox(TextBox toClone) : base(toClone) { text = new StringBuilder(toClone.text.ToString()); ForeColor = toClone.ForeColor; font = toClone.Font; editIndex = 0; editPosition = 0f; scrollValue = 0f; textPos = toClone.textPos; sidePadding = toClone.sidePadding; AllowAlpha = toClone.AllowAlpha; AllowNumeric = toClone.AllowNumeric; AllowedSpecChars = toClone.AllowedSpecChars; }
/// <summary>Validates a comma-delimited TextBox to make aure all values are valid and are in ascending order.</summary> /// <param name="txt">The TextBox to validate.</param> /// <param name="def">The default value to revert to if the value is invalid.</param> private void validatePpl(TextBox txt, string def) { if (txt.Text == string.Empty) return; bool valid = true; string[] ppl = txt.Text.Split(','); double p0 = 0d; double p1 = 0d; if (!double.TryParse(ppl[0], out p0)) { valid = false; } else { for (int i = 1; i < ppl.Length; i++) { if (!double.TryParse(ppl[i], out p1) || p1 <= p0) { valid = false; break; } p0 = p1; } } if (!valid) txt.Text = def; }
/// <summary>If the provided TextBox's value doesn't parse to an int, then replace it with the provided default value.</summary> /// <param name="txt">The default value to replace with.</param> /// <param name="def">The default value to revert to if the value is invalid.</param> /// <param name="minValue">The lowest that the value is allowed to be.</param> private void enforceInt(TextBox txt, string def, int minValue) { int val = 0; if (!int.TryParse(txt.Text, out val) || val < minValue) txt.Text = def; }
/// <summary>If the provided TextBox's value doesn't parse to an int, then replace it with the provided default value.</summary> /// <param name="txt">The default value to replace with.</param> /// <param name="def">The default value to revert to if the value is invalid.</param> private void enforceInt(TextBox txt, string def) { enforceInt(txt, def, int.MinValue); }
/// <summary>If the provided TextBox's value doesn't parse to a double, then replace it with the provided default value.</summary> /// <param name="txt">The default value to replace with.</param> /// <param name="def">The default value to revert to if the value is invalid.</param> /// <param name="minValue">The lowest that the value is allowed to be.</param> private void enforceDouble(TextBox txt, string def, double minValue) { double val = 0d; if (!double.TryParse(txt.Text, out val) || val < minValue) txt.Text = def; }
/// <summary>If the provided TextBox's value doesn't parse to a double, then replace it with the provided default value.</summary> /// <param name="txt">The default value to replace with.</param> /// <param name="def">The default value to revert to if the value is invalid.</param> private void enforceDouble(TextBox txt, string def) { enforceDouble(txt, def, double.MinValue); }
/// <summary>Builds the GUI.</summary> /// <param name="graphics">The graphics device manager to use.</param> private void buildGUI(GraphicsDeviceManager graphics) { #region Defaults // set defaults first Desktop.DefControlBackColor = new Color(Color.Blue, .5f); Desktop.DefButtonBackColor = new Color(Color.White, .5f); Desktop.DefButtonBackColorHover = new Color(Color.White, .75f); Desktop.DefButtonBackColorPressed = new Color(Color.Black, .75f); Desktop.DefButtonBackColorP = new Color(Color.Black, .65f); Desktop.DefButtonBackColorHoverP = new Color(Color.Black, .5f); Desktop.DefButtonTextFont = fSegoe; Desktop.DefButtonTextForeColor = Color.Black; Desktop.DefButtonTextForeColorHover = Color.Black; Desktop.DefButtonTextForeColorPressed = Color.Gray; Desktop.DefButtonTextForeColorP = Color.Gray; Desktop.DefButtonTextForeColorHoverP = Color.White; Desktop.DefComboBoxTextBoxBackColor = Color.White; Desktop.DefComboBoxTextBoxForeColor = Color.Black; Desktop.DefComboBoxSidePadding = 5; Desktop.DefComboBoxButtonWidth = 13; Desktop.DefLabelFont = fSegoe; Desktop.DefLabelForeColor = Color.White; Desktop.DefPopUpMenuFont = fSegoe; Desktop.DefPopUpMenuBackColor = Color.LightGray; Desktop.DefPopUpMenuBackColorHover = Color.Blue; Desktop.DefPopUpMenuForeColor = Color.Black; Desktop.DefPopUpMenuForeColorHover = Color.White; Desktop.DefPopUpMenuSidePadding = 5; Desktop.DefTextBoxFont = fSegoe; Desktop.DefTextBoxBackColor = Color.White; Desktop.DefTextBoxForeColor = Color.Black; Desktop.DefTextBoxSidePadding = 5; Desktop.DefTextBoxVertPadding = 5; Desktop.DefTextBoxHighlightColor = new Color(0, 0, 255, 100); Desktop.DefTextBoxEditPositionOffsetX = -1; Desktop.DefTextBoxEditPositionOffsetY = -1; Desktop.DefListBoxBackColor = Color.LightGray; Desktop.DefListBoxBackColorHover = Color.CornflowerBlue; Desktop.DefListBoxBackColorSelected = Color.Blue; Desktop.DefListBoxTextFont = fSegoe; Desktop.DefListBoxTextForeColor = Color.Black; Desktop.DefListBoxTextForeColorHover = Color.Black; Desktop.DefListBoxTextForeColorSelected = Color.White; desktop.TBack = tSegment; #endregion Defaults #region cntSideBar // cntSideBar cntSideBar = new Container(); cntSideBar.Width = 150; cntSideBar.Height = graphics.PreferredBackBufferHeight; cntSideBar.Left = graphics.PreferredBackBufferWidth - cntSideBar.Width; // btnShowSettingsPnl btnShowSettingsPnl = new ButtonText(); btnShowSettingsPnl.Bounds = new Rectangle(10, 10, cntSideBar.Width - 20, 20); btnShowSettingsPnl.IsToggle = true; btnShowSettingsPnl.Text = "Settings"; btnShowSettingsPnl.Font = fSegoeBold; btnShowSettingsPnl.MouseLeftUp += new EventHandler(btnShowWorldPnl_MouseLeftUp); cntSideBar.Controls.Add(btnShowSettingsPnl); // btnShowScriptsPnl btnShowScriptsPnl = new ButtonText(btnShowSettingsPnl); btnShowScriptsPnl.Top += 20; btnShowScriptsPnl.Text = "Scripts"; btnShowScriptsPnl.MouseLeftUp += new EventHandler(btnShowScriptsPnl_MouseLeftUp); cntSideBar.Controls.Add(btnShowScriptsPnl); // btnShowNodeTypesPnl btnShowNodeTypesPnl = new ButtonText(btnShowScriptsPnl); btnShowNodeTypesPnl.Top += 20; btnShowNodeTypesPnl.Text = "Node Types"; btnShowNodeTypesPnl.MouseLeftUp += new EventHandler(btnShowNodeTypesPnl_MouseLeftUp); cntSideBar.Controls.Add(btnShowNodeTypesPnl); // btnShowPlayersPnl btnShowPlayersPnl = new ButtonText(btnShowNodeTypesPnl); btnShowPlayersPnl.Top += 20; btnShowPlayersPnl.Text = "Players"; btnShowPlayersPnl.MouseLeftUp += new EventHandler(btnShowPlayersPnl_MouseLeftUp); cntSideBar.Controls.Add(btnShowPlayersPnl); // btnShowEditorPnl btnShowEditorPnl = new ButtonText(btnShowPlayersPnl); btnShowEditorPnl.Top += 20; btnShowEditorPnl.Text = "Editor"; btnShowEditorPnl.MouseLeftUp += new EventHandler(btnShowEditorPnl_MouseLeftUp); cntSideBar.Controls.Add(btnShowEditorPnl); #endregion cntSideBar #region pnlSettings // // pnlSettings // pnlSettings = new Container(); pnlSettings.DrawBack = false; pnlSettings.Bounds = new Rectangle(0, btnShowEditorPnl.Bottom + 10, cntSideBar.Width, 0); // lblWorldWidth lblWorldWidth = new Label(); lblWorldWidth.AutoSize = false; lblWorldWidth.Bounds = new Rectangle(0, 0, 80, 20); lblWorldWidth.Text = "WldWidth:"; lblWorldWidth.TextAlign = Desktop.Alignment.CenterRight; pnlSettings.Controls.Add(lblWorldWidth); // txtWorldWidth txtWorldWidth = new TextBox(); txtWorldWidth.Top = lblWorldWidth.Top; txtWorldWidth.Left = lblWorldWidth.Right + 5; txtWorldWidth.Width = pnlSettings.Width - txtWorldWidth.Left - 10; txtWorldWidth.Height = 20; txtWorldWidth.AllowAlpha = false; txtWorldWidth.AllowedSpecChars = "."; txtWorldWidth.FocusLost += new EventHandler(textBox_FocusLost); txtWorldWidth.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtWorldWidth); // lblWorldHeight lblWorldHeight = new Label(lblWorldWidth); lblWorldHeight.Top += 25; lblWorldHeight.Text = "WldHeight:"; pnlSettings.Controls.Add(lblWorldHeight); // txtWorldHeight txtWorldHeight = new TextBox(txtWorldWidth); txtWorldHeight.Top = lblWorldHeight.Top; txtWorldHeight.FocusLost += new EventHandler(textBox_FocusLost); txtWorldHeight.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtWorldHeight); /********************************************************************************************/ // ctlPersonDivider ctlPersonDivider = new Control(); ctlPersonDivider.Bounds = new Rectangle(10, txtWorldHeight.Bottom + 10, pnlSettings.Width - 20, 1); ctlPersonDivider.BackColor = Desktop.DefButtonBackColor; ctlPersonDivider.Ignore = true; pnlSettings.Controls.Add(ctlPersonDivider); // lblPersonSpacing lblPersonSpacing = new Label(lblWorldHeight); lblPersonSpacing.Top = ctlPersonDivider.Bottom + 10; lblPersonSpacing.Text = "PSpacing:"; pnlSettings.Controls.Add(lblPersonSpacing); // txtPersonSpacing txtPersonSpacing = new TextBox(txtWorldHeight); txtPersonSpacing.Top = lblPersonSpacing.Top; txtPersonSpacing.FocusLost += new EventHandler(textBox_FocusLost); txtPersonSpacing.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtPersonSpacing); // lblPersonSpeedLower lblPersonSpeedLower = new Label(lblPersonSpacing); lblPersonSpeedLower.Top += 25; lblPersonSpeedLower.Text = "PSpeed-:"; pnlSettings.Controls.Add(lblPersonSpeedLower); // txtPersonSpeedLower txtPersonSpeedLower = new TextBox(txtPersonSpacing); txtPersonSpeedLower.Top = lblPersonSpeedLower.Top; txtPersonSpeedLower.FocusLost += new EventHandler(textBox_FocusLost); txtPersonSpeedLower.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtPersonSpeedLower); // lblPersonSpeedUpper lblPersonSpeedUpper = new Label(lblPersonSpeedLower); lblPersonSpeedUpper.Top += 25; lblPersonSpeedUpper.Text = "PSpeed+:"; pnlSettings.Controls.Add(lblPersonSpeedUpper); // txtPersonSpeedUpper txtPersonSpeedUpper = new TextBox(txtPersonSpeedLower); txtPersonSpeedUpper.Top = lblPersonSpeedUpper.Top; txtPersonSpeedUpper.FocusLost += new EventHandler(textBox_FocusLost); txtPersonSpeedUpper.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtPersonSpeedUpper); /********************************************************************************************/ // ctlSegmentDivider ctlSegmentDivider = new Control(ctlPersonDivider); ctlSegmentDivider.Top = txtPersonSpeedUpper.Bottom + 10; pnlSettings.Controls.Add(ctlSegmentDivider); // lblWorldRetractSpeed lblRetractSpeed = new Label(lblPersonSpeedUpper); lblRetractSpeed.Top = ctlSegmentDivider.Bottom + 10; lblRetractSpeed.Text = "RSpeed:"; pnlSettings.Controls.Add(lblRetractSpeed); // txtRetractSpeed txtRetractSpeed = new TextBox(txtPersonSpeedUpper); txtRetractSpeed.Top = lblRetractSpeed.Top; txtRetractSpeed.FocusLost += new EventHandler(textBox_FocusLost); txtRetractSpeed.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtRetractSpeed); // lblBuildRate lblBuildRate = new Label(lblRetractSpeed); lblBuildRate.Top += 25; lblBuildRate.Text = "BuildRt:"; pnlSettings.Controls.Add(lblBuildRate); // txtBuildRate txtBuildRate = new TextBox(txtRetractSpeed); txtBuildRate.Top = lblBuildRate.Top; txtBuildRate.FocusLost += new EventHandler(textBox_FocusLost); txtBuildRate.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtBuildRate); /********************************************************************************************/ // ctlCamDivider ctlCamDivider = new Control(ctlPersonDivider); ctlCamDivider.Top = txtBuildRate.Bottom + 10; pnlSettings.Controls.Add(ctlCamDivider); // lblCamWidth lblCamWidth = new Label(lblBuildRate); lblCamWidth.Top = ctlCamDivider.Bottom + 10; lblCamWidth.Text = "CamWidth:"; pnlSettings.Controls.Add(lblCamWidth); // txtCamWidth txtCamWidth = new TextBox(txtBuildRate); txtCamWidth.Top = lblCamWidth.Top; txtCamWidth.FocusLost += new EventHandler(textBox_FocusLost); txtCamWidth.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtCamWidth); // lblCamHeight lblCamHeight = new Label(lblCamWidth); lblCamHeight.Top += 25; lblCamHeight.Text = "CamHeight:"; pnlSettings.Controls.Add(lblCamHeight); // txtCamHeight txtCamHeight = new TextBox(txtCamWidth); txtCamHeight.Top = lblCamHeight.Top; txtCamHeight.FocusLost += new EventHandler(textBox_FocusLost); txtCamHeight.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtCamHeight); // lblCamX lblCamX = new Label(lblCamHeight); lblCamX.Top += 25; lblCamX.Text = "Cam X:"; pnlSettings.Controls.Add(lblCamX); // txtCamX txtCamX = new TextBox(txtCamHeight); txtCamX.Top = lblCamX.Top; txtCamX.FocusLost += new EventHandler(textBox_FocusLost); txtCamX.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtCamX); // lblCamY lblCamY = new Label(lblCamX); lblCamY.Top += 25; lblCamY.Text = "Cam Y:"; pnlSettings.Controls.Add(lblCamY); // txtCamY txtCamY = new TextBox(txtCamX); txtCamY.Top = lblCamY.Top; txtCamY.FocusLost += new EventHandler(textBox_FocusLost); txtCamY.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtCamY); /********************************************************************************************/ // ctlGridDivider ctlGridDivider = new Control(ctlPersonDivider); ctlGridDivider.Top = txtCamY.Bottom + 10; pnlSettings.Controls.Add(ctlGridDivider); // lblGridRows lblGridRows = new Label(lblCamY); lblGridRows.Top = ctlGridDivider.Bottom + 10; lblGridRows.Text = "GridRows:"; pnlSettings.Controls.Add(lblGridRows); // txtGridRows txtGridRows = new TextBox(txtCamY); txtGridRows.Top = lblGridRows.Top; txtGridRows.AllowedSpecChars = string.Empty; txtGridRows.FocusLost += new EventHandler(textBox_FocusLost); txtGridRows.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtGridRows); // lblGridCols lblGridCols = new Label(lblGridRows); lblGridCols.Top += 25; lblGridCols.Text = "GridCols:"; pnlSettings.Controls.Add(lblGridCols); // txtGridCols txtGridCols = new TextBox(txtGridRows); txtGridCols.Top = lblGridCols.Top; txtGridCols.FocusLost += new EventHandler(textBox_FocusLost); txtGridCols.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtGridCols); /********************************************************************************************/ // ctlFogDivider ctlFogDivider = new Control(ctlPersonDivider); ctlFogDivider.Top = txtGridCols.Bottom + 10; pnlSettings.Controls.Add(ctlFogDivider); // lblFogRows lblFogRows = new Label(lblGridCols); lblFogRows.Top = ctlFogDivider.Bottom + 10; lblFogRows.Text = "FogRows:"; pnlSettings.Controls.Add(lblFogRows); // txtFogRows txtFogRows = new TextBox(txtGridCols); txtFogRows.Top = lblFogRows.Top; txtFogRows.FocusLost += new EventHandler(textBox_FocusLost); txtFogRows.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtFogRows); // lblFogCols lblFogCols = new Label(lblFogRows); lblFogCols.Top += 25; lblFogCols.Text = "FogCols:"; pnlSettings.Controls.Add(lblFogCols); // txtFogCols txtFogCols = new TextBox(txtFogRows); txtFogCols.Top = lblFogCols.Top; txtFogCols.FocusLost += new EventHandler(textBox_FocusLost); txtFogCols.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtFogCols); /********************************************************************************************/ // ctlPathDivider ctlPathDivider = new Control(ctlPersonDivider); ctlPathDivider.Top = txtFogCols.Bottom + 10; pnlSettings.Controls.Add(ctlPathDivider); // lblPathRows lblPathRows = new Label(lblFogCols); lblPathRows.Top = ctlPathDivider.Bottom + 10; lblPathRows.Text = "PathRows:"; pnlSettings.Controls.Add(lblPathRows); // txtPathRows txtPathRows = new TextBox(txtFogCols); txtPathRows.Top = lblPathRows.Top; txtPathRows.FocusLost += new EventHandler(textBox_FocusLost); txtPathRows.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtPathRows); // lblPathCols lblPathCols = new Label(lblPathRows); lblPathCols.Top += 25; lblPathCols.Text = "PathCols:"; pnlSettings.Controls.Add(lblPathCols); // txtPathCols txtPathCols = new TextBox(txtPathRows); txtPathCols.Top = lblPathCols.Top; txtPathCols.FocusLost += new EventHandler(textBox_FocusLost); txtPathCols.FocusReceived += new EventHandler(textBox_FocusReceived); pnlSettings.Controls.Add(txtPathCols); pnlSettings.AutoHeight(); cntSideBar.Controls.Add(pnlSettings); #endregion pnlSettings #region pnlScripts // // pnlScripts // pnlScripts = new Container(pnlSettings); // lblScriptsBeginUpdateScript lblScriptsBeginUpdateScript = new Label(lblWorldWidth); lblScriptsBeginUpdateScript.Top = 0; lblScriptsBeginUpdateScript.Text = "Begin Update:"; pnlScripts.Controls.Add(lblScriptsBeginUpdateScript); // btnScriptsBeginUpdateScript btnScriptsBeginUpdateScript = new ButtonText(); btnScriptsBeginUpdateScript.Bounds = new Rectangle(pnlScripts.Width - 30, lblScriptsBeginUpdateScript.Top, 20, 20); btnScriptsBeginUpdateScript.Text = "..."; btnScriptsBeginUpdateScript.MouseLeftUp += new EventHandler(btnScriptsBeginUpdateScript_MouseLeftUp); pnlScripts.Controls.Add(btnScriptsBeginUpdateScript); // lblScriptsBeginUpdateScriptView lblScriptsBeginUpdateScriptView = new Label(lblScriptsBeginUpdateScript); lblScriptsBeginUpdateScriptView.Left = lblScriptsBeginUpdateScript.Right + 5; lblScriptsBeginUpdateScriptView.Top = lblScriptsBeginUpdateScript.Top; lblScriptsBeginUpdateScriptView.Width = btnScriptsBeginUpdateScript.Left - lblScriptsBeginUpdateScriptView.Left; lblScriptsBeginUpdateScriptView.TextAlign = Desktop.Alignment.Center; lblScriptsBeginUpdateScriptView.Text = "---"; pnlScripts.Controls.Add(lblScriptsBeginUpdateScriptView); pnlScripts.AutoHeight(); cntSideBar.Controls.Add(pnlScripts); #endregion pnlScripts #region pnlNodeTypes // // pnlNodeTypes // pnlNodeTypes = new Container(pnlSettings); // cmbNodeTypes cmbNodeTypes = new ComboBox(); cmbNodeTypes.Bounds = new Rectangle(10, 0, pnlNodeTypes.Width - 20, 20); pnlNodeTypes.Controls.Add(cmbNodeTypes); // btnNodeTypeLoad btnNodeTypeLoad = new ButtonText(); btnNodeTypeLoad.Bounds = new Rectangle(10, cmbNodeTypes.Bottom + 10, (pnlNodeTypes.Width - 20) / 4, 20); btnNodeTypeLoad.Text = "Load"; btnNodeTypeLoad.MouseLeftUp += new EventHandler(btnNodeTypeLoad_MouseLeftUp); pnlNodeTypes.Controls.Add(btnNodeTypeLoad); // btnNodeTypeUpdate btnNodeTypeUpdate = new ButtonText(btnNodeTypeLoad); btnNodeTypeUpdate.Left = btnNodeTypeLoad.Right; btnNodeTypeUpdate.Width = (pnlNodeTypes.Width - btnNodeTypeUpdate.Left - 10) / 3; btnNodeTypeUpdate.Text = "Save"; btnNodeTypeUpdate.MouseLeftUp += new EventHandler(btnNodeTypeUpdate_MouseLeftUp); pnlNodeTypes.Controls.Add(btnNodeTypeUpdate); // btnNodeTypeAddNew btnNodeTypeAddNew = new ButtonText(btnNodeTypeUpdate); btnNodeTypeAddNew.Left = btnNodeTypeUpdate.Right; btnNodeTypeAddNew.Width = (pnlNodeTypes.Width - btnNodeTypeAddNew.Left - 10) / 2; btnNodeTypeAddNew.Text = "Add"; btnNodeTypeAddNew.MouseLeftUp += new EventHandler(btnNodeTypeAddNew_MouseLeftUp); pnlNodeTypes.Controls.Add(btnNodeTypeAddNew); // btnNodeTypeDelete btnNodeTypeDelete = new ButtonText(btnNodeTypeAddNew); btnNodeTypeDelete.Left = btnNodeTypeDelete.Right; btnNodeTypeDelete.Width = pnlNodeTypes.Width - btnNodeTypeDelete.Left - 10; btnNodeTypeDelete.Text = "Del"; btnNodeTypeDelete.MouseLeftUp += new EventHandler(btnNodeTypeDelete_MouseLeftUp); pnlNodeTypes.Controls.Add(btnNodeTypeDelete); // lblNodeTypeName lblNodeTypeName = new Label(); lblNodeTypeName.AutoSize = false; lblNodeTypeName.Bounds = new Rectangle(0, btnNodeTypeDelete.Bottom + 10, 80, 20); lblNodeTypeName.Text = "Name:"; lblNodeTypeName.TextAlign = Desktop.Alignment.CenterRight; pnlNodeTypes.Controls.Add(lblNodeTypeName); // txtNodeTypeName txtNodeTypeName = new TextBox(); txtNodeTypeName.Top = lblNodeTypeName.Top; txtNodeTypeName.Left = lblNodeTypeName.Right + 5; txtNodeTypeName.Width = pnlNodeTypes.Width - txtNodeTypeName.Left - 10; txtNodeTypeName.Height = 20; txtNodeTypeName.FocusLost += new EventHandler(textBox_FocusLost); txtNodeTypeName.FocusReceived += new EventHandler(textBox_FocusReceived); pnlNodeTypes.Controls.Add(txtNodeTypeName); // lblNodeTypeIsParent lblNodeTypeIsParent = new Label(lblNodeTypeName); lblNodeTypeIsParent.Top += 25; lblNodeTypeIsParent.Text = "Parent:"; pnlNodeTypes.Controls.Add(lblNodeTypeIsParent); // btnNodeTypeIsParent btnNodeTypeIsParent = new Button(); btnNodeTypeIsParent.Left = lblNodeTypeIsParent.Right + 5; btnNodeTypeIsParent.Top = lblNodeTypeIsParent.Top + 5; btnNodeTypeIsParent.Height = lblNodeTypeIsParent.Height - 10; btnNodeTypeIsParent.Width = btnNodeTypeIsParent.Height; btnNodeTypeIsParent.IsToggle = true; btnNodeTypeIsParent.BackColorP = Desktop.DefButtonBackColor; btnNodeTypeIsParent.BackColor = Color.White; pnlNodeTypes.Controls.Add(btnNodeTypeIsParent); // lblNodeTypeNumSegs lblNodeTypeNumSegs = new Label(lblNodeTypeName); lblNodeTypeNumSegs.Top = lblNodeTypeIsParent.Bottom + 5; lblNodeTypeNumSegs.Text = "NumSegs:"; pnlNodeTypes.Controls.Add(lblNodeTypeNumSegs); // txtNodeTypeNumSegs txtNodeTypeNumSegs = new TextBox(txtNodeTypeName); txtNodeTypeNumSegs.Top = lblNodeTypeNumSegs.Top; txtNodeTypeNumSegs.AllowAlpha = false; txtNodeTypeNumSegs.AllowedSpecChars = string.Empty; txtNodeTypeNumSegs.FocusLost += new EventHandler(textBox_FocusLost); txtNodeTypeNumSegs.FocusReceived += new EventHandler(textBox_FocusReceived); pnlNodeTypes.Controls.Add(txtNodeTypeNumSegs); // lblNodeTypeRadius lblNodeTypeRadius = new Label(lblNodeTypeNumSegs); lblNodeTypeRadius.Top = txtNodeTypeNumSegs.Bottom + 5; lblNodeTypeRadius.Text = "Radius:"; pnlNodeTypes.Controls.Add(lblNodeTypeRadius); // txtNodeTypeRadius txtNodeTypeRadius = new TextBox(txtNodeTypeNumSegs); txtNodeTypeRadius.Top = lblNodeTypeRadius.Top; txtNodeTypeRadius.AllowedSpecChars = "."; txtNodeTypeRadius.FocusLost += new EventHandler(textBox_FocusLost); txtNodeTypeRadius.FocusReceived += new EventHandler(textBox_FocusReceived); pnlNodeTypes.Controls.Add(txtNodeTypeRadius); // lblNodeTypeSpacing lblNodeTypeSpacing = new Label(lblNodeTypeRadius); lblNodeTypeSpacing.Top = txtNodeTypeRadius.Bottom + 5; lblNodeTypeSpacing.Text = "Spacing:"; pnlNodeTypes.Controls.Add(lblNodeTypeSpacing); // txtNodeTypeSpacing txtNodeTypeSpacing = new TextBox(txtNodeTypeRadius); txtNodeTypeSpacing.Top = lblNodeTypeSpacing.Top; txtNodeTypeSpacing.FocusLost += new EventHandler(textBox_FocusLost); txtNodeTypeSpacing.FocusReceived += new EventHandler(textBox_FocusReceived); pnlNodeTypes.Controls.Add(txtNodeTypeSpacing); // lblNodeTypeGenSpacing lblNodeTypeGenSpacing = new Label(lblNodeTypeSpacing); lblNodeTypeGenSpacing.Top = txtNodeTypeSpacing.Bottom + 5; lblNodeTypeGenSpacing.Text = "GenSpace:"; pnlNodeTypes.Controls.Add(lblNodeTypeGenSpacing); // txtNodeTypeGenSpacing txtNodeTypeGenSpacing = new TextBox(txtNodeTypeSpacing); txtNodeTypeGenSpacing.Top = lblNodeTypeGenSpacing.Top; txtNodeTypeGenSpacing.FocusLost += new EventHandler(textBox_FocusLost); txtNodeTypeGenSpacing.FocusReceived += new EventHandler(textBox_FocusReceived); pnlNodeTypes.Controls.Add(txtNodeTypeGenSpacing); // lblNodeTypeSightDistance lblNodeTypeSightDistance = new Label(lblNodeTypeGenSpacing); lblNodeTypeSightDistance.Top = txtNodeTypeGenSpacing.Bottom + 5; lblNodeTypeSightDistance.Text = "SightDist:"; pnlNodeTypes.Controls.Add(lblNodeTypeSightDistance); // txtNodeTypeSightDistance txtNodeTypeSightDistance = new TextBox(txtNodeTypeGenSpacing); txtNodeTypeSightDistance.Top = lblNodeTypeSightDistance.Top; txtNodeTypeSightDistance.FocusLost += new EventHandler(textBox_FocusLost); txtNodeTypeSightDistance.FocusReceived += new EventHandler(textBox_FocusReceived); pnlNodeTypes.Controls.Add(txtNodeTypeSightDistance); // lblNodeTypeBuildRangeMin lblNodeTypeBuildRangeMin = new Label(lblNodeTypeSightDistance); lblNodeTypeBuildRangeMin.Top = txtNodeTypeSightDistance.Bottom + 5; lblNodeTypeBuildRangeMin.Text = "BuildMin:"; pnlNodeTypes.Controls.Add(lblNodeTypeBuildRangeMin); // txtNodeTypeBuildRangeMin txtNodeTypeBuildRangeMin = new TextBox(txtNodeTypeSightDistance); txtNodeTypeBuildRangeMin.Top = lblNodeTypeBuildRangeMin.Top; txtNodeTypeBuildRangeMin.FocusLost += new EventHandler(textBox_FocusLost); txtNodeTypeBuildRangeMin.FocusReceived += new EventHandler(textBox_FocusReceived); pnlNodeTypes.Controls.Add(txtNodeTypeBuildRangeMin); pnlNodeTypes.AutoHeight(); cntSideBar.Controls.Add(pnlNodeTypes); #endregion pnlNodeTypes #region pnlPlayers // // pnlPlayers // pnlPlayers = new Container(pnlSettings); // cmbPlayers cmbPlayers = new ComboBox(); cmbPlayers.Bounds = new Rectangle(10, 0, pnlPlayers.Width - 20, 20); pnlPlayers.Controls.Add(cmbPlayers); // btnPlayerLoad btnPlayerLoad = new ButtonText(); btnPlayerLoad.Bounds = new Rectangle(10, cmbPlayers.Bottom + 10, (pnlPlayers.Width - 20) / 4, 20); btnPlayerLoad.Text = "Load"; btnPlayerLoad.MouseLeftUp += new EventHandler(btnPlayerLoad_MouseLeftUp); pnlPlayers.Controls.Add(btnPlayerLoad); // btnPlayerUpdate btnPlayerUpdate = new ButtonText(btnPlayerLoad); btnPlayerUpdate.Left = btnPlayerLoad.Right; btnPlayerUpdate.Width = (pnlPlayers.Width - btnPlayerUpdate.Left - 10) / 3; btnPlayerUpdate.Text = "Save"; btnPlayerUpdate.MouseLeftUp += new EventHandler(btnPlayerUpdate_MouseLeftUp); pnlPlayers.Controls.Add(btnPlayerUpdate); // btnPlayerAddNew btnPlayerAddNew = new ButtonText(btnPlayerUpdate); btnPlayerAddNew.Left = btnPlayerUpdate.Right; btnPlayerAddNew.Width = (pnlPlayers.Width - btnPlayerAddNew.Left - 10) / 2; btnPlayerAddNew.Text = "Add"; btnPlayerAddNew.MouseLeftUp += new EventHandler(btnPlayerAddNew_MouseLeftUp); pnlPlayers.Controls.Add(btnPlayerAddNew); // btnPlayerDelete btnPlayerDelete = new ButtonText(btnPlayerAddNew); btnPlayerDelete.Left = btnPlayerAddNew.Right; btnPlayerDelete.Width = pnlPlayers.Width - btnPlayerDelete.Left - 10; btnPlayerDelete.Text = "Del"; btnPlayerDelete.MouseLeftUp += new EventHandler(btnPlayerDelete_MouseLeftUp); pnlPlayers.Controls.Add(btnPlayerDelete); // lblPlayerID lblPlayerID = new Label(); lblPlayerID.AutoSize = false; lblPlayerID.Bounds = new Rectangle(0, btnPlayerDelete.Bottom + 10, 50, 20); lblPlayerID.Text = "ID:"; lblPlayerID.TextAlign = Desktop.Alignment.CenterRight; pnlPlayers.Controls.Add(lblPlayerID); // txtPlayerID txtPlayerID = new TextBox(); txtPlayerID.Top = lblPlayerID.Top; txtPlayerID.Left = lblPlayerID.Right + 5; txtPlayerID.Width = pnlPlayers.Width - txtPlayerID.Left - 10; txtPlayerID.Height = 20; txtPlayerID.FocusLost += new EventHandler(textBox_FocusLost); txtPlayerID.FocusReceived += new EventHandler(textBox_FocusReceived); pnlPlayers.Controls.Add(txtPlayerID); // lblPlayerName lblPlayerName = new Label(lblPlayerID); lblPlayerName.Top = txtPlayerID.Bottom + 10; lblPlayerName.Text = "Name:"; pnlPlayers.Controls.Add(lblPlayerName); // txtPlayerName txtPlayerName = new TextBox(); txtPlayerName.Top = lblPlayerName.Top; txtPlayerName.Left = lblPlayerName.Right + 5; txtPlayerName.Width = pnlPlayers.Width - txtPlayerName.Left - 10; txtPlayerName.Height = 20; txtPlayerName.FocusLost += new EventHandler(textBox_FocusLost); txtPlayerName.FocusReceived += new EventHandler(textBox_FocusReceived); pnlPlayers.Controls.Add(txtPlayerName); // lblPlayerTypes lblPlayerTypes = new Label(lblPlayerName); lblPlayerTypes.Top += 25; lblPlayerTypes.Text = "Type:"; pnlPlayers.Controls.Add(lblPlayerTypes); // cmbPlayerTypes cmbPlayerTypes = new ComboBox(cmbPlayers, false); cmbPlayerTypes.Top = lblPlayerTypes.Top; cmbPlayerTypes.Left = lblPlayerTypes.Right + 5; cmbPlayerTypes.Width = pnlPlayers.Width - cmbPlayerTypes.Left - 10; cmbPlayerTypes.Menu.addRange(new string[] { "Human", "Network", "Computer" }); pnlPlayers.Controls.Add(cmbPlayerTypes); pnlPlayers.AutoHeight(); cntSideBar.Controls.Add(pnlPlayers); #endregion pnlPlayers #region pnlEditor // // pnlEditor // pnlEditor = new Container(pnlSettings); #region Add Objects // btnAddNode btnAddNode = new ButtonText(btnShowSettingsPnl); btnAddNode.Top = 0; btnAddNode.Text = "Add Node"; btnAddNode.Font = fSegoe; btnAddNode.MouseLeftUp += new EventHandler(btnAddNode_MouseLeftUp); pnlEditor.Controls.Add(btnAddNode); // btnAddSeg btnAddSeg = new ButtonText(btnAddNode); btnAddSeg.Top += 20; btnAddSeg.Text = "Add Segment"; btnAddSeg.MouseLeftUp += new EventHandler(btnAddSeg_MouseLeftUp); pnlEditor.Controls.Add(btnAddSeg); // btnAddGeo btnAddGeo = new ButtonText(btnAddSeg); btnAddGeo.Top += 20; btnAddGeo.Text = "Add Geo"; btnAddGeo.MouseLeftUp += new EventHandler(btnAddGeo_MouseLeftUp); pnlEditor.Controls.Add(btnAddGeo); // btnAddHotSpot btnAddHotspot = new ButtonText(btnAddGeo); btnAddHotspot.Top += 20; btnAddHotspot.Text = "Add Hotspot"; btnAddHotspot.MouseLeftUp += new EventHandler(btnAddHotspot_MouseLeftUp); pnlEditor.Controls.Add(btnAddHotspot); // // pnlEditorAddNodes // pnlEditorAddNodes = new Container(); pnlEditorAddNodes.DrawBack = false; pnlEditorAddNodes.Bounds = new Rectangle(0, btnAddHotspot.Bottom + 10, pnlEditor.Width, 0); // lblEditorAddNodeOwner lblEditorAddNodeOwner = new Label(); lblEditorAddNodeOwner.AutoSize = false; lblEditorAddNodeOwner.Bounds = new Rectangle(10, 0, 80, 20); lblEditorAddNodeOwner.Text = "Owner:"; lblEditorAddNodeOwner.TextAlign = Desktop.Alignment.BottomLeft; pnlEditorAddNodes.Controls.Add(lblEditorAddNodeOwner); // cmbEditorAddNodeOwner cmbEditorAddNodeOwner = new ComboBox(); cmbEditorAddNodeOwner.Bounds = new Rectangle(10, lblEditorAddNodeOwner.Bottom + 5, pnlEditor.Width - 20, 20); pnlEditorAddNodes.Controls.Add(cmbEditorAddNodeOwner); // lblEditorAddNodeType lblEditorAddNodeType = new Label(lblEditorAddNodeOwner); lblEditorAddNodeType.Top = cmbEditorAddNodeOwner.Bottom + 10; lblEditorAddNodeType.Text = "Type:"; pnlEditorAddNodes.Controls.Add(lblEditorAddNodeType); // cmbEditorAddNodeType cmbEditorAddNodeType = new ComboBox(cmbEditorAddNodeOwner, false); cmbEditorAddNodeType.Top = lblEditorAddNodeType.Bottom + 5; pnlEditorAddNodes.Controls.Add(cmbEditorAddNodeType); pnlEditorAddNodes.AutoHeight(); pnlEditor.Controls.Add(pnlEditorAddNodes); // // pnlEditorAddSegs // pnlEditorAddSegs = new Container(pnlEditorAddNodes); // lblEditorAddSegOwner lblEditorAddSegOwner = new Label(lblEditorAddNodeOwner); pnlEditorAddSegs.Controls.Add(lblEditorAddSegOwner); // cmbEditorAddSegOwner cmbEditorAddSegOwner = new ComboBox(cmbEditorAddNodeOwner, true); pnlEditorAddSegs.Controls.Add(cmbEditorAddSegOwner); pnlEditorAddSegs.AutoHeight(); pnlEditor.Controls.Add(pnlEditorAddSegs); // // pnlEditorAddGeos // pnlEditorAddGeos = new Container(pnlEditorAddSegs); pnlEditorAddGeos.Height = 0; pnlEditor.Controls.Add(pnlEditorAddGeos); // // pnlEditorAddHotspots // pnlEditorAddHotspots = new Container(pnlEditorAddGeos); pnlEditorAddHotspots.Height = 0; pnlEditor.Controls.Add(pnlEditorAddHotspots); // ctlEditorDivider ctlEditorDivider = new Control(); ctlEditorDivider.Bounds = new Rectangle(10, btnAddHotspot.Bottom + 10, pnlEditor.Width - 20, 1); ctlEditorDivider.BackColor = Desktop.DefButtonBackColor; ctlEditorDivider.Ignore = true; pnlEditor.Controls.Add(ctlEditorDivider); #endregion Add Objects #region pnlEditorNodes // // pnlEditorNodes // pnlEditorNodes = new Container(pnlEditorAddHotspots); pnlEditorNodes.Top = ctlEditorDivider.Bottom + 10; // lblEditorNodeOwner lblEditorNodeOwner = new Label(lblEditorAddNodeOwner); lblEditorNodeOwner.Top = 0; pnlEditorNodes.Controls.Add(lblEditorNodeOwner); // cmbEditorNodeOwner cmbEditorNodeOwner = new ComboBox(cmbEditorAddNodeOwner, true); cmbEditorNodeOwner.Top = lblEditorNodeOwner.Bottom + 5; pnlEditorNodes.Controls.Add(cmbEditorNodeOwner); // lblEditorNodeType lblEditorNodeType = new Label(lblEditorAddNodeType); lblEditorNodeType.Top = cmbEditorNodeOwner.Bottom + 10; pnlEditorNodes.Controls.Add(lblEditorNodeType); // cmbEditorNodeType cmbEditorNodeType = new ComboBox(cmbEditorAddNodeType, true); cmbEditorNodeType.Top = lblEditorNodeType.Bottom + 5; pnlEditorNodes.Controls.Add(cmbEditorNodeType); // btnEditorNodeLoadType btnEditorNodeLoadType = new ButtonText(); btnEditorNodeLoadType.Bounds = new Rectangle(10, cmbEditorNodeType.Bottom + 5, cmbEditorNodeType.Width, 20); btnEditorNodeLoadType.Text = "Load"; btnEditorNodeLoadType.MouseLeftUp += new EventHandler(btnEditorNodeLoadType_MouseLeftUp); pnlEditorNodes.Controls.Add(btnEditorNodeLoadType); // lblEditorNodeID lblEditorNodeID = new Label(lblEditorNodeOwner); lblEditorNodeID.Top = btnEditorNodeLoadType.Bottom + 10; lblEditorNodeID.Left = 0; lblEditorNodeID.TextAlign = Desktop.Alignment.CenterRight; lblEditorNodeID.Text = "ID:"; pnlEditorNodes.Controls.Add(lblEditorNodeID); // txtEditorNodeID txtEditorNodeID = new TextBox(); txtEditorNodeID.Top = lblEditorNodeID.Top; txtEditorNodeID.Left = lblEditorNodeID.Right + 5; txtEditorNodeID.Width = pnlEditorNodes.Width - txtEditorNodeID.Left - 10; txtEditorNodeID.Height = 20; txtEditorNodeID.AllowAlpha = false; txtEditorNodeID.FocusLost += new EventHandler(textBox_FocusLost); txtEditorNodeID.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorNodes.Controls.Add(txtEditorNodeID); // lblEditorNodeIsParent lblEditorNodeIsParent = new Label(lblEditorNodeID); lblEditorNodeIsParent.Top = txtEditorNodeID.Bottom + 10; lblEditorNodeIsParent.Text = "Parent:"; pnlEditorNodes.Controls.Add(lblEditorNodeIsParent); // btnEditorNodeIsParent btnEditorNodeIsParent = new Button(); btnEditorNodeIsParent.Left = lblEditorNodeIsParent.Right + 5; btnEditorNodeIsParent.Top = lblEditorNodeIsParent.Top + 5; btnEditorNodeIsParent.Height = lblEditorNodeIsParent.Height - 10; btnEditorNodeIsParent.Width = btnEditorNodeIsParent.Height; btnEditorNodeIsParent.IsToggle = true; btnEditorNodeIsParent.BackColorP = Desktop.DefButtonBackColor; btnEditorNodeIsParent.BackColor = Color.White; pnlEditorNodes.Controls.Add(btnEditorNodeIsParent); // lblEditorNodeNumSegs lblEditorNodeNumSegs = new Label(lblEditorNodeIsParent); lblEditorNodeNumSegs.Top = lblEditorNodeIsParent.Bottom + 5; lblEditorNodeNumSegs.Text = "NumSegs:"; pnlEditorNodes.Controls.Add(lblEditorNodeNumSegs); // txtEditorNodeNumSegs txtEditorNodeNumSegs = new TextBox(txtEditorNodeID); txtEditorNodeNumSegs.Top = lblEditorNodeNumSegs.Top; txtEditorNodeNumSegs.FocusLost += new EventHandler(textBox_FocusLost); txtEditorNodeNumSegs.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorNodes.Controls.Add(txtEditorNodeNumSegs); // lblEditorNodeRadius lblEditorNodeRadius = new Label(lblEditorNodeNumSegs); lblEditorNodeRadius.Top = txtEditorNodeNumSegs.Bottom + 5; lblEditorNodeRadius.Text = "Radius:"; pnlEditorNodes.Controls.Add(lblEditorNodeRadius); // txtEditorNodeRadius txtEditorNodeRadius = new TextBox(txtEditorNodeNumSegs); txtEditorNodeRadius.Top = lblEditorNodeRadius.Top; txtEditorNodeRadius.AllowedSpecChars = "."; txtEditorNodeRadius.FocusLost += new EventHandler(textBox_FocusLost); txtEditorNodeRadius.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorNodes.Controls.Add(txtEditorNodeRadius); // lblEditorNodeSpacing lblEditorNodeSpacing = new Label(lblEditorNodeRadius); lblEditorNodeSpacing.Top = txtEditorNodeRadius.Bottom + 5; lblEditorNodeSpacing.Text = "Spacing:"; pnlEditorNodes.Controls.Add(lblEditorNodeSpacing); // txtEditorNodeSpacing txtEditorNodeSpacing = new TextBox(txtEditorNodeRadius); txtEditorNodeSpacing.Top = lblEditorNodeSpacing.Top; txtEditorNodeSpacing.FocusLost += new EventHandler(textBox_FocusLost); txtEditorNodeSpacing.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorNodes.Controls.Add(txtEditorNodeSpacing); // lblEditorNodeGenSpacing lblEditorNodeGenSpacing = new Label(lblEditorNodeSpacing); lblEditorNodeGenSpacing.Top = txtEditorNodeSpacing.Bottom + 5; lblEditorNodeGenSpacing.Text = "GenSpace:"; pnlEditorNodes.Controls.Add(lblEditorNodeGenSpacing); // txtEditorNodeGenSpacing txtEditorNodeGenSpacing = new TextBox(txtEditorNodeSpacing); txtEditorNodeGenSpacing.Top = lblEditorNodeGenSpacing.Top; txtEditorNodeGenSpacing.FocusLost += new EventHandler(textBox_FocusLost); txtEditorNodeGenSpacing.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorNodes.Controls.Add(txtEditorNodeGenSpacing); // lblEditorNodeGenCountDown lblEditorNodeGenCountDown = new Label(lblEditorNodeGenSpacing); lblEditorNodeGenCountDown.Top = txtEditorNodeGenSpacing.Bottom + 5; lblEditorNodeGenCountDown.Text = "GenCntDwn:"; pnlEditorNodes.Controls.Add(lblEditorNodeGenCountDown); // txtEditorNodeGenCountDown txtEditorNodeGenCountDown = new TextBox(txtEditorNodeGenSpacing); txtEditorNodeGenCountDown.Top = lblEditorNodeGenCountDown.Top; txtEditorNodeGenCountDown.FocusLost += new EventHandler(textBox_FocusLost); txtEditorNodeGenCountDown.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorNodes.Controls.Add(txtEditorNodeGenCountDown); // lblEditorNodeSightDist lblEditorNodeSightDist = new Label(lblEditorNodeGenCountDown); lblEditorNodeSightDist.Top = txtEditorNodeGenCountDown.Bottom + 5; lblEditorNodeSightDist.Text = "SightDist:"; pnlEditorNodes.Controls.Add(lblEditorNodeSightDist); // txtEditorNodeSightDist txtEditorNodeSightDist = new TextBox(txtEditorNodeGenCountDown); txtEditorNodeSightDist.Top = lblEditorNodeSightDist.Top; txtEditorNodeSightDist.FocusLost += new EventHandler(textBox_FocusLost); txtEditorNodeSightDist.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorNodes.Controls.Add(txtEditorNodeSightDist); // lblEditorNodeX lblEditorNodeX = new Label(lblEditorNodeSightDist); lblEditorNodeX.Top = txtEditorNodeSightDist.Bottom + 5; lblEditorNodeX.Text = "X:"; pnlEditorNodes.Controls.Add(lblEditorNodeX); // txtEditorNodeX txtEditorNodeX = new TextBox(txtEditorNodeSightDist); txtEditorNodeX.Top = lblEditorNodeX.Top; txtEditorNodeX.FocusLost += new EventHandler(textBox_FocusLost); txtEditorNodeX.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorNodes.Controls.Add(txtEditorNodeX); // lblEditorNodeY lblEditorNodeY = new Label(lblEditorNodeX); lblEditorNodeY.Top = txtEditorNodeX.Bottom + 5; lblEditorNodeY.Text = "Y:"; pnlEditorNodes.Controls.Add(lblEditorNodeY); // txtEditorNodeY txtEditorNodeY = new TextBox(txtEditorNodeX); txtEditorNodeY.Top = lblEditorNodeY.Top; txtEditorNodeY.FocusLost += new EventHandler(textBox_FocusLost); txtEditorNodeY.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorNodes.Controls.Add(txtEditorNodeY); // lblEditorNodeOwnsHotspot lblEditorNodeOwnsHotspot = new Label(lblEditorNodeY); lblEditorNodeOwnsHotspot.Top = txtEditorNodeY.Bottom + 5; lblEditorNodeOwnsHotspot.Text = "OwnsHotSpot:"; pnlEditorNodes.Controls.Add(lblEditorNodeOwnsHotspot); // txtEditorNodeOwnsHotspot txtEditorNodeOwnsHotspot = new TextBox(txtEditorNodeY); txtEditorNodeOwnsHotspot.Top = lblEditorNodeOwnsHotspot.Top; txtEditorNodeOwnsHotspot.FocusLost += new EventHandler(textBox_FocusLost); txtEditorNodeY.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorNodes.Controls.Add(txtEditorNodeOwnsHotspot); // lblEditorNodeActive lblEditorNodeActive = new Label(lblEditorNodeOwnsHotspot); lblEditorNodeActive.Top = txtEditorNodeOwnsHotspot.Bottom + 5; lblEditorNodeActive.Text = "Active:"; pnlEditorNodes.Controls.Add(lblEditorNodeActive); // btnEditorNodeActive btnEditorNodeActive = new Button(btnEditorNodeIsParent); btnEditorNodeActive.Left = lblEditorNodeActive.Right + 5; btnEditorNodeActive.Top = lblEditorNodeActive.Top + 5; pnlEditorNodes.Controls.Add(btnEditorNodeActive); // btnEditorNodeApply btnEditorNodeApply = new ButtonText(btnEditorNodeLoadType); btnEditorNodeApply.Top = lblEditorNodeActive.Bottom + 10; btnEditorNodeApply.Text = "Apply"; btnEditorNodeApply.MouseLeftUp += new EventHandler(btnEditorNodeApply_MouseLeftUp); pnlEditorNodes.Controls.Add(btnEditorNodeApply); // btnEditorNodeDel btnEditorNodeDel = new ButtonText(btnEditorNodeApply); btnEditorNodeDel.Top = btnEditorNodeApply.Bottom + 10; btnEditorNodeDel.Text = "Delete"; btnEditorNodeDel.MouseLeftUp += new EventHandler(btnEditorNodeDel_MouseLeftUp); pnlEditorNodes.Controls.Add(btnEditorNodeDel); pnlEditorNodes.AutoHeight(); pnlEditor.Controls.Add(pnlEditorNodes); #endregion pnlEditorNodes #region pnlEditorSegs // // pnlEditorSegs // pnlEditorSegs = new Container(pnlEditorNodes); // lblEditorSegOwner lblEditorSegOwner = new Label(lblEditorAddNodeOwner); lblEditorSegOwner.Top = 0; pnlEditorSegs.Controls.Add(lblEditorSegOwner); // cmbEditorSegOwner cmbEditorSegOwner = new ComboBox(cmbEditorAddNodeOwner, true); cmbEditorSegOwner.Top = lblEditorSegOwner.Bottom + 5; pnlEditorSegs.Controls.Add(cmbEditorSegOwner); // lblEditorSegLenLbl lblEditorSegLenLbl = new Label(); lblEditorSegLenLbl.AutoSize = false; lblEditorSegLenLbl.Bounds = new Rectangle(10, cmbEditorSegOwner.Bottom + 10, 55, 20); lblEditorSegLenLbl.TextAlign = Desktop.Alignment.CenterRight; lblEditorSegLenLbl.Text = "Length:"; pnlEditorSegs.Controls.Add(lblEditorSegLenLbl); // lblEditorSegLenVal lblEditorSegLenVal = new Label(lblEditorSegLenLbl); lblEditorSegLenVal.Left = lblEditorSegLenLbl.Right + 5; lblEditorSegLenVal.Top = lblEditorSegLenLbl.Top; lblEditorSegLenVal.Width = pnlEditorSegs.Width - lblEditorSegLenVal.Left - 10; lblEditorSegLenVal.TextAlign = Desktop.Alignment.CenterLeft; pnlEditorSegs.Controls.Add(lblEditorSegLenVal); // lblEditorSegEndLen0 lblEditorSegEndLen0 = new Label(lblEditorSegLenLbl); lblEditorSegEndLen0.Top = lblEditorSegLenVal.Bottom + 5; lblEditorSegEndLen0.Text = "EndLen0:"; pnlEditorSegs.Controls.Add(lblEditorSegEndLen0); // txtEditorSegEndLen0; txtEditorSegEndLen0 = new TextBox(); txtEditorSegEndLen0.Top = lblEditorSegEndLen0.Top; txtEditorSegEndLen0.Left = lblEditorSegEndLen0.Right + 5; txtEditorSegEndLen0.Width = pnlEditorSegs.Width - txtEditorSegEndLen0.Left - 10; txtEditorSegEndLen0.Height = 20; txtEditorSegEndLen0.AllowAlpha = false; txtEditorSegEndLen0.AllowedSpecChars = "."; txtEditorSegEndLen0.FocusLost += new EventHandler(textBox_FocusLost); txtEditorSegEndLen0.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorSegs.Controls.Add(txtEditorSegEndLen0); // lblEditorSegEndLen1; lblEditorSegEndLen1 = new Label(lblEditorSegEndLen0); lblEditorSegEndLen1.Top = txtEditorSegEndLen0.Bottom + 5; lblEditorSegEndLen1.Text = "EndLen1:"; pnlEditorSegs.Controls.Add(lblEditorSegEndLen1); // txtEditorSegEndLen1; txtEditorSegEndLen1 = new TextBox(txtEditorSegEndLen0); txtEditorSegEndLen1.Top = lblEditorSegEndLen1.Top; txtEditorSegEndLen1.FocusLost += new EventHandler(textBox_FocusLost); txtEditorSegEndLen1.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorSegs.Controls.Add(txtEditorSegEndLen1); // lblEditorSegEndState0; lblEditorSegEndState0 = new Label(lblEditorSegEndLen1); lblEditorSegEndState0.Top = txtEditorSegEndLen1.Bottom + 5; lblEditorSegEndState0.Text = "State0:"; pnlEditorSegs.Controls.Add(lblEditorSegEndState0); // cmbEditorSegEndState0; cmbEditorSegEndState0 = new ComboBox(); cmbEditorSegEndState0.Bounds = new Rectangle(lblEditorSegEndState0.Right + 5, lblEditorSegEndState0.Top, pnlPlayers.Width - lblEditorSegEndState0.Right - 15, 20); cmbEditorSegEndState0.Menu.addRange(new string[] { "Complete", "Building", "Retracting" }); pnlEditorSegs.Controls.Add(cmbEditorSegEndState0); // lblEditorSegEndState1; lblEditorSegEndState1 = new Label(lblEditorSegEndState0); lblEditorSegEndState1.Top = cmbEditorSegEndState0.Bottom + 5; lblEditorSegEndState1.Text = "State1:"; pnlEditorSegs.Controls.Add(lblEditorSegEndState1); // cmbEditorSegEndState1; cmbEditorSegEndState1 = new ComboBox(cmbEditorSegEndState0, true); cmbEditorSegEndState1.Top = lblEditorSegEndState1.Top; pnlEditorSegs.Controls.Add(cmbEditorSegEndState1); // lblEditorSegLanePeople0; lblEditorSegLanePeople0 = new Label(lblEditorSegEndState1); lblEditorSegLanePeople0.Top = cmbEditorSegEndState1.Bottom + 5; lblEditorSegLanePeople0.Text = "Ppl0:"; pnlEditorSegs.Controls.Add(lblEditorSegLanePeople0); // txtEditorSegLanePeople0; txtEditorSegLanePeople0 = new TextBox(txtEditorSegEndLen1); txtEditorSegLanePeople0.Top = lblEditorSegLanePeople0.Top; txtEditorSegLanePeople0.AllowedSpecChars = ".,"; txtEditorSegLanePeople0.FocusLost += new EventHandler(textBox_FocusLost); txtEditorSegLanePeople0.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorSegs.Controls.Add(txtEditorSegLanePeople0); // lblEditorSegLanePeople1; lblEditorSegLanePeople1 = new Label(lblEditorSegLanePeople0); lblEditorSegLanePeople1.Top = txtEditorSegLanePeople0.Bottom + 5; lblEditorSegLanePeople1.Text = "Ppl1:"; pnlEditorSegs.Controls.Add(lblEditorSegLanePeople1); // txtEditorSegLanePeople1; txtEditorSegLanePeople1 = new TextBox(txtEditorSegLanePeople0); txtEditorSegLanePeople1.Top = lblEditorSegLanePeople1.Top; txtEditorSegLanePeople1.FocusLost += new EventHandler(textBox_FocusLost); txtEditorSegLanePeople1.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorSegs.Controls.Add(txtEditorSegLanePeople1); // btnEditorSegApply; btnEditorSegApply = new ButtonText(btnEditorNodeApply); btnEditorSegApply.Top = txtEditorSegLanePeople1.Bottom + 10; btnEditorSegApply.MouseLeftUp += new EventHandler(btnEditorSegApply_MouseLeftUp); pnlEditorSegs.Controls.Add(btnEditorSegApply); // btnEditorSegDel; btnEditorSegDel = new ButtonText(btnEditorSegApply); btnEditorSegDel.Top = btnEditorSegApply.Bottom + 10; btnEditorSegDel.Text = "Delete"; btnEditorSegDel.MouseLeftUp += new EventHandler(btnEditorSegDel_MouseLeftUp); pnlEditorSegs.Controls.Add(btnEditorSegDel); pnlEditorSegs.AutoHeight(); pnlEditor.Controls.Add(pnlEditorSegs); #endregion pnlEditorSegs #region pnlEditorGeos // // pnlEditorGeos // pnlEditorGeos = new Container(pnlEditorSegs); // lblEditorGeoCloseLoop lblEditorGeoCloseLoop = new Label(); lblEditorGeoCloseLoop.AutoSize = false; lblEditorGeoCloseLoop.Bounds = new Rectangle(10, 0, 75, 20); lblEditorGeoCloseLoop.TextAlign = Desktop.Alignment.CenterRight; lblEditorGeoCloseLoop.Text = "CloseLoop:"; pnlEditorGeos.Controls.Add(lblEditorGeoCloseLoop); // btnEditorGeoCloseLoop btnEditorGeoCloseLoop = new Button(); btnEditorGeoCloseLoop.Left = lblEditorGeoCloseLoop.Right + 5; btnEditorGeoCloseLoop.Top = lblEditorGeoCloseLoop.Top + 5; btnEditorGeoCloseLoop.Height = lblEditorGeoCloseLoop.Height - 10; btnEditorGeoCloseLoop.Width = btnEditorGeoCloseLoop.Height; btnEditorGeoCloseLoop.IsToggle = true; btnEditorGeoCloseLoop.BackColorP = Desktop.DefButtonBackColor; btnEditorGeoCloseLoop.BackColor = Color.White; pnlEditorGeos.Controls.Add(btnEditorGeoCloseLoop); // lblEditorGeoDisplay lblEditorGeoDisplay = new Label(lblEditorGeoCloseLoop); lblEditorGeoDisplay.Top = lblEditorGeoCloseLoop.Bottom + 5; lblEditorGeoDisplay.Text = "Display:"; pnlEditorGeos.Controls.Add(lblEditorGeoDisplay); // btnEditorGeoDisplay btnEditorGeoDisplay = new Button(btnEditorGeoCloseLoop); btnEditorGeoDisplay.Top = lblEditorGeoDisplay.Top + 5; pnlEditorGeos.Controls.Add(btnEditorGeoDisplay); // btnEditorGeoApply btnEditorGeoApply = new ButtonText(btnEditorNodeApply); btnEditorGeoApply.Top = btnEditorGeoDisplay.Bottom + 10; btnEditorGeoApply.MouseLeftUp += new EventHandler(btnEditorGeoApply_MouseLeftUp); pnlEditorGeos.Controls.Add(btnEditorGeoApply); // btnEditorGeoDel btnEditorGeoDel = new ButtonText(btnEditorNodeApply); btnEditorGeoDel.Top = btnEditorGeoApply.Bottom + 10; btnEditorGeoDel.Text = "Delete"; btnEditorGeoDel.MouseLeftUp += new EventHandler(btnEditorGeoDel_MouseLeftUp); pnlEditorGeos.Controls.Add(btnEditorGeoDel); pnlEditorGeos.AutoHeight(); pnlEditor.Controls.Add(pnlEditorGeos); #endregion pnlEditorGeos #region pnlEditorHotspots pnlEditorHotspots = new Container(pnlEditorGeos); // lblEditorHotspotIDLbl lblEditorHotspotIDLbl = new Label(lblEditorNodeActive); lblEditorHotspotIDLbl.Top = 0; lblEditorHotspotIDLbl.Text = "ID:"; pnlEditorHotspots.Controls.Add(lblEditorHotspotIDLbl); // lblEditorHotspotIDVal lblEditorHotspotIDVal = new Label(lblEditorSegLenVal); lblEditorHotspotIDVal.Top = lblEditorHotspotIDLbl.Top; lblEditorHotspotIDVal.Left = txtBuildRate.Left; pnlEditorHotspots.Controls.Add(lblEditorHotspotIDVal); // lblEditorHotspotX lblEditorHotspotX = new Label(lblEditorHotspotIDLbl); lblEditorHotspotX.Top = lblEditorHotspotIDVal.Bottom + 5; lblEditorHotspotX.Text = "X:"; pnlEditorHotspots.Controls.Add(lblEditorHotspotX); // txtEditorHotspotX txtEditorHotspotX = new TextBox(txtEditorNodeX); txtEditorHotspotX.Top = lblEditorHotspotX.Top; txtEditorHotspotX.FocusLost += new EventHandler(textBox_FocusLost); txtEditorHotspotX.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorHotspots.Controls.Add(txtEditorHotspotX); // lblEditorHotspotY lblEditorHotspotY = new Label(lblEditorHotspotX); lblEditorHotspotY.Top = txtEditorHotspotX.Bottom + 5; lblEditorHotspotY.Text = "Y:"; pnlEditorHotspots.Controls.Add(lblEditorHotspotY); // txtEditorHotspotY txtEditorHotspotY = new TextBox(txtEditorHotspotX); txtEditorHotspotY.Top = lblEditorHotspotY.Top; txtEditorHotspotY.FocusLost += new EventHandler(textBox_FocusLost); txtEditorHotspotY.FocusReceived += new EventHandler(textBox_FocusReceived); pnlEditorHotspots.Controls.Add(txtEditorHotspotY); // lblEditorHotspotScript lblEditorHotspotScript = new Label(lblEditorHotspotY); lblEditorHotspotScript.Top = txtEditorHotspotY.Bottom + 5; lblEditorHotspotScript.Text = "Script:"; pnlEditorHotspots.Controls.Add(lblEditorHotspotScript); // btnEditorHotspotScript btnEditorHotspotScript = new ButtonText(btnEditorNodeLoadType); btnEditorHotspotScript.Top = lblEditorHotspotScript.Top; btnEditorHotspotScript.Width = btnEditorHotspotScript.Height; btnEditorHotspotScript.Left = txtEditorHotspotY.Right - btnEditorHotspotScript.Width; btnEditorHotspotScript.Text = "..."; btnEditorHotspotScript.MouseLeftUp += new EventHandler(btnEditorHotspotScript_MouseLeftUp); pnlEditorHotspots.Controls.Add(btnEditorHotspotScript); // lblEditorHotspotScriptView lblEditorHotspotScriptView = new Label(lblEditorHotspotIDVal); lblEditorHotspotScriptView.Top = lblEditorHotspotScript.Top; lblEditorHotspotScriptView.Width = btnEditorHotspotScript.Left - lblEditorHotspotScriptView.Left; lblEditorHotspotScriptView.TextAlign = Desktop.Alignment.Center; lblEditorHotspotScriptView.Text = "---"; pnlEditorHotspots.Controls.Add(lblEditorHotspotScriptView); // lblEditorHotspotScriptVal lblEditorHotspotScriptVal = new Label(lblEditorHotspotScriptView); lblEditorHotspotScriptVal.Visible = false; pnlEditorHotspots.Controls.Add(lblEditorHotspotScriptVal); // btnEditorHotspotApply btnEditorHotspotApply = new ButtonText(btnEditorNodeLoadType); btnEditorHotspotApply.Top = lblEditorHotspotScriptView.Bottom + 10; btnEditorHotspotApply.Text = "Apply"; btnEditorHotspotApply.MouseLeftUp += new EventHandler(btnEditorHotspotApply_MouseLeftUp); pnlEditorHotspots.Controls.Add(btnEditorHotspotApply); // btnEditorHotspotDel btnEditorHotspotDel = new ButtonText(btnEditorHotspotApply); btnEditorHotspotDel.Top = btnEditorHotspotApply.Bottom + 10; btnEditorHotspotDel.Text = "Delete"; btnEditorHotspotDel.MouseLeftUp += new EventHandler(btnEditorHotspotDel_MouseLeftUp); pnlEditorHotspots.Controls.Add(btnEditorHotspotDel); pnlEditorHotspots.AutoHeight(); pnlEditor.Controls.Add(pnlEditorHotspots); #endregion pnlEditorHotspots pnlEditor.AutoHeight(); cntSideBar.Controls.Add(pnlEditor); #endregion pnlEditor #region Load and Save // btnSaveWorld btnSaveWorld = new ButtonText(); btnSaveWorld.Bounds = new Rectangle(10, cntSideBar.Bottom - 30, cntSideBar.Width - 20, 20); btnSaveWorld.Text = "Save World"; btnSaveWorld.MouseLeftUp += new EventHandler(btnSaveWorld_MouseLeftUp); cntSideBar.Controls.Add(btnSaveWorld); // btnLoadWorld btnLoadWorld = new ButtonText(btnSaveWorld); btnLoadWorld.Top -= 25; btnLoadWorld.Text = "Load World"; btnLoadWorld.MouseLeftUp += new EventHandler(btnLoadWorld_MouseLeftUp); cntSideBar.Controls.Add(btnLoadWorld); #endregion Load and Save refreshSideBar(); desktop.Controls.Add(cntSideBar); #region cntMsgBox // // cntMsgBox // cntMsgBox = new Container(); cntMsgBox.Width = 600; cntMsgBox.Visible = false; // lblMsgBoxMessage lblMsgBoxMessage = new Label(); lblMsgBoxMessage.AutoSize = false; lblMsgBoxMessage.Bounds = new Rectangle(0, 10, cntMsgBox.Width, 20); lblMsgBoxMessage.TextAlign = Desktop.Alignment.Center; cntMsgBox.Controls.Add(lblMsgBoxMessage); // btnMsgBoxExit btnMsgBoxExit = new ButtonText(); btnMsgBoxExit.Bounds = new Rectangle((cntMsgBox.Width - 40) / 2, lblMsgBoxMessage.Bottom + 10, 40, 20); btnMsgBoxExit.Text = "OK"; btnMsgBoxExit.MouseLeftUp += new EventHandler(btnMsgBoxExit_MouseLeftUp); cntMsgBox.Controls.Add(btnMsgBoxExit); cntMsgBox.Height = btnMsgBoxExit.Bottom + 10; cntMsgBox.Left = (graphics.PreferredBackBufferWidth - cntMsgBox.Width) / 2; cntMsgBox.Top = (graphics.PreferredBackBufferHeight - cntMsgBox.Height) / 2; desktop.Controls.Add(cntMsgBox); #endregion cntMsgBox #region cntSaveLoad // // cntSaveLoad // cntSaveLoad = new Container(); cntSaveLoad.Bounds = new Rectangle(Graphics.PreferredBackBufferWidth / 2 - 500, Graphics.PreferredBackBufferHeight / 2 - 200, 1000, 400); cntSaveLoad.Visible = false; // lblSaveLoadTitle lblSaveLoadTitle = new Label(); lblSaveLoadTitle.AutoSize = false; lblSaveLoadTitle.DrawBack = true; lblSaveLoadTitle.Bounds = new Rectangle(0, 0, cntSaveLoad.Width, 20); lblSaveLoadTitle.TextAlign = Desktop.Alignment.Center; cntSaveLoad.Controls.Add(lblSaveLoadTitle); // lblSaveLoadPath lblSaveLoadPath = new Label(); lblSaveLoadPath.Text = "Path:"; lblSaveLoadPath.Location = new Point(10, lblSaveLoadTitle.Bottom + 10); cntSaveLoad.Controls.Add(lblSaveLoadPath); // btnSaveLoadPath btnSaveLoadPath = new List<ButtonText>(4); // btnSaveLoadConfirm btnSaveLoadConfirm = new ButtonText(); btnSaveLoadConfirm.Bounds = new Rectangle(cntSaveLoad.Width - 60, cntSaveLoad.Height - 30, 50, 20); btnSaveLoadConfirm.MouseLeftUp += new EventHandler(btnSaveLoadConfirm_MouseLeftUp); cntSaveLoad.Controls.Add(btnSaveLoadConfirm); // btnSaveLoadCancel btnSaveLoadCancel = new ButtonText(btnSaveLoadConfirm); btnSaveLoadCancel.Left = btnSaveLoadConfirm.Left - 55; btnSaveLoadCancel.Text = "Cancel"; btnSaveLoadCancel.MouseLeftUp += new EventHandler(btnSaveLoadCancel_MouseLeftUp); cntSaveLoad.Controls.Add(btnSaveLoadCancel); // lblSaveLoadFileName lblSaveLoadFileName = new Label(); lblSaveLoadFileName.Text = "File Name:"; lblSaveLoadFileName.Location = new Point(10, btnSaveLoadConfirm.Top - 30); cntSaveLoad.Controls.Add(lblSaveLoadFileName); // txtSaveLoadFileName txtSaveLoadFileName = new TextBox(); txtSaveLoadFileName.Bounds = new Rectangle(lblSaveLoadFileName.Right + 5, lblSaveLoadFileName.Top, cntSaveLoad.Width - lblSaveLoadFileName.Right - 15, 20); cntSaveLoad.Controls.Add(txtSaveLoadFileName); // lsbSaveLoadFiles lsbSaveLoadFiles = new ListBoxText(); lsbSaveLoadFiles.Bounds = new Rectangle(10, lblSaveLoadTitle.Bottom + 40, cntSaveLoad.Width - 20, txtSaveLoadFileName.Top - lblSaveLoadTitle.Bottom - 50); lsbSaveLoadFiles.MouseLeftDoubleClick += new EventHandler(lsbSaveLoadFiles_OnMouseLeftDoubleClick); lsbSaveLoadFiles.SelectedIndexChanged += new EventHandler(lsbSaveLoadFiles_SelectedIndexChanged); cntSaveLoad.Controls.Add(lsbSaveLoadFiles); desktop.Controls.Add(cntSaveLoad); #endregion cntSaveLoad #region cntTextEditor // // cntTextEditor // cntTextEditor = new Container(); cntTextEditor.Bounds = new Rectangle(Graphics.PreferredBackBufferWidth / 2 - 500, Graphics.PreferredBackBufferHeight / 2 - 200, 1000, 400); cntTextEditor.Visible = false; // lblTextEditorTitle lblTextEditorTitle = new Label(); lblTextEditorTitle.AutoSize = false; lblTextEditorTitle.DrawBack = true; lblTextEditorTitle.Bounds = new Rectangle(0, 0, cntTextEditor.Width, 20); lblTextEditorTitle.TextAlign = Desktop.Alignment.Center; cntTextEditor.Controls.Add(lblTextEditorTitle); // btnTextEditorOK btnTextEditorOK = new ButtonText(); btnTextEditorOK.Bounds = new Rectangle(cntTextEditor.Width - 60, cntTextEditor.Height - 30, 50, 20); btnTextEditorOK.Text = "OK"; btnTextEditorOK.MouseLeftUp += new EventHandler(btnTextEditorOK_MouseLeftUp); cntTextEditor.Controls.Add(btnTextEditorOK); btnTextEditorOK.MouseLeftUp += new EventHandler(btnTextEditorOK_MouseLeftUp_HotspotScript); // for hotspot scripts btnTextEditorOK.MouseLeftUp += new EventHandler(btnTextEditorOK_MouseLeftUp_BeginUpdateScript); // for hotspot scripts // btnTextEditorCancel btnTextEditorCancel = new ButtonText(btnTextEditorOK); btnTextEditorCancel.Left = btnTextEditorOK.Left - 55; btnTextEditorCancel.Text = "Cancel"; btnTextEditorCancel.MouseLeftUp += new EventHandler(btnTextEditorCancel_MouseLeftUp); cntTextEditor.Controls.Add(btnTextEditorCancel); // txtTextEditorText txtTextEditorText = new TextBoxMulti(); txtTextEditorText.Bounds = new Rectangle(10, lblTextEditorTitle.Bottom + 40, cntTextEditor.Width - 20, btnTextEditorOK.Top - lblTextEditorTitle.Bottom - 50); txtTextEditorText.AllowedSpecChars = null; txtTextEditorText.AllowMultiLine = true; txtTextEditorText.Font = fCourierNew; txtTextEditorText.EditPositionOffsetX = -3; txtTextEditorText.EditPositionOffsetY = 0; txtTextEditorText.StopOnTab = false; cntTextEditor.Controls.Add(txtTextEditorText); desktop.Controls.Add(cntTextEditor); #endregion cntTextEditor }
public void LoadContent(ContentManager theContentManager) { textBoxSprite = new Sprite(theContentManager, "LoginMenu/TextBox"); statusTextBoxSprite = new Sprite(theContentManager, "LoginMenu/TransparentTextBox"); submitButtonUp = new Sprite(theContentManager, "CreateAccountMenu/SubmitButtonUp"); submitButtonDown = new Sprite(theContentManager, "CreateAccountMenu/SubmitButtonDown"); backButtonUp = new Sprite(theContentManager, "CreateAccountMenu/BackButtonUp"); backButtonDown = new Sprite(theContentManager, "CreateAccountMenu/BackButtonDown"); emailLabel = new Sprite(theContentManager, "CreateAccountMenu/EmailLabel"); passwordLabel = new Sprite(theContentManager, "CreateAccountMenu/PasswordLabel"); verifyLabel = new Sprite(theContentManager, "CreateAccountMenu/VerifyPasswordLabel"); backgroundSprite = new Sprite(theContentManager, "CreateAccountMenu/Background"); logoSprite = new Sprite(theContentManager, "CreateAccountMenu/Logo"); textBoxFont = theContentManager.Load<SpriteFont>("CreateAccountMenu/CreateFont"); textInputDevice = new TextInputDevice(myGame.Window.Handle); emailTextBox = new TextBox(textInputDevice, 290, 230, textBoxSprite, textBoxFont); emailTextBox.MarginX = 20; emailTextBox.MarginY = 16; emailTextBox.textColor = Color.White; passwordTextBox = new TextBox(textInputDevice, 290, 297, textBoxSprite, textBoxFont); passwordTextBox.isPassword = true; passwordTextBox.MarginX = 20; passwordTextBox.MarginY = 20; passwordTextBox.textColor = Color.White; verifyTextBox = new TextBox(textInputDevice, 290, 364, textBoxSprite, textBoxFont); verifyTextBox.isPassword = true; verifyTextBox.MarginX = 20; verifyTextBox.MarginY = 20; verifyTextBox.textColor = Color.White; statusTextBox = new TextBox(textInputDevice, 200, 460, statusTextBoxSprite, textBoxFont); statusTextBox.ReadOnly = true; statusTextBox.MarginX = 20; statusTextBox.MarginY = 20; statusTextBox.textColor = Color.White; statusTextBox.Alignment = TextAlignment.Centered; submitButton = new Button("", 350, 418, submitButtonUp, submitButtonDown, textBoxFont); backButton = new Button("", 12, 552, backButtonUp, backButtonDown, textBoxFont); if (_email != "" && _password != "") { emailTextBox.Text = _email; passwordTextBox.Text = _password; } }
public void LoadContent(ContentManager theContentManager) { textBoxSprite = new Sprite(theContentManager, "LoginMenu/TextBox"); statusTextBoxSprite = new Sprite(theContentManager, "LoginMenu/TransparentTextBox"); registerButtonUp = new Sprite(theContentManager, "LoginMenu/RegisterButtonUp"); registerButtonDown = new Sprite(theContentManager, "LoginMenu/RegisterButtonDown"); loginButtonUp = new Sprite(theContentManager, "LoginMenu/LoginButtonUp"); loginButtonDown = new Sprite(theContentManager, "LoginMenu/LoginButtonDown"); exitButtonUp = new Sprite(theContentManager, "LoginMenu/exitButtonUp"); exitButtonDown = new Sprite(theContentManager, "LoginMenu/exitButtonDown"); emailLabel = new Sprite(theContentManager, "LoginMenu/EmailLabel"); passwordLabel = new Sprite(theContentManager, "LoginMenu/PasswordLabel"); backgroundSprite = new Sprite(theContentManager, "LoginMenu/Background"); logoSprite = new Sprite(theContentManager, "LoginMenu/Logo"); textBoxFont = theContentManager.Load<SpriteFont>("LoginMenu/LoginFont"); textInputDevice = new TextInputDevice(myGame.Window.Handle); usernameTextBox = new TextBox(textInputDevice, 290, 239, textBoxSprite, textBoxFont); usernameTextBox.MarginX = 20; usernameTextBox.MarginY = 20; usernameTextBox.textColor = Color.White; passwordTextBox = new TextBox(textInputDevice, 290, 306, textBoxSprite, textBoxFont); passwordTextBox.isPassword = true; passwordTextBox.MarginX = 20; passwordTextBox.MarginY = 20; passwordTextBox.textColor = Color.White; statusTextBox = new TextBox(textInputDevice, 200, 416, statusTextBoxSprite, textBoxFont); statusTextBox.ReadOnly = true; statusTextBox.MarginX = 20; statusTextBox.MarginY = 20; statusTextBox.textColor = Color.White; statusTextBox.Alignment = TextAlignment.Centered; loginButton = new Button("", 416, 372, loginButtonUp, loginButtonDown, textBoxFont); registerButton = new Button("", 290, 372, registerButtonUp, registerButtonDown, textBoxFont); exitButton = new Button("", 12, 552, exitButtonUp, exitButtonDown, textBoxFont); }
public void SendNewCharacterRequest(byte characterSlot, string username, byte raceID, byte genderID, byte hairStyleID, byte hairColorID, byte faceStyleID, byte shirtStyleID, byte shirtColorID, byte legsStyleID, byte legsColorID, byte skinColorID, TextBox statusText) { NetOutgoingMessage outgoingMessage; outgoingMessage = netClient.CreateMessage(); outgoingMessage.Write((byte)PacketType.New_Character_Request); outgoingMessage.Write(characterSlot); outgoingMessage.Write(username); outgoingMessage.Write(raceID); outgoingMessage.Write(genderID); outgoingMessage.Write(hairStyleID); outgoingMessage.Write(hairColorID); outgoingMessage.Write(faceStyleID); outgoingMessage.Write(shirtStyleID); outgoingMessage.Write(shirtColorID); outgoingMessage.Write(legsStyleID); outgoingMessage.Write(legsColorID); outgoingMessage.Write(skinColorID); netClient.SendMessage(outgoingMessage, NetDeliveryMethod.ReliableOrdered); statusText.Text = "Creating Character"; statusText.Visible = true; statusText.Alignment = TextAlignment.Centered; }
public void LoadContent(ContentManager theContentManager) { spr_MatuBackground = new Sprite(theContentManager, "CharacterCreateMenu/Matu Background"); spr_KremBackground = new Sprite(theContentManager, "CharacterCreateMenu/Krem Background"); spr_HumanBackground = new Sprite(theContentManager, "CharacterCreateMenu/Human Background"); spr_RaceMatuButton = new Sprite(theContentManager, "CharacterCreateMenu/ButtonRaceMatu"); spr_RaceKremButton = new Sprite(theContentManager, "CharacterCreateMenu/ButtonRaceKrem"); spr_RaceHumanButton = new Sprite(theContentManager, "CharacterCreateMenu/ButtonRaceHuman"); spr_GenderFemaleButton = new Sprite(theContentManager, "CharacterCreateMenu/ButtonGenderFemale"); spr_GenderMaleButton = new Sprite(theContentManager, "CharacterCreateMenu/ButtonGenderMale"); spr_ArrowLeft = new Sprite(theContentManager, "CharacterCreateMenu/ButtonLeftArrow"); spr_ArrowRight = new Sprite(theContentManager, "CharacterCreateMenu/ButtonRightArrow"); spr_ButtonBack_Up = new Sprite(theContentManager, "CreateAccountMenu/BackButtonUp"); spr_ButtonBack_Down = new Sprite(theContentManager, "CreateAccountMenu/BackButtonUp"); spr_ButtonPlay_Up = new Sprite(theContentManager, "CharacterCreateMenu/PlayButtonUp"); spr_ButtonPlay_Down = new Sprite(theContentManager, "CharacterCreateMenu/PlayButtonDown"); spr_Overlay = new Sprite(theContentManager, "CharacterCreateMenu/Panel Overlay"); spr_SelectBox = new Sprite(theContentManager, "CharacterCreateMenu/SelectBox"); spr_TextBox = new Sprite(theContentManager, "CharacterCreateMenu/TextBox"); spr_TextBoxTransparent = new Sprite(theContentManager, "CreateAccountMenu/Transparent TextBox"); spr_NameLabel = new Sprite(theContentManager, "CharacterCreateMenu/NameLabel"); fnt_Username = theContentManager.Load<SpriteFont>("CharacterCreateMenu/UsernameFont"); buttonFont = theContentManager.Load<SpriteFont>("CharacterCreateMenu/buttonFont"); textInputDevice = new TextInputDevice(myGame.Window.Handle); txt_Username = new TextBox(textInputDevice, 432, 500, spr_TextBox, fnt_Username); txt_Username.MarginX = 20; txt_Username.MarginY = 20; txt_Username.textColor = Color.White; txt_StatusText = new TextBox(textInputDevice, 343, 532, spr_TextBoxTransparent, fnt_Username); txt_StatusText.ReadOnly = true; txt_StatusText.MarginX = 20; txt_StatusText.MarginY = 20; txt_StatusText.Visible = false; txt_StatusText.textColor = Color.White; buttons = new List<Button>(); btn_RaceHuman = new Button("", 33, 30, spr_RaceHumanButton, spr_RaceHumanButton, buttonFont); btn_RaceMatu = new Button("", 108, 30, spr_RaceMatuButton, spr_RaceMatuButton, buttonFont); btn_RaceKrem = new Button("", 174, 30, spr_RaceKremButton, spr_RaceKremButton, buttonFont); btn_GenderMale = new Button("", 70, 144, spr_GenderMaleButton, spr_GenderMaleButton, buttonFont); btn_GenderFemale = new Button("", 152, 144, spr_GenderFemaleButton, spr_GenderFemaleButton, buttonFont); btn_HairStyleLeft = new Button("", 39, 264, spr_ArrowLeft, spr_ArrowLeft, buttonFont); btn_HairStyleRight = new Button("", 219, 264, spr_ArrowRight, spr_ArrowRight, buttonFont); btn_HairColorLeft = new Button("", 39, 304, spr_ArrowLeft, spr_ArrowLeft, buttonFont); btn_HairColorRight = new Button("", 219, 304, spr_ArrowRight, spr_ArrowRight, buttonFont); btn_FaceStyleLeft = new Button("", 39, 336, spr_ArrowLeft, spr_ArrowLeft, buttonFont); btn_FaceStyleRight = new Button("", 219, 336, spr_ArrowRight, spr_ArrowRight, buttonFont); btn_ShirtStyleLeft = new Button("", 39, 373, spr_ArrowLeft, spr_ArrowLeft, buttonFont); btn_ShirtStyleRight = new Button("", 219, 373, spr_ArrowRight, spr_ArrowRight, buttonFont); btn_ShirtColorLeft = new Button("", 39, 410, spr_ArrowLeft, spr_ArrowLeft, buttonFont); btn_ShirtColorRight = new Button("", 219, 410, spr_ArrowRight, spr_ArrowRight, buttonFont); btn_LegsStyleLeft = new Button("", 39, 445, spr_ArrowLeft, spr_ArrowLeft, buttonFont); btn_LegsStyleRight = new Button("", 219, 445, spr_ArrowRight, spr_ArrowRight, buttonFont); btn_LegsColorLeft = new Button("", 39, 485, spr_ArrowLeft, spr_ArrowLeft, buttonFont); btn_LegsColorRight = new Button("", 219, 485, spr_ArrowRight, spr_ArrowRight, buttonFont); btn_SkinColorLeft = new Button("", 39, 520, spr_ArrowLeft, spr_ArrowLeft, buttonFont); btn_SkinColorRight = new Button("", 219, 520, spr_ArrowRight, spr_ArrowRight, buttonFont); btn_Play = new Button("", 689, 553, spr_ButtonPlay_Up, spr_ButtonPlay_Down, buttonFont); btn_Back = new Button("", 310, 553, spr_ButtonBack_Up, spr_ButtonBack_Down, buttonFont); buttons.Add(btn_RaceHuman); buttons.Add(btn_RaceMatu); buttons.Add(btn_RaceKrem); buttons.Add(btn_GenderMale); buttons.Add(btn_GenderFemale); buttons.Add(btn_HairStyleLeft); buttons.Add(btn_HairStyleRight); buttons.Add(btn_HairColorLeft); buttons.Add(btn_HairColorRight); buttons.Add(btn_FaceStyleLeft); buttons.Add(btn_FaceStyleRight); buttons.Add(btn_ShirtStyleLeft); buttons.Add(btn_ShirtStyleRight); buttons.Add(btn_ShirtColorLeft); buttons.Add(btn_ShirtColorRight); buttons.Add(btn_LegsStyleLeft); buttons.Add(btn_LegsStyleRight); buttons.Add(btn_LegsColorLeft); buttons.Add(btn_LegsColorRight); buttons.Add(btn_SkinColorLeft); buttons.Add(btn_SkinColorRight); buttons.Add(btn_Play); buttons.Add(btn_Back); UpdateCharacterImage(); }