2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
#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.Generic;
|
2014-12-03 09:06:05 +00:00
|
|
|
using System.Drawing;
|
2015-03-03 09:42:54 +00:00
|
|
|
using System.Globalization;
|
2009-04-19 18:07:22 +00:00
|
|
|
using System.Windows.Forms;
|
2015-07-27 09:02:28 +00:00
|
|
|
using CodeImp.DoomBuilder.GZBuilder.Data;
|
2009-04-19 18:07:22 +00:00
|
|
|
using CodeImp.DoomBuilder.Map;
|
|
|
|
using CodeImp.DoomBuilder.Config;
|
|
|
|
using CodeImp.DoomBuilder.Types;
|
2012-07-10 10:20:45 +00:00
|
|
|
using CodeImp.DoomBuilder.GZBuilder;
|
2013-06-17 13:17:53 +00:00
|
|
|
using CodeImp.DoomBuilder.Data;
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Controls
|
|
|
|
{
|
|
|
|
internal partial class LinedefInfoPanel : UserControl
|
|
|
|
{
|
2014-12-03 09:06:05 +00:00
|
|
|
private readonly int hexenformatwidth;
|
|
|
|
private readonly int doomformatwidth;
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
// Constructor
|
|
|
|
public LinedefInfoPanel()
|
|
|
|
{
|
|
|
|
// Initialize
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
// Hide stuff when in Doom format
|
|
|
|
hexenformatwidth = infopanel.Width;
|
|
|
|
doomformatwidth = infopanel.Width - 190;
|
2014-12-03 09:06:05 +00:00
|
|
|
|
|
|
|
//mxd
|
|
|
|
labelTextureFrontTop.BackColor = Color.FromArgb(128, labelTextureFrontTop.BackColor);
|
|
|
|
labelTextureFrontMid.BackColor = Color.FromArgb(128, labelTextureFrontMid.BackColor);
|
|
|
|
labelTextureFrontBottom.BackColor = Color.FromArgb(128, labelTextureFrontBottom.BackColor);
|
|
|
|
|
|
|
|
labelTextureBackTop.BackColor = Color.FromArgb(128, labelTextureBackTop.BackColor);
|
|
|
|
labelTextureBackMid.BackColor = Color.FromArgb(128, labelTextureBackMid.BackColor);
|
|
|
|
labelTextureBackBottom.BackColor = Color.FromArgb(128, labelTextureBackBottom.BackColor);
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This shows the info
|
2015-02-25 19:59:17 +00:00
|
|
|
public void ShowInfo(Linedef l, Sidedef highlightside)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
|
|
|
string peggedness;
|
|
|
|
|
|
|
|
// Show/hide stuff depending on format
|
|
|
|
if(!General.Map.FormatInterface.HasActionArgs)
|
|
|
|
{
|
|
|
|
arglbl1.Visible = false;
|
|
|
|
arglbl2.Visible = false;
|
|
|
|
arglbl3.Visible = false;
|
|
|
|
arglbl4.Visible = false;
|
|
|
|
arglbl5.Visible = false;
|
|
|
|
arg1.Visible = false;
|
|
|
|
arg2.Visible = false;
|
|
|
|
arg3.Visible = false;
|
|
|
|
arg4.Visible = false;
|
|
|
|
arg5.Visible = false;
|
|
|
|
infopanel.Width = doomformatwidth;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
arglbl1.Visible = true;
|
|
|
|
arglbl2.Visible = true;
|
|
|
|
arglbl3.Visible = true;
|
|
|
|
arglbl4.Visible = true;
|
|
|
|
arglbl5.Visible = true;
|
|
|
|
arg1.Visible = true;
|
|
|
|
arg2.Visible = true;
|
|
|
|
arg3.Visible = true;
|
|
|
|
arg4.Visible = true;
|
|
|
|
arg5.Visible = true;
|
|
|
|
infopanel.Width = hexenformatwidth;
|
|
|
|
}
|
2013-12-06 11:21:10 +00:00
|
|
|
|
2014-01-23 13:36:51 +00:00
|
|
|
//mxd. Hide activation or tag and rearrange labels
|
2014-11-25 11:52:01 +00:00
|
|
|
if(!General.Map.FormatInterface.HasBuiltInActivations && General.Map.FormatInterface.HasNumericLinedefActivations) //Hexen map format?
|
|
|
|
{
|
2014-01-23 13:36:51 +00:00
|
|
|
activation.Visible = true;
|
|
|
|
activationlabel.Visible = true;
|
|
|
|
taglabel.Visible = false;
|
|
|
|
tag.Visible = false;
|
|
|
|
|
2014-03-14 14:21:34 +00:00
|
|
|
//set activation
|
2014-11-25 11:52:01 +00:00
|
|
|
foreach(LinedefActivateInfo ai in General.Map.Config.LinedefActivates)
|
|
|
|
{
|
|
|
|
if(l.Activate == ai.Index)
|
|
|
|
{
|
2013-12-06 11:21:10 +00:00
|
|
|
activation.Text = ai.Title;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2014-01-23 13:36:51 +00:00
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
activation.Enabled = (l.Activate != 0); //mxd
|
|
|
|
activationlabel.Enabled = (l.Activate != 0); //mxd
|
2014-11-25 11:52:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-12-06 11:21:10 +00:00
|
|
|
activation.Visible = false;
|
|
|
|
activationlabel.Visible = false;
|
2014-01-23 13:36:51 +00:00
|
|
|
taglabel.Visible = true;
|
|
|
|
tag.Visible = true;
|
2013-12-06 11:21:10 +00:00
|
|
|
|
2015-07-27 21:35:42 +00:00
|
|
|
//mxd. Set tag(s)
|
|
|
|
if(l.Tags.Count > 1)
|
|
|
|
{
|
|
|
|
string[] tags = new string[l.Tags.Count];
|
2015-12-28 15:01:53 +00:00
|
|
|
for(int i = 0; i < l.Tags.Count; i++) tags[i] = l.Tags[i].ToString();
|
2015-07-27 21:35:42 +00:00
|
|
|
tag.Text = string.Join(", ", tags);
|
|
|
|
tag.Enabled = true;
|
|
|
|
taglabel.Enabled = true;
|
|
|
|
taglabel.Text = "Tags:";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tag.Text = l.Tag + (General.Map.Options.TagLabels.ContainsKey(l.Tag) ? " - " + General.Map.Options.TagLabels[l.Tag] : string.Empty);
|
|
|
|
tag.Enabled = (l.Tag != 0);
|
|
|
|
taglabel.Enabled = (l.Tag != 0);
|
|
|
|
taglabel.Text = "Tag:";
|
|
|
|
}
|
2013-12-06 11:21:10 +00:00
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
// Get line action information
|
|
|
|
LinedefActionInfo act = General.Map.Config.GetLinedefActionInfo(l.Action);
|
|
|
|
|
|
|
|
// Determine peggedness
|
2014-12-03 09:06:05 +00:00
|
|
|
bool upperunpegged = l.IsFlagSet(General.Map.Config.UpperUnpeggedFlag);
|
|
|
|
bool lowerunpegged = l.IsFlagSet(General.Map.Config.LowerUnpeggedFlag);
|
2009-04-19 18:07:22 +00:00
|
|
|
if(upperunpegged && lowerunpegged)
|
|
|
|
peggedness = "Upper & Lower";
|
|
|
|
else if(upperunpegged)
|
|
|
|
peggedness = "Upper";
|
|
|
|
else if(lowerunpegged)
|
|
|
|
peggedness = "Lower";
|
|
|
|
else
|
|
|
|
peggedness = "None";
|
|
|
|
|
|
|
|
// Linedef info
|
2009-06-05 19:03:56 +00:00
|
|
|
infopanel.Text = " Linedef " + l.Index + " ";
|
2009-04-19 18:07:22 +00:00
|
|
|
action.Text = act.ToString();
|
|
|
|
length.Text = l.Length.ToString("0.##");
|
2015-07-09 22:32:12 +00:00
|
|
|
angle.Text = General.ClampAngle(l.AngleDeg) + "\u00B0";
|
2009-04-19 18:07:22 +00:00
|
|
|
unpegged.Text = peggedness;
|
2014-12-08 21:06:08 +00:00
|
|
|
unpegged.Enabled = (peggedness != "None"); //mxd
|
|
|
|
peglabel.Enabled = (peggedness != "None"); //mxd
|
2014-12-03 09:06:05 +00:00
|
|
|
action.Enabled = (act.Index != 0);
|
|
|
|
actionlabel.Enabled = (act.Index != 0);
|
2012-07-10 10:20:45 +00:00
|
|
|
|
2015-07-27 09:02:28 +00:00
|
|
|
//mxd. ACS script argument names
|
|
|
|
bool isacsscript = (Array.IndexOf(GZGeneral.ACS_SPECIALS, l.Action) != -1);
|
|
|
|
bool isnamedacsscript = (isacsscript && General.Map.UDMF && l.Fields.ContainsKey("arg0str"));
|
|
|
|
string scriptname = (isnamedacsscript ? l.Fields.GetValue("arg0str", string.Empty) : string.Empty);
|
|
|
|
ScriptItem scriptitem = null;
|
2012-07-10 10:20:45 +00:00
|
|
|
|
2015-07-27 09:02:28 +00:00
|
|
|
// Named script?
|
|
|
|
if(isnamedacsscript && General.Map.NamedScripts.ContainsKey(scriptname.ToLowerInvariant()))
|
|
|
|
{
|
|
|
|
scriptitem = General.Map.NamedScripts[scriptname.ToLowerInvariant()];
|
|
|
|
}
|
|
|
|
// Script number?
|
|
|
|
else if(isacsscript && General.Map.NumberedScripts.ContainsKey(l.Args[0]))
|
|
|
|
{
|
|
|
|
scriptitem = General.Map.NumberedScripts[l.Args[0]];
|
2015-07-28 15:04:21 +00:00
|
|
|
scriptname = (scriptitem.HasCustomName ? scriptitem.Name : scriptitem.Index.ToString());
|
2015-07-27 09:02:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Apply script args?
|
|
|
|
Label[] arglabels = new[] { arglbl1, arglbl2, arglbl3, arglbl4, arglbl5 };
|
|
|
|
Label[] args = new[] { arg1, arg2, arg3, arg4, arg5 };
|
|
|
|
|
|
|
|
if(scriptitem != null)
|
|
|
|
{
|
|
|
|
string[] argnames = scriptitem.GetArgumentsDescriptions(l.Action);
|
|
|
|
for(int i = 0; i < argnames.Length; i++)
|
|
|
|
{
|
|
|
|
if(!string.IsNullOrEmpty(argnames[i]))
|
|
|
|
{
|
|
|
|
arglabels[i].Text = argnames[i] + ":";
|
|
|
|
arglabels[i].Enabled = true;
|
|
|
|
args[i].Enabled = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
arglabels[i].Text = act.Args[i].Title + ":";
|
|
|
|
arglabels[i].Enabled = act.Args[i].Used;
|
|
|
|
args[i].Enabled = act.Args[i].Used;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for(int i = 0; i < act.Args.Length; i++)
|
|
|
|
{
|
|
|
|
arglabels[i].Text = act.Args[i].Title + ":";
|
|
|
|
arglabels[i].Enabled = act.Args[i].Used;
|
|
|
|
args[i].Enabled = act.Args[i].Used;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//mxd. Set argument value and label
|
|
|
|
if(!string.IsNullOrEmpty(scriptname)) arg1.Text = scriptname;
|
|
|
|
else SetArgumentText(act.Args[0], arg1, l.Args[0]);
|
2014-12-03 09:06:05 +00:00
|
|
|
SetArgumentText(act.Args[1], arg2, l.Args[1]);
|
|
|
|
SetArgumentText(act.Args[2], arg3, l.Args[2]);
|
|
|
|
SetArgumentText(act.Args[3], arg4, l.Args[3]);
|
|
|
|
SetArgumentText(act.Args[4], arg5, l.Args[4]);
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
// Front side available?
|
|
|
|
if(l.Front != null)
|
|
|
|
{
|
2014-12-03 09:06:05 +00:00
|
|
|
//mxd. Extended info shown?
|
|
|
|
bool hasTopFields = false;
|
|
|
|
bool hasMiddleFields = false;
|
|
|
|
bool hasBottomFields = false;
|
2015-02-25 19:59:17 +00:00
|
|
|
|
|
|
|
//mxd. Highlight this side?
|
|
|
|
bool highlight = (l.Front == highlightside);
|
|
|
|
frontpanel.ForeColor = (highlight ? SystemColors.HotTrack : SystemColors.WindowText); //mxd
|
2012-10-03 18:46:13 +00:00
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Show sidedef info
|
2012-10-03 18:46:13 +00:00
|
|
|
frontpanel.Visible = true; //mxd
|
2012-11-05 21:53:45 +00:00
|
|
|
frontpanel.Text = " Front Sidedef " + l.Front.Index;
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//mxd
|
2014-11-25 11:52:01 +00:00
|
|
|
if(General.Map.UDMF)
|
|
|
|
{
|
2012-10-03 18:46:13 +00:00
|
|
|
//light
|
|
|
|
frontoffsetlabel.Text = "Front light:";
|
2015-02-25 19:59:17 +00:00
|
|
|
SetUDMFLight(l.Front, frontoffsetlabel, frontoffset, highlight);
|
2012-11-05 21:53:45 +00:00
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
//global offset, sector index
|
|
|
|
frontpanel.Text += ". Offset " + l.Front.OffsetX + ", " + l.Front.OffsetY + ". Sector " + l.Front.Sector.Index + " ";
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//sidedef top
|
2015-02-25 19:59:17 +00:00
|
|
|
hasTopFields = SetPairedUDMFFieldsLabel(l.Front.Fields, "offsetx_top", "offsety_top", 0.0f, frontTopUDMFOffsetLabel, frontTopUDMFOffset, highlight);
|
|
|
|
hasTopFields |= SetPairedUDMFFieldsLabel(l.Front.Fields, "scalex_top", "scaley_top", 1.0f, frontTopUDMFScaleLabel, frontTopUDMFScale, highlight);
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//sidedef middle
|
2015-02-25 19:59:17 +00:00
|
|
|
hasMiddleFields = SetPairedUDMFFieldsLabel(l.Front.Fields, "offsetx_mid", "offsety_mid", 0.0f, frontMidUDMFOffsetLabel, frontMidUDMFOffset, highlight);
|
|
|
|
hasMiddleFields |= SetPairedUDMFFieldsLabel(l.Front.Fields, "scalex_mid", "scaley_mid", 1.0f, frontMidUDMFScaleLabel, frontMidUDMFScale, highlight);
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//sidedef bottom
|
2015-02-25 19:59:17 +00:00
|
|
|
hasBottomFields = SetPairedUDMFFieldsLabel(l.Front.Fields, "offsetx_bottom", "offsety_bottom", 0.0f, frontBottomUDMFOffsetLabel, frontBottomUDMFOffset, highlight);
|
|
|
|
hasBottomFields |= SetPairedUDMFFieldsLabel(l.Front.Fields, "scalex_bottom", "scaley_bottom", 1.0f, frontBottomUDMFScaleLabel, frontBottomUDMFScale, highlight);
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//visibility
|
2014-12-03 09:06:05 +00:00
|
|
|
frontTopUDMFOffset.Visible = hasTopFields;
|
|
|
|
frontTopUDMFOffsetLabel.Visible = hasTopFields;
|
|
|
|
frontTopUDMFScale.Visible = hasTopFields;
|
|
|
|
frontTopUDMFScaleLabel.Visible = hasTopFields;
|
|
|
|
|
|
|
|
frontMidUDMFOffset.Visible = hasMiddleFields;
|
|
|
|
frontMidUDMFOffsetLabel.Visible = hasMiddleFields;
|
|
|
|
frontMidUDMFScale.Visible = hasMiddleFields;
|
|
|
|
frontMidUDMFScaleLabel.Visible = hasMiddleFields;
|
|
|
|
|
|
|
|
frontBottomUDMFOffset.Visible = hasBottomFields;
|
|
|
|
frontBottomUDMFOffsetLabel.Visible = hasBottomFields;
|
|
|
|
frontBottomUDMFScale.Visible = hasBottomFields;
|
|
|
|
frontBottomUDMFScaleLabel.Visible = hasBottomFields;
|
2014-11-25 11:52:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-10-03 18:46:13 +00:00
|
|
|
frontoffsetlabel.Text = "Front offset:";
|
2015-12-28 15:01:53 +00:00
|
|
|
if(l.Front.OffsetX != 0 || l.Front.OffsetY != 0)
|
2014-12-08 21:06:08 +00:00
|
|
|
{
|
|
|
|
frontoffset.Text = l.Front.OffsetX + ", " + l.Front.OffsetY;
|
|
|
|
frontoffsetlabel.Enabled = true;
|
|
|
|
frontoffset.Enabled = true;
|
Fixed(?), Texture Browser: possibly fixed Texture Browser not showing up / locking edit forms when current map has a ton of textures (like 2000 or more) in a single texture group.
Changed, cosmetic, Sector Info panel, Visual mode: info about currently highlighted surface is now shown using different color.
Changed, cosmetic, Linedef Info panel, Visual mode, non-UDMF: texture offset labels for currently highlighted sidedef are now shown using different color.
Changed, cosmetic, Vertex Info panel, UDMF: floor and ceiling offset labels are now grayed out when they have default values.
2015-03-23 22:39:31 +00:00
|
|
|
|
|
|
|
frontoffset.ForeColor = (highlight ? SystemColors.HotTrack : SystemColors.WindowText);
|
|
|
|
frontoffsetlabel.ForeColor = frontoffset.ForeColor;
|
2014-12-08 21:06:08 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
frontoffset.Text = "--, --";
|
|
|
|
frontoffsetlabel.Enabled = false;
|
|
|
|
frontoffset.Enabled = false;
|
|
|
|
}
|
2012-10-03 18:46:13 +00:00
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
//mxd. Sector index
|
|
|
|
frontpanel.Text += ". Sector " + l.Front.Sector.Index + " ";
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
//visibility
|
|
|
|
frontTopUDMFOffsetLabel.Visible = false;
|
|
|
|
frontTopUDMFScaleLabel.Visible = false;
|
|
|
|
|
|
|
|
frontMidUDMFOffsetLabel.Visible = false;
|
|
|
|
frontMidUDMFScaleLabel.Visible = false;
|
|
|
|
|
|
|
|
frontBottomUDMFOffsetLabel.Visible = false;
|
|
|
|
frontBottomUDMFScaleLabel.Visible = false;
|
2012-10-03 18:46:13 +00:00
|
|
|
}
|
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
//mxd. Set texture names, update panel sizes
|
|
|
|
UpdateTexturePanel(panelFrontTop, l.Front.HighTexture, fronthighname, labelTextureFrontTop,
|
|
|
|
Math.Max(frontTopUDMFOffset.Right, frontTopUDMFScale.Right) + 4, fronthightex,
|
|
|
|
frontTopUDMFOffsetLabel.Left, hasTopFields, l.Front.HighRequired());
|
2012-10-03 18:46:13 +00:00
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
UpdateTexturePanel(panelFrontMid, l.Front.MiddleTexture, frontmidname, labelTextureFrontMid,
|
|
|
|
Math.Max(frontMidUDMFOffset.Right, frontMidUDMFScale.Right) + 4, frontmidtex,
|
|
|
|
frontMidUDMFOffsetLabel.Left, hasMiddleFields, l.Front.MiddleRequired());
|
2012-10-03 18:46:13 +00:00
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
UpdateTexturePanel(panelFrontLow, l.Front.LowTexture, frontlowname, labelTextureFrontBottom,
|
|
|
|
Math.Max(frontBottomUDMFOffset.Right, frontBottomUDMFScale.Right) + 4, frontlowtex,
|
|
|
|
frontBottomUDMFOffsetLabel.Left, hasBottomFields, l.Front.LowRequired());
|
|
|
|
|
|
|
|
//mxd. Resize panel
|
|
|
|
flowLayoutPanelFront.Width = panelFrontLow.Right;
|
|
|
|
frontpanel.Width = flowLayoutPanelFront.Width + flowLayoutPanelFront.Left * 2 - 4;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Show no info
|
2014-11-25 11:52:01 +00:00
|
|
|
if(General.Map.UDMF) //mxd
|
|
|
|
{
|
2012-10-03 18:46:13 +00:00
|
|
|
frontoffsetlabel.Text = "Front light:";
|
|
|
|
frontoffset.Text = "--";
|
2014-11-25 11:52:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-10-03 18:46:13 +00:00
|
|
|
frontoffsetlabel.Text = "Front offset:";
|
|
|
|
frontoffset.Text = "--, --";
|
|
|
|
}
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
frontoffsetlabel.Enabled = false;
|
|
|
|
frontoffset.Enabled = false;
|
2012-10-03 18:46:13 +00:00
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
fronthightex.BackgroundImage = null;
|
|
|
|
frontmidtex.BackgroundImage = null;
|
|
|
|
frontlowtex.BackgroundImage = null;
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
frontpanel.Visible = false; //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Back size available?
|
|
|
|
if(l.Back != null)
|
|
|
|
{
|
2014-12-03 09:06:05 +00:00
|
|
|
//mxd. Extended info shown?
|
|
|
|
bool hasTopFields = false;
|
|
|
|
bool hasMiddleFields = false;
|
|
|
|
bool hasBottomFields = false;
|
2015-02-25 19:59:17 +00:00
|
|
|
|
|
|
|
//mxd. Highlight this side?
|
|
|
|
bool highlight = l.Back == highlightside;
|
|
|
|
backpanel.ForeColor = (highlight ? SystemColors.HotTrack : SystemColors.WindowText); //mxd
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Show sidedef info
|
2012-10-03 18:46:13 +00:00
|
|
|
backpanel.Visible = true; //mxd
|
2012-11-05 21:53:45 +00:00
|
|
|
backpanel.Text = " Back Sidedef " + l.Back.Index;
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//mxd
|
2014-12-03 09:06:05 +00:00
|
|
|
if(General.Map.UDMF)
|
|
|
|
{
|
2012-10-03 18:46:13 +00:00
|
|
|
//light
|
|
|
|
backoffsetlabel.Text = "Back light:";
|
2015-02-25 19:59:17 +00:00
|
|
|
SetUDMFLight(l.Back, backoffsetlabel, backoffset, highlight);
|
2012-11-05 21:53:45 +00:00
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
//global offset, sector index
|
|
|
|
backpanel.Text += ". Offset " + l.Back.OffsetX + ", " + l.Back.OffsetY + ". Sector " + l.Back.Sector.Index + " ";
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//sidedef top
|
2015-02-25 19:59:17 +00:00
|
|
|
hasTopFields = SetPairedUDMFFieldsLabel(l.Back.Fields, "offsetx_top", "offsety_top", 0f, backTopUDMFOffsetLabel, backTopUDMFOffset, highlight);
|
|
|
|
hasTopFields |= SetPairedUDMFFieldsLabel(l.Back.Fields, "scalex_top", "scaley_top", 1.0f, backTopUDMFScaleLabel, backTopUDMFScale, highlight);
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//sidedef middle
|
2015-02-25 19:59:17 +00:00
|
|
|
hasMiddleFields = SetPairedUDMFFieldsLabel(l.Back.Fields, "offsetx_mid", "offsety_mid", 0f, backMidUDMFOffsetLabel, backMidUDMFOffset, highlight);
|
|
|
|
hasMiddleFields |= SetPairedUDMFFieldsLabel(l.Back.Fields, "scalex_mid", "scaley_mid", 1.0f, backMidUDMFScaleLabel, backMidUDMFScale, highlight);
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//sidedef bottom
|
2015-02-25 19:59:17 +00:00
|
|
|
hasBottomFields = SetPairedUDMFFieldsLabel(l.Back.Fields, "offsetx_bottom", "offsety_bottom", 0f, backBottomUDMFOffsetLabel, backBottomUDMFOffset, highlight);
|
|
|
|
hasBottomFields |= SetPairedUDMFFieldsLabel(l.Back.Fields, "scalex_bottom", "scaley_bottom", 1.0f, backBottomUDMFScaleLabel, backBottomUDMFScale, highlight);
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//visibility
|
2014-12-03 09:06:05 +00:00
|
|
|
backTopUDMFOffset.Visible = hasTopFields;
|
|
|
|
backTopUDMFOffsetLabel.Visible = hasTopFields;
|
|
|
|
backTopUDMFScale.Visible = hasTopFields;
|
|
|
|
backTopUDMFScaleLabel.Visible = hasTopFields;
|
|
|
|
|
|
|
|
backMidUDMFOffset.Visible = hasMiddleFields;
|
|
|
|
backMidUDMFOffsetLabel.Visible = hasMiddleFields;
|
|
|
|
backMidUDMFScale.Visible = hasMiddleFields;
|
|
|
|
backMidUDMFScaleLabel.Visible = hasMiddleFields;
|
|
|
|
|
|
|
|
backBottomUDMFOffset.Visible = hasBottomFields;
|
|
|
|
backBottomUDMFOffsetLabel.Visible = hasBottomFields;
|
|
|
|
backBottomUDMFScale.Visible = hasBottomFields;
|
|
|
|
backBottomUDMFScaleLabel.Visible = hasBottomFields;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-10-03 18:46:13 +00:00
|
|
|
backoffsetlabel.Text = "Back offset:";
|
2015-12-28 15:01:53 +00:00
|
|
|
if(l.Back.OffsetX != 0 || l.Back.OffsetY != 0)
|
2014-12-08 21:06:08 +00:00
|
|
|
{
|
|
|
|
backoffset.Text = l.Back.OffsetX + ", " + l.Back.OffsetY;
|
|
|
|
backoffsetlabel.Enabled = true;
|
|
|
|
backoffset.Enabled = true;
|
Fixed(?), Texture Browser: possibly fixed Texture Browser not showing up / locking edit forms when current map has a ton of textures (like 2000 or more) in a single texture group.
Changed, cosmetic, Sector Info panel, Visual mode: info about currently highlighted surface is now shown using different color.
Changed, cosmetic, Linedef Info panel, Visual mode, non-UDMF: texture offset labels for currently highlighted sidedef are now shown using different color.
Changed, cosmetic, Vertex Info panel, UDMF: floor and ceiling offset labels are now grayed out when they have default values.
2015-03-23 22:39:31 +00:00
|
|
|
|
|
|
|
backoffset.ForeColor = (highlight ? SystemColors.HotTrack : SystemColors.WindowText);
|
|
|
|
backoffsetlabel.ForeColor = backoffset.ForeColor;
|
2014-12-08 21:06:08 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backoffset.Text = "--, --";
|
|
|
|
backoffsetlabel.Enabled = false;
|
|
|
|
backoffset.Enabled = false;
|
|
|
|
}
|
2012-10-03 18:46:13 +00:00
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
// Sector index
|
|
|
|
backpanel.Text += ". Sector " + l.Back.Sector.Index + " ";
|
2012-10-03 18:46:13 +00:00
|
|
|
}
|
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
//mxd. Set texture names, update panel sizes
|
|
|
|
UpdateTexturePanel(panelBackTop, l.Back.HighTexture, backhighname, labelTextureBackTop,
|
|
|
|
Math.Max(backTopUDMFOffset.Right, backTopUDMFScale.Right) + 4, backhightex,
|
|
|
|
backTopUDMFOffsetLabel.Left, hasTopFields, l.Back.HighRequired());
|
2012-10-03 18:46:13 +00:00
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
UpdateTexturePanel(panelBackMid, l.Back.MiddleTexture, backmidname, labelTextureBackMid,
|
|
|
|
Math.Max(backMidUDMFOffset.Right, backMidUDMFScale.Right) + 4, backmidtex,
|
|
|
|
backMidUDMFOffsetLabel.Left, hasMiddleFields, l.Back.MiddleRequired());
|
2012-10-03 18:46:13 +00:00
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
UpdateTexturePanel(panelBackLow, l.Back.LowTexture, backlowname, labelTextureBackBottom,
|
|
|
|
Math.Max(backBottomUDMFOffset.Right, backBottomUDMFScale.Right) + 4, backlowtex,
|
|
|
|
backBottomUDMFOffsetLabel.Left, hasBottomFields, l.Back.LowRequired());
|
|
|
|
|
|
|
|
//mxd. Resize panel
|
|
|
|
flowLayoutPanelBack.Width = panelBackLow.Right;
|
|
|
|
backpanel.Width = flowLayoutPanelBack.Width + flowLayoutPanelBack.Left * 2 - 4;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Show no info
|
2014-11-25 11:52:01 +00:00
|
|
|
if(General.Map.UDMF) //mxd
|
|
|
|
{
|
2012-10-03 18:46:13 +00:00
|
|
|
backoffsetlabel.Text = "Back light:";
|
|
|
|
backoffset.Text = "--";
|
2014-11-25 11:52:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-10-03 18:46:13 +00:00
|
|
|
backoffsetlabel.Text = "Back offset:";
|
|
|
|
backoffset.Text = "--, --";
|
|
|
|
}
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
backoffsetlabel.Enabled = false;
|
|
|
|
backoffset.Enabled = false;
|
2012-10-03 18:46:13 +00:00
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
backhightex.BackgroundImage = null;
|
|
|
|
backmidtex.BackgroundImage = null;
|
|
|
|
backlowtex.BackgroundImage = null;
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
backpanel.Visible = false; //mxd
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
2015-04-12 21:05:09 +00:00
|
|
|
//mxd. Flags and activations
|
2013-12-05 14:04:25 +00:00
|
|
|
flags.Items.Clear();
|
2015-04-12 21:05:09 +00:00
|
|
|
|
|
|
|
// Add activations
|
|
|
|
foreach(LinedefActivateInfo ai in General.Map.Config.LinedefActivates)
|
|
|
|
{
|
|
|
|
if(l.Flags.ContainsKey(ai.Key) && l.Flags[ai.Key])
|
|
|
|
flags.Items.Add(new ListViewItem(ai.Title) { Checked = true, ForeColor = SystemColors.HotTrack });
|
|
|
|
}
|
|
|
|
|
|
|
|
// And flags
|
|
|
|
foreach(KeyValuePair<string, string> group in General.Map.Config.LinedefFlags)
|
|
|
|
{
|
|
|
|
if(l.Flags.ContainsKey(group.Key) && l.Flags[group.Key])
|
|
|
|
flags.Items.Add(new ListViewItem(group.Value) { Checked = true });
|
|
|
|
}
|
|
|
|
|
|
|
|
// And front flags
|
|
|
|
if(l.Front != null)
|
|
|
|
{
|
|
|
|
foreach(KeyValuePair<string, string> group in General.Map.Config.SidedefFlags)
|
|
|
|
{
|
|
|
|
if(l.Front.Flags.ContainsKey(group.Key) && l.Front.Flags[group.Key])
|
|
|
|
flags.Items.Add(new ListViewItem("Front: " + group.Value) { Checked = true });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// And back flags
|
|
|
|
if(l.Back != null)
|
2014-11-25 11:52:01 +00:00
|
|
|
{
|
2015-04-12 21:05:09 +00:00
|
|
|
foreach(KeyValuePair<string, string> group in General.Map.Config.SidedefFlags)
|
2014-11-25 11:52:01 +00:00
|
|
|
{
|
2015-04-12 21:05:09 +00:00
|
|
|
if(l.Back.Flags.ContainsKey(group.Key) && l.Back.Flags[group.Key])
|
|
|
|
flags.Items.Add(new ListViewItem("Back: " + group.Value) { Checked = true });
|
2013-12-05 14:04:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//mxd. Flags panel visibility and size
|
|
|
|
flagsPanel.Visible = (flags.Items.Count > 0);
|
2014-11-25 11:52:01 +00:00
|
|
|
if(flags.Items.Count > 0)
|
|
|
|
{
|
2015-04-12 22:29:22 +00:00
|
|
|
flags.Width = flags.GetItemRect(0).Width * (int)Math.Ceiling(flags.Items.Count / 4.0f);
|
2013-12-05 14:04:25 +00:00
|
|
|
flagsPanel.Width = flags.Width + flags.Left * 2;
|
|
|
|
}
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Show the whole thing
|
|
|
|
this.Show();
|
|
|
|
this.Update();
|
|
|
|
}
|
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
private static void UpdateTexturePanel(Panel panel, string texturename, Label texturenamelabel, Label sizelabel, int maxlabelright, Panel image, int sizeref, bool extendedinfoshown, bool required)
|
|
|
|
{
|
|
|
|
// Set texture name
|
|
|
|
texturenamelabel.Text = texturename;
|
|
|
|
|
|
|
|
// And image
|
|
|
|
DisplayTextureImage(image, sizelabel, texturename, required);
|
|
|
|
|
|
|
|
//Reposition texture name label?
|
|
|
|
if(texturenamelabel.Width < image.Width + 2)
|
|
|
|
texturenamelabel.Location = new Point(image.Location.X + (image.Width - texturenamelabel.Width) / 2, texturenamelabel.Location.Y);
|
|
|
|
else
|
|
|
|
texturenamelabel.Location = new Point(image.Location.X, texturenamelabel.Location.Y);
|
|
|
|
|
|
|
|
// Resize panel
|
|
|
|
if(!extendedinfoshown)
|
|
|
|
panel.Width = Math.Max(texturenamelabel.Right + image.Location.X + 1, sizeref);
|
|
|
|
else
|
|
|
|
panel.Width = Math.Max(texturenamelabel.Right, maxlabelright) + image.Location.X;
|
|
|
|
}
|
|
|
|
|
2012-10-03 18:46:13 +00:00
|
|
|
//mxd
|
2015-02-25 19:59:17 +00:00
|
|
|
private static bool SetPairedUDMFFieldsLabel(UniFields fields, string paramX, string paramY, float defaultvalue, Label namelabel, Label valuelabel, bool highlight)
|
2014-11-25 11:52:01 +00:00
|
|
|
{
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
float x = UniFields.GetFloat(fields, paramX, defaultvalue);
|
|
|
|
float y = UniFields.GetFloat(fields, paramY, defaultvalue);
|
2012-10-03 18:46:13 +00:00
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
if(fields.ContainsKey(paramX)) x = (float)fields[paramX].Value;
|
|
|
|
if(fields.ContainsKey(paramY)) y = (float)fields[paramY].Value;
|
2012-10-03 18:46:13 +00:00
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
if(x != defaultvalue || y != defaultvalue)
|
2014-11-25 11:52:01 +00:00
|
|
|
{
|
2015-03-03 09:42:54 +00:00
|
|
|
valuelabel.Text = x.ToString(CultureInfo.InvariantCulture) + ", " + y.ToString(CultureInfo.InvariantCulture);
|
2014-12-03 09:06:05 +00:00
|
|
|
valuelabel.Enabled = true;
|
|
|
|
namelabel.Enabled = true;
|
2015-02-25 19:59:17 +00:00
|
|
|
return true;
|
2014-12-03 09:06:05 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
valuelabel.Text = "--, --";
|
2015-02-25 19:59:17 +00:00
|
|
|
valuelabel.Enabled = highlight;
|
|
|
|
namelabel.Enabled = highlight;
|
|
|
|
return false;
|
2012-10-03 18:46:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//mxd
|
2015-02-25 19:59:17 +00:00
|
|
|
private static void SetUDMFLight(Sidedef sd, Label label, Label value, bool highlight)
|
2014-05-20 09:09:28 +00:00
|
|
|
{
|
2014-11-25 11:52:01 +00:00
|
|
|
if(sd.Fields.ContainsKey("light"))
|
|
|
|
{
|
2013-09-11 09:47:53 +00:00
|
|
|
int light = (int)sd.Fields["light"].Value;
|
|
|
|
|
2015-12-28 15:01:53 +00:00
|
|
|
if(sd.Fields.GetValue("lightabsolute", false))
|
2012-11-02 23:11:38 +00:00
|
|
|
value.Text = light + " (abs.)";
|
2013-09-11 09:47:53 +00:00
|
|
|
else
|
|
|
|
value.Text = light + " (" + Math.Min(255, Math.Max(0, (light + sd.Sector.Brightness))) + ")";
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
value.Enabled = true;
|
|
|
|
label.Enabled = true;
|
2014-11-25 11:52:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-02-25 19:59:17 +00:00
|
|
|
value.Text = "-- (" + sd.Sector.Brightness + ")";
|
|
|
|
label.Enabled = highlight;
|
|
|
|
value.Enabled = highlight;
|
2012-10-03 18:46:13 +00:00
|
|
|
}
|
2015-02-25 19:59:17 +00:00
|
|
|
|
|
|
|
label.ForeColor = (highlight ? SystemColors.HotTrack : SystemColors.WindowText);
|
|
|
|
value.ForeColor = label.ForeColor;
|
2012-10-03 18:46:13 +00:00
|
|
|
}
|
|
|
|
|
2013-09-11 09:47:53 +00:00
|
|
|
//mxd
|
2014-12-03 09:06:05 +00:00
|
|
|
private static void SetArgumentText(ArgumentInfo info, Label label, int value)
|
2014-05-20 09:09:28 +00:00
|
|
|
{
|
2014-01-16 13:08:41 +00:00
|
|
|
TypeHandler th = General.Types.GetArgumentHandler(info);
|
|
|
|
th.SetValue(value);
|
|
|
|
label.Text = th.GetStringValue();
|
|
|
|
}
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// When visible changed
|
|
|
|
protected override void OnVisibleChanged(EventArgs e)
|
|
|
|
{
|
|
|
|
// Hiding panels
|
|
|
|
if(!this.Visible)
|
|
|
|
{
|
|
|
|
fronthightex.BackgroundImage = null;
|
|
|
|
frontmidtex.BackgroundImage = null;
|
|
|
|
frontlowtex.BackgroundImage = null;
|
|
|
|
backhightex.BackgroundImage = null;
|
|
|
|
backmidtex.BackgroundImage = null;
|
|
|
|
backlowtex.BackgroundImage = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Call base
|
|
|
|
base.OnVisibleChanged(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
// This shows a sidedef texture in a panel
|
2014-12-03 09:06:05 +00:00
|
|
|
private static void DisplayTextureImage(Panel panel, Label sizelabel, string name, bool required)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
|
|
|
// Check if name is a "none" texture
|
2013-07-31 12:38:47 +00:00
|
|
|
if((name.Length < 1) || (name == "-"))
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
2014-11-25 11:52:01 +00:00
|
|
|
sizelabel.Visible = false; //mxd
|
2013-06-17 13:17:53 +00:00
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Determine image to show
|
2013-07-31 12:38:47 +00:00
|
|
|
if(required)
|
|
|
|
General.DisplayZoomedImage(panel, Properties.Resources.MissingTexture);
|
2013-08-05 13:46:43 +00:00
|
|
|
else
|
|
|
|
panel.BackgroundImage = null;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-06-17 13:17:53 +00:00
|
|
|
//mxd
|
|
|
|
ImageData texture = General.Map.Data.GetTextureImage(name);
|
2014-12-03 09:06:05 +00:00
|
|
|
if(General.Settings.ShowTextureSizes && texture.ImageState == ImageLoadState.Ready && !(texture is UnknownImage))
|
2014-11-25 11:52:01 +00:00
|
|
|
{
|
|
|
|
sizelabel.Visible = true;
|
Fixed, Texture previews: texture size labels were displaying incorrect size or no size at all when showing TEXTURES textures with negative scale.
Fixed, Visual mode, UDMF: when several wall parts were selected, only one could be dragged with the mouse.
Fixed, Visual mode, Auto-align textures, UDMF: TEXTURES scale is now taken into account when aligning textures.
Fixed, Visual mode, Auto-align textures (Y), UDMF: nearest height matching is now applied to non-wrapped middle backsides.
Cosmetic changes in ZDoom_ACS.cfg.
2015-01-27 11:40:25 +00:00
|
|
|
sizelabel.Text = Math.Abs(texture.ScaledWidth) + "x" + Math.Abs(texture.ScaledHeight);
|
2014-11-25 11:52:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sizelabel.Visible = false;
|
2013-06-17 13:17:53 +00:00
|
|
|
}
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Set the image
|
2013-07-31 12:38:47 +00:00
|
|
|
General.DisplayZoomedImage(panel, texture.GetPreview());
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|