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;
|
2022-12-28 22:04:32 +00:00
|
|
|
private Label[] arglabels;
|
|
|
|
private Label[] args;
|
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Constructor
|
|
|
|
public LinedefInfoPanel()
|
|
|
|
{
|
|
|
|
// Initialize
|
|
|
|
InitializeComponent();
|
2020-09-11 23:25:59 +00:00
|
|
|
CodeImp.DoomBuilder.General.ApplyMonoListViewFix(flags);
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
// Hide stuff when in Doom format
|
|
|
|
hexenformatwidth = infopanel.Width;
|
|
|
|
doomformatwidth = infopanel.Width - 190;
|
2014-12-03 09:06:05 +00:00
|
|
|
|
2022-12-28 22:04:32 +00:00
|
|
|
arglabels = new Label[] { arglbl1, arglbl2, arglbl3, arglbl4, arglbl5 };
|
|
|
|
args = new Label[] { arg1, arg2, arg3, arg4, arg5 };
|
|
|
|
|
2021-09-04 10:21:17 +00:00
|
|
|
// We have to set the parernt (and subsequently the new location relative to the parent) here since
|
|
|
|
// we can't set the parent in the designer. And if the parent is not set to the ConfigurablePictureBox
|
|
|
|
// the Label's background alpha will not work correctly
|
|
|
|
labelTextureFrontTop.Parent = fronthightex;
|
|
|
|
labelTextureFrontTop.Location = new Point(1, 1);
|
|
|
|
labelTextureFrontMid.Parent = frontmidtex;
|
|
|
|
labelTextureFrontMid.Location = new Point(1, 1);
|
|
|
|
labelTextureFrontBottom.Parent = frontlowtex;
|
|
|
|
labelTextureFrontBottom.Location = new Point(1, 1);
|
|
|
|
labelTextureBackTop.Parent = backhightex;
|
|
|
|
labelTextureBackTop.Location = new Point(1, 1);
|
|
|
|
labelTextureBackMid.Parent = backmidtex;
|
|
|
|
labelTextureBackMid.Location = new Point(1, 1);
|
|
|
|
labelTextureBackBottom.Parent = backlowtex;
|
|
|
|
labelTextureBackBottom.Location = new Point(1, 1);
|
|
|
|
|
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;
|
2022-12-28 22:04:32 +00:00
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Show/hide stuff depending on format
|
2022-12-28 22:04:32 +00:00
|
|
|
bool hasArgs = General.Map.FormatInterface.HasActionArgs;
|
|
|
|
for (int i = 0; i < args.Length; i++)
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
2022-12-28 22:04:32 +00:00
|
|
|
arglabels[i].Visible = hasArgs;
|
|
|
|
args[i].Visible = hasArgs;
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
2022-12-28 22:04:32 +00:00
|
|
|
infopanel.Width = (hasArgs ? hexenformatwidth : doomformatwidth);
|
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;
|
2016-06-16 22:57:20 +00:00
|
|
|
activationlabel.Text = "Activation:";
|
2014-01-23 13:36:51 +00:00
|
|
|
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
|
|
|
|
2016-02-06 21:23:43 +00:00
|
|
|
activation.Enabled = (l.Activate != 0 || l.Action != 0); //mxd
|
|
|
|
activationlabel.Enabled = (l.Activate != 0 || l.Action != 0); //mxd
|
2014-11-25 11:52:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-06-16 22:57:20 +00:00
|
|
|
if(General.Map.UDMF)
|
|
|
|
{
|
|
|
|
// Hijack activation labels to show lock numer...
|
|
|
|
activationlabel.Text = "Lock:";
|
|
|
|
activationlabel.Visible = true;
|
|
|
|
activation.Visible = true;
|
|
|
|
|
|
|
|
int locknum = l.Fields.GetValue("locknumber", 0);
|
|
|
|
if(locknum != 0)
|
|
|
|
{
|
|
|
|
activationlabel.Enabled = true;
|
|
|
|
activation.Enabled = true;
|
|
|
|
|
|
|
|
if(General.Map.Config.Enums.ContainsKey("keys"))
|
|
|
|
{
|
|
|
|
foreach(EnumItem item in General.Map.Config.Enums["keys"])
|
|
|
|
{
|
|
|
|
if(item.GetIntValue() == locknum)
|
|
|
|
{
|
|
|
|
activation.Text = locknum + " - " + item.Title;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
activation.Text = locknum.ToString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
activationlabel.Enabled = false;
|
|
|
|
activation.Enabled = false;
|
|
|
|
activation.Text = "None";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Should be Doom map format
|
|
|
|
activationlabel.Visible = false;
|
|
|
|
activation.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
|
2016-11-21 13:03:19 +00:00
|
|
|
#if DEBUG
|
|
|
|
infopanel.Text = " Linedef " + l.Index + " (vert. " + l.Start.Index + " - vert. " + l.End.Index + ") ";
|
|
|
|
#else
|
2009-06-05 19:03:56 +00:00
|
|
|
infopanel.Text = " Linedef " + l.Index + " ";
|
2016-11-21 13:03:19 +00:00
|
|
|
#endif
|
2009-04-19 18:07:22 +00:00
|
|
|
action.Text = act.ToString();
|
|
|
|
length.Text = l.Length.ToString("0.##");
|
2016-11-21 13:03:19 +00:00
|
|
|
angle.Text = 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);
|
2017-02-23 13:01:36 +00:00
|
|
|
bool isarg0str = (General.Map.UDMF && l.Fields.ContainsKey("arg0str"));
|
|
|
|
string arg0str = isarg0str ? l.Fields.GetValue("arg0str", string.Empty) : string.Empty;
|
2015-07-27 09:02:28 +00:00
|
|
|
ScriptItem scriptitem = null;
|
2012-07-10 10:20:45 +00:00
|
|
|
|
2016-09-12 14:08:45 +00:00
|
|
|
//mxd. Set default label colors
|
|
|
|
arg1.ForeColor = SystemColors.ControlText;
|
|
|
|
arglbl1.ForeColor = SystemColors.ControlText;
|
|
|
|
|
2015-07-27 09:02:28 +00:00
|
|
|
// Named script?
|
2017-02-23 13:01:36 +00:00
|
|
|
if(isacsscript && isarg0str && General.Map.NamedScripts.ContainsKey(arg0str.ToLowerInvariant()))
|
2015-07-27 09:02:28 +00:00
|
|
|
{
|
2017-02-23 13:01:36 +00:00
|
|
|
scriptitem = General.Map.NamedScripts[arg0str.ToLowerInvariant()];
|
2015-07-27 09:02:28 +00:00
|
|
|
}
|
|
|
|
// Script number?
|
|
|
|
else if(isacsscript && General.Map.NumberedScripts.ContainsKey(l.Args[0]))
|
|
|
|
{
|
|
|
|
scriptitem = General.Map.NumberedScripts[l.Args[0]];
|
2017-02-23 13:01:36 +00:00
|
|
|
arg0str = (scriptitem.HasCustomName ? scriptitem.Name : scriptitem.Index.ToString());
|
2015-07-27 09:02:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Apply script args?
|
|
|
|
if(scriptitem != null)
|
|
|
|
{
|
2017-02-23 13:01:36 +00:00
|
|
|
int first;
|
|
|
|
string[] argnames = scriptitem.GetArgumentsDescriptions(l.Action, out first);
|
|
|
|
for (int i = 0; i < first; i++)
|
|
|
|
{
|
|
|
|
arglabels[i].Text = (isarg0str ? act.Args[i].TitleStr : act.Args[i].Title) + ":";
|
|
|
|
arglabels[i].Enabled = act.Args[i].Used;
|
|
|
|
args[i].Enabled = act.Args[i].Used;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = first; i < argnames.Length; i++)
|
2015-07-27 09:02:28 +00:00
|
|
|
{
|
|
|
|
if(!string.IsNullOrEmpty(argnames[i]))
|
|
|
|
{
|
|
|
|
arglabels[i].Text = argnames[i] + ":";
|
|
|
|
arglabels[i].Enabled = true;
|
|
|
|
args[i].Enabled = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-02-23 13:01:36 +00:00
|
|
|
arglabels[i].Text = (isarg0str ? act.Args[i].TitleStr : act.Args[i].Title) + ":";
|
|
|
|
arglabels[i].Enabled = act.Args[i].Used;
|
2015-07-27 09:02:28 +00:00
|
|
|
args[i].Enabled = act.Args[i].Used;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for(int i = 0; i < act.Args.Length; i++)
|
|
|
|
{
|
2017-02-23 13:01:36 +00:00
|
|
|
arglabels[i].Text = (isarg0str ? act.Args[i].TitleStr : act.Args[i].Title) + ":";
|
|
|
|
arglabels[i].Enabled = act.Args[i].Used;
|
2015-07-27 09:02:28 +00:00
|
|
|
args[i].Enabled = act.Args[i].Used;
|
|
|
|
}
|
2016-09-12 14:08:45 +00:00
|
|
|
|
|
|
|
// Special cases: unknown script name/index
|
2017-02-23 13:01:36 +00:00
|
|
|
if(isacsscript)
|
2016-09-12 14:08:45 +00:00
|
|
|
{
|
2017-02-23 13:01:36 +00:00
|
|
|
arglbl1.Text = "Unknown script " + (isarg0str ? "name" : "number") + ":";
|
2016-09-12 14:08:45 +00:00
|
|
|
arg1.ForeColor = Color.DarkRed;
|
|
|
|
arglbl1.ForeColor = Color.DarkRed;
|
|
|
|
}
|
2015-07-27 09:02:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//mxd. Set argument value and label
|
2017-02-23 13:01:36 +00:00
|
|
|
if(isarg0str) arg1.Text = arg0str;
|
2015-07-27 09:02:28 +00:00
|
|
|
else SetArgumentText(act.Args[0], arg1, l.Args[0]);
|
2022-12-28 22:04:32 +00:00
|
|
|
for (int i = 1; i < args.Length; i++)
|
|
|
|
SetArgumentText(act.Args[i], args[i], l.Args[i]);
|
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
|
2020-05-22 19:39:18 +00:00
|
|
|
hasTopFields = SetPairedUDMFFieldsLabel(l.Front.Fields, "offsetx_top", "offsety_top", 0.0, frontTopUDMFOffsetLabel, frontTopUDMFOffset, highlight);
|
|
|
|
hasTopFields |= SetPairedUDMFFieldsLabel(l.Front.Fields, "scalex_top", "scaley_top", 1.0, frontTopUDMFScaleLabel, frontTopUDMFScale, highlight);
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//sidedef middle
|
2020-05-22 19:39:18 +00:00
|
|
|
hasMiddleFields = SetPairedUDMFFieldsLabel(l.Front.Fields, "offsetx_mid", "offsety_mid", 0.0, frontMidUDMFOffsetLabel, frontMidUDMFOffset, highlight);
|
|
|
|
hasMiddleFields |= SetPairedUDMFFieldsLabel(l.Front.Fields, "scalex_mid", "scaley_mid", 1.0, frontMidUDMFScaleLabel, frontMidUDMFScale, highlight);
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//sidedef bottom
|
2020-05-22 19:39:18 +00:00
|
|
|
hasBottomFields = SetPairedUDMFFieldsLabel(l.Front.Fields, "offsetx_bottom", "offsety_bottom", 0.0, frontBottomUDMFOffsetLabel, frontBottomUDMFOffset, highlight);
|
|
|
|
hasBottomFields |= SetPairedUDMFFieldsLabel(l.Front.Fields, "scalex_bottom", "scaley_bottom", 1.0, 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
|
2020-05-22 23:37:14 +00:00
|
|
|
hasTopFields = SetPairedUDMFFieldsLabel(l.Back.Fields, "offsetx_top", "offsety_top", 0.0, backTopUDMFOffsetLabel, backTopUDMFOffset, highlight);
|
|
|
|
hasTopFields |= SetPairedUDMFFieldsLabel(l.Back.Fields, "scalex_top", "scaley_top", 1.0, backTopUDMFScaleLabel, backTopUDMFScale, highlight);
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//sidedef middle
|
2020-05-22 23:37:14 +00:00
|
|
|
hasMiddleFields = SetPairedUDMFFieldsLabel(l.Back.Fields, "offsetx_mid", "offsety_mid", 0.0, backMidUDMFOffsetLabel, backMidUDMFOffset, highlight);
|
|
|
|
hasMiddleFields |= SetPairedUDMFFieldsLabel(l.Back.Fields, "scalex_mid", "scaley_mid", 1.0, backMidUDMFScaleLabel, backMidUDMFScale, highlight);
|
2012-10-03 18:46:13 +00:00
|
|
|
|
|
|
|
//sidedef bottom
|
2020-05-22 23:37:14 +00:00
|
|
|
hasBottomFields = SetPairedUDMFFieldsLabel(l.Back.Fields, "offsetx_bottom", "offsety_bottom", 0.0, backBottomUDMFOffsetLabel, backBottomUDMFOffset, highlight);
|
|
|
|
hasBottomFields |= SetPairedUDMFFieldsLabel(l.Back.Fields, "scalex_bottom", "scaley_bottom", 1.0, 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());
|
2021-09-04 10:21:17 +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());
|
2021-09-04 10:21:17 +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)
|
|
|
|
{
|
2016-06-14 20:39:46 +00:00
|
|
|
Rectangle rect = flags.GetItemRect(0);
|
|
|
|
int itemspercolumn = 1;
|
|
|
|
|
|
|
|
// Check how many items per column we have...
|
|
|
|
for(int i = 1; i < flags.Items.Count; i++)
|
|
|
|
{
|
|
|
|
if(flags.GetItemRect(i).X != rect.X) break;
|
|
|
|
itemspercolumn++;
|
|
|
|
}
|
|
|
|
|
|
|
|
flags.Width = rect.Width * (int)Math.Ceiling(flags.Items.Count / (float)itemspercolumn);
|
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();
|
2017-02-08 12:18:01 +00:00
|
|
|
//this.Update(); // ano - don't think this is needed, and is slow
|
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
|
2021-09-04 10:21:17 +00:00
|
|
|
private static void UpdateTexturePanel(Panel panel, string texturename, Label texturenamelabel, Label sizelabel, int maxlabelright, ConfigurablePictureBox image, int sizeref, bool extendedinfoshown, bool required)
|
2014-12-03 09:06:05 +00:00
|
|
|
{
|
|
|
|
// Set texture name
|
2016-12-22 15:04:40 +00:00
|
|
|
texturenamelabel.Text = (texturename.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH ? texturename : texturename.ToUpperInvariant());
|
2014-12-03 09:06:05 +00:00
|
|
|
|
|
|
|
// 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
|
2020-05-22 19:39:18 +00:00
|
|
|
private static bool SetPairedUDMFFieldsLabel(UniFields fields, string paramX, string paramY, double defaultvalue, Label namelabel, Label valuelabel, bool highlight)
|
2014-11-25 11:52:01 +00:00
|
|
|
{
|
2020-05-21 12:20:02 +00:00
|
|
|
double x = UniFields.GetFloat(fields, paramX, defaultvalue);
|
|
|
|
double y = UniFields.GetFloat(fields, paramY, defaultvalue);
|
2012-10-03 18:46:13 +00:00
|
|
|
|
2020-05-21 12:20:02 +00:00
|
|
|
if(fields.ContainsKey(paramX)) x = (double)fields[paramX].Value;
|
|
|
|
if(fields.ContainsKey(paramY)) y = (double)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
|
2021-09-04 10:21:17 +00:00
|
|
|
private static void DisplayTextureImage(ConfigurablePictureBox 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
|
2021-09-04 10:21:17 +00:00
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Determine image to show
|
2021-09-04 10:21:17 +00:00
|
|
|
if (required)
|
|
|
|
panel.Image = Properties.Resources.MissingTexture;
|
2013-08-05 13:46:43 +00:00
|
|
|
else
|
2021-09-04 10:21:17 +00:00
|
|
|
panel.Image = 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
|
|
|
}
|
2021-09-04 10:21:17 +00:00
|
|
|
|
2009-04-19 18:07:22 +00:00
|
|
|
// Set the image
|
2021-09-04 10:21:17 +00:00
|
|
|
panel.Image = texture.GetPreview();
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|