diff --git a/editor source/Desktop/CommonControls/PropertyTable.cs b/editor source/Desktop/CommonControls/PropertyTable.cs index a737e677df777548dd82aeedbc784877cedb5312..9394c328747b476d1b69a00e049b8b268af7dc66 100644 --- a/editor source/Desktop/CommonControls/PropertyTable.cs +++ b/editor source/Desktop/CommonControls/PropertyTable.cs @@ -397,18 +397,31 @@ namespace Desktop.CommonControls //create an item if (index == -1) { - Type itemType = memberType.GenericTypeArguments[0]; - object item = null; - if (itemType == typeof(string)) + //see if any item doesn't have a control yet and use that. Otherwise create a new item + for (int i = 0; i < list.Count; i++) { - item = ""; + PropertyTableRow indexRow = _rows.Get(result.Property, i); + if (indexRow == null) + { + index = i; + break; + } } - else + if (index == -1) { - item = Activator.CreateInstance(itemType); + Type itemType = memberType.GenericTypeArguments[0]; + object item = null; + if (itemType == typeof(string)) + { + item = ""; + } + else + { + item = Activator.CreateInstance(itemType); + } + list.Add(item); + index = list.Count - 1; } - list.Add(item); - index = list.Count - 1; } } @@ -603,5 +616,41 @@ namespace Desktop.CommonControls } } } + + public void AddSpeedButton(string group, string caption, Func<object, string> propertyCreator) + { + ToolStripMenuItem groupMenu = null; + for (int i = 0; i < menuSpeedButtons.Items.Count; i++) + { + ToolStripItem mnuItem = menuSpeedButtons.Items[i]; + if (mnuItem.Text == group) + { + groupMenu = mnuItem as ToolStripMenuItem; + break; + } + } + if (groupMenu == null) + { + groupMenu = new ToolStripMenuItem(group); + menuSpeedButtons.Items.Add(groupMenu); + } + + ToolStripMenuItem item = new ToolStripMenuItem(caption); + item.Tag = propertyCreator; + item.Click += CustomSpeedButtonClick; + groupMenu.DropDownItems.Add(item); + } + + private void CustomSpeedButtonClick(object sender, EventArgs e) + { + ToolStripMenuItem item = sender as ToolStripMenuItem; + Func<object, string> func = item.Tag as Func<object, string>; + string property = func(Data); + PropertyRecord record = PropertyProvider.GetEditControls(Data.GetType()).FirstOrDefault(r => r.Property == property); + if (record != null) + { + AddControl(record); + } + } } } diff --git a/editor source/Desktop/Controls/RecordLookup.cs b/editor source/Desktop/Controls/RecordLookup.cs index 2b002d783e43f361168935015133a6c609f2dceb..fc748acfba01b5bfff0fba79c94003b3989e7844 100644 --- a/editor source/Desktop/Controls/RecordLookup.cs +++ b/editor source/Desktop/Controls/RecordLookup.cs @@ -235,7 +235,7 @@ namespace Desktop } return; } - cmdNew.Enabled = false; + cmdNew.Enabled = (txtName.Text.Length > 0); AcceptButton = cmdAccept; List<IRecord> records = _provider.GetRecords(txtName.Text); _provider.Sort(records); diff --git a/editor source/SPNATI Character Editor/Activities/DialogueEditor.Designer.cs b/editor source/SPNATI Character Editor/Activities/DialogueEditor.Designer.cs index 4e65898a6f3bebb44e504ec45d1aa7c205a9ab13..b3b816acd293fc7ce155d76d6592d0c7cf44eacc 100644 --- a/editor source/SPNATI Character Editor/Activities/DialogueEditor.Designer.cs +++ b/editor source/SPNATI Character Editor/Activities/DialogueEditor.Designer.cs @@ -31,141 +31,30 @@ namespace SPNATI_Character_Editor.Activities private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); this.splitDialogue = new System.Windows.Forms.SplitContainer(); this.treeDialogue = new SPNATI_Character_Editor.Controls.DialogueTree(); this.grpCase = new System.Windows.Forms.GroupBox(); + this.tabs = new System.Windows.Forms.TabControl(); + this.tabDialogue = new System.Windows.Forms.TabPage(); + this.lblAvailableVars = new System.Windows.Forms.Label(); + this.cmdCopyAll = new System.Windows.Forms.Button(); + this.ckbShowAdvanced = new System.Windows.Forms.CheckBox(); + this.cmdPasteAll = new System.Windows.Forms.Button(); + this.gridDialogue = new SPNATI_Character_Editor.Controls.DialogueGrid(); + this.tabNotes = new System.Windows.Forms.TabPage(); + this.txtNotes = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); this.cmdMakeResponse = new System.Windows.Forms.Button(); - this.cmdToggleMode = new System.Windows.Forms.Button(); this.cmdCallOut = new System.Windows.Forms.Button(); - this.ckbShowBubbleColumns = new System.Windows.Forms.CheckBox(); - this.gridDialogue = new SPNATI_Character_Editor.Controls.DialogueGrid(); this.lblHelpText = new System.Windows.Forms.Label(); - this.cmdPasteAll = new System.Windows.Forms.Button(); - this.cmdCopyAll = new System.Windows.Forms.Button(); this.cboCaseTags = new System.Windows.Forms.ComboBox(); this.label34 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.lblAvailableVars = new System.Windows.Forms.Label(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.chkSelectAll = new System.Windows.Forms.CheckBox(); this.flowStageChecks = new System.Windows.Forms.FlowLayoutPanel(); this.grpConditions = new System.Windows.Forms.GroupBox(); this.valPriority = new System.Windows.Forms.NumericUpDown(); this.label73 = new System.Windows.Forms.Label(); - this.tabControlConditions = new System.Windows.Forms.TabControl(); - this.tabTarget = new System.Windows.Forms.TabPage(); - this.markerTarget = new SPNATI_Character_Editor.Controls.MarkerConditionField(); - this.label76 = new System.Windows.Forms.Label(); - this.valMaxStartingLayers = new System.Windows.Forms.NumericUpDown(); - this.valStartingLayers = new System.Windows.Forms.NumericUpDown(); - this.lblTargetStartingLayers = new System.Windows.Forms.Label(); - this.ckbTargetStatusNegated = new System.Windows.Forms.CheckBox(); - this.valMaxLayers = new System.Windows.Forms.NumericUpDown(); - this.label74 = new System.Windows.Forms.Label(); - this.valLayers = new System.Windows.Forms.NumericUpDown(); - this.lblTargetLayers = new System.Windows.Forms.Label(); - this.cboTargetNotMarker = new System.Windows.Forms.ComboBox(); - this.label72 = new System.Windows.Forms.Label(); - this.cboTargetStatus = new System.Windows.Forms.ComboBox(); - this.label75 = new System.Windows.Forms.Label(); - this.label66 = new System.Windows.Forms.Label(); - this.valMaxTimeInStage = new System.Windows.Forms.NumericUpDown(); - this.label53 = new System.Windows.Forms.Label(); - this.valMaxLosses = new System.Windows.Forms.NumericUpDown(); - this.label52 = new System.Windows.Forms.Label(); - this.valTimeInStage = new System.Windows.Forms.NumericUpDown(); - this.label45 = new System.Windows.Forms.Label(); - this.valLosses = new System.Windows.Forms.NumericUpDown(); - this.label43 = new System.Windows.Forms.Label(); - this.cboTargetToStage = new System.Windows.Forms.ComboBox(); - this.label41 = new System.Windows.Forms.Label(); - this.label21 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label25 = new System.Windows.Forms.Label(); - this.cboTargetHand = new System.Windows.Forms.ComboBox(); - this.cboLineTarget = new System.Windows.Forms.ComboBox(); - this.label29 = new System.Windows.Forms.Label(); - this.cboLineFilter = new System.Windows.Forms.ComboBox(); - this.cboTargetStage = new System.Windows.Forms.ComboBox(); - this.tabOther = new System.Windows.Forms.TabPage(); - this.markerAlsoPlaying = new SPNATI_Character_Editor.Controls.MarkerConditionField(); - this.cboAlsoPlayingNotMarker = new System.Windows.Forms.ComboBox(); - this.label71 = new System.Windows.Forms.Label(); - this.label67 = new System.Windows.Forms.Label(); - this.valMaxAlsoTimeInStage = new System.Windows.Forms.NumericUpDown(); - this.label54 = new System.Windows.Forms.Label(); - this.valAlsoTimeInStage = new System.Windows.Forms.NumericUpDown(); - this.label44 = new System.Windows.Forms.Label(); - this.cboAlsoPlayingMaxStage = new System.Windows.Forms.ComboBox(); - this.label38 = new System.Windows.Forms.Label(); - this.label36 = new System.Windows.Forms.Label(); - this.cboAlsoPlaying = new System.Windows.Forms.ComboBox(); - this.label27 = new System.Windows.Forms.Label(); - this.cboAlsoPlayingStage = new System.Windows.Forms.ComboBox(); - this.cboAlsoPlayingHand = new System.Windows.Forms.ComboBox(); - this.label30 = new System.Windows.Forms.Label(); - this.label28 = new System.Windows.Forms.Label(); - this.tabConditions = new System.Windows.Forms.TabPage(); - this.gridFilters = new System.Windows.Forms.DataGridView(); - this.ColTagFilter = new System.Windows.Forms.DataGridViewComboBoxColumn(); - this.ColGenderFilter = new System.Windows.Forms.DataGridViewComboBoxColumn(); - this.ColStatusFilterNegated = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.ColStatusFilter = new System.Windows.Forms.DataGridViewComboBoxColumn(); - this.ColFilterCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.tabSelf = new System.Windows.Forms.TabPage(); - this.markerSelf = new SPNATI_Character_Editor.Controls.MarkerConditionField(); - this.cboNotMarker = new System.Windows.Forms.ComboBox(); - this.label70 = new System.Windows.Forms.Label(); - this.cboOwnHand = new System.Windows.Forms.ComboBox(); - this.label26 = new System.Windows.Forms.Label(); - this.label69 = new System.Windows.Forms.Label(); - this.valMaxOwnTimeInStage = new System.Windows.Forms.NumericUpDown(); - this.label63 = new System.Windows.Forms.Label(); - this.valMaxOwnLosses = new System.Windows.Forms.NumericUpDown(); - this.label57 = new System.Windows.Forms.Label(); - this.valOwnLosses = new System.Windows.Forms.NumericUpDown(); - this.label51 = new System.Windows.Forms.Label(); - this.valOwnTimeInStage = new System.Windows.Forms.NumericUpDown(); - this.label42 = new System.Windows.Forms.Label(); - this.label68 = new System.Windows.Forms.Label(); - this.tabMisc = new System.Windows.Forms.TabPage(); - this.valMaxGameRounds = new System.Windows.Forms.NumericUpDown(); - this.label64 = new System.Windows.Forms.Label(); - this.valGameRounds = new System.Windows.Forms.NumericUpDown(); - this.label65 = new System.Windows.Forms.Label(); - this.cboMaxTotalFinished = new System.Windows.Forms.ComboBox(); - this.label62 = new System.Windows.Forms.Label(); - this.cboMaxTotalFinishing = new System.Windows.Forms.ComboBox(); - this.label61 = new System.Windows.Forms.Label(); - this.cboMaxTotalNaked = new System.Windows.Forms.ComboBox(); - this.label60 = new System.Windows.Forms.Label(); - this.cboMaxTotalExposed = new System.Windows.Forms.ComboBox(); - this.label59 = new System.Windows.Forms.Label(); - this.cboMaxTotalPlaying = new System.Windows.Forms.ComboBox(); - this.label58 = new System.Windows.Forms.Label(); - this.cboMaxTotalMales = new System.Windows.Forms.ComboBox(); - this.label56 = new System.Windows.Forms.Label(); - this.cboMaxTotalFemales = new System.Windows.Forms.ComboBox(); - this.label55 = new System.Windows.Forms.Label(); - this.cboTotalFinished = new System.Windows.Forms.ComboBox(); - this.label50 = new System.Windows.Forms.Label(); - this.cboTotalFinishing = new System.Windows.Forms.ComboBox(); - this.label49 = new System.Windows.Forms.Label(); - this.cboTotalNaked = new System.Windows.Forms.ComboBox(); - this.label48 = new System.Windows.Forms.Label(); - this.cboTotalExposed = new System.Windows.Forms.ComboBox(); - this.label47 = new System.Windows.Forms.Label(); - this.cboTotalPlaying = new System.Windows.Forms.ComboBox(); - this.label46 = new System.Windows.Forms.Label(); - this.label37 = new System.Windows.Forms.Label(); - this.label32 = new System.Windows.Forms.Label(); - this.label31 = new System.Windows.Forms.Label(); - this.cboTotalMales = new System.Windows.Forms.ComboBox(); - this.cboTotalFemales = new System.Windows.Forms.ComboBox(); this.tableConditions = new Desktop.CommonControls.PropertyTable(); this.triggerMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); @@ -174,32 +63,12 @@ namespace SPNATI_Character_Editor.Activities this.splitDialogue.Panel2.SuspendLayout(); this.splitDialogue.SuspendLayout(); this.grpCase.SuspendLayout(); + this.tabs.SuspendLayout(); + this.tabDialogue.SuspendLayout(); + this.tabNotes.SuspendLayout(); this.groupBox3.SuspendLayout(); this.grpConditions.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.valPriority)).BeginInit(); - this.tabControlConditions.SuspendLayout(); - this.tabTarget.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxStartingLayers)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.valStartingLayers)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxLayers)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.valLayers)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxTimeInStage)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxLosses)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.valTimeInStage)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.valLosses)).BeginInit(); - this.tabOther.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxAlsoTimeInStage)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.valAlsoTimeInStage)).BeginInit(); - this.tabConditions.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.gridFilters)).BeginInit(); - this.tabSelf.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxOwnTimeInStage)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxOwnLosses)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.valOwnLosses)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.valOwnTimeInStage)).BeginInit(); - this.tabMisc.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxGameRounds)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.valGameRounds)).BeginInit(); this.SuspendLayout(); // // splitDialogue @@ -239,18 +108,12 @@ namespace SPNATI_Character_Editor.Activities | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.grpCase.BackColor = System.Drawing.SystemColors.Control; + this.grpCase.Controls.Add(this.tabs); this.grpCase.Controls.Add(this.cmdMakeResponse); - this.grpCase.Controls.Add(this.cmdToggleMode); this.grpCase.Controls.Add(this.cmdCallOut); - this.grpCase.Controls.Add(this.ckbShowBubbleColumns); - this.grpCase.Controls.Add(this.gridDialogue); this.grpCase.Controls.Add(this.lblHelpText); - this.grpCase.Controls.Add(this.cmdPasteAll); - this.grpCase.Controls.Add(this.cmdCopyAll); this.grpCase.Controls.Add(this.cboCaseTags); this.grpCase.Controls.Add(this.label34); - this.grpCase.Controls.Add(this.label8); - this.grpCase.Controls.Add(this.lblAvailableVars); this.grpCase.Controls.Add(this.groupBox3); this.grpCase.Controls.Add(this.grpConditions); this.grpCase.ForeColor = System.Drawing.SystemColors.ControlText; @@ -260,6 +123,124 @@ namespace SPNATI_Character_Editor.Activities this.grpCase.TabIndex = 28; this.grpCase.TabStop = false; this.grpCase.Text = "Edit Case"; + // + // tabs + // + this.tabs.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.tabs.Controls.Add(this.tabDialogue); + this.tabs.Controls.Add(this.tabNotes); + this.tabs.Location = new System.Drawing.Point(0, 420); + this.tabs.Name = "tabs"; + this.tabs.SelectedIndex = 0; + this.tabs.Size = new System.Drawing.Size(697, 251); + this.tabs.TabIndex = 95; + // + // tabDialogue + // + this.tabDialogue.Controls.Add(this.lblAvailableVars); + this.tabDialogue.Controls.Add(this.cmdCopyAll); + this.tabDialogue.Controls.Add(this.ckbShowAdvanced); + this.tabDialogue.Controls.Add(this.cmdPasteAll); + this.tabDialogue.Controls.Add(this.gridDialogue); + this.tabDialogue.Location = new System.Drawing.Point(4, 22); + this.tabDialogue.Name = "tabDialogue"; + this.tabDialogue.Padding = new System.Windows.Forms.Padding(3); + this.tabDialogue.Size = new System.Drawing.Size(689, 225); + this.tabDialogue.TabIndex = 0; + this.tabDialogue.Text = "Dialogue"; + this.tabDialogue.UseVisualStyleBackColor = true; + // + // lblAvailableVars + // + this.lblAvailableVars.AutoSize = true; + this.lblAvailableVars.Location = new System.Drawing.Point(2, 8); + this.lblAvailableVars.Name = "lblAvailableVars"; + this.lblAvailableVars.Size = new System.Drawing.Size(53, 13); + this.lblAvailableVars.TabIndex = 32; + this.lblAvailableVars.Text = "Variables:"; + // + // cmdCopyAll + // + this.cmdCopyAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.cmdCopyAll.Location = new System.Drawing.Point(527, 3); + this.cmdCopyAll.Name = "cmdCopyAll"; + this.cmdCopyAll.Size = new System.Drawing.Size(75, 23); + this.cmdCopyAll.TabIndex = 39; + this.cmdCopyAll.Text = "Copy All"; + this.cmdCopyAll.UseVisualStyleBackColor = true; + this.cmdCopyAll.Click += new System.EventHandler(this.cmdCopyAll_Click); + // + // ckbShowBubbleColumns + // + this.ckbShowAdvanced.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.ckbShowAdvanced.AutoSize = true; + this.ckbShowAdvanced.Location = new System.Drawing.Point(417, 6); + this.ckbShowAdvanced.Name = "ckbShowBubbleColumns"; + this.ckbShowAdvanced.Size = new System.Drawing.Size(104, 17); + this.ckbShowAdvanced.TabIndex = 43; + this.ckbShowAdvanced.Text = "Show advanced"; + this.ckbShowAdvanced.UseVisualStyleBackColor = true; + this.ckbShowAdvanced.CheckedChanged += new System.EventHandler(this.ckbShowAdvanced_CheckedChanged); + // + // cmdPasteAll + // + this.cmdPasteAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.cmdPasteAll.Location = new System.Drawing.Point(608, 3); + this.cmdPasteAll.Name = "cmdPasteAll"; + this.cmdPasteAll.Size = new System.Drawing.Size(75, 23); + this.cmdPasteAll.TabIndex = 40; + this.cmdPasteAll.Text = "Paste All"; + this.cmdPasteAll.UseVisualStyleBackColor = true; + this.cmdPasteAll.Click += new System.EventHandler(this.cmdPasteAll_Click); + // + // gridDialogue + // + this.gridDialogue.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.gridDialogue.Location = new System.Drawing.Point(3, 32); + this.gridDialogue.Name = "gridDialogue"; + this.gridDialogue.ReadOnly = false; + this.gridDialogue.Size = new System.Drawing.Size(680, 336); + this.gridDialogue.TabIndex = 42; + this.gridDialogue.KeyDown += new System.EventHandler<System.Windows.Forms.KeyEventArgs>(this.gridDialogue_KeyDown); + this.gridDialogue.HighlightRow += new System.EventHandler<int>(this.gridDialogue_HighlightRow); + // + // tabNotes + // + this.tabNotes.Controls.Add(this.txtNotes); + this.tabNotes.Controls.Add(this.label1); + this.tabNotes.Location = new System.Drawing.Point(4, 22); + this.tabNotes.Name = "tabNotes"; + this.tabNotes.Padding = new System.Windows.Forms.Padding(3); + this.tabNotes.Size = new System.Drawing.Size(689, 225); + this.tabNotes.TabIndex = 1; + this.tabNotes.Text = "Notes"; + this.tabNotes.UseVisualStyleBackColor = true; + // + // txtNotes + // + this.txtNotes.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.txtNotes.Location = new System.Drawing.Point(5, 19); + this.txtNotes.Multiline = true; + this.txtNotes.Name = "txtNotes"; + this.txtNotes.Size = new System.Drawing.Size(678, 206); + this.txtNotes.TabIndex = 1; + this.txtNotes.Validated += new System.EventHandler(this.txtNotes_Validated); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 3); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(413, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Jot down any personal notes about this case here. These notes won\'t appear in gam" + + "e."; // // cmdMakeResponse // @@ -273,17 +254,6 @@ namespace SPNATI_Character_Editor.Activities this.cmdMakeResponse.UseVisualStyleBackColor = true; this.cmdMakeResponse.Click += new System.EventHandler(this.cmdMakeResponse_Click); // - // cmdToggleMode - // - this.cmdToggleMode.Location = new System.Drawing.Point(71, 180); - this.cmdToggleMode.Name = "cmdToggleMode"; - this.cmdToggleMode.Size = new System.Drawing.Size(20, 20); - this.cmdToggleMode.TabIndex = 32; - this.cmdToggleMode.Text = "↺"; - this.toolTip1.SetToolTip(this.cmdToggleMode, "Toggles between new and old condition editors"); - this.cmdToggleMode.UseVisualStyleBackColor = true; - this.cmdToggleMode.Click += new System.EventHandler(this.cmdToggleMode_Click); - // // cmdCallOut // this.cmdCallOut.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -297,31 +267,6 @@ namespace SPNATI_Character_Editor.Activities this.cmdCallOut.UseVisualStyleBackColor = true; this.cmdCallOut.Click += new System.EventHandler(this.cmdCallOut_Click); // - // ckbShowBubbleColumns - // - this.ckbShowBubbleColumns.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ckbShowBubbleColumns.AutoSize = true; - this.ckbShowBubbleColumns.Location = new System.Drawing.Point(361, 426); - this.ckbShowBubbleColumns.Name = "ckbShowBubbleColumns"; - this.ckbShowBubbleColumns.Size = new System.Drawing.Size(168, 17); - this.ckbShowBubbleColumns.TabIndex = 43; - this.ckbShowBubbleColumns.Text = "Show speech bubble columns"; - this.ckbShowBubbleColumns.UseVisualStyleBackColor = true; - this.ckbShowBubbleColumns.CheckedChanged += new System.EventHandler(this.ckbShowSpeechBubbleColumns_CheckedChanged); - // - // gridDialogue - // - this.gridDialogue.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.gridDialogue.Location = new System.Drawing.Point(6, 452); - this.gridDialogue.Name = "gridDialogue"; - this.gridDialogue.ReadOnly = false; - this.gridDialogue.Size = new System.Drawing.Size(685, 220); - this.gridDialogue.TabIndex = 42; - this.gridDialogue.KeyDown += new System.EventHandler<System.Windows.Forms.KeyEventArgs>(this.gridDialogue_KeyDown); - this.gridDialogue.HighlightRow += new System.EventHandler<int>(this.gridDialogue_HighlightRow); - // // lblHelpText // this.lblHelpText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -333,28 +278,6 @@ namespace SPNATI_Character_Editor.Activities this.lblHelpText.Text = "Help Text"; this.lblHelpText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // cmdPasteAll - // - this.cmdPasteAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.cmdPasteAll.Location = new System.Drawing.Point(616, 423); - this.cmdPasteAll.Name = "cmdPasteAll"; - this.cmdPasteAll.Size = new System.Drawing.Size(75, 23); - this.cmdPasteAll.TabIndex = 40; - this.cmdPasteAll.Text = "Paste All"; - this.cmdPasteAll.UseVisualStyleBackColor = true; - this.cmdPasteAll.Click += new System.EventHandler(this.cmdPasteAll_Click); - // - // cmdCopyAll - // - this.cmdCopyAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.cmdCopyAll.Location = new System.Drawing.Point(535, 423); - this.cmdCopyAll.Name = "cmdCopyAll"; - this.cmdCopyAll.Size = new System.Drawing.Size(75, 23); - this.cmdCopyAll.TabIndex = 39; - this.cmdCopyAll.Text = "Copy All"; - this.cmdCopyAll.UseVisualStyleBackColor = true; - this.cmdCopyAll.Click += new System.EventHandler(this.cmdCopyAll_Click); - // // cboCaseTags // this.cboCaseTags.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -373,26 +296,6 @@ namespace SPNATI_Character_Editor.Activities this.label34.TabIndex = 34; this.label34.Text = "Type:"; // - // label8 - // - this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(6, 423); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(52, 13); - this.label8.TabIndex = 33; - this.label8.Text = "Dialogue:"; - // - // lblAvailableVars - // - this.lblAvailableVars.AutoSize = true; - this.lblAvailableVars.Location = new System.Drawing.Point(6, 436); - this.lblAvailableVars.Name = "lblAvailableVars"; - this.lblAvailableVars.Size = new System.Drawing.Size(53, 13); - this.lblAvailableVars.TabIndex = 32; - this.lblAvailableVars.Text = "Variables:"; - // // groupBox3 // this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -435,7 +338,6 @@ namespace SPNATI_Character_Editor.Activities this.grpConditions.Controls.Add(this.valPriority); this.grpConditions.Controls.Add(this.label73); this.grpConditions.Controls.Add(this.tableConditions); - this.grpConditions.Controls.Add(this.tabControlConditions); this.grpConditions.Location = new System.Drawing.Point(9, 184); this.grpConditions.Name = "grpConditions"; this.grpConditions.Size = new System.Drawing.Size(682, 233); @@ -466,1318 +368,6 @@ namespace SPNATI_Character_Editor.Activities this.label73.TabIndex = 60; this.label73.Text = "Priority:"; // - // tabControlConditions - // - this.tabControlConditions.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.tabControlConditions.Controls.Add(this.tabTarget); - this.tabControlConditions.Controls.Add(this.tabOther); - this.tabControlConditions.Controls.Add(this.tabConditions); - this.tabControlConditions.Controls.Add(this.tabSelf); - this.tabControlConditions.Controls.Add(this.tabMisc); - this.tabControlConditions.Location = new System.Drawing.Point(6, 19); - this.tabControlConditions.Name = "tabControlConditions"; - this.tabControlConditions.SelectedIndex = 0; - this.tabControlConditions.Size = new System.Drawing.Size(670, 211); - this.tabControlConditions.TabIndex = 30; - // - // tabTarget - // - this.tabTarget.Controls.Add(this.markerTarget); - this.tabTarget.Controls.Add(this.label76); - this.tabTarget.Controls.Add(this.valMaxStartingLayers); - this.tabTarget.Controls.Add(this.valStartingLayers); - this.tabTarget.Controls.Add(this.lblTargetStartingLayers); - this.tabTarget.Controls.Add(this.ckbTargetStatusNegated); - this.tabTarget.Controls.Add(this.valMaxLayers); - this.tabTarget.Controls.Add(this.label74); - this.tabTarget.Controls.Add(this.valLayers); - this.tabTarget.Controls.Add(this.lblTargetLayers); - this.tabTarget.Controls.Add(this.cboTargetNotMarker); - this.tabTarget.Controls.Add(this.label72); - this.tabTarget.Controls.Add(this.cboTargetStatus); - this.tabTarget.Controls.Add(this.label75); - this.tabTarget.Controls.Add(this.label66); - this.tabTarget.Controls.Add(this.valMaxTimeInStage); - this.tabTarget.Controls.Add(this.label53); - this.tabTarget.Controls.Add(this.valMaxLosses); - this.tabTarget.Controls.Add(this.label52); - this.tabTarget.Controls.Add(this.valTimeInStage); - this.tabTarget.Controls.Add(this.label45); - this.tabTarget.Controls.Add(this.valLosses); - this.tabTarget.Controls.Add(this.label43); - this.tabTarget.Controls.Add(this.cboTargetToStage); - this.tabTarget.Controls.Add(this.label41); - this.tabTarget.Controls.Add(this.label21); - this.tabTarget.Controls.Add(this.label6); - this.tabTarget.Controls.Add(this.label5); - this.tabTarget.Controls.Add(this.label25); - this.tabTarget.Controls.Add(this.cboTargetHand); - this.tabTarget.Controls.Add(this.cboLineTarget); - this.tabTarget.Controls.Add(this.label29); - this.tabTarget.Controls.Add(this.cboLineFilter); - this.tabTarget.Controls.Add(this.cboTargetStage); - this.tabTarget.Location = new System.Drawing.Point(4, 22); - this.tabTarget.Name = "tabTarget"; - this.tabTarget.Padding = new System.Windows.Forms.Padding(3); - this.tabTarget.Size = new System.Drawing.Size(662, 185); - this.tabTarget.TabIndex = 0; - this.tabTarget.Text = "Target"; - this.tabTarget.UseVisualStyleBackColor = true; - // - // markerTarget - // - this.markerTarget.Location = new System.Drawing.Point(81, 154); - this.markerTarget.Name = "markerTarget"; - this.markerTarget.Size = new System.Drawing.Size(242, 23); - this.markerTarget.TabIndex = 94; - this.markerTarget.Value = null; - // - // label76 - // - this.label76.AutoSize = true; - this.label76.Location = new System.Drawing.Point(517, 22); - this.label76.Name = "label76"; - this.label76.Size = new System.Drawing.Size(19, 13); - this.label76.TabIndex = 12; - this.label76.Text = "to:"; - // - // valMaxStartingLayers - // - this.valMaxStartingLayers.Location = new System.Drawing.Point(542, 20); - this.valMaxStartingLayers.Name = "valMaxStartingLayers"; - this.valMaxStartingLayers.Size = new System.Drawing.Size(43, 20); - this.valMaxStartingLayers.TabIndex = 13; - // - // valStartingLayers - // - this.valStartingLayers.Location = new System.Drawing.Point(468, 20); - this.valStartingLayers.Name = "valStartingLayers"; - this.valStartingLayers.Size = new System.Drawing.Size(43, 20); - this.valStartingLayers.TabIndex = 11; - // - // lblTargetStartingLayers - // - this.lblTargetStartingLayers.AutoSize = true; - this.lblTargetStartingLayers.Location = new System.Drawing.Point(344, 22); - this.lblTargetStartingLayers.Name = "lblTargetStartingLayers"; - this.lblTargetStartingLayers.Size = new System.Drawing.Size(76, 13); - this.lblTargetStartingLayers.TabIndex = 10; - this.lblTargetStartingLayers.Text = "Starting layers:"; - // - // ckbTargetStatusNegated - // - this.ckbTargetStatusNegated.AutoSize = true; - this.ckbTargetStatusNegated.Location = new System.Drawing.Point(81, 75); - this.ckbTargetStatusNegated.Name = "ckbTargetStatusNegated"; - this.ckbTargetStatusNegated.Size = new System.Drawing.Size(43, 17); - this.ckbTargetStatusNegated.TabIndex = 31; - this.ckbTargetStatusNegated.Text = "Not"; - this.ckbTargetStatusNegated.UseVisualStyleBackColor = true; - // - // valMaxLayers - // - this.valMaxLayers.Location = new System.Drawing.Point(542, 74); - this.valMaxLayers.Name = "valMaxLayers"; - this.valMaxLayers.Size = new System.Drawing.Size(43, 20); - this.valMaxLayers.TabIndex = 43; - // - // label74 - // - this.label74.AutoSize = true; - this.label74.Location = new System.Drawing.Point(517, 76); - this.label74.Name = "label74"; - this.label74.Size = new System.Drawing.Size(19, 13); - this.label74.TabIndex = 42; - this.label74.Text = "to:"; - // - // valLayers - // - this.valLayers.Location = new System.Drawing.Point(468, 74); - this.valLayers.Name = "valLayers"; - this.valLayers.Size = new System.Drawing.Size(43, 20); - this.valLayers.TabIndex = 41; - // - // lblTargetLayers - // - this.lblTargetLayers.AutoSize = true; - this.lblTargetLayers.Location = new System.Drawing.Point(344, 76); - this.lblTargetLayers.Name = "lblTargetLayers"; - this.lblTargetLayers.Size = new System.Drawing.Size(58, 13); - this.lblTargetLayers.TabIndex = 40; - this.lblTargetLayers.Text = "Layers left:"; - // - // cboTargetNotMarker - // - this.cboTargetNotMarker.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.cboTargetNotMarker.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.cboTargetNotMarker.FormattingEnabled = true; - this.cboTargetNotMarker.Location = new System.Drawing.Point(416, 154); - this.cboTargetNotMarker.Name = "cboTargetNotMarker"; - this.cboTargetNotMarker.Size = new System.Drawing.Size(209, 21); - this.cboTargetNotMarker.TabIndex = 93; - // - // label72 - // - this.label72.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label72.AutoSize = true; - this.label72.Location = new System.Drawing.Point(344, 157); - this.label72.Name = "label72"; - this.label72.Size = new System.Drawing.Size(49, 13); - this.label72.TabIndex = 92; - this.label72.Text = "Not said:"; - // - // cboTargetStatus - // - this.cboTargetStatus.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.cboTargetStatus.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.cboTargetStatus.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboTargetStatus.FormattingEnabled = true; - this.cboTargetStatus.Location = new System.Drawing.Point(130, 72); - this.cboTargetStatus.Name = "cboTargetStatus"; - this.cboTargetStatus.Size = new System.Drawing.Size(193, 21); - this.cboTargetStatus.TabIndex = 32; - // - // label75 - // - this.label75.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label75.AutoSize = true; - this.label75.Location = new System.Drawing.Point(6, 76); - this.label75.Name = "label75"; - this.label75.Size = new System.Drawing.Size(40, 13); - this.label75.TabIndex = 30; - this.label75.Text = "Status:"; - // - // label66 - // - this.label66.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label66.AutoSize = true; - this.label66.Location = new System.Drawing.Point(6, 157); - this.label66.Name = "label66"; - this.label66.Size = new System.Drawing.Size(66, 13); - this.label66.TabIndex = 90; - this.label66.Text = "Said marker:"; - // - // valMaxTimeInStage - // - this.valMaxTimeInStage.Location = new System.Drawing.Point(542, 128); - this.valMaxTimeInStage.Name = "valMaxTimeInStage"; - this.valMaxTimeInStage.Size = new System.Drawing.Size(43, 20); - this.valMaxTimeInStage.TabIndex = 83; - // - // label53 - // - this.label53.AutoSize = true; - this.label53.Location = new System.Drawing.Point(517, 130); - this.label53.Name = "label53"; - this.label53.Size = new System.Drawing.Size(19, 13); - this.label53.TabIndex = 82; - this.label53.Text = "to:"; - // - // valMaxLosses - // - this.valMaxLosses.Location = new System.Drawing.Point(542, 101); - this.valMaxLosses.Name = "valMaxLosses"; - this.valMaxLosses.Size = new System.Drawing.Size(43, 20); - this.valMaxLosses.TabIndex = 63; - // - // label52 - // - this.label52.AutoSize = true; - this.label52.Location = new System.Drawing.Point(517, 103); - this.label52.Name = "label52"; - this.label52.Size = new System.Drawing.Size(19, 13); - this.label52.TabIndex = 62; - this.label52.Text = "to:"; - // - // valTimeInStage - // - this.valTimeInStage.Location = new System.Drawing.Point(468, 128); - this.valTimeInStage.Name = "valTimeInStage"; - this.valTimeInStage.Size = new System.Drawing.Size(43, 20); - this.valTimeInStage.TabIndex = 81; - // - // label45 - // - this.label45.AutoSize = true; - this.label45.Location = new System.Drawing.Point(344, 130); - this.label45.Name = "label45"; - this.label45.Size = new System.Drawing.Size(87, 13); - this.label45.TabIndex = 80; - this.label45.Text = "Rounds in stage:"; - // - // valLosses - // - this.valLosses.Location = new System.Drawing.Point(468, 101); - this.valLosses.Name = "valLosses"; - this.valLosses.Size = new System.Drawing.Size(43, 20); - this.valLosses.TabIndex = 61; - // - // label43 - // - this.label43.AutoSize = true; - this.label43.Location = new System.Drawing.Point(344, 103); - this.label43.Name = "label43"; - this.label43.Size = new System.Drawing.Size(101, 13); - this.label43.TabIndex = 60; - this.label43.Text = "Consecutive losses:"; - // - // cboTargetToStage - // - this.cboTargetToStage.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.cboTargetToStage.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.cboTargetToStage.FormattingEnabled = true; - this.cboTargetToStage.Location = new System.Drawing.Point(373, 46); - this.cboTargetToStage.Name = "cboTargetToStage"; - this.cboTargetToStage.Size = new System.Drawing.Size(252, 21); - this.cboTargetToStage.TabIndex = 23; - // - // label41 - // - this.label41.AutoSize = true; - this.label41.Location = new System.Drawing.Point(344, 49); - this.label41.Name = "label41"; - this.label41.Size = new System.Drawing.Size(23, 13); - this.label41.TabIndex = 22; - this.label41.Text = "To:"; - // - // label21 - // - this.label21.AutoSize = true; - this.label21.Location = new System.Drawing.Point(6, 3); - this.label21.Name = "label21"; - this.label21.Size = new System.Drawing.Size(308, 13); - this.label21.TabIndex = 26; - this.label21.Text = "Targets the player the action belongs to (ex. the player who lost)"; - // - // label6 - // - this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(6, 130); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(29, 13); - this.label6.TabIndex = 70; - this.label6.Text = "Tag:"; - // - // label5 - // - this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(6, 22); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(39, 13); - this.label5.TabIndex = 0; - this.label5.Text = "Player:"; - // - // label25 - // - this.label25.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label25.AutoSize = true; - this.label25.Location = new System.Drawing.Point(6, 103); - this.label25.Name = "label25"; - this.label25.Size = new System.Drawing.Size(36, 13); - this.label25.TabIndex = 50; - this.label25.Text = "Hand:"; - // - // cboTargetHand - // - this.cboTargetHand.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboTargetHand.FormattingEnabled = true; - this.cboTargetHand.Items.AddRange(new object[] { - "", - "Nothing", - "High Card", - "One Pair", - "Two Pair", - "Three of a Kind", - "Straight", - "Flush", - "Full House", - "Four of a Kind", - "Straight Flush", - "Royal Flush"}); - this.cboTargetHand.Location = new System.Drawing.Point(81, 100); - this.cboTargetHand.Name = "cboTargetHand"; - this.cboTargetHand.Size = new System.Drawing.Size(242, 21); - this.cboTargetHand.TabIndex = 51; - // - // cboLineTarget - // - this.cboLineTarget.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.cboLineTarget.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.cboLineTarget.FormattingEnabled = true; - this.cboLineTarget.Location = new System.Drawing.Point(81, 19); - this.cboLineTarget.Name = "cboLineTarget"; - this.cboLineTarget.Size = new System.Drawing.Size(242, 21); - this.cboLineTarget.TabIndex = 1; - this.cboLineTarget.SelectedIndexChanged += new System.EventHandler(this.cboLineTarget_SelectedIndexChanged); - // - // label29 - // - this.label29.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label29.AutoSize = true; - this.label29.Location = new System.Drawing.Point(6, 49); - this.label29.Name = "label29"; - this.label29.Size = new System.Drawing.Size(62, 13); - this.label29.TabIndex = 20; - this.label29.Text = "From stage:"; - // - // cboLineFilter - // - this.cboLineFilter.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.cboLineFilter.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.cboLineFilter.FormattingEnabled = true; - this.cboLineFilter.Location = new System.Drawing.Point(81, 127); - this.cboLineFilter.Name = "cboLineFilter"; - this.cboLineFilter.Size = new System.Drawing.Size(242, 21); - this.cboLineFilter.TabIndex = 71; - // - // cboTargetStage - // - this.cboTargetStage.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.cboTargetStage.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.cboTargetStage.FormattingEnabled = true; - this.cboTargetStage.Location = new System.Drawing.Point(81, 46); - this.cboTargetStage.Name = "cboTargetStage"; - this.cboTargetStage.Size = new System.Drawing.Size(242, 21); - this.cboTargetStage.TabIndex = 21; - // - // tabOther - // - this.tabOther.Controls.Add(this.markerAlsoPlaying); - this.tabOther.Controls.Add(this.cboAlsoPlayingNotMarker); - this.tabOther.Controls.Add(this.label71); - this.tabOther.Controls.Add(this.label67); - this.tabOther.Controls.Add(this.valMaxAlsoTimeInStage); - this.tabOther.Controls.Add(this.label54); - this.tabOther.Controls.Add(this.valAlsoTimeInStage); - this.tabOther.Controls.Add(this.label44); - this.tabOther.Controls.Add(this.cboAlsoPlayingMaxStage); - this.tabOther.Controls.Add(this.label38); - this.tabOther.Controls.Add(this.label36); - this.tabOther.Controls.Add(this.cboAlsoPlaying); - this.tabOther.Controls.Add(this.label27); - this.tabOther.Controls.Add(this.cboAlsoPlayingStage); - this.tabOther.Controls.Add(this.cboAlsoPlayingHand); - this.tabOther.Controls.Add(this.label30); - this.tabOther.Controls.Add(this.label28); - this.tabOther.Location = new System.Drawing.Point(4, 22); - this.tabOther.Name = "tabOther"; - this.tabOther.Padding = new System.Windows.Forms.Padding(3); - this.tabOther.Size = new System.Drawing.Size(662, 185); - this.tabOther.TabIndex = 1; - this.tabOther.Text = "Other Player"; - this.tabOther.UseVisualStyleBackColor = true; - // - // markerAlsoPlaying - // - this.markerAlsoPlaying.Location = new System.Drawing.Point(99, 126); - this.markerAlsoPlaying.Name = "markerAlsoPlaying"; - this.markerAlsoPlaying.Size = new System.Drawing.Size(226, 23); - this.markerAlsoPlaying.TabIndex = 46; - this.markerAlsoPlaying.Value = null; - // - // cboAlsoPlayingNotMarker - // - this.cboAlsoPlayingNotMarker.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.cboAlsoPlayingNotMarker.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.cboAlsoPlayingNotMarker.FormattingEnabled = true; - this.cboAlsoPlayingNotMarker.Location = new System.Drawing.Point(418, 126); - this.cboAlsoPlayingNotMarker.Name = "cboAlsoPlayingNotMarker"; - this.cboAlsoPlayingNotMarker.Size = new System.Drawing.Size(207, 21); - this.cboAlsoPlayingNotMarker.TabIndex = 45; - // - // label71 - // - this.label71.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label71.AutoSize = true; - this.label71.Location = new System.Drawing.Point(325, 129); - this.label71.Name = "label71"; - this.label71.Size = new System.Drawing.Size(84, 13); - this.label71.TabIndex = 44; - this.label71.Text = "Not said marker:"; - // - // label67 - // - this.label67.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label67.AutoSize = true; - this.label67.Location = new System.Drawing.Point(6, 129); - this.label67.Name = "label67"; - this.label67.Size = new System.Drawing.Size(66, 13); - this.label67.TabIndex = 42; - this.label67.Text = "Said marker:"; - // - // valMaxAlsoTimeInStage - // - this.valMaxAlsoTimeInStage.Location = new System.Drawing.Point(195, 100); - this.valMaxAlsoTimeInStage.Name = "valMaxAlsoTimeInStage"; - this.valMaxAlsoTimeInStage.Size = new System.Drawing.Size(65, 20); - this.valMaxAlsoTimeInStage.TabIndex = 33; - // - // label54 - // - this.label54.AutoSize = true; - this.label54.Location = new System.Drawing.Point(170, 102); - this.label54.Name = "label54"; - this.label54.Size = new System.Drawing.Size(19, 13); - this.label54.TabIndex = 32; - this.label54.Text = "to:"; - // - // valAlsoTimeInStage - // - this.valAlsoTimeInStage.Location = new System.Drawing.Point(99, 100); - this.valAlsoTimeInStage.Name = "valAlsoTimeInStage"; - this.valAlsoTimeInStage.Size = new System.Drawing.Size(65, 20); - this.valAlsoTimeInStage.TabIndex = 31; - // - // label44 - // - this.label44.AutoSize = true; - this.label44.Location = new System.Drawing.Point(6, 102); - this.label44.Name = "label44"; - this.label44.Size = new System.Drawing.Size(87, 13); - this.label44.TabIndex = 30; - this.label44.Text = "Rounds in stage:"; - // - // cboAlsoPlayingMaxStage - // - this.cboAlsoPlayingMaxStage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.cboAlsoPlayingMaxStage.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.cboAlsoPlayingMaxStage.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.cboAlsoPlayingMaxStage.FormattingEnabled = true; - this.cboAlsoPlayingMaxStage.Location = new System.Drawing.Point(373, 46); - this.cboAlsoPlayingMaxStage.Name = "cboAlsoPlayingMaxStage"; - this.cboAlsoPlayingMaxStage.Size = new System.Drawing.Size(252, 21); - this.cboAlsoPlayingMaxStage.TabIndex = 6; - // - // label38 - // - this.label38.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.label38.AutoSize = true; - this.label38.Location = new System.Drawing.Point(344, 49); - this.label38.Name = "label38"; - this.label38.Size = new System.Drawing.Size(23, 13); - this.label38.TabIndex = 29; - this.label38.Text = "To:"; - // - // label36 - // - this.label36.AutoSize = true; - this.label36.Location = new System.Drawing.Point(6, 3); - this.label36.Name = "label36"; - this.label36.Size = new System.Drawing.Size(255, 13); - this.label36.TabIndex = 28; - this.label36.Text = "Targets a player other than the one taking the action"; - // - // cboAlsoPlaying - // - this.cboAlsoPlaying.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.cboAlsoPlaying.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.cboAlsoPlaying.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.cboAlsoPlaying.FormattingEnabled = true; - this.cboAlsoPlaying.Location = new System.Drawing.Point(99, 19); - this.cboAlsoPlaying.Name = "cboAlsoPlaying"; - this.cboAlsoPlaying.Size = new System.Drawing.Size(526, 21); - this.cboAlsoPlaying.TabIndex = 4; - this.cboAlsoPlaying.SelectedIndexChanged += new System.EventHandler(this.cboAlsoPlaying_SelectedIndexChanged); - // - // label27 - // - this.label27.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label27.AutoSize = true; - this.label27.Location = new System.Drawing.Point(6, 22); - this.label27.Name = "label27"; - this.label27.Size = new System.Drawing.Size(39, 13); - this.label27.TabIndex = 20; - this.label27.Text = "Player:"; - // - // cboAlsoPlayingStage - // - this.cboAlsoPlayingStage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.cboAlsoPlayingStage.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.cboAlsoPlayingStage.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.cboAlsoPlayingStage.FormattingEnabled = true; - this.cboAlsoPlayingStage.Location = new System.Drawing.Point(99, 46); - this.cboAlsoPlayingStage.Name = "cboAlsoPlayingStage"; - this.cboAlsoPlayingStage.Size = new System.Drawing.Size(224, 21); - this.cboAlsoPlayingStage.TabIndex = 5; - // - // cboAlsoPlayingHand - // - this.cboAlsoPlayingHand.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.cboAlsoPlayingHand.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboAlsoPlayingHand.FormattingEnabled = true; - this.cboAlsoPlayingHand.Items.AddRange(new object[] { - "", - "Nothing", - "High Card", - "One Pair", - "Two Pair", - "Three of a Kind", - "Straight", - "Flush", - "Full House", - "Four of a Kind", - "Straight Flush", - "Royal Flush"}); - this.cboAlsoPlayingHand.Location = new System.Drawing.Point(99, 73); - this.cboAlsoPlayingHand.Name = "cboAlsoPlayingHand"; - this.cboAlsoPlayingHand.Size = new System.Drawing.Size(526, 21); - this.cboAlsoPlayingHand.TabIndex = 7; - // - // label30 - // - this.label30.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label30.AutoSize = true; - this.label30.Location = new System.Drawing.Point(6, 76); - this.label30.Name = "label30"; - this.label30.Size = new System.Drawing.Size(36, 13); - this.label30.TabIndex = 26; - this.label30.Text = "Hand:"; - // - // label28 - // - this.label28.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label28.AutoSize = true; - this.label28.Location = new System.Drawing.Point(6, 49); - this.label28.Name = "label28"; - this.label28.Size = new System.Drawing.Size(62, 13); - this.label28.TabIndex = 22; - this.label28.Text = "From stage:"; - // - // tabConditions - // - this.tabConditions.Controls.Add(this.gridFilters); - this.tabConditions.Location = new System.Drawing.Point(4, 22); - this.tabConditions.Name = "tabConditions"; - this.tabConditions.Padding = new System.Windows.Forms.Padding(3); - this.tabConditions.Size = new System.Drawing.Size(662, 185); - this.tabConditions.TabIndex = 3; - this.tabConditions.Text = "Tag/gender/status counts"; - this.tabConditions.UseVisualStyleBackColor = true; - // - // gridFilters - // - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gridFilters.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; - this.gridFilters.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.gridFilters.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.ColTagFilter, - this.ColGenderFilter, - this.ColStatusFilterNegated, - this.ColStatusFilter, - this.ColFilterCount}); - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.gridFilters.DefaultCellStyle = dataGridViewCellStyle2; - this.gridFilters.Dock = System.Windows.Forms.DockStyle.Fill; - this.gridFilters.Location = new System.Drawing.Point(3, 3); - this.gridFilters.Name = "gridFilters"; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gridFilters.RowHeadersDefaultCellStyle = dataGridViewCellStyle3; - this.gridFilters.Size = new System.Drawing.Size(656, 179); - this.gridFilters.TabIndex = 0; - // - // ColTagFilter - // - this.ColTagFilter.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ColTagFilter.HeaderText = "Tag"; - this.ColTagFilter.Name = "ColTagFilter"; - this.ColTagFilter.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - // - // ColGenderFilter - // - this.ColGenderFilter.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ColGenderFilter.FillWeight = 80F; - this.ColGenderFilter.HeaderText = "Gender"; - this.ColGenderFilter.Items.AddRange(new object[] { - "", - "female", - "male"}); - this.ColGenderFilter.Name = "ColGenderFilter"; - // - // ColStatusFilterNegated - // - this.ColStatusFilterNegated.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - this.ColStatusFilterNegated.HeaderText = "Not"; - this.ColStatusFilterNegated.Name = "ColStatusFilterNegated"; - this.ColStatusFilterNegated.Width = 30; - // - // ColStatusFilter - // - this.ColStatusFilter.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ColStatusFilter.DropDownWidth = 2; - this.ColStatusFilter.HeaderText = "Status"; - this.ColStatusFilter.Name = "ColStatusFilter"; - // - // ColFilterCount - // - this.ColFilterCount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ColFilterCount.FillWeight = 80F; - this.ColFilterCount.HeaderText = "Required number"; - this.ColFilterCount.Name = "ColFilterCount"; - // - // tabSelf - // - this.tabSelf.Controls.Add(this.markerSelf); - this.tabSelf.Controls.Add(this.cboNotMarker); - this.tabSelf.Controls.Add(this.label70); - this.tabSelf.Controls.Add(this.cboOwnHand); - this.tabSelf.Controls.Add(this.label26); - this.tabSelf.Controls.Add(this.label69); - this.tabSelf.Controls.Add(this.valMaxOwnTimeInStage); - this.tabSelf.Controls.Add(this.label63); - this.tabSelf.Controls.Add(this.valMaxOwnLosses); - this.tabSelf.Controls.Add(this.label57); - this.tabSelf.Controls.Add(this.valOwnLosses); - this.tabSelf.Controls.Add(this.label51); - this.tabSelf.Controls.Add(this.valOwnTimeInStage); - this.tabSelf.Controls.Add(this.label42); - this.tabSelf.Controls.Add(this.label68); - this.tabSelf.Location = new System.Drawing.Point(4, 22); - this.tabSelf.Name = "tabSelf"; - this.tabSelf.Padding = new System.Windows.Forms.Padding(3); - this.tabSelf.Size = new System.Drawing.Size(662, 185); - this.tabSelf.TabIndex = 4; - this.tabSelf.Text = "Self"; - this.tabSelf.UseVisualStyleBackColor = true; - // - // markerSelf - // - this.markerSelf.Location = new System.Drawing.Point(115, 45); - this.markerSelf.Name = "markerSelf"; - this.markerSelf.Size = new System.Drawing.Size(200, 23); - this.markerSelf.TabIndex = 68; - this.markerSelf.Value = null; - // - // cboNotMarker - // - this.cboNotMarker.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.cboNotMarker.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.cboNotMarker.FormattingEnabled = true; - this.cboNotMarker.Location = new System.Drawing.Point(428, 45); - this.cboNotMarker.Name = "cboNotMarker"; - this.cboNotMarker.Size = new System.Drawing.Size(197, 21); - this.cboNotMarker.TabIndex = 61; - // - // label70 - // - this.label70.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label70.AutoSize = true; - this.label70.Location = new System.Drawing.Point(321, 48); - this.label70.Name = "label70"; - this.label70.Size = new System.Drawing.Size(84, 13); - this.label70.TabIndex = 67; - this.label70.Text = "Not said marker:"; - // - // cboOwnHand - // - this.cboOwnHand.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.cboOwnHand.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboOwnHand.FormattingEnabled = true; - this.cboOwnHand.Items.AddRange(new object[] { - "", - "Nothing", - "High Card", - "One Pair", - "Two Pair", - "Three of a Kind", - "Straight", - "Flush", - "Full House", - "Four of a Kind", - "Straight Flush", - "Royal Flush"}); - this.cboOwnHand.Location = new System.Drawing.Point(115, 72); - this.cboOwnHand.Name = "cboOwnHand"; - this.cboOwnHand.Size = new System.Drawing.Size(200, 21); - this.cboOwnHand.TabIndex = 62; - // - // label26 - // - this.label26.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label26.AutoSize = true; - this.label26.Location = new System.Drawing.Point(6, 75); - this.label26.Name = "label26"; - this.label26.Size = new System.Drawing.Size(59, 13); - this.label26.TabIndex = 66; - this.label26.Text = "Own hand:"; - // - // label69 - // - this.label69.AutoSize = true; - this.label69.Location = new System.Drawing.Point(6, 3); - this.label69.Name = "label69"; - this.label69.Size = new System.Drawing.Size(147, 13); - this.label69.TabIndex = 64; - this.label69.Text = "Targets this own player\'s data"; - // - // valMaxOwnTimeInStage - // - this.valMaxOwnTimeInStage.Location = new System.Drawing.Point(195, 19); - this.valMaxOwnTimeInStage.Name = "valMaxOwnTimeInStage"; - this.valMaxOwnTimeInStage.Size = new System.Drawing.Size(54, 20); - this.valMaxOwnTimeInStage.TabIndex = 57; - // - // label63 - // - this.label63.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label63.AutoSize = true; - this.label63.Location = new System.Drawing.Point(175, 21); - this.label63.Name = "label63"; - this.label63.Size = new System.Drawing.Size(19, 13); - this.label63.TabIndex = 63; - this.label63.Text = "to:"; - // - // valMaxOwnLosses - // - this.valMaxOwnLosses.Location = new System.Drawing.Point(513, 19); - this.valMaxOwnLosses.Name = "valMaxOwnLosses"; - this.valMaxOwnLosses.Size = new System.Drawing.Size(54, 20); - this.valMaxOwnLosses.TabIndex = 59; - // - // label57 - // - this.label57.AutoSize = true; - this.label57.Location = new System.Drawing.Point(488, 21); - this.label57.Name = "label57"; - this.label57.Size = new System.Drawing.Size(19, 13); - this.label57.TabIndex = 62; - this.label57.Text = "to:"; - // - // valOwnLosses - // - this.valOwnLosses.Location = new System.Drawing.Point(428, 19); - this.valOwnLosses.Name = "valOwnLosses"; - this.valOwnLosses.Size = new System.Drawing.Size(54, 20); - this.valOwnLosses.TabIndex = 58; - // - // label51 - // - this.label51.AutoSize = true; - this.label51.Location = new System.Drawing.Point(321, 21); - this.label51.Name = "label51"; - this.label51.Size = new System.Drawing.Size(101, 13); - this.label51.TabIndex = 61; - this.label51.Text = "Consecutive losses:"; - // - // valOwnTimeInStage - // - this.valOwnTimeInStage.Location = new System.Drawing.Point(115, 19); - this.valOwnTimeInStage.Name = "valOwnTimeInStage"; - this.valOwnTimeInStage.Size = new System.Drawing.Size(54, 20); - this.valOwnTimeInStage.TabIndex = 56; - // - // label42 - // - this.label42.AutoSize = true; - this.label42.Location = new System.Drawing.Point(6, 21); - this.label42.Name = "label42"; - this.label42.Size = new System.Drawing.Size(87, 13); - this.label42.TabIndex = 60; - this.label42.Text = "Rounds in stage:"; - // - // label68 - // - this.label68.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label68.AutoSize = true; - this.label68.Location = new System.Drawing.Point(6, 48); - this.label68.Name = "label68"; - this.label68.Size = new System.Drawing.Size(66, 13); - this.label68.TabIndex = 45; - this.label68.Text = "Said marker:"; - // - // tabMisc - // - this.tabMisc.Controls.Add(this.valMaxGameRounds); - this.tabMisc.Controls.Add(this.label64); - this.tabMisc.Controls.Add(this.valGameRounds); - this.tabMisc.Controls.Add(this.label65); - this.tabMisc.Controls.Add(this.cboMaxTotalFinished); - this.tabMisc.Controls.Add(this.label62); - this.tabMisc.Controls.Add(this.cboMaxTotalFinishing); - this.tabMisc.Controls.Add(this.label61); - this.tabMisc.Controls.Add(this.cboMaxTotalNaked); - this.tabMisc.Controls.Add(this.label60); - this.tabMisc.Controls.Add(this.cboMaxTotalExposed); - this.tabMisc.Controls.Add(this.label59); - this.tabMisc.Controls.Add(this.cboMaxTotalPlaying); - this.tabMisc.Controls.Add(this.label58); - this.tabMisc.Controls.Add(this.cboMaxTotalMales); - this.tabMisc.Controls.Add(this.label56); - this.tabMisc.Controls.Add(this.cboMaxTotalFemales); - this.tabMisc.Controls.Add(this.label55); - this.tabMisc.Controls.Add(this.cboTotalFinished); - this.tabMisc.Controls.Add(this.label50); - this.tabMisc.Controls.Add(this.cboTotalFinishing); - this.tabMisc.Controls.Add(this.label49); - this.tabMisc.Controls.Add(this.cboTotalNaked); - this.tabMisc.Controls.Add(this.label48); - this.tabMisc.Controls.Add(this.cboTotalExposed); - this.tabMisc.Controls.Add(this.label47); - this.tabMisc.Controls.Add(this.cboTotalPlaying); - this.tabMisc.Controls.Add(this.label46); - this.tabMisc.Controls.Add(this.label37); - this.tabMisc.Controls.Add(this.label32); - this.tabMisc.Controls.Add(this.label31); - this.tabMisc.Controls.Add(this.cboTotalMales); - this.tabMisc.Controls.Add(this.cboTotalFemales); - this.tabMisc.Location = new System.Drawing.Point(4, 22); - this.tabMisc.Name = "tabMisc"; - this.tabMisc.Padding = new System.Windows.Forms.Padding(3); - this.tabMisc.Size = new System.Drawing.Size(662, 185); - this.tabMisc.TabIndex = 2; - this.tabMisc.Text = "Misc"; - this.tabMisc.UseVisualStyleBackColor = true; - // - // valMaxGameRounds - // - this.valMaxGameRounds.Location = new System.Drawing.Point(200, 46); - this.valMaxGameRounds.Name = "valMaxGameRounds"; - this.valMaxGameRounds.Size = new System.Drawing.Size(54, 20); - this.valMaxGameRounds.TabIndex = 6; - // - // label64 - // - this.label64.AutoSize = true; - this.label64.Location = new System.Drawing.Point(175, 48); - this.label64.Name = "label64"; - this.label64.Size = new System.Drawing.Size(19, 13); - this.label64.TabIndex = 59; - this.label64.Text = "to:"; - // - // valGameRounds - // - this.valGameRounds.Location = new System.Drawing.Point(115, 46); - this.valGameRounds.Name = "valGameRounds"; - this.valGameRounds.Size = new System.Drawing.Size(54, 20); - this.valGameRounds.TabIndex = 5; - // - // label65 - // - this.label65.AutoSize = true; - this.label65.Location = new System.Drawing.Point(8, 48); - this.label65.Name = "label65"; - this.label65.Size = new System.Drawing.Size(73, 13); - this.label65.TabIndex = 58; - this.label65.Text = "Game rounds:"; - // - // cboMaxTotalFinished - // - this.cboMaxTotalFinished.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboMaxTotalFinished.FormattingEnabled = true; - this.cboMaxTotalFinished.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboMaxTotalFinished.Location = new System.Drawing.Point(519, 97); - this.cboMaxTotalFinished.Name = "cboMaxTotalFinished"; - this.cboMaxTotalFinished.Size = new System.Drawing.Size(38, 21); - this.cboMaxTotalFinished.TabIndex = 18; - // - // label62 - // - this.label62.AutoSize = true; - this.label62.Location = new System.Drawing.Point(494, 100); - this.label62.Name = "label62"; - this.label62.Size = new System.Drawing.Size(19, 13); - this.label62.TabIndex = 53; - this.label62.Text = "to:"; - // - // cboMaxTotalFinishing - // - this.cboMaxTotalFinishing.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboMaxTotalFinishing.FormattingEnabled = true; - this.cboMaxTotalFinishing.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboMaxTotalFinishing.Location = new System.Drawing.Point(410, 97); - this.cboMaxTotalFinishing.Name = "cboMaxTotalFinishing"; - this.cboMaxTotalFinishing.Size = new System.Drawing.Size(38, 21); - this.cboMaxTotalFinishing.TabIndex = 16; - // - // label61 - // - this.label61.AutoSize = true; - this.label61.Location = new System.Drawing.Point(385, 100); - this.label61.Name = "label61"; - this.label61.Size = new System.Drawing.Size(19, 13); - this.label61.TabIndex = 51; - this.label61.Text = "to:"; - // - // cboMaxTotalNaked - // - this.cboMaxTotalNaked.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboMaxTotalNaked.FormattingEnabled = true; - this.cboMaxTotalNaked.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboMaxTotalNaked.Location = new System.Drawing.Point(279, 97); - this.cboMaxTotalNaked.Name = "cboMaxTotalNaked"; - this.cboMaxTotalNaked.Size = new System.Drawing.Size(38, 21); - this.cboMaxTotalNaked.TabIndex = 14; - // - // label60 - // - this.label60.AutoSize = true; - this.label60.Location = new System.Drawing.Point(254, 100); - this.label60.Name = "label60"; - this.label60.Size = new System.Drawing.Size(19, 13); - this.label60.TabIndex = 49; - this.label60.Text = "to:"; - // - // cboMaxTotalExposed - // - this.cboMaxTotalExposed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboMaxTotalExposed.FormattingEnabled = true; - this.cboMaxTotalExposed.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboMaxTotalExposed.Location = new System.Drawing.Point(177, 97); - this.cboMaxTotalExposed.Name = "cboMaxTotalExposed"; - this.cboMaxTotalExposed.Size = new System.Drawing.Size(38, 21); - this.cboMaxTotalExposed.TabIndex = 12; - // - // label59 - // - this.label59.AutoSize = true; - this.label59.Location = new System.Drawing.Point(152, 100); - this.label59.Name = "label59"; - this.label59.Size = new System.Drawing.Size(19, 13); - this.label59.TabIndex = 47; - this.label59.Text = "to:"; - // - // cboMaxTotalPlaying - // - this.cboMaxTotalPlaying.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboMaxTotalPlaying.FormattingEnabled = true; - this.cboMaxTotalPlaying.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboMaxTotalPlaying.Location = new System.Drawing.Point(68, 97); - this.cboMaxTotalPlaying.Name = "cboMaxTotalPlaying"; - this.cboMaxTotalPlaying.Size = new System.Drawing.Size(38, 21); - this.cboMaxTotalPlaying.TabIndex = 10; - // - // label58 - // - this.label58.AutoSize = true; - this.label58.Location = new System.Drawing.Point(43, 100); - this.label58.Name = "label58"; - this.label58.Size = new System.Drawing.Size(19, 13); - this.label58.TabIndex = 45; - this.label58.Text = "to:"; - // - // cboMaxTotalMales - // - this.cboMaxTotalMales.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboMaxTotalMales.FormattingEnabled = true; - this.cboMaxTotalMales.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboMaxTotalMales.Location = new System.Drawing.Point(435, 19); - this.cboMaxTotalMales.Name = "cboMaxTotalMales"; - this.cboMaxTotalMales.Size = new System.Drawing.Size(54, 21); - this.cboMaxTotalMales.TabIndex = 4; - // - // label56 - // - this.label56.AutoSize = true; - this.label56.Location = new System.Drawing.Point(410, 22); - this.label56.Name = "label56"; - this.label56.Size = new System.Drawing.Size(19, 13); - this.label56.TabIndex = 41; - this.label56.Text = "to:"; - // - // cboMaxTotalFemales - // - this.cboMaxTotalFemales.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboMaxTotalFemales.FormattingEnabled = true; - this.cboMaxTotalFemales.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboMaxTotalFemales.Location = new System.Drawing.Point(200, 19); - this.cboMaxTotalFemales.Name = "cboMaxTotalFemales"; - this.cboMaxTotalFemales.Size = new System.Drawing.Size(54, 21); - this.cboMaxTotalFemales.TabIndex = 2; - // - // label55 - // - this.label55.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label55.AutoSize = true; - this.label55.Location = new System.Drawing.Point(175, 22); - this.label55.Name = "label55"; - this.label55.Size = new System.Drawing.Size(19, 13); - this.label55.TabIndex = 39; - this.label55.Text = "to:"; - // - // cboTotalFinished - // - this.cboTotalFinished.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboTotalFinished.FormattingEnabled = true; - this.cboTotalFinished.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboTotalFinished.Location = new System.Drawing.Point(519, 73); - this.cboTotalFinished.Name = "cboTotalFinished"; - this.cboTotalFinished.Size = new System.Drawing.Size(38, 21); - this.cboTotalFinished.TabIndex = 17; - // - // label50 - // - this.label50.AutoSize = true; - this.label50.Location = new System.Drawing.Point(454, 76); - this.label50.Name = "label50"; - this.label50.Size = new System.Drawing.Size(59, 13); - this.label50.TabIndex = 35; - this.label50.Text = "# Finished:"; - // - // cboTotalFinishing - // - this.cboTotalFinishing.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboTotalFinishing.FormattingEnabled = true; - this.cboTotalFinishing.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboTotalFinishing.Location = new System.Drawing.Point(410, 73); - this.cboTotalFinishing.Name = "cboTotalFinishing"; - this.cboTotalFinishing.Size = new System.Drawing.Size(38, 21); - this.cboTotalFinishing.TabIndex = 15; - // - // label49 - // - this.label49.AutoSize = true; - this.label49.Location = new System.Drawing.Point(323, 76); - this.label49.Name = "label49"; - this.label49.Size = new System.Drawing.Size(81, 13); - this.label49.TabIndex = 33; - this.label49.Text = "# Masturbating:"; - // - // cboTotalNaked - // - this.cboTotalNaked.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboTotalNaked.FormattingEnabled = true; - this.cboTotalNaked.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboTotalNaked.Location = new System.Drawing.Point(279, 73); - this.cboTotalNaked.Name = "cboTotalNaked"; - this.cboTotalNaked.Size = new System.Drawing.Size(38, 21); - this.cboTotalNaked.TabIndex = 13; - // - // label48 - // - this.label48.AutoSize = true; - this.label48.Location = new System.Drawing.Point(221, 76); - this.label48.Name = "label48"; - this.label48.Size = new System.Drawing.Size(52, 13); - this.label48.TabIndex = 31; - this.label48.Text = "# Naked:"; - // - // cboTotalExposed - // - this.cboTotalExposed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboTotalExposed.FormattingEnabled = true; - this.cboTotalExposed.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboTotalExposed.Location = new System.Drawing.Point(177, 73); - this.cboTotalExposed.Name = "cboTotalExposed"; - this.cboTotalExposed.Size = new System.Drawing.Size(38, 21); - this.cboTotalExposed.TabIndex = 11; - // - // label47 - // - this.label47.AutoSize = true; - this.label47.Location = new System.Drawing.Point(110, 76); - this.label47.Name = "label47"; - this.label47.Size = new System.Drawing.Size(61, 13); - this.label47.TabIndex = 29; - this.label47.Text = "# Exposed:"; - // - // cboTotalPlaying - // - this.cboTotalPlaying.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboTotalPlaying.FormattingEnabled = true; - this.cboTotalPlaying.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboTotalPlaying.Location = new System.Drawing.Point(68, 73); - this.cboTotalPlaying.Name = "cboTotalPlaying"; - this.cboTotalPlaying.Size = new System.Drawing.Size(38, 21); - this.cboTotalPlaying.TabIndex = 9; - // - // label46 - // - this.label46.AutoSize = true; - this.label46.Location = new System.Drawing.Point(8, 76); - this.label46.Name = "label46"; - this.label46.Size = new System.Drawing.Size(54, 13); - this.label46.TabIndex = 27; - this.label46.Text = "# Playing:"; - // - // label37 - // - this.label37.AutoSize = true; - this.label37.Location = new System.Drawing.Point(6, 3); - this.label37.Name = "label37"; - this.label37.Size = new System.Drawing.Size(213, 13); - this.label37.TabIndex = 24; - this.label37.Text = "Conditions not targeting anyone in particular"; - // - // label32 - // - this.label32.AutoSize = true; - this.label32.Location = new System.Drawing.Point(276, 22); - this.label32.Name = "label32"; - this.label32.Size = new System.Drawing.Size(64, 13); - this.label32.TabIndex = 23; - this.label32.Text = "Total males:"; - // - // label31 - // - this.label31.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label31.AutoSize = true; - this.label31.Location = new System.Drawing.Point(6, 22); - this.label31.Name = "label31"; - this.label31.Size = new System.Drawing.Size(73, 13); - this.label31.TabIndex = 22; - this.label31.Text = "Total females:"; - // - // cboTotalMales - // - this.cboTotalMales.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboTotalMales.FormattingEnabled = true; - this.cboTotalMales.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboTotalMales.Location = new System.Drawing.Point(350, 19); - this.cboTotalMales.Name = "cboTotalMales"; - this.cboTotalMales.Size = new System.Drawing.Size(54, 21); - this.cboTotalMales.TabIndex = 3; - // - // cboTotalFemales - // - this.cboTotalFemales.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboTotalFemales.FormattingEnabled = true; - this.cboTotalFemales.Items.AddRange(new object[] { - "", - "0", - "1", - "2", - "3", - "4", - "5"}); - this.cboTotalFemales.Location = new System.Drawing.Point(115, 19); - this.cboTotalFemales.Name = "cboTotalFemales"; - this.cboTotalFemales.Size = new System.Drawing.Size(54, 21); - this.cboTotalFemales.TabIndex = 1; - // // tableConditions // this.tableConditions.AllowDelete = true; @@ -1795,6 +385,7 @@ namespace SPNATI_Character_Editor.Activities this.tableConditions.RemoveCaption = "Remove condition"; this.tableConditions.RowHeaderWidth = 0F; this.tableConditions.Size = new System.Drawing.Size(670, 208); + this.tableConditions.Sorted = false; this.tableConditions.TabIndex = 31; this.tableConditions.UseAutoComplete = true; // @@ -1817,38 +408,16 @@ namespace SPNATI_Character_Editor.Activities this.splitDialogue.ResumeLayout(false); this.grpCase.ResumeLayout(false); this.grpCase.PerformLayout(); + this.tabs.ResumeLayout(false); + this.tabDialogue.ResumeLayout(false); + this.tabDialogue.PerformLayout(); + this.tabNotes.ResumeLayout(false); + this.tabNotes.PerformLayout(); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); this.grpConditions.ResumeLayout(false); this.grpConditions.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.valPriority)).EndInit(); - this.tabControlConditions.ResumeLayout(false); - this.tabTarget.ResumeLayout(false); - this.tabTarget.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxStartingLayers)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.valStartingLayers)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxLayers)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.valLayers)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxTimeInStage)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxLosses)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.valTimeInStage)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.valLosses)).EndInit(); - this.tabOther.ResumeLayout(false); - this.tabOther.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxAlsoTimeInStage)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.valAlsoTimeInStage)).EndInit(); - this.tabConditions.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.gridFilters)).EndInit(); - this.tabSelf.ResumeLayout(false); - this.tabSelf.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxOwnTimeInStage)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxOwnLosses)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.valOwnLosses)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.valOwnTimeInStage)).EndInit(); - this.tabMisc.ResumeLayout(false); - this.tabMisc.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.valMaxGameRounds)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.valGameRounds)).EndInit(); this.ResumeLayout(false); } @@ -1857,138 +426,30 @@ namespace SPNATI_Character_Editor.Activities private System.Windows.Forms.SplitContainer splitDialogue; private System.Windows.Forms.GroupBox grpCase; - private System.Windows.Forms.CheckBox ckbShowBubbleColumns; + private System.Windows.Forms.CheckBox ckbShowAdvanced; private Controls.DialogueGrid gridDialogue; private System.Windows.Forms.Label lblHelpText; private System.Windows.Forms.Button cmdPasteAll; private System.Windows.Forms.Button cmdCopyAll; private System.Windows.Forms.ComboBox cboCaseTags; private System.Windows.Forms.Label label34; - private System.Windows.Forms.Label label8; private System.Windows.Forms.Label lblAvailableVars; private System.Windows.Forms.GroupBox groupBox3; private System.Windows.Forms.CheckBox chkSelectAll; private System.Windows.Forms.FlowLayoutPanel flowStageChecks; private System.Windows.Forms.GroupBox grpConditions; - private System.Windows.Forms.TabControl tabControlConditions; - private System.Windows.Forms.TabPage tabTarget; - private System.Windows.Forms.ComboBox cboTargetNotMarker; - private System.Windows.Forms.Label label72; - private System.Windows.Forms.Label label66; - private System.Windows.Forms.NumericUpDown valMaxTimeInStage; - private System.Windows.Forms.Label label53; - private System.Windows.Forms.NumericUpDown valMaxLosses; - private System.Windows.Forms.Label label52; - private System.Windows.Forms.NumericUpDown valTimeInStage; - private System.Windows.Forms.Label label45; - private System.Windows.Forms.NumericUpDown valLosses; - private System.Windows.Forms.Label label43; - private System.Windows.Forms.ComboBox cboTargetToStage; - private System.Windows.Forms.Label label41; - private System.Windows.Forms.Label label21; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label25; - private System.Windows.Forms.ComboBox cboTargetHand; - private System.Windows.Forms.ComboBox cboLineTarget; - private System.Windows.Forms.Label label29; - private System.Windows.Forms.ComboBox cboTargetStage; - private System.Windows.Forms.ComboBox cboLineFilter; - private System.Windows.Forms.TabPage tabOther; - private System.Windows.Forms.ComboBox cboAlsoPlayingNotMarker; - private System.Windows.Forms.Label label71; - private System.Windows.Forms.Label label67; - private System.Windows.Forms.NumericUpDown valMaxAlsoTimeInStage; - private System.Windows.Forms.Label label54; - private System.Windows.Forms.NumericUpDown valAlsoTimeInStage; - private System.Windows.Forms.Label label44; - private System.Windows.Forms.ComboBox cboAlsoPlayingMaxStage; - private System.Windows.Forms.Label label38; - private System.Windows.Forms.Label label36; - private System.Windows.Forms.ComboBox cboAlsoPlaying; - private System.Windows.Forms.Label label27; - private System.Windows.Forms.ComboBox cboAlsoPlayingStage; - private System.Windows.Forms.ComboBox cboAlsoPlayingHand; - private System.Windows.Forms.Label label30; - private System.Windows.Forms.Label label28; - private System.Windows.Forms.TabPage tabConditions; - private System.Windows.Forms.DataGridView gridFilters; - private System.Windows.Forms.DataGridViewComboBoxColumn ColTagFilter; - private System.Windows.Forms.DataGridViewComboBoxColumn ColGenderFilter; - private System.Windows.Forms.DataGridViewCheckBoxColumn ColStatusFilterNegated; - private System.Windows.Forms.DataGridViewComboBoxColumn ColStatusFilter; - private System.Windows.Forms.DataGridViewTextBoxColumn ColFilterCount; - private System.Windows.Forms.TabPage tabSelf; - private System.Windows.Forms.ComboBox cboNotMarker; - private System.Windows.Forms.Label label70; - private System.Windows.Forms.ComboBox cboOwnHand; - private System.Windows.Forms.Label label26; - private System.Windows.Forms.Label label69; - private System.Windows.Forms.NumericUpDown valMaxOwnTimeInStage; - private System.Windows.Forms.Label label63; - private System.Windows.Forms.NumericUpDown valMaxOwnLosses; - private System.Windows.Forms.Label label57; - private System.Windows.Forms.NumericUpDown valOwnLosses; - private System.Windows.Forms.Label label51; - private System.Windows.Forms.NumericUpDown valOwnTimeInStage; - private System.Windows.Forms.Label label42; - private System.Windows.Forms.Label label68; - private System.Windows.Forms.TabPage tabMisc; private System.Windows.Forms.NumericUpDown valPriority; private System.Windows.Forms.Label label73; - private System.Windows.Forms.NumericUpDown valMaxGameRounds; - private System.Windows.Forms.Label label64; - private System.Windows.Forms.NumericUpDown valGameRounds; - private System.Windows.Forms.Label label65; - private System.Windows.Forms.ComboBox cboMaxTotalFinished; - private System.Windows.Forms.Label label62; - private System.Windows.Forms.ComboBox cboMaxTotalFinishing; - private System.Windows.Forms.Label label61; - private System.Windows.Forms.ComboBox cboMaxTotalNaked; - private System.Windows.Forms.Label label60; - private System.Windows.Forms.ComboBox cboMaxTotalExposed; - private System.Windows.Forms.Label label59; - private System.Windows.Forms.ComboBox cboMaxTotalPlaying; - private System.Windows.Forms.Label label58; - private System.Windows.Forms.ComboBox cboMaxTotalMales; - private System.Windows.Forms.Label label56; - private System.Windows.Forms.ComboBox cboMaxTotalFemales; - private System.Windows.Forms.Label label55; - private System.Windows.Forms.ComboBox cboTotalFinished; - private System.Windows.Forms.Label label50; - private System.Windows.Forms.ComboBox cboTotalFinishing; - private System.Windows.Forms.Label label49; - private System.Windows.Forms.ComboBox cboTotalNaked; - private System.Windows.Forms.Label label48; - private System.Windows.Forms.ComboBox cboTotalExposed; - private System.Windows.Forms.Label label47; - private System.Windows.Forms.ComboBox cboTotalPlaying; - private System.Windows.Forms.Label label46; - private System.Windows.Forms.Label label37; - private System.Windows.Forms.Label label32; - private System.Windows.Forms.Label label31; - private System.Windows.Forms.ComboBox cboTotalMales; - private System.Windows.Forms.ComboBox cboTotalFemales; private System.Windows.Forms.ContextMenuStrip triggerMenu; - private System.Windows.Forms.NumericUpDown valMaxLayers; - private System.Windows.Forms.Label label74; - private System.Windows.Forms.NumericUpDown valLayers; - private System.Windows.Forms.Label lblTargetLayers; - private System.Windows.Forms.ComboBox cboTargetStatus; - private System.Windows.Forms.Label label75; - private System.Windows.Forms.CheckBox ckbTargetStatusNegated; - private System.Windows.Forms.NumericUpDown valMaxStartingLayers; - private System.Windows.Forms.NumericUpDown valStartingLayers; - private System.Windows.Forms.Label lblTargetStartingLayers; - private System.Windows.Forms.Label label76; - private Controls.MarkerConditionField markerSelf; - private Controls.MarkerConditionField markerTarget; - private Controls.MarkerConditionField markerAlsoPlaying; private System.Windows.Forms.Button cmdCallOut; private System.Windows.Forms.ToolTip toolTip1; private Desktop.CommonControls.PropertyTable tableConditions; - private System.Windows.Forms.Button cmdToggleMode; private System.Windows.Forms.Button cmdMakeResponse; private Controls.DialogueTree treeDialogue; + private System.Windows.Forms.TabControl tabs; + private System.Windows.Forms.TabPage tabDialogue; + private System.Windows.Forms.TabPage tabNotes; + private System.Windows.Forms.TextBox txtNotes; + private System.Windows.Forms.Label label1; } } diff --git a/editor source/SPNATI Character Editor/Activities/DialogueEditor.cs b/editor source/SPNATI Character Editor/Activities/DialogueEditor.cs index 90a6a0c3a1984a35c521706c297b827ba172d556..c0d2024c99d0261c6ec7c9d250f97c6a73bf5e5c 100644 --- a/editor source/SPNATI Character Editor/Activities/DialogueEditor.cs +++ b/editor source/SPNATI Character Editor/Activities/DialogueEditor.cs @@ -11,9 +11,7 @@ namespace SPNATI_Character_Editor.Activities [Activity(typeof(Character), 30)] public partial class DialogueEditor : Activity { - private const string UseOldEditorSetting = "UseOldEditor"; private const string FavoriteConditionsSetting = "FavoritedConditions"; - private bool _usingOldEditor; private Character _character; private CharacterEditorData _editorData; @@ -55,15 +53,6 @@ namespace SPNATI_Character_Editor.Activities tableConditions.Context = _character; SetupMessageHandlers(); grpCase.Enabled = false; - - _usingOldEditor = Config.GetBoolean(UseOldEditorSetting); - EnableOldEditor(_usingOldEditor); - } - - private void EnableOldEditor(bool value) - { - tableConditions.Visible = !value; - tabControlConditions.Visible = value; } /// <summary> @@ -86,7 +75,6 @@ namespace SPNATI_Character_Editor.Activities CreateStageCheckboxes(); - PopulateListingFields(); SetupFindReplace(); } @@ -195,31 +183,7 @@ namespace SPNATI_Character_Editor.Activities gridDialogue.UpdateAvailableImagesForCase(GetSelectedStages(), true); _populatingCase = false; } - - private void cboLineTarget_SelectedIndexChanged(object sender, System.EventArgs e) - { - if (_populatingCase) - return; - string key = cboLineTarget.SelectedItem.ToString(); - Character c = CharacterDatabase.Get(key); - PopulateStageCombo(cboTargetStage, c, true); - PopulateStageCombo(cboTargetToStage, c, true); - markerTarget.SetDataSource(c, false); - PopulateMarkerCombo(cboTargetNotMarker, c, false); - } - - private void cboAlsoPlaying_SelectedIndexChanged(object sender, System.EventArgs e) - { - if (_populatingCase) - return; - string key = cboAlsoPlaying.SelectedItem.ToString(); - Character c = CharacterDatabase.Get(key); - PopulateStageCombo(cboAlsoPlayingStage, c, false); - PopulateStageCombo(cboAlsoPlayingMaxStage, c, false); - markerAlsoPlaying.SetDataSource(c, false); - PopulateMarkerCombo(cboAlsoPlayingNotMarker, c, false); - } - + /// <summary> /// Checks or unchecks all stages besides the current stage /// </summary> @@ -297,9 +261,9 @@ namespace SPNATI_Character_Editor.Activities } } - private void ckbShowSpeechBubbleColumns_CheckedChanged(object sender, EventArgs e) + private void ckbShowAdvanced_CheckedChanged(object sender, EventArgs e) { - this.gridDialogue.ShowSpeechBubbleColumns = ckbShowBubbleColumns.Checked; + this.gridDialogue.ShowAdvancedColumns = ckbShowAdvanced.Checked; } #endregion @@ -357,117 +321,7 @@ namespace SPNATI_Character_Editor.Activities return false; } } - - /// <summary> - /// Populates fields that list cross-character data (names, tags, etc.) - /// </summary> - private void PopulateListingFields() - { - List<string> items = new List<string>(); - items.Add(""); - foreach (var character in CharacterDatabase.Characters) - { - items.Add(character.FolderName); - } - items.Sort(); - cboAlsoPlaying.DataSource = items; - cboAlsoPlaying.BindingContext = new BindingContext(); - - List<object> filters = new List<object>(); - List<string> tags = new List<string>(); - foreach (var tag in TagDatabase.Tags) - { - filters.Add(tag); - tags.Add(tag.Value); - } - filters.Add(""); - filters.Add("human"); - filters.Add("human_male"); - filters.Add("human_female"); - filters.Sort((i1, i2) => { return i1.ToString().CompareTo(i2.ToString()); }); - tags.Add(""); - tags.Add("human"); - tags.Add("human_male"); - tags.Add("human_female"); - tags.Sort(); - cboLineFilter.DataSource = filters; - cboLineFilter.BindingContext = new BindingContext(); - - ((DataGridViewComboBoxColumn)gridFilters.Columns["ColStatusFilter"]).DataSource = TargetCondition.StatusTypes; - ((DataGridViewComboBoxColumn)gridFilters.Columns["ColStatusFilter"]).ValueMember = "Key"; - ((DataGridViewComboBoxColumn)gridFilters.Columns["ColStatusFilter"]).DisplayMember = "Value"; - cboTargetStatus.DataSource = TargetCondition.StatusTypes; - cboTargetStatus.ValueMember = "Key"; - cboTargetStatus.DisplayMember = "Value"; - - DataGridViewComboBoxColumn gridCol = gridFilters.Columns["ColTagFilter"] as DataGridViewComboBoxColumn; - if (gridCol != null) - { - foreach (var tag in tags) - { - gridCol.Items.Add(tag); - } - } - } - - /// <summary> - /// Populates the target field with loaded characters of the appropriate gender for the current case - /// </summary> - private void PopulateTargetField() - { - cboLineTarget.Items.Clear(); - List<string> items = new List<string>(); - items.Add(""); - - Trigger trigger = TriggerDatabase.GetTrigger(_selectedCase?.Tag); - string gender = trigger?.Gender; - bool useGender = !string.IsNullOrEmpty(gender); - string size = trigger?.Size; - bool useSize = !string.IsNullOrEmpty(size); - - foreach (var character in CharacterDatabase.Characters) - { - if ((!useGender || gender == character.Gender) && (!useSize || size == character.Size)) - { - items.Add(character.FolderName); - } - } - items.Add("human"); - items.Sort(); - cboLineTarget.Items.Clear(); - foreach (string item in items) - { - cboLineTarget.Items.Add(item); - } - } - - /// <summary> - /// Updates a marker dropdown to contain only markers used in the given character's dialogue - /// </summary> - /// <param name="box"></param> - /// <param name="character"></param> - private void PopulateMarkerCombo(ComboBox box, Character character, bool allowPrivate) - { - string oldText = box.Text; - box.Items.Clear(); - box.Text = ""; - if (character == null) - return; - - foreach (var marker in character.Markers.Values) - { - if (allowPrivate || marker.Scope == MarkerScope.Public) - { - box.Items.Add(marker.Name); - } - } - - if (!string.IsNullOrEmpty(oldText)) - { - box.Text = oldText; - } - } - + #region Find/Replace /// <summary> /// Hooks up event handlers for the Find/Replace form @@ -558,7 +412,6 @@ namespace SPNATI_Character_Editor.Activities /// </summary> private void PopulateCase() { - string minStage, maxStage; if (_selectedCase == null) { grpCase.Visible = false; @@ -619,126 +472,37 @@ namespace SPNATI_Character_Editor.Activities #endregion - if (!_usingOldEditor) + txtNotes.Text = _editorData.GetNote(_selectedCase); + + if (caseTrigger.HasTarget) { - if (caseTrigger.HasTarget) - { - tableConditions.RecordFilter = null; - } - else - { - tableConditions.RecordFilter = FilterTargets; - } - bool firstPopulation = (tableConditions.Data == null); - tableConditions.Data = _selectedCase; + tableConditions.RecordFilter = null; + } + else + { + tableConditions.RecordFilter = FilterTargets; + } + bool firstPopulation = (tableConditions.Data == null); + tableConditions.Data = _selectedCase; + AddSpeedButtons(); - if (firstPopulation) + if (firstPopulation) + { + List<string> favorites = new List<string>(); + string favoritesData = Config.GetString(FavoriteConditionsSetting); + if (!string.IsNullOrEmpty(favoritesData)) { - List<string> favorites = new List<string>(); - string favoritesData = Config.GetString(FavoriteConditionsSetting); - if (!string.IsNullOrEmpty(favoritesData)) + foreach (string key in favoritesData.Split('|')) { - foreach (string key in favoritesData.Split('|')) + if (!string.IsNullOrEmpty(key)) { - if (!string.IsNullOrEmpty(key)) - { - favorites.Add(key); - } + favorites.Add(key); } } - tableConditions.SetFavorites(favorites); } + tableConditions.SetFavorites(favorites); } - else - { - PopulateTargetField(); - - #region Target tab - ClearConditionFields(); - if (caseTrigger.HasTarget) - { - ((Control)tabTarget).Enabled = true; - GUIHelper.SetComboBox(cboLineTarget, _selectedCase.Target); - GUIHelper.SetComboBox(cboTargetHand, _selectedCase.TargetHand); - GUIHelper.SetComboBox(cboLineFilter, _selectedCase.Filter); - GUIHelper.SetComboBox(cboTargetStatus, _selectedCase.TargetStatusType); - ckbTargetStatusNegated.Checked = _selectedCase.NegateTargetStatus; - Character target = CharacterDatabase.Get(_selectedCase.Target); - _selectedCase.SplitTargetStage(out minStage, out maxStage); - PopulateStageCombo(cboTargetStage, target, true); - SetStageComboBox(cboTargetStage, minStage); - PopulateStageCombo(cboTargetToStage, target, true); - SetStageComboBox(cboTargetToStage, maxStage); - markerTarget.SetDataSource(target, false); - markerTarget.Value = _selectedCase.TargetSaidMarker; - PopulateMarkerCombo(cboTargetNotMarker, target, false); - cboTargetNotMarker.Text = _selectedCase.TargetNotSaidMarker; - GUIHelper.SetRange(valTimeInStage, valMaxTimeInStage, _selectedCase.TargetTimeInStage); - GUIHelper.SetRange(valLosses, valMaxLosses, _selectedCase.ConsecutiveLosses); - GUIHelper.SetRange(valLayers, valMaxLayers, _selectedCase.TargetLayers); - GUIHelper.SetRange(valStartingLayers, valMaxStartingLayers, _selectedCase.TargetStartingLayers); - valOwnLosses.Enabled = false; - valMaxOwnLosses.Enabled = false; - } - else - { - ((Control)tabTarget).Enabled = false; - GUIHelper.SetComboBox(cboLineTarget, ""); - cboTargetStage.Text = ""; - cboTargetToStage.Text = ""; - markerTarget.Value = null; - cboTargetNotMarker.Text = ""; - GUIHelper.SetComboBox(cboTargetHand, ""); - GUIHelper.SetComboBox(cboLineFilter, ""); - valOwnLosses.Enabled = true; - valMaxOwnLosses.Enabled = true; - } - #endregion - - #region Also Playing tab - GUIHelper.SetComboBox(cboAlsoPlaying, _selectedCase.AlsoPlaying); - GUIHelper.SetComboBox(cboAlsoPlayingHand, _selectedCase.AlsoPlayingHand); - Character other = CharacterDatabase.Get(_selectedCase.AlsoPlaying); - cboAlsoPlayingStage.Text = ""; - cboAlsoPlayingMaxStage.Text = ""; - GUIHelper.SetRange(valAlsoTimeInStage, valMaxAlsoTimeInStage, _selectedCase.AlsoPlayingTimeInStage); - - _selectedCase.SplitAlsoPlayingStage(out minStage, out maxStage); - PopulateStageCombo(cboAlsoPlayingStage, other, false); - SetStageComboBox(cboAlsoPlayingStage, minStage); - PopulateStageCombo(cboAlsoPlayingMaxStage, other, false); - SetStageComboBox(cboAlsoPlayingMaxStage, maxStage); - markerAlsoPlaying.SetDataSource(other, false); - markerAlsoPlaying.Value = _selectedCase.AlsoPlayingSaidMarker; - PopulateMarkerCombo(cboAlsoPlayingNotMarker, other, false); - cboAlsoPlayingNotMarker.Text = _selectedCase.AlsoPlayingNotSaidMarker; - #endregion - - #region Self tab - cboOwnHand.SelectedItem = _selectedCase.HasHand; - GUIHelper.SetRange(valOwnLosses, valMaxOwnLosses, _selectedCase.ConsecutiveLosses); - GUIHelper.SetRange(valOwnTimeInStage, valMaxOwnTimeInStage, _selectedCase.TimeInStage); - markerSelf.SetDataSource(_character, true); - PopulateMarkerCombo(cboNotMarker, _character, true); - markerSelf.Value = _selectedCase.SaidMarker; - cboNotMarker.Text = _selectedCase.NotSaidMarker; - #endregion - - #region Misc tab - GUIHelper.SetRange(cboTotalFemales, cboMaxTotalFemales, _selectedCase.TotalFemales); - GUIHelper.SetRange(cboTotalMales, cboMaxTotalMales, _selectedCase.TotalMales); - GUIHelper.SetRange(valGameRounds, valMaxGameRounds, _selectedCase.TotalRounds); - GUIHelper.SetRange(cboTotalPlaying, cboMaxTotalPlaying, _selectedCase.TotalPlaying); - GUIHelper.SetRange(cboTotalExposed, cboMaxTotalExposed, _selectedCase.TotalExposed); - GUIHelper.SetRange(cboTotalNaked, cboMaxTotalNaked, _selectedCase.TotalNaked); - GUIHelper.SetRange(cboTotalFinishing, cboMaxTotalFinishing, _selectedCase.TotalMasturbating); - GUIHelper.SetRange(cboTotalFinished, cboMaxTotalFinished, _selectedCase.TotalFinished); - #endregion - - #region Tags tab - LoadFilterConditions(); - #endregion - } + GUIHelper.SetNumericBox(valPriority, _selectedCase.CustomPriority); @@ -752,6 +516,25 @@ namespace SPNATI_Character_Editor.Activities HighlightRow(0); } + private void AddSpeedButtons() + { + if (_selectedCase == null) { return; } + tableConditions.AddSpeedButton("Game", "Background", (data) => { return AddVariableTest("~background~", data); }); + tableConditions.AddSpeedButton("Game", "Inside/Outside", (data) => { return AddVariableTest("~background.location~", data); }); + Trigger caseTrigger = TriggerDatabase.GetTrigger(_selectedCase.Tag); + if (caseTrigger.AvailableVariables.Contains("clothing") && caseTrigger.HasTarget) + { + tableConditions.AddSpeedButton("Clothing", "Clothing Position", (data) => { return AddVariableTest("~clothing.position~", data); }); + } + } + + private string AddVariableTest(string variable, object data) + { + Case theCase = data as Case; + theCase.Expressions.Add(new ExpressionTest(variable, "")); + return "Expressions"; + } + private HashSet<int> GetSelectedStages() { HashSet<int> selectedStages = new HashSet<int>(); @@ -766,24 +549,6 @@ namespace SPNATI_Character_Editor.Activities return selectedStages; } - private void ClearConditionFields() - { - foreach (TabPage page in tabControlConditions.TabPages) - { - foreach (Control ctl in page.Controls) - { - if (ctl is TextBox || ctl is NumericUpDown) - ctl.Text = ""; - else if (ctl is ComboBox) - { - ComboBox box = ctl as ComboBox; - box.SelectedIndex = -1; - box.Text = ""; - } - } - } - } - /// <summary> /// Updates a stage-specific dropdown to have display friendly options specific to the character being targeted /// </summary> @@ -924,60 +689,6 @@ namespace SPNATI_Character_Editor.Activities return stage.Id; } - /// <summary> - /// Populates the Filters grid - /// </summary> - private void LoadFilterConditions() - { - if (_selectedCase == null) - return; - gridFilters.Rows.Clear(); - DataGridViewComboBoxColumn colTags = gridFilters.Columns["ColTagFilter"] as DataGridViewComboBoxColumn; - foreach (TargetCondition condition in _selectedCase.Conditions) - { - if (string.IsNullOrEmpty(condition.Filter)) - continue; - DataGridViewRow row = gridFilters.Rows[gridFilters.Rows.Add()]; - if (!colTags.Items.Contains(condition.Filter)) - { - colTags.Items.Add(condition.Filter); - } - try - { - row.Cells["ColTagFilter"].Value = condition.Filter; - row.Cells["ColGenderFilter"].Value = condition.Gender; - row.Cells["ColStatusFilter"].Value = condition.StatusType; - row.Cells["ColStatusFilterNegated"].Value = condition.NegateStatus; - row.Cells["ColFilterCount"].Value = condition.Count; - } - catch { } - } - } - - /// <summary> - /// Saves filter conditions into the case - /// </summary> - private void SaveFilterConditions() - { - if (_selectedCase == null) - return; - _selectedCase.Conditions.Clear(); - for (int i = 0; i < gridFilters.Rows.Count; i++) - { - DataGridViewRow row = gridFilters.Rows[i]; - string filter = row.Cells["ColTagFilter"].Value?.ToString(); - string countValue = row.Cells["ColFilterCount"].Value?.ToString(); - string gender = row.Cells["ColGenderFilter"].Value?.ToString(); - string status = row.Cells["ColStatusFilter"].Value?.ToString(); - object negStatus = row.Cells["ColStatusFilterNegated"].Value; - - if (string.IsNullOrEmpty(filter) || string.IsNullOrEmpty(countValue)) - continue; - TargetCondition condition = new TargetCondition(filter, gender, status, negStatus != null && (bool)negStatus, countValue); - _selectedCase.Conditions.Add(condition); - } - } - private bool FilterTargets(PropertyRecord record) { if (record.Group == "Target") @@ -997,6 +708,7 @@ namespace SPNATI_Character_Editor.Activities if (_selectedCase == null) return false; + SaveNotes(); bool needRegeneration = false; var c = _selectedCase; if (c.Tag != Trigger.StartTrigger) @@ -1024,79 +736,8 @@ namespace SPNATI_Character_Editor.Activities needRegeneration = true; } - if (!_usingOldEditor) - { - tableConditions.Save(); - } - else - { - #region Target tab - if (trigger.HasTarget) - { - c.Target = GUIHelper.ReadComboBox(cboLineTarget); - c.SetTargetStage(ReadStageComboBox(cboTargetStage), ReadStageComboBox(cboTargetToStage)); - c.TargetHand = GUIHelper.ReadComboBox(cboTargetHand); - c.Filter = GUIHelper.ReadComboBox(cboLineFilter); - c.TargetTimeInStage = GUIHelper.ReadRange(valTimeInStage, valMaxTimeInStage); - c.ConsecutiveLosses = GUIHelper.ReadRange(valLosses, valMaxLosses); - c.TargetLayers = GUIHelper.ReadRange(valLayers, valMaxLayers); - c.TargetStartingLayers = GUIHelper.ReadRange(valStartingLayers, valMaxStartingLayers); - c.TargetStatusType = GUIHelper.ReadComboBox(cboTargetStatus); - c.NegateTargetStatus = ckbTargetStatusNegated.Checked; - c.TargetSaidMarker = markerTarget.Value; - c.TargetNotSaidMarker = GUIHelper.ReadComboBox(cboTargetNotMarker); - } - else - { - c.Target = null; - c.TargetStage = null; - c.TargetLayers = null; - c.TargetStatus = null; - c.NegateTargetStatus = false; - c.TargetHand = null; - c.Filter = null; - c.TargetTimeInStage = null; - c.TargetSaidMarker = null; - c.TargetNotSaidMarker = null; - } - #endregion - - #region Also Playing Tab - c.AlsoPlaying = GUIHelper.ReadComboBox(cboAlsoPlaying); - c.AlsoPlayingHand = GUIHelper.ReadComboBox(cboAlsoPlayingHand); - c.SetAlsoPlayingStage(ReadStageComboBox(cboAlsoPlayingStage), ReadStageComboBox(cboAlsoPlayingMaxStage)); - c.AlsoPlayingTimeInStage = GUIHelper.ReadRange(valAlsoTimeInStage, valMaxAlsoTimeInStage); - c.AlsoPlayingSaidMarker = markerAlsoPlaying.Value; - c.AlsoPlayingNotSaidMarker = GUIHelper.ReadComboBox(cboAlsoPlayingNotMarker); - #endregion - - #region Self tab - c.SaidMarker = markerSelf.Value; - c.NotSaidMarker = GUIHelper.ReadComboBox(cboNotMarker); - c.HasHand = GUIHelper.ReadComboBox(cboOwnHand); - c.TimeInStage = GUIHelper.ReadRange(valOwnTimeInStage, valMaxOwnTimeInStage); - if (!trigger.HasTarget) - { - c.ConsecutiveLosses = GUIHelper.ReadRange(valOwnLosses, valMaxOwnLosses); - } - #endregion - - #region Misc tab - c.TotalFemales = GUIHelper.ReadRange(cboTotalFemales, cboMaxTotalFemales); - c.TotalMales = GUIHelper.ReadRange(cboTotalMales, cboMaxTotalMales); - c.TotalRounds = GUIHelper.ReadRange(valGameRounds, valMaxGameRounds); - c.TotalPlaying = GUIHelper.ReadRange(cboTotalPlaying, cboMaxTotalPlaying); - c.TotalExposed = GUIHelper.ReadRange(cboTotalExposed, cboMaxTotalExposed); - c.TotalNaked = GUIHelper.ReadRange(cboTotalNaked, cboMaxTotalNaked); - c.TotalMasturbating = GUIHelper.ReadRange(cboTotalFinishing, cboMaxTotalFinishing); - c.TotalFinished = GUIHelper.ReadRange(cboTotalFinished, cboMaxTotalFinished); - #endregion - - #region Tags tab - SaveFilterConditions(); - #endregion - } - + tableConditions.Save(); + c.CustomPriority = GUIHelper.ReadNumericBox(valPriority); } @@ -1255,21 +896,6 @@ namespace SPNATI_Character_Editor.Activities } } - private void cmdToggleMode_Click(object sender, EventArgs e) - { - if (_selectedCase != null) - { - SaveCase(); - } - _usingOldEditor = !_usingOldEditor; - Config.Set(UseOldEditorSetting, _usingOldEditor); - EnableOldEditor(_usingOldEditor); - if (_selectedCase != null) - { - PopulateCase(); - } - } - private void tree_SelectedNodeChanging(object sender, CaseSelectionEventArgs e) { SaveCase(); @@ -1301,5 +927,19 @@ namespace SPNATI_Character_Editor.Activities { } + + private void txtNotes_Validated(object sender, EventArgs e) + { + SaveNotes(); + } + + private void SaveNotes() + { + if (_selectedCase == null) + { + return; + } + _editorData.SetNote(_selectedCase, txtNotes.Text); + } } } diff --git a/editor source/SPNATI Character Editor/Activities/DialogueEditor.resx b/editor source/SPNATI Character Editor/Activities/DialogueEditor.resx index f5581281d08ab875afa160e9e2432b464bb09693..1afe17b3056027aa6eb5461dd4a7fa6c1db8b708 100644 --- a/editor source/SPNATI Character Editor/Activities/DialogueEditor.resx +++ b/editor source/SPNATI Character Editor/Activities/DialogueEditor.resx @@ -120,9 +120,6 @@ <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>724, 17</value> </metadata> - <metadata name="ColTagFilter.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <metadata name="triggerMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>604, 17</value> </metadata> diff --git a/editor source/SPNATI Character Editor/Activities/PoseCreator.Designer.cs b/editor source/SPNATI Character Editor/Activities/PoseCreator.Designer.cs index a4931fa2b85a9fcdd5aab80cd99a31aebfb4015d..6fe5b2f482ad83d33546b688c20e3e1142e66ac7 100644 --- a/editor source/SPNATI Character Editor/Activities/PoseCreator.Designer.cs +++ b/editor source/SPNATI Character Editor/Activities/PoseCreator.Designer.cs @@ -30,14 +30,27 @@ { this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.lstPoses = new System.Windows.Forms.ListBox(); this.tsPoseList = new System.Windows.Forms.ToolStrip(); this.table = new Desktop.CommonControls.PropertyTable(); this.canvas = new Desktop.CommonControls.DBPanel(); - this.tsAddLink = new System.Windows.Forms.ToolStripButton(); + this.lstPoses = new Desktop.CommonControls.DBTreeView(); this.tsAdd = new System.Windows.Forms.ToolStripButton(); this.tsRemove = new System.Windows.Forms.ToolStripButton(); + this.tsCollapseAll = new System.Windows.Forms.ToolStripButton(); + this.tsExpandAll = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.tsCut = new System.Windows.Forms.ToolStripButton(); + this.tsCopy = new System.Windows.Forms.ToolStripButton(); + this.tsPaste = new System.Windows.Forms.ToolStripButton(); + this.tsDuplicate = new System.Windows.Forms.ToolStripButton(); + this.lblDragger = new System.Windows.Forms.Label(); + this.preview = new SPNATI_Character_Editor.Controls.CharacterImageBox(); this.openFileDialog1 = new SPNATI_Character_Editor.Controls.CharacterImageDialog(); + this.tsAddKeyframe = new System.Windows.Forms.ToolStripButton(); + this.tsAddDirective = new System.Windows.Forms.ToolStripSplitButton(); + this.addSpriteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addAnimationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -47,6 +60,7 @@ this.splitContainer2.Panel2.SuspendLayout(); this.splitContainer2.SuspendLayout(); this.tsPoseList.SuspendLayout(); + this.canvas.SuspendLayout(); this.SuspendLayout(); // // splitContainer1 @@ -77,6 +91,7 @@ // // splitContainer2.Panel1 // + this.splitContainer2.Panel1.Controls.Add(this.lblDragger); this.splitContainer2.Panel1.Controls.Add(this.lstPoses); this.splitContainer2.Panel1.Controls.Add(this.tsPoseList); // @@ -87,25 +102,22 @@ this.splitContainer2.SplitterDistance = 211; this.splitContainer2.TabIndex = 2; // - // lstPoses - // - this.lstPoses.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.lstPoses.FormattingEnabled = true; - this.lstPoses.Location = new System.Drawing.Point(3, 23); - this.lstPoses.Name = "lstPoses"; - this.lstPoses.Size = new System.Drawing.Size(242, 173); - this.lstPoses.TabIndex = 0; - this.lstPoses.SelectedIndexChanged += new System.EventHandler(this.lstPoses_SelectedIndexChanged); - // // tsPoseList // this.tsPoseList.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.tsPoseList.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.tsAddLink, this.tsAdd, - this.tsRemove}); + this.tsRemove, + this.tsAddDirective, + this.tsAddKeyframe, + this.toolStripSeparator1, + this.tsCut, + this.tsCopy, + this.tsPaste, + this.tsDuplicate, + this.toolStripSeparator2, + this.tsCollapseAll, + this.tsExpandAll}); this.tsPoseList.Location = new System.Drawing.Point(0, 0); this.tsPoseList.Name = "tsPoseList"; this.tsPoseList.Size = new System.Drawing.Size(248, 25); @@ -134,22 +146,29 @@ // // canvas // + this.canvas.Controls.Add(this.preview); this.canvas.Dock = System.Windows.Forms.DockStyle.Fill; this.canvas.Location = new System.Drawing.Point(0, 0); this.canvas.Name = "canvas"; this.canvas.Size = new System.Drawing.Size(738, 670); this.canvas.TabIndex = 0; // - // tsAddLink + // lstPoses // - this.tsAddLink.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.tsAddLink.Image = global::SPNATI_Character_Editor.Properties.Resources.AddLink; - this.tsAddLink.ImageTransparentColor = System.Drawing.Color.Magenta; - this.tsAddLink.Name = "tsAddLink"; - this.tsAddLink.Size = new System.Drawing.Size(23, 22); - this.tsAddLink.Text = "Add pose link"; - this.tsAddLink.ToolTipText = "Link image across stages"; - this.tsAddLink.Click += new System.EventHandler(this.tsAddLink_Click); + this.lstPoses.AllowDrop = true; + this.lstPoses.Dock = System.Windows.Forms.DockStyle.Fill; + this.lstPoses.Location = new System.Drawing.Point(0, 25); + this.lstPoses.Name = "lstPoses"; + this.lstPoses.Size = new System.Drawing.Size(248, 182); + this.lstPoses.TabIndex = 2; + this.lstPoses.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.lstPoses_ItemDrag); + this.lstPoses.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.lstPoses_AfterSelect); + this.lstPoses.DragDrop += new System.Windows.Forms.DragEventHandler(this.lstPoses_DragDrop); + this.lstPoses.DragEnter += new System.Windows.Forms.DragEventHandler(this.lstPoses_DragEnter); + this.lstPoses.DragOver += new System.Windows.Forms.DragEventHandler(this.lstPoses_DragOver); + this.lstPoses.DragLeave += new System.EventHandler(this.lstPoses_DragLeave); + this.lstPoses.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.lstPoses_QueryContinueDrag); + this.lstPoses.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lstPoses_KeyDown); // // tsAdd // @@ -160,6 +179,7 @@ this.tsAdd.Size = new System.Drawing.Size(23, 22); this.tsAdd.Text = "Add Pose"; this.tsAdd.ToolTipText = "Add sprite-based pose"; + this.tsAdd.Click += new System.EventHandler(this.tsAdd_Click); // // tsRemove // @@ -172,9 +192,143 @@ this.tsRemove.ToolTipText = "Remove pose"; this.tsRemove.Click += new System.EventHandler(this.tsRemove_Click); // + // tsCollapseAll + // + this.tsCollapseAll.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsCollapseAll.Image = global::SPNATI_Character_Editor.Properties.Resources.CollapseAll; + this.tsCollapseAll.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsCollapseAll.Name = "tsCollapseAll"; + this.tsCollapseAll.Size = new System.Drawing.Size(23, 22); + this.tsCollapseAll.Text = "Collapse all"; + this.tsCollapseAll.ToolTipText = "Collapse all"; + this.tsCollapseAll.Click += new System.EventHandler(this.tsCollapseAll_Click); + // + // tsExpandAll + // + this.tsExpandAll.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsExpandAll.Image = global::SPNATI_Character_Editor.Properties.Resources.ExpandAll; + this.tsExpandAll.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsExpandAll.Name = "tsExpandAll"; + this.tsExpandAll.Size = new System.Drawing.Size(23, 20); + this.tsExpandAll.Text = "Expand all"; + this.tsExpandAll.ToolTipText = "Expand all"; + this.tsExpandAll.Click += new System.EventHandler(this.tsExpandAll_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25); + // + // tsCut + // + this.tsCut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsCut.Image = global::SPNATI_Character_Editor.Properties.Resources.Cut; + this.tsCut.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsCut.Name = "tsCut"; + this.tsCut.Size = new System.Drawing.Size(23, 22); + this.tsCut.Text = "Cut"; + this.tsCut.Click += new System.EventHandler(this.tsCut_Click); + // + // tsCopy + // + this.tsCopy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsCopy.Image = global::SPNATI_Character_Editor.Properties.Resources.Copy; + this.tsCopy.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsCopy.Name = "tsCopy"; + this.tsCopy.Size = new System.Drawing.Size(23, 22); + this.tsCopy.Text = "Copy"; + this.tsCopy.Click += new System.EventHandler(this.tsCopy_Click); + // + // tsPaste + // + this.tsPaste.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsPaste.Image = global::SPNATI_Character_Editor.Properties.Resources.Paste; + this.tsPaste.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsPaste.Name = "tsPaste"; + this.tsPaste.Size = new System.Drawing.Size(23, 22); + this.tsPaste.Text = "Paste"; + this.tsPaste.Click += new System.EventHandler(this.tsPaste_Click); + // + // tsDuplicate + // + this.tsDuplicate.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsDuplicate.Image = global::SPNATI_Character_Editor.Properties.Resources.Duplicate; + this.tsDuplicate.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsDuplicate.Name = "tsDuplicate"; + this.tsDuplicate.Size = new System.Drawing.Size(23, 22); + this.tsDuplicate.Text = "Duplicate"; + this.tsDuplicate.Click += new System.EventHandler(this.tsDuplicate_Click); + // + // lblDragger + // + this.lblDragger.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lblDragger.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lblDragger.Location = new System.Drawing.Point(5, 102); + this.lblDragger.Name = "lblDragger"; + this.lblDragger.Size = new System.Drawing.Size(220, 2); + this.lblDragger.TabIndex = 4; + this.lblDragger.Visible = false; + // + // preview + // + this.preview.Dock = System.Windows.Forms.DockStyle.Fill; + this.preview.Location = new System.Drawing.Point(0, 0); + this.preview.Name = "preview"; + this.preview.Size = new System.Drawing.Size(738, 670); + this.preview.TabIndex = 0; + // // openFileDialog1 // this.openFileDialog1.Filter = ""; + this.openFileDialog1.UseAbsolutePaths = false; + // + // tsAddKeyframe + // + this.tsAddKeyframe.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsAddKeyframe.Image = global::SPNATI_Character_Editor.Properties.Resources.AddKeyframe; + this.tsAddKeyframe.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsAddKeyframe.Name = "tsAddKeyframe"; + this.tsAddKeyframe.Size = new System.Drawing.Size(23, 22); + this.tsAddKeyframe.Text = "Add Keyframe"; + this.tsAddKeyframe.Click += new System.EventHandler(this.tsAddKeyframe_Click); + // + // tsAddDirective + // + this.tsAddDirective.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsAddDirective.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.addSpriteToolStripMenuItem, + this.addAnimationToolStripMenuItem}); + this.tsAddDirective.Image = global::SPNATI_Character_Editor.Properties.Resources.AddChildNode; + this.tsAddDirective.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsAddDirective.Name = "tsAddDirective"; + this.tsAddDirective.Size = new System.Drawing.Size(32, 22); + this.tsAddDirective.Text = "Add"; + this.tsAddDirective.ToolTipText = "Add a new directive to the selected scene"; + // + // addSpriteToolStripMenuItem + // + this.addSpriteToolStripMenuItem.Name = "addSpriteToolStripMenuItem"; + this.addSpriteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D1))); + this.addSpriteToolStripMenuItem.Size = new System.Drawing.Size(195, 22); + this.addSpriteToolStripMenuItem.Tag = "sprite"; + this.addSpriteToolStripMenuItem.Text = "Add Sprite"; + this.addSpriteToolStripMenuItem.ToolTipText = "Add a sprite to the scene"; + this.addSpriteToolStripMenuItem.Click += new System.EventHandler(this.addSpriteToolStripMenuItem_Click); + // + // removeObjectToolStripMenuItem + // + this.addAnimationToolStripMenuItem.Name = "removeObjectToolStripMenuItem"; + this.addAnimationToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D2))); + this.addAnimationToolStripMenuItem.Size = new System.Drawing.Size(195, 22); + this.addAnimationToolStripMenuItem.Tag = "remove"; + this.addAnimationToolStripMenuItem.Text = "Add Animation"; + this.addAnimationToolStripMenuItem.Click += new System.EventHandler(this.addAnimationToolStripMenuItem_Click); // // PoseCreator // @@ -194,6 +348,7 @@ this.splitContainer2.ResumeLayout(false); this.tsPoseList.ResumeLayout(false); this.tsPoseList.PerformLayout(); + this.canvas.ResumeLayout(false); this.ResumeLayout(false); } @@ -201,14 +356,27 @@ #endregion private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.ListBox lstPoses; private System.Windows.Forms.ToolStrip tsPoseList; private System.Windows.Forms.ToolStripButton tsAdd; private System.Windows.Forms.ToolStripButton tsRemove; private System.Windows.Forms.SplitContainer splitContainer2; private Desktop.CommonControls.PropertyTable table; - private System.Windows.Forms.ToolStripButton tsAddLink; private Desktop.CommonControls.DBPanel canvas; private Controls.CharacterImageDialog openFileDialog1; + private Desktop.CommonControls.DBTreeView lstPoses; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripButton tsCollapseAll; + private System.Windows.Forms.ToolStripButton tsExpandAll; + private System.Windows.Forms.ToolStripButton tsCut; + private System.Windows.Forms.ToolStripButton tsCopy; + private System.Windows.Forms.ToolStripButton tsPaste; + private System.Windows.Forms.ToolStripButton tsDuplicate; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private Controls.CharacterImageBox preview; + private System.Windows.Forms.Label lblDragger; + private System.Windows.Forms.ToolStripSplitButton tsAddDirective; + private System.Windows.Forms.ToolStripMenuItem addSpriteToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem addAnimationToolStripMenuItem; + private System.Windows.Forms.ToolStripButton tsAddKeyframe; } } diff --git a/editor source/SPNATI Character Editor/Activities/PoseCreator.cs b/editor source/SPNATI Character Editor/Activities/PoseCreator.cs index 68678b13e2cfd6722980a301555ba4639b28b34e..95c9fd8e4e71e87dd862afb03b1d3b5a1ba0c19e 100644 --- a/editor source/SPNATI Character Editor/Activities/PoseCreator.cs +++ b/editor source/SPNATI Character Editor/Activities/PoseCreator.cs @@ -1,19 +1,28 @@ using Desktop; using SPNATI_Character_Editor.Controls; +using System; +using System.Collections.Generic; +using System.Drawing; using System.Windows.Forms; namespace SPNATI_Character_Editor.Activities { - // >>>> NOT READY FOR 3.4 - //[Activity(typeof(Character), 210)] - //[Activity(typeof(Costume), 210)] + [Activity(typeof(Character), 210)] + [Activity(typeof(Costume), 210)] public partial class PoseCreator : Activity { private CharacterEditorData _editorData; private ISkin _character; + private ImageLibrary _library; - private CrossStagePose _currentLink; private Pose _currentPose; + private Sprite _currentSprite; + private PoseDirective _currentDirective; + private Keyframe _currentKeyframe; + private PoseAnimFrame _currentAnimFrame; + private Dictionary<object, TreeNode> _nodes = new Dictionary<object, TreeNode>(); + + private object _clipboard; private bool _populatingPoses; @@ -30,30 +39,91 @@ namespace SPNATI_Character_Editor.Activities protected override void OnInitialize() { _character = Record as ISkin; + _library = ImageLibrary.Get(_character); _editorData = CharacterDatabase.GetEditorData(_character.Character); - table.Context = new PoseContext(_character); + table.Context = new PoseContext(_character, CharacterContext.Pose); + } + + protected override void OnFirstActivate() + { + RebuildPoseList(); } protected override void OnActivate() { Workspace.ToggleSidebar(false); - RebuildPoseList(); } private void RebuildPoseList() { _populatingPoses = true; - object selectedItem = lstPoses.SelectedItem; + lstPoses.Nodes.Clear(); + foreach (Pose pose in _character.CustomPoses) + { + AddNode(pose); + } + _populatingPoses = false; + } + + private TreeNode AddNode(Pose pose) + { + TreeNode node = new TreeNode(pose.ToString()); + node.Tag = pose; + _nodes[pose] = node; + lstPoses.Nodes.Add(node); - //Rebuild the pose list because things could've been added from another activity - lstPoses.Items.Clear(); - foreach (CrossStagePose pose in _editorData.Poses) + //subnodes for sprites and directives + foreach (Sprite sprite in pose.Sprites) { - lstPoses.Items.Add(pose); + AddSprite(pose, sprite); } - lstPoses.SelectedItem = selectedItem; - _populatingPoses = false; + foreach (PoseDirective directive in pose.Directives) + { + AddDirective(pose, directive); + } + return node; + } + + private TreeNode AddSprite(Pose pose, Sprite sprite) + { + TreeNode node = new TreeNode(sprite.ToString()); + node.Tag = sprite; + _nodes[sprite] = node; + + TreeNode parent = _nodes[pose]; + parent.Nodes.Add(node); + return node; + } + + private TreeNode AddDirective(Pose pose, PoseDirective directive) + { + TreeNode node = new TreeNode(directive.ToString()); + node.Tag = directive; + _nodes[directive] = node; + + TreeNode parent = _nodes[pose]; + parent.Nodes.Add(node); + + if (directive.DirectiveType == "animation") + { + foreach (Keyframe frame in directive.Keyframes) + { + AddKeyframe(directive, frame); + } + } + return node; + } + + private TreeNode AddKeyframe(PoseDirective directive, Keyframe keyframe) + { + TreeNode node = new TreeNode(keyframe.ToString()); + node.Tag = keyframe; + _nodes[keyframe] = node; + + TreeNode parent = _nodes[directive]; + parent.Nodes.Add(node); + return node; } protected override void OnDeactivate() @@ -61,7 +131,7 @@ namespace SPNATI_Character_Editor.Activities Workspace.ToggleSidebar(true); } - private void lstPoses_SelectedIndexChanged(object sender, System.EventArgs e) + private void lstPoses_AfterSelect(object sender, TreeViewEventArgs e) { if (_populatingPoses) { @@ -70,76 +140,585 @@ namespace SPNATI_Character_Editor.Activities table.Save(); - object selected = lstPoses.SelectedItem; - if (selected is CrossStagePose) + TreeNode node = lstPoses.SelectedNode as TreeNode; + if (node == null) { - _currentLink = selected as CrossStagePose; + table.Data = null; + return; + } + _currentPose = node.Tag as Pose; + _currentSprite = node.Tag as Sprite; + _currentKeyframe = node.Tag as Keyframe; + _currentAnimFrame = node.Tag as PoseAnimFrame; + _currentDirective = node.Tag as PoseDirective; + if (_currentKeyframe is PoseDirective || _currentKeyframe is Sprite) + { + _currentKeyframe = null; + } + if (_currentKeyframe != null || _currentAnimFrame != null) + { + _currentDirective = node.Parent.Tag as PoseDirective; + _currentPose = node.Parent.Parent.Tag as Pose; + } + else if (_currentSprite != null || _currentDirective != null) + { + _currentPose = node.Parent.Tag as Pose; + } + if (_currentSprite != null) + { + table.RecordFilter = SpriteFilter; + } + else if (_currentKeyframe != null) + { + table.RecordFilter = KeyframeFilter; + } + else if (_currentAnimFrame != null) + { + table.RecordFilter = AnimFrameFilter; + } + else if (_currentDirective != null) + { + table.RecordFilter = DirectiveFilter; } else { - _currentPose = selected as Pose; + table.RecordFilter = null; + } + table.Data = node.Tag; + + tsAddKeyframe.Enabled = (_currentDirective != null); + + preview.SetImage(new CharacterImage(_currentPose)); + } + + private bool SpriteFilter(PropertyRecord record) + { + switch (record.Key) + { + case "id": + case "src": + case "x": + case "y": + case "z": + case "scalex": + case "scaley": + case "pivotx": + case "pivoty": + case "width": + case "height": + case "alpha": + case "rotation": + return true; + default: + return false; } - table.Data = selected; } - private void tsAddLink_Click(object sender, System.EventArgs e) + private bool DirectiveFilter(PropertyRecord record) { - CrossStagePose pose = new CrossStagePose(); - if (openFileDialog1.ShowDialog(_character, "") == System.Windows.Forms.DialogResult.OK) + switch (record.Key) { - pose.FileName = openFileDialog1.FileName; - if (!string.IsNullOrEmpty(pose.FileName)) - { - char stageChar = pose.FileName[0]; - if (char.IsDigit(stageChar)) - { - int stage = int.Parse(stageChar.ToString()); - pose.Stages.Add(stage); - } - _editorData.Poses.Add(pose); - lstPoses.Items.Add(pose); - lstPoses.SelectedItem = pose; - } + case "id": + case "tween": + case "ease": + case "delay": + return true; + default: + return false; + } + } + + private bool KeyframeFilter(PropertyRecord record) + { + switch (record.Key) + { + case "time": + case "x": + case "y": + case "scalex": + case "scaley": + case "alpha": + case "rotation": + return true; + default: + return false; + } + } + + private bool AnimFrameFilter(PropertyRecord record) + { + switch (record.Key) + { + case "time": + case "src": + return true; + default: + return false; } } private void table_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { - if (e.PropertyName == "FileName" || e.PropertyName == "Id") + UpdateNode(table.Data); + if (table.Data is Pose && e.PropertyName == "Id") + { + _library.Rename(_currentPose); + } + preview.SetImage(new CharacterImage(_currentPose)); + } + + private void UpdateNode(object data) + { + TreeNode node; + if (_nodes.TryGetValue(data, out node)) { - RebuildPoseList(); + node.Text = data.ToString(); } } private void tsRemove_Click(object sender, System.EventArgs e) { - CrossStagePose link = lstPoses.SelectedItem as CrossStagePose; - if (link != null) + DeleteSelectedNode(); + } + + private void DeleteSelectedNode() + { + if (lstPoses.SelectedNode == null) { return; } + + if (MessageBox.Show($"Are you sure you want to remove {lstPoses.SelectedNode.Tag}? This cannot be undone.", "Remove Pose", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) + { + RemoveNode(lstPoses.SelectedNode); + } + } + + private void tsAdd_Click(object sender, System.EventArgs e) + { + Pose pose = new Pose(); + pose.Id = "New Pose"; + _library.Add(pose); + _character.CustomPoses.Add(pose); + AddNode(pose); + SelectNode(pose); + } + + private void SelectNode(Pose pose) + { + TreeNode node; + if (_nodes.TryGetValue(pose, out node)) + { + lstPoses.SelectedNode = node; + } + } + + private void lstPoses_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Delete) + { + DeleteSelectedNode(); + } + else if (e.KeyCode == Keys.X && e.Modifiers.HasFlag(Keys.Control)) + { + tsCut_Click(this, EventArgs.Empty); + } + else if (e.KeyCode == Keys.C && e.Modifiers.HasFlag(Keys.Control)) + { + tsCopy_Click(this, EventArgs.Empty); + } + else if (e.KeyCode == Keys.D && e.Modifiers.HasFlag(Keys.Control)) + { + tsDuplicate_Click(this, EventArgs.Empty); + } + else if (e.KeyCode == Keys.V && e.Modifiers.HasFlag(Keys.Control)) + { + tsPaste_Click(this, EventArgs.Empty); + } + } + + private void tsCollapseAll_Click(object sender, EventArgs e) + { + lstPoses.CollapseAll(); + } + + private void tsExpandAll_Click(object sender, EventArgs e) + { + lstPoses.ExpandAll(); + } + + /// <summary> + /// Deletes a node + /// </summary> + /// <param name="node"></param> + private void RemoveNode(TreeNode node) + { + if (node == null) { return; } + + Sprite sprite = node.Tag as Sprite; + Keyframe frame = node.Tag as Keyframe; + PoseDirective directive = node.Tag as PoseDirective; + PoseAnimFrame animFrame = node.Tag as PoseAnimFrame; + Pose pose = node.Tag as Pose; + + _nodes.Remove(node.Tag); + if (pose != null) + { + _character.CustomPoses.Remove(_currentPose); + _library.Remove(_currentPose); + } + else if (sprite != null) + { + _currentPose.Sprites.Remove(sprite); + } + else if (animFrame != null) + { + _currentDirective.AnimFrames.Remove(animFrame); + } + else if (directive != null) + { + _currentPose.Directives.Remove(directive); + } + else if (frame != null) + { + _currentDirective.Keyframes.Remove(frame); + } + node.Remove(); + } + + private void tsCut_Click(object sender, EventArgs e) + { + TreeNode node = lstPoses.SelectedNode as TreeNode; + if (node != null) + { + _clipboard = node.Tag; + RemoveNode(node); + } + } + + private void tsCopy_Click(object sender, EventArgs e) + { + TreeNode node = lstPoses.SelectedNode as TreeNode; + if (node != null) + { + ICloneable cloner = node.Tag as ICloneable; + _clipboard = cloner?.Clone(); + } + } + + private void tsPaste_Click(object sender, EventArgs e) + { + TreeNode node = lstPoses.SelectedNode as TreeNode; + if (_clipboard == null || node == null) { return; } + ICloneable cloner = _clipboard as ICloneable; + object obj = cloner.Clone(); + Pose pastedPose = obj as Pose; + Sprite pastedSprite = obj as Sprite; + PoseDirective pastedDirective = obj as PoseDirective; + Keyframe pastedKeyframe = obj as Keyframe; + PoseAnimFrame pastedAnim = obj as PoseAnimFrame; + + TreeNode pastedNode = null; + if (pastedPose != null) + { + _character.CustomPoses.Add(pastedPose); + pastedNode = AddNode(pastedPose); + } + else if (pastedSprite != null) { - if (MessageBox.Show($"Are you sure you want to unlink {link} from use in other stages?", "Unlink Pose", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) + if (_currentPose != null) { - _editorData.Poses.Remove(link); - lstPoses.Items.Remove(link); + _currentPose.Sprites.Add(pastedSprite); + pastedNode = AddSprite(_currentPose, pastedSprite); } } - Pose pose = lstPoses.SelectedItem as Pose; - if (pose != null) + else if (pastedDirective != null) + { + if (_currentPose != null) + { + _currentPose.Directives.Add(pastedDirective); + pastedNode = AddDirective(_currentPose, pastedDirective); + } + } + else if (pastedKeyframe != null) + { + if (_currentDirective != null) + { + _currentDirective.Keyframes.Add(pastedKeyframe); + pastedNode = AddKeyframe(_currentDirective, pastedKeyframe); + } + } + + if (pastedNode != null) + { + lstPoses.SelectedNode = pastedNode; + } + } + + private void tsDuplicate_Click(object sender, EventArgs e) + { + object clipboard = _clipboard; + tsCopy_Click(sender, e); + tsPaste_Click(sender, e); + _clipboard = clipboard; + } + + private void lstPoses_ItemDrag(object sender, ItemDragEventArgs e) + { + TreeNode node = e.Item as TreeNode; + if (node != null && node.Tag is Pose) + { + lstPoses.CollapseAll(); + } + DoDragDrop(e.Item, DragDropEffects.Move); + } + + private void lstPoses_DragDrop(object sender, DragEventArgs e) + { + lblDragger.Visible = false; + + TreeNode dragNode = (TreeNode)e.Data.GetData(typeof(TreeNode)); + if (dragNode == null) { return; } + bool draggingDirective = dragNode.Tag is Directive; + bool draggingSprite = dragNode.Tag is Sprite; + bool draggingKeyframe = dragNode.Tag is Keyframe && !draggingDirective && !draggingSprite; + + Point targetPoint = lstPoses.PointToClient(new Point(e.X, e.Y)); + TreeNode targetNode = lstPoses.GetNodeAt(targetPoint); + if (targetNode == null) { return; } + bool targetSprite = targetNode.Tag is Sprite; + bool targetDirective = targetNode.Tag is Directive; + bool targetKeyframe = targetNode.Tag is Keyframe && !targetDirective && !targetSprite; + + if (!dragNode.Equals(targetNode)) { - if (MessageBox.Show($"Are you sure you want to remove {pose}? This cannot be undone.", "Remove Pose", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) + if (draggingDirective) + { + //dragging a directive + + if (targetKeyframe) + { + MoveNode(dragNode, targetNode.Parent.Index + 1); + } + else if (!targetDirective) + { + //insert at start of target scene + MoveNode(dragNode, 0); + } + else + { + if (targetPoint.Y - targetNode.Bounds.Height / 2 < targetNode.Bounds.Y - 2) + { + if (targetNode.PrevNode == null) + { + //insert at first position in scene + MoveNode(dragNode, 0); + } + else + { + //insert beneath previous node + MoveNode(dragNode, targetNode.Index); + } + } + else + { + //insert beneath target node + MoveNode(dragNode, targetNode.Index + 1); + } + } + } + else if (draggingKeyframe) + { + //dragging a keyframe + + if (targetKeyframe) + { + if (targetPoint.Y - targetNode.Bounds.Height / 2 < targetNode.Bounds.Y - 2) + { + MoveNode(dragNode, targetNode.Index); + } + else + { + MoveNode(dragNode, targetNode.Index + 1); + } + } + } + else { - + //dragging a pose + + if (targetPoint.Y - targetNode.Bounds.Height / 2 < targetNode.Bounds.Y - 2) + { + //insert above target scene + MoveNode(dragNode, targetNode.Index); + } + else + { + if (targetDirective) + { + //this shouldn't happen since the tree collapses directives, but if it does, use the scene node + targetNode = targetNode.Parent; + } + + //insert behind target scene + MoveNode(dragNode, targetNode.Index + 1); + } } } } + + private void MoveNode(TreeNode node, int index) + { + //if moving higher, adjust the index to account for the node being removed + if (node.Index < index) + { + index--; + } + + TreeNode parent = node.Parent; + node.Remove(); + if (parent != null) + { + parent.Nodes.Insert(index, node); + } + else + { + lstPoses.Nodes.Insert(index, node); + } + + lstPoses.SelectedNode = node; + } + + private void RemoveSelectionHandler() + { + lstPoses.AfterSelect -= lstPoses_AfterSelect; + } + + private void AddSelectionHandler() + { + lstPoses.AfterSelect += lstPoses_AfterSelect; + } + + private void lstPoses_DragEnter(object sender, DragEventArgs e) + { + e.Effect = DragDropEffects.Move; + } + + private void lstPoses_DragLeave(object sender, EventArgs e) + { + lblDragger.Visible = false; + } + + private void lstPoses_DragOver(object sender, DragEventArgs e) + { + lstPoses.Scroll(); + + TreeNode dragNode = (TreeNode)e.Data.GetData(typeof(TreeNode)); + if (dragNode == null) { return; } + bool draggingSprite = dragNode.Tag is Sprite; + bool draggingDirective = dragNode.Tag is PoseDirective; + bool draggingKeyframe = dragNode.Tag is Keyframe && !draggingSprite && !draggingDirective; + + Point targetPoint = lstPoses.PointToClient(new Point(e.X, e.Y)); + TreeNode targetNode = lstPoses.GetNodeAt(targetPoint); + bool targetDirective = targetNode?.Tag is PoseDirective; + + + if (targetNode == null || (draggingKeyframe && (targetNode == null || targetNode.Parent != dragNode.Parent)) + || (draggingSprite && (targetNode == null || targetNode.Parent != dragNode.Parent))) + { + //keyframes can only be dragged within their original parent + e.Effect = DragDropEffects.None; + lblDragger.Visible = false; + return; + } + else + { + Pose pose = targetNode.Tag as Pose; + e.Effect = DragDropEffects.Move; + } + + if (draggingDirective && !targetDirective) + { + //dragging a directive on top of a pose. always insert below + Point pt = lblDragger.Location; + pt.Y = lstPoses.Top + targetNode.Bounds.Y + targetNode.Bounds.Height; + lblDragger.Location = pt; + lblDragger.Visible = true; + } + else + { + if (targetPoint.Y - targetNode.Bounds.Height / 2 < targetNode.Bounds.Y - 2) + { + //hovering on the upper half of a node + Point pt = lblDragger.Location; + pt.Y = lstPoses.Top + targetNode.Bounds.Y; + lblDragger.Location = pt; + lblDragger.Visible = true; + } + else + { + //hovering on the lower half + Point pt = lblDragger.Location; + pt.Y = lstPoses.Top + targetNode.Bounds.Y + targetNode.Bounds.Height; + lblDragger.Location = pt; + lblDragger.Visible = true; + } + } + RemoveSelectionHandler(); + lstPoses.SelectedNode = dragNode; + AddSelectionHandler(); + } + + private void lstPoses_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) + { + if (e.Action == DragAction.Cancel || e.Action == DragAction.Drop) + { + lblDragger.Visible = false; + } + } + + private void addSpriteToolStripMenuItem_Click(object sender, EventArgs e) + { + if (_currentPose == null) + { + return; + } + Sprite sprite = new Sprite(); + _currentPose.Sprites.Add(sprite); + lstPoses.SelectedNode = AddSprite(_currentPose, sprite); + } + + private void addAnimationToolStripMenuItem_Click(object sender, EventArgs e) + { + if (_currentPose == null) + { + return; + } + PoseDirective directive = new PoseDirective(); + directive.DirectiveType = "animation"; + _currentPose.Directives.Add(directive); + lstPoses.SelectedNode = AddDirective(_currentPose, directive); + } + + private void tsAddKeyframe_Click(object sender, EventArgs e) + { + if (_currentDirective == null) + { + return; + } + Keyframe frame = new Keyframe(); + _currentDirective.Keyframes.Add(frame); + lstPoses.SelectedNode = AddKeyframe(_currentDirective, frame); + } } public class PoseContext : ICharacterContext { public ISkin Character { get; } + public CharacterContext Context { get; } - public PoseContext(ISkin character) + public PoseContext(ISkin character, CharacterContext context) { Character = character; + Context = context; } } } diff --git a/editor source/SPNATI Character Editor/Activities/PoseListEditor.Designer.cs b/editor source/SPNATI Character Editor/Activities/PoseListEditor.Designer.cs index 70bb37fed9852fb2a85170338327acf01a72fe3c..fdf8d97c9b19d212e91e7c10222468c72f79f9cc 100644 --- a/editor source/SPNATI Character Editor/Activities/PoseListEditor.Designer.cs +++ b/editor source/SPNATI Character Editor/Activities/PoseListEditor.Designer.cs @@ -29,7 +29,7 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.cmdImportAll = new System.Windows.Forms.Button(); this.cmdImportNew = new System.Windows.Forms.Button(); this.cmdClear = new System.Windows.Forms.Button(); @@ -117,6 +117,7 @@ this.gridPoses.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.gridPoses.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText; this.gridPoses.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gridPoses.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.ColStage, @@ -182,9 +183,9 @@ // ColData // this.ColData.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; - dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.ColData.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.ColData.DefaultCellStyle = dataGridViewCellStyle2; this.ColData.HeaderText = "Code"; this.ColData.Name = "ColData"; // diff --git a/editor source/SPNATI Character Editor/Activities/PoseListEditor.cs b/editor source/SPNATI Character Editor/Activities/PoseListEditor.cs index aab2c9d2ba5cfdb2f37f388db40fba7d24dfea28..3359559b1e69a710c85e0a9defb5b153ae98d0f0 100644 --- a/editor source/SPNATI Character Editor/Activities/PoseListEditor.cs +++ b/editor source/SPNATI Character Editor/Activities/PoseListEditor.cs @@ -216,6 +216,10 @@ namespace SPNATI_Character_Editor.Activities /// <returns></returns> private static string GetKey(string stage, string pose) { + if (string.IsNullOrEmpty(stage)) + { + return pose; + } return string.Format("{0}-{1}", stage, pose); } @@ -303,6 +307,11 @@ namespace SPNATI_Character_Editor.Activities row.Cells["ColStage"].Value = "0"; row.Cells["ColPose"].Value = pose.ImageKey; } + else if (piecedKey.Length == 1) + { + row.Cells["ColStage"].Value = ""; + row.Cells["ColPose"].Value = piecedKey[0]; + } else { row.Cells["ColStage"].Value = piecedKey[0]; @@ -359,9 +368,9 @@ namespace SPNATI_Character_Editor.Activities string stage = row.Cells["ColStage"].Value?.ToString(); string pose = row.Cells["ColPose"].Value?.ToString(); - if (string.IsNullOrEmpty(stage) || string.IsNullOrEmpty(pose)) + if (string.IsNullOrEmpty(pose)) { - MessageBox.Show("Stage and Pose must be filled out.", "Import Pose", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("Pose must be filled out.", "Import Pose", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string data = row.Cells["ColData"].Value?.ToString(); @@ -740,7 +749,29 @@ namespace SPNATI_Character_Editor.Activities private void cutToolStripMenuItem_Click(object sender, EventArgs e) { - if (gridPoses.SelectedRows.Count == 0) { return; } + if (gridPoses.SelectedRows.Count == 0) + { + if (gridPoses.SelectedCells.Count > 0) + { + DataGridViewCell cell = gridPoses.SelectedCells[0]; + if (cell is DataGridViewTextBoxCell) + { + string text = cell.Value?.ToString(); + if (!string.IsNullOrEmpty(text)) + { + Clipboard.Clear(); + Clipboard.SetText(text); + TextBox box = gridPoses.EditingControl as TextBox; + if (box != null) + { + box.Text = ""; + } + } + } + } + return; + } + CopySelectedLine(); //remove the line int index = gridPoses.SelectedRows[0].Index; @@ -749,13 +780,43 @@ namespace SPNATI_Character_Editor.Activities private void copyToolStripMenuItem_Click(object sender, EventArgs e) { - CopySelectedLine(); + var count = gridPoses.SelectedCells.Count; + if (count == 1) + { + //if cursor is in a cell, do standard clipboard action + TextBox box = gridPoses.EditingControl as TextBox; + if (box != null) + { + Clipboard.Clear(); + Clipboard.SetText(box.Text); + } + } + else + { + //otherwise, copy the whole row + CopySelectedLine(); + } } private void pasteToolStripMenuItem_Click(object sender, EventArgs e) { if (_clipboard == null) { return; } - if (gridPoses.SelectedRows.Count == 0) { return; } + if (gridPoses.SelectedRows.Count == 0) + { + if (gridPoses.SelectedCells.Count > 0) + { + DataGridViewCell cell = gridPoses.SelectedCells[0]; + if (cell is DataGridViewTextBoxCell) + { + TextBox box = gridPoses.EditingControl as TextBox; + if (box != null) + { + box.Text = Clipboard.GetText(); + } + } + } + return; + } DataGridViewRow row = gridPoses.SelectedRows[0]; if (row.Index == gridPoses.Rows.Count - 1) diff --git a/editor source/SPNATI Character Editor/CharacterValidator.cs b/editor source/SPNATI Character Editor/CharacterValidator.cs index ec4a5b9309232670c8ece500b6933b9dde2dd31b..0fda0390314edf17fdf2691a9419e502f6c68dfd 100644 --- a/editor source/SPNATI Character Editor/CharacterValidator.cs +++ b/editor source/SPNATI Character Editor/CharacterValidator.cs @@ -378,9 +378,21 @@ namespace SPNATI_Character_Editor if (!string.IsNullOrEmpty(img)) { unusedImages.Remove(img); - if (!File.Exists(Path.Combine(Config.GetRootDirectory(character), img))) + if (img.StartsWith("custom:")) { - warnings.Add(new ValidationError(ValidationFilterLevel.MissingImages, string.Format("{1} does not exist. {0}", caseLabel, img), context)); + string id = img.Substring(7); + Pose pose = character.Poses.Find(p => p.Id == id); + if (pose == null) + { + warnings.Add(new ValidationError(ValidationFilterLevel.MissingImages, string.Format("Pose {1} does not exist. {0}", caseLabel, img), context)); + } + } + else + { + if (!File.Exists(Path.Combine(Config.GetRootDirectory(character), img))) + { + warnings.Add(new ValidationError(ValidationFilterLevel.MissingImages, string.Format("{1} does not exist. {0}", caseLabel, img), context)); + } } stageImages.Add(img); } @@ -423,6 +435,11 @@ namespace SPNATI_Character_Editor ValidateEpilogue(ending, warnings, unusedImages); } + foreach (Pose pose in character.Poses) + { + ValidatePose(character, pose, warnings, unusedImages); + } + if (unusedImages.Count > 0) { warnings.Add(new ValidationError(ValidationFilterLevel.MissingImages, string.Format("The following images are never used: {0}", string.Join(", ", unusedImages)))); @@ -685,6 +702,57 @@ namespace SPNATI_Character_Editor } } + /// <summary> + /// Validates a custom pose + /// </summary> + /// <param name="pose"></param> + /// <param name="warnings"></param> + /// <param name="baseImages"></param> + private static void ValidatePose(Character character, Pose pose, List<ValidationError> warnings, HashSet<string> unusedImages) + { + unusedImages.Remove("custom:" + pose.Id); + foreach (Sprite sprite in pose.Sprites) + { + string path = GetRelativeImagePath(character, sprite.Src); + if (!string.IsNullOrEmpty(path)) + { + unusedImages.Remove(path); + } + } + + foreach (PoseDirective directive in pose.Directives) + { + foreach (Keyframe kf in directive.Keyframes) + { + if (!string.IsNullOrEmpty(kf.Src)) + { + string path = GetRelativeImagePath(character, kf.Src); + if (!string.IsNullOrEmpty(path)) + { + unusedImages.Remove(path); + } + } + } + + foreach (PoseAnimFrame af in directive.AnimFrames) + { + + } + } + } + + private static string GetRelativeImagePath(Character character, string path) + { + string characterRoot = character.GetDirectory(); + string fullPath = Path.Combine(Config.SpnatiDirectory, "opponents", path); + if (fullPath.StartsWith(characterRoot)) + { + string relPath = fullPath.Substring(characterRoot.Length + 1); + return relPath; + } + return path; + } + /// <summary> /// Validates an alternative skin /// </summary> diff --git a/editor source/SPNATI Character Editor/Config.cs b/editor source/SPNATI Character Editor/Config.cs index 138bb77ba5ee0bd42337e318c8037727434e6d33..a19eeabcc9f938bbf4b311b693a06f64c81c55dc 100644 --- a/editor source/SPNATI Character Editor/Config.cs +++ b/editor source/SPNATI Character Editor/Config.cs @@ -10,7 +10,7 @@ namespace SPNATI_Character_Editor /// <summary> /// List of released versions since update tracking was added, used for determining which updates a user skipped and providing info about those /// </summary> - public static readonly string[] VersionHistory = new string[] { "v3.0", "v3.0.1", "v3.1", "v3.2", "v3.3", "v3.3.1", "v3.4" }; + public static readonly string[] VersionHistory = new string[] { "v3.0", "v3.0.1", "v3.1", "v3.2", "v3.3", "v3.3.1", "v3.4", "v3.4.1", "v3.5" }; /// <summary> /// Current Version diff --git a/editor source/SPNATI Character Editor/Controls/CharacterImageBox.Designer.cs b/editor source/SPNATI Character Editor/Controls/CharacterImageBox.Designer.cs index 601f8246a09c50836d7acb88bf78103965252812..06eb1cf2d8d8ebf4d67a5f85c8f268fbe89b8b74 100644 --- a/editor source/SPNATI Character Editor/Controls/CharacterImageBox.Designer.cs +++ b/editor source/SPNATI Character Editor/Controls/CharacterImageBox.Designer.cs @@ -28,7 +28,9 @@ /// </summary> private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.canvas = new Desktop.CommonControls.DBPanel(); + this.tmrTick = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // canvas @@ -40,6 +42,11 @@ this.canvas.TabIndex = 1; this.canvas.Paint += new System.Windows.Forms.PaintEventHandler(this.canvas_Paint); // + // tmrTick + // + this.tmrTick.Interval = 30; + this.tmrTick.Tick += new System.EventHandler(this.tmrTick_Tick); + // // CharacterImageBox // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -53,5 +60,6 @@ #endregion private Desktop.CommonControls.DBPanel canvas; + private System.Windows.Forms.Timer tmrTick; } } diff --git a/editor source/SPNATI Character Editor/Controls/CharacterImageBox.cs b/editor source/SPNATI Character Editor/Controls/CharacterImageBox.cs index 8643bd2e92c657d93dbf5ed743b166f343436ab4..68648906571a1eaf8def5e961c155a801d14e8d6 100644 --- a/editor source/SPNATI Character Editor/Controls/CharacterImageBox.cs +++ b/editor source/SPNATI Character Editor/Controls/CharacterImageBox.cs @@ -1,6 +1,8 @@ using Desktop; using Desktop.Messaging; +using SPNATI_Character_Editor.EpilogueEditing; using System; +using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; @@ -11,8 +13,13 @@ namespace SPNATI_Character_Editor.Controls private CharacterImage _image; private Mailbox _mailbox; private Image _imageReference; + private PosePreview _imagePose; private bool _animating; + private DateTime _lastTick; + + private Dictionary<string, Image> _sprites = new Dictionary<string, Image>(); + public CharacterImageBox() { InitializeComponent(); @@ -29,7 +36,14 @@ namespace SPNATI_Character_Editor.Controls if (_image != null) { _imageReference = null; - _image.ReleaseImage(); + if (_image.Pose != null) + { + _imagePose = null; + } + else + { + _image.ReleaseImage(); + } _image = null; } } @@ -46,17 +60,28 @@ namespace SPNATI_Character_Editor.Controls ImageAnimator.StopAnimate(_imageReference, OnFrameChanged); } _image = image; + _imagePose = null; + tmrTick.Stop(); if (image == null) { _imageReference = null; } else { - _imageReference = image.GetImage(); - if (ImageAnimator.CanAnimate(_imageReference)) + if (image.Pose != null) + { + _imagePose = new PosePreview(image.Skin, image.Pose); + _lastTick = DateTime.Now; + tmrTick.Enabled = _imagePose.IsAnimated; + } + else { - _animating = true; - ImageAnimator.Animate(_imageReference, OnFrameChanged); + _imageReference = image.GetImage(); + if (ImageAnimator.CanAnimate(_imageReference)) + { + _animating = true; + ImageAnimator.Animate(_imageReference, OnFrameChanged); + } } } canvas.Invalidate(); @@ -79,7 +104,11 @@ namespace SPNATI_Character_Editor.Controls private void canvas_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; - if (_imageReference != null) + if (_imagePose != null) + { + _imagePose.Draw(g, canvas.Width, canvas.Height); + } + else if (_imageReference != null) { ImageAnimator.UpdateFrames(); @@ -89,5 +118,22 @@ namespace SPNATI_Character_Editor.Controls g.DrawImage(_imageReference, canvas.Width / 2 - width / 2, 0, width, height); } } + + private void tmrTick_Tick(object sender, EventArgs e) + { + DateTime now = DateTime.Now; + TimeSpan elapsed = now - _lastTick; + float elapsedSec = (float)elapsed.TotalSeconds; + _lastTick = now; + + if (_imagePose == null) + { + tmrTick.Enabled = false; + return; + } + + _imagePose.Update(elapsedSec); + canvas.Invalidate(); + } } } diff --git a/editor source/SPNATI Character Editor/Controls/CharacterImageBox.resx b/editor source/SPNATI Character Editor/Controls/CharacterImageBox.resx index 1af7de150c99c12dd67a509fe57c10d63e4eeb04..2bc86b0be9c05dc939cf6f21d9471309d21a5246 100644 --- a/editor source/SPNATI Character Editor/Controls/CharacterImageBox.resx +++ b/editor source/SPNATI Character Editor/Controls/CharacterImageBox.resx @@ -117,4 +117,7 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <metadata name="tmrTick.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> </root> \ No newline at end of file diff --git a/editor source/SPNATI Character Editor/Controls/CharacterImageDialog.cs b/editor source/SPNATI Character Editor/Controls/CharacterImageDialog.cs index b27ba6df5f93e089481728ba441cb5edd45669e9..f7cef79343ef361d2bfe928f296f3d8fd81075d7 100644 --- a/editor source/SPNATI Character Editor/Controls/CharacterImageDialog.cs +++ b/editor source/SPNATI Character Editor/Controls/CharacterImageDialog.cs @@ -11,6 +11,11 @@ namespace SPNATI_Character_Editor.Controls InitializeComponent(); } + /// <summary> + /// If true, all paths in both character directory and others will be based on "opponents" + /// </summary> + public bool UseAbsolutePaths { get; set; } + private OpenFileDialog openFileDialog1; public string FileName; @@ -37,7 +42,11 @@ namespace SPNATI_Character_Editor.Controls if (!string.IsNullOrEmpty(filename)) { - if (filename.StartsWith("\\")) + if (UseAbsolutePaths) + { + openFileDialog1.InitialDirectory = Path.Combine(root, "opponents", Path.GetDirectoryName(filename)); + } + else if (filename.StartsWith("\\")) { //absolute path openFileDialog1.InitialDirectory = Path.Combine(root, Path.GetDirectoryName(filename).Substring(1)); @@ -58,21 +67,29 @@ namespace SPNATI_Character_Editor.Controls if (result == DialogResult.OK) { filename = openFileDialog1.FileName; - if (filename.StartsWith(localPath)) - { - //file is in character's folder - filename = filename.Substring(localPath.Length + 1); - } - else if (filename.StartsWith(root)) + if (UseAbsolutePaths) { - //file is in another game folder - filename = filename.Substring(root.Length); + string opponentRoot = Path.Combine(root, "opponents") + "\\"; + filename = filename.Substring(opponentRoot.Length); } else { - //file is outside the game, so copy it in (otherwise it won't be available on the website) - File.Copy(filename, Path.Combine(localPath, Path.GetFileName(filename))); - filename = Path.GetFileName(filename); + if (filename.StartsWith(localPath)) + { + //file is in character's folder + filename = filename.Substring(localPath.Length + 1); + } + else if (filename.StartsWith(root)) + { + //file is in another game folder + filename = filename.Substring(root.Length); + } + else + { + //file is outside the game, so copy it in (otherwise it won't be available on the website) + File.Copy(filename, Path.Combine(localPath, Path.GetFileName(filename))); + filename = Path.GetFileName(filename); + } } FileName = filename.Replace("\\", "/"); } diff --git a/editor source/SPNATI Character Editor/Controls/DialogueGrid.Designer.cs b/editor source/SPNATI Character Editor/Controls/DialogueGrid.Designer.cs index 5b046c2a904bdeeece9701e96bd8ba66aa11808a..9fe0e15c6ebd79d864e4630b06852bd18bf34bf9 100644 --- a/editor source/SPNATI Character Editor/Controls/DialogueGrid.Designer.cs +++ b/editor source/SPNATI Character Editor/Controls/DialogueGrid.Designer.cs @@ -36,6 +36,10 @@ this.ColMarker = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColMarkerValue = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColPerTarget = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.ColGender = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.ColLabel = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColIntelligence = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.ColSize = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.ColDirection = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.ColLocation = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColDelete = new System.Windows.Forms.DataGridViewButtonColumn(); @@ -59,6 +63,10 @@ this.ColMarker, this.ColMarkerValue, this.ColPerTarget, + this.ColGender, + this.ColLabel, + this.ColIntelligence, + this.ColSize, this.ColDirection, this.ColLocation, this.ColDelete}); @@ -121,6 +129,48 @@ this.ColPerTarget.Name = "ColPerTarget"; this.ColPerTarget.Width = 70; // + // ColGender + // + this.ColGender.HeaderText = "Gender"; + this.ColGender.Items.AddRange(new object[] { + "", + "female", + "male"}); + this.ColGender.Name = "ColGender"; + this.ColGender.Visible = false; + this.ColGender.Width = 80; + // + // ColLabel + // + this.ColLabel.HeaderText = "Label"; + this.ColLabel.Name = "ColLabel"; + this.ColLabel.Visible = false; + this.ColLabel.Width = 80; + // + // ColIntelligence + // + this.ColIntelligence.HeaderText = "AI"; + this.ColIntelligence.Items.AddRange(new object[] { + "", + "bad", + "average", + "good"}); + this.ColIntelligence.Name = "ColIntelligence"; + this.ColIntelligence.Visible = false; + this.ColIntelligence.Width = 80; + // + // ColSize + // + this.ColSize.HeaderText = "Size"; + this.ColSize.Items.AddRange(new object[] { + "", + "small", + "medium", + "large"}); + this.ColSize.Name = "ColSize"; + this.ColSize.Visible = false; + this.ColSize.Width = 80; + // // ColDirection // this.ColDirection.HeaderText = "Arrow direction"; @@ -169,6 +219,10 @@ private System.Windows.Forms.DataGridViewTextBoxColumn ColMarker; private System.Windows.Forms.DataGridViewTextBoxColumn ColMarkerValue; private System.Windows.Forms.DataGridViewCheckBoxColumn ColPerTarget; + private System.Windows.Forms.DataGridViewComboBoxColumn ColGender; + private System.Windows.Forms.DataGridViewTextBoxColumn ColLabel; + private System.Windows.Forms.DataGridViewComboBoxColumn ColIntelligence; + private System.Windows.Forms.DataGridViewComboBoxColumn ColSize; private System.Windows.Forms.DataGridViewComboBoxColumn ColDirection; private System.Windows.Forms.DataGridViewTextBoxColumn ColLocation; private System.Windows.Forms.DataGridViewButtonColumn ColDelete; diff --git a/editor source/SPNATI Character Editor/Controls/DialogueGrid.cs b/editor source/SPNATI Character Editor/Controls/DialogueGrid.cs index 536211d28689b6099dff7f49f8967b8d8fc6c204..46ce4026dcaf46663c9c7c45e4419a27625fc133 100644 --- a/editor source/SPNATI Character Editor/Controls/DialogueGrid.cs +++ b/editor source/SPNATI Character Editor/Controls/DialogueGrid.cs @@ -158,6 +158,14 @@ namespace SPNATI_Character_Editor.Controls { line.Marker = $"{markerValue}{marker}"; } + else if (markerValue == "+1") + { + line.Marker = $"+{marker}"; + } + else if (markerValue == "-1") + { + line.Marker = $"-{marker}"; + } else { line.Marker = $"{marker}={markerValue}"; @@ -166,6 +174,16 @@ namespace SPNATI_Character_Editor.Controls line.Direction = direction; line.Location = location; + string ai = row.Cells["ColIntelligence"].Value?.ToString(); + string size = row.Cells["ColSize"].Value?.ToString(); + string label = row.Cells["ColLabel"].Value?.ToString(); + string gender = row.Cells["ColGender"].Value?.ToString(); + + line.Intelligence = ai; + line.Size = size; + line.Label = label; + line.Gender = gender; + return line; } @@ -233,9 +251,20 @@ namespace SPNATI_Character_Editor.Controls bool allExist = true; if (!image.IsGeneric) { + bool custom = name.StartsWith("custom:"); + string nameWithoutStage = name; + if (custom) + { + nameWithoutStage = DialogueLine.GetDefaultImage(image.Name.Substring(7)); + } foreach (int stage in selectedStages) { - if (_imageLibrary.Find(stage + "-" + name) == null) + string key = stage + "-" + nameWithoutStage; + if (custom) + { + key = "custom:" + key; + } + if (_imageLibrary.Find(key) == null) { allExist = false; break; @@ -400,11 +429,12 @@ namespace SPNATI_Character_Editor.Controls gridDialogue.EditingControl.Select(); } - public bool ShowSpeechBubbleColumns + public bool ShowAdvancedColumns { set { gridDialogue.Columns["ColDirection"].Visible = gridDialogue.Columns["ColLocation"].Visible = value; + ColGender.Visible = ColSize.Visible = ColIntelligence.Visible = ColLabel.Visible = value; } } @@ -484,6 +514,11 @@ namespace SPNATI_Character_Editor.Controls DataGridViewCell locationCell = row.Cells["ColLocation"]; locationCell.Value = line.Location; + + row.Cells["ColIntelligence"].Value = line.Intelligence; + row.Cells["ColSize"].Value = line.Size; + row.Cells["ColGender"].Value = line.Gender; + row.Cells["ColLabel"].Value = line.Label; } /// <summary> @@ -493,7 +528,7 @@ namespace SPNATI_Character_Editor.Controls /// <param name="key"></param> private void SetImage(DataGridViewComboBoxCell cell, string key) { - string defaultKey = Path.GetFileNameWithoutExtension(DialogueLine.GetDefaultImage(key)); + string defaultKey = DialogueLine.GetDefaultImage(key); foreach (var item in cell.Items) { CharacterImage image = item as CharacterImage; diff --git a/editor source/SPNATI Character Editor/Controls/DialogueGrid.resx b/editor source/SPNATI Character Editor/Controls/DialogueGrid.resx index 2da1ae8659ec3deef8473f744ddf78ade57a2f7c..7d0ac7d4e7a6c86aa1cc33efb193a12fb91bdb2d 100644 --- a/editor source/SPNATI Character Editor/Controls/DialogueGrid.resx +++ b/editor source/SPNATI Character Editor/Controls/DialogueGrid.resx @@ -132,6 +132,18 @@ <metadata name="ColPerTarget.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> + <metadata name="ColGender.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColLabel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColIntelligence.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColSize.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> <metadata name="ColDirection.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> diff --git a/editor source/SPNATI Character Editor/Controls/EditControls/ExpressionControl.Designer.cs b/editor source/SPNATI Character Editor/Controls/EditControls/ExpressionControl.Designer.cs index ae668924de9b1538bfc7a2431e80dd5bc2e79a29..f57080cc44f2c569cdc36760e9590ec21e0cbb2c 100644 --- a/editor source/SPNATI Character Editor/Controls/EditControls/ExpressionControl.Designer.cs +++ b/editor source/SPNATI Character Editor/Controls/EditControls/ExpressionControl.Designer.cs @@ -28,19 +28,12 @@ /// </summary> private void InitializeComponent() { - this.txtExpression = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); - this.txtValue = new System.Windows.Forms.TextBox(); + this.cboValue = new System.Windows.Forms.ComboBox(); + this.cboExpression = new System.Windows.Forms.ComboBox(); this.SuspendLayout(); // - // txtExpression - // - this.txtExpression.Location = new System.Drawing.Point(57, 0); - this.txtExpression.Name = "txtExpression"; - this.txtExpression.Size = new System.Drawing.Size(100, 20); - this.txtExpression.TabIndex = 0; - // // label1 // this.label1.AutoSize = true; @@ -53,39 +46,49 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(163, 2); + this.label2.Location = new System.Drawing.Point(176, 2); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(13, 13); this.label2.TabIndex = 2; this.label2.Text = "="; // - // txtValue + // cboValue + // + this.cboValue.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; + this.cboValue.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; + this.cboValue.FormattingEnabled = true; + this.cboValue.Location = new System.Drawing.Point(191, 0); + this.cboValue.Name = "cboValue"; + this.cboValue.Size = new System.Drawing.Size(112, 21); + this.cboValue.TabIndex = 1; // - this.txtValue.Location = new System.Drawing.Point(182, 0); - this.txtValue.Name = "txtValue"; - this.txtValue.Size = new System.Drawing.Size(100, 20); - this.txtValue.TabIndex = 3; + // cboExpression + // + this.cboExpression.FormattingEnabled = true; + this.cboExpression.Location = new System.Drawing.Point(57, 0); + this.cboExpression.Name = "cboExpression"; + this.cboExpression.Size = new System.Drawing.Size(118, 21); + this.cboExpression.TabIndex = 0; // // ExpressionControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.txtValue); + this.Controls.Add(this.cboExpression); + this.Controls.Add(this.cboValue); this.Controls.Add(this.label2); this.Controls.Add(this.label1); - this.Controls.Add(this.txtExpression); this.Name = "ExpressionControl"; - this.Size = new System.Drawing.Size(433, 20); + this.Size = new System.Drawing.Size(433, 21); this.ResumeLayout(false); this.PerformLayout(); } #endregion - - private System.Windows.Forms.TextBox txtExpression; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox txtValue; + private System.Windows.Forms.ComboBox cboValue; + private System.Windows.Forms.ComboBox cboExpression; } } diff --git a/editor source/SPNATI Character Editor/Controls/EditControls/ExpressionControl.cs b/editor source/SPNATI Character Editor/Controls/EditControls/ExpressionControl.cs index 36705833091cf3d8b3925065ef91bb3574a85175..9968d43eeb034aabb064270e85db4bcd7a87679d 100644 --- a/editor source/SPNATI Character Editor/Controls/EditControls/ExpressionControl.cs +++ b/editor source/SPNATI Character Editor/Controls/EditControls/ExpressionControl.cs @@ -1,44 +1,139 @@ using System; using Desktop; using Desktop.CommonControls; +using System.Windows.Forms; namespace SPNATI_Character_Editor { public partial class ExpressionControl : PropertyEditControl { private ExpressionTest _expression; + private string _currentVariable; public ExpressionControl() { InitializeComponent(); + + cboExpression.Items.AddRange(new string[] { + "~background~", + "~background.location~", + "~clothing~", + "~clothing.position~", + "~player~", + "~weekday~", + }); + cboExpression.AutoCompleteMode = AutoCompleteMode.SuggestAppend; + cboExpression.AutoCompleteSource = AutoCompleteSource.ListItems; } protected override void OnBoundData() { _expression = GetValue() as ExpressionTest; - txtExpression.Text = _expression.Expression; - txtValue.Text = _expression.Value; + cboExpression.Text = _expression.Expression; + cboValue.Text = _expression.Value; + + UpdateAutoComplete(); - txtExpression.TextChanged += TextValueChanged; - txtValue.TextChanged += TextValueChanged; + cboExpression.TextChanged += TextValueChanged; + cboValue.TextChanged += TextValueChanged; } private void TextValueChanged(object sender, EventArgs e) { + UpdateAutoComplete(); Save(); } public override void Clear() { - txtExpression.Text = ""; - txtValue.Text = ""; + cboExpression.Text = ""; + cboValue.Text = ""; Save(); } public override void Save() { - _expression.Expression = txtExpression.Text; - _expression.Value = txtValue.Text; + _expression.Expression = cboExpression.Text; + _expression.Value = cboValue.Text; + } + + private void UpdateAutoComplete() + { + string variable = cboExpression.Text; + if (variable == _currentVariable) + { + return; + } + _currentVariable = variable; + + AutoCompleteStringCollection list = new AutoCompleteStringCollection(); + + cboValue.Items.Clear(); + switch (_currentVariable) + { + case "~clothing.position~": + cboValue.Items.AddRange(new string[] { + "upper", + "lower", + "both", + "head", + "neck", + "hands", + "arms", + "feet", + "legs", + "waist", + "other", + }); + break; + case "~background.location~": + cboValue.Items.AddRange(new string[] { + "indoors", + "outdoors", + }); + break; + case "~background~": + cboValue.Items.AddRange(new string[] { + "inventory", + "beach", + "classroom", + "brick", + "night", + "roof", + "seasonal", + "library", + "bathhouse", + "poolside", + "hot spring", + "mansion", + "purple room", + "showers", + "street", + "green screen", + "arcade", + "club", + "bedroom", + "hall", + "locker room", + "haunted forest", + "romantic", + "classic", + }); + break; + case "~weekday~": + cboValue.Items.AddRange(new string[] { + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + }); + break; + } + cboValue.Sorted = true; + cboValue.AutoCompleteSource = AutoCompleteSource.ListItems; } } diff --git a/editor source/SPNATI Character Editor/Controls/EditControls/ImageFileSelectControl.cs b/editor source/SPNATI Character Editor/Controls/EditControls/ImageFileSelectControl.cs index 1dfd5072064cfcbf870390c76c5142bed720f766..1fbc9cbb5f6de08ce72d6759629ad9e73d942da3 100644 --- a/editor source/SPNATI Character Editor/Controls/EditControls/ImageFileSelectControl.cs +++ b/editor source/SPNATI Character Editor/Controls/EditControls/ImageFileSelectControl.cs @@ -28,6 +28,7 @@ namespace SPNATI_Character_Editor.Controls { throw new Exception("ImageFileSelectControl requires a Character context!"); } + openFileDialog1.UseAbsolutePaths = (context.Context == CharacterContext.Pose); _character = context.Character; txtValue.Text = GetValue()?.ToString(); @@ -75,5 +76,12 @@ namespace SPNATI_Character_Editor.Controls public interface ICharacterContext { ISkin Character { get; } + CharacterContext Context { get; } + } + + public enum CharacterContext + { + Epilogue, + Pose } } diff --git a/editor source/SPNATI Character Editor/Controls/EditControls/NumericRangeControl.Designer.cs b/editor source/SPNATI Character Editor/Controls/EditControls/NumericRangeControl.Designer.cs index 1e79f27d245ef5ff92981e0587e48e1f11496b75..128ad463e8be2c93714b47ab274577b81b8de579 100644 --- a/editor source/SPNATI Character Editor/Controls/EditControls/NumericRangeControl.Designer.cs +++ b/editor source/SPNATI Character Editor/Controls/EditControls/NumericRangeControl.Designer.cs @@ -32,6 +32,7 @@ this.label1 = new System.Windows.Forms.Label(); this.valFrom = new System.Windows.Forms.NumericUpDown(); this.valTo = new System.Windows.Forms.NumericUpDown(); + this.chkUpper = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.valFrom)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.valTo)).BeginInit(); this.SuspendLayout(); @@ -70,10 +71,21 @@ this.valTo.Size = new System.Drawing.Size(41, 20); this.valTo.TabIndex = 8; // + // chkUpper + // + this.chkUpper.AutoSize = true; + this.chkUpper.Location = new System.Drawing.Point(153, 2); + this.chkUpper.Name = "chkUpper"; + this.chkUpper.Size = new System.Drawing.Size(103, 17); + this.chkUpper.TabIndex = 9; + this.chkUpper.Text = "No upper bound"; + this.chkUpper.UseVisualStyleBackColor = true; + // // NumericRangeControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.chkUpper); this.Controls.Add(this.valTo); this.Controls.Add(this.valFrom); this.Controls.Add(this.label2); @@ -92,5 +104,6 @@ private System.Windows.Forms.Label label1; private System.Windows.Forms.NumericUpDown valFrom; private System.Windows.Forms.NumericUpDown valTo; + private System.Windows.Forms.CheckBox chkUpper; } } diff --git a/editor source/SPNATI Character Editor/Controls/EditControls/NumericRangeControl.cs b/editor source/SPNATI Character Editor/Controls/EditControls/NumericRangeControl.cs index f1dd21f93ef27eec63a3dac98362314cbc668ec0..8da5abf4c85b85425d7f6a070713c5f00dd08b25 100644 --- a/editor source/SPNATI Character Editor/Controls/EditControls/NumericRangeControl.cs +++ b/editor source/SPNATI Character Editor/Controls/EditControls/NumericRangeControl.cs @@ -28,8 +28,9 @@ namespace SPNATI_Character_Editor { valFrom.ValueChanged += ValueChanged; valTo.ValueChanged += ValueChanged; - valFrom.TextChanged -= Value_TextChanged; - valTo.TextChanged -= Value_TextChanged; + valFrom.TextChanged += Value_TextChanged; + valTo.TextChanged += Value_TextChanged; + chkUpper.CheckedChanged += ValueChanged; } private void RemoveHandlers() @@ -38,10 +39,12 @@ namespace SPNATI_Character_Editor valTo.ValueChanged -= ValueChanged; valFrom.TextChanged -= Value_TextChanged; valTo.TextChanged -= Value_TextChanged; + chkUpper.CheckedChanged -= ValueChanged; } protected override void OnBoundData() { + chkUpper.Checked = false; string range = GetValue()?.ToString(); if (range == null) { @@ -72,11 +75,12 @@ namespace SPNATI_Character_Editor { //open upper range valTo.Text = ""; + chkUpper.Checked = true; } } else { - valTo.Value = valFrom.Value; //single value uses a closed range with min and max being the same + valTo.Text = ""; } AddHandlers(); } @@ -99,6 +103,10 @@ namespace SPNATI_Character_Editor from = -1; } if (valTo.Text == "") + { + to = from; + } + if (chkUpper.Checked) { to = -1; } diff --git a/editor source/SPNATI Character Editor/Controls/EditControls/PoseStageSelect.Designer.cs b/editor source/SPNATI Character Editor/Controls/EditControls/PoseStageSelect.Designer.cs deleted file mode 100644 index 22494255b37469010b46a64e98da4e13ec0cee24..0000000000000000000000000000000000000000 --- a/editor source/SPNATI Character Editor/Controls/EditControls/PoseStageSelect.Designer.cs +++ /dev/null @@ -1,57 +0,0 @@ -namespace SPNATI_Character_Editor.Controls.EditControls -{ - partial class PoseStageSelect - { - /// <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 Component 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.flowStageChecks = new System.Windows.Forms.FlowLayoutPanel(); - this.SuspendLayout(); - // - // flowStageChecks - // - this.flowStageChecks.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowStageChecks.Location = new System.Drawing.Point(0, 0); - this.flowStageChecks.Name = "flowStageChecks"; - this.flowStageChecks.Size = new System.Drawing.Size(388, 150); - this.flowStageChecks.TabIndex = 0; - // - // PoseStageSelect - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.flowStageChecks); - this.Name = "PoseStageSelect"; - this.Size = new System.Drawing.Size(388, 150); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.FlowLayoutPanel flowStageChecks; - } -} diff --git a/editor source/SPNATI Character Editor/Controls/EditControls/PoseStageSelect.cs b/editor source/SPNATI Character Editor/Controls/EditControls/PoseStageSelect.cs deleted file mode 100644 index bdf31129829d3acdebc85e9df88e9f29dbb884f9..0000000000000000000000000000000000000000 --- a/editor source/SPNATI Character Editor/Controls/EditControls/PoseStageSelect.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Desktop; -using Desktop.CommonControls; -using SPNATI_Character_Editor.Activities; -using System; -using System.Windows.Forms; - -namespace SPNATI_Character_Editor.Controls.EditControls -{ - /// <summary> - /// IMPORTANT - This is NOT a generic control and will only work with a CrossStagePose - /// </summary> - public partial class PoseStageSelect : PropertyEditControl - { - private IWardrobe _wardrobe; - private CrossStagePose _pose; - private Character _character; - - public PoseStageSelect() - { - InitializeComponent(); - } - - protected override void OnBoundData() - { - _pose = Data as CrossStagePose; - - PoseContext context = Context as PoseContext; - if (context != null) - { - _wardrobe = context.Character as IWardrobe; - _character = context.Character.Character; - CreateStageCheckboxes(); - } - } - - private void CreateStageCheckboxes() - { - //Stage checkmarks - for (int i = 0; i < flowStageChecks.Controls.Count; i++) - { - CheckBox box = flowStageChecks.Controls[i] as CheckBox; - if (box != null) - { - box.CheckedChanged -= Check_CheckedChanged; - } - } - flowStageChecks.Controls.Clear(); - - string file = _pose.FileName ?? ""; - - int layers = _character.Layers + Clothing.ExtraStages; - for (int i = 0; i < layers; i++) - { - StageName stage = _character.LayerToStageName(i, false, _wardrobe); - CheckBox check = new CheckBox(); - check.Tag = i; - check.Text = string.Format("{0} ({1})", stage.DisplayName, stage.Id); - check.Width = 180; - check.Margin = new Padding(0); - check.Checked = _pose.Stages.Contains(i); - check.CheckedChanged += Check_CheckedChanged; - check.Enabled = (!file.StartsWith(i.ToString())); - flowStageChecks.Controls.Add(check); - } - } - - private void Check_CheckedChanged(object sender, EventArgs e) - { - CheckBox box = sender as CheckBox; - int stage = (int)box.Tag; - if (box.Checked) - { - _pose.Stages.Add(stage); - } - else - { - _pose.Stages.Remove(stage); - } - } - } - - public class PoseStageAttribute : EditControlAttribute - { - public override Type EditControlType - { - get { return typeof(PoseStageSelect); } - } - } -} diff --git a/editor source/SPNATI Character Editor/Controls/EditControls/PoseStageSelect.resx b/editor source/SPNATI Character Editor/Controls/EditControls/PoseStageSelect.resx deleted file mode 100644 index 1af7de150c99c12dd67a509fe57c10d63e4eeb04..0000000000000000000000000000000000000000 --- a/editor source/SPNATI Character Editor/Controls/EditControls/PoseStageSelect.resx +++ /dev/null @@ -1,120 +0,0 @@ -<?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> \ No newline at end of file diff --git a/editor source/SPNATI Character Editor/Controls/SceneTree.Designer.cs b/editor source/SPNATI Character Editor/Controls/SceneTree.Designer.cs index 65016a237f8038c4bd5a98730a16c7c799adabe5..cbc4bd7fb05bb36ff01cbe23badfcb71a0234c1e 100644 --- a/editor source/SPNATI Character Editor/Controls/SceneTree.Designer.cs +++ b/editor source/SPNATI Character Editor/Controls/SceneTree.Designer.cs @@ -28,7 +28,6 @@ /// </summary> private void InitializeComponent() { - this.treeScenes = new Desktop.CommonControls.DBTreeView(); this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer(); this.lblDragger = new System.Windows.Forms.Label(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); @@ -37,9 +36,11 @@ this.tsAddTransition = new System.Windows.Forms.ToolStripButton(); this.tsAddDirective = new System.Windows.Forms.ToolStripSplitButton(); this.addSpriteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.addEmitterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.removeObjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); + this.addEmitterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.emitParticleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); this.addSpeechBubbleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.removeSpeechBubbleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.clearSpeechBubblesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -63,30 +64,13 @@ this.tsDuplicate = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); this.tsLock = new System.Windows.Forms.ToolStripButton(); - this.emitParticleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); + this.treeScenes = new Desktop.CommonControls.DBTreeView(); this.toolStripContainer1.ContentPanel.SuspendLayout(); this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); this.toolStripContainer1.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // - // treeScenes - // - this.treeScenes.AllowDrop = true; - this.treeScenes.Dock = System.Windows.Forms.DockStyle.Fill; - this.treeScenes.HideSelection = false; - this.treeScenes.Location = new System.Drawing.Point(0, 0); - this.treeScenes.Name = "treeScenes"; - this.treeScenes.Size = new System.Drawing.Size(357, 380); - this.treeScenes.TabIndex = 2; - this.treeScenes.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.TreeScenes_ItemDrag); - this.treeScenes.DragDrop += new System.Windows.Forms.DragEventHandler(this.TreeScenes_DragDrop); - this.treeScenes.DragEnter += new System.Windows.Forms.DragEventHandler(this.TreeScenes_DragEnter); - this.treeScenes.DragOver += new System.Windows.Forms.DragEventHandler(this.TreeScenes_DragOver); - this.treeScenes.DragLeave += new System.EventHandler(this.TreeScenes_DragLeave); - this.treeScenes.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.TreeScenes_QueryContinueDrag); - // // toolStripContainer1 // // @@ -210,26 +194,17 @@ // this.addSpriteToolStripMenuItem.Name = "addSpriteToolStripMenuItem"; this.addSpriteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D1))); - this.addSpriteToolStripMenuItem.Size = new System.Drawing.Size(291, 22); + this.addSpriteToolStripMenuItem.Size = new System.Drawing.Size(277, 22); this.addSpriteToolStripMenuItem.Tag = "sprite"; this.addSpriteToolStripMenuItem.Text = "Add Sprite"; this.addSpriteToolStripMenuItem.ToolTipText = "Add a sprite to the scene"; this.addSpriteToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); // - // addEmitterToolStripMenuItem - // - this.addEmitterToolStripMenuItem.Name = "addEmitterToolStripMenuItem"; - this.addEmitterToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D3))); - this.addEmitterToolStripMenuItem.Size = new System.Drawing.Size(291, 22); - this.addEmitterToolStripMenuItem.Tag = "emitter"; - this.addEmitterToolStripMenuItem.Text = "Add Emitter"; - this.addEmitterToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); - // // removeObjectToolStripMenuItem // this.removeObjectToolStripMenuItem.Name = "removeObjectToolStripMenuItem"; this.removeObjectToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D2))); - this.removeObjectToolStripMenuItem.Size = new System.Drawing.Size(291, 22); + this.removeObjectToolStripMenuItem.Size = new System.Drawing.Size(277, 22); this.removeObjectToolStripMenuItem.Tag = "remove"; this.removeObjectToolStripMenuItem.Text = "Remove Sprite/Emitter"; this.removeObjectToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); @@ -237,13 +212,36 @@ // toolStripSeparator6 // this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(288, 6); + this.toolStripSeparator6.Size = new System.Drawing.Size(274, 6); + // + // addEmitterToolStripMenuItem + // + this.addEmitterToolStripMenuItem.Name = "addEmitterToolStripMenuItem"; + this.addEmitterToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D3))); + this.addEmitterToolStripMenuItem.Size = new System.Drawing.Size(277, 22); + this.addEmitterToolStripMenuItem.Tag = "emitter"; + this.addEmitterToolStripMenuItem.Text = "Add Emitter"; + this.addEmitterToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); + // + // emitParticleToolStripMenuItem + // + this.emitParticleToolStripMenuItem.Name = "emitParticleToolStripMenuItem"; + this.emitParticleToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D4))); + this.emitParticleToolStripMenuItem.Size = new System.Drawing.Size(277, 22); + this.emitParticleToolStripMenuItem.Tag = "emit"; + this.emitParticleToolStripMenuItem.Text = "Emit Particle"; + this.emitParticleToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); + // + // toolStripSeparator8 + // + this.toolStripSeparator8.Name = "toolStripSeparator8"; + this.toolStripSeparator8.Size = new System.Drawing.Size(274, 6); // // addSpeechBubbleToolStripMenuItem // this.addSpeechBubbleToolStripMenuItem.Name = "addSpeechBubbleToolStripMenuItem"; this.addSpeechBubbleToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D5))); - this.addSpeechBubbleToolStripMenuItem.Size = new System.Drawing.Size(291, 22); + this.addSpeechBubbleToolStripMenuItem.Size = new System.Drawing.Size(277, 22); this.addSpeechBubbleToolStripMenuItem.Tag = "text"; this.addSpeechBubbleToolStripMenuItem.Text = "Add Speech Bubble"; this.addSpeechBubbleToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); @@ -252,7 +250,7 @@ // this.removeSpeechBubbleToolStripMenuItem.Name = "removeSpeechBubbleToolStripMenuItem"; this.removeSpeechBubbleToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D6))); - this.removeSpeechBubbleToolStripMenuItem.Size = new System.Drawing.Size(291, 22); + this.removeSpeechBubbleToolStripMenuItem.Size = new System.Drawing.Size(277, 22); this.removeSpeechBubbleToolStripMenuItem.Tag = "clear"; this.removeSpeechBubbleToolStripMenuItem.Text = "Remove Speech Bubble"; this.removeSpeechBubbleToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); @@ -261,7 +259,7 @@ // this.clearSpeechBubblesToolStripMenuItem.Name = "clearSpeechBubblesToolStripMenuItem"; this.clearSpeechBubblesToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D7))); - this.clearSpeechBubblesToolStripMenuItem.Size = new System.Drawing.Size(291, 22); + this.clearSpeechBubblesToolStripMenuItem.Size = new System.Drawing.Size(277, 22); this.clearSpeechBubblesToolStripMenuItem.Tag = "clear-all"; this.clearSpeechBubblesToolStripMenuItem.Text = "Clear Speech Bubbles"; this.clearSpeechBubblesToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); @@ -269,15 +267,15 @@ // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(288, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(274, 6); // // moveSpriteToolStripMenuItem // this.moveSpriteToolStripMenuItem.Name = "moveSpriteToolStripMenuItem"; this.moveSpriteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D8))); - this.moveSpriteToolStripMenuItem.Size = new System.Drawing.Size(291, 22); + this.moveSpriteToolStripMenuItem.Size = new System.Drawing.Size(277, 22); this.moveSpriteToolStripMenuItem.Tag = "move"; - this.moveSpriteToolStripMenuItem.Text = "Move/Rotate/Scale Sprite/Emitter"; + this.moveSpriteToolStripMenuItem.Text = "Animate Sprite/Emitter"; this.moveSpriteToolStripMenuItem.ToolTipText = "Transform a sprite on screen"; this.moveSpriteToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); // @@ -285,7 +283,7 @@ // this.moveZoomCameraToolStripMenuItem.Name = "moveZoomCameraToolStripMenuItem"; this.moveZoomCameraToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D9))); - this.moveZoomCameraToolStripMenuItem.Size = new System.Drawing.Size(291, 22); + this.moveZoomCameraToolStripMenuItem.Size = new System.Drawing.Size(277, 22); this.moveZoomCameraToolStripMenuItem.Tag = "camera"; this.moveZoomCameraToolStripMenuItem.Text = "Move/Zoom Camera"; this.moveZoomCameraToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); @@ -294,7 +292,7 @@ // this.stopAnimationToolStripMenuItem.Name = "stopAnimationToolStripMenuItem"; this.stopAnimationToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D0))); - this.stopAnimationToolStripMenuItem.Size = new System.Drawing.Size(291, 22); + this.stopAnimationToolStripMenuItem.Size = new System.Drawing.Size(277, 22); this.stopAnimationToolStripMenuItem.Tag = "stop"; this.stopAnimationToolStripMenuItem.Text = "Stop Animation"; this.stopAnimationToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); @@ -302,14 +300,14 @@ // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(288, 6); + this.toolStripSeparator4.Size = new System.Drawing.Size(274, 6); // // fadeEffectToolStripMenuItem // this.fadeEffectToolStripMenuItem.Name = "fadeEffectToolStripMenuItem"; this.fadeEffectToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.D1))); - this.fadeEffectToolStripMenuItem.Size = new System.Drawing.Size(291, 22); + this.fadeEffectToolStripMenuItem.Size = new System.Drawing.Size(277, 22); this.fadeEffectToolStripMenuItem.Tag = "fade"; this.fadeEffectToolStripMenuItem.Text = "Fade Effect"; this.fadeEffectToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); @@ -317,14 +315,14 @@ // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(288, 6); + this.toolStripSeparator3.Size = new System.Drawing.Size(274, 6); // // waitForAnimationsToolStripMenuItem // this.waitForAnimationsToolStripMenuItem.Name = "waitForAnimationsToolStripMenuItem"; this.waitForAnimationsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.Space))); - this.waitForAnimationsToolStripMenuItem.Size = new System.Drawing.Size(291, 22); + this.waitForAnimationsToolStripMenuItem.Size = new System.Drawing.Size(277, 22); this.waitForAnimationsToolStripMenuItem.Tag = "wait"; this.waitForAnimationsToolStripMenuItem.Text = "Wait for Animations"; this.waitForAnimationsToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); @@ -333,7 +331,7 @@ // this.waitForInputToolStripMenuItem.Name = "waitForInputToolStripMenuItem"; this.waitForInputToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Space))); - this.waitForInputToolStripMenuItem.Size = new System.Drawing.Size(291, 22); + this.waitForInputToolStripMenuItem.Size = new System.Drawing.Size(277, 22); this.waitForInputToolStripMenuItem.Tag = "pause"; this.waitForInputToolStripMenuItem.Text = "Wait For Input"; this.waitForInputToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); @@ -435,19 +433,21 @@ this.tsLock.Text = "Lock changes in canvas"; this.tsLock.Click += new System.EventHandler(this.tsLock_Click); // - // emitParticleToolStripMenuItem - // - this.emitParticleToolStripMenuItem.Name = "emitParticleToolStripMenuItem"; - this.emitParticleToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D4))); - this.emitParticleToolStripMenuItem.Size = new System.Drawing.Size(291, 22); - this.emitParticleToolStripMenuItem.Tag = "emit"; - this.emitParticleToolStripMenuItem.Text = "Emit Particle"; - this.emitParticleToolStripMenuItem.Click += new System.EventHandler(this.AddDirectiveToolstripItem_Click); - // - // toolStripSeparator8 + // treeScenes // - this.toolStripSeparator8.Name = "toolStripSeparator8"; - this.toolStripSeparator8.Size = new System.Drawing.Size(288, 6); + this.treeScenes.AllowDrop = true; + this.treeScenes.Dock = System.Windows.Forms.DockStyle.Fill; + this.treeScenes.HideSelection = false; + this.treeScenes.Location = new System.Drawing.Point(0, 0); + this.treeScenes.Name = "treeScenes"; + this.treeScenes.Size = new System.Drawing.Size(357, 380); + this.treeScenes.TabIndex = 2; + this.treeScenes.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.TreeScenes_ItemDrag); + this.treeScenes.DragDrop += new System.Windows.Forms.DragEventHandler(this.TreeScenes_DragDrop); + this.treeScenes.DragEnter += new System.Windows.Forms.DragEventHandler(this.TreeScenes_DragEnter); + this.treeScenes.DragOver += new System.Windows.Forms.DragEventHandler(this.TreeScenes_DragOver); + this.treeScenes.DragLeave += new System.EventHandler(this.TreeScenes_DragLeave); + this.treeScenes.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.TreeScenes_QueryContinueDrag); // // SceneTree // diff --git a/editor source/SPNATI Character Editor/DataStructures/Behaviour.cs b/editor source/SPNATI Character Editor/DataStructures/Behaviour.cs index a53564be8fec825a612e457fac18ee5dfe6490f8..1c26ab60b35d9110d183cc270c3219a0dd013336 100644 --- a/editor source/SPNATI Character Editor/DataStructures/Behaviour.cs +++ b/editor source/SPNATI Character Editor/DataStructures/Behaviour.cs @@ -112,14 +112,19 @@ namespace SPNATI_Character_Editor public static DialogueLine CreateStageSpecificLine(DialogueLine line, int stage, Character character) { DialogueLine copy = line.Copy(); + bool custom = copy.Image != null && copy.Image.StartsWith("custom:"); if (copy.Image != null) { copy.Image = Path.GetFileNameWithoutExtension(copy.Image); + if (custom) + { + copy.Image = "custom:" + copy.Image; + } } string path = character != null ? Config.GetRootDirectory(character) : ""; string extension = line.ImageExtension; - if (string.IsNullOrEmpty(extension)) + if (string.IsNullOrEmpty(extension) && !custom) { //figure out the extension by searching for files of different names bool basePngExists = File.Exists(Path.Combine(path, copy.Image + ".png")); @@ -151,7 +156,7 @@ namespace SPNATI_Character_Editor } } - if (!copy.Image.StartsWith(stage + "-") && !File.Exists(Path.Combine(path, copy.Image + extension))) + if (!custom && !copy.Image.StartsWith(stage + "-") && !File.Exists(Path.Combine(path, copy.Image + extension))) { copy.Image = stage + "-" + copy.Image; } @@ -256,7 +261,7 @@ namespace SPNATI_Character_Editor string extension = line.ImageExtension ?? Path.GetExtension(line.Image); copy.ImageExtension = extension; line.ImageExtension = extension; - copy.Image = Path.GetFileNameWithoutExtension(DialogueLine.GetDefaultImage(line.Image)); + copy.Image = DialogueLine.GetDefaultImage(line.Image); copy.Text = line.Text.Trim(); return copy; } diff --git a/editor source/SPNATI Character Editor/DataStructures/Case.cs b/editor source/SPNATI Character Editor/DataStructures/Case.cs index 75266229afc2b6b76c6a9e0426c99f89d0de2d14..43940872414c781e7aba02b68a688ac8f1972185 100644 --- a/editor source/SPNATI Character Editor/DataStructures/Case.cs +++ b/editor source/SPNATI Character Editor/DataStructures/Case.cs @@ -1432,6 +1432,18 @@ namespace SPNATI_Character_Editor { return tag; } + else if (tag == "opponent_lost") + { + return "must_strip"; + } + else if (tag == "opponent_stripping") + { + return "stripping"; + } + else if (tag == "opponent_stripped") + { + return "stripped"; + } } if (tag == "good_hand" || tag == "okay_hand" || tag == "bad_hand") diff --git a/editor source/SPNATI Character Editor/DataStructures/CaseNote.cs b/editor source/SPNATI Character Editor/DataStructures/CaseNote.cs new file mode 100644 index 0000000000000000000000000000000000000000..f0f3df9c3f6f259855a4115dbe4bd48ac948965a --- /dev/null +++ b/editor source/SPNATI Character Editor/DataStructures/CaseNote.cs @@ -0,0 +1,12 @@ +using System.Xml.Serialization; + +namespace SPNATI_Character_Editor +{ + public class CaseNote + { + [XmlAttribute("id")] + public int Id; + [XmlText] + public string Text; + } +} diff --git a/editor source/SPNATI Character Editor/DataStructures/Character.cs b/editor source/SPNATI Character Editor/DataStructures/Character.cs index 8e5b036f15df8b9f16f35eb48dd155dc269d6d0f..15437096a2cccba0e0c680840f45789a28e19e33 100644 --- a/editor source/SPNATI Character Editor/DataStructures/Character.cs +++ b/editor source/SPNATI Character Editor/DataStructures/Character.cs @@ -463,6 +463,10 @@ namespace SPNATI_Character_Editor { ending.OnAfterDeserialize(); } + foreach (Pose pose in Poses) + { + pose.OnAfterDeserialize(); + } } #endregion @@ -713,6 +717,12 @@ namespace SPNATI_Character_Editor { return null; } + + public List<Pose> CustomPoses + { + get { return Poses; } + set { Poses = value; } + } } /// <summary> diff --git a/editor source/SPNATI Character Editor/DataStructures/CharacterEditorData.cs b/editor source/SPNATI Character Editor/DataStructures/CharacterEditorData.cs index 095fe3a0de5d9a109478585b631882164dd4b6f8..2f1a0e80720825731254c0f1f0743d92172c6dfe 100644 --- a/editor source/SPNATI Character Editor/DataStructures/CharacterEditorData.cs +++ b/editor source/SPNATI Character Editor/DataStructures/CharacterEditorData.cs @@ -38,19 +38,17 @@ namespace SPNATI_Character_Editor /// </summary> public List<SituationResponse> Responses = new List<SituationResponse>(); + [XmlArray("notes")] + [XmlArrayItem("note")] + public List<CaseNote> Notes = new List<CaseNote>(); + private Dictionary<int, string> _notes = new Dictionary<int, string>(); + [XmlElement("nextId")] /// <summary> /// Next unique ID to assign /// </summary> public int NextId; - [XmlArray("poses")] - [XmlArrayItem("pose")] - /// <summary> - /// Poses available to a stage that don't meet follow prefix conventions - /// </summary> - public List<CrossStagePose> Poses = new List<CrossStagePose>(); - /// <summary> /// Deferred initialization of things that aren't part of serialization and don't need to exist until the character's lines are being worked on /// </summary> @@ -110,6 +108,8 @@ namespace SPNATI_Character_Editor break; } } + + _notes.Remove(deletedCase.Id); } } @@ -126,9 +126,11 @@ namespace SPNATI_Character_Editor public void OnBeforeSerialize() { - foreach (CrossStagePose pose in Poses) + Notes.Clear(); + foreach (KeyValuePair<int, string> kvp in _notes) { - pose.OnBeforeSerialize(); + CaseNote note = new CaseNote() { Id = kvp.Key, Text = kvp.Value }; + Notes.Add(note); } } @@ -139,9 +141,9 @@ namespace SPNATI_Character_Editor c.OnAfterDeserialize(); } - foreach (CrossStagePose pose in Poses) + foreach (CaseNote note in Notes) { - pose.OnAfterDeserialize(); + _notes[note.Id] = note.Text; } } @@ -243,6 +245,28 @@ namespace SPNATI_Character_Editor SituationResponse situationResponse = new SituationResponse(response, opponent, opponentCase); Responses.Add(situationResponse); } + + public void SetNote(Case workingCase, string text) + { + if (string.IsNullOrEmpty(text)) + { + _notes.Remove(workingCase.Id); + return; + } + AssignId(workingCase); + _notes[workingCase.Id] = text; + } + + public string GetNote(Case workingCase) + { + if (workingCase.Id == 0) + { + return ""; + } + string text = ""; + _notes.TryGetValue(workingCase.Id, out text); + return text; + } } public class Situation diff --git a/editor source/SPNATI Character Editor/DataStructures/CrossStagePose.cs b/editor source/SPNATI Character Editor/DataStructures/CrossStagePose.cs deleted file mode 100644 index 001072e073df60450bcaf6f5286a9cb3112851a5..0000000000000000000000000000000000000000 --- a/editor source/SPNATI Character Editor/DataStructures/CrossStagePose.cs +++ /dev/null @@ -1,105 +0,0 @@ -using SPNATI_Character_Editor.Controls; -using SPNATI_Character_Editor.Controls.EditControls; -using System.Collections.Generic; -using System.Text; -using System.Xml.Serialization; - -namespace SPNATI_Character_Editor -{ - public class CrossStagePose : IHookSerialization - { - [FileSelect(DisplayName = "Path")] - [XmlAttribute("src")] - public string FileName; - - [XmlAttribute("stage")] - public string Stage; - - [PoseStage(DisplayName = "Stages", RowHeight = 300)] - public HashSet<int> Stages = new HashSet<int>(); - - public override string ToString() - { - return FileName ?? "Orphaned pose"; - } - - private void ParseStageString() - { - Stages.Clear(); - if (!string.IsNullOrEmpty(Stage)) - { - //convert range string into a set of stages - string[] ranges = Stage.Split(','); - foreach (string range in ranges) - { - string[] minMax = range.Split('-'); - int min, max; - int.TryParse(minMax[0], out min); - if (minMax.Length == 1 || !int.TryParse(minMax[1], out max)) - { - max = min; - } - for (int i = min; i <= max; i++) - { - Stages.Add(i); - } - } - } - } - - private string StageRangeToString() - { - //turn the stage map into a string of ranges - List<int> stages = new List<int>(); - if (Stages.Count == 0) - { - return ""; - } - stages.AddRange(Stages); - stages.Sort(); - int last = stages[0]; - int startRange = last; - - StringBuilder sb = new StringBuilder(); - - for (int i = 1; i < stages.Count; i++) - { - int stage = stages[i]; - if (stage - 1 > last) - { - if (startRange == last) - { - sb.Append(startRange.ToString() + ","); - } - else - { - sb.Append($"{startRange}-{last},"); - } - startRange = stage; - } - last = stage; - } - if (startRange == last) - { - sb.Append(startRange.ToString()); - } - else - { - sb.Append($"{startRange}-{last}"); - } - - return sb.ToString(); - } - - public void OnAfterDeserialize() - { - ParseStageString(); - } - - public void OnBeforeSerialize() - { - - Stage = StageRangeToString(); - } - } -} diff --git a/editor source/SPNATI Character Editor/DataStructures/Directive.cs b/editor source/SPNATI Character Editor/DataStructures/Directive.cs index 42e99060dc84ea6f3b53ca1b8ec1cc70bddca815..4119e82e4ea4c98751b2e63e75e2f5109289f4a0 100644 --- a/editor source/SPNATI Character Editor/DataStructures/Directive.cs +++ b/editor source/SPNATI Character Editor/DataStructures/Directive.cs @@ -19,10 +19,6 @@ namespace SPNATI_Character_Editor [XmlAttribute("id")] public string Id; - [FileSelect(DisplayName = "Source", GroupOrder = 5, Key = "src", Description = "Sprite source image")] - [XmlAttribute("src")] - public string Src; - [Measurement(DisplayName = "Width", Key = "width", GroupOrder = 95, Description = "Custom sprite width relative to the scene width")] [XmlAttribute("width")] public string Width; @@ -70,6 +66,11 @@ namespace SPNATI_Character_Editor [XmlAttribute("layer")] public int Layer; + [DefaultValue(0)] + [Numeric(DisplayName = "Layer", Key = "z", GroupOrder = 6, Description = "Sort order layer", Minimum = 0, Maximum = 100)] + [XmlAttribute("z")] + public int Z; + [Text(DisplayName = "Text", Key = "text", GroupOrder = 5, Description = "Speech bubble text", RowHeight = 52, Multiline = true)] [XmlText] public string Text; @@ -143,6 +144,11 @@ namespace SPNATI_Character_Editor [Numeric(DisplayName = "Count", Key = "count", GroupOrder = 10, Description = "Number of particles to emit", Minimum = 1, Maximum = 100)] [XmlAttribute("count")] public int Count; + + [Boolean(DisplayName = "Ignore rotation", Key = "ignoreRotation", GroupOrder = 19, Description = "If true, particles will spawn facing upwards regardless of the emitter's current rotation")] + [DefaultValue(false)] + [XmlAttribute("ignoreRotation")] + public bool IgnoreRotation; #endregion [XmlElement("keyframe")] @@ -169,7 +175,7 @@ namespace SPNATI_Character_Editor string delay = string.IsNullOrEmpty(Delay) ? "" : $" delay {Delay}s"; string loop = Looped ? " (loop)" : ""; string props = GetProperties(); - text = $"Move sprite ({Id}) {time}{loop}{delay}{(props.Length > 0 ? "-" + props : "")}"; + text = $"Animate ({Id}) {time}{loop}{delay}{(props.Length > 0 ? "-" + props : "")}"; break; case "wait": text = "Wait for Animations"; @@ -322,6 +328,10 @@ namespace SPNATI_Character_Editor [XmlAttribute("rate")] public string Rate; + [FileSelect(DisplayName = "Source", GroupOrder = 5, Key = "src", Description = "Sprite source image")] + [XmlAttribute("src")] + public string Src; + [Measurement(DisplayName = "X", Key = "x", GroupOrder = 10, Description = "Scene X position")] [XmlAttribute("x")] public string X; @@ -375,7 +385,7 @@ namespace SPNATI_Character_Editor public bool HasAnimatableProperties() { return !string.IsNullOrEmpty(X) || !string.IsNullOrEmpty(Y) || !string.IsNullOrEmpty(Scale) || !string.IsNullOrEmpty(ScaleX) || !string.IsNullOrEmpty(ScaleY) - || !string.IsNullOrEmpty(Color) || !string.IsNullOrEmpty(Opacity) || !string.IsNullOrEmpty(Rotation) || !string.IsNullOrEmpty(Zoom); + || !string.IsNullOrEmpty(Color) || !string.IsNullOrEmpty(Opacity) || !string.IsNullOrEmpty(Rotation) || !string.IsNullOrEmpty(Zoom) || !string.IsNullOrEmpty(Src); } public Keyframe() { } @@ -398,6 +408,7 @@ namespace SPNATI_Character_Editor Opacity = src.Opacity; Rotation = src.Rotation; Zoom = src.Zoom; + Src = src.Src; src.Time = null; src.X = null; @@ -409,6 +420,7 @@ namespace SPNATI_Character_Editor src.Zoom = null; src.ScaleX = null; src.ScaleY = null; + src.Src = null; } public string GetProperties() @@ -442,6 +454,10 @@ namespace SPNATI_Character_Editor { sb.Append($" Zoom:{Zoom}"); } + if (!string.IsNullOrEmpty(Src)) + { + sb.Append($" Src:{Src}"); + } return sb.ToString(); } diff --git a/editor source/SPNATI Character Editor/DataStructures/ISkin.cs b/editor source/SPNATI Character Editor/DataStructures/ISkin.cs index 32a940a845fe2263b3bdb1ac966780550b0c37e6..221f867aa36023a1609c73caebee841d5e8ee43a 100644 --- a/editor source/SPNATI Character Editor/DataStructures/ISkin.cs +++ b/editor source/SPNATI Character Editor/DataStructures/ISkin.cs @@ -29,5 +29,10 @@ namespace SPNATI_Character_Editor /// Associated character /// </summary> Character Character { get; } + /// <summary> + /// Gets a list of custom poses associated with this skin + /// </summary> + /// <returns></returns> + List<Pose> CustomPoses { get; set; } } } diff --git a/editor source/SPNATI Character Editor/DataStructures/Metadata.cs b/editor source/SPNATI Character Editor/DataStructures/Metadata.cs index 065687e1adf1a64d2977dd1983fa525e54d5fe99..3badde4693d8bee388f1578e4c9b842ffce6c172 100644 --- a/editor source/SPNATI Character Editor/DataStructures/Metadata.cs +++ b/editor source/SPNATI Character Editor/DataStructures/Metadata.cs @@ -81,7 +81,10 @@ namespace SPNATI_Character_Editor FirstName = c.FirstName; LastName = c.LastName; Label = c.Label; - Gender = c.Gender; + if (string.IsNullOrEmpty(Gender)) + { + Gender = c.Gender; + } Layers = c.Layers; Endings = c.Endings.ConvertAll(e => new EpilogueMeta { diff --git a/editor source/SPNATI Character Editor/DataStructures/Pose.cs b/editor source/SPNATI Character Editor/DataStructures/Pose.cs index 0029bfcc232538e8e4d3ea286f01226ce2e021fb..ebf4797ff28a73b0edc390526dc036336b340245 100644 --- a/editor source/SPNATI Character Editor/DataStructures/Pose.cs +++ b/editor source/SPNATI Character Editor/DataStructures/Pose.cs @@ -1,4 +1,7 @@ -using System.Collections.Generic; +using Desktop.CommonControls.PropertyControls; +using System; +using System.Collections.Generic; +using System.ComponentModel; using System.Xml.Serialization; namespace SPNATI_Character_Editor @@ -6,15 +9,57 @@ namespace SPNATI_Character_Editor /// <summary> /// Pose composed of sprites and animations /// </summary> - public class Pose + public class Pose : ICloneable { + [Text(DisplayName = "ID", GroupOrder = 0)] [XmlAttribute("id")] public string Id; + [Float(DisplayName = "Base Height", Key = "baseHeight", GroupOrder = 10, Minimum = 0, Maximum = 50000, DecimalPlaces = 0)] + [DefaultValue("1400")] + [XmlAttribute("baseHeight")] + public string BaseHeight = "1400"; + + [XmlIgnore] + public CharacterImage ImageLink; + [XmlElement("sprite")] public List<Sprite> Sprites = new List<Sprite>(); [XmlElement("directive")] public List<PoseDirective> Directives = new List<PoseDirective>(); + + public override string ToString() + { + return Id; + } + + public object Clone() + { + Pose pose = MemberwiseClone() as Pose; + pose.Sprites = new List<Sprite>(); + foreach (Sprite sprite in Sprites) + { + Sprite clonedSprite = sprite.Clone() as Sprite; + pose.Sprites.Add(clonedSprite); + } + + pose.Directives = new List<PoseDirective>(); + foreach (PoseDirective directive in Directives) + { + PoseDirective clonedDirective = directive.Clone() as PoseDirective; + pose.Directives.Add(clonedDirective); + } + return pose; + } + + public void OnAfterDeserialize() + { + foreach (Sprite sprite in Sprites) + { + sprite.ScaleX = sprite.ScaleX ?? sprite.Scale; + sprite.ScaleY = sprite.ScaleY ?? sprite.Scale; + } + } } } diff --git a/editor source/SPNATI Character Editor/DataStructures/PoseDirective.cs b/editor source/SPNATI Character Editor/DataStructures/PoseDirective.cs index 2d00ead0de041876ecd1098ec5f4204fd1d97803..88c030ee86d74bd38b8722ab4be9ae0c0ae52671 100644 --- a/editor source/SPNATI Character Editor/DataStructures/PoseDirective.cs +++ b/editor source/SPNATI Character Editor/DataStructures/PoseDirective.cs @@ -1,6 +1,65 @@ -namespace SPNATI_Character_Editor +using System; +using System.Collections.Generic; +using System.Xml.Serialization; + +namespace SPNATI_Character_Editor { - public class PoseDirective + public class PoseDirective : Directive { + [XmlAttribute("frameTime")] + public string FrameTime; + + [XmlElement("animFrame")] + public List<PoseAnimFrame> AnimFrames = new List<PoseAnimFrame>(); + + public override string ToString() + { + switch (DirectiveType) + { + case "animation": + return $"Animate: {Id}"; + case "sequence": + return $"Sequence: {Id}"; + } + return "New Directive"; + } + + public override object Clone() + { + PoseDirective clone = MemberwiseClone() as PoseDirective; + clone.Keyframes = new List<Keyframe>(); + foreach (Keyframe kf in Keyframes) + { + Keyframe clonedFrame = kf.Clone() as Keyframe; + clonedFrame.Directive = clone; + clone.Keyframes.Add(clonedFrame); + } + clone.AnimFrames = new List<PoseAnimFrame>(); + foreach (PoseAnimFrame pf in AnimFrames) + { + PoseAnimFrame clonedFrame = pf.Clone() as PoseAnimFrame; + clonedFrame.Directive = clone; + clone.AnimFrames.Add(clonedFrame); + } + return clone; + } + } + + public class PoseAnimFrame : ICloneable + { + /// <summary> + /// Parent directive + /// </summary> + [XmlIgnore] + public Directive Directive { get; set; } + + [XmlAttribute("id")] + public string Id; + + public object Clone() + { + PoseAnimFrame frame = MemberwiseClone() as PoseAnimFrame; + return frame; + } } } diff --git a/editor source/SPNATI Character Editor/DataStructures/Skin.cs b/editor source/SPNATI Character Editor/DataStructures/Skin.cs index e111b517f3e88c89953996960fc9e699bc002f9b..8851318f991f5d0f5f1cfdd8e40a19395af9171e 100644 --- a/editor source/SPNATI Character Editor/DataStructures/Skin.cs +++ b/editor source/SPNATI Character Editor/DataStructures/Skin.cs @@ -205,13 +205,23 @@ namespace SPNATI_Character_Editor if (stage < endStage) { DialogueLine stageLine = Behaviour.CreateStageSpecificLine(line, stage, Character); - images.Add(Path.GetFileNameWithoutExtension(stageLine.Image)); + string name = Path.GetFileNameWithoutExtension(stageLine.Image); + if (!name.StartsWith("custom:")) + { + images.Add(name); + } } } } } return images; } + + public List<Pose> CustomPoses + { + get { return Poses; } + set { Poses = value; } + } } /// <summary> diff --git a/editor source/SPNATI Character Editor/DataStructures/Sprite.cs b/editor source/SPNATI Character Editor/DataStructures/Sprite.cs index 711642fae8ded485b1393436a1c0611951ec4571..c158211e0f356ae6d6a694fe8bcff63d556ce912 100644 --- a/editor source/SPNATI Character Editor/DataStructures/Sprite.cs +++ b/editor source/SPNATI Character Editor/DataStructures/Sprite.cs @@ -3,7 +3,11 @@ /// <summary> /// In-game (non-epilogue) sprite /// </summary> - public class Sprite + public class Sprite : Directive { + public override string ToString() + { + return $"Sprite: {Id}"; + } } -} +} \ No newline at end of file diff --git a/editor source/SPNATI Character Editor/DialogueLine.cs b/editor source/SPNATI Character Editor/DialogueLine.cs index 5f9219ba988c0a4e35cb250ff9c9faec9074d205..a54036a2f004cd3bd507d7da7f5bdd068abb2f25 100644 --- a/editor source/SPNATI Character Editor/DialogueLine.cs +++ b/editor source/SPNATI Character Editor/DialogueLine.cs @@ -28,6 +28,22 @@ namespace SPNATI_Character_Editor [XmlAttribute("location")] public string Location; + [DefaultValue("")] + [XmlAttribute("set-gender")] + public string Gender; + + [DefaultValue("")] + [XmlAttribute("set-intelligence")] + public string Intelligence; + + [DefaultValue("")] + [XmlAttribute("set-size")] + public string Size; + + [DefaultValue("")] + [XmlAttribute("set-label")] + public string Label; + [XmlIgnore] public string ImageExtension; @@ -60,6 +76,10 @@ namespace SPNATI_Character_Editor hash = (hash * 397) ^ (Marker ?? string.Empty).GetHashCode(); hash = (hash * 397) ^ (Direction ?? string.Empty).GetHashCode(); hash = (hash * 397) ^ (Location ?? string.Empty).GetHashCode(); + hash = (hash * 397) ^ (Gender ?? string.Empty).GetHashCode(); + hash = (hash * 397) ^ (Intelligence ?? string.Empty).GetHashCode(); + hash = (hash * 397) ^ (Size ?? string.Empty).GetHashCode(); + hash = (hash * 397) ^ (Label ?? string.Empty).GetHashCode(); return hash; } @@ -72,6 +92,8 @@ namespace SPNATI_Character_Editor { if (string.IsNullOrEmpty(image)) return image; + bool custom = image.StartsWith("custom:"); + int hyphen = image.IndexOf('-'); if (hyphen > 0) { @@ -79,10 +101,20 @@ namespace SPNATI_Character_Editor int value; if (int.TryParse(prefix, out value)) { - return Path.GetFileNameWithoutExtension(image.Substring(hyphen + 1)); + string reduced = Path.GetFileNameWithoutExtension(image.Substring(hyphen + 1)); + if (custom) + { + reduced = "custom:" + reduced; + } + return reduced; } } - return Path.GetFileNameWithoutExtension(image); + string path = Path.GetFileNameWithoutExtension(image); + if (custom) + { + path = "custom:" + path; + } + return path; } /// <summary> diff --git a/editor source/SPNATI Character Editor/EpilogueEditing/EpilogueCanvas.cs b/editor source/SPNATI Character Editor/EpilogueEditing/EpilogueCanvas.cs index ea6cd4284110e57755e18ac535a0a5cee88af808..c91a2e838dabfde0861defb3a4f4fc7ef058cfbe 100644 --- a/editor source/SPNATI Character Editor/EpilogueEditing/EpilogueCanvas.cs +++ b/editor source/SPNATI Character Editor/EpilogueEditing/EpilogueCanvas.cs @@ -1731,7 +1731,7 @@ namespace SPNATI_Character_Editor.Controls return; } - _scenePreview = new ScenePreview(_selectedScene); + _scenePreview = new ScenePreview(_selectedScene, _character); _overlay = new SceneObject(_scenePreview, _character, null, null, null); _overlay.Id = "fade"; _overlay.SetColor(_epilogue, _selectedScene); @@ -1812,8 +1812,11 @@ namespace SPNATI_Character_Editor.Controls canvas.Invalidate(); break; case "remove": - _scenePreview.Objects.Remove(obj); - obj.Dispose(); + if (obj != null) + { + _scenePreview.Objects.Remove(obj); + obj.Dispose(); + } canvas.Invalidate(); break; case "fade": @@ -2386,6 +2389,7 @@ namespace SPNATI_Character_Editor.Controls public class EpilogueContext : IAutoCompleteList, ICharacterContext { public ISkin Character { get; set; } + public CharacterContext Context { get; private set; } public Epilogue Epilogue { get; set; } public Scene Scene { get; set; } @@ -2394,6 +2398,7 @@ namespace SPNATI_Character_Editor.Controls Character = character; Epilogue = epilogue; Scene = scene; + Context = CharacterContext.Epilogue; } public override string ToString() diff --git a/editor source/SPNATI Character Editor/EpilogueEditing/PoseAnimation.cs b/editor source/SPNATI Character Editor/EpilogueEditing/PoseAnimation.cs new file mode 100644 index 0000000000000000000000000000000000000000..69b58465017dc21e3e945b1e3d286d074872a678 --- /dev/null +++ b/editor source/SPNATI Character Editor/EpilogueEditing/PoseAnimation.cs @@ -0,0 +1,155 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SPNATI_Character_Editor.EpilogueEditing +{ + public class PoseAnimation + { + public PosePreview Pose; + public PoseDirective Directive; + public SpritePreview Sprite; + public float Duration; + public float Delay; + public float Elapsed; + public bool Looped; + public List<KeyframePreview> Frames = new List<KeyframePreview>(); + + public PoseAnimation(PosePreview pose, PoseDirective directive) + { + Pose = pose; + Sprite = pose.GetSprite(directive.Id); + Directive = directive; + foreach (Keyframe kf in directive.Keyframes) + { + KeyframePreview frame = new KeyframePreview(pose, kf); + Frames.Add(frame); + } + Frames.Sort((f1, f2) => { + return f1.Time.CompareTo(f2.Time); + }); + + float totalTime = 0; + foreach (KeyframePreview kf in Frames) + { + kf.StartTime = totalTime; + totalTime = kf.Time; + } + + Duration = totalTime; + float.TryParse(directive.Delay, NumberStyles.Number, CultureInfo.InvariantCulture, out Delay); + Delay *= 1000; + Update(0); + } + + public bool IsComplete + { + get + { + return Elapsed - Delay >= Duration; + } + } + + public void Update(float elapsedMs) + { + Elapsed += elapsedMs; + if (Directive.Looped && IsComplete) + { + Elapsed -= Duration; + } + float t = Elapsed - Delay; + + if (Sprite == null) { return; } + for (int i = Frames.Count - 1; i >= 0; i--) + { + KeyframePreview frame = Frames[i]; + if (t <= frame.StartTime) + { + continue; + } + + KeyframePreview lastFrame = (i > 0 ? Frames[i - 1] : frame); + float progress = (t - frame.StartTime) / (frame.Time - frame.StartTime); + progress = (t <= 0 ? 0 : Math.Min(1, Math.Max(0, progress))); + + progress = SceneAnimation.Ease(Directive.EasingMethod ?? "linear", progress); + UpdateSprite(lastFrame, frame, progress, i); + return; + } + } + + private void UpdateSprite(KeyframePreview fromFrame, KeyframePreview toFrame, float time, int index) + { + if (Sprite == null) { return; } + string interpolation = Directive.InterpolationMethod ?? "linear"; + if (Directive.InterpolationMethod == "none" && !string.IsNullOrEmpty(fromFrame.Src)) + { + Sprite.Image = Pose.Images[fromFrame.Src]; + } + + KeyframePreview lastLast = (index > 0 ? Frames[index - 1] : fromFrame); + KeyframePreview nextNext = index < Frames.Count - 2 ? Frames[index + 1] : toFrame; + if (!string.IsNullOrEmpty(fromFrame.Keyframe.X)) + { + Sprite.X = SceneObject.Interpolate(fromFrame.X, toFrame.X, interpolation, time, lastLast.X, nextNext.X); + } + if (!string.IsNullOrEmpty(fromFrame.Keyframe.Y)) + { + Sprite.Y = SceneObject.Interpolate(fromFrame.Y, toFrame.Y, interpolation, time, lastLast.Y, nextNext.Y); + } + if (!string.IsNullOrEmpty(fromFrame.Keyframe.ScaleX)) + { + Sprite.ScaleX = SceneObject.Interpolate(fromFrame.ScaleX, toFrame.ScaleX, interpolation, time, lastLast.ScaleX, nextNext.ScaleX); + } + if (!string.IsNullOrEmpty(fromFrame.Keyframe.ScaleY)) + { + Sprite.ScaleY = SceneObject.Interpolate(fromFrame.ScaleY, toFrame.ScaleY, interpolation, time, lastLast.ScaleY, nextNext.ScaleY); + } + if (!string.IsNullOrEmpty(fromFrame.Keyframe.Rotation)) + { + Sprite.Rotation = SceneObject.Interpolate(fromFrame.Rotation, toFrame.Rotation, interpolation, time, lastLast.Rotation, nextNext.Rotation); + } + if (!string.IsNullOrEmpty(fromFrame.Keyframe.Opacity)) + { + Sprite.Alpha = SceneObject.Interpolate(fromFrame.Alpha, toFrame.Alpha, interpolation, time, lastLast.Alpha, nextNext.Alpha); + } + } + } + + public class KeyframePreview + { + public Keyframe Keyframe; + public float Time; + public float StartTime; + public float X; + public float Y; + public float ScaleX = 1; + public float ScaleY = 1; + public float Alpha = 100; + public float Rotation = 0; + public string Src; + + public KeyframePreview(PosePreview pose, Keyframe frame) + { + Keyframe = frame; + Src = frame.Src; + float.TryParse(frame.X, NumberStyles.Number, CultureInfo.InvariantCulture, out X); + float.TryParse(frame.Y, NumberStyles.Number, CultureInfo.InvariantCulture, out Y); + if (!float.TryParse(frame.ScaleX, NumberStyles.Number, CultureInfo.InvariantCulture, out ScaleX)) + { + ScaleX = 1; + } + if (!float.TryParse(frame.ScaleY, NumberStyles.Number, CultureInfo.InvariantCulture, out ScaleY)) + { + ScaleY = 1; + } + float.TryParse(frame.Rotation, NumberStyles.Number, CultureInfo.InvariantCulture, out Rotation); + float.TryParse(frame.Opacity, NumberStyles.Number, CultureInfo.InvariantCulture, out Alpha); + float.TryParse(frame.Time, NumberStyles.Number, CultureInfo.InvariantCulture, out Time); + Time *= 1000; + } + } +} diff --git a/editor source/SPNATI Character Editor/EpilogueEditing/PosePreview.cs b/editor source/SPNATI Character Editor/EpilogueEditing/PosePreview.cs new file mode 100644 index 0000000000000000000000000000000000000000..bd33fb720630257d6d43da0d950d8433f02c4c1a --- /dev/null +++ b/editor source/SPNATI Character Editor/EpilogueEditing/PosePreview.cs @@ -0,0 +1,153 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; + +namespace SPNATI_Character_Editor.EpilogueEditing +{ + public class PosePreview : IDisposable + { + public ISkin Character; + public Pose Pose; + public float BaseHeight; + + public Dictionary<string, Image> Images = new Dictionary<string, Image>(); + + public List<SpritePreview> Sprites = new List<SpritePreview>(); + private Dictionary<string, SpritePreview> _spriteMap = new Dictionary<string, SpritePreview>(); + + public List<PoseAnimation> Animations = new List<PoseAnimation>(); + + public PosePreview(ISkin character, Pose pose) + { + Character = character; + Pose = pose; + int baseHeight; + if (!int.TryParse(pose.BaseHeight, out baseHeight)) + { + BaseHeight = 1400; + } + else + { + BaseHeight = baseHeight; + } + + foreach (Sprite sprite in pose.Sprites) + { + if (!string.IsNullOrEmpty(sprite.Src)) + { + AddImage(sprite.Src); + } + SpritePreview preview = new SpritePreview(this, sprite, Sprites.Count); + Sprites.Add(preview); + if (!string.IsNullOrEmpty(sprite.Id)) + { + _spriteMap[sprite.Id] = preview; + } + } + foreach (PoseDirective directive in pose.Directives) + { + if (directive.DirectiveType == "animation") + { + if (!string.IsNullOrEmpty(directive.Src)) + { + AddImage(directive.Src); + } + Animations.Add(new PoseAnimation(this, directive)); + } + else + { + foreach (PoseAnimFrame frame in directive.AnimFrames) + { + if (!string.IsNullOrEmpty(frame.Id)) + { + AddImage(frame.Id); + } + } + } + } + ResortSprites(); + } + + public bool IsAnimated + { + get + { + return Animations.Count > 0; + } + } + + public SpritePreview GetSprite(string id) + { + return _spriteMap.Get(id); + } + + internal bool IsDisposing; + public void Dispose() + { + IsDisposing = true; + + foreach (Image img in Images.Values) + { + img.Dispose(); + } + Images.Clear(); + + IsDisposing = false; + } + + private void AddImage(string src) + { + if (string.IsNullOrEmpty(src)) { return; } + if (Images.ContainsKey(src)) + { + return; + } + string path = GetImagePath(src); + try + { + using (var temp = new Bitmap(path)) + { + Bitmap img = new Bitmap(temp); + Images[src] = img; + } + } + catch { } + } + + protected string GetImagePath(string path) + { + return Path.Combine(Config.SpnatiDirectory, "opponents", path); + } + + private void ResortSprites() + { + Sprites.Sort((s1, s2) => + { + int compare = s1.Z.CompareTo(s2.Z); + if (compare == 0) + { + compare = s1.AddIndex.CompareTo(s2.AddIndex); + } + return compare; + }); + } + + public void Draw(Graphics g, int width, int height) + { + foreach (SpritePreview sprite in Sprites) + { + sprite.Draw(g, width, height); + } + } + + public void Update(float elapsedSec) + { + float elapsedMs = elapsedSec * 1000; + for (int i = 0; i < Animations.Count; i++) + { + Animations[i].Update(elapsedMs); + } + } + } +} diff --git a/editor source/SPNATI Character Editor/EpilogueEditing/SceneEmitter.cs b/editor source/SPNATI Character Editor/EpilogueEditing/SceneEmitter.cs index c6bff5ea323dc4d1ec18a6d32f9d7c43cdb48156..3b2500727016e1b87fbe48145436806e81471d76 100644 --- a/editor source/SPNATI Character Editor/EpilogueEditing/SceneEmitter.cs +++ b/editor source/SPNATI Character Editor/EpilogueEditing/SceneEmitter.cs @@ -34,6 +34,7 @@ namespace SPNATI_Character_Editor.EpilogueEditing public RandomParameter StartRotation; public RandomParameter EndRotation; public RandomParameter Lifetime; + public bool IgnoreParent; public SceneEmitter() { } @@ -78,6 +79,7 @@ namespace SPNATI_Character_Editor.EpilogueEditing StartRotation = RandomParameter.Create(directive.StartRotation, 0, 0); EndRotation = RandomParameter.Create(directive.EndRotation, StartRotation); Lifetime = RandomParameter.Create(directive.Lifetime, 1, 1); + IgnoreParent = directive.IgnoreRotation; ParticleWidth = Width; ParticleHeight = Height; @@ -113,7 +115,7 @@ namespace SPNATI_Character_Editor.EpilogueEditing copy.EndRotation = EndRotation; copy.Lifetime = Lifetime; copy.Angle = Angle; - + copy.IgnoreParent = IgnoreParent; return copy; } diff --git a/editor source/SPNATI Character Editor/EpilogueEditing/SceneObject.cs b/editor source/SPNATI Character Editor/EpilogueEditing/SceneObject.cs index 42b8e262ef4148a2e4daefea7a7a62931f89a7fc..9e5e91640812ea785b0847ddf69d6db11155ebab 100644 --- a/editor source/SPNATI Character Editor/EpilogueEditing/SceneObject.cs +++ b/editor source/SPNATI Character Editor/EpilogueEditing/SceneObject.cs @@ -9,6 +9,7 @@ namespace SPNATI_Character_Editor.EpilogueEditing { public class SceneObject : IDisposable { + public ScenePreview PreviewScene; public static int NextLayer = 0; public Character Character; public SceneObject SourceObject; @@ -64,6 +65,7 @@ namespace SPNATI_Character_Editor.EpilogueEditing public SceneObjectType ObjectType = SceneObjectType.Other; public Image Image; + public string Src; public object Max { get; private set; } @@ -78,6 +80,7 @@ namespace SPNATI_Character_Editor.EpilogueEditing public SceneObject(ScenePreview scene, Character character, Directive directive) : this(scene, character, directive.Id, directive.Src, directive.Color) { + PreviewScene = scene; LinkedFrame = directive; if (directive.DirectiveType == "sprite") { @@ -175,7 +178,7 @@ namespace SPNATI_Character_Editor.EpilogueEditing PivotY = ParsePivot(directive.PivotY, Height); if (!string.IsNullOrEmpty(directive.Rate)) { - float.TryParse(directive.Rate, out Rate); + float.TryParse(directive.Rate, NumberStyles.Number, CultureInfo.InvariantCulture, out Rate); } SortLayer = ++NextLayer; @@ -185,7 +188,7 @@ namespace SPNATI_Character_Editor.EpilogueEditing } } - protected int ParsePivot(string pivot, float size) + public static int ParsePivot(string pivot, float size) { switch (pivot) { @@ -209,6 +212,7 @@ namespace SPNATI_Character_Editor.EpilogueEditing protected void CopyValuesFrom(SceneObject source) { + PreviewScene = source.PreviewScene; Character = source.Character; ObjectType = source.ObjectType; X = source.X; @@ -234,10 +238,12 @@ namespace SPNATI_Character_Editor.EpilogueEditing SortLayer = source.SortLayer; Layer = source.Layer; Rate = source.Rate; + Src = source.Src; } public SceneObject(ScenePreview scene, Character character, string id, string imagePath, string color) { + PreviewScene = scene; Character = character; Id = id; if (!string.IsNullOrEmpty(color)) @@ -250,15 +256,7 @@ namespace SPNATI_Character_Editor.EpilogueEditing } if (!string.IsNullOrEmpty(imagePath)) { - string path = GetImagePath(imagePath); - try - { - using (var temp = new Bitmap(path)) - { - Image = new Bitmap(temp); - } - } - catch { } + SetImage(imagePath); } if (Image == null) @@ -276,6 +274,12 @@ namespace SPNATI_Character_Editor.EpilogueEditing Height = HeightPct * scene.Height; } + private void SetImage(string src) + { + Src = src; + Image = PreviewScene.Images.Get(src); + } + public static float Parse(string str, float sceneSize) { if (string.IsNullOrEmpty(str)) @@ -339,6 +343,10 @@ namespace SPNATI_Character_Editor.EpilogueEditing { float.TryParse(frame.Zoom, NumberStyles.Float, CultureInfo.InvariantCulture, out Zoom); } + if (!string.IsNullOrEmpty(frame.Src) && frame.Src != Src) + { + SetImage(frame.Src); + } SetColor(frame); Directive directive = frame as Directive; @@ -394,9 +402,25 @@ namespace SPNATI_Character_Editor.EpilogueEditing Color.Color = Interpolate(last.Color, frame.Color, frame.Tween, time, lastLast.Color, nextNext.Color); Color.Color = System.Drawing.Color.FromArgb((int)(Alpha / 100 * 255), Color.Color); Rate = Interpolate(last.Rate, frame.Rate, frame.Tween, time, lastLast.Rate, nextNext.Rate); + if (!string.IsNullOrEmpty(frame.Src)) + { + string src = ""; + if (time >= 1) + { + src = frame.Src; + } + else + { + src = last.Src; + } + if (src != Src) + { + SetImage(src); + } + } } - protected float Interpolate(float lastValue, float nextValue, string interpolationMode, float t, float lastLastValue, float nextNextValue) + public static float Interpolate(float lastValue, float nextValue, string interpolationMode, float t, float lastLastValue, float nextNextValue) { switch (interpolationMode) { @@ -412,7 +436,7 @@ namespace SPNATI_Character_Editor.EpilogueEditing float p = 0.5f * (a + (b * t) + (c * t * t) + (d * t * t * t)); return p; case "none": - return lastValue; + return t >= 1 ? nextValue : lastValue; default: return (nextValue - lastValue) * t + lastValue; } @@ -591,7 +615,6 @@ namespace SPNATI_Character_Editor.EpilogueEditing public virtual void Dispose() { - Image?.Dispose(); Color?.Dispose(); } diff --git a/editor source/SPNATI Character Editor/EpilogueEditing/SceneParticle.cs b/editor source/SPNATI Character Editor/EpilogueEditing/SceneParticle.cs index 12c8916d042b59252a20553f59eb608d7f22ca21..76838a343a86ca8801be9364244631cde16dd64c 100644 --- a/editor source/SPNATI Character Editor/EpilogueEditing/SceneParticle.cs +++ b/editor source/SPNATI Character Editor/EpilogueEditing/SceneParticle.cs @@ -40,7 +40,7 @@ namespace SPNATI_Character_Editor.EpilogueEditing PivotX = Width / 2.0f; PivotY = Height / 2.0f; - Rotation = rotation; + Rotation = emitter.IgnoreParent ? 0 : rotation; float degrees = rotation; float radians = degrees * (float)Math.PI / 180.0f; float speed = emitter.Speed.Get(); diff --git a/editor source/SPNATI Character Editor/EpilogueEditing/ScenePreview.cs b/editor source/SPNATI Character Editor/EpilogueEditing/ScenePreview.cs index e72c132bb3e4aba0793a084e5ab34b77fb55b994..73f3ab4aaed84c0dd831f2c317841a8f7c313bc9 100644 --- a/editor source/SPNATI Character Editor/EpilogueEditing/ScenePreview.cs +++ b/editor source/SPNATI Character Editor/EpilogueEditing/ScenePreview.cs @@ -16,8 +16,12 @@ namespace SPNATI_Character_Editor.EpilogueEditing public List<SceneObject> Objects = new List<SceneObject>(); public List<SceneObject> TextBoxes = new List<SceneObject>(); - public ScenePreview(Scene scene) + public Dictionary<string, Image> Images = new Dictionary<string, Image>(); + + public ScenePreview(Scene scene, Character character) { + PreviewScene = this; + Character = character; LinkedScene = scene; try { @@ -38,7 +42,6 @@ namespace SPNATI_Character_Editor.EpilogueEditing float.TryParse(w, NumberStyles.Integer, CultureInfo.InvariantCulture, out Width); float.TryParse(h, NumberStyles.Integer, CultureInfo.InvariantCulture, out Height); - X = (int)Parse(scene.X, Width); Y = (int)Parse(scene.Y, Height); @@ -66,6 +69,35 @@ namespace SPNATI_Character_Editor.EpilogueEditing { OverlayColor = System.Drawing.Color.FromArgb(0, OverlayColor); } + + AddImage(scene.Background); + foreach (Directive directive in scene.Directives) + { + AddImage(directive.Src); + foreach (Keyframe frame in directive.Keyframes) + { + AddImage(frame.Src); + } + } + } + + private void AddImage(string src) + { + if (string.IsNullOrEmpty(src)) { return; } + if (Images.ContainsKey(src)) + { + return; + } + string path = GetImagePath(src); + try + { + using (var temp = new Bitmap(path)) + { + Bitmap img = new Bitmap(temp); + Images[src] = img; + } + } + catch { } } internal bool IsDisposing; @@ -84,6 +116,13 @@ namespace SPNATI_Character_Editor.EpilogueEditing Objects.Clear(); TextBoxes.Clear(); base.Dispose(); + + foreach (Image img in Images.Values) + { + img.Dispose(); + } + Images.Clear(); + IsDisposing = false; } diff --git a/editor source/SPNATI Character Editor/EpilogueEditing/SpritePreview.cs b/editor source/SPNATI Character Editor/EpilogueEditing/SpritePreview.cs new file mode 100644 index 0000000000000000000000000000000000000000..0a53f6dc180beede377e98adff893ca8d4af643b --- /dev/null +++ b/editor source/SPNATI Character Editor/EpilogueEditing/SpritePreview.cs @@ -0,0 +1,152 @@ +using System; +using System.Drawing; +using System.Drawing.Imaging; +using System.Globalization; + +namespace SPNATI_Character_Editor.EpilogueEditing +{ + public class SpritePreview + { + public string Id; + public PosePreview Pose; + public Image Image; + public int AddIndex; + public float X; + public float Y; + public int Width; + public int Height; + public int Z; + public float ScaleX; + public float ScaleY; + public float Rotation; + public float Alpha; + public float PivotX; + public float PivotY; + + public SpritePreview() { } + + public SpritePreview(PosePreview pose, Sprite sprite, int index) + { + Pose = pose; + Id = sprite.Id; + Z = sprite.Z; + AddIndex = index; + float.TryParse(sprite.X, NumberStyles.Number, CultureInfo.InvariantCulture, out X); + float.TryParse(sprite.Y, NumberStyles.Number, CultureInfo.InvariantCulture, out Y); + int.TryParse(sprite.Width, out Width); + int.TryParse(sprite.Height, out Height); + if (!string.IsNullOrEmpty(sprite.Src)) + { + pose.Images.TryGetValue(sprite.Src, out Image); + if (Width == 0) + { + Width = Image.Width; + } + if (Height == 0) + { + Height = Image.Height; + } + } + if (!float.TryParse(sprite.ScaleX, NumberStyles.Number, CultureInfo.InvariantCulture, out ScaleX)) + { + ScaleX = 1; + } + if (!float.TryParse(sprite.ScaleY, NumberStyles.Number, CultureInfo.InvariantCulture, out ScaleY)) + { + ScaleY = 1; + } + PivotX = SceneObject.ParsePivot(sprite.PivotX ?? "center", Width); + PivotY = SceneObject.ParsePivot(sprite.PivotY ?? "center", Height); + float.TryParse(sprite.Rotation, NumberStyles.Number, CultureInfo.InvariantCulture, out Rotation); + float.TryParse(sprite.Opacity ?? "100", NumberStyles.Number, CultureInfo.InvariantCulture, out Alpha); + } + + public override string ToString() + { + return Id; + } + + public void Draw(Graphics g, int displayWidth, int displayHeight) + { + if (Image != null && Alpha > 0) + { + Rectangle bounds = ToScreenRegion(displayWidth, displayHeight); + + float offsetX = bounds.X + PivotX / Width * bounds.Width; + float offsetY = bounds.Y + PivotY / Height * bounds.Height; + if (float.IsNaN(offsetX)) + { + offsetX = 0; + } + if (float.IsNaN(offsetY)) + { + offsetY = 0; + } + + g.TranslateTransform(offsetX, offsetY); + g.RotateTransform(Rotation); + g.TranslateTransform(-offsetX, -offsetY); + + if (Alpha < 100) + { + float[][] matrixItems = new float[][] { + new float[] { 1, 0, 0, 0, 0 }, + new float[] { 0, 1, 0, 0, 0 }, + new float[] { 0, 0, 1, 0, 0 }, + new float[] { 0, 0, 0, Alpha / 100.0f, 0 }, + new float[] { 0, 0, 0, 0, 1 } + }; + ColorMatrix cm = new ColorMatrix(matrixItems); + ImageAttributes ia = new ImageAttributes(); + ia.SetColorMatrix(cm, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); + + g.DrawImage(Image, bounds, 0, 0, Image.Width, Image.Height, GraphicsUnit.Pixel, ia); + } + else + { + g.DrawImage(Image, new Rectangle(bounds.X, bounds.Y, bounds.Width, bounds.Height), new Rectangle(0, 0, Image.Width, Image.Height), GraphicsUnit.Pixel); + } + + g.ResetTransform(); + } + } + + public Rectangle ToScreenRegion(int displayWidth, int displayHeight) + { + //get unscaled bounds in screen space + float x = ScaleToDisplay(X, displayHeight); + float y = ScaleToDisplay(Y, displayHeight); + float width = ScaleToDisplay(Width, displayHeight); + float height = ScaleToDisplay(Height, displayHeight); + x = (int)(x + displayWidth * 0.5f - width * 0.5f); + + //translate pivot to origin + float pivotX = x + PivotX / Width * width; + float pivotY = y + PivotY / Height * height; + x -= pivotX; + y -= pivotY; + + //apply scaling + float right = x + width; + x *= ScaleX; + right *= ScaleX; + width = right - x; + + float bottom = y + height; + y *= ScaleY; + bottom *= ScaleY; + height = bottom - y; + + //translate back + x += pivotX; + y += pivotY; + + return new Rectangle((int)x, (int)y, (int)width, (int)height); + } + + public int ScaleToDisplay(float value, int canvasHeight) + { + return (int)Math.Floor(value * canvasHeight / Pose.BaseHeight); + } + } +} diff --git a/editor source/SPNATI Character Editor/IO/FlatFileSerializer.cs b/editor source/SPNATI Character Editor/IO/FlatFileSerializer.cs index 8102b7289379e9485bca2d5d1a5e0ede17c245d5..3e040ca227d738ccad794b4b16ec6d1c00faab0a 100644 --- a/editor source/SPNATI Character Editor/IO/FlatFileSerializer.cs +++ b/editor source/SPNATI Character Editor/IO/FlatFileSerializer.cs @@ -304,6 +304,22 @@ namespace SPNATI_Character_Editor { lineCode += string.Format(",marker:{0}", defaultLine.Marker); } + if (!string.IsNullOrEmpty(defaultLine.Gender)) + { + lineCode += $",set-gender:{defaultLine.Gender}"; + } + if (!string.IsNullOrEmpty(defaultLine.Intelligence)) + { + lineCode += $",set-intelligence:{defaultLine.Intelligence}"; + } + if (!string.IsNullOrEmpty(defaultLine.Label)) + { + lineCode += $",set-label:{defaultLine.Label}"; + } + if (!string.IsNullOrEmpty(defaultLine.Size)) + { + lineCode += $",set-size:{defaultLine.Size}"; + } string text = String.IsNullOrEmpty(defaultLine.Text) ? "~silent~" : defaultLine.Text; lines.Add(string.Format("{0}={1},{2}", lineCode, defaultLine.Image, text)); } @@ -1122,6 +1138,18 @@ namespace SPNATI_Character_Editor lineCase.Expressions.Add(test); } break; + case "set-gender": + line.Gender = value; + break; + case "set-intelligence": + line.Intelligence = value; + break; + case "set-label": + line.Label = value; + break; + case "set-size": + line.Size = value; + break; default: if (key.StartsWith("count-")) { diff --git a/editor source/SPNATI Character Editor/Icons/CollapseAll.png b/editor source/SPNATI Character Editor/Icons/CollapseAll.png new file mode 100644 index 0000000000000000000000000000000000000000..499f12dff2d26b9025b584dae4c6726dd68f4645 --- /dev/null +++ b/editor source/SPNATI Character Editor/Icons/CollapseAll.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8579626b9d660ed19e0e8c45257a5bd4fbaace299e65f2612bd1677a2a45c09 +size 196 diff --git a/editor source/SPNATI Character Editor/Icons/ExpandAll.png b/editor source/SPNATI Character Editor/Icons/ExpandAll.png new file mode 100644 index 0000000000000000000000000000000000000000..8a65e810ce7fa6d5320d558fbf50d45235567c97 --- /dev/null +++ b/editor source/SPNATI Character Editor/Icons/ExpandAll.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34d0174f737f5e1d847169e65b67665c8067de59e505ce54cbba1cc2ad728c1e +size 193 diff --git a/editor source/SPNATI Character Editor/ImageLibrary.cs b/editor source/SPNATI Character Editor/ImageLibrary.cs index aa8807e7d405d2c98684df28852342ca15d5fad3..46ace57573f22895b390e57d124eb23afdac61ec 100644 --- a/editor source/SPNATI Character Editor/ImageLibrary.cs +++ b/editor source/SPNATI Character Editor/ImageLibrary.cs @@ -30,7 +30,6 @@ namespace SPNATI_Character_Editor private Dictionary<int, List<CharacterImage>> _stages = new Dictionary<int, List<CharacterImage>>(); private List<CharacterImage> _allImages = new List<CharacterImage>(); private Dictionary<string, CharacterImage> _miniImages = new Dictionary<string, CharacterImage>(); - private Dictionary<string, CharacterImage> _crossStageImages = new Dictionary<string, CharacterImage>(); private Costume _skin; /// <summary> @@ -51,17 +50,9 @@ namespace SPNATI_Character_Editor Add(file, name); } - CharacterEditorData editorData = CharacterDatabase.GetEditorData(character.Character); - if (editorData != null) + foreach (Pose pose in character.CustomPoses) { - string folder = character.GetDirectory(); - foreach (CrossStagePose pose in editorData.Poses) - { - string name = Path.GetFileNameWithoutExtension(pose.FileName); - CharacterImage image = new CharacterImage(Path.Combine(folder, pose.FileName), name); - //image.d - _crossStageImages[pose.FileName] = image; - } + Add(pose); } } @@ -78,26 +69,77 @@ namespace SPNATI_Character_Editor if (file != PreviewImage) { - int stage = -1; - if (char.IsNumber(image.Name[0])) + CacheStage(image); + } + return image; + } + + private void CacheStage(CharacterImage image) + { + string name = image.Name; + if (name.StartsWith("custom:")) + { + name = name.Substring(7); + } + if (string.IsNullOrEmpty(name)) { return; } + int stage = -1; + if (char.IsNumber(name[0])) + { + int hyphen = name.IndexOf('-', 1); + if (hyphen > 0) { - int hyphen = image.Name.IndexOf('-', 1); - if (hyphen > 0) - { - stage = int.Parse(image.Name.Substring(0, hyphen)); - } + stage = int.Parse(name.Substring(0, hyphen)); + } + } + if (stage < 0) + image.IsGeneric = true; + List<CharacterImage> list; + if (!_stages.TryGetValue(stage, out list)) + { + list = new List<CharacterImage>(); + _stages[stage] = list; + } + list.Add(image); + } + + /// <summary> + /// Adds a custom pose + /// </summary> + /// <param name="pose"></param> + public void Add(Pose pose) + { + CharacterImage image = new CharacterImage(pose); + pose.ImageLink = image; + _allImages.Add(image); + + CacheStage(image); + } + + public void Rename(Pose pose) + { + if (pose.ImageLink != null) + { + foreach (KeyValuePair<int, List<CharacterImage>> kvp in _stages) + { + kvp.Value.Remove(pose.ImageLink); } - if (stage < 0) - image.IsGeneric = true; - List<CharacterImage> list; - if (!_stages.TryGetValue(stage, out list)) + pose.ImageLink.Name = "custom:" + pose.Id; + pose.ImageLink.DefaultName = pose.ImageLink.Name; + CacheStage(pose.ImageLink); + } + } + + public void Remove(Pose pose) + { + CharacterImage img = _allImages.Find(i => i.Pose == pose); + if (img != null) + { + _allImages.Remove(img); + foreach (KeyValuePair<int, List<CharacterImage>> kvp in _stages) { - list = new List<CharacterImage>(); - _stages[stage] = list; + kvp.Value.Remove(img); } - list.Add(image); } - return image; } /// <summary> @@ -107,7 +149,13 @@ namespace SPNATI_Character_Editor /// <returns></returns> public CharacterImage Find(string name) { + if (string.IsNullOrEmpty(name)) { return null; } + bool custom = name.StartsWith("custom:"); string shortName = Path.GetFileNameWithoutExtension(name); + if (custom) + { + shortName = "custom:" + shortName; + } return _allImages.Find(img => img.Name == name || img.Name == shortName); } @@ -163,23 +211,6 @@ namespace SPNATI_Character_Editor yield return img; } } - - // >>>> NOT READY FOR 3.4 - //CharacterEditorData editorData = CharacterDatabase.GetEditorData(_character.Character); - //if (editorData != null) - //{ - // foreach (CrossStagePose pose in editorData.Poses) - // { - // if (pose.Stages.Contains(stage) && !pose.FileName.StartsWith(stage.ToString())) - // { - // CharacterImage img = _crossStageImages.Get(pose.FileName); - // if (img != null) - // { - // yield return img; - // } - // } - // } - //} } /// <summary> @@ -242,7 +273,9 @@ namespace SPNATI_Character_Editor { public bool Disposed { get; private set; } - private Costume _skin; + public Costume Skin; + + public Pose Pose; public string FileName; public string FileExtension; @@ -263,6 +296,13 @@ namespace SPNATI_Character_Editor DefaultName = DialogueLine.GetDefaultImage(Name); } + public CharacterImage(Pose pose) + { + Name = "custom:" + pose.Id; + Pose = pose; + DefaultName = DialogueLine.GetDefaultImage(Name); + } + public override string ToString() { return Name; @@ -270,13 +310,13 @@ namespace SPNATI_Character_Editor public string GetPath() { - if (_skin == null) + if (Skin == null) { return FileName; } else { - string path = Path.Combine(Config.SpnatiDirectory, _skin.Folder, Name + FileExtension); + string path = Path.Combine(Config.SpnatiDirectory, Skin.Folder, Name + FileExtension); if (!File.Exists(path)) { return FileName; @@ -314,7 +354,7 @@ namespace SPNATI_Character_Editor { string oldPath = GetPath(); int count = ReferenceCount; - _skin = skin; + Skin = skin; string newPath = GetPath(); if (count > 0 && oldPath != newPath) { diff --git a/editor source/SPNATI Character Editor/Properties/AssemblyInfo.cs b/editor source/SPNATI Character Editor/Properties/AssemblyInfo.cs index 469185a501032a3ae5924b07f6a4d9d95b42a495..0133a705df93b618e655f7e6b1765bcbce7e5adb 100644 --- a/editor source/SPNATI Character Editor/Properties/AssemblyInfo.cs +++ b/editor source/SPNATI Character Editor/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SPNATI Character Editor")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,12 +25,12 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.4.0.0")] +[assembly: AssemblyVersion("3.5.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/editor source/SPNATI Character Editor/Properties/Resources.Designer.cs b/editor source/SPNATI Character Editor/Properties/Resources.Designer.cs index d491e2ef8200fe329bebd74bc14a53de9c9a716a..91fa27cc996fd53c2d4cd22e8ffe5bd4f00165e3 100644 --- a/editor source/SPNATI Character Editor/Properties/Resources.Designer.cs +++ b/editor source/SPNATI Character Editor/Properties/Resources.Designer.cs @@ -120,6 +120,16 @@ namespace SPNATI_Character_Editor.Properties { } } + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap CollapseAll { + get { + object obj = ResourceManager.GetObject("CollapseAll", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> @@ -190,6 +200,16 @@ namespace SPNATI_Character_Editor.Properties { } } + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap ExpandAll { + get { + object obj = ResourceManager.GetObject("ExpandAll", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> diff --git a/editor source/SPNATI Character Editor/Properties/Resources.resx b/editor source/SPNATI Character Editor/Properties/Resources.resx index af438ecef38f9398065bfa822198733bdd560e44..98b8a1d64a7642b584ddc1f085afed3fa7228aa3 100644 --- a/editor source/SPNATI Character Editor/Properties/Resources.resx +++ b/editor source/SPNATI Character Editor/Properties/Resources.resx @@ -214,4 +214,10 @@ <data name="AddLink" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Icons\AddLink.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="CollapseAll" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Icons\CollapseAll.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="ExpandAll" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Icons\ExpandAll.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> </root> \ No newline at end of file diff --git a/editor source/SPNATI Character Editor/SPNATI Character Editor.csproj b/editor source/SPNATI Character Editor/SPNATI Character Editor.csproj index 63d65048bb64aa625b4512100c3e9a7090293c85..b64411775024051bf3259b2e50897e821106560a 100644 --- a/editor source/SPNATI Character Editor/SPNATI Character Editor.csproj +++ b/editor source/SPNATI Character Editor/SPNATI Character Editor.csproj @@ -147,12 +147,6 @@ <Compile Include="Controls\CharacterImageDialog.cs"> <SubType>Component</SubType> </Compile> - <Compile Include="Controls\EditControls\PoseStageSelect.cs"> - <SubType>UserControl</SubType> - </Compile> - <Compile Include="Controls\EditControls\PoseStageSelect.Designer.cs"> - <DependentUpon>PoseStageSelect.cs</DependentUpon> - </Compile> <Compile Include="Controls\SceneTree.cs"> <SubType>UserControl</SubType> </Compile> @@ -168,7 +162,7 @@ <Compile Include="Controls\TreeViews\IDialogueTreeView.cs" /> <Compile Include="Controls\TreeViews\CaseView.cs" /> <Compile Include="Controls\TreeViews\StageView.cs" /> - <Compile Include="DataStructures\CrossStagePose.cs" /> + <Compile Include="DataStructures\CaseNote.cs" /> <Compile Include="DataStructures\DataConversions.cs" /> <Compile Include="DataStructures\Definition.cs" /> <Compile Include="DataStructures\Definitions.cs" /> @@ -422,6 +416,9 @@ <Compile Include="EpilogueEditing\EpilogueCanvas.Designer.cs"> <DependentUpon>EpilogueCanvas.cs</DependentUpon> </Compile> + <Compile Include="EpilogueEditing\PoseAnimation.cs" /> + <Compile Include="EpilogueEditing\SpritePreview.cs" /> + <Compile Include="EpilogueEditing\PosePreview.cs" /> <Compile Include="EpilogueEditing\RandomParameter.cs" /> <Compile Include="EpilogueEditing\SceneAnimation.cs" /> <Compile Include="EpilogueEditing\SceneObject.cs" /> @@ -636,9 +633,6 @@ <EmbeddedResource Include="Controls\EditControls\ParticleFloatControl.resx"> <DependentUpon>ParticleFloatControl.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="Controls\EditControls\PoseStageSelect.resx"> - <DependentUpon>PoseStageSelect.cs</DependentUpon> - </EmbeddedResource> <EmbeddedResource Include="Controls\EditControls\StageControl.resx"> <DependentUpon>StageControl.cs</DependentUpon> </EmbeddedResource> @@ -784,6 +778,8 @@ <None Include="Icons\emitter.png" /> <None Include="Icons\Fade.png" /> <None Include="Icons\AddLink.png" /> + <None Include="Icons\CollapseAll.png" /> + <None Include="Icons\ExpandAll.png" /> <Content Include="tag_dictionary.xml"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> @@ -881,6 +877,9 @@ <Content Include="variables.xml"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> + <Content Include="VersionHistory\v3.4.1.html"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> <Content Include="VersionHistory\v3.4.html"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> @@ -896,6 +895,9 @@ <Content Include="VersionHistory\v3.1.html"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> + <Content Include="VersionHistory\v3.5.html"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> <Content Include="VersionHistory\whatsnew.css"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> diff --git a/editor source/SPNATI Character Editor/ShellLogic.cs b/editor source/SPNATI Character Editor/ShellLogic.cs index 7a59f2f1e89b16b87b035ad92f116632f0e1cd1a..379b011ffa785d6868d2a1f808e2cf985dd6b93a 100644 --- a/editor source/SPNATI Character Editor/ShellLogic.cs +++ b/editor source/SPNATI Character Editor/ShellLogic.cs @@ -78,11 +78,11 @@ namespace SPNATI_Character_Editor def.IsAnimatable = true; def.Description = "Moves/rotates/scales a sprite or emitter."; def.FilterPropertiesById = true; - foreach (string key in new string[] { "id", "x", "y", "scalex", "scaley", "rotation", "alpha", "rate", "time", "delay", "loop", "ease", "tween", "clamp", "iterations" }) + foreach (string key in new string[] { "id", "src", "x", "y", "scalex", "scaley", "rotation", "alpha", "rate", "time", "delay", "loop", "ease", "tween", "clamp", "iterations" }) { def.AllowedProperties.Add(key); } - foreach (string key in new string[] { "time", "x", "y", "scalex", "scaley", "rotation", "alpha" }) + foreach (string key in new string[] { "time", "src", "x", "y", "scalex", "scaley", "rotation", "alpha" }) { def.RequiredAnimatedProperties.Add(key); } @@ -134,7 +134,7 @@ namespace SPNATI_Character_Editor def = provider.Create("emitter") as DirectiveDefinition; def.Description = "Adds an object emitter to the scene."; foreach (string key in new string[] { "id", "layer", "src", "rate", "angle", "width", "height", "x", "y", "rotation", "startScaleX", "startScaleY", "endScaleX", - "endScaleY", "speed", "accel", "forceX", "forceY", "startColor", "endColor", "startAlpha", "endAlpha", "startRotation", "endRotation", "lifetime", "ease"}) + "endScaleY", "speed", "accel", "forceX", "forceY", "startColor", "endColor", "startAlpha", "endAlpha", "startRotation", "endRotation", "lifetime", "ease", "ignoreRotation"}) { def.AllowedProperties.Add(key); } diff --git a/editor source/SPNATI Character Editor/VersionHistory/v3.4.1.html b/editor source/SPNATI Character Editor/VersionHistory/v3.4.1.html new file mode 100644 index 0000000000000000000000000000000000000000..09603deb21af3acc3afb81552e82f3946dcccaf9 --- /dev/null +++ b/editor source/SPNATI Character Editor/VersionHistory/v3.4.1.html @@ -0,0 +1,5 @@ +<h3>Bug Fixes</h3> +<ul> + <li>Fixed emitter rate preview for non-English locales</li> + <li>Fixed sorting ambiguity with masturbating cases</li> +</ul> \ No newline at end of file diff --git a/editor source/SPNATI Character Editor/VersionHistory/v3.5.html b/editor source/SPNATI Character Editor/VersionHistory/v3.5.html new file mode 100644 index 0000000000000000000000000000000000000000..8eb16a265f7571147c725ca976b5b5cb1ebaf5bc --- /dev/null +++ b/editor source/SPNATI Character Editor/VersionHistory/v3.5.html @@ -0,0 +1,35 @@ +<h3>Dialogue Editor</h3> +<ul> + <li>Added a personal notes section in a tab next to the dialogue table. This is not used anywhere in the game, but can serve as a place you can make your own personal notes about what a case is doing (ex. why is it setting X marker, does it precede something important, and so forth)</li> + <li>Legacy-style condition editor has been removed. It has been deprecated for several releases now.</li> + <li>Ranges (ex. time in stage) now have a "no upper bound" checkbox. It's no longer required to enter a "to" value when doing a single stage range.</li> + <li>Opponent Lost/Stripping/Stripped now allow for creating responses</li> + <li>Added shortcut buttons for targeting variables like clothing position, background type, etc.</li> + <li>Variable Test conditions now have autocomplete for variables where it makes sense.</li> + <li>It's now possible to change a character's gender, label (display name), size, and intelligence when playing a line. By default to reduce clutter, these options are hidden. Check "Show Advanced" in the Dialogue Editor to see them.</li> +</ul> + +<h3>Pose Maker</h3> +<ul> + <li>New tab for creating custom poses comprised of multiple sprites and animations.</li> + <li>These can be used in place of file names for the image that accompanies a line.</li> + <li>Naming conventions are the same as with image files. A pose named "5-custom" will only be available in stage 5, for example.</li> + <li>The realtime preview is currently view-only, meaning animations can only be edited via the fields and not through a rich point-and-click UI like the epilogue editor offers.</li> +</ul> + +<h3>Epilogue Editor</h3> +<ul> + <li>Added ability to change a sprite's src in a keyframe.</li> + <li>"Ignore Rotation" option added to emitters to allow particles to spawn facing upwards regardless of the emitter's rotation.</li> + <li>Move/Rotate/Scale Sprite/Emitter was renamed to Animate Sprite/Emitter.</li> +</ul> + +<h3>Bug Fixes</h3> +<ul> + <li>Fixed crash when trying to use the Remove Sprite/Emitter directive</li> + <li>Fixed crash in the Poses editor when creating a skin for a character using a image with no stage prefix (ex. zblank.png)</li> + <li>A stage is no longer required when importing a pose. Leaving it blank will create an image with no stage prefix (ex. happy.png instead of 1-happy.png), which can be used in any stage.</li> + <li>The "Create New" button is now always enabled if text has been entered, allowing the creation of a character/skin/tag/marker whose name is a partial match of an existing one.</li> + <li>Fixed Ctrl+X/Ctrl+C/Ctrl+V in the pose list</li> + <li>+1 and -1 are now accepted as marker values synonymous with +/-.</li> +</ul> \ No newline at end of file diff --git a/opponents/dialogue_tags.xml b/opponents/dialogue_tags.xml index 959862bc0940e23127a705654f71e9ba9b813e6e..a5502a53014181a8e94a52da6f6e00aa4b27cd50 100644 --- a/opponents/dialogue_tags.xml +++ b/opponents/dialogue_tags.xml @@ -9,11 +9,11 @@ <defaultImage>happy</defaultImage> <defaultText>This is what the character says after they've been selected</defaultText> </trigger> - <trigger tag="opponent_selected" optional="true" start="0" end="0" hasTarget="true" label="Opponent Selected" description="When another character is added to the selection screen" group="0" order="0"> + <trigger tag="opponent_selected" optional="true" start="0" end="0" hasTarget="true" label="Opponent Selected" description="When another character is added to the selection screen" group="0" order="1"> <defaultImage>happy</defaultImage> <defaultText>This is what the character says after another character has been (individually) selected</defaultText> </trigger> - <trigger tag="game_start" optional="true" start="0" end="0" label="Game start" oncePerStage="true" description="When the game starts" group="0" order="1"> + <trigger tag="game_start" optional="true" start="0" end="0" label="Game start" oncePerStage="true" description="When the game starts" group="0" order="2"> <defaultImage>happy</defaultImage> <defaultText>This is what the character says when the game starts</defaultText> </trigger> @@ -78,12 +78,12 @@ <defaultImage>strip</defaultImage> <defaultText>What the character says as they take their clothes off. The picture and text should be unique to what they're taking off.</defaultText> </trigger> - <trigger tag="must_masturbate_first" start="8" end="8" relatedGroup="2" label="Must Masturbate (Self, first to do so)" oncePerStage="true" description="The character is the first to lose the game and must start masturbating" group="9" order="0"> + <trigger tag="must_masturbate_first" start="8" end="8" relatedGroup="2" label="Must Masturbate (Self, first to do so)" oncePerStage="true" description="The character is the first to lose the game and must start masturbating" group="10" order="0"> <vars /> <defaultImage>loss</defaultImage> <defaultText>This is the character response when they lost their last hand and have to masturbate, and they're the first character who's required to masturbate.</defaultText> </trigger> - <trigger tag="must_masturbate" start="8" end="8" relatedGroup="2" label="Must Masturbate (Self)" oncePerStage="true" description="The character has lost the game must start masturbating" group="9" order="1"> + <trigger tag="must_masturbate" start="8" end="8" relatedGroup="2" label="Must Masturbate (Self)" oncePerStage="true" description="The character has lost the game must start masturbating" group="10" order="1"> <vars /> <defaultImage>loss</defaultImage> <defaultText>This is the character response when they lost their last hand and have to masturbate, and they're not the first character who's required to masturbate.</defaultText> @@ -108,12 +108,12 @@ <defaultImage>finishing</defaultImage> <defaultText>What the masturbating character says as they "finish".</defaultText> </trigger> - <trigger tag="finished_masturbating" start="10" end="10" label="Finished (Self)" description="Character has finished masturbating" group="9" order="6"> + <trigger tag="finished_masturbating" start="10" end="10" label="Finished (Self)" description="Character has finished masturbating" group="10" order="6"> <vars /> <defaultImage>finished</defaultImage> <defaultText>What the character says after they've finished masturbating.</defaultText> </trigger> - <trigger tag="opponent_lost" optional="true" start="0" end="10" label="Opponent Lost" hasTarget="true" description="An opponent lost the round and will either have to remove something or masturbate" group="3" order="-1"> + <trigger tag="opponent_lost" optional="true" start="0" end="10" label="Opponent Lost" hasTarget="true" description="An opponent lost the round and will either have to remove something or masturbate" group="8" order="0"> <vars> <string>name</string> </vars> @@ -484,7 +484,7 @@ <defaultImage>happy</defaultImage> <defaultText>What the character says when they win the game. Can happen in any stage unless you have specific line for that stage.</defaultText> </trigger> - <trigger tag="game_over_defeat" start="10" end="10" label="Game Over (Defeat)" oncePerStage="true" hasTarget="true" description="The game is over and this character lost" group="11" order="0" noPrefix="true"> + <trigger tag="game_over_defeat" start="10" end="10" label="Game Over (Defeat)" oncePerStage="true" hasTarget="true" description="The game is over and this character lost" group="11" order="1" noPrefix="true"> <vars> <string>name</string> </vars> diff --git a/opponents/tag_sort_order.txt b/opponents/tag_sort_order.txt new file mode 100644 index 0000000000000000000000000000000000000000..fe48df1fc8aa83904d4904b47e5b5449dee04ec2 --- /dev/null +++ b/opponents/tag_sort_order.txt @@ -0,0 +1,67 @@ +This lists out the sorting order from dialogue_tags.xml to make it easy to tell if there are conflicts. Every tag should have a unique group+order, or the sorting of behaviour.xml will be ambiguous + +Tag Group Order +--------------------------------------------- +selected 0 0 +opponent_selected 0 1 +game_start 0 2 +swap_cards 1 0 +good_hand 1 1 +okay_hand 1 2 +bad_hand 1 3 +hand 1 4 +must_strip 2 0 +must_strip_winning 2 1 +must_strip_normal 2 2 +must_strip_losing 2 3 +stripping 2 4 +stripped 2 5 +male_human_must_strip 3 0 +male_must_strip 3 1 +female_human_must_strip 3 2 +female_must_strip 3 3 +male_removing_accessory 4 0 +male_removed_accessory 4 1 +female_removing_accessory 4 2 +femaled_removed_accessory 4 3 +male_removing_minor 5 0 +male_removed_minor 5 1 +female_removing_minor 5 2 +female_removed_minor 5 3 +male_removing_major 6 0 +male_removed_major 6 1 +female_removing_major 6 2 +female_removed_major 6 3 +male_chest_will_be_visible 7 0 +male_chest_is_visible 7 1 +male_crotch_will_be_visible 7 2 +male_small_crotch_is_visible 7 3 +male_medium_crotch_is_visible 7 4 +male_large_crotch_is_visible 7 5 +female_chest_will_be_visible 7 6 +female_small_chest_is_visible 7 7 +female_medium_chest_is_visible 7 8 +female_large_chest_is_visible 7 9 +female_crotch_will_be_visible 7 10 +female_crotch_is_visible 7 11 +opponent_lost 8 0 +opponent_stripping 8 1 +opponent_stripped 8 2 +male_must_masturbate 9 0 +male_start_masturbating 9 1 +male_masturbating 9 2 +male_finished_masturbating 9 3 +female_must_masturbate 9 4 +female_start_masturbating 9 5 +female_masturbating 9 6 +female_finished_masturbating 9 7 +must_masturbate_first 10 0 +must_masturbate 10 1 +start_masturbating 10 2 +masturbating 10 3 +heavy_masturbating 10 4 +finishing_masturbating 10 5 +finished_masturbating 10 6 +game_over_victory 11 0 +game_over_defeat 11 1 +global 12 0 \ No newline at end of file diff --git a/tools/character_editor/Character Editor 3.0.1.zip b/tools/character_editor/Character Editor 3.0.1.zip deleted file mode 100644 index 232ba1837292eb9d66e61db2a7adeb06058b70fc..0000000000000000000000000000000000000000 Binary files a/tools/character_editor/Character Editor 3.0.1.zip and /dev/null differ diff --git a/tools/character_editor/Character Editor 3.0.zip b/tools/character_editor/Character Editor 3.0.zip deleted file mode 100644 index c45e0bac2b410e7814863a519d8404389ab5d4d9..0000000000000000000000000000000000000000 Binary files a/tools/character_editor/Character Editor 3.0.zip and /dev/null differ diff --git a/tools/character_editor/Character Editor 3.1.zip b/tools/character_editor/Character Editor 3.1.zip deleted file mode 100644 index b64855085ca9645064196ab2ac628d803ecdf8c8..0000000000000000000000000000000000000000 Binary files a/tools/character_editor/Character Editor 3.1.zip and /dev/null differ diff --git a/tools/character_editor/Character Editor 3.4.1.zip b/tools/character_editor/Character Editor 3.4.1.zip new file mode 100644 index 0000000000000000000000000000000000000000..1790773963ba663a459c6e0aeb42b6ae02f9dd58 Binary files /dev/null and b/tools/character_editor/Character Editor 3.4.1.zip differ diff --git a/tools/character_editor/Character Editor 3.5b.zip b/tools/character_editor/Character Editor 3.5b.zip new file mode 100644 index 0000000000000000000000000000000000000000..1bb1fb87029f983803319a10d2e3213939a3a4e5 Binary files /dev/null and b/tools/character_editor/Character Editor 3.5b.zip differ diff --git a/tools/character_editor/SPNATI Character Editor 1.16b.zip b/tools/character_editor/SPNATI Character Editor 1.16b.zip deleted file mode 100644 index b554d8e131fe6554af25467fd7fcbcb8f5f10ec6..0000000000000000000000000000000000000000 Binary files a/tools/character_editor/SPNATI Character Editor 1.16b.zip and /dev/null differ diff --git a/tools/character_editor/SPNATI_Character_Editor_2.1.zip b/tools/character_editor/SPNATI_Character_Editor_2.1.zip deleted file mode 100644 index 0b7487612c9fb274b0e5daffd550fe75548f3a90..0000000000000000000000000000000000000000 Binary files a/tools/character_editor/SPNATI_Character_Editor_2.1.zip and /dev/null differ diff --git a/tools/character_editor/SPNATI_Character_Editor_2.2.zip b/tools/character_editor/SPNATI_Character_Editor_2.2.zip deleted file mode 100644 index 4383cc181084053edfaa1e5c6f3c760c071e24c5..0000000000000000000000000000000000000000 Binary files a/tools/character_editor/SPNATI_Character_Editor_2.2.zip and /dev/null differ diff --git a/tools/character_editor/SPNATI_Character_Editor_2.3.zip b/tools/character_editor/SPNATI_Character_Editor_2.3.zip deleted file mode 100644 index 6ad248782ce0575a35ef2d60e1abda0bf4c9600d..0000000000000000000000000000000000000000 Binary files a/tools/character_editor/SPNATI_Character_Editor_2.3.zip and /dev/null differ diff --git a/tools/character_editor/SPNatI Character Editor 1.15.zip b/tools/character_editor/SPNatI Character Editor 1.15.zip deleted file mode 100644 index 470cf760d7970d5d496d94b4b5d071d20e5c4722..0000000000000000000000000000000000000000 Binary files a/tools/character_editor/SPNatI Character Editor 1.15.zip and /dev/null differ