mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-20 19:02:12 +00:00
Visual Mode: fixed a problem where floors/ceilings could not be changed in size if the user tried to change their texture offset in a non-UDMF map
This commit is contained in:
parent
0a9837050a
commit
2b40a08f13
9 changed files with 25 additions and 15 deletions
|
@ -848,15 +848,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
// Texture offset change
|
||||
public virtual void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection)
|
||||
public virtual bool OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection)
|
||||
{
|
||||
if(horizontal == 0 && vertical == 0) return; //mxd
|
||||
if(horizontal == 0 && vertical == 0) return false; //mxd
|
||||
|
||||
//mxd
|
||||
if(!General.Map.UDMF)
|
||||
{
|
||||
General.Interface.DisplayStatus(StatusType.Warning, "Floor/ceiling texture offsets cannot be changed in this map format!");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if((General.Map.UndoRedo.NextUndo == null) || (General.Map.UndoRedo.NextUndo.TicketID != undoticket))
|
||||
|
@ -914,6 +914,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
if(vs != null) vs.UpdateSectorGeometry(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
|
|
@ -1660,7 +1660,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
// Texture offset change
|
||||
public virtual void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection)
|
||||
public virtual bool OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection)
|
||||
{
|
||||
if((General.Map.UndoRedo.NextUndo == null) || (General.Map.UndoRedo.NextUndo.TicketID != undoticket))
|
||||
undoticket = mode.CreateUndo("Change texture offsets");
|
||||
|
@ -1695,6 +1695,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
//mxd. Update linked effects
|
||||
SectorData sd = mode.GetSectorDataEx(Sector.Sector);
|
||||
if(sd != null) sd.Reset(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
public void OnSelectBegin() { }
|
||||
public void OnEditBegin() { }
|
||||
public void OnChangeTargetBrightness(bool up) { }
|
||||
public void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection) { }
|
||||
public bool OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection) { return true; }
|
||||
public void OnSelectTexture() { }
|
||||
public void OnCopyTexture() { }
|
||||
public void OnPasteTexture() { }
|
||||
|
|
|
@ -657,7 +657,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
public void OnSelectBegin() { }
|
||||
public void OnEditBegin() { }
|
||||
public void OnChangeTargetBrightness(bool up) { }
|
||||
public void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection) { }
|
||||
public bool OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection) { return true; }
|
||||
public void OnSelectTexture() { }
|
||||
public void OnCopyTexture() { }
|
||||
public void OnPasteTexture() { }
|
||||
|
|
|
@ -241,7 +241,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
public void OnEditBegin() { }
|
||||
public void OnMouseMove(MouseEventArgs e) { }
|
||||
public void OnChangeTargetBrightness(bool up) { }
|
||||
public void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection) { }
|
||||
public bool OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection) { return true; }
|
||||
public void OnChangeScale(int incrementX, int incrementY) { }
|
||||
public void OnSelectTexture() { }
|
||||
public void OnCopyTexture() { }
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
void OnMouseMove(MouseEventArgs e);
|
||||
void OnChangeTargetHeight(int amount);
|
||||
void OnChangeTargetBrightness(bool up);
|
||||
void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection);
|
||||
bool OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection);
|
||||
void OnChangeScale(int incrementX, int incrementY); //mxd
|
||||
void OnResetTextureOffset();
|
||||
void OnResetLocalTextureOffset(); //mxd. This should reset upper/middle/lower offsets (UDMF only)
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
public void OnMouseMove(MouseEventArgs e) { }
|
||||
public void OnChangeTargetHeight(int amount) { }
|
||||
public void OnChangeTargetBrightness(bool up) { }
|
||||
public void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection) { }
|
||||
public bool OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection) { return true; }
|
||||
public void OnChangeScale(int incrementX, int incrementY) { } //mxd
|
||||
public void OnResetTextureOffset() { }
|
||||
public void OnResetLocalTextureOffset() { } //mxd
|
||||
|
|
|
@ -279,16 +279,19 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
//mxd
|
||||
public override void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection)
|
||||
public override bool OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection)
|
||||
{
|
||||
bool appliedoffset = false;
|
||||
|
||||
// Only do this when not done yet in this call
|
||||
// Because we may be able to select the same 3D floor multiple times through multiple sectors
|
||||
SectorData sd = mode.GetSectorData(level.sector);
|
||||
if(!sd.CeilingChanged)
|
||||
{
|
||||
sd.CeilingChanged = true;
|
||||
base.OnChangeTextureOffset(horizontal, vertical, doSurfaceAngleCorrection);
|
||||
sd.CeilingChanged = appliedoffset = base.OnChangeTextureOffset(horizontal, vertical, doSurfaceAngleCorrection);
|
||||
}
|
||||
|
||||
return appliedoffset;
|
||||
}
|
||||
|
||||
// Move texture coordinates
|
||||
|
|
|
@ -233,16 +233,19 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
//mxd
|
||||
public override void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection)
|
||||
public override bool OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection)
|
||||
{
|
||||
bool appliedoffset = false;
|
||||
|
||||
// Only do this when not done yet in this call
|
||||
// Because we may be able to select the same 3D floor multiple times through multiple sectors
|
||||
SectorData sd = mode.GetSectorData(level.sector);
|
||||
if(!sd.FloorChanged)
|
||||
{
|
||||
sd.FloorChanged = true;
|
||||
base.OnChangeTextureOffset(horizontal, vertical, doSurfaceAngleCorrection);
|
||||
sd.FloorChanged = appliedoffset = base.OnChangeTextureOffset(horizontal, vertical, doSurfaceAngleCorrection);
|
||||
}
|
||||
|
||||
return appliedoffset;
|
||||
}
|
||||
|
||||
// Move texture coordinates
|
||||
|
|
Loading…
Reference in a new issue