diff --git a/Build/Configurations/Includes/SRB222_common.cfg b/Build/Configurations/Includes/SRB222_common.cfg index ac2459d8a78b81032f993349a4bd944d22678c7f..5f486b039f5e7db6972b2a75be609403e918f0ab 100644 --- a/Build/Configurations/Includes/SRB222_common.cfg +++ b/Build/Configurations/Includes/SRB222_common.cfg @@ -251,6 +251,7 @@ mapformat_udmf } damagetypes = "Generic Water Fire Lava Electric Spike DeathPitTilt DeathPitNoTilt Instakill SpecialStage"; + triggerertypes = "Player AllPlayers Mobj"; // LINEDEF FLAGS linedefflags diff --git a/Build/Configurations/Includes/SRB222_misc.cfg b/Build/Configurations/Includes/SRB222_misc.cfg index 53ad3b38092cd51f7a5696e715f2e320e9fd25c3..7d5f8956916f41b9959e70c4de5fbccb98c427d1 100644 --- a/Build/Configurations/Includes/SRB222_misc.cfg +++ b/Build/Configurations/Includes/SRB222_misc.cfg @@ -244,24 +244,6 @@ universalfields type = 1; default = 0.90625; } - - triggertag - { - type = 15; - default = 0; - } - - triggerer - { - type = 0; - default = 0; - enum - { - 0 = "Player"; - 1 = "All players"; - 2 = "Object"; - } - } } linedef diff --git a/Source/Core/Config/GameConfiguration.cs b/Source/Core/Config/GameConfiguration.cs index ab91eb6b5fa30e1f42f42fa32f5ed61b58386db5..9b2f8ad1ce7eac1b4a0943a2efbe98db2a7d3338 100755 --- a/Source/Core/Config/GameConfiguration.cs +++ b/Source/Core/Config/GameConfiguration.cs @@ -192,6 +192,9 @@ namespace CodeImp.DoomBuilder.Config //mxd. Internal sounds. These logical sound names won't trigger a warning when they are not bound to actual sounds in SOUNDINFO. private HashSet<string> internalsoundnames; + //Triggerer types + private HashSet<string> triggerertypes; + //mxd. Stuff to ignore private HashSet<string> ignoreddirectories; private HashSet<string> ignoredextensions; @@ -348,6 +351,9 @@ namespace CodeImp.DoomBuilder.Config //mxd. Internal sounds internal HashSet<string> InternalSoundNames { get { return internalsoundnames; } } + //Triggerer types + internal IEnumerable<string> TriggererTypes { get { return triggerertypes; } } + //mxd. Stuff to ignore internal HashSet<string> IgnoredFileExtensions { get { return ignoredextensions; } } internal HashSet<string> IgnoredDirectoryNames { get { return ignoreddirectories; } } @@ -529,7 +535,8 @@ namespace CodeImp.DoomBuilder.Config char[] splitter = {' '}; damagetypes = new HashSet<string>(cfg.ReadSetting("damagetypes", "None").Split(splitter, StringSplitOptions.RemoveEmptyEntries), StringComparer.OrdinalIgnoreCase); internalsoundnames = new HashSet<string>(cfg.ReadSetting("internalsoundnames", string.Empty).Split(splitter, StringSplitOptions.RemoveEmptyEntries), StringComparer.OrdinalIgnoreCase); - + triggerertypes = new HashSet<string>(cfg.ReadSetting("triggerertypes", string.Empty).Split(splitter, StringSplitOptions.RemoveEmptyEntries), StringComparer.OrdinalIgnoreCase); + //mxd. Load stuff to ignore ignoreddirectories = new HashSet<string>(cfg.ReadSetting("ignoreddirectories", string.Empty).Split(splitter, StringSplitOptions.RemoveEmptyEntries), StringComparer.OrdinalIgnoreCase); ignoredextensions = new HashSet<string>(cfg.ReadSetting("ignoredextensions", string.Empty).Split(splitter, StringSplitOptions.RemoveEmptyEntries), StringComparer.OrdinalIgnoreCase); diff --git a/Source/Core/Resources/UDMF_UI.cfg b/Source/Core/Resources/UDMF_UI.cfg index f1fad8c2d70c49e96e0d1a67400e29340464d1e4..aa91d592cec41cd470bc6fc8133b7b2fce91f6ac 100755 --- a/Source/Core/Resources/UDMF_UI.cfg +++ b/Source/Core/Resources/UDMF_UI.cfg @@ -84,6 +84,8 @@ uifields color_floor = 0; lightalpha = 0; fadealpha = 0; + triggertag = 15; + triggerer = 2; } thing diff --git a/Source/Core/Windows/SectorEditFormSRB2.Designer.cs b/Source/Core/Windows/SectorEditFormSRB2.Designer.cs index 8b06df6237192e5ccc3945b7f9de57f919eefb2c..c0104a7c902f6454badf43c8cf72ce49c24bf268 100644 --- a/Source/Core/Windows/SectorEditFormSRB2.Designer.cs +++ b/Source/Core/Windows/SectorEditFormSRB2.Designer.cs @@ -42,6 +42,9 @@ System.Windows.Forms.Label label5; System.Windows.Forms.Label labelLightAlpha; System.Windows.Forms.Label labelFadeAlpha; + System.Windows.Forms.GroupBox grouptriggers; + System.Windows.Forms.Label labelTriggerer; + System.Windows.Forms.Label labelTriggerTag; this.tagsselector = new CodeImp.DoomBuilder.Controls.TagsSelector(); this.resetdamagetype = new System.Windows.Forms.Button(); this.brightness = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); @@ -54,12 +57,14 @@ this.sectorheightlabel = new System.Windows.Forms.Label(); this.sectorheight = new System.Windows.Forms.Label(); this.floorheight = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); + this.triggerer = new System.Windows.Forms.ComboBox(); this.tabs = new System.Windows.Forms.TabControl(); this.tabproperties = new System.Windows.Forms.TabPage(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.flags = new CodeImp.DoomBuilder.Controls.CheckboxArrayControl(); this.tabColors = new System.Windows.Forms.TabPage(); this.groupBox8 = new System.Windows.Forms.GroupBox(); + this.fadeAlpha = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); this.lightAlpha = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); this.lightColor = new CodeImp.DoomBuilder.Controls.ColorFieldsControl(); this.fadeColor = new CodeImp.DoomBuilder.Controls.ColorFieldsControl(); @@ -104,7 +109,7 @@ this.cancel = new System.Windows.Forms.Button(); this.apply = new System.Windows.Forms.Button(); this.tooltip = new System.Windows.Forms.ToolTip(this.components); - this.fadeAlpha = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); + this.triggerTag = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); groupaction = new System.Windows.Forms.GroupBox(); groupeffect = new System.Windows.Forms.GroupBox(); label16 = new System.Windows.Forms.Label(); @@ -117,9 +122,13 @@ label5 = new System.Windows.Forms.Label(); labelLightAlpha = new System.Windows.Forms.Label(); labelFadeAlpha = new System.Windows.Forms.Label(); + grouptriggers = new System.Windows.Forms.GroupBox(); + labelTriggerer = new System.Windows.Forms.Label(); + labelTriggerTag = new System.Windows.Forms.Label(); groupaction.SuspendLayout(); groupeffect.SuspendLayout(); groupfloorceiling.SuspendLayout(); + grouptriggers.SuspendLayout(); this.tabs.SuspendLayout(); this.tabproperties.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -428,6 +437,47 @@ labelLightAlpha.TabIndex = 18; labelLightAlpha.Text = "Light alpha:"; // + // labelFadeAlpha + // + labelFadeAlpha.AutoSize = true; + labelFadeAlpha.Location = new System.Drawing.Point(6, 118); + labelFadeAlpha.Name = "labelFadeAlpha"; + labelFadeAlpha.Size = new System.Drawing.Size(63, 13); + labelFadeAlpha.TabIndex = 20; + labelFadeAlpha.Text = "Fade alpha:"; + // + // grouptriggers + // + grouptriggers.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + grouptriggers.Controls.Add(labelTriggerTag); + grouptriggers.Controls.Add(this.triggerTag); + grouptriggers.Controls.Add(labelTriggerer); + grouptriggers.Controls.Add(this.triggerer); + grouptriggers.Location = new System.Drawing.Point(287, 186); + grouptriggers.Name = "grouptriggers"; + grouptriggers.Size = new System.Drawing.Size(254, 138); + grouptriggers.TabIndex = 8; + grouptriggers.TabStop = false; + grouptriggers.Text = "Triggers"; + // + // labelTriggerer + // + labelTriggerer.Location = new System.Drawing.Point(6, 48); + labelTriggerer.Name = "labelTriggerer"; + labelTriggerer.Size = new System.Drawing.Size(74, 14); + labelTriggerer.TabIndex = 7; + labelTriggerer.Text = "Triggerer:"; + labelTriggerer.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // triggerer + // + this.triggerer.FormattingEnabled = true; + this.triggerer.Location = new System.Drawing.Point(86, 44); + this.triggerer.Name = "triggerer"; + this.triggerer.Size = new System.Drawing.Size(167, 21); + this.triggerer.TabIndex = 8; + // // tabs // this.tabs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -450,6 +500,7 @@ // // tabproperties // + this.tabproperties.Controls.Add(grouptriggers); this.tabproperties.Controls.Add(this.groupBox3); this.tabproperties.Controls.Add(groupaction); this.tabproperties.Controls.Add(groupeffect); @@ -513,6 +564,25 @@ this.groupBox8.TabStop = false; this.groupBox8.Text = "Global sector colors"; // + // fadeAlpha + // + this.fadeAlpha.AllowDecimal = false; + this.fadeAlpha.AllowExpressions = false; + this.fadeAlpha.AllowNegative = false; + this.fadeAlpha.AllowRelative = false; + this.fadeAlpha.ButtonStep = 1; + this.fadeAlpha.ButtonStepBig = 1F; + this.fadeAlpha.ButtonStepFloat = 1F; + this.fadeAlpha.ButtonStepSmall = 1F; + this.fadeAlpha.ButtonStepsUseModifierKeys = true; + this.fadeAlpha.ButtonStepsWrapAround = false; + this.fadeAlpha.Location = new System.Drawing.Point(74, 113); + this.fadeAlpha.Name = "fadeAlpha"; + this.fadeAlpha.Size = new System.Drawing.Size(81, 24); + this.fadeAlpha.StepValues = null; + this.fadeAlpha.TabIndex = 21; + this.fadeAlpha.WhenTextChanged += new System.EventHandler(this.fadeAlpha_WhenTextChanged); + // // lightAlpha // this.lightAlpha.AllowDecimal = false; @@ -635,7 +705,7 @@ // // floorAngleControl // - this.floorAngleControl.Angle = -1980; + this.floorAngleControl.Angle = -2160; this.floorAngleControl.AngleOffset = 90; this.floorAngleControl.DoomAngleClamping = false; this.floorAngleControl.Location = new System.Drawing.Point(6, 156); @@ -832,7 +902,7 @@ // // ceilAngleControl // - this.ceilAngleControl.Angle = -1980; + this.ceilAngleControl.Angle = -2160; this.ceilAngleControl.AngleOffset = 90; this.ceilAngleControl.DoomAngleClamping = false; this.ceilAngleControl.Location = new System.Drawing.Point(6, 156); @@ -1097,33 +1167,32 @@ this.tooltip.InitialDelay = 10; this.tooltip.ReshowDelay = 100; // - // fadeAlpha - // - this.fadeAlpha.AllowDecimal = false; - this.fadeAlpha.AllowExpressions = false; - this.fadeAlpha.AllowNegative = false; - this.fadeAlpha.AllowRelative = false; - this.fadeAlpha.ButtonStep = 1; - this.fadeAlpha.ButtonStepBig = 1F; - this.fadeAlpha.ButtonStepFloat = 1F; - this.fadeAlpha.ButtonStepSmall = 1F; - this.fadeAlpha.ButtonStepsUseModifierKeys = true; - this.fadeAlpha.ButtonStepsWrapAround = false; - this.fadeAlpha.Location = new System.Drawing.Point(74, 113); - this.fadeAlpha.Name = "fadeAlpha"; - this.fadeAlpha.Size = new System.Drawing.Size(81, 24); - this.fadeAlpha.StepValues = null; - this.fadeAlpha.TabIndex = 21; - this.fadeAlpha.WhenTextChanged += new System.EventHandler(this.fadeAlpha_WhenTextChanged); - // - // labelFadeAlpha - // - labelFadeAlpha.AutoSize = true; - labelFadeAlpha.Location = new System.Drawing.Point(6, 118); - labelFadeAlpha.Name = "labelFadeAlpha"; - labelFadeAlpha.Size = new System.Drawing.Size(63, 13); - labelFadeAlpha.TabIndex = 20; - labelFadeAlpha.Text = "Fade alpha:"; + // triggerTag + // + this.triggerTag.AllowDecimal = false; + this.triggerTag.AllowExpressions = false; + this.triggerTag.AllowNegative = false; + this.triggerTag.AllowRelative = false; + this.triggerTag.ButtonStep = 1; + this.triggerTag.ButtonStepBig = 1F; + this.triggerTag.ButtonStepFloat = 1F; + this.triggerTag.ButtonStepSmall = 1F; + this.triggerTag.ButtonStepsUseModifierKeys = true; + this.triggerTag.ButtonStepsWrapAround = false; + this.triggerTag.Location = new System.Drawing.Point(86, 14); + this.triggerTag.Name = "triggerTag"; + this.triggerTag.Size = new System.Drawing.Size(81, 24); + this.triggerTag.StepValues = null; + this.triggerTag.TabIndex = 20; + // + // labelTriggerTag + // + labelTriggerTag.Location = new System.Drawing.Point(6, 19); + labelTriggerTag.Name = "labelTriggerTag"; + labelTriggerTag.Size = new System.Drawing.Size(74, 14); + labelTriggerTag.TabIndex = 21; + labelTriggerTag.Text = "Trigger tag:"; + labelTriggerTag.TextAlign = System.Drawing.ContentAlignment.TopRight; // // SectorEditFormSRB2 // @@ -1151,6 +1220,7 @@ groupeffect.PerformLayout(); groupfloorceiling.ResumeLayout(false); groupfloorceiling.PerformLayout(); + grouptriggers.ResumeLayout(false); this.tabs.ResumeLayout(false); this.tabproperties.ResumeLayout(false); this.groupBox3.ResumeLayout(false); @@ -1236,5 +1306,7 @@ private System.Windows.Forms.GroupBox groupBox8; private Controls.ButtonsNumericTextbox lightAlpha; private Controls.ButtonsNumericTextbox fadeAlpha; + private System.Windows.Forms.ComboBox triggerer; + private Controls.ButtonsNumericTextbox triggerTag; } } \ No newline at end of file diff --git a/Source/Core/Windows/SectorEditFormSRB2.cs b/Source/Core/Windows/SectorEditFormSRB2.cs index 5bf544ce2e54424ee34160282e489cbe17c7f72b..e73fb072500d7769d716b3ee34ac81e88ab0007f 100644 --- a/Source/Core/Windows/SectorEditFormSRB2.cs +++ b/Source/Core/Windows/SectorEditFormSRB2.cs @@ -24,6 +24,7 @@ namespace CodeImp.DoomBuilder.Windows #region ================== Constants private const string NO_DAMAGETYPE = "None"; //mxd + private const string TRIGGERER_DEFAULT = "Player"; #endregion @@ -183,6 +184,10 @@ namespace CodeImp.DoomBuilder.Windows damagetype.Items.Add(NO_DAMAGETYPE); damagetype.Items.AddRange(General.Map.Data.DamageTypes); + //Fill triggerer list + List<string> ttypes = new List<string>(General.Map.Config.TriggererTypes); + triggerer.Items.AddRange(ttypes.ToArray()); + // Initialize custom fields editor fieldslist.Setup("sector"); @@ -293,6 +298,8 @@ namespace CodeImp.DoomBuilder.Windows // Misc gravity.Text = sc.Fields.GetValue("gravity", 1.0).ToString(); + triggerTag.Text = sc.Fields.GetValue("triggertag", 0).ToString(); + triggerer.Text = sc.Fields.GetValue("triggerer", TRIGGERER_DEFAULT); // Sector colors fadeColor.SetValueFrom(sc.Fields, true); @@ -382,6 +389,9 @@ namespace CodeImp.DoomBuilder.Windows // Misc if(s.Fields.GetValue("gravity", 1.0).ToString() != gravity.Text) gravity.Text = ""; + if (s.Fields.GetValue("triggertag", 0).ToString() != triggerTag.Text) triggerTag.Text = ""; + if (triggerer.SelectedIndex > -1 && s.Fields.GetValue("triggerer", TRIGGERER_DEFAULT) != triggerer.Text) + triggerer.SelectedIndex = -1; // Sector colors fadeColor.SetValueFrom(s.Fields, false); @@ -665,6 +675,12 @@ namespace CodeImp.DoomBuilder.Windows if(!string.IsNullOrEmpty(gravity.Text)) UniFields.SetFloat(s.Fields, "gravity", gravity.GetResultFloat(s.Fields.GetValue("gravity", 1.0)), 1.0); + if (!string.IsNullOrEmpty(triggerTag.Text)) + UniFields.SetInteger(s.Fields, "triggertag", triggerTag.GetResult(s.Fields.GetValue("triggertag", 0)), 0); + + if (!string.IsNullOrEmpty(triggerer.Text)) + UniFields.SetString(s.Fields, "triggerer", triggerer.Text, TRIGGERER_DEFAULT); + // Clear horizontal slopes double diff = Math.Abs(Math.Round(s.FloorSlopeOffset) - s.FloorSlopeOffset); if (Math.Abs(s.FloorSlope.z) == 1.0 && diff < 0.000000001) diff --git a/Source/Core/Windows/SectorEditFormSRB2.resx b/Source/Core/Windows/SectorEditFormSRB2.resx index 560d3f192dd958375a426ced631f0f1f20eea6e9..25662129232452017c8c1f93ff060105d2928f2c 100644 --- a/Source/Core/Windows/SectorEditFormSRB2.resx +++ b/Source/Core/Windows/SectorEditFormSRB2.resx @@ -181,12 +181,21 @@ <metadata name="labelLightAlpha.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </metadata> - <metadata name="tabproperties.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <metadata name="labelFadeAlpha.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </metadata> + <metadata name="grouptriggers.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </metadata> + <metadata name="labelTriggerTag.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </metadata> + <metadata name="labelTriggerer.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </metadata> + <metadata name="tabproperties.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> <data name="resetfloorlight.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m