Removed some unused functions.

Tag Explorer: comments can now be edited properly.
This commit is contained in:
MaxED 2012-07-10 14:14:53 +00:00
parent 5cb573d938
commit fb0db718a0
36 changed files with 68 additions and 139 deletions

View file

@ -94,7 +94,7 @@ namespace CodeImp.DoomBuilder.Compilers
if(!isdisposed) if(!isdisposed)
{ {
Exception deleteerror = null; Exception deleteerror = null;
double starttime = General.Clock.GetCurrentTime(); double starttime = General.Clock.CurrentTime;
do do
{ {
@ -111,7 +111,7 @@ namespace CodeImp.DoomBuilder.Compilers
} }
// Bail out when it takes too long // Bail out when it takes too long
if((General.Clock.GetCurrentTime() - starttime) > 2000) break; if((General.Clock.CurrentTime - starttime) > 2000) break;
} }
while(deleteerror != null); while(deleteerror != null);

View file

@ -531,7 +531,7 @@ namespace CodeImp.DoomBuilder.Data
private void StartBackgroundLoader() private void StartBackgroundLoader()
{ {
// Timing // Timing
loadstarttime = General.Clock.GetCurrentTime(); loadstarttime = General.Clock.CurrentTime;
loadfinishtime = 0; loadfinishtime = 0;
// If a loader is already running, stop it first // If a loader is already running, stop it first
@ -664,7 +664,7 @@ namespace CodeImp.DoomBuilder.Data
// Timing // Timing
if(loadfinishtime == 0) if(loadfinishtime == 0)
{ {
loadfinishtime = General.Clock.GetCurrentTime(); loadfinishtime = General.Clock.CurrentTime;
double deltatimesec = (loadfinishtime - loadstarttime) / 1000.0d; double deltatimesec = (loadfinishtime - loadstarttime) / 1000.0d;
General.WriteLogLine("Resources loading took " + deltatimesec.ToString("########0.00") + " seconds"); General.WriteLogLine("Resources loading took " + deltatimesec.ToString("########0.00") + " seconds");
} }

View file

@ -20,7 +20,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
} }
} }
public class BoundingBoxTools public static class BoundingBoxTools
{ {
//this creates array of vectors resembling bounding box //this creates array of vectors resembling bounding box
public static Vector3[] CalculateBoundingBox(BoundingBoxSizes bbs) { public static Vector3[] CalculateBoundingBox(BoundingBoxSizes bbs) {
@ -48,35 +48,6 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
return new Vector3[] { v0, v1 }; return new Vector3[] { v0, v1 };
} }
/*public static Vector3[] CalculateBoundingPlane(BoundingBoxSizes bbs) {
if(bbs.MinX != bbs.MaxX && bbs.MinY != bbs.MaxY && bbs.MinZ != bbs.MaxZ)
return CalculateBoundingBox(bbs);
//center
Vector3 v0 = new Vector3(bbs.MinX + (bbs.MaxX - bbs.MinX) / 2, bbs.MinY + (bbs.MaxY - bbs.MinY) / 2, bbs.MinZ + (bbs.MaxZ - bbs.MinZ) / 2);
Vector3 v1, v2, v3, v4;
//corners
if (bbs.MinX == bbs.MaxX) {
v1 = new Vector3(bbs.MinX, bbs.MinY, bbs.MinZ);
v2 = new Vector3(bbs.MinX, bbs.MaxY, bbs.MinZ);
v3 = new Vector3(bbs.MinX, bbs.MinY, bbs.MaxZ);
v4 = new Vector3(bbs.MinX, bbs.MaxY, bbs.MaxZ);
} else if (bbs.MinY == bbs.MaxY) {
v1 = new Vector3(bbs.MinX, bbs.MinY, bbs.MinZ);
v2 = new Vector3(bbs.MaxX, bbs.MinY, bbs.MinZ);
v3 = new Vector3(bbs.MinX, bbs.MinY, bbs.MaxZ);
v4 = new Vector3(bbs.MaxX, bbs.MinY, bbs.MaxZ);
} else {
v1 = new Vector3(bbs.MinX, bbs.MinY, bbs.MinZ);
v2 = new Vector3(bbs.MaxX, bbs.MinY, bbs.MinZ);
v3 = new Vector3(bbs.MinX, bbs.MaxY, bbs.MinZ);
v4 = new Vector3(bbs.MaxX, bbs.MaxY, bbs.MinZ);
}
return new Vector3[] { v0, v1, v2, v3, v4 };
}*/
public static void UpdateBoundingBoxSizes(ref BoundingBoxSizes bbs, WorldVertex v) { public static void UpdateBoundingBoxSizes(ref BoundingBoxSizes bbs, WorldVertex v) {
if (v.x < bbs.MinX) if (v.x < bbs.MinX)
bbs.MinX = (short)v.x; bbs.MinX = (short)v.x;

View file

@ -3,7 +3,7 @@ using SlimDX;
namespace CodeImp.DoomBuilder.GZBuilder.Data namespace CodeImp.DoomBuilder.GZBuilder.Data
{ {
public class GZDoomLight { public sealed class GZDoomLight {
public int Type; //holds GZDoomLightType public int Type; //holds GZDoomLightType
public Color3 Color; public Color3 Color;
public int PrimaryRadius; public int PrimaryRadius;
@ -33,6 +33,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
//divide these by 100 to get light color alpha //divide these by 100 to get light color alpha
public enum GZDoomLightRenderStyle : int public enum GZDoomLightRenderStyle : int
{ {
NONE = 0,
NORMAL = 99, NORMAL = 99,
VAVOOM = 50, VAVOOM = 50,
ADDITIVE = 25, ADDITIVE = 25,

View file

@ -3,7 +3,7 @@ using SlimDX;
using SlimDX.Direct3D9; using SlimDX.Direct3D9;
namespace CodeImp.DoomBuilder.GZBuilder.Data { namespace CodeImp.DoomBuilder.GZBuilder.Data {
public class MapInfo { public sealed class MapInfo {
public string Sky1; public string Sky1;
public float Sky1ScrollSpeed; public float Sky1ScrollSpeed;
public string Sky2; public string Sky2;

View file

@ -1,10 +1,11 @@
using SlimDX; using System;
using SlimDX;
using SlimDX.Direct3D9; using SlimDX.Direct3D9;
using CodeImp.DoomBuilder.Rendering; using CodeImp.DoomBuilder.Rendering;
namespace CodeImp.DoomBuilder.GZBuilder.Data namespace CodeImp.DoomBuilder.GZBuilder.Data
{ {
class ThingBoundingBox sealed class ThingBoundingBox : IDisposable
{ {
public VertexBuffer cage; public VertexBuffer cage;
public VertexBuffer arrow; public VertexBuffer arrow;

View file

@ -17,7 +17,7 @@ using CodeImp.DoomBuilder.GZBuilder.Controls;
namespace CodeImp.DoomBuilder.GZBuilder namespace CodeImp.DoomBuilder.GZBuilder
{ {
//mxd. should get rid of this class one day... //mxd. should get rid of this class one day...
public class GZGeneral public static class GZGeneral
{ {
//gzdoom light types //gzdoom light types
private static int[] gzLights = { /* normal lights */ 9800, 9801, 9802, 9803, 9804, /* additive lights */ 9810, 9811, 9812, 9813, 9814, /* negative lights */ 9820, 9821, 9822, 9823, 9824, /* vavoom lights */ 1502, 1503}; private static int[] gzLights = { /* normal lights */ 9800, 9801, 9802, 9803, 9804, /* additive lights */ 9810, 9811, 9812, 9813, 9814, /* negative lights */ 9820, 9821, 9822, 9823, 9824, /* vavoom lights */ 1502, 1503};
@ -39,7 +39,6 @@ namespace CodeImp.DoomBuilder.GZBuilder
private static Docker console; private static Docker console;
#endif #endif
public static void Init() { public static void Init() {
//bind actions //bind actions
General.Actions.BindMethods(typeof(GZGeneral)); General.Actions.BindMethods(typeof(GZGeneral));

View file

@ -64,7 +64,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.ZDoom
} }
} }
name = (name != "" ? "[" + n + "] " + name : "Script " + n); name = (name.Length > 0 ? "[" + n + "] " + name : "Script " + n);
ScriptItem i = new ScriptItem(n, name, startPos, endPos); ScriptItem i = new ScriptItem(n, name, startPos, endPos);
numberedScripts.Add(i); numberedScripts.Add(i);
} }
@ -76,4 +76,4 @@ namespace CodeImp.DoomBuilder.GZBuilder.ZDoom
return true; return true;
} }
} }
} }

View file

@ -9,7 +9,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
public class GZModel { public class GZModel {
public List<Mesh> Meshes; public List<Mesh> Meshes;
public List<Texture> Textures; public List<Texture> Textures;
public byte NUM_MESHES = 0; //can't be greater than 255, can it? public byte NUM_MESHES; //can't be greater than 255, can it?
public Vector3[] BoundingBox; public Vector3[] BoundingBox;
public List<IndexBuffer> Indeces2D; public List<IndexBuffer> Indeces2D;
public List<short> NumIndeces2D; public List<short> NumIndeces2D;

View file

@ -18,7 +18,7 @@ using SlimDX.Direct3D9;
//mxd. Original version taken from here: http://colladadotnet.codeplex.com/SourceControl/changeset/view/40680 //mxd. Original version taken from here: http://colladadotnet.codeplex.com/SourceControl/changeset/view/40680
namespace CodeImp.DoomBuilder.GZBuilder.MD3 namespace CodeImp.DoomBuilder.GZBuilder.MD3
{ {
internal class ModelReader internal static class ModelReader
{ {
public static void Parse(ref ModeldefEntry mde, PK3StructuredReader reader, Device D3DDevice) { public static void Parse(ref ModeldefEntry mde, PK3StructuredReader reader, Device D3DDevice) {
string[] modelNames = new string[mde.ModelNames.Count]; string[] modelNames = new string[mde.ModelNames.Count];

View file

@ -21,29 +21,7 @@ namespace CodeImp.DoomBuilder
{ {
public class Clock public class Clock
{ {
// Disposing
private bool isdisposed = false;
// Disposing
public bool IsDisposed { get { return isdisposed; } }
// Constructor
public Clock(){
// We have no destructor
GC.SuppressFinalize(this);
}
// Disposer
public void Dispose(){
// Not already disposed?
if(!isdisposed) {
isdisposed = true;
}
}
// This queries the system for the current time // This queries the system for the current time
public double GetCurrentTime(){ public double CurrentTime { get { return Configuration.Timer.ElapsedMilliseconds; } }
return SlimDX.Configuration.Timer.ElapsedMilliseconds;
}
} }
} }

View file

@ -936,7 +936,7 @@ namespace CodeImp.DoomBuilder
if(editing != null) editing.Dispose(); editing = null; if(editing != null) editing.Dispose(); editing = null;
if(mainwindow != null) mainwindow.Dispose(); if(mainwindow != null) mainwindow.Dispose();
if(actions != null) actions.Dispose(); if(actions != null) actions.Dispose();
if(clock != null) clock.Dispose(); //if (clock != null) clock.Dispose(); //mxd
if(plugins != null) plugins.Dispose(); if(plugins != null) plugins.Dispose();
if(types != null) types.Dispose(); if(types != null) types.Dispose();
try { D3DDevice.Terminate(); } catch(Exception) { } try { D3DDevice.Terminate(); } catch(Exception) { }

View file

@ -2805,7 +2805,7 @@ namespace CodeImp.DoomBuilder.Map
{ {
Dictionary<uint, List<Sidedef>> storedsides = new Dictionary<uint, List<Sidedef>>(numsidedefs); Dictionary<uint, List<Sidedef>> storedsides = new Dictionary<uint, List<Sidedef>>(numsidedefs);
int originalsidescount = numsidedefs; int originalsidescount = numsidedefs;
double starttime = General.Clock.GetCurrentTime(); double starttime = General.Clock.CurrentTime;
BeginAddRemove(); BeginAddRemove();
@ -2893,7 +2893,7 @@ namespace CodeImp.DoomBuilder.Map
EndAddRemove(); EndAddRemove();
// Output info // Output info
double endtime = General.Clock.GetCurrentTime(); double endtime = General.Clock.CurrentTime;
double deltatimesec = (endtime - starttime) / 1000.0d; double deltatimesec = (endtime - starttime) / 1000.0d;
float ratio = 100.0f - (((float)numsidedefs / (float)originalsidescount) * 100.0f); float ratio = 100.0f - (((float)numsidedefs / (float)originalsidescount) * 100.0f);
General.WriteLogLine("Sidedefs compressed: " + numsidedefs + " remaining out of " + originalsidescount + " (" + ratio.ToString("########0.00") + "%) in " + deltatimesec.ToString("########0.00") + " seconds"); General.WriteLogLine("Sidedefs compressed: " + numsidedefs + " remaining out of " + originalsidescount + " (" + ratio.ToString("########0.00") + "%) in " + deltatimesec.ToString("########0.00") + " seconds");

View file

@ -458,7 +458,7 @@ namespace CodeImp.DoomBuilder.Rendering
// Highlight // Highlight
if(General.Settings.AnimateVisualSelection) if(General.Settings.AnimateVisualSelection)
{ {
double time = General.Clock.GetCurrentTime(); double time = General.Clock.CurrentTime;
highlightglow = (float)Math.Sin(time / 100.0f) * 0.1f + 0.4f; highlightglow = (float)Math.Sin(time / 100.0f) * 0.1f + 0.4f;
//mxd. WHY?! //mxd. WHY?!
//highlightglowinv = -(float)Math.Sin(time / 100.0f) * 0.1f + 0.4f; //highlightglowinv = -(float)Math.Sin(time / 100.0f) * 0.1f + 0.4f;

View file

@ -468,7 +468,7 @@ namespace CodeImp.DoomBuilder.VisualModes
return; return;
} }
double time = General.Clock.GetCurrentTime(); double time = General.Clock.CurrentTime;
float rMin = Math.Min(lightPrimaryRadius, lightSecondaryRadius); float rMin = Math.Min(lightPrimaryRadius, lightSecondaryRadius);
float rMax = Math.Max(lightPrimaryRadius, lightSecondaryRadius); float rMax = Math.Max(lightPrimaryRadius, lightSecondaryRadius);

View file

@ -2765,7 +2765,7 @@ namespace CodeImp.DoomBuilder.Windows
if(!processor.Enabled) if(!processor.Enabled)
{ {
processor.Enabled = true; processor.Enabled = true;
lastupdatetime = General.Clock.GetCurrentTime(); lastupdatetime = General.Clock.CurrentTime;
} }
} }
@ -2791,7 +2791,7 @@ namespace CodeImp.DoomBuilder.Windows
private void processor_Tick(object sender, EventArgs e) private void processor_Tick(object sender, EventArgs e)
{ {
Vector2D deltamouse; Vector2D deltamouse;
double curtime = General.Clock.GetCurrentTime(); double curtime = General.Clock.CurrentTime;
double deltatime = curtime - lastupdatetime; double deltatime = curtime - lastupdatetime;
lastupdatetime = curtime; lastupdatetime = curtime;

View file

@ -392,7 +392,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
flashpolygon = new FlatVertex[s.FlatVertices.Length]; flashpolygon = new FlatVertex[s.FlatVertices.Length];
s.FlatVertices.CopyTo(flashpolygon, 0); s.FlatVertices.CopyTo(flashpolygon, 0);
flashintensity = 1.0f; flashintensity = 1.0f;
flashstarttime = (double)General.Clock.GetCurrentTime(); flashstarttime = (double)General.Clock.CurrentTime;
General.Interface.EnableProcessing(); General.Interface.EnableProcessing();
} }
@ -441,7 +441,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
flashpolygon = new FlatVertex[s.FlatVertices.Length]; flashpolygon = new FlatVertex[s.FlatVertices.Length];
s.FlatVertices.CopyTo(flashpolygon, 0); s.FlatVertices.CopyTo(flashpolygon, 0);
flashintensity = 1.0f; flashintensity = 1.0f;
flashstarttime = (double)General.Clock.GetCurrentTime(); flashstarttime = (double)General.Clock.CurrentTime;
General.Interface.EnableProcessing(); General.Interface.EnableProcessing();
} }
else else
@ -515,7 +515,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(flashpolygon != null) if(flashpolygon != null)
{ {
// Determine the intensity of the flash by time elapsed // Determine the intensity of the flash by time elapsed
double curtime = (double)General.Clock.GetCurrentTime();; double curtime = (double)General.Clock.CurrentTime;;
flashintensity = 1f - (float)((curtime - flashstarttime) / FLASH_DURATION); flashintensity = 1f - (float)((curtime - flashstarttime) / FLASH_DURATION);
if(flashintensity > 0.0f) if(flashintensity > 0.0f)
{ {

View file

@ -561,10 +561,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
} }
// Time to pick a new target? // Time to pick a new target?
if(General.Clock.GetCurrentTime() > (lastpicktime + PICK_INTERVAL)) if(General.Clock.CurrentTime > (lastpicktime + PICK_INTERVAL))
{ {
PickTargetUnlocked(); PickTargetUnlocked();
lastpicktime = General.Clock.GetCurrentTime(); lastpicktime = General.Clock.CurrentTime;
} }
// The mouse is always in motion // The mouse is always in motion

View file

@ -14,6 +14,7 @@ using CodeImp.DoomBuilder.VisualModes;
using CodeImp.DoomBuilder.ColorPicker.Windows; using CodeImp.DoomBuilder.ColorPicker.Windows;
[assembly: CLSCompliant(true)]
namespace CodeImp.DoomBuilder.ColorPicker namespace CodeImp.DoomBuilder.ColorPicker
{ {
public class BuilderPlug : Plug public class BuilderPlug : Plug

View file

@ -5,6 +5,7 @@ using System.Text;
namespace CodeImp.DoomBuilder.ColorPicker { namespace CodeImp.DoomBuilder.ColorPicker {
public enum ColorPickerType : int { public enum ColorPickerType : int {
CP_NONE = 0,
CP_LIGHT = 1, CP_LIGHT = 1,
CP_SECTOR = 2 CP_SECTOR = 2
} }

View file

@ -4,7 +4,7 @@ using System.Drawing.Drawing2D;
using System.Drawing.Imaging; using System.Drawing.Imaging;
namespace CodeImp.DoomBuilder.ColorPicker { namespace CodeImp.DoomBuilder.ColorPicker {
public class ColorWheel : IDisposable { public sealed class ColorWheel : IDisposable {
// These resources should be disposed // These resources should be disposed
// of when you're done with them. // of when you're done with them.

View file

@ -23,7 +23,7 @@ namespace CodeImp.DoomBuilder.ColorPicker.Controls {
public ColorHandler.RGB CurrentColor { get { return RGB; } } public ColorHandler.RGB CurrentColor { get { return RGB; } }
private bool isInUpdate = false; private bool isInUpdate;
private Color startColor; private Color startColor;
//events //events

View file

@ -1,6 +1,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// Управление общими сведениями о сборке осуществляется с помощью // Управление общими сведениями о сборке осуществляется с помощью
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, // набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
@ -34,3 +35,4 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View file

@ -18,7 +18,7 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows {
public partial class LightColorPicker : DelayedForm, IColorPicker { public partial class LightColorPicker : DelayedForm, IColorPicker {
public ColorPickerType Type { get { return ColorPickerType.CP_LIGHT; } } public ColorPickerType Type { get { return ColorPickerType.CP_LIGHT; } }
private static bool RELATIVE_MODE = false; private static bool RELATIVE_MODE;
private static int[] LIGHT_USES_ANGLE_VALUE = { 9801, 9802, 9804, 9811, 9812, 9814, 9821, 9822, 9824 }; private static int[] LIGHT_USES_ANGLE_VALUE = { 9801, 9802, 9804, 9811, 9812, 9814, 9821, 9822, 9824 };
@ -366,4 +366,4 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows {
public int SecondaryRadius; public int SecondaryRadius;
public int Interval; public int Interval;
} }
} }

View file

@ -767,10 +767,10 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
} }
// Time to pick a new target? // Time to pick a new target?
if(General.Clock.GetCurrentTime() > (lastpicktime + PICK_INTERVAL)) if(General.Clock.CurrentTime > (lastpicktime + PICK_INTERVAL))
{ {
PickTargetUnlocked(); PickTargetUnlocked();
lastpicktime = General.Clock.GetCurrentTime(); lastpicktime = General.Clock.CurrentTime;
} }
// The mouse is always in motion // The mouse is always in motion

View file

@ -7,6 +7,7 @@ using CodeImp.DoomBuilder.Controls;
using CodeImp.DoomBuilder.Editing; using CodeImp.DoomBuilder.Editing;
using CodeImp.DoomBuilder.Plugins; using CodeImp.DoomBuilder.Plugins;
[assembly: CLSCompliant(true)]
namespace CodeImp.DoomBuilder.TagExplorer namespace CodeImp.DoomBuilder.TagExplorer
{ {
public sealed class BuilderPlug : Plug public sealed class BuilderPlug : Plug

View file

@ -450,10 +450,10 @@ namespace CodeImp.DoomBuilder.TagExplorer
pos++; pos++;
} }
if (token != "") { if (token.Length > 0) {
int result = -1; int result = -1;
int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out result); if(int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out result))
return result; return result;
} }
return -1; return -1;
@ -643,6 +643,7 @@ namespace CodeImp.DoomBuilder.TagExplorer
e.CancelEdit = true; e.CancelEdit = true;
return; return;
} }
treeView.MouseLeave -= treeView_MouseLeave;
} }
//map should be in UDMF format, or we wouldn't be here //map should be in UDMF format, or we wouldn't be here
@ -664,6 +665,7 @@ namespace CodeImp.DoomBuilder.TagExplorer
e.Node.Text = info.GetName(ref comment, currentSortMode); e.Node.Text = info.GetName(ref comment, currentSortMode);
e.Node.ForeColor = Color.Black; e.Node.ForeColor = Color.Black;
} }
treeView.MouseLeave += new EventHandler(treeView_MouseLeave);
} }
private void treeView_MouseLeave(object sender, EventArgs e) { private void treeView_MouseLeave(object sender, EventArgs e) {

View file

@ -16,22 +16,13 @@ namespace CodeImp.DoomBuilder.TagExplorer
private int index; private int index;
private int action; private int action;
private int tag; private int tag;
private int thingType;
private string defaultName; private string defaultName;
public int Index { get { return index; } } public int Index { get { return index; } }
public int Tag { get { return tag; } } public int Tag { get { return tag; } }
public int Action { get { return action; } } public int Action { get { return action; } }
public int ThingType {
get {
if (type != NodeInfoType.THING)
throw new Exception("Error: ThingType property accessed in " + type.ToString() + " node!");
return thingType;
}
}
public NodeInfoType Type { get { return type; } } public NodeInfoType Type { get { return type; } }
public string Comment { get { return getComment(); } set { setComment(value); } } public string Comment { get { return getComment(); } set { setComment(value); } }
public string DefaultName { get { return defaultName; } }
//constructor //constructor
public NodeInfo(Thing t) { public NodeInfo(Thing t) {
@ -39,7 +30,6 @@ namespace CodeImp.DoomBuilder.TagExplorer
index = t.Index; index = t.Index;
action = t.Action; action = t.Action;
tag = t.Tag; tag = t.Tag;
thingType = t.Type;
ThingTypeInfo tti = General.Map.Data.GetThingInfoEx(t.Type); ThingTypeInfo tti = General.Map.Data.GetThingInfoEx(t.Type);
defaultName = (tti != null ? tti.Title : NodeInfoDefaultName.THING); defaultName = (tti != null ? tti.Title : NodeInfoDefaultName.THING);
} }
@ -77,37 +67,11 @@ namespace CodeImp.DoomBuilder.TagExplorer
return l.Fields; return l.Fields;
} }
public Vector2D GetPosition() {
switch (type){
case NodeInfoType.THING:
Thing t = General.Map.Map.GetThingByIndex(index);
if (t != null) return new Vector2D(t.Position.x, t.Position.y);
return new Vector2D();
break;
case NodeInfoType.SECTOR:
Sector s = General.Map.Map.GetSectorByIndex(index);
if (s != null) return new Vector2D(s.BBox.Location.X + s.BBox.Width / 2, s.BBox.Location.Y + s.BBox.Height / 2);
return new Vector2D();
break;
case NodeInfoType.LINEDEF:
Linedef l = General.Map.Map.GetLinedefByIndex(index);
if (l != null) return new Vector2D(l.Rect.Location.X + l.Rect.Width / 2, l.Rect.Location.Y + l.Rect.Height / 2);
return new Vector2D();
break;
default:
return new Vector2D();
break;
}
}
//comment //comment
private void setComment(string comment) { private void setComment(string comment) {
UniFields fields = getFields(); UniFields fields = getFields();
if (comment == "") { if (comment.Length == 0) {
if (fields.ContainsKey("comment")) { if (fields.ContainsKey("comment")) {
General.Map.UndoRedo.CreateUndo("Remove comment"); General.Map.UndoRedo.CreateUndo("Remove comment");
fields.BeforeFieldsChange(); fields.BeforeFieldsChange();
@ -159,7 +123,7 @@ namespace CodeImp.DoomBuilder.TagExplorer
comment = t.Fields["comment"].Value.ToString(); comment = t.Fields["comment"].Value.ToString();
isDefaultName = false; isDefaultName = false;
} }
return combineName(comment == "" ? defaultName : comment, t.Tag, t.Action, t.Index, sortMode, isDefaultName); return combineName(comment.Length == 0 ? defaultName : comment, t.Tag, t.Action, t.Index, sortMode, isDefaultName);
} }
private string getSectorName(Sector s, ref string comment, string sortMode) { private string getSectorName(Sector s, ref string comment, string sortMode) {
@ -169,7 +133,7 @@ namespace CodeImp.DoomBuilder.TagExplorer
comment = s.Fields["comment"].Value.ToString(); comment = s.Fields["comment"].Value.ToString();
isDefaultName = false; isDefaultName = false;
} }
return combineName(comment == "" ? NodeInfoDefaultName.SECTOR : comment, s.Tag, s.Effect, s.FixedIndex, sortMode, isDefaultName); return combineName(comment.Length == 0 ? NodeInfoDefaultName.SECTOR : comment, s.Tag, s.Effect, s.FixedIndex, sortMode, isDefaultName);
} }
private string getLinedefName(Linedef l, ref string comment, string sortMode) { private string getLinedefName(Linedef l, ref string comment, string sortMode) {
@ -179,7 +143,7 @@ namespace CodeImp.DoomBuilder.TagExplorer
comment = l.Fields["comment"].Value.ToString(); comment = l.Fields["comment"].Value.ToString();
isDefaultName = false; isDefaultName = false;
} }
return combineName(comment == "" ? NodeInfoDefaultName.LINEDEF : comment, l.Tag, l.Action, l.Index, sortMode, isDefaultName); return combineName(comment.Length == 0 ? NodeInfoDefaultName.LINEDEF : comment, l.Tag, l.Action, l.Index, sortMode, isDefaultName);
} }
private string combineName(string name, int tag, int action, int index, string sortMode, bool isDefaultName) { private string combineName(string name, int tag, int action, int index, string sortMode, bool isDefaultName) {

View file

@ -1,6 +1,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// Управление общими сведениями о сборке осуществляется с помощью // Управление общими сведениями о сборке осуществляется с помощью
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, // набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
@ -34,3 +35,4 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View file

@ -9,6 +9,7 @@ using CodeImp.DoomBuilder.Actions;
using CodeImp.DoomBuilder.Windows; using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.VisualModes; using CodeImp.DoomBuilder.VisualModes;
[assembly: CLSCompliant(true)]
namespace CodeImp.DoomBuilder.UDMFControls namespace CodeImp.DoomBuilder.UDMFControls
{ {
public sealed class BuilderPlug: Plug { public sealed class BuilderPlug: Plug {

View file

@ -49,7 +49,6 @@ namespace CodeImp.DoomBuilder.UDMFControls
penRed = new Pen(Color.Red, 2.0f); penRed = new Pen(Color.Red, 2.0f);
center = new Point(panelAngleControl.Width / 2, panelAngleControl.Height / 2); center = new Point(panelAngleControl.Width / 2, panelAngleControl.Height / 2);
needleLength = center.X - 4; needleLength = center.X - 4;
angle = 0;
//events //events
panelAngleControl.MouseDown += new MouseEventHandler(panelAngleControl_MouseDown); panelAngleControl.MouseDown += new MouseEventHandler(panelAngleControl_MouseDown);
@ -144,4 +143,4 @@ namespace CodeImp.DoomBuilder.UDMFControls
update(); update();
} }
} }
} }

View file

@ -6,6 +6,7 @@ using System.Data;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Globalization;
namespace CodeImp.DoomBuilder.UDMFControls namespace CodeImp.DoomBuilder.UDMFControls
{ {
@ -56,8 +57,8 @@ namespace CodeImp.DoomBuilder.UDMFControls
trackBar1.Minimum = (int)(min * 10); trackBar1.Minimum = (int)(min * 10);
trackBar1.Maximum = (int)(max * 10); trackBar1.Maximum = (int)(max * 10);
labelMin.Text = min.ToString(); labelMin.Text = min.ToString(CultureInfo.InvariantCulture);
labelMax.Text = max.ToString(); labelMax.Text = max.ToString(CultureInfo.InvariantCulture);
numericUpDown1.Value = (decimal)General.Clamp((float)numericUpDown1.Value, min, max); numericUpDown1.Value = (decimal)General.Clamp((float)numericUpDown1.Value, min, max);

View file

@ -6,6 +6,7 @@ using System.Data;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Globalization;
namespace CodeImp.DoomBuilder.UDMFControls namespace CodeImp.DoomBuilder.UDMFControls
{ {
@ -56,8 +57,8 @@ namespace CodeImp.DoomBuilder.UDMFControls
trackBar1.Minimum = min; trackBar1.Minimum = min;
trackBar1.Maximum = max; trackBar1.Maximum = max;
labelMin.Text = min.ToString(); labelMin.Text = min.ToString(CultureInfo.InvariantCulture);
labelMax.Text = max.ToString(); labelMax.Text = max.ToString(CultureInfo.InvariantCulture);
numericUpDown1.Value = General.Clamp((int)numericUpDown1.Value, min, max); numericUpDown1.Value = General.Clamp((int)numericUpDown1.Value, min, max);
numericUpDown1.Minimum = min; numericUpDown1.Minimum = min;

View file

@ -7,12 +7,13 @@ using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using CodeImp.DoomBuilder.Geometry; using CodeImp.DoomBuilder.Geometry;
using System.Globalization;
namespace CodeImp.DoomBuilder.UDMFControls namespace CodeImp.DoomBuilder.UDMFControls
{ {
public partial class PositionControl : UserControl public partial class PositionControl : UserControl
{ {
private static int stepSize = 0; private static int stepSize;
private bool blockEvents; private bool blockEvents;
public event EventHandler OnValueChanged; public event EventHandler OnValueChanged;
@ -43,7 +44,7 @@ namespace CodeImp.DoomBuilder.UDMFControls
delta = new Vector2D(); delta = new Vector2D();
InitializeComponent(); InitializeComponent();
trackBar1.Value = stepSize; trackBar1.Value = stepSize;
labelStepSize.Text = stepSize == 0 ? "1" : stepSize.ToString(); labelStepSize.Text = stepSize == 0 ? "1" : stepSize.ToString(CultureInfo.InvariantCulture);
} }
//events //events
private void nudX_ValueChanged(object sender, EventArgs e) { private void nudX_ValueChanged(object sender, EventArgs e) {
@ -69,4 +70,4 @@ namespace CodeImp.DoomBuilder.UDMFControls
labelStepSize.Text = nudX.Increment.ToString(); labelStepSize.Text = nudX.Increment.ToString();
} }
} }
} }

View file

@ -1,6 +1,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// Управление общими сведениями о сборке осуществляется с помощью // Управление общими сведениями о сборке осуществляется с помощью
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, // набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
@ -34,3 +35,4 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View file

@ -12,6 +12,7 @@ using CodeImp.DoomBuilder.VisualModes;
using CodeImp.DoomBuilder.Windows; using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.Geometry; using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Types; using CodeImp.DoomBuilder.Types;
using System.Globalization;
namespace CodeImp.DoomBuilder.UDMFControls namespace CodeImp.DoomBuilder.UDMFControls
{ {
@ -225,13 +226,13 @@ namespace CodeImp.DoomBuilder.UDMFControls
private void setDefaultUniversalProperties(UniFields fields, List<UniversalFieldInfo> defaultFields) { private void setDefaultUniversalProperties(UniFields fields, List<UniversalFieldInfo> defaultFields) {
foreach (UniversalFieldInfo info in defaultFields) { foreach (UniversalFieldInfo info in defaultFields) {
if (!fields.ContainsKey(info.Name)) if (!fields.ContainsKey(info.Name))
fields.Add(info.Name, new UniValue(info.Type, (UniversalType)info.Type == UniversalType.Integer ? (object)Convert.ToInt32(info.Default) : info.Default)); fields.Add(info.Name, new UniValue(info.Type, (UniversalType)info.Type == UniversalType.Integer ? (object)Convert.ToInt32(info.Default, CultureInfo.InvariantCulture) : info.Default));
} }
} }
private void removeDefaultUniversalProperties(UniFields fields, List<UniversalFieldInfo> defaultFields) { private void removeDefaultUniversalProperties(UniFields fields, List<UniversalFieldInfo> defaultFields) {
foreach (UniversalFieldInfo info in defaultFields) { foreach (UniversalFieldInfo info in defaultFields) {
if (fields.ContainsKey(info.Name) && fields[info.Name].Value.Equals((UniversalType)info.Type == UniversalType.Integer ? (object)Convert.ToInt32(info.Default) : info.Default)) if (fields.ContainsKey(info.Name) && fields[info.Name].Value.Equals((UniversalType)info.Type == UniversalType.Integer ? (object)Convert.ToInt32(info.Default, CultureInfo.InvariantCulture) : info.Default))
fields.Remove(info.Name); fields.Remove(info.Name);
} }
} }