C&C Remastered Map Editor
Initial commit of C&C Remastered Map Editor code
This commit is contained in:
parent
1f6350fe6e
commit
e37e174be1
289 changed files with 80922 additions and 7 deletions
158
CnCTDRAMapEditor/Dialogs/ErrorMessageBox.Designer.cs
generated
Normal file
158
CnCTDRAMapEditor/Dialogs/ErrorMessageBox.Designer.cs
generated
Normal file
|
@ -0,0 +1,158 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class ErrorMessageBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.lblMessage = new System.Windows.Forms.Label();
|
||||
this.txtErrors = new System.Windows.Forms.TextBox();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.btnCopy = new System.Windows.Forms.Button();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 1;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.lblMessage, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.txtErrors, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 2);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 3;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(447, 285);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// lblMessage
|
||||
//
|
||||
this.lblMessage.AutoSize = true;
|
||||
this.lblMessage.Location = new System.Drawing.Point(3, 0);
|
||||
this.lblMessage.Name = "lblMessage";
|
||||
this.lblMessage.Size = new System.Drawing.Size(191, 13);
|
||||
this.lblMessage.TabIndex = 1;
|
||||
this.lblMessage.Text = "The following errors were encountered:";
|
||||
//
|
||||
// txtErrors
|
||||
//
|
||||
this.txtErrors.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.txtErrors.Location = new System.Drawing.Point(3, 16);
|
||||
this.txtErrors.Multiline = true;
|
||||
this.txtErrors.Name = "txtErrors";
|
||||
this.txtErrors.ReadOnly = true;
|
||||
this.txtErrors.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.txtErrors.Size = new System.Drawing.Size(441, 231);
|
||||
this.txtErrors.TabIndex = 0;
|
||||
this.txtErrors.WordWrap = false;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOK);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnCopy);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 253);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(441, 29);
|
||||
this.flowLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnOK.Location = new System.Drawing.Point(363, 3);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOK.TabIndex = 0;
|
||||
this.btnOK.Text = "&OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnCopy
|
||||
//
|
||||
this.btnCopy.Location = new System.Drawing.Point(246, 3);
|
||||
this.btnCopy.Name = "btnCopy";
|
||||
this.btnCopy.Size = new System.Drawing.Size(111, 23);
|
||||
this.btnCopy.TabIndex = 1;
|
||||
this.btnCopy.Text = "&Copy to Clipboard";
|
||||
this.btnCopy.UseVisualStyleBackColor = true;
|
||||
this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
|
||||
//
|
||||
// ErrorMessageBox
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnOK;
|
||||
this.ClientSize = new System.Drawing.Size(447, 285);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ErrorMessageBox";
|
||||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Error Report";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.TextBox txtErrors;
|
||||
private System.Windows.Forms.Label lblMessage;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.Button btnCopy;
|
||||
}
|
||||
}
|
55
CnCTDRAMapEditor/Dialogs/ErrorMessageBox.cs
Normal file
55
CnCTDRAMapEditor/Dialogs/ErrorMessageBox.cs
Normal file
|
@ -0,0 +1,55 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class ErrorMessageBox : Form
|
||||
{
|
||||
public string Message
|
||||
{
|
||||
set
|
||||
{
|
||||
lblMessage.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<string> Errors
|
||||
{
|
||||
set
|
||||
{
|
||||
txtErrors.Text = string.Join(Environment.NewLine, value);
|
||||
}
|
||||
}
|
||||
|
||||
public ErrorMessageBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnCopy_Click(object sender, EventArgs e)
|
||||
{
|
||||
Clipboard.SetText(txtErrors.Text);
|
||||
}
|
||||
}
|
||||
}
|
120
CnCTDRAMapEditor/Dialogs/ErrorMessageBox.resx
Normal file
120
CnCTDRAMapEditor/Dialogs/ErrorMessageBox.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
153
CnCTDRAMapEditor/Dialogs/InviteMessageBox.Designer.cs
generated
Normal file
153
CnCTDRAMapEditor/Dialogs/InviteMessageBox.Designer.cs
generated
Normal file
|
@ -0,0 +1,153 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class InviteMessageBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.checkBoxDontShowThisAgain = new System.Windows.Forms.CheckBox();
|
||||
this.pictureBoxIcon = new System.Windows.Forms.PictureBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxIcon)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.Controls.Add(this.flowLayoutPanel2);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOK);
|
||||
this.flowLayoutPanel1.Controls.Add(this.checkBoxDontShowThisAgain);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(425, 97);
|
||||
this.flowLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// flowLayoutPanel2
|
||||
//
|
||||
this.flowLayoutPanel2.AutoSize = true;
|
||||
this.flowLayoutPanel2.Controls.Add(this.pictureBoxIcon);
|
||||
this.flowLayoutPanel2.Controls.Add(this.label1);
|
||||
this.flowLayoutPanel2.Location = new System.Drawing.Point(3, 3);
|
||||
this.flowLayoutPanel2.Name = "flowLayoutPanel2";
|
||||
this.flowLayoutPanel2.Size = new System.Drawing.Size(419, 38);
|
||||
this.flowLayoutPanel2.TabIndex = 0;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(175, 47);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOK.TabIndex = 1;
|
||||
this.btnOK.Text = "&OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkBoxDontShowThisAgain
|
||||
//
|
||||
this.checkBoxDontShowThisAgain.AutoSize = true;
|
||||
this.flowLayoutPanel1.SetFlowBreak(this.checkBoxDontShowThisAgain, true);
|
||||
this.checkBoxDontShowThisAgain.Location = new System.Drawing.Point(3, 76);
|
||||
this.checkBoxDontShowThisAgain.Name = "checkBoxDontShowThisAgain";
|
||||
this.checkBoxDontShowThisAgain.Size = new System.Drawing.Size(127, 17);
|
||||
this.checkBoxDontShowThisAgain.TabIndex = 2;
|
||||
this.checkBoxDontShowThisAgain.Text = "Don\'t show this again";
|
||||
this.checkBoxDontShowThisAgain.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pictureBoxIcon
|
||||
//
|
||||
this.pictureBoxIcon.Location = new System.Drawing.Point(3, 3);
|
||||
this.pictureBoxIcon.Name = "pictureBoxIcon";
|
||||
this.pictureBoxIcon.Size = new System.Drawing.Size(32, 32);
|
||||
this.pictureBoxIcon.TabIndex = 0;
|
||||
this.pictureBoxIcon.TabStop = false;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(41, 12);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(375, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "To join a game session or accept game invites, please first exit the Map Editor.";
|
||||
//
|
||||
// CheckMessageBox
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnOK;
|
||||
this.ClientSize = new System.Drawing.Size(425, 97);
|
||||
this.Controls.Add(this.flowLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "CheckMessageBox";
|
||||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Map Editor";
|
||||
this.Load += new System.EventHandler(this.InviteMessageBox_Load);
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel2.ResumeLayout(false);
|
||||
this.flowLayoutPanel2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxIcon)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.CheckBox checkBoxDontShowThisAgain;
|
||||
private System.Windows.Forms.PictureBox pictureBoxIcon;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
38
CnCTDRAMapEditor/Dialogs/InviteMessageBox.cs
Normal file
38
CnCTDRAMapEditor/Dialogs/InviteMessageBox.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class InviteMessageBox : Form
|
||||
{
|
||||
public bool DontShowAgain => checkBoxDontShowThisAgain.Checked;
|
||||
|
||||
public InviteMessageBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InviteMessageBox_Load(object sender, EventArgs e)
|
||||
{
|
||||
using (var infoIcon = new Icon(SystemIcons.Information, pictureBoxIcon.Width, pictureBoxIcon.Height))
|
||||
{
|
||||
pictureBoxIcon.Image = infoIcon.ToBitmap();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
120
CnCTDRAMapEditor/Dialogs/InviteMessageBox.resx
Normal file
120
CnCTDRAMapEditor/Dialogs/InviteMessageBox.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
166
CnCTDRAMapEditor/Dialogs/MapSettingsDialog.Designer.cs
generated
Normal file
166
CnCTDRAMapEditor/Dialogs/MapSettingsDialog.Designer.cs
generated
Normal file
|
@ -0,0 +1,166 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class MapSettingsDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.settingsTreeView = new System.Windows.Forms.TreeView();
|
||||
this.settingsPanel = new System.Windows.Forms.Panel();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.settingsTreeView, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.settingsPanel, 1, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 2;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(784, 561);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 2);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnCancel);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOK);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 524);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(778, 34);
|
||||
this.flowLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.AutoSize = true;
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(708, 2);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(68, 30);
|
||||
this.btnCancel.TabIndex = 2;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.AutoSize = true;
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(654, 2);
|
||||
this.btnOK.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(50, 30);
|
||||
this.btnOK.TabIndex = 3;
|
||||
this.btnOK.Text = "&OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// settingsTreeView
|
||||
//
|
||||
this.settingsTreeView.CheckBoxes = true;
|
||||
this.settingsTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.settingsTreeView.DrawMode = System.Windows.Forms.TreeViewDrawMode.OwnerDrawText;
|
||||
this.settingsTreeView.HideSelection = false;
|
||||
this.settingsTreeView.Location = new System.Drawing.Point(3, 3);
|
||||
this.settingsTreeView.Name = "settingsTreeView";
|
||||
this.settingsTreeView.Size = new System.Drawing.Size(150, 515);
|
||||
this.settingsTreeView.TabIndex = 2;
|
||||
this.settingsTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.settingsTreeView_AfterCheck);
|
||||
this.settingsTreeView.DrawNode += new System.Windows.Forms.DrawTreeNodeEventHandler(this.settingsTreeView_DrawNode);
|
||||
this.settingsTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.settingsTreeView_AfterSelect);
|
||||
//
|
||||
// settingsPanel
|
||||
//
|
||||
this.settingsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.settingsPanel.Location = new System.Drawing.Point(166, 10);
|
||||
this.settingsPanel.Margin = new System.Windows.Forms.Padding(10, 10, 10, 10);
|
||||
this.settingsPanel.Name = "settingsPanel";
|
||||
this.settingsPanel.Size = new System.Drawing.Size(608, 501);
|
||||
this.settingsPanel.TabIndex = 3;
|
||||
//
|
||||
// MapSettingsDialog
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(784, 561);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "MapSettingsDialog";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Map Settings";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.TreeView settingsTreeView;
|
||||
private System.Windows.Forms.Panel settingsPanel;
|
||||
}
|
||||
}
|
157
CnCTDRAMapEditor/Dialogs/MapSettingsDialog.cs
Normal file
157
CnCTDRAMapEditor/Dialogs/MapSettingsDialog.cs
Normal file
|
@ -0,0 +1,157 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Controls;
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Model;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class MapSettingsDialog : Form
|
||||
{
|
||||
private const int TVIF_STATE = 0x8;
|
||||
private const int TVIS_STATEIMAGEMASK = 0xF000;
|
||||
private const int TV_FIRST = 0x1100;
|
||||
private const int TVM_SETITEM = TV_FIRST + 63;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
|
||||
|
||||
private struct TVITEM
|
||||
{
|
||||
public int mask;
|
||||
public IntPtr hItem;
|
||||
public int state;
|
||||
public int stateMask;
|
||||
[MarshalAs(UnmanagedType.LPTStr)]
|
||||
public String lpszText;
|
||||
public int cchTextMax;
|
||||
public int iImage;
|
||||
public int iSelectedImage;
|
||||
public int cChildren;
|
||||
public IntPtr lParam;
|
||||
}
|
||||
|
||||
private readonly IGamePlugin plugin;
|
||||
private readonly PropertyTracker<BasicSection> basicSettingsTracker;
|
||||
private readonly PropertyTracker<BriefingSection> briefingSettingsTracker;
|
||||
private readonly IDictionary<House, PropertyTracker<House>> houseSettingsTrackers;
|
||||
private readonly TreeNode playersNode;
|
||||
|
||||
public MapSettingsDialog(IGamePlugin plugin, PropertyTracker<BasicSection> basicSettingsTracker, PropertyTracker<BriefingSection> briefingSettingsTracker,
|
||||
IDictionary<House, PropertyTracker<House>> houseSettingsTrackers)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.plugin = plugin;
|
||||
this.basicSettingsTracker = basicSettingsTracker;
|
||||
this.briefingSettingsTracker = briefingSettingsTracker;
|
||||
this.houseSettingsTrackers = houseSettingsTrackers;
|
||||
|
||||
settingsTreeView.BeginUpdate();
|
||||
settingsTreeView.Nodes.Clear();
|
||||
settingsTreeView.Nodes.Add("BASIC", "Basic");
|
||||
settingsTreeView.Nodes.Add("BRIEFING", "Briefing");
|
||||
|
||||
playersNode = settingsTreeView.Nodes.Add("Players");
|
||||
foreach (var player in plugin.Map.Houses)
|
||||
{
|
||||
var playerNode = playersNode.Nodes.Add(player.Type.Name, player.Type.Name);
|
||||
playerNode.Checked = player.Enabled;
|
||||
}
|
||||
playersNode.Expand();
|
||||
|
||||
settingsTreeView.EndUpdate();
|
||||
settingsTreeView.SelectedNode = settingsTreeView.Nodes[0];
|
||||
}
|
||||
|
||||
private void settingsTreeView_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
settingsPanel.Controls.Clear();
|
||||
|
||||
switch (settingsTreeView.SelectedNode.Name)
|
||||
{
|
||||
case "BASIC":
|
||||
{
|
||||
settingsPanel.Controls.Add(new BasicSettings(plugin, basicSettingsTracker));
|
||||
}
|
||||
break;
|
||||
case "BRIEFING":
|
||||
{
|
||||
settingsPanel.Controls.Add(new BriefingSettings(plugin, briefingSettingsTracker));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
var player = plugin.Map.Houses.Where(h => h.Type.Name == settingsTreeView.SelectedNode.Name).FirstOrDefault();
|
||||
if (player != null)
|
||||
{
|
||||
settingsPanel.Controls.Add(new PlayerSettings(plugin, houseSettingsTrackers[player]));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void settingsTreeView_DrawNode(object sender, DrawTreeNodeEventArgs e)
|
||||
{
|
||||
if (!playersNode.Nodes.Contains(e.Node))
|
||||
{
|
||||
HideCheckBox(e.Node);
|
||||
e.DrawDefault = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Graphics.DrawString(e.Node.Text, e.Node.TreeView.Font, new SolidBrush(settingsTreeView.ForeColor), e.Node.Bounds.X, e.Node.Bounds.Y);
|
||||
}
|
||||
}
|
||||
|
||||
private void HideCheckBox(TreeNode node)
|
||||
{
|
||||
TVITEM tvi = new TVITEM
|
||||
{
|
||||
hItem = node.Handle,
|
||||
mask = TVIF_STATE,
|
||||
stateMask = TVIS_STATEIMAGEMASK,
|
||||
state = 0,
|
||||
lpszText = null,
|
||||
cchTextMax = 0,
|
||||
iImage = 0,
|
||||
iSelectedImage = 0,
|
||||
cChildren = 0,
|
||||
lParam = IntPtr.Zero
|
||||
};
|
||||
IntPtr lparam = Marshal.AllocHGlobal(Marshal.SizeOf(tvi));
|
||||
Marshal.StructureToPtr(tvi, lparam, false);
|
||||
SendMessage(node.TreeView.Handle, TVM_SETITEM, IntPtr.Zero, lparam);
|
||||
}
|
||||
|
||||
private void settingsTreeView_AfterCheck(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
var player = plugin.Map.Houses.Where(h => h.Type.Name == e.Node.Name).FirstOrDefault();
|
||||
if (player != null)
|
||||
{
|
||||
((dynamic)houseSettingsTrackers[player]).Enabled = e.Node.Checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
120
CnCTDRAMapEditor/Dialogs/MapSettingsDialog.resx
Normal file
120
CnCTDRAMapEditor/Dialogs/MapSettingsDialog.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
301
CnCTDRAMapEditor/Dialogs/NewMapDialog.Designer.cs
generated
Normal file
301
CnCTDRAMapEditor/Dialogs/NewMapDialog.Designer.cs
generated
Normal file
|
@ -0,0 +1,301 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class NewMapDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.radioTD = new System.Windows.Forms.RadioButton();
|
||||
this.radioRA = new System.Windows.Forms.RadioButton();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.radioTheater1 = new System.Windows.Forms.RadioButton();
|
||||
this.radioTheater2 = new System.Windows.Forms.RadioButton();
|
||||
this.radioTheater3 = new System.Windows.Forms.RadioButton();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel2.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.flowLayoutPanel3.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.flowLayoutPanel4.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 1;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel2, 0, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 2;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 13F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(356, 324);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnCancel);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOK);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(2, 295);
|
||||
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(352, 27);
|
||||
this.flowLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.AutoSize = true;
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(300, 2);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(50, 23);
|
||||
this.btnCancel.TabIndex = 1;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.AutoSize = true;
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(246, 2);
|
||||
this.btnOK.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(50, 23);
|
||||
this.btnOK.TabIndex = 0;
|
||||
this.btnOK.Text = "&OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// flowLayoutPanel2
|
||||
//
|
||||
this.flowLayoutPanel2.Controls.Add(this.groupBox1);
|
||||
this.flowLayoutPanel2.Controls.Add(this.groupBox2);
|
||||
this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flowLayoutPanel2.Location = new System.Drawing.Point(2, 2);
|
||||
this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.flowLayoutPanel2.Name = "flowLayoutPanel2";
|
||||
this.flowLayoutPanel2.Size = new System.Drawing.Size(352, 289);
|
||||
this.flowLayoutPanel2.TabIndex = 1;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.flowLayoutPanel3);
|
||||
this.groupBox1.Location = new System.Drawing.Point(2, 2);
|
||||
this.groupBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.groupBox1.Size = new System.Drawing.Size(339, 70);
|
||||
this.groupBox1.TabIndex = 2;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Game Type";
|
||||
//
|
||||
// flowLayoutPanel3
|
||||
//
|
||||
this.flowLayoutPanel3.AutoSize = true;
|
||||
this.flowLayoutPanel3.Controls.Add(this.radioTD);
|
||||
this.flowLayoutPanel3.Controls.Add(this.radioRA);
|
||||
this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel3.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flowLayoutPanel3.Location = new System.Drawing.Point(2, 15);
|
||||
this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.flowLayoutPanel3.Name = "flowLayoutPanel3";
|
||||
this.flowLayoutPanel3.Size = new System.Drawing.Size(335, 53);
|
||||
this.flowLayoutPanel3.TabIndex = 0;
|
||||
//
|
||||
// radioTD
|
||||
//
|
||||
this.radioTD.AutoSize = true;
|
||||
this.radioTD.Checked = true;
|
||||
this.radioTD.Location = new System.Drawing.Point(2, 2);
|
||||
this.radioTD.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.radioTD.Name = "radioTD";
|
||||
this.radioTD.Size = new System.Drawing.Size(94, 17);
|
||||
this.radioTD.TabIndex = 0;
|
||||
this.radioTD.TabStop = true;
|
||||
this.radioTD.Text = "Tiberian Dawn";
|
||||
this.radioTD.UseVisualStyleBackColor = true;
|
||||
this.radioTD.CheckedChanged += new System.EventHandler(this.radioGameType_CheckedChanged);
|
||||
//
|
||||
// radioRA
|
||||
//
|
||||
this.radioRA.AutoSize = true;
|
||||
this.radioRA.Location = new System.Drawing.Point(2, 23);
|
||||
this.radioRA.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.radioRA.Name = "radioRA";
|
||||
this.radioRA.Size = new System.Drawing.Size(69, 17);
|
||||
this.radioRA.TabIndex = 1;
|
||||
this.radioRA.Text = "Red Alert";
|
||||
this.radioRA.UseVisualStyleBackColor = true;
|
||||
this.radioRA.CheckedChanged += new System.EventHandler(this.radioGameType_CheckedChanged);
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox2.Controls.Add(this.flowLayoutPanel4);
|
||||
this.groupBox2.Location = new System.Drawing.Point(2, 76);
|
||||
this.groupBox2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.groupBox2.Size = new System.Drawing.Size(339, 89);
|
||||
this.groupBox2.TabIndex = 3;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Theater";
|
||||
//
|
||||
// flowLayoutPanel4
|
||||
//
|
||||
this.flowLayoutPanel4.AutoSize = true;
|
||||
this.flowLayoutPanel4.Controls.Add(this.radioTheater1);
|
||||
this.flowLayoutPanel4.Controls.Add(this.radioTheater2);
|
||||
this.flowLayoutPanel4.Controls.Add(this.radioTheater3);
|
||||
this.flowLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel4.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flowLayoutPanel4.Location = new System.Drawing.Point(2, 15);
|
||||
this.flowLayoutPanel4.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.flowLayoutPanel4.Name = "flowLayoutPanel4";
|
||||
this.flowLayoutPanel4.Size = new System.Drawing.Size(335, 72);
|
||||
this.flowLayoutPanel4.TabIndex = 0;
|
||||
//
|
||||
// radioTheater1
|
||||
//
|
||||
this.radioTheater1.AutoSize = true;
|
||||
this.radioTheater1.Checked = true;
|
||||
this.radioTheater1.Location = new System.Drawing.Point(2, 2);
|
||||
this.radioTheater1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.radioTheater1.Name = "radioTheater1";
|
||||
this.radioTheater1.Size = new System.Drawing.Size(56, 17);
|
||||
this.radioTheater1.TabIndex = 0;
|
||||
this.radioTheater1.TabStop = true;
|
||||
this.radioTheater1.Text = "Desert";
|
||||
this.radioTheater1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// radioTheater2
|
||||
//
|
||||
this.radioTheater2.AutoSize = true;
|
||||
this.radioTheater2.Location = new System.Drawing.Point(2, 23);
|
||||
this.radioTheater2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.radioTheater2.Name = "radioTheater2";
|
||||
this.radioTheater2.Size = new System.Drawing.Size(76, 17);
|
||||
this.radioTheater2.TabIndex = 1;
|
||||
this.radioTheater2.Text = "Temperate";
|
||||
this.radioTheater2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// radioTheater3
|
||||
//
|
||||
this.radioTheater3.AutoSize = true;
|
||||
this.radioTheater3.Location = new System.Drawing.Point(2, 44);
|
||||
this.radioTheater3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.radioTheater3.Name = "radioTheater3";
|
||||
this.radioTheater3.Size = new System.Drawing.Size(56, 17);
|
||||
this.radioTheater3.TabIndex = 2;
|
||||
this.radioTheater3.TabStop = true;
|
||||
this.radioTheater3.Text = "Winter";
|
||||
this.radioTheater3.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// NewMapDialog
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(356, 324);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "NewMapDialog";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "New Map";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel2.ResumeLayout(false);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.flowLayoutPanel3.ResumeLayout(false);
|
||||
this.flowLayoutPanel3.PerformLayout();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.flowLayoutPanel4.ResumeLayout(false);
|
||||
this.flowLayoutPanel4.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3;
|
||||
private System.Windows.Forms.RadioButton radioTD;
|
||||
private System.Windows.Forms.RadioButton radioRA;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel4;
|
||||
private System.Windows.Forms.RadioButton radioTheater1;
|
||||
private System.Windows.Forms.RadioButton radioTheater2;
|
||||
private System.Windows.Forms.RadioButton radioTheater3;
|
||||
}
|
||||
}
|
85
CnCTDRAMapEditor/Dialogs/NewMapDialog.cs
Normal file
85
CnCTDRAMapEditor/Dialogs/NewMapDialog.cs
Normal file
|
@ -0,0 +1,85 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class NewMapDialog : Form
|
||||
{
|
||||
private GameType gameType = GameType.TiberianDawn;
|
||||
public GameType GameType
|
||||
{
|
||||
get => gameType;
|
||||
set
|
||||
{
|
||||
if (gameType != value)
|
||||
{
|
||||
gameType = value;
|
||||
UpdateGameType();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string TheaterName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (radioTheater1.Checked) return radioTheater1.Text;
|
||||
if (radioTheater2.Checked) return radioTheater2.Text;
|
||||
if (radioTheater3.Checked) return radioTheater3.Text;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public NewMapDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void UpdateGameType()
|
||||
{
|
||||
switch(GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
{
|
||||
radioTheater1.Text = "Desert";
|
||||
radioTheater2.Text = "Temperate";
|
||||
radioTheater3.Text = "Winter";
|
||||
} break;
|
||||
case GameType.RedAlert:
|
||||
{
|
||||
radioTheater1.Text = "Temperate";
|
||||
radioTheater2.Text = "Snow";
|
||||
radioTheater3.Text = "Interior";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void radioGameType_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (radioTD.Checked)
|
||||
{
|
||||
GameType = GameType.TiberianDawn;
|
||||
}
|
||||
else if (radioRA.Checked)
|
||||
{
|
||||
GameType = GameType.RedAlert;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
120
CnCTDRAMapEditor/Dialogs/NewMapDialog.resx
Normal file
120
CnCTDRAMapEditor/Dialogs/NewMapDialog.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
386
CnCTDRAMapEditor/Dialogs/SteamDialog.Designer.cs
generated
Normal file
386
CnCTDRAMapEditor/Dialogs/SteamDialog.Designer.cs
generated
Normal file
|
@ -0,0 +1,386 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class SteamDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SteamDialog));
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.descriptionTxt = new System.Windows.Forms.TextBox();
|
||||
this.titleTxt = new System.Windows.Forms.TextBox();
|
||||
this.visibilityComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.previewTxt = new System.Windows.Forms.TextBox();
|
||||
this.previewBtn = new System.Windows.Forms.Button();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.btnGoToSteam = new System.Windows.Forms.Button();
|
||||
this.publicMapContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.publishAsNewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.statusLbl = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.btnPublishMap = new MobiusEditor.Controls.MenuButton();
|
||||
this.imageTooltip = new MobiusEditor.Controls.ImageTooltip();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.tableLayoutPanel2.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.publicMapContextMenuStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 1;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 2);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 3;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(500, 385);
|
||||
this.tableLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
this.tableLayoutPanel2.ColumnCount = 2;
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label2, 0, 1);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label3, 0, 2);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label4, 0, 3);
|
||||
this.tableLayoutPanel2.Controls.Add(this.descriptionTxt, 0, 4);
|
||||
this.tableLayoutPanel2.Controls.Add(this.titleTxt, 1, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.visibilityComboBox, 1, 1);
|
||||
this.tableLayoutPanel2.Controls.Add(this.panel1, 1, 2);
|
||||
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel2.Location = new System.Drawing.Point(2, 2);
|
||||
this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
|
||||
this.tableLayoutPanel2.RowCount = 5;
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 13F));
|
||||
this.tableLayoutPanel2.Size = new System.Drawing.Size(496, 233);
|
||||
this.tableLayoutPanel2.TabIndex = 2;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label1.Location = new System.Drawing.Point(2, 0);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(69, 24);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Title";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label2.Location = new System.Drawing.Point(2, 24);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(69, 25);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Visibility";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label3.Location = new System.Drawing.Point(2, 49);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(69, 27);
|
||||
this.label3.TabIndex = 2;
|
||||
this.label3.Text = "Preview";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label4.Location = new System.Drawing.Point(2, 76);
|
||||
this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(69, 13);
|
||||
this.label4.TabIndex = 3;
|
||||
this.label4.Text = "Description";
|
||||
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// descriptionTxt
|
||||
//
|
||||
this.tableLayoutPanel2.SetColumnSpan(this.descriptionTxt, 2);
|
||||
this.descriptionTxt.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.descriptionTxt.Location = new System.Drawing.Point(2, 91);
|
||||
this.descriptionTxt.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.descriptionTxt.Multiline = true;
|
||||
this.descriptionTxt.Name = "descriptionTxt";
|
||||
this.descriptionTxt.Size = new System.Drawing.Size(492, 202);
|
||||
this.descriptionTxt.TabIndex = 4;
|
||||
this.descriptionTxt.TextChanged += new System.EventHandler(this.descriptionTxt_TextChanged);
|
||||
//
|
||||
// titleTxt
|
||||
//
|
||||
this.titleTxt.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.titleTxt.Location = new System.Drawing.Point(75, 2);
|
||||
this.titleTxt.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.titleTxt.Name = "titleTxt";
|
||||
this.titleTxt.Size = new System.Drawing.Size(419, 20);
|
||||
this.titleTxt.TabIndex = 5;
|
||||
//
|
||||
// visibilityComboBox
|
||||
//
|
||||
this.visibilityComboBox.DisplayMember = "Name";
|
||||
this.visibilityComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.visibilityComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.visibilityComboBox.FormattingEnabled = true;
|
||||
this.visibilityComboBox.Location = new System.Drawing.Point(75, 26);
|
||||
this.visibilityComboBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.visibilityComboBox.Name = "visibilityComboBox";
|
||||
this.visibilityComboBox.Size = new System.Drawing.Size(419, 21);
|
||||
this.visibilityComboBox.TabIndex = 6;
|
||||
this.visibilityComboBox.ValueMember = "Value";
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.previewTxt);
|
||||
this.panel1.Controls.Add(this.previewBtn);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel1.Location = new System.Drawing.Point(75, 51);
|
||||
this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(419, 23);
|
||||
this.panel1.TabIndex = 7;
|
||||
//
|
||||
// previewTxt
|
||||
//
|
||||
this.previewTxt.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.previewTxt.Location = new System.Drawing.Point(2, 2);
|
||||
this.previewTxt.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.previewTxt.Name = "previewTxt";
|
||||
this.previewTxt.Size = new System.Drawing.Size(392, 20);
|
||||
this.previewTxt.TabIndex = 2;
|
||||
this.previewTxt.TextChanged += new System.EventHandler(this.previewTxt_TextChanged);
|
||||
//
|
||||
// previewBtn
|
||||
//
|
||||
this.previewBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.previewBtn.AutoSize = true;
|
||||
this.previewBtn.Location = new System.Drawing.Point(392, 2);
|
||||
this.previewBtn.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.previewBtn.Name = "previewBtn";
|
||||
this.previewBtn.Size = new System.Drawing.Size(26, 23);
|
||||
this.previewBtn.TabIndex = 3;
|
||||
this.previewBtn.Text = "...";
|
||||
this.previewBtn.UseVisualStyleBackColor = true;
|
||||
this.previewBtn.Click += new System.EventHandler(this.previewBtn_Click);
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.btnClose);
|
||||
this.panel2.Controls.Add(this.btnGoToSteam);
|
||||
this.panel2.Controls.Add(this.btnPublishMap);
|
||||
this.panel2.Controls.Add(this.statusLbl);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(2, 239);
|
||||
this.panel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(496, 34);
|
||||
this.panel2.TabIndex = 3;
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnClose.AutoSize = true;
|
||||
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnClose.Location = new System.Drawing.Point(426, 2);
|
||||
this.btnClose.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(68, 30);
|
||||
this.btnClose.TabIndex = 6;
|
||||
this.btnClose.Text = "&Close";
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnGoToSteam
|
||||
//
|
||||
this.btnGoToSteam.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnGoToSteam.AutoSize = true;
|
||||
this.btnGoToSteam.Location = new System.Drawing.Point(346, 2);
|
||||
this.btnGoToSteam.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.btnGoToSteam.Name = "btnGoToSteam";
|
||||
this.btnGoToSteam.Size = new System.Drawing.Size(76, 30);
|
||||
this.btnGoToSteam.TabIndex = 7;
|
||||
this.btnGoToSteam.Text = "Go to &Steam";
|
||||
this.btnGoToSteam.UseVisualStyleBackColor = true;
|
||||
this.btnGoToSteam.Click += new System.EventHandler(this.btnGoToSteam_Click);
|
||||
//
|
||||
// publicMapContextMenuStrip
|
||||
//
|
||||
this.publicMapContextMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
this.publicMapContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.publishAsNewToolStripMenuItem});
|
||||
this.publicMapContextMenuStrip.Name = "publicMapContextMenuStrip";
|
||||
this.publicMapContextMenuStrip.Size = new System.Drawing.Size(157, 26);
|
||||
//
|
||||
// publishAsNewToolStripMenuItem
|
||||
//
|
||||
this.publishAsNewToolStripMenuItem.Name = "publishAsNewToolStripMenuItem";
|
||||
this.publishAsNewToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
||||
this.publishAsNewToolStripMenuItem.Text = "Publish As New";
|
||||
this.publishAsNewToolStripMenuItem.Click += new System.EventHandler(this.publishAsNewToolStripMenuItem_Click);
|
||||
//
|
||||
// statusLbl
|
||||
//
|
||||
this.statusLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.statusLbl.Location = new System.Drawing.Point(7, 1);
|
||||
this.statusLbl.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.statusLbl.Name = "statusLbl";
|
||||
this.statusLbl.Size = new System.Drawing.Size(264, 31);
|
||||
this.statusLbl.TabIndex = 9;
|
||||
this.statusLbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label5.Location = new System.Drawing.Point(3, 275);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(494, 110);
|
||||
this.label5.TabIndex = 4;
|
||||
this.label5.Text = resources.GetString("label5.Text");
|
||||
//
|
||||
// btnPublishMap
|
||||
//
|
||||
this.btnPublishMap.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnPublishMap.AutoSize = true;
|
||||
this.btnPublishMap.Location = new System.Drawing.Point(234, 2);
|
||||
this.btnPublishMap.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnPublishMap.Menu = this.publicMapContextMenuStrip;
|
||||
this.btnPublishMap.Name = "btnPublishMap";
|
||||
this.btnPublishMap.Size = new System.Drawing.Size(111, 30);
|
||||
this.btnPublishMap.TabIndex = 8;
|
||||
this.btnPublishMap.Text = "&Publish Map";
|
||||
this.btnPublishMap.UseVisualStyleBackColor = true;
|
||||
this.btnPublishMap.Click += new System.EventHandler(this.btnPublishMap_Click);
|
||||
//
|
||||
// imageTooltip
|
||||
//
|
||||
this.imageTooltip.MaxSize = new System.Drawing.Size(0, 0);
|
||||
this.imageTooltip.OwnerDraw = true;
|
||||
this.imageTooltip.ShowAlways = true;
|
||||
//
|
||||
// SteamDialog
|
||||
//
|
||||
this.AcceptButton = this.btnPublishMap;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.CancelButton = this.btnClose;
|
||||
this.ClientSize = new System.Drawing.Size(500, 385);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(516, 357);
|
||||
this.Name = "SteamDialog";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Steam Workshop: Publish Custom Map";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel2.ResumeLayout(false);
|
||||
this.tableLayoutPanel2.PerformLayout();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
this.publicMapContextMenuStrip.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox descriptionTxt;
|
||||
private System.Windows.Forms.TextBox titleTxt;
|
||||
private System.Windows.Forms.ComboBox visibilityComboBox;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.TextBox previewTxt;
|
||||
private System.Windows.Forms.Button previewBtn;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Button btnClose;
|
||||
private System.Windows.Forms.Button btnGoToSteam;
|
||||
private MobiusEditor.Controls.MenuButton btnPublishMap;
|
||||
private System.Windows.Forms.Label statusLbl;
|
||||
private System.Windows.Forms.ContextMenuStrip publicMapContextMenuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem publishAsNewToolStripMenuItem;
|
||||
private Controls.ImageTooltip imageTooltip;
|
||||
private System.Windows.Forms.Label label5;
|
||||
}
|
||||
}
|
253
CnCTDRAMapEditor/Dialogs/SteamDialog.cs
Normal file
253
CnCTDRAMapEditor/Dialogs/SteamDialog.cs
Normal file
|
@ -0,0 +1,253 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Controls;
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Utility;
|
||||
using Steamworks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class SteamDialog : Form
|
||||
{
|
||||
private static readonly string PreviewDirectory = Path.Combine(Path.GetTempPath(), "CnCRCMapEditor");
|
||||
|
||||
private readonly IGamePlugin plugin;
|
||||
private readonly Timer statusUpdateTimer = new Timer();
|
||||
|
||||
public SteamDialog(IGamePlugin plugin)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
visibilityComboBox.DataSource = new []
|
||||
{
|
||||
new { Name = "Public", Value = ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic },
|
||||
new { Name = "Friends Only", Value = ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityFriendsOnly },
|
||||
new { Name = "Private", Value = ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPrivate }
|
||||
};
|
||||
|
||||
statusUpdateTimer.Interval = 500;
|
||||
statusUpdateTimer.Tick += StatusUpdateTimer_Tick;
|
||||
|
||||
Disposed += (o, e) => { (previewTxt.Tag as Image)?.Dispose(); };
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
titleTxt.Text = plugin.Map.SteamSection.Title;
|
||||
descriptionTxt.Text = plugin.Map.SteamSection.Description;
|
||||
previewTxt.Text = plugin.Map.SteamSection.PreviewFile;
|
||||
visibilityComboBox.SelectedValue = plugin.Map.SteamSection.Visibility;
|
||||
|
||||
btnPublishMap.SplitWidth = (plugin.Map.SteamSection.PublishedFileId != PublishedFileId_t.Invalid.m_PublishedFileId) ? MenuButton.DefaultSplitWidth : 0;
|
||||
|
||||
Directory.CreateDirectory(PreviewDirectory);
|
||||
var previewPath = Path.Combine(PreviewDirectory, "Minimap.png");
|
||||
plugin.Map.GenerateWorkshopPreview().ToBitmap().Save(previewPath, ImageFormat.Png);
|
||||
|
||||
if (plugin.Map.BasicSection.SoloMission)
|
||||
{
|
||||
var soloBannerPath = Path.Combine(PreviewDirectory, "SoloBanner.png");
|
||||
Properties.Resources.UI_CustomMissionPreviewDefault.Save(soloBannerPath, ImageFormat.Png);
|
||||
previewTxt.Text = soloBannerPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
previewTxt.Text = previewPath;
|
||||
}
|
||||
|
||||
imageTooltip.SetToolTip(previewTxt, "Preview.png");
|
||||
|
||||
statusUpdateTimer.Start();
|
||||
|
||||
UpdateControls();
|
||||
}
|
||||
|
||||
private void StatusUpdateTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
var status = SteamworksUGC.CurrentOperation?.Status;
|
||||
if (!string.IsNullOrEmpty(status))
|
||||
{
|
||||
statusLbl.Text = status;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
base.OnClosed(e);
|
||||
|
||||
statusUpdateTimer.Stop();
|
||||
statusUpdateTimer.Dispose();
|
||||
}
|
||||
|
||||
protected virtual void OnPublishSuccess()
|
||||
{
|
||||
statusLbl.Text = "Done.";
|
||||
EnableControls(true);
|
||||
}
|
||||
|
||||
protected virtual void OnOperationFailed(string status)
|
||||
{
|
||||
statusLbl.Text = status;
|
||||
EnableControls(true);
|
||||
}
|
||||
|
||||
private void EnableControls(bool enable)
|
||||
{
|
||||
titleTxt.Enabled = enable;
|
||||
visibilityComboBox.Enabled = enable;
|
||||
previewTxt.Enabled = enable;
|
||||
previewBtn.Enabled = enable;
|
||||
descriptionTxt.Enabled = enable;
|
||||
btnPublishMap.Enabled = enable;
|
||||
btnClose.Enabled = enable;
|
||||
}
|
||||
|
||||
private void btnGoToSteam_Click(object sender, EventArgs e)
|
||||
{
|
||||
var workshopUrl = SteamworksUGC.WorkshopURL;
|
||||
if (!string.IsNullOrEmpty(workshopUrl))
|
||||
{
|
||||
Process.Start(workshopUrl);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnPublishMap_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(plugin.Map.BasicSection.Name))
|
||||
{
|
||||
plugin.Map.BasicSection.Name = titleTxt.Text;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(plugin.Map.BasicSection.Author))
|
||||
{
|
||||
plugin.Map.BasicSection.Author = SteamFriends.GetPersonaName();
|
||||
}
|
||||
|
||||
plugin.Map.SteamSection.PreviewFile = previewTxt.Text;
|
||||
plugin.Map.SteamSection.Title = titleTxt.Text;
|
||||
plugin.Map.SteamSection.Description = descriptionTxt.Text;
|
||||
plugin.Map.SteamSection.Visibility = (ERemoteStoragePublishedFileVisibility)visibilityComboBox.SelectedValue;
|
||||
|
||||
var tempPath = Path.Combine(Path.GetTempPath(), "CnCRCMapEditorPublishUGC");
|
||||
Directory.CreateDirectory(tempPath);
|
||||
foreach (var file in new DirectoryInfo(tempPath).EnumerateFiles()) file.Delete();
|
||||
|
||||
var pgmPath = Path.Combine(tempPath, "MAPDATA.PGM");
|
||||
plugin.Save(pgmPath, FileType.PGM);
|
||||
|
||||
var tags = new List<string>();
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
tags.Add("TD");
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
tags.Add("RA");
|
||||
break;
|
||||
}
|
||||
|
||||
if (plugin.Map.BasicSection.SoloMission)
|
||||
{
|
||||
tags.Add("SinglePlayer");
|
||||
}
|
||||
else
|
||||
{
|
||||
tags.Add("MultiPlayer");
|
||||
}
|
||||
|
||||
if (SteamworksUGC.PublishUGC(tempPath, plugin.Map.SteamSection, tags, OnPublishSuccess, OnOperationFailed))
|
||||
{
|
||||
statusLbl.Text = SteamworksUGC.CurrentOperation.Status;
|
||||
EnableControls(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void previewBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
var ofd = new OpenFileDialog
|
||||
{
|
||||
AutoUpgradeEnabled = false,
|
||||
RestoreDirectory = true,
|
||||
Filter = "Preview Files (*.png)|*.png",
|
||||
CheckFileExists = true,
|
||||
InitialDirectory = Path.GetDirectoryName(previewTxt.Text),
|
||||
FileName = Path.GetFileName(previewTxt.Text)
|
||||
};
|
||||
if (!string.IsNullOrEmpty(previewTxt.Text))
|
||||
{
|
||||
ofd.FileName = previewTxt.Text;
|
||||
}
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
previewTxt.Text = ofd.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
private void publishAsNewToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
plugin.Map.SteamSection.PublishedFileId = PublishedFileId_t.Invalid.m_PublishedFileId;
|
||||
btnPublishMap.PerformClick();
|
||||
}
|
||||
|
||||
private void previewTxt_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
(previewTxt.Tag as Image)?.Dispose();
|
||||
|
||||
Bitmap preview = null;
|
||||
using (Bitmap b = new Bitmap(previewTxt.Text))
|
||||
{
|
||||
preview = new Bitmap(b.Width, b.Height, b.PixelFormat);
|
||||
using (Graphics g = Graphics.FromImage(preview))
|
||||
{
|
||||
g.DrawImage(b, Point.Empty);
|
||||
g.Flush();
|
||||
}
|
||||
}
|
||||
|
||||
previewTxt.Tag = preview;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
previewTxt.Tag = null;
|
||||
}
|
||||
|
||||
UpdateControls();
|
||||
}
|
||||
|
||||
private void descriptionTxt_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateControls();
|
||||
}
|
||||
|
||||
private void UpdateControls()
|
||||
{
|
||||
btnPublishMap.Enabled = (previewTxt.Tag != null) && !string.IsNullOrEmpty(descriptionTxt.Text);
|
||||
}
|
||||
}
|
||||
}
|
131
CnCTDRAMapEditor/Dialogs/SteamDialog.resx
Normal file
131
CnCTDRAMapEditor/Dialogs/SteamDialog.resx
Normal file
|
@ -0,0 +1,131 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="publicMapContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="label5.Text" xml:space="preserve">
|
||||
<value>Respect the rights of others. Provide only content (1) that is not defamatory, obscene, offensive or indecent, (2) that is not confidential or proprietary and (3) that does not violate or infringe any third-party rights. By providing content, you grant EA all licenses needed to enable EA’s use of the content for any purpose. EA’s User Agreement applies.
|
||||
|
||||
EA does not pre-screen, endorse or specifically support any C&&C mod. Please use mods with caution and understand there may be a risk. EA reserves the right to address any inappropriate use of our C&&C content.</value>
|
||||
</data>
|
||||
<metadata name="imageTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>314, 17</value>
|
||||
</metadata>
|
||||
</root>
|
713
CnCTDRAMapEditor/Dialogs/TeamTypesDialog.Designer.cs
generated
Normal file
713
CnCTDRAMapEditor/Dialogs/TeamTypesDialog.Designer.cs
generated
Normal file
|
@ -0,0 +1,713 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class TeamTypesDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.settingsPanel = new System.Windows.Forms.Panel();
|
||||
this.teamTypeTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.houseComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.roundaboutCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.learningCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.suicideCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.autocreateCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.mercernaryCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.reinforcableCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.prebuiltCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.initNumNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.maxAllowedNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.fearNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.waypointLabel = new System.Windows.Forms.Label();
|
||||
this.triggerLabel = new System.Windows.Forms.Label();
|
||||
this.waypointComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.triggerComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.recruitPriorityNud = new System.Windows.Forms.NumericUpDown();
|
||||
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.teamsDataGridView = new System.Windows.Forms.DataGridView();
|
||||
this.teamsTypeColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
|
||||
this.teamsCountColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.missionsDataGridView = new System.Windows.Forms.DataGridView();
|
||||
this.missionsMissionColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
|
||||
this.missionsArgumentColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.teamTypesListView = new System.Windows.Forms.ListView();
|
||||
this.nameColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.teamTypesContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.addTeamTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.removeTeamTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.settingsPanel.SuspendLayout();
|
||||
this.teamTypeTableLayoutPanel.SuspendLayout();
|
||||
this.tableLayoutPanel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.initNumNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.maxAllowedNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.fearNud)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.recruitPriorityNud)).BeginInit();
|
||||
this.tableLayoutPanel3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.teamsDataGridView)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.missionsDataGridView)).BeginInit();
|
||||
this.teamTypesContextMenuStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.settingsPanel, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.teamTypesListView, 0, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 2;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(1313, 640);
|
||||
this.tableLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 2);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnCancel);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOK);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(4, 583);
|
||||
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(1305, 52);
|
||||
this.flowLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.AutoSize = true;
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(1200, 3);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(102, 46);
|
||||
this.btnCancel.TabIndex = 2;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.AutoSize = true;
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(1119, 3);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(75, 46);
|
||||
this.btnOK.TabIndex = 3;
|
||||
this.btnOK.Text = "&OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// settingsPanel
|
||||
//
|
||||
this.settingsPanel.Controls.Add(this.teamTypeTableLayoutPanel);
|
||||
this.settingsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.settingsPanel.Location = new System.Drawing.Point(277, 15);
|
||||
this.settingsPanel.Margin = new System.Windows.Forms.Padding(15);
|
||||
this.settingsPanel.Name = "settingsPanel";
|
||||
this.settingsPanel.Size = new System.Drawing.Size(1021, 548);
|
||||
this.settingsPanel.TabIndex = 3;
|
||||
//
|
||||
// teamTypeTableLayoutPanel
|
||||
//
|
||||
this.teamTypeTableLayoutPanel.ColumnCount = 3;
|
||||
this.teamTypeTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.teamTypeTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.teamTypeTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.teamTypeTableLayoutPanel.Controls.Add(this.tableLayoutPanel2, 0, 0);
|
||||
this.teamTypeTableLayoutPanel.Controls.Add(this.tableLayoutPanel3, 2, 0);
|
||||
this.teamTypeTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.teamTypeTableLayoutPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.teamTypeTableLayoutPanel.Name = "teamTypeTableLayoutPanel";
|
||||
this.teamTypeTableLayoutPanel.RowCount = 1;
|
||||
this.teamTypeTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.teamTypeTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 548F));
|
||||
this.teamTypeTableLayoutPanel.Size = new System.Drawing.Size(1021, 548);
|
||||
this.teamTypeTableLayoutPanel.TabIndex = 0;
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
this.tableLayoutPanel2.AutoSize = true;
|
||||
this.tableLayoutPanel2.ColumnCount = 2;
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.houseComboBox, 1, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.roundaboutCheckBox, 1, 1);
|
||||
this.tableLayoutPanel2.Controls.Add(this.learningCheckBox, 1, 2);
|
||||
this.tableLayoutPanel2.Controls.Add(this.suicideCheckBox, 1, 3);
|
||||
this.tableLayoutPanel2.Controls.Add(this.autocreateCheckBox, 1, 4);
|
||||
this.tableLayoutPanel2.Controls.Add(this.mercernaryCheckBox, 1, 5);
|
||||
this.tableLayoutPanel2.Controls.Add(this.reinforcableCheckBox, 1, 6);
|
||||
this.tableLayoutPanel2.Controls.Add(this.prebuiltCheckBox, 1, 7);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label2, 0, 9);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label3, 0, 10);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label4, 0, 11);
|
||||
this.tableLayoutPanel2.Controls.Add(this.initNumNud, 1, 9);
|
||||
this.tableLayoutPanel2.Controls.Add(this.maxAllowedNud, 1, 10);
|
||||
this.tableLayoutPanel2.Controls.Add(this.fearNud, 1, 11);
|
||||
this.tableLayoutPanel2.Controls.Add(this.waypointLabel, 0, 12);
|
||||
this.tableLayoutPanel2.Controls.Add(this.triggerLabel, 0, 13);
|
||||
this.tableLayoutPanel2.Controls.Add(this.waypointComboBox, 1, 12);
|
||||
this.tableLayoutPanel2.Controls.Add(this.triggerComboBox, 1, 13);
|
||||
this.tableLayoutPanel2.Controls.Add(this.label9, 0, 8);
|
||||
this.tableLayoutPanel2.Controls.Add(this.recruitPriorityNud, 1, 8);
|
||||
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 3);
|
||||
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
|
||||
this.tableLayoutPanel2.RowCount = 15;
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel2.Size = new System.Drawing.Size(307, 542);
|
||||
this.tableLayoutPanel2.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label1.Location = new System.Drawing.Point(3, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(100, 34);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "House";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// houseComboBox
|
||||
//
|
||||
this.houseComboBox.DisplayMember = "Name";
|
||||
this.houseComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.houseComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.houseComboBox.FormattingEnabled = true;
|
||||
this.houseComboBox.Location = new System.Drawing.Point(109, 3);
|
||||
this.houseComboBox.Name = "houseComboBox";
|
||||
this.houseComboBox.Size = new System.Drawing.Size(195, 28);
|
||||
this.houseComboBox.TabIndex = 1;
|
||||
this.houseComboBox.ValueMember = "Type";
|
||||
//
|
||||
// roundaboutCheckBox
|
||||
//
|
||||
this.roundaboutCheckBox.AutoSize = true;
|
||||
this.roundaboutCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.roundaboutCheckBox.Location = new System.Drawing.Point(109, 37);
|
||||
this.roundaboutCheckBox.Name = "roundaboutCheckBox";
|
||||
this.roundaboutCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.roundaboutCheckBox.TabIndex = 2;
|
||||
this.roundaboutCheckBox.Text = "Roundabout";
|
||||
this.roundaboutCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// learningCheckBox
|
||||
//
|
||||
this.learningCheckBox.AutoSize = true;
|
||||
this.learningCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.learningCheckBox.Location = new System.Drawing.Point(109, 67);
|
||||
this.learningCheckBox.Name = "learningCheckBox";
|
||||
this.learningCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.learningCheckBox.TabIndex = 3;
|
||||
this.learningCheckBox.Text = "Learning";
|
||||
this.learningCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// suicideCheckBox
|
||||
//
|
||||
this.suicideCheckBox.AutoSize = true;
|
||||
this.suicideCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.suicideCheckBox.Location = new System.Drawing.Point(109, 97);
|
||||
this.suicideCheckBox.Name = "suicideCheckBox";
|
||||
this.suicideCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.suicideCheckBox.TabIndex = 4;
|
||||
this.suicideCheckBox.Text = "Suicide";
|
||||
this.suicideCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// autocreateCheckBox
|
||||
//
|
||||
this.autocreateCheckBox.AutoSize = true;
|
||||
this.autocreateCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.autocreateCheckBox.Location = new System.Drawing.Point(109, 127);
|
||||
this.autocreateCheckBox.Name = "autocreateCheckBox";
|
||||
this.autocreateCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.autocreateCheckBox.TabIndex = 5;
|
||||
this.autocreateCheckBox.Text = "Auto-create";
|
||||
this.autocreateCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// mercernaryCheckBox
|
||||
//
|
||||
this.mercernaryCheckBox.AutoSize = true;
|
||||
this.mercernaryCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.mercernaryCheckBox.Location = new System.Drawing.Point(109, 157);
|
||||
this.mercernaryCheckBox.Name = "mercernaryCheckBox";
|
||||
this.mercernaryCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.mercernaryCheckBox.TabIndex = 6;
|
||||
this.mercernaryCheckBox.Text = "Mercernary";
|
||||
this.mercernaryCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// reinforcableCheckBox
|
||||
//
|
||||
this.reinforcableCheckBox.AutoSize = true;
|
||||
this.reinforcableCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.reinforcableCheckBox.Location = new System.Drawing.Point(109, 187);
|
||||
this.reinforcableCheckBox.Name = "reinforcableCheckBox";
|
||||
this.reinforcableCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.reinforcableCheckBox.TabIndex = 7;
|
||||
this.reinforcableCheckBox.Text = "Reinforcable";
|
||||
this.reinforcableCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// prebuiltCheckBox
|
||||
//
|
||||
this.prebuiltCheckBox.AutoSize = true;
|
||||
this.prebuiltCheckBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.prebuiltCheckBox.Location = new System.Drawing.Point(109, 217);
|
||||
this.prebuiltCheckBox.Name = "prebuiltCheckBox";
|
||||
this.prebuiltCheckBox.Size = new System.Drawing.Size(195, 24);
|
||||
this.prebuiltCheckBox.TabIndex = 8;
|
||||
this.prebuiltCheckBox.Text = "Prebuilt";
|
||||
this.prebuiltCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label2.Location = new System.Drawing.Point(3, 276);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(100, 32);
|
||||
this.label2.TabIndex = 9;
|
||||
this.label2.Text = "Init Num";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label3.Location = new System.Drawing.Point(3, 308);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(100, 32);
|
||||
this.label3.TabIndex = 10;
|
||||
this.label3.Text = "Max Allowed";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label4.Location = new System.Drawing.Point(3, 340);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(100, 32);
|
||||
this.label4.TabIndex = 11;
|
||||
this.label4.Text = "Fear";
|
||||
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// initNumNud
|
||||
//
|
||||
this.initNumNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.initNumNud.Location = new System.Drawing.Point(109, 279);
|
||||
this.initNumNud.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.initNumNud.Name = "initNumNud";
|
||||
this.initNumNud.Size = new System.Drawing.Size(195, 26);
|
||||
this.initNumNud.TabIndex = 12;
|
||||
//
|
||||
// maxAllowedNud
|
||||
//
|
||||
this.maxAllowedNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.maxAllowedNud.Location = new System.Drawing.Point(109, 311);
|
||||
this.maxAllowedNud.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.maxAllowedNud.Name = "maxAllowedNud";
|
||||
this.maxAllowedNud.Size = new System.Drawing.Size(195, 26);
|
||||
this.maxAllowedNud.TabIndex = 13;
|
||||
//
|
||||
// fearNud
|
||||
//
|
||||
this.fearNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.fearNud.Location = new System.Drawing.Point(109, 343);
|
||||
this.fearNud.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.fearNud.Name = "fearNud";
|
||||
this.fearNud.Size = new System.Drawing.Size(195, 26);
|
||||
this.fearNud.TabIndex = 14;
|
||||
//
|
||||
// waypointLabel
|
||||
//
|
||||
this.waypointLabel.AutoSize = true;
|
||||
this.waypointLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.waypointLabel.Location = new System.Drawing.Point(3, 372);
|
||||
this.waypointLabel.Name = "waypointLabel";
|
||||
this.waypointLabel.Size = new System.Drawing.Size(100, 34);
|
||||
this.waypointLabel.TabIndex = 15;
|
||||
this.waypointLabel.Text = "Waypoint";
|
||||
this.waypointLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// triggerLabel
|
||||
//
|
||||
this.triggerLabel.AutoSize = true;
|
||||
this.triggerLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.triggerLabel.Location = new System.Drawing.Point(3, 406);
|
||||
this.triggerLabel.Name = "triggerLabel";
|
||||
this.triggerLabel.Size = new System.Drawing.Size(100, 34);
|
||||
this.triggerLabel.TabIndex = 16;
|
||||
this.triggerLabel.Text = "Trigger";
|
||||
this.triggerLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// waypointComboBox
|
||||
//
|
||||
this.waypointComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.waypointComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.waypointComboBox.FormattingEnabled = true;
|
||||
this.waypointComboBox.Location = new System.Drawing.Point(109, 375);
|
||||
this.waypointComboBox.Name = "waypointComboBox";
|
||||
this.waypointComboBox.Size = new System.Drawing.Size(195, 28);
|
||||
this.waypointComboBox.TabIndex = 17;
|
||||
//
|
||||
// triggerComboBox
|
||||
//
|
||||
this.triggerComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.triggerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.triggerComboBox.FormattingEnabled = true;
|
||||
this.triggerComboBox.Location = new System.Drawing.Point(109, 409);
|
||||
this.triggerComboBox.Name = "triggerComboBox";
|
||||
this.triggerComboBox.Size = new System.Drawing.Size(195, 28);
|
||||
this.triggerComboBox.TabIndex = 18;
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label9.Location = new System.Drawing.Point(3, 244);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(100, 32);
|
||||
this.label9.TabIndex = 19;
|
||||
this.label9.Text = "Priority";
|
||||
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// recruitPriorityNud
|
||||
//
|
||||
this.recruitPriorityNud.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.recruitPriorityNud.Location = new System.Drawing.Point(109, 247);
|
||||
this.recruitPriorityNud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.recruitPriorityNud.Minimum = new decimal(new int[] {
|
||||
-2147483648,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.recruitPriorityNud.Name = "recruitPriorityNud";
|
||||
this.recruitPriorityNud.Size = new System.Drawing.Size(195, 26);
|
||||
this.recruitPriorityNud.TabIndex = 20;
|
||||
//
|
||||
// tableLayoutPanel3
|
||||
//
|
||||
this.tableLayoutPanel3.ColumnCount = 2;
|
||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel3.Controls.Add(this.label7, 0, 0);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label8, 1, 0);
|
||||
this.tableLayoutPanel3.Controls.Add(this.teamsDataGridView, 0, 1);
|
||||
this.tableLayoutPanel3.Controls.Add(this.missionsDataGridView, 1, 1);
|
||||
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel3.Location = new System.Drawing.Point(316, 3);
|
||||
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
|
||||
this.tableLayoutPanel3.RowCount = 2;
|
||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel3.Size = new System.Drawing.Size(702, 542);
|
||||
this.tableLayoutPanel3.TabIndex = 1;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(3, 0);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(57, 20);
|
||||
this.label7.TabIndex = 0;
|
||||
this.label7.Text = "Teams";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(354, 0);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(70, 20);
|
||||
this.label8.TabIndex = 1;
|
||||
this.label8.Text = "Missions";
|
||||
//
|
||||
// teamsDataGridView
|
||||
//
|
||||
this.teamsDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
this.teamsDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
|
||||
this.teamsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.teamsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.teamsTypeColumn,
|
||||
this.teamsCountColumn});
|
||||
this.teamsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.teamsDataGridView.Location = new System.Drawing.Point(3, 23);
|
||||
this.teamsDataGridView.Name = "teamsDataGridView";
|
||||
this.teamsDataGridView.RowTemplate.Height = 28;
|
||||
this.teamsDataGridView.Size = new System.Drawing.Size(345, 516);
|
||||
this.teamsDataGridView.TabIndex = 2;
|
||||
this.teamsDataGridView.VirtualMode = true;
|
||||
this.teamsDataGridView.CancelRowEdit += new System.Windows.Forms.QuestionEventHandler(this.teamsDataGridView_CancelRowEdit);
|
||||
this.teamsDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.teamsDataGridView_CellValueNeeded);
|
||||
this.teamsDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.teamsDataGridView_CellValuePushed);
|
||||
this.teamsDataGridView.NewRowNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.teamsDataGridView_NewRowNeeded);
|
||||
this.teamsDataGridView.RowDirtyStateNeeded += new System.Windows.Forms.QuestionEventHandler(this.teamsDataGridView_RowDirtyStateNeeded);
|
||||
this.teamsDataGridView.RowValidated += new System.Windows.Forms.DataGridViewCellEventHandler(this.teamsDataGridView_RowValidated);
|
||||
this.teamsDataGridView.UserAddedRow += new System.Windows.Forms.DataGridViewRowEventHandler(this.teamsDataGridView_UserAddedRow);
|
||||
this.teamsDataGridView.UserDeletedRow += new System.Windows.Forms.DataGridViewRowEventHandler(this.teamsDataGridView_UserDeletedRow);
|
||||
this.teamsDataGridView.UserDeletingRow += new System.Windows.Forms.DataGridViewRowCancelEventHandler(this.teamsDataGridView_UserDeletingRow);
|
||||
//
|
||||
// teamsTypeColumn
|
||||
//
|
||||
this.teamsTypeColumn.HeaderText = "Type";
|
||||
this.teamsTypeColumn.Name = "teamsTypeColumn";
|
||||
this.teamsTypeColumn.Width = 54;
|
||||
//
|
||||
// teamsCountColumn
|
||||
//
|
||||
this.teamsCountColumn.HeaderText = "Count";
|
||||
this.teamsCountColumn.Name = "teamsCountColumn";
|
||||
this.teamsCountColumn.Width = 88;
|
||||
//
|
||||
// missionsDataGridView
|
||||
//
|
||||
this.missionsDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
this.missionsDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
|
||||
this.missionsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.missionsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.missionsMissionColumn,
|
||||
this.missionsArgumentColumn});
|
||||
this.missionsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.missionsDataGridView.Location = new System.Drawing.Point(354, 23);
|
||||
this.missionsDataGridView.Name = "missionsDataGridView";
|
||||
this.missionsDataGridView.RowTemplate.Height = 28;
|
||||
this.missionsDataGridView.Size = new System.Drawing.Size(345, 516);
|
||||
this.missionsDataGridView.TabIndex = 3;
|
||||
this.missionsDataGridView.VirtualMode = true;
|
||||
this.missionsDataGridView.CancelRowEdit += new System.Windows.Forms.QuestionEventHandler(this.missionsDataGridView_CancelRowEdit);
|
||||
this.missionsDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.missionsDataGridView_CellValueNeeded);
|
||||
this.missionsDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.missionsDataGridView_CellValuePushed);
|
||||
this.missionsDataGridView.NewRowNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.missionsDataGridView_NewRowNeeded);
|
||||
this.missionsDataGridView.RowDirtyStateNeeded += new System.Windows.Forms.QuestionEventHandler(this.missionsDataGridView_RowDirtyStateNeeded);
|
||||
this.missionsDataGridView.RowValidated += new System.Windows.Forms.DataGridViewCellEventHandler(this.missionsDataGridView_RowValidated);
|
||||
this.missionsDataGridView.UserAddedRow += new System.Windows.Forms.DataGridViewRowEventHandler(this.missionsDataGridView_UserAddedRow);
|
||||
this.missionsDataGridView.UserDeletedRow += new System.Windows.Forms.DataGridViewRowEventHandler(this.missionsDataGridView_UserDeletedRow);
|
||||
this.missionsDataGridView.UserDeletingRow += new System.Windows.Forms.DataGridViewRowCancelEventHandler(this.missionsDataGridView_UserDeletingRow);
|
||||
//
|
||||
// missionsMissionColumn
|
||||
//
|
||||
this.missionsMissionColumn.HeaderText = "Mission";
|
||||
this.missionsMissionColumn.Name = "missionsMissionColumn";
|
||||
this.missionsMissionColumn.Width = 68;
|
||||
//
|
||||
// missionsArgumentColumn
|
||||
//
|
||||
this.missionsArgumentColumn.HeaderText = "Argument";
|
||||
this.missionsArgumentColumn.Name = "missionsArgumentColumn";
|
||||
this.missionsArgumentColumn.Width = 115;
|
||||
//
|
||||
// teamTypesListView
|
||||
//
|
||||
this.teamTypesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.nameColumnHeader});
|
||||
this.teamTypesListView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.teamTypesListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
|
||||
this.teamTypesListView.HideSelection = false;
|
||||
this.teamTypesListView.LabelEdit = true;
|
||||
this.teamTypesListView.Location = new System.Drawing.Point(3, 3);
|
||||
this.teamTypesListView.MultiSelect = false;
|
||||
this.teamTypesListView.Name = "teamTypesListView";
|
||||
this.teamTypesListView.ShowItemToolTips = true;
|
||||
this.teamTypesListView.Size = new System.Drawing.Size(256, 572);
|
||||
this.teamTypesListView.TabIndex = 4;
|
||||
this.teamTypesListView.UseCompatibleStateImageBehavior = false;
|
||||
this.teamTypesListView.View = System.Windows.Forms.View.Details;
|
||||
this.teamTypesListView.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.teamTypesListView_AfterLabelEdit);
|
||||
this.teamTypesListView.SelectedIndexChanged += new System.EventHandler(this.teamTypesListView_SelectedIndexChanged);
|
||||
this.teamTypesListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.teamTypesListView_KeyDown);
|
||||
this.teamTypesListView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.teamTypesListView_MouseDown);
|
||||
//
|
||||
// teamTypesContextMenuStrip
|
||||
//
|
||||
this.teamTypesContextMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
this.teamTypesContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.addTeamTypeToolStripMenuItem,
|
||||
this.removeTeamTypeToolStripMenuItem});
|
||||
this.teamTypesContextMenuStrip.Name = "teamTypesContextMenuStrip";
|
||||
this.teamTypesContextMenuStrip.Size = new System.Drawing.Size(237, 64);
|
||||
//
|
||||
// addTeamTypeToolStripMenuItem
|
||||
//
|
||||
this.addTeamTypeToolStripMenuItem.Name = "addTeamTypeToolStripMenuItem";
|
||||
this.addTeamTypeToolStripMenuItem.Size = new System.Drawing.Size(236, 30);
|
||||
this.addTeamTypeToolStripMenuItem.Text = "&Add Team Type";
|
||||
this.addTeamTypeToolStripMenuItem.Click += new System.EventHandler(this.addTeamTypeToolStripMenuItem_Click);
|
||||
//
|
||||
// removeTeamTypeToolStripMenuItem
|
||||
//
|
||||
this.removeTeamTypeToolStripMenuItem.Name = "removeTeamTypeToolStripMenuItem";
|
||||
this.removeTeamTypeToolStripMenuItem.Size = new System.Drawing.Size(236, 30);
|
||||
this.removeTeamTypeToolStripMenuItem.Text = "&Remove Team Type";
|
||||
this.removeTeamTypeToolStripMenuItem.Click += new System.EventHandler(this.removeTeamTypeToolStripMenuItem_Click);
|
||||
//
|
||||
// TeamTypesDialog
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(1313, 640);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "TeamTypesDialog";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Team Types";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.settingsPanel.ResumeLayout(false);
|
||||
this.teamTypeTableLayoutPanel.ResumeLayout(false);
|
||||
this.teamTypeTableLayoutPanel.PerformLayout();
|
||||
this.tableLayoutPanel2.ResumeLayout(false);
|
||||
this.tableLayoutPanel2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.initNumNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.maxAllowedNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.fearNud)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.recruitPriorityNud)).EndInit();
|
||||
this.tableLayoutPanel3.ResumeLayout(false);
|
||||
this.tableLayoutPanel3.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.teamsDataGridView)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.missionsDataGridView)).EndInit();
|
||||
this.teamTypesContextMenuStrip.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.Panel settingsPanel;
|
||||
private System.Windows.Forms.ListView teamTypesListView;
|
||||
private System.Windows.Forms.ColumnHeader nameColumnHeader;
|
||||
private System.Windows.Forms.ContextMenuStrip teamTypesContextMenuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem addTeamTypeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem removeTeamTypeToolStripMenuItem;
|
||||
private System.Windows.Forms.TableLayoutPanel teamTypeTableLayoutPanel;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox houseComboBox;
|
||||
private System.Windows.Forms.CheckBox roundaboutCheckBox;
|
||||
private System.Windows.Forms.CheckBox learningCheckBox;
|
||||
private System.Windows.Forms.CheckBox suicideCheckBox;
|
||||
private System.Windows.Forms.CheckBox autocreateCheckBox;
|
||||
private System.Windows.Forms.CheckBox mercernaryCheckBox;
|
||||
private System.Windows.Forms.CheckBox reinforcableCheckBox;
|
||||
private System.Windows.Forms.CheckBox prebuiltCheckBox;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.NumericUpDown initNumNud;
|
||||
private System.Windows.Forms.NumericUpDown maxAllowedNud;
|
||||
private System.Windows.Forms.NumericUpDown fearNud;
|
||||
private System.Windows.Forms.Label waypointLabel;
|
||||
private System.Windows.Forms.Label triggerLabel;
|
||||
private System.Windows.Forms.ComboBox waypointComboBox;
|
||||
private System.Windows.Forms.ComboBox triggerComboBox;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.DataGridView teamsDataGridView;
|
||||
private System.Windows.Forms.DataGridView missionsDataGridView;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.NumericUpDown recruitPriorityNud;
|
||||
private System.Windows.Forms.DataGridViewComboBoxColumn teamsTypeColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn teamsCountColumn;
|
||||
private System.Windows.Forms.DataGridViewComboBoxColumn missionsMissionColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn missionsArgumentColumn;
|
||||
}
|
||||
}
|
504
CnCTDRAMapEditor/Dialogs/TeamTypesDialog.cs
Normal file
504
CnCTDRAMapEditor/Dialogs/TeamTypesDialog.cs
Normal file
|
@ -0,0 +1,504 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Model;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class TeamTypesDialog : Form
|
||||
{
|
||||
private readonly IGamePlugin plugin;
|
||||
private readonly int maxTeams;
|
||||
private readonly IEnumerable<ITechnoType> technoTypes;
|
||||
|
||||
private readonly List<TeamType> teamTypes;
|
||||
public IEnumerable<TeamType> TeamTypes => teamTypes;
|
||||
|
||||
private ListViewItem SelectedItem => (teamTypesListView.SelectedItems.Count > 0) ? teamTypesListView.SelectedItems[0] : null;
|
||||
|
||||
private TeamType SelectedTeamType => SelectedItem?.Tag as TeamType;
|
||||
|
||||
private TeamTypeClass mockClass;
|
||||
private TeamTypeMission mockMission;
|
||||
private int classEditRow = -1;
|
||||
private int missionEditRow = -1;
|
||||
|
||||
public TeamTypesDialog(IGamePlugin plugin, int maxTeams)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
this.maxTeams = maxTeams;
|
||||
technoTypes = plugin.Map.InfantryTypes.Cast<ITechnoType>().Concat(plugin.Map.UnitTypes.Cast<ITechnoType>());
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
triggerLabel.Visible = triggerComboBox.Visible = false;
|
||||
waypointLabel.Visible = waypointComboBox.Visible = false;
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
learningCheckBox.Visible = false;
|
||||
mercernaryCheckBox.Visible = false;
|
||||
break;
|
||||
}
|
||||
|
||||
teamTypes = new List<TeamType>(plugin.Map.TeamTypes.Select(t => t.Clone()));
|
||||
|
||||
teamTypesListView.BeginUpdate();
|
||||
{
|
||||
foreach (var teamType in this.teamTypes)
|
||||
{
|
||||
var item = new ListViewItem(teamType.Name)
|
||||
{
|
||||
Tag = teamType
|
||||
};
|
||||
teamTypesListView.Items.Add(item).ToolTipText = teamType.Name;
|
||||
}
|
||||
}
|
||||
teamTypesListView.EndUpdate();
|
||||
|
||||
houseComboBox.DataSource = plugin.Map.Houses.Select(t => new TypeItem<HouseType>(t.Type.Name, t.Type)).ToArray();
|
||||
waypointComboBox.DataSource = "(none)".Yield().Concat(plugin.Map.Waypoints.Select(w => w.Name)).ToArray();
|
||||
triggerComboBox.DataSource = Trigger.None.Yield().Concat(plugin.Map.Triggers.Select(t => t.Name)).ToArray();
|
||||
|
||||
teamsTypeColumn.DisplayMember = "Name";
|
||||
teamsTypeColumn.ValueMember = "Type";
|
||||
teamsTypeColumn.DataSource = technoTypes.Select(t => new TypeItem<ITechnoType>(t.Name, t)).ToArray();
|
||||
|
||||
missionsMissionColumn.DataSource = plugin.Map.TeamMissionTypes;
|
||||
|
||||
teamTypeTableLayoutPanel.Visible = false;
|
||||
}
|
||||
|
||||
private void teamTypesListView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
houseComboBox.DataBindings.Clear();
|
||||
roundaboutCheckBox.DataBindings.Clear();
|
||||
learningCheckBox.DataBindings.Clear();
|
||||
suicideCheckBox.DataBindings.Clear();
|
||||
autocreateCheckBox.DataBindings.Clear();
|
||||
mercernaryCheckBox.DataBindings.Clear();
|
||||
reinforcableCheckBox.DataBindings.Clear();
|
||||
prebuiltCheckBox.DataBindings.Clear();
|
||||
recruitPriorityNud.DataBindings.Clear();
|
||||
initNumNud.DataBindings.Clear();
|
||||
maxAllowedNud.DataBindings.Clear();
|
||||
fearNud.DataBindings.Clear();
|
||||
waypointComboBox.DataBindings.Clear();
|
||||
triggerComboBox.DataBindings.Clear();
|
||||
|
||||
if (SelectedTeamType != null)
|
||||
{
|
||||
houseComboBox.DataBindings.Add("SelectedValue", SelectedTeamType, "House");
|
||||
roundaboutCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsRoundAbout");
|
||||
learningCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsLearning");
|
||||
suicideCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsSuicide");
|
||||
autocreateCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsAutocreate");
|
||||
mercernaryCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsMercenary");
|
||||
reinforcableCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsReinforcable");
|
||||
prebuiltCheckBox.DataBindings.Add("Checked", SelectedTeamType, "IsPrebuilt");
|
||||
recruitPriorityNud.DataBindings.Add("Value", SelectedTeamType, "RecruitPriority");
|
||||
initNumNud.DataBindings.Add("Value", SelectedTeamType, "InitNum");
|
||||
maxAllowedNud.DataBindings.Add("Value", SelectedTeamType, "MaxAllowed");
|
||||
fearNud.DataBindings.Add("Value", SelectedTeamType, "Fear");
|
||||
waypointComboBox.DataBindings.Add("SelectedIndex", SelectedTeamType, "Origin");
|
||||
triggerComboBox.DataBindings.Add("SelectedItem", SelectedTeamType, "Trigger");
|
||||
|
||||
mockClass = null;
|
||||
mockMission = null;
|
||||
classEditRow = -1;
|
||||
missionEditRow = -1;
|
||||
|
||||
teamsDataGridView.Rows.Clear();
|
||||
missionsDataGridView.Rows.Clear();
|
||||
|
||||
teamsDataGridView.RowCount = SelectedTeamType.Classes.Count + 1;
|
||||
missionsDataGridView.RowCount = SelectedTeamType.Missions.Count + 1;
|
||||
|
||||
updateDataGridViewAddRows(teamsDataGridView, Globals.MaxTeamClasses);
|
||||
updateDataGridViewAddRows(missionsDataGridView, Globals.MaxTeamMissions);
|
||||
|
||||
teamTypeTableLayoutPanel.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
teamTypeTableLayoutPanel.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamTypesListView_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
var hitTest = teamTypesListView.HitTest(e.Location);
|
||||
|
||||
bool canAdd = (hitTest.Item == null) && (teamTypesListView.Items.Count < maxTeams);
|
||||
bool canRemove = hitTest.Item != null;
|
||||
addTeamTypeToolStripMenuItem.Visible = canAdd;
|
||||
removeTeamTypeToolStripMenuItem.Visible = canRemove;
|
||||
|
||||
if (canAdd || canRemove)
|
||||
{
|
||||
teamTypesContextMenuStrip.Show(Cursor.Position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void teamTypesListView_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if ((e.KeyData == Keys.F2) && (teamTypesListView.SelectedItems.Count > 0))
|
||||
{
|
||||
teamTypesListView.SelectedItems[0].BeginEdit();
|
||||
}
|
||||
}
|
||||
|
||||
private void addTeamTypeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var nameChars = Enumerable.Range(97, 26).Concat(Enumerable.Range(48, 10));
|
||||
|
||||
string name = string.Empty;
|
||||
foreach (var nameChar in nameChars)
|
||||
{
|
||||
name = new string((char)nameChar, 4);
|
||||
if (!teamTypes.Where(t => t.Equals(name)).Any())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var teamType = new TeamType { Name = name, House = plugin.Map.HouseTypes.First() };
|
||||
var item = new ListViewItem(teamType.Name)
|
||||
{
|
||||
Tag = teamType
|
||||
};
|
||||
teamTypes.Add(teamType);
|
||||
teamTypesListView.Items.Add(item).ToolTipText = teamType.Name;
|
||||
|
||||
item.Selected = true;
|
||||
item.BeginEdit();
|
||||
}
|
||||
|
||||
private void removeTeamTypeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (SelectedItem != null)
|
||||
{
|
||||
teamTypes.Remove(SelectedTeamType);
|
||||
teamTypesListView.Items.Remove(SelectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
private void teamTypesListView_AfterLabelEdit(object sender, LabelEditEventArgs e)
|
||||
{
|
||||
int maxLength = int.MaxValue;
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
maxLength = 8;
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
maxLength = 23;
|
||||
break;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(e.Label))
|
||||
{
|
||||
e.CancelEdit = true;
|
||||
}
|
||||
else if (e.Label.Length > maxLength)
|
||||
{
|
||||
e.CancelEdit = true;
|
||||
MessageBox.Show(string.Format("Team name is longer than {0} characters.", maxLength), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
else if (teamTypes.Where(t => (t != SelectedTeamType) && t.Equals(e.Label)).Any())
|
||||
{
|
||||
e.CancelEdit = true;
|
||||
MessageBox.Show(string.Format("Team with name '{0]' already exists", e.Label), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedTeamType.Name = e.Label;
|
||||
teamTypesListView.Items[e.Item].ToolTipText = SelectedTeamType.Name;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamsDataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
|
||||
{
|
||||
if (SelectedTeamType == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TeamTypeClass teamTypeClass = null;
|
||||
if (e.RowIndex == classEditRow)
|
||||
{
|
||||
teamTypeClass = mockClass;
|
||||
}
|
||||
else if (e.RowIndex < SelectedTeamType.Classes.Count)
|
||||
{
|
||||
teamTypeClass = SelectedTeamType.Classes[e.RowIndex];
|
||||
}
|
||||
|
||||
if (teamTypeClass == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (e.ColumnIndex)
|
||||
{
|
||||
case 0:
|
||||
e.Value = teamTypeClass.Type;
|
||||
break;
|
||||
case 1:
|
||||
e.Value = teamTypeClass.Count;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamsDataGridView_CellValuePushed(object sender, DataGridViewCellValueEventArgs e)
|
||||
{
|
||||
if (SelectedTeamType == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mockClass == null)
|
||||
{
|
||||
mockClass = (e.RowIndex < SelectedTeamType.Classes.Count) ?
|
||||
new TeamTypeClass { Type = SelectedTeamType.Classes[e.RowIndex].Type, Count = SelectedTeamType.Classes[e.RowIndex].Count } :
|
||||
new TeamTypeClass { Type = technoTypes.First(), Count = 0 };
|
||||
}
|
||||
classEditRow = e.RowIndex;
|
||||
|
||||
switch (e.ColumnIndex)
|
||||
{
|
||||
case 0:
|
||||
mockClass.Type = e.Value as ITechnoType;
|
||||
break;
|
||||
case 1:
|
||||
mockClass.Count = int.TryParse(e.Value as string, out int value) ? (byte)Math.Max(0, Math.Min(255, value)) : (byte)0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamsDataGridView_NewRowNeeded(object sender, DataGridViewRowEventArgs e)
|
||||
{
|
||||
mockClass = new TeamTypeClass { Type = technoTypes.First(), Count = 0 };
|
||||
classEditRow = teamsDataGridView.RowCount - 1;
|
||||
}
|
||||
|
||||
private void teamsDataGridView_RowValidated(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if ((mockClass != null) && (e.RowIndex >= SelectedTeamType.Classes.Count) && ((teamsDataGridView.Rows.Count > 1) || (e.RowIndex < (teamsDataGridView.Rows.Count - 1))))
|
||||
{
|
||||
SelectedTeamType.Classes.Add(mockClass);
|
||||
mockClass = null;
|
||||
classEditRow = -1;
|
||||
}
|
||||
else if ((mockClass != null) && (e.RowIndex < SelectedTeamType.Classes.Count))
|
||||
{
|
||||
SelectedTeamType.Classes[e.RowIndex] = mockClass;
|
||||
mockClass = null;
|
||||
classEditRow = -1;
|
||||
}
|
||||
else if (teamsDataGridView.ContainsFocus)
|
||||
{
|
||||
mockClass = null;
|
||||
classEditRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamsDataGridView_RowDirtyStateNeeded(object sender, QuestionEventArgs e)
|
||||
{
|
||||
e.Response = teamsDataGridView.IsCurrentCellDirty;
|
||||
}
|
||||
|
||||
private void teamsDataGridView_CancelRowEdit(object sender, QuestionEventArgs e)
|
||||
{
|
||||
if ((classEditRow == (teamsDataGridView.Rows.Count - 2)) && (classEditRow == SelectedTeamType.Classes.Count))
|
||||
{
|
||||
mockClass = new TeamTypeClass { Type = technoTypes.First(), Count = 0 };
|
||||
}
|
||||
else
|
||||
{
|
||||
mockClass = null;
|
||||
classEditRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamsDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
|
||||
{
|
||||
if (e.Row.Index < SelectedTeamType.Classes.Count)
|
||||
{
|
||||
SelectedTeamType.Classes.RemoveAt(e.Row.Index);
|
||||
}
|
||||
|
||||
if (e.Row.Index == classEditRow)
|
||||
{
|
||||
mockClass = null;
|
||||
classEditRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamsDataGridView_UserAddedRow(object sender, DataGridViewRowEventArgs e)
|
||||
{
|
||||
updateDataGridViewAddRows(teamsDataGridView, Globals.MaxTeamClasses);
|
||||
}
|
||||
|
||||
private void teamsDataGridView_UserDeletedRow(object sender, DataGridViewRowEventArgs e)
|
||||
{
|
||||
updateDataGridViewAddRows(teamsDataGridView, Globals.MaxTeamClasses);
|
||||
}
|
||||
|
||||
private void missionsDataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
|
||||
{
|
||||
if (SelectedTeamType == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TeamTypeMission teamMissionType = null;
|
||||
if (e.RowIndex == missionEditRow)
|
||||
{
|
||||
teamMissionType = mockMission;
|
||||
}
|
||||
else if (e.RowIndex < SelectedTeamType.Missions.Count)
|
||||
{
|
||||
teamMissionType = SelectedTeamType.Missions[e.RowIndex];
|
||||
}
|
||||
|
||||
if (teamMissionType == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (e.ColumnIndex)
|
||||
{
|
||||
case 0:
|
||||
e.Value = teamMissionType.Mission;
|
||||
break;
|
||||
case 1:
|
||||
e.Value = teamMissionType.Argument;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void missionsDataGridView_CellValuePushed(object sender, DataGridViewCellValueEventArgs e)
|
||||
{
|
||||
if (SelectedTeamType == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mockMission == null)
|
||||
{
|
||||
mockMission = (e.RowIndex < SelectedTeamType.Missions.Count) ?
|
||||
new TeamTypeMission { Mission = SelectedTeamType.Missions[e.RowIndex].Mission, Argument = SelectedTeamType.Missions[e.RowIndex].Argument } :
|
||||
new TeamTypeMission { Mission = plugin.Map.TeamMissionTypes.First(), Argument = 0 };
|
||||
}
|
||||
missionEditRow = e.RowIndex;
|
||||
|
||||
switch (e.ColumnIndex)
|
||||
{
|
||||
case 0:
|
||||
mockMission.Mission = e.Value as string;
|
||||
break;
|
||||
case 1:
|
||||
mockMission.Argument = int.TryParse(e.Value as string, out int value) ? value : 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void missionsDataGridView_NewRowNeeded(object sender, DataGridViewRowEventArgs e)
|
||||
{
|
||||
mockMission = new TeamTypeMission { Mission = plugin.Map.TeamMissionTypes.First(), Argument = 0 };
|
||||
missionEditRow = missionsDataGridView.RowCount - 1;
|
||||
}
|
||||
|
||||
private void missionsDataGridView_RowValidated(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if ((mockMission != null) && (e.RowIndex >= SelectedTeamType.Missions.Count) && ((missionsDataGridView.Rows.Count > 1) || (e.RowIndex < (missionsDataGridView.Rows.Count - 1))))
|
||||
{
|
||||
SelectedTeamType.Missions.Add(mockMission);
|
||||
mockMission = null;
|
||||
missionEditRow = -1;
|
||||
}
|
||||
else if ((mockMission != null) && (e.RowIndex < SelectedTeamType.Missions.Count))
|
||||
{
|
||||
SelectedTeamType.Missions[e.RowIndex] = mockMission;
|
||||
mockMission = null;
|
||||
missionEditRow = -1;
|
||||
}
|
||||
else if (missionsDataGridView.ContainsFocus)
|
||||
{
|
||||
mockMission = null;
|
||||
missionEditRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void missionsDataGridView_RowDirtyStateNeeded(object sender, QuestionEventArgs e)
|
||||
{
|
||||
e.Response = missionsDataGridView.IsCurrentCellDirty;
|
||||
}
|
||||
|
||||
private void missionsDataGridView_CancelRowEdit(object sender, QuestionEventArgs e)
|
||||
{
|
||||
if ((missionEditRow == (missionsDataGridView.Rows.Count - 2)) && (missionEditRow == SelectedTeamType.Missions.Count))
|
||||
{
|
||||
mockMission = new TeamTypeMission { Mission = plugin.Map.TeamMissionTypes.First(), Argument = 0 };
|
||||
}
|
||||
else
|
||||
{
|
||||
mockMission = null;
|
||||
missionEditRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void missionsDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
|
||||
{
|
||||
if (e.Row.Index < SelectedTeamType.Missions.Count)
|
||||
{
|
||||
SelectedTeamType.Missions.RemoveAt(e.Row.Index);
|
||||
}
|
||||
|
||||
if (e.Row.Index == missionEditRow)
|
||||
{
|
||||
mockMission = null;
|
||||
missionEditRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void missionsDataGridView_UserAddedRow(object sender, DataGridViewRowEventArgs e)
|
||||
{
|
||||
updateDataGridViewAddRows(missionsDataGridView, Globals.MaxTeamMissions);
|
||||
}
|
||||
|
||||
private void missionsDataGridView_UserDeletedRow(object sender, DataGridViewRowEventArgs e)
|
||||
{
|
||||
updateDataGridViewAddRows(missionsDataGridView, Globals.MaxTeamMissions);
|
||||
}
|
||||
|
||||
private void updateDataGridViewAddRows(DataGridView dataGridView, int maxItems)
|
||||
{
|
||||
dataGridView.AllowUserToAddRows = dataGridView.Rows.Count <= maxItems;
|
||||
}
|
||||
}
|
||||
}
|
135
CnCTDRAMapEditor/Dialogs/TeamTypesDialog.resx
Normal file
135
CnCTDRAMapEditor/Dialogs/TeamTypesDialog.resx
Normal file
|
@ -0,0 +1,135 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="teamsTypeColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="teamsCountColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="missionsMissionColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="missionsArgumentColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="teamTypesContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
687
CnCTDRAMapEditor/Dialogs/TriggersDialog.Designer.cs
generated
Normal file
687
CnCTDRAMapEditor/Dialogs/TriggersDialog.Designer.cs
generated
Normal file
|
@ -0,0 +1,687 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
partial class TriggersDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.settingsPanel = new System.Windows.Forms.Panel();
|
||||
this.triggersTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.houseComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.typeLabel = new System.Windows.Forms.Label();
|
||||
this.event1Label = new System.Windows.Forms.Label();
|
||||
this.event2Label = new System.Windows.Forms.Label();
|
||||
this.action1Label = new System.Windows.Forms.Label();
|
||||
this.action2Label = new System.Windows.Forms.Label();
|
||||
this.action1ComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.action2ComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.existenceLabel = new System.Windows.Forms.Label();
|
||||
this.existenceComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.typeComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.event1ComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.event2ComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.teamLabel = new System.Windows.Forms.Label();
|
||||
this.teamComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.event1Flp = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.event1Nud = new System.Windows.Forms.NumericUpDown();
|
||||
this.event1ValueComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.event2Flp = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.event2Nud = new System.Windows.Forms.NumericUpDown();
|
||||
this.event2ValueComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.action1Flp = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.action1Nud = new System.Windows.Forms.NumericUpDown();
|
||||
this.action1ValueComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.action2Flp = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.action2Nud = new System.Windows.Forms.NumericUpDown();
|
||||
this.action2ValueComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.triggersListView = new System.Windows.Forms.ListView();
|
||||
this.nameColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.triggersContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.addTriggerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.removeTriggerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.settingsPanel.SuspendLayout();
|
||||
this.triggersTableLayoutPanel.SuspendLayout();
|
||||
this.event1Flp.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.event1Nud)).BeginInit();
|
||||
this.event2Flp.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.event2Nud)).BeginInit();
|
||||
this.action1Flp.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.action1Nud)).BeginInit();
|
||||
this.action2Flp.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.action2Nud)).BeginInit();
|
||||
this.triggersContextMenuStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.settingsPanel, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.triggersListView, 0, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 2;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(562, 499);
|
||||
this.tableLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 2);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnCancel);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnOK);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 462);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(556, 34);
|
||||
this.flowLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.AutoSize = true;
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(486, 2);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(68, 30);
|
||||
this.btnCancel.TabIndex = 2;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.AutoSize = true;
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(432, 2);
|
||||
this.btnOK.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(50, 30);
|
||||
this.btnOK.TabIndex = 3;
|
||||
this.btnOK.Text = "&OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// settingsPanel
|
||||
//
|
||||
this.settingsPanel.Controls.Add(this.triggersTableLayoutPanel);
|
||||
this.settingsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.settingsPanel.Location = new System.Drawing.Point(149, 10);
|
||||
this.settingsPanel.Margin = new System.Windows.Forms.Padding(10);
|
||||
this.settingsPanel.Name = "settingsPanel";
|
||||
this.settingsPanel.Size = new System.Drawing.Size(403, 439);
|
||||
this.settingsPanel.TabIndex = 3;
|
||||
//
|
||||
// triggersTableLayoutPanel
|
||||
//
|
||||
this.triggersTableLayoutPanel.AutoSize = true;
|
||||
this.triggersTableLayoutPanel.ColumnCount = 4;
|
||||
this.triggersTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.triggersTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.triggersTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.triggersTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.label1, 0, 0);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.houseComboBox, 1, 0);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.typeLabel, 0, 9);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.event1Label, 0, 10);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.event2Label, 0, 11);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.action1Label, 0, 12);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.action2Label, 0, 13);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.action1ComboBox, 1, 12);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.action2ComboBox, 1, 13);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.existenceLabel, 0, 8);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.existenceComboBox, 1, 8);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.typeComboBox, 1, 9);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.event1ComboBox, 1, 10);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.event2ComboBox, 1, 11);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.teamLabel, 0, 14);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.teamComboBox, 1, 14);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.event1Flp, 2, 10);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.event2Flp, 2, 11);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.action1Flp, 2, 12);
|
||||
this.triggersTableLayoutPanel.Controls.Add(this.action2Flp, 2, 13);
|
||||
this.triggersTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.triggersTableLayoutPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.triggersTableLayoutPanel.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.triggersTableLayoutPanel.Name = "triggersTableLayoutPanel";
|
||||
this.triggersTableLayoutPanel.RowCount = 17;
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.triggersTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.triggersTableLayoutPanel.Size = new System.Drawing.Size(403, 439);
|
||||
this.triggersTableLayoutPanel.TabIndex = 1;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label1.Location = new System.Drawing.Point(2, 0);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(67, 25);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "House";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// houseComboBox
|
||||
//
|
||||
this.houseComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.houseComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.houseComboBox.FormattingEnabled = true;
|
||||
this.houseComboBox.Location = new System.Drawing.Point(73, 2);
|
||||
this.houseComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.houseComboBox.Name = "houseComboBox";
|
||||
this.houseComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.houseComboBox.TabIndex = 1;
|
||||
//
|
||||
// typeLabel
|
||||
//
|
||||
this.typeLabel.AutoSize = true;
|
||||
this.typeLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.typeLabel.Location = new System.Drawing.Point(2, 50);
|
||||
this.typeLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.typeLabel.Name = "typeLabel";
|
||||
this.typeLabel.Size = new System.Drawing.Size(67, 25);
|
||||
this.typeLabel.TabIndex = 9;
|
||||
this.typeLabel.Text = "Type";
|
||||
this.typeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// event1Label
|
||||
//
|
||||
this.event1Label.AutoSize = true;
|
||||
this.event1Label.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.event1Label.Location = new System.Drawing.Point(2, 75);
|
||||
this.event1Label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.event1Label.Name = "event1Label";
|
||||
this.event1Label.Size = new System.Drawing.Size(67, 57);
|
||||
this.event1Label.TabIndex = 10;
|
||||
this.event1Label.Text = "Event 1";
|
||||
this.event1Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// event2Label
|
||||
//
|
||||
this.event2Label.AutoSize = true;
|
||||
this.event2Label.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.event2Label.Location = new System.Drawing.Point(2, 132);
|
||||
this.event2Label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.event2Label.Name = "event2Label";
|
||||
this.event2Label.Size = new System.Drawing.Size(67, 57);
|
||||
this.event2Label.TabIndex = 11;
|
||||
this.event2Label.Text = "Event 2";
|
||||
this.event2Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// action1Label
|
||||
//
|
||||
this.action1Label.AutoSize = true;
|
||||
this.action1Label.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.action1Label.Location = new System.Drawing.Point(2, 189);
|
||||
this.action1Label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.action1Label.Name = "action1Label";
|
||||
this.action1Label.Size = new System.Drawing.Size(67, 57);
|
||||
this.action1Label.TabIndex = 15;
|
||||
this.action1Label.Text = "Action 1";
|
||||
this.action1Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// action2Label
|
||||
//
|
||||
this.action2Label.AutoSize = true;
|
||||
this.action2Label.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.action2Label.Location = new System.Drawing.Point(2, 246);
|
||||
this.action2Label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.action2Label.Name = "action2Label";
|
||||
this.action2Label.Size = new System.Drawing.Size(67, 57);
|
||||
this.action2Label.TabIndex = 16;
|
||||
this.action2Label.Text = "Action 2";
|
||||
this.action2Label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// action1ComboBox
|
||||
//
|
||||
this.action1ComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.action1ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.action1ComboBox.FormattingEnabled = true;
|
||||
this.action1ComboBox.Location = new System.Drawing.Point(73, 191);
|
||||
this.action1ComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.action1ComboBox.Name = "action1ComboBox";
|
||||
this.action1ComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.action1ComboBox.TabIndex = 17;
|
||||
this.action1ComboBox.SelectedIndexChanged += new System.EventHandler(this.trigger1ComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// action2ComboBox
|
||||
//
|
||||
this.action2ComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.action2ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.action2ComboBox.FormattingEnabled = true;
|
||||
this.action2ComboBox.Location = new System.Drawing.Point(73, 248);
|
||||
this.action2ComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.action2ComboBox.Name = "action2ComboBox";
|
||||
this.action2ComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.action2ComboBox.TabIndex = 18;
|
||||
this.action2ComboBox.SelectedIndexChanged += new System.EventHandler(this.trigger2ComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// existenceLabel
|
||||
//
|
||||
this.existenceLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.existenceLabel.Location = new System.Drawing.Point(2, 25);
|
||||
this.existenceLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.existenceLabel.Name = "existenceLabel";
|
||||
this.existenceLabel.Size = new System.Drawing.Size(67, 25);
|
||||
this.existenceLabel.TabIndex = 19;
|
||||
this.existenceLabel.Text = "Existence";
|
||||
this.existenceLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// existenceComboBox
|
||||
//
|
||||
this.existenceComboBox.DisplayMember = "Name";
|
||||
this.existenceComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.existenceComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.existenceComboBox.FormattingEnabled = true;
|
||||
this.existenceComboBox.Location = new System.Drawing.Point(73, 27);
|
||||
this.existenceComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.existenceComboBox.Name = "existenceComboBox";
|
||||
this.existenceComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.existenceComboBox.TabIndex = 20;
|
||||
this.existenceComboBox.ValueMember = "Value";
|
||||
//
|
||||
// typeComboBox
|
||||
//
|
||||
this.typeComboBox.DisplayMember = "Name";
|
||||
this.typeComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.typeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.typeComboBox.FormattingEnabled = true;
|
||||
this.typeComboBox.Location = new System.Drawing.Point(73, 52);
|
||||
this.typeComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.typeComboBox.Name = "typeComboBox";
|
||||
this.typeComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.typeComboBox.TabIndex = 21;
|
||||
this.typeComboBox.ValueMember = "Value";
|
||||
this.typeComboBox.SelectedValueChanged += new System.EventHandler(this.typeComboBox_SelectedValueChanged);
|
||||
//
|
||||
// event1ComboBox
|
||||
//
|
||||
this.event1ComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.event1ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.event1ComboBox.FormattingEnabled = true;
|
||||
this.event1ComboBox.Location = new System.Drawing.Point(73, 77);
|
||||
this.event1ComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.event1ComboBox.Name = "event1ComboBox";
|
||||
this.event1ComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.event1ComboBox.TabIndex = 22;
|
||||
this.event1ComboBox.SelectedIndexChanged += new System.EventHandler(this.trigger1ComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// event2ComboBox
|
||||
//
|
||||
this.event2ComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.event2ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.event2ComboBox.FormattingEnabled = true;
|
||||
this.event2ComboBox.Location = new System.Drawing.Point(73, 134);
|
||||
this.event2ComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.event2ComboBox.Name = "event2ComboBox";
|
||||
this.event2ComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.event2ComboBox.TabIndex = 23;
|
||||
this.event2ComboBox.SelectedIndexChanged += new System.EventHandler(this.trigger2ComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// teamLabel
|
||||
//
|
||||
this.teamLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.teamLabel.Location = new System.Drawing.Point(2, 303);
|
||||
this.teamLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.teamLabel.Name = "teamLabel";
|
||||
this.teamLabel.Size = new System.Drawing.Size(67, 25);
|
||||
this.teamLabel.TabIndex = 32;
|
||||
this.teamLabel.Text = "Team";
|
||||
this.teamLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// teamComboBox
|
||||
//
|
||||
this.teamComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.teamComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.teamComboBox.FormattingEnabled = true;
|
||||
this.teamComboBox.Location = new System.Drawing.Point(73, 305);
|
||||
this.teamComboBox.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.teamComboBox.Name = "teamComboBox";
|
||||
this.teamComboBox.Size = new System.Drawing.Size(141, 21);
|
||||
this.teamComboBox.TabIndex = 33;
|
||||
//
|
||||
// event1Flp
|
||||
//
|
||||
this.event1Flp.AutoSize = true;
|
||||
this.event1Flp.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.event1Flp.Controls.Add(this.event1Nud);
|
||||
this.event1Flp.Controls.Add(this.event1ValueComboBox);
|
||||
this.event1Flp.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.event1Flp.Location = new System.Drawing.Point(219, 78);
|
||||
this.event1Flp.Name = "event1Flp";
|
||||
this.event1Flp.Size = new System.Drawing.Size(172, 51);
|
||||
this.event1Flp.TabIndex = 36;
|
||||
//
|
||||
// event1Nud
|
||||
//
|
||||
this.event1Nud.Location = new System.Drawing.Point(2, 2);
|
||||
this.event1Nud.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.event1Nud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.event1Nud.Minimum = new decimal(new int[] {
|
||||
-2147483648,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.event1Nud.Name = "event1Nud";
|
||||
this.event1Nud.Size = new System.Drawing.Size(70, 20);
|
||||
this.event1Nud.TabIndex = 31;
|
||||
//
|
||||
// event1ValueComboBox
|
||||
//
|
||||
this.event1ValueComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.event1ValueComboBox.FormattingEnabled = true;
|
||||
this.event1ValueComboBox.Location = new System.Drawing.Point(3, 27);
|
||||
this.event1ValueComboBox.Name = "event1ValueComboBox";
|
||||
this.event1ValueComboBox.Size = new System.Drawing.Size(166, 21);
|
||||
this.event1ValueComboBox.TabIndex = 32;
|
||||
//
|
||||
// event2Flp
|
||||
//
|
||||
this.event2Flp.AutoSize = true;
|
||||
this.event2Flp.Controls.Add(this.event2Nud);
|
||||
this.event2Flp.Controls.Add(this.event2ValueComboBox);
|
||||
this.event2Flp.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.event2Flp.Location = new System.Drawing.Point(219, 135);
|
||||
this.event2Flp.Name = "event2Flp";
|
||||
this.event2Flp.Size = new System.Drawing.Size(172, 51);
|
||||
this.event2Flp.TabIndex = 37;
|
||||
//
|
||||
// event2Nud
|
||||
//
|
||||
this.event2Nud.Location = new System.Drawing.Point(2, 2);
|
||||
this.event2Nud.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.event2Nud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.event2Nud.Minimum = new decimal(new int[] {
|
||||
-2147483648,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.event2Nud.Name = "event2Nud";
|
||||
this.event2Nud.Size = new System.Drawing.Size(70, 20);
|
||||
this.event2Nud.TabIndex = 30;
|
||||
//
|
||||
// event2ValueComboBox
|
||||
//
|
||||
this.event2ValueComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.event2ValueComboBox.FormattingEnabled = true;
|
||||
this.event2ValueComboBox.Location = new System.Drawing.Point(3, 27);
|
||||
this.event2ValueComboBox.Name = "event2ValueComboBox";
|
||||
this.event2ValueComboBox.Size = new System.Drawing.Size(166, 21);
|
||||
this.event2ValueComboBox.TabIndex = 33;
|
||||
//
|
||||
// action1Flp
|
||||
//
|
||||
this.action1Flp.AutoSize = true;
|
||||
this.action1Flp.Controls.Add(this.action1Nud);
|
||||
this.action1Flp.Controls.Add(this.action1ValueComboBox);
|
||||
this.action1Flp.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.action1Flp.Location = new System.Drawing.Point(219, 192);
|
||||
this.action1Flp.Name = "action1Flp";
|
||||
this.action1Flp.Size = new System.Drawing.Size(172, 51);
|
||||
this.action1Flp.TabIndex = 38;
|
||||
//
|
||||
// action1Nud
|
||||
//
|
||||
this.action1Nud.Location = new System.Drawing.Point(2, 2);
|
||||
this.action1Nud.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.action1Nud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.action1Nud.Minimum = new decimal(new int[] {
|
||||
-2147483648,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.action1Nud.Name = "action1Nud";
|
||||
this.action1Nud.Size = new System.Drawing.Size(70, 20);
|
||||
this.action1Nud.TabIndex = 31;
|
||||
//
|
||||
// action1ValueComboBox
|
||||
//
|
||||
this.action1ValueComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.action1ValueComboBox.FormattingEnabled = true;
|
||||
this.action1ValueComboBox.Location = new System.Drawing.Point(3, 27);
|
||||
this.action1ValueComboBox.Name = "action1ValueComboBox";
|
||||
this.action1ValueComboBox.Size = new System.Drawing.Size(166, 21);
|
||||
this.action1ValueComboBox.TabIndex = 33;
|
||||
//
|
||||
// action2Flp
|
||||
//
|
||||
this.action2Flp.AutoSize = true;
|
||||
this.action2Flp.Controls.Add(this.action2Nud);
|
||||
this.action2Flp.Controls.Add(this.action2ValueComboBox);
|
||||
this.action2Flp.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.action2Flp.Location = new System.Drawing.Point(219, 249);
|
||||
this.action2Flp.Name = "action2Flp";
|
||||
this.action2Flp.Size = new System.Drawing.Size(172, 51);
|
||||
this.action2Flp.TabIndex = 39;
|
||||
//
|
||||
// action2Nud
|
||||
//
|
||||
this.action2Nud.Location = new System.Drawing.Point(2, 2);
|
||||
this.action2Nud.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.action2Nud.Maximum = new decimal(new int[] {
|
||||
2147483647,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.action2Nud.Minimum = new decimal(new int[] {
|
||||
-2147483648,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.action2Nud.Name = "action2Nud";
|
||||
this.action2Nud.Size = new System.Drawing.Size(70, 20);
|
||||
this.action2Nud.TabIndex = 32;
|
||||
//
|
||||
// action2ValueComboBox
|
||||
//
|
||||
this.action2ValueComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.action2ValueComboBox.FormattingEnabled = true;
|
||||
this.action2ValueComboBox.Location = new System.Drawing.Point(3, 27);
|
||||
this.action2ValueComboBox.Name = "action2ValueComboBox";
|
||||
this.action2ValueComboBox.Size = new System.Drawing.Size(166, 21);
|
||||
this.action2ValueComboBox.TabIndex = 33;
|
||||
//
|
||||
// triggersListView
|
||||
//
|
||||
this.triggersListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.nameColumnHeader});
|
||||
this.triggersListView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.triggersListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
|
||||
this.triggersListView.HideSelection = false;
|
||||
this.triggersListView.LabelEdit = true;
|
||||
this.triggersListView.Location = new System.Drawing.Point(2, 2);
|
||||
this.triggersListView.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.triggersListView.MultiSelect = false;
|
||||
this.triggersListView.Name = "triggersListView";
|
||||
this.triggersListView.ShowItemToolTips = true;
|
||||
this.triggersListView.Size = new System.Drawing.Size(135, 455);
|
||||
this.triggersListView.TabIndex = 4;
|
||||
this.triggersListView.UseCompatibleStateImageBehavior = false;
|
||||
this.triggersListView.View = System.Windows.Forms.View.Details;
|
||||
this.triggersListView.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.teamTypesListView_AfterLabelEdit);
|
||||
this.triggersListView.SelectedIndexChanged += new System.EventHandler(this.triggersListView_SelectedIndexChanged);
|
||||
this.triggersListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.teamTypesListView_KeyDown);
|
||||
this.triggersListView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.teamTypesListView_MouseDown);
|
||||
//
|
||||
// triggersContextMenuStrip
|
||||
//
|
||||
this.triggersContextMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
this.triggersContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.addTriggerToolStripMenuItem,
|
||||
this.removeTriggerToolStripMenuItem});
|
||||
this.triggersContextMenuStrip.Name = "teamTypesContextMenuStrip";
|
||||
this.triggersContextMenuStrip.Size = new System.Drawing.Size(157, 48);
|
||||
//
|
||||
// addTriggerToolStripMenuItem
|
||||
//
|
||||
this.addTriggerToolStripMenuItem.Name = "addTriggerToolStripMenuItem";
|
||||
this.addTriggerToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
||||
this.addTriggerToolStripMenuItem.Text = "&Add Trigger";
|
||||
this.addTriggerToolStripMenuItem.Click += new System.EventHandler(this.addTriggerToolStripMenuItem_Click);
|
||||
//
|
||||
// removeTriggerToolStripMenuItem
|
||||
//
|
||||
this.removeTriggerToolStripMenuItem.Name = "removeTriggerToolStripMenuItem";
|
||||
this.removeTriggerToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
||||
this.removeTriggerToolStripMenuItem.Text = "&Remove Trigger";
|
||||
this.removeTriggerToolStripMenuItem.Click += new System.EventHandler(this.removeTriggerToolStripMenuItem_Click);
|
||||
//
|
||||
// TriggersDialog
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(562, 499);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "TriggersDialog";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Triggers";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.settingsPanel.ResumeLayout(false);
|
||||
this.settingsPanel.PerformLayout();
|
||||
this.triggersTableLayoutPanel.ResumeLayout(false);
|
||||
this.triggersTableLayoutPanel.PerformLayout();
|
||||
this.event1Flp.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.event1Nud)).EndInit();
|
||||
this.event2Flp.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.event2Nud)).EndInit();
|
||||
this.action1Flp.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.action1Nud)).EndInit();
|
||||
this.action2Flp.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.action2Nud)).EndInit();
|
||||
this.triggersContextMenuStrip.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.Panel settingsPanel;
|
||||
private System.Windows.Forms.ListView triggersListView;
|
||||
private System.Windows.Forms.ColumnHeader nameColumnHeader;
|
||||
private System.Windows.Forms.ContextMenuStrip triggersContextMenuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem addTriggerToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem removeTriggerToolStripMenuItem;
|
||||
private System.Windows.Forms.TableLayoutPanel triggersTableLayoutPanel;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox houseComboBox;
|
||||
private System.Windows.Forms.Label typeLabel;
|
||||
private System.Windows.Forms.Label event1Label;
|
||||
private System.Windows.Forms.Label event2Label;
|
||||
private System.Windows.Forms.Label action2Label;
|
||||
private System.Windows.Forms.ComboBox action2ComboBox;
|
||||
private System.Windows.Forms.Label existenceLabel;
|
||||
private System.Windows.Forms.ComboBox existenceComboBox;
|
||||
private System.Windows.Forms.ComboBox typeComboBox;
|
||||
private System.Windows.Forms.ComboBox event1ComboBox;
|
||||
private System.Windows.Forms.ComboBox event2ComboBox;
|
||||
private System.Windows.Forms.ComboBox action1ComboBox;
|
||||
private System.Windows.Forms.Label action1Label;
|
||||
private System.Windows.Forms.Label teamLabel;
|
||||
private System.Windows.Forms.ComboBox teamComboBox;
|
||||
private System.Windows.Forms.FlowLayoutPanel event1Flp;
|
||||
private System.Windows.Forms.NumericUpDown event1Nud;
|
||||
private System.Windows.Forms.FlowLayoutPanel event2Flp;
|
||||
private System.Windows.Forms.NumericUpDown event2Nud;
|
||||
private System.Windows.Forms.FlowLayoutPanel action1Flp;
|
||||
private System.Windows.Forms.NumericUpDown action1Nud;
|
||||
private System.Windows.Forms.FlowLayoutPanel action2Flp;
|
||||
private System.Windows.Forms.NumericUpDown action2Nud;
|
||||
private System.Windows.Forms.ComboBox event1ValueComboBox;
|
||||
private System.Windows.Forms.ComboBox event2ValueComboBox;
|
||||
private System.Windows.Forms.ComboBox action1ValueComboBox;
|
||||
private System.Windows.Forms.ComboBox action2ValueComboBox;
|
||||
}
|
||||
}
|
510
CnCTDRAMapEditor/Dialogs/TriggersDialog.cs
Normal file
510
CnCTDRAMapEditor/Dialogs/TriggersDialog.cs
Normal file
|
@ -0,0 +1,510 @@
|
|||
//
|
||||
// Copyright 2020 Electronic Arts Inc.
|
||||
//
|
||||
// The Command & Conquer Map Editor and corresponding source code is free
|
||||
// software: you can redistribute it and/or modify it under the terms of
|
||||
// the GNU General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
// The Command & Conquer Map Editor and corresponding source code is distributed
|
||||
// in the hope that it will be useful, but with permitted additional restrictions
|
||||
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
|
||||
// distributed with this program. You should have received a copy of the
|
||||
// GNU General Public License along with permitted additional restrictions
|
||||
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
|
||||
using MobiusEditor.Interface;
|
||||
using MobiusEditor.Model;
|
||||
using MobiusEditor.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MobiusEditor.Dialogs
|
||||
{
|
||||
public partial class TriggersDialog : Form
|
||||
{
|
||||
private readonly IGamePlugin plugin;
|
||||
private readonly int maxTriggers;
|
||||
|
||||
private readonly List<Trigger> triggers;
|
||||
public IEnumerable<Trigger> Triggers => triggers;
|
||||
|
||||
private ListViewItem SelectedItem => (triggersListView.SelectedItems.Count > 0) ? triggersListView.SelectedItems[0] : null;
|
||||
|
||||
private Trigger SelectedTrigger => SelectedItem?.Tag as Trigger;
|
||||
|
||||
public TriggersDialog(IGamePlugin plugin, int maxTriggers)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
this.maxTriggers = maxTriggers;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
existenceLabel.Text = "Loop";
|
||||
event1Label.Text = "Event";
|
||||
action1Label.Text = "Action";
|
||||
typeLabel.Visible = typeComboBox.Visible = false;
|
||||
event2Label.Visible = event2ComboBox.Visible = event2Flp.Visible = false;
|
||||
action2Label.Visible = action2ComboBox.Visible = action2Flp.Visible = false;
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
teamLabel.Visible = teamComboBox.Visible = false;
|
||||
break;
|
||||
}
|
||||
|
||||
triggers = new List<Trigger>(plugin.Map.Triggers.Select(t => t.Clone()));
|
||||
|
||||
triggersListView.BeginUpdate();
|
||||
{
|
||||
foreach (var trigger in triggers)
|
||||
{
|
||||
var item = new ListViewItem(trigger.Name)
|
||||
{
|
||||
Tag = trigger
|
||||
};
|
||||
triggersListView.Items.Add(item).ToolTipText = trigger.Name;
|
||||
}
|
||||
}
|
||||
triggersListView.EndUpdate();
|
||||
|
||||
string[] existenceNames = Enum.GetNames(typeof(TriggerPersistantType));
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
existenceNames = new string[] { "No", "And", "Or" };
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
existenceNames = new string[] { "Temporary", "Semi-Constant", "Constant" };
|
||||
break;
|
||||
}
|
||||
|
||||
string[] typeNames = new string[]
|
||||
{
|
||||
"E => A1 [+ A2]",
|
||||
"E1 && E2 => A1 [+ A2]",
|
||||
"E1 || E2 => A1 [+ A2]",
|
||||
"E1 => A1; E2 => A2",
|
||||
};
|
||||
|
||||
houseComboBox.DataSource = "None".Yield().Concat(plugin.Map.Houses.Select(t => t.Type.Name)).ToArray();
|
||||
existenceComboBox.DataSource = Enum.GetValues(typeof(TriggerPersistantType)).Cast<int>()
|
||||
.Select(v => new { Name = existenceNames[v], Value = (TriggerPersistantType)v })
|
||||
.ToArray();
|
||||
typeComboBox.DataSource = Enum.GetValues(typeof(TriggerMultiStyleType)).Cast<int>()
|
||||
.Select(v => new { Name = typeNames[v], Value = (TriggerMultiStyleType)v })
|
||||
.ToArray();
|
||||
event1ComboBox.DataSource = plugin.Map.EventTypes.Where(t => !string.IsNullOrEmpty(t)).ToArray();
|
||||
event2ComboBox.DataSource = plugin.Map.EventTypes.Where(t => !string.IsNullOrEmpty(t)).ToArray();
|
||||
action1ComboBox.DataSource = plugin.Map.ActionTypes.Where(t => !string.IsNullOrEmpty(t)).ToArray();
|
||||
action2ComboBox.DataSource = plugin.Map.ActionTypes.Where(t => !string.IsNullOrEmpty(t)).ToArray();
|
||||
teamComboBox.DataSource = "None".Yield().Concat(plugin.Map.TeamTypes.Select(t => t.Name)).ToArray();
|
||||
|
||||
triggersTableLayoutPanel.Visible = false;
|
||||
}
|
||||
|
||||
private void triggersListView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
houseComboBox.DataBindings.Clear();
|
||||
existenceComboBox.DataBindings.Clear();
|
||||
typeComboBox.DataBindings.Clear();
|
||||
event1ComboBox.DataBindings.Clear();
|
||||
event2ComboBox.DataBindings.Clear();
|
||||
action1ComboBox.DataBindings.Clear();
|
||||
action2ComboBox.DataBindings.Clear();
|
||||
teamComboBox.DataBindings.Clear();
|
||||
|
||||
if (SelectedTrigger != null)
|
||||
{
|
||||
houseComboBox.DataBindings.Add("SelectedItem", SelectedTrigger, "House");
|
||||
existenceComboBox.DataBindings.Add("SelectedValue", SelectedTrigger, "PersistantType");
|
||||
event1ComboBox.DataBindings.Add("SelectedItem", SelectedTrigger.Event1, "EventType");
|
||||
action1ComboBox.DataBindings.Add("SelectedItem", SelectedTrigger.Action1, "ActionType");
|
||||
|
||||
UpdateTriggerControls(SelectedTrigger,
|
||||
SelectedTrigger?.Event1, SelectedTrigger?.Action1,
|
||||
event1ComboBox, event1Nud, event1ValueComboBox,
|
||||
action1ComboBox, action1Nud, action1ValueComboBox);
|
||||
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
teamComboBox.DataBindings.Add("SelectedItem", SelectedTrigger.Action1, "Team");
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
typeComboBox.DataBindings.Add("SelectedValue", SelectedTrigger, "EventControl");
|
||||
event2ComboBox.DataBindings.Add("SelectedItem", SelectedTrigger.Event2, "EventType");
|
||||
action2ComboBox.DataBindings.Add("SelectedItem", SelectedTrigger.Action2, "ActionType");
|
||||
UpdateTriggerControls(SelectedTrigger,
|
||||
SelectedTrigger?.Event2, SelectedTrigger?.Action2,
|
||||
event2ComboBox, event2Nud, event2ValueComboBox,
|
||||
action2ComboBox, action2Nud, action2ValueComboBox);
|
||||
break;
|
||||
}
|
||||
|
||||
triggersTableLayoutPanel.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
triggersTableLayoutPanel.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void teamTypesListView_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
var hitTest = triggersListView.HitTest(e.Location);
|
||||
|
||||
bool canAdd = (hitTest.Item == null) && (triggersListView.Items.Count < maxTriggers);
|
||||
bool canRemove = hitTest.Item != null;
|
||||
addTriggerToolStripMenuItem.Visible = canAdd;
|
||||
removeTriggerToolStripMenuItem.Visible = canRemove;
|
||||
|
||||
if (canAdd || canRemove)
|
||||
{
|
||||
triggersContextMenuStrip.Show(Cursor.Position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void teamTypesListView_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if ((e.KeyData == Keys.F2) && (triggersListView.SelectedItems.Count > 0))
|
||||
{
|
||||
triggersListView.SelectedItems[0].BeginEdit();
|
||||
}
|
||||
}
|
||||
|
||||
private void addTriggerToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var nameChars = Enumerable.Range(97, 26).Concat(Enumerable.Range(48, 10));
|
||||
|
||||
string name = string.Empty;
|
||||
foreach (var nameChar in nameChars)
|
||||
{
|
||||
name = new string((char)nameChar, 4);
|
||||
if (!triggers.Where(t => t.Equals(name)).Any())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var trigger = new Trigger { Name = name, House = plugin.Map.HouseTypes.First().Name };
|
||||
var item = new ListViewItem(trigger.Name)
|
||||
{
|
||||
Tag = trigger
|
||||
};
|
||||
triggers.Add(trigger);
|
||||
triggersListView.Items.Add(item).ToolTipText = trigger.Name;
|
||||
|
||||
item.Selected = true;
|
||||
item.BeginEdit();
|
||||
}
|
||||
|
||||
private void removeTriggerToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (SelectedItem != null)
|
||||
{
|
||||
triggers.Remove(SelectedTrigger);
|
||||
triggersListView.Items.Remove(SelectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
private void teamTypesListView_AfterLabelEdit(object sender, LabelEditEventArgs e)
|
||||
{
|
||||
int maxLength = int.MaxValue;
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
maxLength = 4;
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
maxLength = 23;
|
||||
break;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(e.Label))
|
||||
{
|
||||
e.CancelEdit = true;
|
||||
}
|
||||
else if (e.Label.Length > maxLength)
|
||||
{
|
||||
e.CancelEdit = true;
|
||||
MessageBox.Show(string.Format("Trigger name is longer than {0} characters.", maxLength), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
else if (triggers.Where(t => (t != SelectedTrigger) && t.Equals(e.Label)).Any())
|
||||
{
|
||||
e.CancelEdit = true;
|
||||
MessageBox.Show(string.Format("Trigger with name '{0]' already exists", e.Label), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedTrigger.Name = e.Label;
|
||||
triggersListView.Items[e.Item].ToolTipText = SelectedTrigger.Name;
|
||||
}
|
||||
}
|
||||
|
||||
private void typeComboBox_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (plugin.GameType == GameType.RedAlert)
|
||||
{
|
||||
var eventType = (TriggerMultiStyleType)typeComboBox.SelectedValue;
|
||||
event2Label.Visible = event2ComboBox.Visible = event2Flp.Visible = eventType != TriggerMultiStyleType.Only;
|
||||
}
|
||||
}
|
||||
|
||||
private void trigger1ComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateTriggerControls(SelectedTrigger,
|
||||
SelectedTrigger?.Event1, SelectedTrigger?.Action1,
|
||||
event1ComboBox, event1Nud, event1ValueComboBox,
|
||||
action1ComboBox, action1Nud, action1ValueComboBox);
|
||||
}
|
||||
|
||||
private void trigger2ComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateTriggerControls(SelectedTrigger,
|
||||
SelectedTrigger?.Event2, SelectedTrigger?.Action2,
|
||||
event2ComboBox, event2Nud, event2ValueComboBox,
|
||||
action2ComboBox, action2Nud, action2ValueComboBox);
|
||||
}
|
||||
|
||||
private void UpdateTriggerControls(Trigger trigger, TriggerEvent triggerEvent, TriggerAction triggerAction, ComboBox eventComboBox, NumericUpDown eventNud, ComboBox eventValueComboBox, ComboBox actionComboBox, NumericUpDown actionNud, ComboBox actionValueComboBox)
|
||||
{
|
||||
eventNud.Visible = false;
|
||||
eventNud.DataBindings.Clear();
|
||||
eventValueComboBox.Visible = false;
|
||||
eventValueComboBox.DataBindings.Clear();
|
||||
eventValueComboBox.DataSource = null;
|
||||
eventValueComboBox.DisplayMember = null;
|
||||
eventValueComboBox.ValueMember = null;
|
||||
|
||||
if (triggerEvent != null)
|
||||
{
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.TiberianDawn:
|
||||
switch (eventComboBox.SelectedItem)
|
||||
{
|
||||
case TiberianDawn.EventTypes.EVENT_TIME:
|
||||
case TiberianDawn.EventTypes.EVENT_CREDITS:
|
||||
case TiberianDawn.EventTypes.EVENT_NUNITS_DESTROYED:
|
||||
case TiberianDawn.EventTypes.EVENT_NBUILDINGS_DESTROYED:
|
||||
eventNud.Visible = true;
|
||||
eventNud.DataBindings.Add("Value", triggerEvent, "Data");
|
||||
break;
|
||||
case TiberianDawn.EventTypes.EVENT_BUILD:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DisplayMember = "Name";
|
||||
eventValueComboBox.ValueMember = "Value";
|
||||
eventValueComboBox.DataSource = plugin.Map.BuildingTypes.Select(t => new { Name = t.DisplayName, Value = (long)t.ID }).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedValue", triggerEvent, "Data");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case GameType.RedAlert:
|
||||
switch (eventComboBox.SelectedItem)
|
||||
{
|
||||
case RedAlert.EventTypes.TEVENT_LEAVES_MAP:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DataSource = plugin.Map.TeamTypes.Select(t => t.Name).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedItem", triggerEvent, "Team");
|
||||
break;
|
||||
case RedAlert.EventTypes.TEVENT_PLAYER_ENTERED:
|
||||
case RedAlert.EventTypes.TEVENT_CROSS_HORIZONTAL:
|
||||
case RedAlert.EventTypes.TEVENT_CROSS_VERTICAL:
|
||||
case RedAlert.EventTypes.TEVENT_ENTERS_ZONE:
|
||||
case RedAlert.EventTypes.TEVENT_LOW_POWER:
|
||||
case RedAlert.EventTypes.TEVENT_THIEVED:
|
||||
case RedAlert.EventTypes.TEVENT_HOUSE_DISCOVERED:
|
||||
case RedAlert.EventTypes.TEVENT_BUILDINGS_DESTROYED:
|
||||
case RedAlert.EventTypes.TEVENT_UNITS_DESTROYED:
|
||||
case RedAlert.EventTypes.TEVENT_ALL_DESTROYED:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DisplayMember = "Name";
|
||||
eventValueComboBox.ValueMember = "Value";
|
||||
eventValueComboBox.DataSource = new { Name = "None", Value = (long)-1 }.Yield().Concat(plugin.Map.Houses.Select(t => new { t.Type.Name, Value = (long)t.Type.ID })).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedValue", triggerEvent, "Data");
|
||||
break;
|
||||
case RedAlert.EventTypes.TEVENT_BUILDING_EXISTS:
|
||||
case RedAlert.EventTypes.TEVENT_BUILD:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DisplayMember = "Name";
|
||||
eventValueComboBox.ValueMember = "Value";
|
||||
eventValueComboBox.DataSource = plugin.Map.BuildingTypes.Select(t => new { Name = t.DisplayName, Value = (long)t.ID }).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedValue", triggerEvent, "Data");
|
||||
break;
|
||||
case RedAlert.EventTypes.TEVENT_BUILD_UNIT:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DisplayMember = "Name";
|
||||
eventValueComboBox.ValueMember = "Value";
|
||||
eventValueComboBox.DataSource = plugin.Map.UnitTypes.Where(t => t.IsUnit).Select(t => new { Name = t.DisplayName, Value = (long)t.ID }).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedValue", triggerEvent, "Data");
|
||||
break;
|
||||
case RedAlert.EventTypes.TEVENT_BUILD_INFANTRY:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DisplayMember = "Name";
|
||||
eventValueComboBox.ValueMember = "Value";
|
||||
eventValueComboBox.DataSource = plugin.Map.InfantryTypes.Select(t => new { Name = t.DisplayName, Value = (long)t.ID }).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedValue", triggerEvent, "Data");
|
||||
break;
|
||||
case RedAlert.EventTypes.TEVENT_BUILD_AIRCRAFT:
|
||||
eventValueComboBox.Visible = true;
|
||||
eventValueComboBox.DisplayMember = "Name";
|
||||
eventValueComboBox.ValueMember = "Value";
|
||||
eventValueComboBox.DataSource = plugin.Map.UnitTypes.Where(t => t.IsAircraft).Select(t => new { Name = t.DisplayName, Value = (long)t.ID }).ToArray();
|
||||
eventValueComboBox.DataBindings.Add("SelectedValue", triggerEvent, "Data");
|
||||
break;
|
||||
case RedAlert.EventTypes.TEVENT_NUNITS_DESTROYED:
|
||||
case RedAlert.EventTypes.TEVENT_NBUILDINGS_DESTROYED:
|
||||
case RedAlert.EventTypes.TEVENT_CREDITS:
|
||||
case RedAlert.EventTypes.TEVENT_TIME:
|
||||
case RedAlert.EventTypes.TEVENT_GLOBAL_SET:
|
||||
case RedAlert.EventTypes.TEVENT_GLOBAL_CLEAR:
|
||||
eventNud.Visible = true;
|
||||
eventNud.DataBindings.Add("Value", triggerEvent, "Data");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
actionNud.Visible = false;
|
||||
actionNud.DataBindings.Clear();
|
||||
actionNud.Minimum = long.MinValue;
|
||||
actionNud.Maximum = long.MaxValue;
|
||||
actionValueComboBox.Visible = false;
|
||||
actionValueComboBox.DataBindings.Clear();
|
||||
actionValueComboBox.DataSource = null;
|
||||
actionValueComboBox.DisplayMember = null;
|
||||
actionValueComboBox.ValueMember = null;
|
||||
|
||||
if (triggerAction != null)
|
||||
{
|
||||
switch (plugin.GameType)
|
||||
{
|
||||
case GameType.RedAlert:
|
||||
switch (actionComboBox.SelectedItem)
|
||||
{
|
||||
case RedAlert.ActionTypes.TACTION_CREATE_TEAM:
|
||||
case RedAlert.ActionTypes.TACTION_DESTROY_TEAM:
|
||||
case RedAlert.ActionTypes.TACTION_REINFORCEMENTS:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DataSource = plugin.Map.TeamTypes.Select(t => t.Name).ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedItem", triggerAction, "Team");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_WIN:
|
||||
case RedAlert.ActionTypes.TACTION_LOSE:
|
||||
case RedAlert.ActionTypes.TACTION_BEGIN_PRODUCTION:
|
||||
case RedAlert.ActionTypes.TACTION_FIRE_SALE:
|
||||
case RedAlert.ActionTypes.TACTION_AUTOCREATE:
|
||||
case RedAlert.ActionTypes.TACTION_ALL_HUNT:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = new { Name = "None", Value = (long)-1 }.Yield().Concat(plugin.Map.Houses.Select(t => new { t.Type.Name, Value = (long)t.Type.ID })).ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_FORCE_TRIGGER:
|
||||
case RedAlert.ActionTypes.TACTION_DESTROY_TRIGGER:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DataSource = plugin.Map.Triggers.Select(t => t.Name).ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedItem", triggerAction, "Trigger");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_DZ:
|
||||
case RedAlert.ActionTypes.TACTION_REVEAL_SOME:
|
||||
case RedAlert.ActionTypes.TACTION_REVEAL_ZONE:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = new { Name = "None", Value = (long)-1 }.Yield().Concat(plugin.Map.Waypoints.Select((t, i) => new { t.Name, Value = (long)i })).ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_1_SPECIAL:
|
||||
case RedAlert.ActionTypes.TACTION_FULL_SPECIAL:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = Enum.GetValues(typeof(RedAlert.ActionDataTypes.SpecialWeaponType)).Cast<int>()
|
||||
.Select(v => new { Name = Enum.GetName(typeof(RedAlert.ActionDataTypes.SpecialWeaponType), v), Value = (long)v })
|
||||
.ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_PLAY_MUSIC:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = Enum.GetValues(typeof(RedAlert.ActionDataTypes.ThemeType)).Cast<int>()
|
||||
.Select(v => new { Name = Enum.GetName(typeof(RedAlert.ActionDataTypes.ThemeType), v), Value = (long)v })
|
||||
.ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_PLAY_MOVIE:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = Enum.GetValues(typeof(RedAlert.ActionDataTypes.VQType)).Cast<int>()
|
||||
.Select(v => new { Name = Enum.GetName(typeof(RedAlert.ActionDataTypes.VQType), v), Value = (long)v })
|
||||
.ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_PLAY_SOUND:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = Enum.GetValues(typeof(RedAlert.ActionDataTypes.VocType)).Cast<int>()
|
||||
.Select(v => new { Name = Enum.GetName(typeof(RedAlert.ActionDataTypes.VocType), v), Value = (long)v })
|
||||
.ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_PLAY_SPEECH:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = Enum.GetValues(typeof(RedAlert.ActionDataTypes.VoxType)).Cast<int>()
|
||||
.Select(v => new { Name = Enum.GetName(typeof(RedAlert.ActionDataTypes.VoxType), v), Value = (long)v })
|
||||
.ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_PREFERRED_TARGET:
|
||||
actionValueComboBox.Visible = true;
|
||||
actionValueComboBox.DisplayMember = "Name";
|
||||
actionValueComboBox.ValueMember = "Value";
|
||||
actionValueComboBox.DataSource = Enum.GetValues(typeof(RedAlert.ActionDataTypes.QuarryType)).Cast<int>()
|
||||
.Select(v => new { Name = Enum.GetName(typeof(RedAlert.ActionDataTypes.QuarryType), v), Value = (long)v })
|
||||
.ToArray();
|
||||
actionValueComboBox.DataBindings.Add("SelectedValue", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_TEXT_TRIGGER:
|
||||
actionNud.Visible = true;
|
||||
actionNud.Minimum = 1;
|
||||
actionNud.Maximum = 209;
|
||||
actionNud.DataBindings.Add("Value", triggerAction, "Data");
|
||||
break;
|
||||
case RedAlert.ActionTypes.TACTION_ADD_TIMER:
|
||||
case RedAlert.ActionTypes.TACTION_SUB_TIMER:
|
||||
case RedAlert.ActionTypes.TACTION_SET_TIMER:
|
||||
case RedAlert.ActionTypes.TACTION_SET_GLOBAL:
|
||||
case RedAlert.ActionTypes.TACTION_CLEAR_GLOBAL:
|
||||
case RedAlert.ActionTypes.TACTION_BASE_BUILDING:
|
||||
actionNud.Visible = true;
|
||||
actionNud.DataBindings.Add("Value", triggerAction, "Data");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
123
CnCTDRAMapEditor/Dialogs/TriggersDialog.resx
Normal file
123
CnCTDRAMapEditor/Dialogs/TriggersDialog.resx
Normal file
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="triggersContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
Reference in a new issue