OBJ model export: added option to disable generating ZScript/DECORATE and/or MODELDEF

This commit is contained in:
biwa 2021-03-11 21:54:48 +01:00
parent 122784f739
commit a2b007b9ae
2 changed files with 82 additions and 40 deletions

View file

@ -40,10 +40,10 @@
this.label2 = new System.Windows.Forms.Label();
this.gbGZDoom = new System.Windows.Forms.GroupBox();
this.actorNameError = new System.Windows.Forms.PictureBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.gbActorFormat = new System.Windows.Forms.GroupBox();
this.rbZScript = new System.Windows.Forms.RadioButton();
this.rbDecorate = new System.Windows.Forms.RadioButton();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.gbActorSettings = new System.Windows.Forms.GroupBox();
this.tbSprite = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.cbSolid = new System.Windows.Forms.CheckBox();
@ -73,11 +73,13 @@
this.cbIgnoreControlSectors = new System.Windows.Forms.CheckBox();
this.browse = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.cbGenerateModeldef = new System.Windows.Forms.CheckBox();
this.cbGenerateCode = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.nudScale)).BeginInit();
this.gbGZDoom.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.actorNameError)).BeginInit();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.gbActorFormat.SuspendLayout();
this.gbActorSettings.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout();
this.SuspendLayout();
@ -112,7 +114,7 @@
// export
//
this.export.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.export.Location = new System.Drawing.Point(279, 518);
this.export.Location = new System.Drawing.Point(279, 588);
this.export.Name = "export";
this.export.Size = new System.Drawing.Size(75, 23);
this.export.TabIndex = 7;
@ -124,7 +126,7 @@
//
this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancel.Location = new System.Drawing.Point(360, 518);
this.cancel.Location = new System.Drawing.Point(360, 588);
this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(75, 23);
this.cancel.TabIndex = 8;
@ -182,9 +184,11 @@
//
// gbGZDoom
//
this.gbGZDoom.Controls.Add(this.cbGenerateCode);
this.gbGZDoom.Controls.Add(this.cbGenerateModeldef);
this.gbGZDoom.Controls.Add(this.actorNameError);
this.gbGZDoom.Controls.Add(this.groupBox3);
this.gbGZDoom.Controls.Add(this.groupBox2);
this.gbGZDoom.Controls.Add(this.gbActorFormat);
this.gbGZDoom.Controls.Add(this.gbActorSettings);
this.gbGZDoom.Controls.Add(this.bResetPaths);
this.gbGZDoom.Controls.Add(this.tbActorName);
this.gbGZDoom.Controls.Add(this.label6);
@ -201,7 +205,7 @@
this.gbGZDoom.Controls.Add(this.cbExportForGZDoom);
this.gbGZDoom.Location = new System.Drawing.Point(15, 141);
this.gbGZDoom.Name = "gbGZDoom";
this.gbGZDoom.Size = new System.Drawing.Size(420, 368);
this.gbGZDoom.Size = new System.Drawing.Size(420, 439);
this.gbGZDoom.TabIndex = 6;
this.gbGZDoom.TabStop = false;
//
@ -215,16 +219,16 @@
this.actorNameError.TabStop = false;
this.actorNameError.Visible = false;
//
// groupBox3
// gbActorFormat
//
this.groupBox3.Controls.Add(this.rbZScript);
this.groupBox3.Controls.Add(this.rbDecorate);
this.groupBox3.Location = new System.Drawing.Point(8, 286);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(170, 73);
this.groupBox3.TabIndex = 14;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Actor format";
this.gbActorFormat.Controls.Add(this.rbZScript);
this.gbActorFormat.Controls.Add(this.rbDecorate);
this.gbActorFormat.Location = new System.Drawing.Point(10, 340);
this.gbActorFormat.Name = "gbActorFormat";
this.gbActorFormat.Size = new System.Drawing.Size(170, 88);
this.gbActorFormat.TabIndex = 14;
this.gbActorFormat.TabStop = false;
this.gbActorFormat.Text = "Actor format";
//
// rbZScript
//
@ -249,19 +253,19 @@
this.rbDecorate.Text = "DECORATE";
this.rbDecorate.UseVisualStyleBackColor = true;
//
// groupBox2
// gbActorSettings
//
this.groupBox2.Controls.Add(this.tbSprite);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.cbSolid);
this.groupBox2.Controls.Add(this.cbSpawnOnCeiling);
this.groupBox2.Controls.Add(this.cbNoGravity);
this.groupBox2.Location = new System.Drawing.Point(9, 158);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(169, 119);
this.groupBox2.TabIndex = 13;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Actor settings";
this.gbActorSettings.Controls.Add(this.tbSprite);
this.gbActorSettings.Controls.Add(this.label7);
this.gbActorSettings.Controls.Add(this.cbSolid);
this.gbActorSettings.Controls.Add(this.cbSpawnOnCeiling);
this.gbActorSettings.Controls.Add(this.cbNoGravity);
this.gbActorSettings.Location = new System.Drawing.Point(11, 212);
this.gbActorSettings.Name = "gbActorSettings";
this.gbActorSettings.Size = new System.Drawing.Size(169, 134);
this.gbActorSettings.TabIndex = 13;
this.gbActorSettings.TabStop = false;
this.gbActorSettings.Text = "Actor settings";
//
// tbSprite
//
@ -423,9 +427,9 @@
this.groupBox1.Controls.Add(this.bAddFlat);
this.groupBox1.Controls.Add(this.bAddTexture);
this.groupBox1.Controls.Add(this.lbSkipTextures);
this.groupBox1.Location = new System.Drawing.Point(184, 158);
this.groupBox1.Location = new System.Drawing.Point(186, 212);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(222, 201);
this.groupBox1.Size = new System.Drawing.Size(222, 216);
this.groupBox1.TabIndex = 15;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Skip textures";
@ -528,13 +532,34 @@
this.browse.UseVisualStyleBackColor = true;
this.browse.Click += new System.EventHandler(this.browse_Click);
//
// cbGenerateModeldef
//
this.cbGenerateModeldef.AutoSize = true;
this.cbGenerateModeldef.Location = new System.Drawing.Point(8, 184);
this.cbGenerateModeldef.Name = "cbGenerateModeldef";
this.cbGenerateModeldef.Size = new System.Drawing.Size(132, 17);
this.cbGenerateModeldef.TabIndex = 25;
this.cbGenerateModeldef.Text = "Generate MODELDEF";
this.cbGenerateModeldef.UseVisualStyleBackColor = true;
//
// cbGenerateCode
//
this.cbGenerateCode.AutoSize = true;
this.cbGenerateCode.Location = new System.Drawing.Point(8, 161);
this.cbGenerateCode.Name = "cbGenerateCode";
this.cbGenerateCode.Size = new System.Drawing.Size(171, 17);
this.cbGenerateCode.TabIndex = 25;
this.cbGenerateCode.Text = "Generate ZScript/DECORATE";
this.cbGenerateCode.UseVisualStyleBackColor = true;
this.cbGenerateCode.CheckedChanged += new System.EventHandler(this.cbGenerateCode_CheckedChanged);
//
// WavefrontSettingsForm
//
this.AcceptButton = this.export;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancel;
this.ClientSize = new System.Drawing.Size(447, 553);
this.ClientSize = new System.Drawing.Size(447, 623);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.gbGZDoom);
this.Controls.Add(this.label2);
@ -556,10 +581,10 @@
this.gbGZDoom.ResumeLayout(false);
this.gbGZDoom.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.actorNameError)).EndInit();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.gbActorFormat.ResumeLayout(false);
this.gbActorFormat.PerformLayout();
this.gbActorSettings.ResumeLayout(false);
this.gbActorSettings.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
@ -599,13 +624,13 @@
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button bResetPaths;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox gbActorSettings;
private System.Windows.Forms.CheckBox cbNoGravity;
private System.Windows.Forms.CheckBox cbSpawnOnCeiling;
private System.Windows.Forms.CheckBox cbSolid;
private System.Windows.Forms.RadioButton rbDecorate;
private System.Windows.Forms.RadioButton rbZScript;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.GroupBox gbActorFormat;
private System.Windows.Forms.TextBox tbSprite;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.GroupBox groupBox4;
@ -614,5 +639,7 @@
private System.Windows.Forms.CheckBox cbIgnoreControlSectors;
private System.Windows.Forms.PictureBox actorNameError;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.CheckBox cbGenerateCode;
private System.Windows.Forms.CheckBox cbGenerateModeldef;
}
}

View file

@ -93,6 +93,14 @@ namespace CodeImp.DoomBuilder.BuilderModes.Interface
if (c != cbExportForGZDoom)
c.Enabled = cbExportForGZDoom.Checked;
}
cbGenerateCode.Checked = General.Settings.ReadPluginSetting("objgeneratecode", true);
cbGenerateModeldef.Checked = General.Settings.ReadPluginSetting("objgeneratemodeldef", true);
if(cbExportForGZDoom.Checked)
{
gbActorFormat.Enabled = gbActorSettings.Enabled = cbGenerateCode.Checked;
}
}
#region ================== Methods
@ -185,8 +193,10 @@ namespace CodeImp.DoomBuilder.BuilderModes.Interface
General.Settings.WritePluginSetting("objactorpath", tbActorPath.Text);
General.Settings.WritePluginSetting("objmodelpath", tbModelPath.Text);
General.Settings.WritePluginSetting("objsprite", tbSprite.Text.ToUpperInvariant());
General.Settings.WritePluginSetting("objgeneratecode", cbGenerateCode.Checked);
General.Settings.WritePluginSetting("objgeneratemodeldef", cbGenerateModeldef.Checked);
Dictionary<string, string> skiptexture = new Dictionary<string, string>();
Dictionary <string, string> skiptexture = new Dictionary<string, string>();
int i = 0;
foreach(string t in lbSkipTextures.Items)
{
@ -350,5 +360,10 @@ namespace CodeImp.DoomBuilder.BuilderModes.Interface
actorNameError.Visible = false;
}
}
private void cbGenerateCode_CheckedChanged(object sender, EventArgs e)
{
gbActorFormat.Enabled = gbActorSettings.Enabled = cbGenerateCode.Checked;
}
}
}