diff --git a/Build/Configurations/Includes/ZDoom_misc.cfg b/Build/Configurations/Includes/ZDoom_misc.cfg index e321336f..80f48fb0 100644 --- a/Build/Configurations/Includes/ZDoom_misc.cfg +++ b/Build/Configurations/Includes/ZDoom_misc.cfg @@ -153,28 +153,7 @@ textures /* ADDITIONAL UNIVERSAL DOOM MAP FORMAT FIELD DEFINITIONS -Only add fields here that Doom Builder does not edit with its own user-interface! -The "default" field must match the UDMF specifications! - -Field data types: -0 = integer * -1 = float -2 = string -3 = bool -4 = linedeftype (integer) * -5 = sectoreffect (integer) * -6 = texture (string) -7 = flat (string) -8 = angle in degrees (integer) -9 = angle in radians (float) -10 = XXRRGGBB color (integer) -11 = enum option (integer) * -12 = enum bits (integer) * -13 = sector tag (integer) * -14 = thing tag (integer) * -15 = linedef tag (integer) * -16 = enum option (string) -17 = angle in degrees (float) +See Documents\fielddatatypes.txt for informtion on the types. */ universalfields { diff --git a/Documents/fielddatatypes.txt b/Documents/fielddatatypes.txt index 07966d48..8c85d4be 100644 --- a/Documents/fielddatatypes.txt +++ b/Documents/fielddatatypes.txt @@ -21,6 +21,8 @@ all supported data types: 15 = linedef tag (integer) * 16 = enum option (string) 17 = angle in degrees (float) +18 = thing type (integer) +19 = thing class (string) - Only types indicates with * are usable for standard hexen args - When no type is specified, the default type is 0 (integer) diff --git a/Resources/Icons/Angle.png b/Resources/Icons/Angle.png new file mode 100644 index 00000000..a0d67d28 Binary files /dev/null and b/Resources/Icons/Angle.png differ diff --git a/Resources/Icons/ColorPick.png b/Resources/Icons/ColorPick.png index 4cf7c053..e9d0ae11 100644 Binary files a/Resources/Icons/ColorPick.png and b/Resources/Icons/ColorPick.png differ diff --git a/Resources/Icons/List.png b/Resources/Icons/List.png new file mode 100644 index 00000000..acc30b85 Binary files /dev/null and b/Resources/Icons/List.png differ diff --git a/Resources/Icons/List_Images.png b/Resources/Icons/List_Images.png new file mode 100644 index 00000000..248eaf1a Binary files /dev/null and b/Resources/Icons/List_Images.png differ diff --git a/Resources/Icons/Text.png b/Resources/Icons/Text.png new file mode 100644 index 00000000..82b80f37 Binary files /dev/null and b/Resources/Icons/Text.png differ diff --git a/Source/Core/Actions/Action.cs b/Source/Core/Actions/Action.cs index 0cd16d59..485fc643 100644 --- a/Source/Core/Actions/Action.cs +++ b/Source/Core/Actions/Action.cs @@ -243,7 +243,9 @@ namespace CodeImp.DoomBuilder.Actions internal void Begin() { List delegateslist; - + + General.Plugins.OnActionBegin(this); + // Method bound? if(begindelegates.Count > 0) { @@ -277,6 +279,8 @@ namespace CodeImp.DoomBuilder.Actions General.Actions.ResetExclusiveRequest(); General.Actions.Current = null; } + + General.Plugins.OnActionEnd(this); } // This checks if the action qualifies for a key combination diff --git a/Source/Core/Builder.csproj b/Source/Core/Builder.csproj index 436d817a..ae25f003 100644 --- a/Source/Core/Builder.csproj +++ b/Source/Core/Builder.csproj @@ -704,6 +704,8 @@ + + Form @@ -762,7 +764,11 @@ + + + + diff --git a/Source/Core/Config/ThingTypeInfo.cs b/Source/Core/Config/ThingTypeInfo.cs index f3610341..d11d7383 100644 --- a/Source/Core/Config/ThingTypeInfo.cs +++ b/Source/Core/Config/ThingTypeInfo.cs @@ -53,6 +53,7 @@ namespace CodeImp.DoomBuilder.Config private int index; private string title; private string sprite; + private ActorStructure actor; private long spritelongname; private int color; private bool arrow; @@ -75,6 +76,7 @@ namespace CodeImp.DoomBuilder.Config public int Index { get { return index; } } public string Title { get { return title; } } public string Sprite { get { return sprite; } } + public ActorStructure Actor { get { return actor; } } public long SpriteLongName { get { return spritelongname; } } public int Color { get { return color; } } public bool Arrow { get { return arrow; } } @@ -101,6 +103,7 @@ namespace CodeImp.DoomBuilder.Config // Initialize this.index = index; this.category = null; + this.actor = null; this.title = "<" + index.ToString(CultureInfo.InvariantCulture) + ">"; this.sprite = DataManager.INTERNAL_PREFIX + "unknownthing"; this.color = 0; @@ -131,6 +134,7 @@ namespace CodeImp.DoomBuilder.Config this.category = cat; this.args = new ArgumentInfo[Linedef.NUM_ARGS]; this.isknown = true; + this.actor = null; // Read properties this.title = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".title", "<" + key + ">"); @@ -173,6 +177,7 @@ namespace CodeImp.DoomBuilder.Config this.index = index; this.category = cat; this.title = title; + this.actor = null; this.isknown = true; this.args = new ArgumentInfo[Linedef.NUM_ARGS]; for(int i = 0; i < Linedef.NUM_ARGS; i++) this.args[i] = new ArgumentInfo(i); @@ -210,6 +215,7 @@ namespace CodeImp.DoomBuilder.Config this.index = actor.DoomEdNum; this.category = cat; this.title = ""; + this.actor = actor; this.isknown = true; this.args = new ArgumentInfo[Linedef.NUM_ARGS]; for(int i = 0; i < Linedef.NUM_ARGS; i++) this.args[i] = new ArgumentInfo(i); @@ -244,6 +250,9 @@ namespace CodeImp.DoomBuilder.Config // This updates the properties from a decorate actor internal void ModifyByDecorateActor(ActorStructure actor) { + // Keep reference to actor + this.actor = actor; + // Set the title if(actor.HasPropertyWithValue("$title")) title = actor.GetPropertyAllValues("$title"); diff --git a/Source/Core/Controls/ArgumentBox.Designer.cs b/Source/Core/Controls/ArgumentBox.Designer.cs index a3093328..8be9b6e4 100644 --- a/Source/Core/Controls/ArgumentBox.Designer.cs +++ b/Source/Core/Controls/ArgumentBox.Designer.cs @@ -47,11 +47,10 @@ namespace CodeImp.DoomBuilder.Controls // this.button.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button.Image = global::CodeImp.DoomBuilder.Properties.Resources.treeview; - this.button.ImageAlign = System.Drawing.ContentAlignment.BottomCenter; this.button.Location = new System.Drawing.Point(153, 0); this.button.Name = "button"; this.button.Padding = new System.Windows.Forms.Padding(0, 0, 1, 2); - this.button.Size = new System.Drawing.Size(30, 24); + this.button.Size = new System.Drawing.Size(28, 24); this.button.TabIndex = 1; this.button.UseVisualStyleBackColor = true; this.button.Visible = false; diff --git a/Source/Core/Controls/ArgumentBox.cs b/Source/Core/Controls/ArgumentBox.cs index c5e9bbdf..c5d94d93 100644 --- a/Source/Core/Controls/ArgumentBox.cs +++ b/Source/Core/Controls/ArgumentBox.cs @@ -197,6 +197,7 @@ namespace CodeImp.DoomBuilder.Controls { // Show the button button.Visible = true; + button.Image = typehandler.BrowseImage; scrollbuttons.Visible = false; combobox.DropDownStyle = ComboBoxStyle.Simple; } diff --git a/Source/Core/Controls/FieldsEditorControl.Designer.cs b/Source/Core/Controls/FieldsEditorControl.Designer.cs index b1d60e6e..3a2a30e6 100644 --- a/Source/Core/Controls/FieldsEditorControl.Designer.cs +++ b/Source/Core/Controls/FieldsEditorControl.Designer.cs @@ -29,10 +29,10 @@ namespace CodeImp.DoomBuilder.Controls private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - 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(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle(); this.fieldslist = new System.Windows.Forms.DataGridView(); this.fieldname = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.fieldtype = new System.Windows.Forms.DataGridViewComboBoxColumn(); @@ -57,14 +57,14 @@ namespace CodeImp.DoomBuilder.Controls this.fieldname, this.fieldtype, this.fieldvalue}); - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle4.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.fieldslist.DefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle24.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle24.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle24.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle24.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle24.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.fieldslist.DefaultCellStyle = dataGridViewCellStyle24; this.fieldslist.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.fieldslist.Location = new System.Drawing.Point(0, 0); this.fieldslist.MultiSelect = false; @@ -91,12 +91,12 @@ namespace CodeImp.DoomBuilder.Controls // // fieldname // - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.NullValue = null; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - this.fieldname.DefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle21.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle21.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle21.NullValue = null; + dataGridViewCellStyle21.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle21.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + this.fieldname.DefaultCellStyle = dataGridViewCellStyle21; this.fieldname.Frozen = true; this.fieldname.HeaderText = "Property"; this.fieldname.Name = "fieldname"; @@ -105,11 +105,11 @@ namespace CodeImp.DoomBuilder.Controls // fieldtype // this.fieldtype.AutoComplete = false; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - this.fieldtype.DefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle22.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle22.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle22.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle22.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + this.fieldtype.DefaultCellStyle = dataGridViewCellStyle22; this.fieldtype.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; this.fieldtype.HeaderText = "Type"; this.fieldtype.Name = "fieldtype"; @@ -119,11 +119,11 @@ namespace CodeImp.DoomBuilder.Controls // // fieldvalue // - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - this.fieldvalue.DefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle23.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle23.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle23.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle23.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + this.fieldvalue.DefaultCellStyle = dataGridViewCellStyle23; this.fieldvalue.HeaderText = "Value"; this.fieldvalue.Name = "fieldvalue"; this.fieldvalue.Resizable = System.Windows.Forms.DataGridViewTriState.True; @@ -136,13 +136,14 @@ namespace CodeImp.DoomBuilder.Controls // // browsebutton // + this.browsebutton.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.browsebutton.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.browsebutton.Image = global::CodeImp.DoomBuilder.Properties.Resources.treeview; - this.browsebutton.ImageAlign = System.Drawing.ContentAlignment.BottomCenter; + this.browsebutton.Image = global::CodeImp.DoomBuilder.Properties.Resources.List; this.browsebutton.Location = new System.Drawing.Point(343, 75); this.browsebutton.Name = "browsebutton"; - this.browsebutton.Size = new System.Drawing.Size(28, 26); + this.browsebutton.Size = new System.Drawing.Size(28, 22); this.browsebutton.TabIndex = 2; + this.browsebutton.TabStop = false; this.browsebutton.UseVisualStyleBackColor = true; this.browsebutton.Click += new System.EventHandler(this.browsebutton_Click); // diff --git a/Source/Core/Controls/FieldsEditorControl.cs b/Source/Core/Controls/FieldsEditorControl.cs index 9e0d9f0e..efc23843 100644 --- a/Source/Core/Controls/FieldsEditorControl.cs +++ b/Source/Core/Controls/FieldsEditorControl.cs @@ -592,6 +592,7 @@ namespace CodeImp.DoomBuilder.Controls { // Browse (row as FieldsEditorRow).Browse(this.ParentForm); + fieldslist.Focus(); } } } @@ -711,24 +712,11 @@ namespace CodeImp.DoomBuilder.Controls // Show button enumscombo.Visible = false; + browsebutton.Image = frow.TypeHandler.BrowseImage; browsebutton.Location = new Point(cellrect.Right - browsebutton.Width, cellrect.Top); browsebutton.Height = cellrect.Height; + Console.WriteLine(cellrect.Height.ToString()); browsebutton.Visible = true; - - /* - // Determine image/text - if((frow.Type == UniversalFieldType.SectorEffect) || - (frow.Type == UniversalFieldType.LinedefAction)) - { - browsebutton.Image = CodeImp.DoomBuilder.Properties.Resources.treeview; - browsebutton.Text = ""; - } - else - { - browsebutton.Image = null; - browsebutton.Text = "..."; - } - */ } else { diff --git a/Source/Core/Editing/EditingManager.cs b/Source/Core/Editing/EditingManager.cs index 83506995..d980ad9e 100644 --- a/Source/Core/Editing/EditingManager.cs +++ b/Source/Core/Editing/EditingManager.cs @@ -188,6 +188,7 @@ namespace CodeImp.DoomBuilder.Editing { // Cancel disengaging = true; + General.Plugins.OnEditCancel(); mode.OnCancel(); return true; } @@ -355,7 +356,11 @@ namespace CodeImp.DoomBuilder.Editing { // Disenagage old mode disengaging = true; - if(oldmode != null) oldmode.OnDisengage(); + if(oldmode != null) + { + General.Plugins.OnEditDisengage(oldmode, newmode); + oldmode.OnDisengage(); + } // Reset cursor General.Interface.SetCursor(Cursors.Default); @@ -367,7 +372,11 @@ namespace CodeImp.DoomBuilder.Editing disengaging = false; // Engage new mode - if(newmode != null) newmode.OnEngage(); + if(newmode != null) + { + newmode.OnEngage(); + General.Plugins.OnEditEngage(oldmode, newmode); + } // Bind new switch actions UnbindSwitchActions(); @@ -426,7 +435,10 @@ namespace CodeImp.DoomBuilder.Editing { // Let the mode know if(mode != null) + { + General.Plugins.OnEditCancel(); mode.OnCancel(); + } } /// @@ -437,7 +449,10 @@ namespace CodeImp.DoomBuilder.Editing { // Let the mode know if(mode != null) + { + General.Plugins.OnEditAccept(); mode.OnAccept(); + } } #endregion diff --git a/Source/Core/Plugins/Plug.cs b/Source/Core/Plugins/Plug.cs index a12fcd44..7ad7c6e4 100644 --- a/Source/Core/Plugins/Plug.cs +++ b/Source/Core/Plugins/Plug.cs @@ -6,7 +6,9 @@ using System.Collections.Generic; using System.Globalization; using System.Text; using System.IO; +using System.Windows.Forms; using CodeImp.DoomBuilder.Editing; +using CodeImp.DoomBuilder.Geometry; using CodeImp.DoomBuilder.Rendering; using CodeImp.DoomBuilder.Data; using CodeImp.DoomBuilder.Map; @@ -121,101 +123,73 @@ namespace CodeImp.DoomBuilder.Plugins /// This iscalled when the ceiling surface buffer is updated for a sector. The plugin can /// modify the vertices to change how the surface is presented to the user. /// - public virtual void OnSectorCeilingSurfaceUpdate(Sector s, ref FlatVertex[] vertices) - { - } + public virtual void OnSectorCeilingSurfaceUpdate(Sector s, ref FlatVertex[] vertices) { } /// /// This iscalled when the floor surface buffer is updated for a sector. The plugin can /// modify the vertices to change how the surface is presented to the user. /// - public virtual void OnSectorFloorSurfaceUpdate(Sector s, ref FlatVertex[] vertices) - { - } + public virtual void OnSectorFloorSurfaceUpdate(Sector s, ref FlatVertex[] vertices) { } /// /// Occurs before a map is opened. /// - public virtual void OnMapOpenBegin() - { - } + public virtual void OnMapOpenBegin() { } /// /// Occurs after a map is opened. /// - public virtual void OnMapOpenEnd() - { - } + public virtual void OnMapOpenEnd() { } /// /// Occurs before a new map is created. /// - public virtual void OnMapNewBegin() - { - } + public virtual void OnMapNewBegin() { } /// /// Occurs after a new map is created. /// - public virtual void OnMapNewEnd() - { - } + public virtual void OnMapNewEnd() { } /// /// Occurs before the map is closed. /// - public virtual void OnMapCloseBegin() - { - } + public virtual void OnMapCloseBegin() { } /// /// Occurs after a the map is closed. /// - public virtual void OnMapCloseEnd() - { - } + public virtual void OnMapCloseEnd() { } /// /// Occurs before a map is saved. /// - public virtual void OnMapSaveBegin(SavePurpose purpose) - { - } + public virtual void OnMapSaveBegin(SavePurpose purpose) { } /// /// Occurs after a map is saved. /// - public virtual void OnMapSaveEnd(SavePurpose purpose) - { - } + public virtual void OnMapSaveEnd(SavePurpose purpose) { } /// /// Occurs before the MapSet is changed. This means that the active MapSet will be disposed and changed to a new one. /// - public virtual void OnMapSetChangeBegin() - { - } + public virtual void OnMapSetChangeBegin() { } /// /// Occurs after the MapSet is changed. /// - public virtual void OnMapSetChangeEnd() - { - } + public virtual void OnMapSetChangeEnd() { } /// /// This is called after the constructor to allow a plugin to initialize. /// - public virtual void OnInitialize() - { - } + public virtual void OnInitialize() { } /// /// This is called when the user chose to reload the resources. /// - public virtual void OnReloadResources() - { - } + public virtual void OnReloadResources() { } /// /// This is called by the Doom Builder core when the editing mode changes. @@ -223,121 +197,132 @@ namespace CodeImp.DoomBuilder.Plugins /// /// The previous editing mode /// The new editing mode - public virtual bool OnModeChange(EditMode oldmode, EditMode newmode) - { - return true; - } + public virtual bool OnModeChange(EditMode oldmode, EditMode newmode) { return true; } /// /// Called by the Doom Builder core when the user changes the program configuration (F5). /// - public virtual void OnProgramReconfigure() - { - } + public virtual void OnProgramReconfigure() { } /// /// Called by the Doom Builder core when the user changes the map settings (F2). /// - public virtual void OnMapReconfigure() - { - } + public virtual void OnMapReconfigure() { } /// /// Called by the Doom Builder core when the user wants to copy selected geometry. /// Return false to abort the copy operation. /// The result parameter is false when the operation was already aborted by another plugin. /// - public virtual bool OnCopyBegin(bool result) - { - return true; - } + public virtual bool OnCopyBegin(bool result) { return true; } /// /// Called by the Doom Builder core when the user has copied geometry. /// - public virtual void OnCopyEnd() - { - } + public virtual void OnCopyEnd() { } /// /// Called by the Doom Builder core when the user wants to paste geometry into the map. /// Return false to abort the paste operation. /// The result parameter is false when the operation was already aborted by another plugin. /// - public virtual bool OnPasteBegin(PasteOptions options, bool result) - { - return true; - } + public virtual bool OnPasteBegin(PasteOptions options, bool result) { return true; } /// /// Called by the Doom Builder core when the user pastes geometry into the map. The new geometry is created and marked before this method is called. /// - public virtual void OnPasteEnd(PasteOptions options) - { - } + public virtual void OnPasteEnd(PasteOptions options) { } /// /// Called by the Doom Builder core when the user wants to undo the previous action. /// Return false to abort the operation. /// The result parameter is false when the operation was already aborted by another plugin. /// - public virtual bool OnUndoBegin(bool result) - { - return true; - } + public virtual bool OnUndoBegin(bool result) { return true; } /// /// Called by the Doom Builder core when the user has undone the previous action. /// - public virtual void OnUndoEnd() - { - } + public virtual void OnUndoEnd() { } /// /// Called by the Doom Builder core when the user wants to redo the previously undone action. /// Return false to abort the operation. /// The result parameter is false when the operation was already aborted by another plugin. /// - public virtual bool OnRedoBegin(bool result) - { - return true; - } + public virtual bool OnRedoBegin(bool result) { return true; } /// /// Called by the Doom Builder core when the user has redone the action. /// - public virtual void OnRedoEnd() - { - } + public virtual void OnRedoEnd() { } /// /// Called by the Doom Builder core when a new undo level has been created. /// - public virtual void OnUndoCreated() - { - } + public virtual void OnUndoCreated() { } /// /// Called by the Doom Builder core when an undo level has been withdrawn. /// - public virtual void OnUndoWithdrawn() - { - } + public virtual void OnUndoWithdrawn() { } /// /// Called when the user opens the Preferences dialog. /// - public virtual void OnShowPreferences(PreferencesController controller) - { - } + public virtual void OnShowPreferences(PreferencesController controller) { } /// /// Called when the user closes the Preferences dialog by either accepting the changes or cancelling. /// - public virtual void OnClosePreferences(PreferencesController controller) - { - } + public virtual void OnClosePreferences(PreferencesController controller) { } + /// + /// Called when an Action begins. + /// + public virtual void OnActionBegin(CodeImp.DoomBuilder.Actions.Action action) { } + + /// + /// Called when an Action ends. + /// + public virtual void OnActionEnd(CodeImp.DoomBuilder.Actions.Action action) { } + + /// + /// Called when an Editing Mode engages + /// + public virtual void OnEditEngage(EditMode oldmode, EditMode newmode) { } + + /// + /// Called when an Editing Mode disengages + /// + public virtual void OnEditDisengage(EditMode oldmode, EditMode newmode) { } + + /// + /// Called when an Editing Mode is cancelled + /// + public virtual void OnEditCancel() { } + + /// + /// Called when an Editing Mode is accepted + /// + public virtual void OnEditAccept() { } + + // Interface events + public virtual void OnEditMouseClick(MouseEventArgs e) { } + public virtual void OnEditMouseDoubleClick(MouseEventArgs e) { } + public virtual void OnEditMouseDown(MouseEventArgs e) { } + public virtual void OnEditMouseEnter(EventArgs e) { } + public virtual void OnEditMouseLeave(EventArgs e) { } + public virtual void OnEditMouseMove(MouseEventArgs e) { } + public virtual void OnEditMouseUp(MouseEventArgs e) { } + public virtual void OnEditKeyDown(KeyEventArgs e) { } + public virtual void OnEditKeyUp(KeyEventArgs e) { } + public virtual void OnEditMouseInput(Vector2D delta) { } + + // Rendering events + public virtual void OnEditRedrawDisplayBegin() { } + public virtual void OnEditRedrawDisplayEnd() { } + #endregion } } diff --git a/Source/Core/Plugins/PluginManager.cs b/Source/Core/Plugins/PluginManager.cs index 5d935d15..26696865 100644 --- a/Source/Core/Plugins/PluginManager.cs +++ b/Source/Core/Plugins/PluginManager.cs @@ -22,8 +22,10 @@ using System.Collections.Generic; using System.Globalization; using System.Text; using System.IO; +using System.Windows.Forms; using CodeImp.DoomBuilder.Editing; using System.Reflection; +using CodeImp.DoomBuilder.Geometry; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Rendering; using CodeImp.DoomBuilder.Windows; @@ -221,14 +223,7 @@ namespace CodeImp.DoomBuilder.Plugins #endregion #region ================== Events - - - public void ReloadResources() - { - foreach(Plugin p in plugins) p.Plug.OnReloadResources(); - } - - + public bool ModeChanges(EditMode oldmode, EditMode newmode) { bool result = true; @@ -236,19 +231,6 @@ namespace CodeImp.DoomBuilder.Plugins return result; } - - public void ProgramReconfigure() - { - foreach(Plugin p in plugins) p.Plug.OnProgramReconfigure(); - } - - - public void MapReconfigure() - { - foreach(Plugin p in plugins) p.Plug.OnMapReconfigure(); - } - - public bool OnCopyBegin() { bool result = true; @@ -256,13 +238,6 @@ namespace CodeImp.DoomBuilder.Plugins return result; } - - public void OnCopyEnd() - { - foreach(Plugin p in plugins) p.Plug.OnCopyEnd(); - } - - public bool OnPasteBegin(PasteOptions options) { bool result = true; @@ -270,13 +245,6 @@ namespace CodeImp.DoomBuilder.Plugins return result; } - - public void OnPasteEnd(PasteOptions options) - { - foreach(Plugin p in plugins) p.Plug.OnPasteEnd(options.Copy()); - } - - public bool OnUndoBegin() { bool result = true; @@ -284,13 +252,6 @@ namespace CodeImp.DoomBuilder.Plugins return result; } - - public void OnUndoEnd() - { - foreach(Plugin p in plugins) p.Plug.OnUndoEnd(); - } - - public bool OnRedoBegin() { bool result = true; @@ -298,107 +259,47 @@ namespace CodeImp.DoomBuilder.Plugins return result; } - - public void OnRedoEnd() - { - foreach(Plugin p in plugins) p.Plug.OnRedoEnd(); - } - - - public void OnUndoCreated() - { - foreach(Plugin p in plugins) p.Plug.OnUndoCreated(); - } - - - public void OnUndoWithdrawn() - { - foreach(Plugin p in plugins) p.Plug.OnUndoWithdrawn(); - } - - - public void OnMapOpenBegin() - { - foreach(Plugin p in plugins) p.Plug.OnMapOpenBegin(); - } - - - public void OnMapOpenEnd() - { - foreach(Plugin p in plugins) p.Plug.OnMapOpenEnd(); - } - - - public void OnMapNewBegin() - { - foreach(Plugin p in plugins) p.Plug.OnMapNewBegin(); - } - - - public void OnMapNewEnd() - { - foreach(Plugin p in plugins) p.Plug.OnMapNewEnd(); - } - - - public void OnMapCloseBegin() - { - foreach(Plugin p in plugins) p.Plug.OnMapCloseBegin(); - } - - - public void OnMapCloseEnd() - { - foreach(Plugin p in plugins) p.Plug.OnMapCloseEnd(); - } - - - public void OnMapSaveBegin(SavePurpose purpose) - { - foreach(Plugin p in plugins) p.Plug.OnMapSaveBegin(purpose); - } - - - public void OnMapSaveEnd(SavePurpose purpose) - { - foreach(Plugin p in plugins) p.Plug.OnMapSaveEnd(purpose); - } - - - public void OnMapSetChangeBegin() - { - foreach(Plugin p in plugins) p.Plug.OnMapSetChangeBegin(); - } - - - public void OnMapSetChangeEnd() - { - foreach(Plugin p in plugins) p.Plug.OnMapSetChangeEnd(); - } - - - public void OnSectorCeilingSurfaceUpdate(Sector s, ref FlatVertex[] vertices) - { - foreach(Plugin p in plugins) p.Plug.OnSectorCeilingSurfaceUpdate(s, ref vertices); - } - - - public void OnSectorFloorSurfaceUpdate(Sector s, ref FlatVertex[] vertices) - { - foreach(Plugin p in plugins) p.Plug.OnSectorFloorSurfaceUpdate(s, ref vertices); - } - - - public void OnShowPreferences(PreferencesController controller) - { - foreach(Plugin p in plugins) p.Plug.OnShowPreferences(controller); - } - - - public void OnClosePreferences(PreferencesController controller) - { - foreach(Plugin p in plugins) p.Plug.OnClosePreferences(controller); - } + public void ReloadResources() { foreach(Plugin p in plugins) p.Plug.OnReloadResources(); } + public void ProgramReconfigure() { foreach(Plugin p in plugins) p.Plug.OnProgramReconfigure(); } + public void MapReconfigure() { foreach(Plugin p in plugins) p.Plug.OnMapReconfigure(); } + public void OnCopyEnd() { foreach(Plugin p in plugins) p.Plug.OnCopyEnd(); } + public void OnPasteEnd(PasteOptions options) { foreach(Plugin p in plugins) p.Plug.OnPasteEnd(options.Copy()); } + public void OnUndoEnd() { foreach(Plugin p in plugins) p.Plug.OnUndoEnd(); } + public void OnRedoEnd() { foreach(Plugin p in plugins) p.Plug.OnRedoEnd(); } + public void OnUndoCreated() { foreach(Plugin p in plugins) p.Plug.OnUndoCreated(); } + public void OnUndoWithdrawn() { foreach(Plugin p in plugins) p.Plug.OnUndoWithdrawn(); } + public void OnMapOpenBegin() { foreach(Plugin p in plugins) p.Plug.OnMapOpenBegin(); } + public void OnMapOpenEnd() { foreach(Plugin p in plugins) p.Plug.OnMapOpenEnd(); } + public void OnMapNewBegin() { foreach(Plugin p in plugins) p.Plug.OnMapNewBegin(); } + public void OnMapNewEnd() { foreach(Plugin p in plugins) p.Plug.OnMapNewEnd(); } + public void OnMapCloseBegin() { foreach(Plugin p in plugins) p.Plug.OnMapCloseBegin(); } + public void OnMapCloseEnd() { foreach(Plugin p in plugins) p.Plug.OnMapCloseEnd(); } + public void OnMapSaveBegin(SavePurpose purpose) { foreach(Plugin p in plugins) p.Plug.OnMapSaveBegin(purpose); } + public void OnMapSaveEnd(SavePurpose purpose) { foreach(Plugin p in plugins) p.Plug.OnMapSaveEnd(purpose); } + public void OnMapSetChangeBegin() { foreach(Plugin p in plugins) p.Plug.OnMapSetChangeBegin(); } + public void OnMapSetChangeEnd() { foreach(Plugin p in plugins) p.Plug.OnMapSetChangeEnd(); } + public void OnSectorCeilingSurfaceUpdate(Sector s, ref FlatVertex[] vertices) { foreach(Plugin p in plugins) p.Plug.OnSectorCeilingSurfaceUpdate(s, ref vertices); } + public void OnSectorFloorSurfaceUpdate(Sector s, ref FlatVertex[] vertices) { foreach(Plugin p in plugins) p.Plug.OnSectorFloorSurfaceUpdate(s, ref vertices); } + public void OnShowPreferences(PreferencesController controller) { foreach(Plugin p in plugins) p.Plug.OnShowPreferences(controller); } + public void OnClosePreferences(PreferencesController controller) { foreach(Plugin p in plugins) p.Plug.OnClosePreferences(controller); } + public void OnActionBegin(CodeImp.DoomBuilder.Actions.Action action) { foreach(Plugin p in plugins) p.Plug.OnActionBegin(action); } + public void OnActionEnd(CodeImp.DoomBuilder.Actions.Action action) { foreach(Plugin p in plugins) p.Plug.OnActionEnd(action); } + public void OnEditEngage(EditMode oldmode, EditMode newmode) { foreach(Plugin p in plugins) p.Plug.OnEditEngage(oldmode, newmode); } + public void OnEditDisengage(EditMode oldmode, EditMode newmode) { foreach(Plugin p in plugins) p.Plug.OnEditDisengage(oldmode, newmode); } + public void OnEditCancel() { foreach(Plugin p in plugins) p.Plug.OnEditCancel(); } + public void OnEditAccept() { foreach(Plugin p in plugins) p.Plug.OnEditAccept(); } + public void OnEditMouseClick(MouseEventArgs e) { foreach(Plugin p in plugins) p.Plug.OnEditMouseClick(e); } + public void OnEditMouseDoubleClick(MouseEventArgs e) { foreach(Plugin p in plugins) p.Plug.OnEditMouseDoubleClick(e); } + public void OnEditMouseDown(MouseEventArgs e) { foreach(Plugin p in plugins) p.Plug.OnEditMouseDown(e); } + public void OnEditMouseEnter(EventArgs e) { foreach(Plugin p in plugins) p.Plug.OnEditMouseEnter(e); } + public void OnEditMouseLeave(EventArgs e) { foreach(Plugin p in plugins) p.Plug.OnEditMouseLeave(e); } + public void OnEditMouseMove(MouseEventArgs e) { foreach(Plugin p in plugins) p.Plug.OnEditMouseMove(e); } + public void OnEditMouseUp(MouseEventArgs e) { foreach(Plugin p in plugins) p.Plug.OnEditMouseUp(e); } + public void OnEditKeyDown(KeyEventArgs e) { foreach(Plugin p in plugins) p.Plug.OnEditKeyDown(e); } + public void OnEditKeyUp(KeyEventArgs e) { foreach(Plugin p in plugins) p.Plug.OnEditKeyUp(e); } + public void OnEditMouseInput(Vector2D delta) { foreach(Plugin p in plugins) p.Plug.OnEditMouseInput(delta); } + public void OnEditRedrawDisplayBegin() { foreach(Plugin p in plugins) p.Plug.OnEditRedrawDisplayBegin(); } + public void OnEditRedrawDisplayEnd() { foreach(Plugin p in plugins) p.Plug.OnEditRedrawDisplayEnd(); } #endregion } diff --git a/Source/Core/Properties/Resources.Designer.cs b/Source/Core/Properties/Resources.Designer.cs index 307ff7bd..418a7f0d 100644 --- a/Source/Core/Properties/Resources.Designer.cs +++ b/Source/Core/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3082 +// Runtime Version:2.0.50727.3615 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -60,6 +60,13 @@ namespace CodeImp.DoomBuilder.Properties { } } + internal static System.Drawing.Bitmap Angle { + get { + object obj = ResourceManager.GetObject("Angle", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap CLogo { get { object obj = ResourceManager.GetObject("CLogo", resourceCulture); @@ -172,6 +179,20 @@ namespace CodeImp.DoomBuilder.Properties { } } + internal static System.Drawing.Bitmap List { + get { + object obj = ResourceManager.GetObject("List", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap List_Images { + get { + object obj = ResourceManager.GetObject("List_Images", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap mergegeometry { get { object obj = ResourceManager.GetObject("mergegeometry", resourceCulture); @@ -424,6 +445,13 @@ namespace CodeImp.DoomBuilder.Properties { } } + internal static System.Drawing.Bitmap Text { + get { + object obj = ResourceManager.GetObject("Text", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap treeview { get { object obj = ResourceManager.GetObject("treeview", resourceCulture); diff --git a/Source/Core/Properties/Resources.resx b/Source/Core/Properties/Resources.resx index 46d9337d..8435c3f6 100644 --- a/Source/Core/Properties/Resources.resx +++ b/Source/Core/Properties/Resources.resx @@ -121,17 +121,23 @@ ..\Resources\Grid2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Grid2_arrowup.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ScriptHelp.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\ScriptConstant.xpm;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\Grid4.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\PasteSpecial.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\UnknownImage.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Hourglass.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Copy.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Status11.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -139,9 +145,6 @@ ..\Resources\Status10.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\mergegeometry.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\CLogo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -166,14 +169,17 @@ ..\Resources\KnownTextureSet.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\NewScript.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Status12.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Redo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\OpenMap.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SaveAll.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\ViewTextureFloor.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -187,23 +193,23 @@ ..\Resources\Monster2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Hourglass.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\WarningLarge.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\NewMap.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Copy.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\ScriptPalette.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\NewMap2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\ViewNormal.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Grid2_arrowup.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\SaveMap.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -217,14 +223,11 @@ ..\Resources\Status0.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\ScriptHelp.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\Prefab.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Splash3_trans.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\MissingTexture.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Zoom.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -247,6 +250,9 @@ ..\Resources\WarningOff.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\OpenScript.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\ViewTextureCeiling.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -259,14 +265,14 @@ ..\Resources\mergegeometry2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Prefab2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ViewNormal.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Question.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\SaveAll.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\mergegeometry.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\ColorPick.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -280,11 +286,8 @@ ..\Resources\ScriptCompile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\SaveScript.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\OpenScript.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Prefab2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Paste.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -292,11 +295,11 @@ ..\Resources\Folder.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Grid4.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Splash3_trans.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\MissingTexture.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\OpenMap.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\ErrorLarge.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -304,10 +307,19 @@ ..\Resources\Warning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\NewScript.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SaveScript.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\PasteSpecial.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\List.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\List_Images.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Text.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Angle.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/Source/Core/Resources/Angle.png b/Source/Core/Resources/Angle.png new file mode 100644 index 00000000..a0d67d28 Binary files /dev/null and b/Source/Core/Resources/Angle.png differ diff --git a/Source/Core/Resources/ColorPick.png b/Source/Core/Resources/ColorPick.png index 4cf7c053..e9d0ae11 100644 Binary files a/Source/Core/Resources/ColorPick.png and b/Source/Core/Resources/ColorPick.png differ diff --git a/Source/Core/Resources/List.png b/Source/Core/Resources/List.png new file mode 100644 index 00000000..acc30b85 Binary files /dev/null and b/Source/Core/Resources/List.png differ diff --git a/Source/Core/Resources/List_Images.png b/Source/Core/Resources/List_Images.png new file mode 100644 index 00000000..248eaf1a Binary files /dev/null and b/Source/Core/Resources/List_Images.png differ diff --git a/Source/Core/Resources/Text.png b/Source/Core/Resources/Text.png new file mode 100644 index 00000000..82b80f37 Binary files /dev/null and b/Source/Core/Resources/Text.png differ diff --git a/Source/Core/Types/AngleDegreesFloatHandler.cs b/Source/Core/Types/AngleDegreesFloatHandler.cs index 1fb3d1ec..9c97efe9 100644 --- a/Source/Core/Types/AngleDegreesFloatHandler.cs +++ b/Source/Core/Types/AngleDegreesFloatHandler.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Text; using CodeImp.DoomBuilder.IO; @@ -50,6 +51,8 @@ namespace CodeImp.DoomBuilder.Types public override bool IsBrowseable { get { return true; } } + public override Image BrowseImage { get { return Properties.Resources.Angle; } } + #endregion #region ================== Constructor diff --git a/Source/Core/Types/AngleDegreesHandler.cs b/Source/Core/Types/AngleDegreesHandler.cs index d6b2cba5..4e4af925 100644 --- a/Source/Core/Types/AngleDegreesHandler.cs +++ b/Source/Core/Types/AngleDegreesHandler.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Text; using CodeImp.DoomBuilder.IO; @@ -50,6 +51,8 @@ namespace CodeImp.DoomBuilder.Types public override bool IsBrowseable { get { return true; } } + public override Image BrowseImage { get { return Properties.Resources.Angle; } } + #endregion #region ================== Constructor diff --git a/Source/Core/Types/AngleRadiansHandler.cs b/Source/Core/Types/AngleRadiansHandler.cs index 57673288..9df18a56 100644 --- a/Source/Core/Types/AngleRadiansHandler.cs +++ b/Source/Core/Types/AngleRadiansHandler.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Text; using CodeImp.DoomBuilder.IO; @@ -51,6 +52,8 @@ namespace CodeImp.DoomBuilder.Types public override bool IsBrowseable { get { return true; } } + public override Image BrowseImage { get { return Properties.Resources.Angle; } } + #endregion #region ================== Constructor diff --git a/Source/Core/Types/ColorHandler.cs b/Source/Core/Types/ColorHandler.cs index e8b41076..64318217 100644 --- a/Source/Core/Types/ColorHandler.cs +++ b/Source/Core/Types/ColorHandler.cs @@ -51,6 +51,8 @@ namespace CodeImp.DoomBuilder.Types public override bool IsBrowseable { get { return true; } } + public override Image BrowseImage { get { return Properties.Resources.ColorPick; } } + #endregion #region ================== Constructor diff --git a/Source/Core/Types/EnumBitsHandler.cs b/Source/Core/Types/EnumBitsHandler.cs index f7214dd1..3a9f48df 100644 --- a/Source/Core/Types/EnumBitsHandler.cs +++ b/Source/Core/Types/EnumBitsHandler.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Text; using CodeImp.DoomBuilder.IO; @@ -50,6 +51,8 @@ namespace CodeImp.DoomBuilder.Types #region ================== Properties public override bool IsBrowseable { get { return true; } } + + public override Image BrowseImage { get { return Properties.Resources.List; } } #endregion diff --git a/Source/Core/Types/FlatHandler.cs b/Source/Core/Types/FlatHandler.cs index 3b3f80ac..55961212 100644 --- a/Source/Core/Types/FlatHandler.cs +++ b/Source/Core/Types/FlatHandler.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Text; using CodeImp.DoomBuilder.IO; @@ -49,6 +50,8 @@ namespace CodeImp.DoomBuilder.Types public override bool IsBrowseable { get { return true; } } + public override Image BrowseImage { get { return Properties.Resources.List_Images; } } + #endregion #region ================== Methods diff --git a/Source/Core/Types/LinedefTypeHandler.cs b/Source/Core/Types/LinedefTypeHandler.cs index 66ccf9c2..7499b383 100644 --- a/Source/Core/Types/LinedefTypeHandler.cs +++ b/Source/Core/Types/LinedefTypeHandler.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Text; using CodeImp.DoomBuilder.IO; @@ -50,6 +51,8 @@ namespace CodeImp.DoomBuilder.Types public override bool IsBrowseable { get { return true; } } + public override Image BrowseImage { get { return Properties.Resources.List; } } + #endregion #region ================== Constructor diff --git a/Source/Core/Types/SectorEffectHandler.cs b/Source/Core/Types/SectorEffectHandler.cs index e5628136..51bee52c 100644 --- a/Source/Core/Types/SectorEffectHandler.cs +++ b/Source/Core/Types/SectorEffectHandler.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Text; using CodeImp.DoomBuilder.IO; @@ -50,6 +51,8 @@ namespace CodeImp.DoomBuilder.Types public override bool IsBrowseable { get { return true; } } + public override Image BrowseImage { get { return Properties.Resources.List; } } + #endregion #region ================== Constructor diff --git a/Source/Core/Types/StringHandler.cs b/Source/Core/Types/StringHandler.cs index a0c099ce..110b2904 100644 --- a/Source/Core/Types/StringHandler.cs +++ b/Source/Core/Types/StringHandler.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Text; using CodeImp.DoomBuilder.IO; @@ -48,6 +49,8 @@ namespace CodeImp.DoomBuilder.Types #region ================== Properties public override bool IsBrowseable { get { return true; } } + + public override Image BrowseImage { get { return Properties.Resources.Text; } } #endregion diff --git a/Source/Core/Types/TextureHandler.cs b/Source/Core/Types/TextureHandler.cs index 996b71b5..3f356ac8 100644 --- a/Source/Core/Types/TextureHandler.cs +++ b/Source/Core/Types/TextureHandler.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Text; using CodeImp.DoomBuilder.IO; @@ -49,6 +50,8 @@ namespace CodeImp.DoomBuilder.Types public override bool IsBrowseable { get { return true; } } + public override Image BrowseImage { get { return Properties.Resources.List_Images; } } + #endregion #region ================== Methods diff --git a/Source/Core/Types/ThingClassHandler.cs b/Source/Core/Types/ThingClassHandler.cs new file mode 100644 index 00000000..212431c7 --- /dev/null +++ b/Source/Core/Types/ThingClassHandler.cs @@ -0,0 +1,109 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.Globalization; +using System.Text; +using CodeImp.DoomBuilder.Config; +using CodeImp.DoomBuilder.IO; +using CodeImp.DoomBuilder.Data; +using System.IO; +using System.Diagnostics; +using System.Windows.Forms; +using CodeImp.DoomBuilder.Windows; + +#endregion + +namespace CodeImp.DoomBuilder.Types +{ + [TypeHandler(UniversalType.ThingClass, "Thing Class", true)] + internal class ThingClassHandler : TypeHandler + { + #region ================== Constants + + #endregion + + #region ================== Variables + + private string value = ""; + + #endregion + + #region ================== Properties + + public override bool IsBrowseable { get { return true; } } + + public override Image BrowseImage { get { return Properties.Resources.List; } } + + #endregion + + #region ================== Methods + + public override void Browse(IWin32Window parent) + { + int tid = 0; + + // Find the thing with this class name + foreach(ThingTypeInfo t in General.Map.Data.ThingTypes) + { + if((t.Actor != null) && (string.Compare(t.Actor.ClassName, value, true) == 0)) + { + tid = t.Index; + break; + } + } + + //tid = ThingBrowserForm.BrowseThing(parent, tid); + ThingBrowserForm f = new ThingBrowserForm(tid); + if(f.ShowDialog(Form.ActiveForm) == DialogResult.OK) + { + // Find the class name for this thing + ThingTypeInfo t = General.Map.Data.GetThingInfo(f.SelectedType); + if(t.Actor != null) + this.value = t.Actor.ClassName; + else + this.value = ""; + } + + f.Dispose(); + } + + public override void SetValue(object value) + { + if(value != null) + this.value = value.ToString(); + else + this.value = ""; + } + + public override object GetValue() + { + return this.value; + } + + public override string GetStringValue() + { + return this.value; + } + + #endregion + } +} diff --git a/Source/Core/Types/ThingTypeHandler.cs b/Source/Core/Types/ThingTypeHandler.cs new file mode 100644 index 00000000..cbf03658 --- /dev/null +++ b/Source/Core/Types/ThingTypeHandler.cs @@ -0,0 +1,115 @@ + +#region ================== Copyright (c) 2007 Pascal vd Heiden + +/* + * Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com + * This program is released under GNU General Public License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.Globalization; +using System.Text; +using CodeImp.DoomBuilder.IO; +using CodeImp.DoomBuilder.Data; +using System.IO; +using System.Diagnostics; +using CodeImp.DoomBuilder.Config; +using CodeImp.DoomBuilder.Windows; +using System.Windows.Forms; + +#endregion + +namespace CodeImp.DoomBuilder.Types +{ + [TypeHandler(UniversalType.ThingType, "Thing Type", true)] + internal class ThingTypeHandler : TypeHandler + { + #region ================== Constants + + #endregion + + #region ================== Variables + + private int value; + + #endregion + + #region ================== Properties + + public override bool IsBrowseable { get { return true; } } + + public override Image BrowseImage { get { return Properties.Resources.List; } } + + #endregion + + #region ================== Constructor + + #endregion + + #region ================== Methods + + public override void Browse(IWin32Window parent) + { + this.value = ThingBrowserForm.BrowseThing(parent, this.value); + } + + public override void SetValue(object value) + { + int result; + + // Null? + if(value == null) + { + this.value = 0; + } + // Compatible type? + else if((value is int) || (value is float) || (value is bool)) + { + // Set directly + this.value = Convert.ToInt32(value); + } + else + { + // Try parsing as string + if(int.TryParse(value.ToString(), NumberStyles.Integer, CultureInfo.CurrentCulture, out result)) + { + this.value = result; + } + else + { + this.value = 0; + } + } + } + + public override object GetValue() + { + return this.value; + } + + public override int GetIntValue() + { + return this.value; + } + + public override string GetStringValue() + { + return this.value.ToString(); + } + + #endregion + } +} diff --git a/Source/Core/Types/TypeHandler.cs b/Source/Core/Types/TypeHandler.cs index 019954e2..0c0551ac 100644 --- a/Source/Core/Types/TypeHandler.cs +++ b/Source/Core/Types/TypeHandler.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Text; using CodeImp.DoomBuilder.IO; @@ -64,6 +65,8 @@ namespace CodeImp.DoomBuilder.Types public virtual bool IsBrowseable { get { return false; } } public virtual bool IsEnumerable { get { return false; } } public virtual bool IsLimitedToEnums { get { return false; } } + + public virtual Image BrowseImage { get { return null; } } #endregion diff --git a/Source/Core/Types/UniversalType.cs b/Source/Core/Types/UniversalType.cs index 4d394d91..536ab52f 100644 --- a/Source/Core/Types/UniversalType.cs +++ b/Source/Core/Types/UniversalType.cs @@ -46,6 +46,8 @@ namespace CodeImp.DoomBuilder.Types ThingTag = 14, LinedefTag = 15, EnumStrings = 16, - AngleDegreesFloat = 17 + AngleDegreesFloat = 17, + ThingType = 18, + ThingClass = 19 } } diff --git a/Source/Core/Windows/LinedefEditForm.Designer.cs b/Source/Core/Windows/LinedefEditForm.Designer.cs index 133ed86f..4b3af3af 100644 --- a/Source/Core/Windows/LinedefEditForm.Designer.cs +++ b/Source/Core/Windows/LinedefEditForm.Designer.cs @@ -58,7 +58,6 @@ namespace CodeImp.DoomBuilder.Windows this.hexenpanel = new System.Windows.Forms.Panel(); this.activation = new System.Windows.Forms.ComboBox(); this.action = new CodeImp.DoomBuilder.Controls.ActionSelectorControl(); - this.browseaction = new System.Windows.Forms.Button(); this.udmfpanel = new System.Windows.Forms.Panel(); this.udmfactivates = new CodeImp.DoomBuilder.Controls.CheckboxArrayControl(); this.newtag = new System.Windows.Forms.Button(); @@ -68,16 +67,23 @@ namespace CodeImp.DoomBuilder.Windows this.tabs = new System.Windows.Forms.TabControl(); this.tabproperties = new System.Windows.Forms.TabPage(); this.idgroup = new System.Windows.Forms.GroupBox(); + this.tag = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); this.tabsidedefs = new System.Windows.Forms.TabPage(); this.splitter = new System.Windows.Forms.SplitContainer(); this.frontside = new System.Windows.Forms.CheckBox(); this.frontgroup = new System.Windows.Forms.GroupBox(); + this.frontoffsety = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); + this.frontoffsetx = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); + this.frontsector = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); this.customfrontbutton = new System.Windows.Forms.Button(); this.frontlow = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); this.frontmid = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); this.fronthigh = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); this.backside = new System.Windows.Forms.CheckBox(); this.backgroup = new System.Windows.Forms.GroupBox(); + this.backoffsety = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); + this.backoffsetx = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); + this.backsector = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); this.custombackbutton = new System.Windows.Forms.Button(); this.backlow = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); this.backmid = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); @@ -86,13 +92,7 @@ namespace CodeImp.DoomBuilder.Windows this.fieldslist = new CodeImp.DoomBuilder.Controls.FieldsEditorControl(); this.heightpanel1 = new System.Windows.Forms.Panel(); this.heightpanel2 = new System.Windows.Forms.Panel(); - this.tag = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.frontsector = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.frontoffsetx = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.frontoffsety = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.backoffsety = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.backoffsetx = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); - this.backsector = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); + this.browseaction = new System.Windows.Forms.Button(); label2 = new System.Windows.Forms.Label(); taglabel = new System.Windows.Forms.Label(); label3 = new System.Windows.Forms.Label(); @@ -420,19 +420,6 @@ namespace CodeImp.DoomBuilder.Windows this.action.Value = 402; this.action.ValueChanges += new System.EventHandler(this.action_ValueChanges); // - // browseaction - // - this.browseaction.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.browseaction.Image = global::CodeImp.DoomBuilder.Properties.Resources.treeview; - this.browseaction.Location = new System.Drawing.Point(469, 26); - this.browseaction.Name = "browseaction"; - this.browseaction.Padding = new System.Windows.Forms.Padding(0, 0, 1, 3); - this.browseaction.Size = new System.Drawing.Size(30, 23); - this.browseaction.TabIndex = 1; - this.browseaction.Text = " "; - this.browseaction.UseVisualStyleBackColor = true; - this.browseaction.Click += new System.EventHandler(this.browseaction_Click); - // // udmfpanel // this.udmfpanel.Controls.Add(this.udmfactivates); @@ -542,6 +529,18 @@ namespace CodeImp.DoomBuilder.Windows this.idgroup.TabStop = false; this.idgroup.Text = " Identification "; // + // tag + // + this.tag.AllowDecimal = false; + this.tag.AllowNegative = false; + this.tag.AllowRelative = true; + this.tag.ButtonStep = 1; + this.tag.Location = new System.Drawing.Point(62, 26); + this.tag.Name = "tag"; + this.tag.Size = new System.Drawing.Size(75, 24); + this.tag.StepValues = null; + this.tag.TabIndex = 7; + // // tabsidedefs // this.tabsidedefs.Controls.Add(this.splitter); @@ -611,6 +610,42 @@ namespace CodeImp.DoomBuilder.Windows this.frontgroup.TabStop = false; this.frontgroup.Text = " "; // + // frontoffsety + // + this.frontoffsety.AllowDecimal = false; + this.frontoffsety.AllowNegative = true; + this.frontoffsety.AllowRelative = true; + this.frontoffsety.ButtonStep = 1; + this.frontoffsety.Location = new System.Drawing.Point(171, 74); + this.frontoffsety.Name = "frontoffsety"; + this.frontoffsety.Size = new System.Drawing.Size(62, 24); + this.frontoffsety.StepValues = null; + this.frontoffsety.TabIndex = 16; + // + // frontoffsetx + // + this.frontoffsetx.AllowDecimal = false; + this.frontoffsetx.AllowNegative = true; + this.frontoffsetx.AllowRelative = true; + this.frontoffsetx.ButtonStep = 1; + this.frontoffsetx.Location = new System.Drawing.Point(103, 74); + this.frontoffsetx.Name = "frontoffsetx"; + this.frontoffsetx.Size = new System.Drawing.Size(62, 24); + this.frontoffsetx.StepValues = null; + this.frontoffsetx.TabIndex = 15; + // + // frontsector + // + this.frontsector.AllowDecimal = false; + this.frontsector.AllowNegative = false; + this.frontsector.AllowRelative = false; + this.frontsector.ButtonStep = 1; + this.frontsector.Location = new System.Drawing.Point(103, 35); + this.frontsector.Name = "frontsector"; + this.frontsector.Size = new System.Drawing.Size(130, 24); + this.frontsector.StepValues = null; + this.frontsector.TabIndex = 14; + // // customfrontbutton // this.customfrontbutton.Location = new System.Drawing.Point(103, 124); @@ -685,6 +720,42 @@ namespace CodeImp.DoomBuilder.Windows this.backgroup.TabStop = false; this.backgroup.Text = " "; // + // backoffsety + // + this.backoffsety.AllowDecimal = false; + this.backoffsety.AllowNegative = true; + this.backoffsety.AllowRelative = true; + this.backoffsety.ButtonStep = 1; + this.backoffsety.Location = new System.Drawing.Point(171, 74); + this.backoffsety.Name = "backoffsety"; + this.backoffsety.Size = new System.Drawing.Size(62, 24); + this.backoffsety.StepValues = null; + this.backoffsety.TabIndex = 19; + // + // backoffsetx + // + this.backoffsetx.AllowDecimal = false; + this.backoffsetx.AllowNegative = true; + this.backoffsetx.AllowRelative = true; + this.backoffsetx.ButtonStep = 1; + this.backoffsetx.Location = new System.Drawing.Point(103, 74); + this.backoffsetx.Name = "backoffsetx"; + this.backoffsetx.Size = new System.Drawing.Size(62, 24); + this.backoffsetx.StepValues = null; + this.backoffsetx.TabIndex = 18; + // + // backsector + // + this.backsector.AllowDecimal = false; + this.backsector.AllowNegative = false; + this.backsector.AllowRelative = false; + this.backsector.ButtonStep = 1; + this.backsector.Location = new System.Drawing.Point(103, 35); + this.backsector.Name = "backsector"; + this.backsector.Size = new System.Drawing.Size(130, 24); + this.backsector.StepValues = null; + this.backsector.TabIndex = 17; + // // custombackbutton // this.custombackbutton.Location = new System.Drawing.Point(103, 124); @@ -730,7 +801,7 @@ namespace CodeImp.DoomBuilder.Windows this.tabcustom.Location = new System.Drawing.Point(4, 23); this.tabcustom.Name = "tabcustom"; this.tabcustom.Padding = new System.Windows.Forms.Padding(3); - this.tabcustom.Size = new System.Drawing.Size(533, 538); + this.tabcustom.Size = new System.Drawing.Size(549, 538); this.tabcustom.TabIndex = 2; this.tabcustom.Text = "Custom"; this.tabcustom.UseVisualStyleBackColor = true; @@ -766,75 +837,18 @@ namespace CodeImp.DoomBuilder.Windows this.heightpanel2.TabIndex = 4; this.heightpanel2.Visible = false; // - // tag + // browseaction // - this.tag.AllowNegative = false; - this.tag.AllowRelative = true; - this.tag.ButtonStep = 1; - this.tag.Location = new System.Drawing.Point(62, 26); - this.tag.Name = "tag"; - this.tag.Size = new System.Drawing.Size(75, 24); - this.tag.TabIndex = 7; - // - // frontsector - // - this.frontsector.AllowNegative = false; - this.frontsector.AllowRelative = false; - this.frontsector.ButtonStep = 1; - this.frontsector.Location = new System.Drawing.Point(103, 35); - this.frontsector.Name = "frontsector"; - this.frontsector.Size = new System.Drawing.Size(130, 24); - this.frontsector.TabIndex = 14; - // - // frontoffsetx - // - this.frontoffsetx.AllowNegative = true; - this.frontoffsetx.AllowRelative = true; - this.frontoffsetx.ButtonStep = 1; - this.frontoffsetx.Location = new System.Drawing.Point(103, 74); - this.frontoffsetx.Name = "frontoffsetx"; - this.frontoffsetx.Size = new System.Drawing.Size(62, 24); - this.frontoffsetx.TabIndex = 15; - // - // frontoffsety - // - this.frontoffsety.AllowNegative = true; - this.frontoffsety.AllowRelative = true; - this.frontoffsety.ButtonStep = 1; - this.frontoffsety.Location = new System.Drawing.Point(171, 74); - this.frontoffsety.Name = "frontoffsety"; - this.frontoffsety.Size = new System.Drawing.Size(62, 24); - this.frontoffsety.TabIndex = 16; - // - // backoffsety - // - this.backoffsety.AllowNegative = true; - this.backoffsety.AllowRelative = true; - this.backoffsety.ButtonStep = 1; - this.backoffsety.Location = new System.Drawing.Point(171, 74); - this.backoffsety.Name = "backoffsety"; - this.backoffsety.Size = new System.Drawing.Size(62, 24); - this.backoffsety.TabIndex = 19; - // - // backoffsetx - // - this.backoffsetx.AllowNegative = true; - this.backoffsetx.AllowRelative = true; - this.backoffsetx.ButtonStep = 1; - this.backoffsetx.Location = new System.Drawing.Point(103, 74); - this.backoffsetx.Name = "backoffsetx"; - this.backoffsetx.Size = new System.Drawing.Size(62, 24); - this.backoffsetx.TabIndex = 18; - // - // backsector - // - this.backsector.AllowNegative = false; - this.backsector.AllowRelative = false; - this.backsector.ButtonStep = 1; - this.backsector.Location = new System.Drawing.Point(103, 35); - this.backsector.Name = "backsector"; - this.backsector.Size = new System.Drawing.Size(130, 24); - this.backsector.TabIndex = 17; + this.browseaction.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.browseaction.Image = global::CodeImp.DoomBuilder.Properties.Resources.List; + this.browseaction.Location = new System.Drawing.Point(469, 26); + this.browseaction.Name = "browseaction"; + this.browseaction.Padding = new System.Windows.Forms.Padding(0, 0, 1, 3); + this.browseaction.Size = new System.Drawing.Size(28, 23); + this.browseaction.TabIndex = 1; + this.browseaction.Text = " "; + this.browseaction.UseVisualStyleBackColor = true; + this.browseaction.Click += new System.EventHandler(this.browseaction_Click); // // LinedefEditForm // diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs index c12359d3..545f285e 100644 --- a/Source/Core/Windows/MainForm.cs +++ b/Source/Core/Windows/MainForm.cs @@ -891,7 +891,9 @@ namespace CodeImp.DoomBuilder.Windows { if((General.Map != null) && (General.Editing.Mode != null)) { + General.Plugins.OnEditRedrawDisplayBegin(); General.Editing.Mode.OnRedrawDisplay(); + General.Plugins.OnEditRedrawDisplayEnd(); } else { @@ -974,13 +976,21 @@ namespace CodeImp.DoomBuilder.Windows // Mouse click private void display_MouseClick(object sender, MouseEventArgs e) { - if((General.Map != null) && (General.Editing.Mode != null)) General.Editing.Mode.OnMouseClick(e); + if((General.Map != null) && (General.Editing.Mode != null)) + { + General.Plugins.OnEditMouseClick(e); + General.Editing.Mode.OnMouseClick(e); + } } // Mouse doubleclick private void display_MouseDoubleClick(object sender, MouseEventArgs e) { - if((General.Map != null) && (General.Editing.Mode != null)) General.Editing.Mode.OnMouseDoubleClick(e); + if((General.Map != null) && (General.Editing.Mode != null)) + { + General.Plugins.OnEditMouseDoubleClick(e); + General.Editing.Mode.OnMouseDoubleClick(e); + } } // Mouse down @@ -1012,27 +1022,43 @@ namespace CodeImp.DoomBuilder.Windows General.Actions.KeyPressed(key | mod); // Invoke on editing mode - if((General.Map != null) && (General.Editing.Mode != null)) General.Editing.Mode.OnMouseDown(e); + if((General.Map != null) && (General.Editing.Mode != null)) + { + General.Plugins.OnEditMouseDown(e); + General.Editing.Mode.OnMouseDown(e); + } } // Mouse enters private void display_MouseEnter(object sender, EventArgs e) { mouseinside = true; - if((General.Map != null) && (mouseinput == null) && (General.Editing.Mode != null)) General.Editing.Mode.OnMouseEnter(e); + if((General.Map != null) && (mouseinput == null) && (General.Editing.Mode != null)) + { + General.Plugins.OnEditMouseEnter(e); + General.Editing.Mode.OnMouseEnter(e); + } } // Mouse leaves private void display_MouseLeave(object sender, EventArgs e) { mouseinside = false; - if((General.Map != null) && (mouseinput == null) && (General.Editing.Mode != null)) General.Editing.Mode.OnMouseLeave(e); + if((General.Map != null) && (mouseinput == null) && (General.Editing.Mode != null)) + { + General.Plugins.OnEditMouseLeave(e); + General.Editing.Mode.OnMouseLeave(e); + } } // Mouse moves private void display_MouseMove(object sender, MouseEventArgs e) { - if((General.Map != null) && (mouseinput == null) && (General.Editing.Mode != null)) General.Editing.Mode.OnMouseMove(e); + if((General.Map != null) && (mouseinput == null) && (General.Editing.Mode != null)) + { + General.Plugins.OnEditMouseMove(e); + General.Editing.Mode.OnMouseMove(e); + } } // Mouse up @@ -1062,7 +1088,11 @@ namespace CodeImp.DoomBuilder.Windows General.Actions.KeyReleased(key | mod); // Invoke on editing mode - if((General.Map != null) && (General.Editing.Mode != null)) General.Editing.Mode.OnMouseUp(e); + if((General.Map != null) && (General.Editing.Mode != null)) + { + General.Plugins.OnEditMouseUp(e); + General.Editing.Mode.OnMouseUp(e); + } } #endregion @@ -1221,7 +1251,11 @@ namespace CodeImp.DoomBuilder.Windows e.Handled = General.Actions.KeyPressed((int)e.KeyData); // Invoke on editing mode - if((General.Map != null) && (General.Editing.Mode != null)) General.Editing.Mode.OnKeyDown(e); + if((General.Map != null) && (General.Editing.Mode != null)) + { + General.Plugins.OnEditKeyDown(e); + General.Editing.Mode.OnKeyDown(e); + } // Handled if(e.Handled) @@ -1271,7 +1305,11 @@ namespace CodeImp.DoomBuilder.Windows e.Handled = General.Actions.KeyReleased((int)e.KeyData); // Invoke on editing mode - if((General.Map != null) && (General.Editing.Mode != null)) General.Editing.Mode.OnKeyUp(e); + if((General.Map != null) && (General.Editing.Mode != null)) + { + General.Plugins.OnEditKeyUp(e); + General.Editing.Mode.OnKeyUp(e); + } // Handled if(e.Handled) @@ -2574,7 +2612,10 @@ namespace CodeImp.DoomBuilder.Windows // Process mouse input deltamouse = mouseinput.Process(); if((General.Map != null) && (General.Editing.Mode != null)) + { + General.Plugins.OnEditMouseInput(deltamouse); General.Editing.Mode.OnMouseInput(deltamouse); + } } // Process signal diff --git a/Source/Core/Windows/ResourceOptionsForm.Designer.cs b/Source/Core/Windows/ResourceOptionsForm.Designer.cs index 5b6b01a7..d7e9a50d 100644 --- a/Source/Core/Windows/ResourceOptionsForm.Designer.cs +++ b/Source/Core/Windows/ResourceOptionsForm.Designer.cs @@ -150,7 +150,7 @@ namespace CodeImp.DoomBuilder.Windows this.browsewad.Location = new System.Drawing.Point(315, 36); this.browsewad.Name = "browsewad"; this.browsewad.Padding = new System.Windows.Forms.Padding(0, 0, 1, 3); - this.browsewad.Size = new System.Drawing.Size(30, 23); + this.browsewad.Size = new System.Drawing.Size(28, 23); this.browsewad.TabIndex = 1; this.browsewad.Text = " "; this.browsewad.UseVisualStyleBackColor = true; @@ -235,7 +235,7 @@ namespace CodeImp.DoomBuilder.Windows this.browsedir.Location = new System.Drawing.Point(315, 36); this.browsedir.Name = "browsedir"; this.browsedir.Padding = new System.Windows.Forms.Padding(0, 0, 1, 3); - this.browsedir.Size = new System.Drawing.Size(30, 23); + this.browsedir.Size = new System.Drawing.Size(28, 23); this.browsedir.TabIndex = 1; this.browsedir.UseVisualStyleBackColor = true; this.browsedir.Click += new System.EventHandler(this.browsedir_Click); @@ -296,7 +296,7 @@ namespace CodeImp.DoomBuilder.Windows this.browsepk3.Location = new System.Drawing.Point(315, 36); this.browsepk3.Name = "browsepk3"; this.browsepk3.Padding = new System.Windows.Forms.Padding(0, 0, 1, 3); - this.browsepk3.Size = new System.Drawing.Size(30, 23); + this.browsepk3.Size = new System.Drawing.Size(28, 23); this.browsepk3.TabIndex = 1; this.browsepk3.UseVisualStyleBackColor = true; this.browsepk3.Click += new System.EventHandler(this.browsepk3_Click); diff --git a/Source/Core/Windows/SectorEditForm.Designer.cs b/Source/Core/Windows/SectorEditForm.Designer.cs index caa19f34..de2d3fda 100644 --- a/Source/Core/Windows/SectorEditForm.Designer.cs +++ b/Source/Core/Windows/SectorEditForm.Designer.cs @@ -113,12 +113,14 @@ namespace CodeImp.DoomBuilder.Windows // // tag // + this.tag.AllowDecimal = false; this.tag.AllowNegative = false; this.tag.AllowRelative = true; this.tag.ButtonStep = 1; this.tag.Location = new System.Drawing.Point(89, 26); this.tag.Name = "tag"; this.tag.Size = new System.Drawing.Size(73, 24); + this.tag.StepValues = null; this.tag.TabIndex = 25; // // taglabel @@ -158,22 +160,24 @@ namespace CodeImp.DoomBuilder.Windows // // brightness // + this.brightness.AllowDecimal = false; this.brightness.AllowNegative = false; this.brightness.AllowRelative = true; this.brightness.ButtonStep = 8; this.brightness.Location = new System.Drawing.Point(89, 61); this.brightness.Name = "brightness"; this.brightness.Size = new System.Drawing.Size(73, 24); + this.brightness.StepValues = null; this.brightness.TabIndex = 24; // // browseeffect // this.browseeffect.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.browseeffect.Image = global::CodeImp.DoomBuilder.Properties.Resources.treeview; + this.browseeffect.Image = global::CodeImp.DoomBuilder.Properties.Resources.List; this.browseeffect.Location = new System.Drawing.Point(385, 27); this.browseeffect.Name = "browseeffect"; this.browseeffect.Padding = new System.Windows.Forms.Padding(0, 0, 1, 3); - this.browseeffect.Size = new System.Drawing.Size(30, 23); + this.browseeffect.Size = new System.Drawing.Size(28, 23); this.browseeffect.TabIndex = 1; this.browseeffect.Text = " "; this.browseeffect.UseVisualStyleBackColor = true; @@ -232,23 +236,27 @@ namespace CodeImp.DoomBuilder.Windows // // floorheight // + this.floorheight.AllowDecimal = false; this.floorheight.AllowNegative = true; this.floorheight.AllowRelative = true; this.floorheight.ButtonStep = 8; this.floorheight.Location = new System.Drawing.Point(112, 69); this.floorheight.Name = "floorheight"; this.floorheight.Size = new System.Drawing.Size(88, 24); + this.floorheight.StepValues = null; this.floorheight.TabIndex = 23; this.floorheight.WhenTextChanged += new System.EventHandler(this.floorheight_TextChanged); // // ceilingheight // + this.ceilingheight.AllowDecimal = false; this.ceilingheight.AllowNegative = true; this.ceilingheight.AllowRelative = true; this.ceilingheight.ButtonStep = 8; this.ceilingheight.Location = new System.Drawing.Point(112, 35); this.ceilingheight.Name = "ceilingheight"; this.ceilingheight.Size = new System.Drawing.Size(88, 24); + this.ceilingheight.StepValues = null; this.ceilingheight.TabIndex = 22; this.ceilingheight.WhenTextChanged += new System.EventHandler(this.ceilingheight_TextChanged); // diff --git a/Source/Core/Windows/ThingEditForm.Designer.cs b/Source/Core/Windows/ThingEditForm.Designer.cs index 38c1804b..447d2366 100644 --- a/Source/Core/Windows/ThingEditForm.Designer.cs +++ b/Source/Core/Windows/ThingEditForm.Designer.cs @@ -419,11 +419,11 @@ namespace CodeImp.DoomBuilder.Windows // browseaction // this.browseaction.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.browseaction.Image = global::CodeImp.DoomBuilder.Properties.Resources.treeview; + this.browseaction.Image = global::CodeImp.DoomBuilder.Properties.Resources.List; this.browseaction.Location = new System.Drawing.Point(530, 26); this.browseaction.Name = "browseaction"; this.browseaction.Padding = new System.Windows.Forms.Padding(0, 0, 1, 3); - this.browseaction.Size = new System.Drawing.Size(30, 23); + this.browseaction.Size = new System.Drawing.Size(28, 23); this.browseaction.TabIndex = 1; this.browseaction.Text = " "; this.browseaction.UseVisualStyleBackColor = true; diff --git a/Source/Core/ZDoom/ActorStructure.cs b/Source/Core/ZDoom/ActorStructure.cs index 232f15da..8beec4d1 100644 --- a/Source/Core/ZDoom/ActorStructure.cs +++ b/Source/Core/ZDoom/ActorStructure.cs @@ -488,7 +488,7 @@ namespace CodeImp.DoomBuilder.ZDoom /// /// This returns a specific state, or null when the state can't be found. /// - internal StateStructure GetState(string statename) + public StateStructure GetState(string statename) { if(states.ContainsKey(statename)) return states[statename]; @@ -501,7 +501,7 @@ namespace CodeImp.DoomBuilder.ZDoom /// /// This creates a list of all states, also those inherited from the base class. /// - internal Dictionary GetAllStates() + public Dictionary GetAllStates() { Dictionary list = new Dictionary(states); diff --git a/Source/Core/ZDoom/StateStructure.cs b/Source/Core/ZDoom/StateStructure.cs index 78dd1785..b710b2e5 100644 --- a/Source/Core/ZDoom/StateStructure.cs +++ b/Source/Core/ZDoom/StateStructure.cs @@ -31,7 +31,7 @@ using CodeImp.DoomBuilder.Compilers; namespace CodeImp.DoomBuilder.ZDoom { - internal sealed class StateStructure + public sealed class StateStructure { #region ================== Constants @@ -50,7 +50,9 @@ namespace CodeImp.DoomBuilder.ZDoom #endregion #region ================== Properties - + + public int SpritesCount { get { return sprites.Count; } } + #endregion #region ================== Constructor / Disposer diff --git a/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs b/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs index 9121f1d4..922a9122 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs @@ -1186,7 +1186,8 @@ namespace CodeImp.DoomBuilder.BuilderModes if(!cancelled) { modealreadyswitching = true; - this.OnAccept(); + //this.OnAccept(); // BAD! Any other plugins won't know this mode was accepted + General.Editing.AcceptMode(); } // Update