mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 14:31:50 +00:00
Visual Mode, UDMF: Change texture scale actions now try to change scale by one texture/sprite pixel at a time. Action info now also shows scaled texture/sprite size.
Info panels: float values are now formatted regardless of current CultureInfo (e.g. decimal separator is now always dot). Also, they are no longer clamped to 2 decimal places. Updated ZDoom_ACS.cfg.
This commit is contained in:
parent
f60dc25d9f
commit
52ab917179
16 changed files with 75 additions and 73 deletions
|
@ -390,7 +390,7 @@ keywords
|
|||
SetPointer = "bool SetPointer(int assign_slot, int tid[, int pointer_selector[, int flags]])\nSet the value of one of the caller's stored pointers.";
|
||||
SetResultValue = "void SetResultValue(int value)";
|
||||
SetSkyScrollSpeed = "void SetSkyScrollSpeed(int sky, fixed skyspeed)\nChanges the scrolling speed of a sky.\nThis is useful in conjunction with ChangeSky.\nsky: either 1 or 2.\nskyspeed: the desired scrolling speed.";
|
||||
SetTeleFog = "void SetTeleFog(int tid, str telefogsrcclass, str telefogdestclass";
|
||||
SetActorTeleFog = "void SetActorTeleFog(int tid, str telefogsrcclass, str telefogdestclass";
|
||||
SetThingSpecial = "void SetThingSpecial(int tid, int special[, int arg0[, int arg1[, int arg2[, int arg3[, int arg4]]]]])\nSets the special for any things with the same TID.\nThis is similar to Thing_SetSpecial, except it can only be used from ACS,\nand it can set all of a thing's special arguments.\nIf tid is 0, then the activator is used.";
|
||||
SetUserArray = "void SetUserArray(int tid, str name, int pos, int value)\nSets one of the affected actor's user array-bound variables.";
|
||||
SetUserCVar = "bool SetUserCVar(int playernumber, str cvar, int value)\nSets the console variable of a particular player.\nOnly mod-defined console variables through CVARINFO can be changed by using this function.\nReturns FALSE if cvar is invalid, it is not writable, or the player doesn't exist.";
|
||||
|
@ -430,7 +430,7 @@ keywords
|
|||
StrParam = "int StrParam(type:expression)\nStrParam will create a new string formatted based upon the same method for Print or Log.\nThe return value is the string table index of the new string.";
|
||||
StrRight = "str StrRight(str string, int length)\nCreates a new string containing the length last characters of string.\nIf string does not exist, an empty string is returned.\nIf string is shorter than length characters, the entire string is returned.";
|
||||
Suspend = "Suspend";
|
||||
SwapTeleFog = "int SwapTeleFog(int tid)";
|
||||
SwapActorTeleFog = "int SwapActorTeleFog(int tid)";
|
||||
Switch = "Switch(expression)";
|
||||
TagWait = "void TagWait(int tag)";
|
||||
TakeActorInventory = "void TakeActorInventory(int tid, str inventory_item, int amount)\nThis function will take the amount of items from the specified actor.\nTakeActorInventory can remove items that are flagged as undroppable.";
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Tools;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
|
@ -481,7 +482,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
if(x != defaultvalue || y != defaultvalue)
|
||||
{
|
||||
valuelabel.Text = String.Format("{0:0.##}", x) + ", " + String.Format("{0:0.##}", y);
|
||||
valuelabel.Text = x.ToString(CultureInfo.InvariantCulture) + ", " + y.ToString(CultureInfo.InvariantCulture);
|
||||
valuelabel.Enabled = true;
|
||||
namelabel.Enabled = true;
|
||||
return true;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
@ -188,7 +189,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
showExtededCeilingInfo = true;
|
||||
ceilingOffset.Enabled = true;
|
||||
ceilingOffsetLabel.Enabled = true;
|
||||
ceilingOffset.Text = String.Format("{0:0.##}", panX) + ", " + String.Format("{0:0.##}", panY);
|
||||
ceilingOffset.Text = panX.ToString(CultureInfo.InvariantCulture) + ", " + panY.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -206,7 +207,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
showExtededFloorInfo = true;
|
||||
floorOffset.Enabled = true;
|
||||
floorOffsetLabel.Enabled = true;
|
||||
floorOffset.Text = String.Format("{0:0.##}", panX) + ", " + String.Format("{0:0.##}", panY);
|
||||
floorOffset.Text = panX.ToString(CultureInfo.InvariantCulture) + ", " + panY.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -216,7 +217,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
//ceiling scale
|
||||
float scaleX = s.Fields.GetValue("xscaleceiling", 1.0f);//1.0f;
|
||||
float scaleX = s.Fields.GetValue("xscaleceiling", 1.0f);
|
||||
float scaleY = s.Fields.GetValue("yscaleceiling", 1.0f);
|
||||
|
||||
if(scaleX != 1.0f || scaleY != 1.0f)
|
||||
|
@ -224,7 +225,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
showExtededCeilingInfo = true;
|
||||
ceilingScale.Enabled = true;
|
||||
ceilingScaleLabel.Enabled = true;
|
||||
ceilingScale.Text = String.Format("{0:0.##}", scaleX) + ", " + String.Format("{0:0.##}", scaleY);
|
||||
ceilingScale.Text = scaleX.ToString(CultureInfo.InvariantCulture) + ", " + scaleY.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -242,7 +243,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
showExtededFloorInfo = true;
|
||||
floorScale.Enabled = true;
|
||||
floorScaleLabel.Enabled = true;
|
||||
floorScale.Text = String.Format("{0:0.##}", scaleX) + ", " + String.Format("{0:0.##}", scaleY);
|
||||
floorScale.Text = scaleX.ToString(CultureInfo.InvariantCulture) + ", " + scaleY.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
|
@ -94,7 +95,6 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if(ti.AbsoluteZ)
|
||||
{
|
||||
zvalue = t.Position.z;
|
||||
zinfo = zvalue.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -104,20 +104,18 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if(ti.Hangs)
|
||||
{
|
||||
zvalue = t.Sector.CeilHeight - t.Position.z - ti.Height; //mxd
|
||||
zinfo = zvalue.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
zvalue = t.Sector.FloorHeight + t.Position.z;
|
||||
zinfo = zvalue.ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
zvalue = t.Position.z;
|
||||
if(zvalue >= 0.0f) zinfo = "+" + zvalue; else zinfo = zvalue.ToString();
|
||||
}
|
||||
}
|
||||
zinfo = zvalue.ToString(CultureInfo.InvariantCulture); //mxd
|
||||
|
||||
// Thing info
|
||||
infopanel.Text = " Thing " + t.Index + " ";
|
||||
|
@ -126,7 +124,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
labelclass.Enabled = !string.IsNullOrEmpty(ti.ClassName); //mxd
|
||||
classname.Enabled = labelclass.Enabled; //mxd
|
||||
classname.Text = (!string.IsNullOrEmpty(ti.ClassName) ? ti.ClassName : "--"); //mxd
|
||||
position.Text = t.Position.x + ", " + t.Position.y + ", " + zinfo;
|
||||
position.Text = t.Position.x.ToString(CultureInfo.InvariantCulture) + ", " + t.Position.y.ToString(CultureInfo.InvariantCulture) + ", " + zinfo;
|
||||
tag.Text = t.Tag + (General.Map.Options.TagLabels.ContainsKey(t.Tag) ? " - " + General.Map.Options.TagLabels[t.Tag] : string.Empty);
|
||||
angle.Text = t.AngleDoom + "\u00B0";
|
||||
anglecontrol.Angle = t.AngleDoom;
|
||||
|
|
6
Source/Core/Controls/VertexInfoPanel.Designer.cs
generated
6
Source/Core/Controls/VertexInfoPanel.Designer.cs
generated
|
@ -57,7 +57,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.vertexinfo.Controls.Add(label1);
|
||||
this.vertexinfo.Location = new System.Drawing.Point(0, 0);
|
||||
this.vertexinfo.Name = "vertexinfo";
|
||||
this.vertexinfo.Size = new System.Drawing.Size(163, 100);
|
||||
this.vertexinfo.Size = new System.Drawing.Size(200, 100);
|
||||
this.vertexinfo.TabIndex = 0;
|
||||
this.vertexinfo.TabStop = false;
|
||||
this.vertexinfo.Text = " Vertex ";
|
||||
|
@ -85,7 +85,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// labelCeilingOffset
|
||||
//
|
||||
this.labelCeilingOffset.AutoSize = true;
|
||||
this.labelCeilingOffset.Location = new System.Drawing.Point(7, 3);
|
||||
this.labelCeilingOffset.Location = new System.Drawing.Point(5, 3);
|
||||
this.labelCeilingOffset.Name = "labelCeilingOffset";
|
||||
this.labelCeilingOffset.Size = new System.Drawing.Size(70, 13);
|
||||
this.labelCeilingOffset.TabIndex = 4;
|
||||
|
@ -103,7 +103,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// labelFloorOffset
|
||||
//
|
||||
this.labelFloorOffset.AutoSize = true;
|
||||
this.labelFloorOffset.Location = new System.Drawing.Point(14, 26);
|
||||
this.labelFloorOffset.Location = new System.Drawing.Point(12, 26);
|
||||
this.labelFloorOffset.Name = "labelFloorOffset";
|
||||
this.labelFloorOffset.Size = new System.Drawing.Size(62, 13);
|
||||
this.labelFloorOffset.TabIndex = 5;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#region ================== Namespaces
|
||||
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
|
||||
|
@ -37,14 +38,14 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
// Vertex info
|
||||
vertexinfo.Text = " Vertex " + v.Index + " ";
|
||||
position.Text = v.Position.x.ToString("0.##") + ", " + v.Position.y.ToString("0.##");
|
||||
position.Text = v.Position.x.ToString(CultureInfo.InvariantCulture) + ", " + v.Position.y.ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
//mxd. Height offsets
|
||||
if(General.Map.UDMF)
|
||||
{
|
||||
if(!float.IsNaN(v.ZCeiling))
|
||||
{
|
||||
zceiling.Text = v.ZCeiling.ToString("0.##");
|
||||
zceiling.Text = v.ZCeiling.ToString(CultureInfo.InvariantCulture);
|
||||
zceiling.Enabled = true;
|
||||
labelCeilingOffset.Enabled = true;
|
||||
}
|
||||
|
@ -55,7 +56,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
if(!float.IsNaN(v.ZFloor))
|
||||
{
|
||||
zfloor.Text = v.ZFloor.ToString("0.##");
|
||||
zfloor.Text = v.ZFloor.ToString(CultureInfo.InvariantCulture);
|
||||
zfloor.Enabled = true;
|
||||
labelFloorOffset.Enabled = true;
|
||||
}
|
||||
|
|
4
Source/Core/Windows/VertexEditForm.Designer.cs
generated
4
Source/Core/Windows/VertexEditForm.Designer.cs
generated
|
@ -153,7 +153,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new System.Drawing.Point(71, 37);
|
||||
label2.Location = new System.Drawing.Point(68, 37);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new System.Drawing.Size(111, 13);
|
||||
label2.TabIndex = 26;
|
||||
|
@ -162,7 +162,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new System.Drawing.Point(63, 5);
|
||||
label3.Location = new System.Drawing.Point(60, 5);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new System.Drawing.Size(119, 13);
|
||||
label3.TabIndex = 27;
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
// This changes the height
|
||||
protected abstract void ChangeHeight(int amount);
|
||||
protected abstract void ChangeTextureScale(float incrementX, float incrementY); //mxd
|
||||
protected abstract void ChangeTextureScale(int incrementX, int incrementY); //mxd
|
||||
public virtual void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight) { } //mxd
|
||||
|
||||
// This swaps triangles so that the plane faces the other way
|
||||
|
@ -895,9 +895,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
//mxd
|
||||
public virtual void OnChangeScale(float incrementX, float incrementY)
|
||||
public virtual void OnChangeScale(int incrementX, int incrementY)
|
||||
{
|
||||
if(!General.Map.UDMF) return;
|
||||
if(!General.Map.UDMF || !Texture.IsImageLoaded) return;
|
||||
|
||||
if((General.Map.UndoRedo.NextUndo == null) || (General.Map.UndoRedo.NextUndo.TicketID != undoticket))
|
||||
undoticket = mode.CreateUndo("Change texture scale");
|
||||
|
|
|
@ -28,6 +28,7 @@ using CodeImp.DoomBuilder.Map;
|
|||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using System.Globalization;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -1451,9 +1452,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
//mxd
|
||||
public virtual void OnChangeScale(float incrementX, float incrementY)
|
||||
public virtual void OnChangeScale(int incrementX, int incrementY)
|
||||
{
|
||||
if(!General.Map.UDMF) return;
|
||||
if(!General.Map.UDMF || !Texture.IsImageLoaded) return;
|
||||
|
||||
if((General.Map.UndoRedo.NextUndo == null) || (General.Map.UndoRedo.NextUndo.TicketID != undoticket))
|
||||
undoticket = mode.CreateUndo("Change wall scale");
|
||||
|
@ -1488,27 +1489,25 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
Sidedef.Fields.BeforeFieldsChange();
|
||||
|
||||
if(incrementX != 0)
|
||||
if(incrementX != 0)
|
||||
{
|
||||
if(scaleX + incrementX == 0)
|
||||
scaleX *= -1;
|
||||
else
|
||||
scaleX += incrementX;
|
||||
float pix = (int)Math.Round(Texture.Width * scaleX) + incrementX;
|
||||
float newscaleX = (float)Math.Round(pix / Texture.Width, 3);
|
||||
scaleX = (newscaleX == 0 ? scaleX * -1 : newscaleX);
|
||||
UDMFTools.SetFloat(Sidedef.Fields, keyX, scaleX, 1.0f);
|
||||
}
|
||||
|
||||
if(incrementY != 0)
|
||||
{
|
||||
if(scaleY + incrementY == 0)
|
||||
scaleY *= -1;
|
||||
else
|
||||
scaleY += incrementY;
|
||||
float pix = (int)Math.Round(Texture.Height * scaleY) + incrementY;
|
||||
float newscaleY = (float)Math.Round(pix / Texture.Height, 3);
|
||||
scaleY = (newscaleY == 0 ? scaleY * -1 : newscaleY);
|
||||
UDMFTools.SetFloat(Sidedef.Fields, keyY, scaleY, 1.0f);
|
||||
}
|
||||
|
||||
//update geometry
|
||||
Setup();
|
||||
mode.SetActionResult("Wall scale changed to " + scaleX + ", " + scaleY);
|
||||
mode.SetActionResult("Wall scale changed to " + scaleX.ToString("F03", CultureInfo.InvariantCulture) + ", " + scaleY.ToString("F03", CultureInfo.InvariantCulture) + " (" + (int)Math.Round(Texture.Width / scaleX) + " x " + (int)Math.Round(Texture.Height / scaleY) + ").");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -2666,7 +2666,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
PreAction(UndoGroup.TextureScaleChange);
|
||||
List<IVisualEventReceiver> objs = GetSelectedObjects(true, true, true, false);
|
||||
foreach(IVisualEventReceiver i in objs) i.OnChangeScale(-0.1f, 0);
|
||||
foreach(IVisualEventReceiver i in objs) i.OnChangeScale(-1, 0);
|
||||
PostAction();
|
||||
}
|
||||
|
||||
|
@ -2676,7 +2676,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
PreAction(UndoGroup.TextureScaleChange);
|
||||
List<IVisualEventReceiver> objs = GetSelectedObjects(true, true, true, false);
|
||||
foreach(IVisualEventReceiver i in objs) i.OnChangeScale(0.1f, 0);
|
||||
foreach(IVisualEventReceiver i in objs) i.OnChangeScale(1, 0);
|
||||
PostAction();
|
||||
}
|
||||
|
||||
|
@ -2686,7 +2686,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
PreAction(UndoGroup.TextureScaleChange);
|
||||
List<IVisualEventReceiver> objs = GetSelectedObjects(true, true, true, false);
|
||||
foreach(IVisualEventReceiver i in objs) i.OnChangeScale(0, 0.1f);
|
||||
foreach(IVisualEventReceiver i in objs) i.OnChangeScale(0, 1);
|
||||
PostAction();
|
||||
}
|
||||
|
||||
|
@ -2696,7 +2696,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
PreAction(UndoGroup.TextureScaleChange);
|
||||
List<IVisualEventReceiver> objs = GetSelectedObjects(true, true, true, false);
|
||||
foreach(IVisualEventReceiver i in objs) i.OnChangeScale(0, -0.1f);
|
||||
foreach(IVisualEventReceiver i in objs) i.OnChangeScale(0, -1);
|
||||
PostAction();
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
|
@ -578,29 +579,32 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
//mxd
|
||||
public virtual void OnChangeScale(float incrementX, float incrementY)
|
||||
public virtual void OnChangeScale(int incrementX, int incrementY)
|
||||
{
|
||||
if(!General.Map.UDMF) return;
|
||||
if(!General.Map.UDMF || !sprite.IsImageLoaded) return;
|
||||
|
||||
if((General.Map.UndoRedo.NextUndo == null) || (General.Map.UndoRedo.NextUndo.TicketID != undoticket))
|
||||
undoticket = mode.CreateUndo("Change thing scale");
|
||||
|
||||
float sx = Thing.ScaleX;
|
||||
float sy = Thing.ScaleY;
|
||||
float scaleX = Thing.ScaleX;
|
||||
float scaleY = Thing.ScaleY;
|
||||
|
||||
if(incrementX != 0)
|
||||
{
|
||||
if(sx - incrementX == 0) sx *= -1;
|
||||
else sx -= incrementX;
|
||||
float pix = (int)Math.Round(sprite.Width * scaleX) + incrementX;
|
||||
float newscaleX = (float)Math.Round(pix / sprite.Width, 3);
|
||||
scaleX = (newscaleX == 0 ? scaleX * -1 : newscaleX);
|
||||
}
|
||||
|
||||
if(incrementY != 0)
|
||||
{
|
||||
if(sy + incrementY == 0) sy *= -1;
|
||||
else sy += incrementY;
|
||||
float pix = (int)Math.Round(sprite.Height * scaleY) + incrementY;
|
||||
float newscaleY = (float)Math.Round(pix / sprite.Height, 3);
|
||||
scaleY = (newscaleY == 0 ? scaleY * -1 : newscaleY);
|
||||
}
|
||||
|
||||
Thing.SetScale((float)Math.Round(sx, 3), (float)Math.Round(sy, 3));
|
||||
mode.SetActionResult("Changed thing scale to " + Thing.ScaleX + ", " + Thing.ScaleY + ".");
|
||||
Thing.SetScale(scaleX, scaleY);
|
||||
mode.SetActionResult("Changed thing scale to " + scaleX.ToString("F03", CultureInfo.InvariantCulture) + ", " + scaleY.ToString("F03", CultureInfo.InvariantCulture) + " (" + (int)Math.Round(sprite.Width * scaleX) + " x " + (int)Math.Round(sprite.Height * scaleY) + ").");
|
||||
|
||||
// Update what must be updated
|
||||
this.Changed = true;
|
||||
|
|
|
@ -231,7 +231,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
public virtual void OnMouseMove(MouseEventArgs e) { }
|
||||
public virtual void OnChangeTargetBrightness(bool up) { }
|
||||
public virtual void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection) { }
|
||||
public virtual void OnChangeScale(float incrementX, float incrementY) { }
|
||||
public virtual void OnChangeScale(int incrementX, int incrementY) { }
|
||||
public virtual void OnSelectTexture() { }
|
||||
public virtual void OnCopyTexture() { }
|
||||
public virtual void OnPasteTexture() { }
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
void OnChangeTargetHeight(int amount);
|
||||
void OnChangeTargetBrightness(bool up);
|
||||
void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection);
|
||||
void OnChangeScale(float incrementX, float incrementY); //mxd
|
||||
void OnChangeScale(int incrementX, int incrementY); //mxd
|
||||
void OnResetTextureOffset();
|
||||
void OnResetLocalTextureOffset(); //mxd. This should reset upper/middle/lower offsets (UDMF only)
|
||||
void OnSelectTexture();
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
public void OnChangeTargetHeight(int amount) { }
|
||||
public void OnChangeTargetBrightness(bool up) { }
|
||||
public void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection) { }
|
||||
public virtual void OnChangeScale(float incrementX, float incrementY) { } //mxd
|
||||
public virtual void OnChangeScale(int incrementX, int incrementY) { } //mxd
|
||||
public void OnResetTextureOffset() { }
|
||||
public void OnResetLocalTextureOffset() { } //mxd
|
||||
public void OnSelectTexture() { }
|
||||
|
|
|
@ -20,6 +20,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
|
@ -201,7 +202,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
//mxd. Texture scale change
|
||||
protected override void ChangeTextureScale(float incrementX, float incrementY)
|
||||
protected override void ChangeTextureScale(int incrementX, int incrementY)
|
||||
{
|
||||
Sector s = GetControlSector();
|
||||
float scaleX = s.Fields.GetValue("xscaleceiling", 1.0f);
|
||||
|
@ -211,19 +212,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
if(incrementX != 0)
|
||||
{
|
||||
if(scaleX + incrementX == 0)
|
||||
scaleX *= -1;
|
||||
else
|
||||
scaleX += incrementX;
|
||||
float pix = (int)Math.Round(Texture.Width * scaleX) + incrementX;
|
||||
float newscaleX = (float)Math.Round(pix / Texture.Width, 3);
|
||||
scaleX = (newscaleX == 0 ? scaleX * -1 : newscaleX);
|
||||
UDMFTools.SetFloat(s.Fields, "xscaleceiling", scaleX, 1.0f);
|
||||
}
|
||||
|
||||
if(incrementY != 0)
|
||||
{
|
||||
if(scaleY + incrementY == 0)
|
||||
scaleY *= -1;
|
||||
else
|
||||
scaleY += incrementY;
|
||||
float pix = (int)Math.Round(Texture.Height * scaleY) + incrementY;
|
||||
float newscaleY = (float)Math.Round(pix / Texture.Height, 3);
|
||||
scaleY = (newscaleY == 0 ? scaleY * -1 : newscaleY);
|
||||
UDMFTools.SetFloat(s.Fields, "yscaleceiling", scaleY, 1.0f);
|
||||
}
|
||||
|
||||
|
@ -238,7 +237,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
Sector.Sector.UpdateCache();
|
||||
}
|
||||
|
||||
mode.SetActionResult("Ceiling scale changed to " + scaleX + ", " + scaleY);
|
||||
mode.SetActionResult("Ceiling scale changed to " + scaleX.ToString("F03", CultureInfo.InvariantCulture) + ", " + scaleY.ToString("F03", CultureInfo.InvariantCulture) + " (" + (int)Math.Round(Texture.Width / scaleX) + " x " + (int)Math.Round(Texture.Height / scaleY) + ").");
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
|
|
@ -20,6 +20,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
|
@ -203,7 +204,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
//mxd. Texture scale change
|
||||
protected override void ChangeTextureScale(float incrementX, float incrementY)
|
||||
protected override void ChangeTextureScale(int incrementX, int incrementY)
|
||||
{
|
||||
Sector s = GetControlSector();
|
||||
float scaleX = s.Fields.GetValue("xscalefloor", 1.0f);
|
||||
|
@ -213,19 +214,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
if(incrementX != 0)
|
||||
{
|
||||
if(scaleX + incrementX == 0)
|
||||
scaleX *= -1;
|
||||
else
|
||||
scaleX += incrementX;
|
||||
float pix = (int)Math.Round(Texture.Width * scaleX) + incrementX;
|
||||
float newscaleX = (float)Math.Round(pix / Texture.Width, 3);
|
||||
scaleX = (newscaleX == 0 ? scaleX * -1 : newscaleX);
|
||||
UDMFTools.SetFloat(s.Fields, "xscalefloor", scaleX, 1.0f);
|
||||
}
|
||||
|
||||
if(incrementY != 0)
|
||||
{
|
||||
if(scaleY + incrementY == 0)
|
||||
scaleY *= -1;
|
||||
else
|
||||
scaleY += incrementY;
|
||||
float pix = (int)Math.Round(Texture.Height * scaleY) + incrementY;
|
||||
float newscaleY = (float)Math.Round(pix / Texture.Height, 3);
|
||||
scaleY = (newscaleY == 0 ? scaleY * -1 : newscaleY);
|
||||
UDMFTools.SetFloat(s.Fields, "yscalefloor", scaleY, 1.0f);
|
||||
}
|
||||
|
||||
|
@ -240,7 +239,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
Sector.Sector.UpdateCache();
|
||||
}
|
||||
|
||||
mode.SetActionResult("Floor scale changed to " + scaleX + ", " + scaleY);
|
||||
mode.SetActionResult("Floor scale changed to " + scaleX.ToString("F03", CultureInfo.InvariantCulture) + ", " + scaleY.ToString("F03", CultureInfo.InvariantCulture) + " (" + (int)Math.Round(Texture.Width / scaleX) + " x " + (int)Math.Round(Texture.Height / scaleY) + ").");
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
|
Loading…
Reference in a new issue