mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-17 01:22:18 +00:00
Visual mode: "Reset Texture Offsets" now resets "global" texture offsets in all map formats.
Visual mode: added "Reset Local Texture Offsets (UDMF)" action (default key is Ctrl-Shift-R). It will reset upper/middle/lower texture offsets in UDMF and will act exactly as "Reset Texture Offsets" action in other map formats.
This commit is contained in:
parent
3f66656b3b
commit
0c1c44c14b
10 changed files with 58 additions and 9 deletions
|
@ -926,12 +926,24 @@ resettexture
|
|||
{
|
||||
title = "Reset Texture Offsets";
|
||||
category = "visual";
|
||||
description = "Resets the texture offsets on the targeted or selected sidedef to 0, 0. Also resets sidedef's scale and floor/ceiling's scale and rotation in UDMF map format.";
|
||||
description = "Resets the texture offsets on the targeted or selected sidedef to 0, 0.";
|
||||
allowkeys = true;
|
||||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
}
|
||||
|
||||
//mxd
|
||||
resettextureudmf
|
||||
{
|
||||
title = "Reset Local Texture Offsets (UDMF)";
|
||||
category = "visual";
|
||||
description = "Resets upper/middle/lower texture offsets on the targeted or selected sidedef to 0, 0. Also resets sidedef's scale and floor/ceiling's scale and rotation.";
|
||||
allowkeys = true;
|
||||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
default = 196690; //Ctrl-Shift-R
|
||||
}
|
||||
|
||||
texturecopyoffsets
|
||||
{
|
||||
title = "Copy Offsets";
|
||||
|
|
|
@ -362,6 +362,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
public virtual void OnToggleUpperUnpegged() { }
|
||||
public virtual void OnToggleLowerUnpegged() { }
|
||||
public virtual void OnResetTextureOffset() { }
|
||||
public virtual void OnResetLocalTextureOffset() { } //mxd
|
||||
public virtual void OnCopyTextureOffsets() { }
|
||||
public virtual void OnPasteTextureOffsets() { }
|
||||
public virtual void OnInsert() { }
|
||||
|
|
|
@ -597,19 +597,33 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
mode.SetActionResult("Texture offsets reset.");
|
||||
|
||||
// Apply offsets
|
||||
if(General.Map.UDMF) {
|
||||
SetTextureOffsetX(0);
|
||||
SetTextureOffsetY(0);
|
||||
ResetTextureScale();
|
||||
} else {
|
||||
Sidedef.OffsetX = 0;
|
||||
Sidedef.OffsetY = 0;
|
||||
}
|
||||
Sidedef.OffsetX = 0;
|
||||
Sidedef.OffsetY = 0;
|
||||
|
||||
// Update sidedef geometry
|
||||
VisualSidedefParts parts = Sector.GetSidedefParts(Sidedef);
|
||||
parts.SetupAllParts();
|
||||
}
|
||||
|
||||
//mxd
|
||||
public virtual void OnResetLocalTextureOffset() {
|
||||
if (!General.Map.UDMF) {
|
||||
OnResetTextureOffset();
|
||||
return;
|
||||
}
|
||||
|
||||
mode.CreateUndo("Reset local texture offsets");
|
||||
mode.SetActionResult("Local texture offsets reset.");
|
||||
|
||||
// Apply offsets
|
||||
SetTextureOffsetX(0);
|
||||
SetTextureOffsetY(0);
|
||||
ResetTextureScale();
|
||||
|
||||
// Update sidedef geometry
|
||||
VisualSidedefParts parts = Sector.GetSidedefParts(Sidedef);
|
||||
parts.SetupAllParts();
|
||||
}
|
||||
|
||||
// Toggle upper-unpegged
|
||||
public virtual void OnToggleUpperUnpegged()
|
||||
|
|
|
@ -2456,6 +2456,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
PostAction();
|
||||
}
|
||||
|
||||
[BeginAction("resettextureudmf")]
|
||||
public void ResetLocalOffsets() {
|
||||
PreAction(UndoGroup.None);
|
||||
List<IVisualEventReceiver> objs = GetSelectedObjects(true, true, false, false);
|
||||
foreach(IVisualEventReceiver i in objs) i.OnResetLocalTextureOffset();
|
||||
PostAction();
|
||||
}
|
||||
|
||||
[BeginAction("floodfilltextures")]
|
||||
public void FloodfillTextures()
|
||||
{
|
||||
|
|
|
@ -456,6 +456,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
public virtual void OnToggleUpperUnpegged() { }
|
||||
public virtual void OnToggleLowerUnpegged() { }
|
||||
public virtual void OnResetTextureOffset() { }
|
||||
public virtual void OnResetLocalTextureOffset() { } //mxd
|
||||
public virtual void OnProcess(float deltatime) { }
|
||||
public virtual void OnTextureFloodfill() { }
|
||||
public virtual void OnInsert() { }
|
||||
|
|
|
@ -206,6 +206,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
public virtual void OnToggleUpperUnpegged() { }
|
||||
public virtual void OnToggleLowerUnpegged() { }
|
||||
public virtual void OnResetTextureOffset() { }
|
||||
public virtual void OnResetLocalTextureOffset() { } //mxd
|
||||
public virtual void OnProcess(float deltatime) { }
|
||||
public virtual void OnTextureFloodfill() { }
|
||||
public virtual void OnInsert() { }
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection);
|
||||
void OnChangeTextureScale(float incrementX, float incrementY); //mxd
|
||||
void OnResetTextureOffset();
|
||||
void OnResetLocalTextureOffset(); //mxd. This should reset upper/middle/lower offsets (UDMF only)
|
||||
void OnSelectTexture();
|
||||
void OnCopyTexture();
|
||||
void OnPasteTexture();
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
public void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection) { }
|
||||
public virtual void OnChangeTextureScale(float incrementX, float incrementY) { } //mxd
|
||||
public void OnResetTextureOffset() { }
|
||||
public void OnResetLocalTextureOffset() { } //mxd
|
||||
public void OnSelectTexture() { }
|
||||
public void OnCopyTexture() { }
|
||||
public void OnPasteTexture() { }
|
||||
|
|
|
@ -245,6 +245,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
Sector.UpdateSectorGeometry(false);
|
||||
}
|
||||
|
||||
//mxd
|
||||
public override void OnResetLocalTextureOffset() {
|
||||
OnResetTextureOffset();
|
||||
}
|
||||
|
||||
// Paste texture
|
||||
public override void OnPasteTexture()
|
||||
{
|
||||
|
|
|
@ -247,6 +247,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if(Sector.Sector.UpdateNeeded)
|
||||
Sector.UpdateSectorGeometry(false);
|
||||
}
|
||||
|
||||
//mxd
|
||||
public override void OnResetLocalTextureOffset() {
|
||||
OnResetTextureOffset();
|
||||
}
|
||||
|
||||
// Paste texture
|
||||
public override void OnPasteTexture()
|
||||
|
|
Loading…
Reference in a new issue