Skip to content

Commit

Permalink
Criminal Record Icons below Job Icons (space-wizards#26203)
Browse files Browse the repository at this point in the history
SS13 Criminal Record Icon Location REAL

Adds a new Offset DataField to the StatusIcon Prototype. It effects status icon location on a per-pixel level. Not sure what else it could be used for, but hey, nothing wrong with generalizing. Also moves the mindshield icon priority to one, to fix an unreported bug with them covering non-job icons.
  • Loading branch information
Golinth authored Mar 18, 2024
1 parent 6095383 commit 21de5e9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Content.Client/StatusIcon/StatusIconOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected override void Draw(in OverlayDrawArgs args)
accOffsetL += texture.Height;
countL++;
}
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) accOffsetL / EyeManager.PixelsPerMeter;
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) (accOffsetL - proto.Offset) / EyeManager.PixelsPerMeter;
xOffset = -(bounds.Width + sprite.Offset.X) / 2f;

}
Expand All @@ -106,7 +106,7 @@ protected override void Draw(in OverlayDrawArgs args)
accOffsetR += texture.Height;
countR++;
}
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) accOffsetR / EyeManager.PixelsPerMeter;
yOffset = (bounds.Height + sprite.Offset.Y) / 2f - (float) (accOffsetR - proto.Offset) / EyeManager.PixelsPerMeter;
xOffset = (bounds.Width + sprite.Offset.X) / 2f - (float) texture.Width / EyeManager.PixelsPerMeter;

}
Expand Down
6 changes: 6 additions & 0 deletions Content.Shared/StatusIcon/StatusIconPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ public int CompareTo(StatusIconData? other)
/// </summary>
[DataField]
public StatusIconLayer Layer = StatusIconLayer.Base;

/// <summary>
/// Offset of the status icon, up and down only.
/// </summary>
[DataField]
public int Offset = 0;
}

/// <summary>
Expand Down
5 changes: 3 additions & 2 deletions Resources/Prototypes/StatusEffects/security.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
- type: statusIcon
id: SecurityIcon
abstract: true
priority: 1
locationPreference: Left
priority: 2
offset: 1
locationPreference: Right

- type: statusIcon
parent: SecurityIcon
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/StatusIcon/antag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

- type: statusIcon
id: MindShieldIcon
priority: 2
priority: 1
locationPreference: Right
layer: Mod
icon:
Expand Down

0 comments on commit 21de5e9

Please sign in to comment.