Added Draedon weapon chargers and generators. As of pushing this, it uses dirt blocks as fuel. This will be changed when a sprite and name are decided for the actual fuel. These have been roughly tested in Multiplayer. No remaining bugs exist to my knowledge. Added a schematic worldgen system. There are two .cs files that they use with autogenerated code. Please excuse their poor quality. Added a rough base for pop GUIs (for book-reading and the like. A draedons logbook exists that uses this) Adjusted Snake eyes to use a little less dust. Note: This is NOT ready to be merged into master yet. A lot of placeholders are used.
40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
|
|
namespace CalamityMod.UI
|
|
{
|
|
public abstract class PopupGUI
|
|
{
|
|
public int FadeTime;
|
|
public bool Active;
|
|
public virtual int FadeTimeMax { get; set; } = 30;
|
|
public virtual void Update()
|
|
{
|
|
if (Active)
|
|
{
|
|
if (FadeTime < FadeTimeMax)
|
|
FadeTime++;
|
|
}
|
|
else if (FadeTime > 0)
|
|
FadeTime--;
|
|
if (Main.mouseLeft && Main.mouseLeftRelease && !Main.blockMouse && FadeTime >= 30)
|
|
{
|
|
Main.mouseLeftRelease = false;
|
|
Main.mouseLeft = false;
|
|
Active = false;
|
|
}
|
|
}
|
|
public float GetYTop() => MathHelper.Lerp(Main.screenHeight * 2, Main.screenHeight * 0.25f, FadeTime / (float)FadeTimeMax);
|
|
public Vector2 GetScreenAdjustedScale(float textureScale, Texture2D drawTexture)
|
|
{
|
|
float xScale = MathHelper.Lerp(0.004f, 1f, FadeTime / (float)FadeTimeMax);
|
|
Vector2 scale = new Vector2(xScale, 1f) * new Vector2(Main.screenWidth, Main.screenHeight) / drawTexture.Size();
|
|
scale *= 0.5f;
|
|
scale *= textureScale;
|
|
return scale;
|
|
}
|
|
public virtual void Draw(SpriteBatch spriteBatch) { }
|
|
}
|
|
}
|