2007-10-24 17:25:03 +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;
|
|
|
|
using System.ComponentModel;
|
|
|
|
using System.Drawing;
|
|
|
|
using System.Text;
|
|
|
|
using System.Windows.Forms;
|
|
|
|
using Microsoft.Win32;
|
|
|
|
using System.Diagnostics;
|
|
|
|
using CodeImp.DoomBuilder.Data;
|
|
|
|
using CodeImp.DoomBuilder.Map;
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
2008-05-29 11:54:45 +00:00
|
|
|
namespace CodeImp.DoomBuilder.Controls
|
2007-10-24 17:25:03 +00:00
|
|
|
{
|
2008-01-02 21:49:43 +00:00
|
|
|
internal partial class SectorInfoPanel : UserControl
|
2007-10-24 17:25:03 +00:00
|
|
|
{
|
|
|
|
// Constructor
|
|
|
|
public SectorInfoPanel()
|
|
|
|
{
|
|
|
|
// Initialize
|
|
|
|
InitializeComponent();
|
|
|
|
}
|
|
|
|
|
|
|
|
// This shows the info
|
|
|
|
public void ShowInfo(Sector s)
|
|
|
|
{
|
2008-02-22 17:20:10 +00:00
|
|
|
string effectinfo = "";
|
|
|
|
|
2007-10-24 17:25:03 +00:00
|
|
|
int sheight = s.CeilHeight - s.FloorHeight;
|
|
|
|
|
2008-02-22 17:20:10 +00:00
|
|
|
// Lookup effect description in config
|
|
|
|
if(General.Map.Config.SectorEffects.ContainsKey(s.Effect))
|
|
|
|
effectinfo = General.Map.Config.SectorEffects[s.Effect].ToString();
|
|
|
|
else if(s.Effect == 0)
|
|
|
|
effectinfo = s.Effect.ToString() + " - Normal";
|
|
|
|
else
|
|
|
|
effectinfo = s.Effect.ToString() + " - Unknown";
|
2007-10-24 17:25:03 +00:00
|
|
|
|
|
|
|
// Sector info
|
2007-12-27 01:24:11 +00:00
|
|
|
sectorinfo.Text = " Sector " + s.Index.ToString() + " ";
|
2008-02-22 17:20:10 +00:00
|
|
|
effect.Text = effectinfo;
|
2007-10-24 17:25:03 +00:00
|
|
|
ceiling.Text = s.CeilHeight.ToString();
|
|
|
|
floor.Text = s.FloorHeight.ToString();
|
|
|
|
tag.Text = s.Tag.ToString();
|
|
|
|
height.Text = sheight.ToString();
|
|
|
|
brightness.Text = s.Brightness.ToString();
|
|
|
|
floorname.Text = s.FloorTexture;
|
|
|
|
ceilingname.Text = s.CeilTexture;
|
2008-09-28 21:20:56 +00:00
|
|
|
General.DisplayZoomedImage(floortex, General.Map.Data.GetFlatImage(s.FloorTexture).GetPreview());
|
|
|
|
General.DisplayZoomedImage(ceilingtex, General.Map.Data.GetFlatImage(s.CeilTexture).GetPreview());
|
2007-10-24 17:25:03 +00:00
|
|
|
|
|
|
|
// Show the whole thing
|
|
|
|
this.Show();
|
|
|
|
this.Update();
|
|
|
|
}
|
|
|
|
|
2007-10-26 13:17:20 +00:00
|
|
|
// When visible changed
|
|
|
|
protected override void OnVisibleChanged(EventArgs e)
|
2007-10-24 17:25:03 +00:00
|
|
|
{
|
2007-10-26 13:17:20 +00:00
|
|
|
// Hiding panels
|
|
|
|
if(!this.Visible)
|
|
|
|
{
|
|
|
|
floortex.BackgroundImage = null;
|
|
|
|
ceilingtex.BackgroundImage = null;
|
|
|
|
}
|
2007-10-24 17:25:03 +00:00
|
|
|
|
2007-10-26 13:17:20 +00:00
|
|
|
// Call base
|
|
|
|
base.OnVisibleChanged(e);
|
2007-10-24 17:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|