Make Y+ up. (#109)
This commit is contained in:
committed by
GitHub
parent
7a91fb7512
commit
2dd3f24fb2
@@ -27,16 +27,7 @@ namespace Content.Client.Construction
|
||||
{
|
||||
if (Prototype != null)
|
||||
{
|
||||
// Stupid god damn Y AXIS.
|
||||
var dir = Manager.Direction;
|
||||
if (dir == Direction.South)
|
||||
{
|
||||
dir = Direction.North;
|
||||
}
|
||||
else if (dir == Direction.North)
|
||||
{
|
||||
dir = Direction.South;
|
||||
}
|
||||
Owner.SpawnGhost(Prototype, coords, dir);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -56,16 +56,14 @@ namespace Content.Client.GameObjects.Components.SmoothWalling
|
||||
var state0 = $"{StateBase}0";
|
||||
SnapGrid = Owner.GetComponent<SnapGridComponent>();
|
||||
Sprite = Owner.GetComponent<ISpriteComponent>();
|
||||
// BIG NOTE: Y axis is fucked. Double fucked. Triple super-mega-ultra-turbo-fucked.
|
||||
// so, the DirectionOffsets here are incorrect (flipped).
|
||||
Sprite.LayerMapSet(CornerLayers.SE, Sprite.AddLayerState(state0));
|
||||
Sprite.LayerSetDirOffset(CornerLayers.SE, DirectionOffset.Flip);
|
||||
Sprite.LayerSetDirOffset(CornerLayers.SE, DirectionOffset.None);
|
||||
Sprite.LayerMapSet(CornerLayers.NE, Sprite.AddLayerState(state0));
|
||||
Sprite.LayerSetDirOffset(CornerLayers.NE, DirectionOffset.Clockwise);
|
||||
Sprite.LayerSetDirOffset(CornerLayers.NE, DirectionOffset.CounterClockwise);
|
||||
Sprite.LayerMapSet(CornerLayers.NW, Sprite.AddLayerState(state0));
|
||||
Sprite.LayerSetDirOffset(CornerLayers.NW, DirectionOffset.None);
|
||||
Sprite.LayerSetDirOffset(CornerLayers.NW, DirectionOffset.Flip);
|
||||
Sprite.LayerMapSet(CornerLayers.SW, Sprite.AddLayerState(state0));
|
||||
Sprite.LayerSetDirOffset(CornerLayers.SW, DirectionOffset.CounterClockwise);
|
||||
Sprite.LayerSetDirOffset(CornerLayers.SW, DirectionOffset.Clockwise);
|
||||
}
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace Content.Client.UserInterface
|
||||
|
||||
private UiHandInfo LeftHand;
|
||||
private UiHandInfo RightHand;
|
||||
private Box2i handL;
|
||||
private Box2i handR;
|
||||
private UIBox2i handL;
|
||||
private UIBox2i handR;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
@@ -53,7 +53,7 @@ namespace Content.Client.UserInterface
|
||||
SetMarginsPreset(LayoutPreset.CenterBottom);
|
||||
SetAnchorPreset(LayoutPreset.CenterBottom);
|
||||
|
||||
handL = new Box2i(0, 0, BOX_SIZE, BOX_SIZE);
|
||||
handL = new UIBox2i(0, 0, BOX_SIZE, BOX_SIZE);
|
||||
handR = handL.Translated(new Vector2i(BOX_SIZE + BOX_SPACING, 0));
|
||||
SS14.Shared.Log.Logger.Debug($"{handL}, {handR}");
|
||||
MouseFilter = MouseFilterMode.Stop;
|
||||
@@ -64,7 +64,7 @@ namespace Content.Client.UserInterface
|
||||
return new Vector2(BOX_SIZE * 2 + 1, BOX_SIZE);
|
||||
}
|
||||
|
||||
protected override void Draw(DrawingHandle handle)
|
||||
protected override void Draw(DrawingHandleScreen handle)
|
||||
{
|
||||
if (!TryGetHands(out IHandsComponent hands))
|
||||
return;
|
||||
@@ -79,7 +79,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
var bounds = LeftHand.HeldSprite.Size;
|
||||
handle.DrawTextureRect(LeftHand.HeldSprite,
|
||||
Box2i.FromDimensions(handL.Left + (int)(handL.Width / 2f - bounds.X / 2f),
|
||||
UIBox2i.FromDimensions(handL.Left + (int)(handL.Width / 2f - bounds.X / 2f),
|
||||
handL.Top + (int)(handL.Height / 2f - bounds.Y / 2f),
|
||||
(int)bounds.X, (int)bounds.Y), tile: false);
|
||||
}
|
||||
@@ -88,7 +88,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
var bounds = RightHand.HeldSprite.Size;
|
||||
handle.DrawTextureRect(RightHand.HeldSprite,
|
||||
Box2i.FromDimensions(handR.Left + (int)(handR.Width / 2f - bounds.Y / 2f),
|
||||
UIBox2i.FromDimensions(handR.Left + (int)(handR.Width / 2f - bounds.Y / 2f),
|
||||
handR.Top + (int)(handR.Height / 2f - bounds.Y / 2f),
|
||||
(int)bounds.X, (int)bounds.Y), tile: false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user