mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-19 06:51:09 +00:00
added reset texture offsets feature for visual mode
This commit is contained in:
parent
45ab139ff9
commit
ba39f00fb9
7 changed files with 39 additions and 1 deletions
|
@ -28,7 +28,7 @@ The order and included items may also change any time.
|
||||||
=========================================================
|
=========================================================
|
||||||
|
|
||||||
- Contact AlysiumX (AlysiumX@gmail.com) for official video tutorials
|
- Contact AlysiumX (AlysiumX@gmail.com) for official video tutorials
|
||||||
(see http://www.youtube.com/view_play_list?p=6FDD1F9F674419E8)
|
(see http://doomvideos.com/, http://www.youtube.com/view_play_list?p=6FDD1F9F674419E8)
|
||||||
|
|
||||||
- Make Plugin Development Kit
|
- Make Plugin Development Kit
|
||||||
- Add general purpose events to editing modes and plugin main class
|
- Add general purpose events to editing modes and plugin main class
|
||||||
|
|
|
@ -487,6 +487,16 @@ togglebrightness
|
||||||
allowscroll = true;
|
allowscroll = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resettexture
|
||||||
|
{
|
||||||
|
title = "Reset Texture Offsets";
|
||||||
|
category = "visual";
|
||||||
|
description = "Resets the texture offsets on the targeted or selected sidedef to 0, 0.";
|
||||||
|
allowkeys = true;
|
||||||
|
allowmouse = true;
|
||||||
|
allowscroll = true;
|
||||||
|
}
|
||||||
|
|
||||||
placevisualstart
|
placevisualstart
|
||||||
{
|
{
|
||||||
title = "Place Visual Mode Camera";
|
title = "Place Visual Mode Camera";
|
||||||
|
|
|
@ -82,6 +82,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public virtual void OnTextureAlign(bool alignx, bool aligny) { }
|
public virtual void OnTextureAlign(bool alignx, bool aligny) { }
|
||||||
public virtual void OnToggleUpperUnpegged() { }
|
public virtual void OnToggleUpperUnpegged() { }
|
||||||
public virtual void OnToggleLowerUnpegged() { }
|
public virtual void OnToggleLowerUnpegged() { }
|
||||||
|
public virtual void OnResetTextureOffset() { }
|
||||||
protected virtual void SetTexture(string texturename) { }
|
protected virtual void SetTexture(string texturename) { }
|
||||||
|
|
||||||
// Select texture
|
// Select texture
|
||||||
|
|
|
@ -113,6 +113,23 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public virtual void OnChangeTargetHeight(int amount) { }
|
public virtual void OnChangeTargetHeight(int amount) { }
|
||||||
protected virtual void SetTexture(string texturename) { }
|
protected virtual void SetTexture(string texturename) { }
|
||||||
|
|
||||||
|
// Reset texture offsets
|
||||||
|
public virtual void OnResetTextureOffset()
|
||||||
|
{
|
||||||
|
General.Map.UndoRedo.CreateUndo("Reset texture offsets");
|
||||||
|
|
||||||
|
// Apply offsets
|
||||||
|
Sidedef.OffsetX = 0;
|
||||||
|
Sidedef.OffsetY = 0;
|
||||||
|
|
||||||
|
// Update sidedef geometry
|
||||||
|
VisualSidedefParts parts = Sector.GetSidedefParts(Sidedef);
|
||||||
|
if(parts.lower != null) parts.lower.Setup();
|
||||||
|
if(parts.middledouble != null) parts.middledouble.Setup();
|
||||||
|
if(parts.middlesingle != null) parts.middlesingle.Setup();
|
||||||
|
if(parts.upper != null) parts.upper.Setup();
|
||||||
|
}
|
||||||
|
|
||||||
// Toggle upper-unpegged
|
// Toggle upper-unpegged
|
||||||
public virtual void OnToggleUpperUnpegged()
|
public virtual void OnToggleUpperUnpegged()
|
||||||
{
|
{
|
||||||
|
|
|
@ -498,6 +498,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
{
|
{
|
||||||
renderer.FullBrightness = !renderer.FullBrightness;
|
renderer.FullBrightness = !renderer.FullBrightness;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BeginAction("resettexture")]
|
||||||
|
public void ResetTexture()
|
||||||
|
{
|
||||||
|
PickTargetUnlocked();
|
||||||
|
if(target.picked != null) (target.picked as IVisualEventReceiver).OnResetTextureOffset();
|
||||||
|
ShowTargetInfo();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
|
@ -347,6 +347,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public virtual void OnTextureAlign(bool alignx, bool aligny) { }
|
public virtual void OnTextureAlign(bool alignx, bool aligny) { }
|
||||||
public virtual void OnToggleUpperUnpegged() { }
|
public virtual void OnToggleUpperUnpegged() { }
|
||||||
public virtual void OnToggleLowerUnpegged() { }
|
public virtual void OnToggleLowerUnpegged() { }
|
||||||
|
public virtual void OnResetTextureOffset() { }
|
||||||
|
|
||||||
// Return texture name
|
// Return texture name
|
||||||
public virtual string GetTextureName() { return ""; }
|
public virtual string GetTextureName() { return ""; }
|
||||||
|
|
|
@ -47,6 +47,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
void OnChangeTargetHeight(int amount);
|
void OnChangeTargetHeight(int amount);
|
||||||
void OnChangeTargetBrightness(int amount);
|
void OnChangeTargetBrightness(int amount);
|
||||||
void OnChangeTextureOffset(int horizontal, int vertical);
|
void OnChangeTextureOffset(int horizontal, int vertical);
|
||||||
|
void OnResetTextureOffset();
|
||||||
void OnSelectTexture();
|
void OnSelectTexture();
|
||||||
void OnCopyTexture();
|
void OnCopyTexture();
|
||||||
void OnPasteTexture();
|
void OnPasteTexture();
|
||||||
|
|
Loading…
Reference in a new issue