v1.3.0.1 (Epic Store release)

This commit is contained in:
Regalis11
2024-03-28 18:34:33 +02:00
parent 81ca8637be
commit 3791670c42
269 changed files with 13160 additions and 2966 deletions
@@ -93,13 +93,13 @@ namespace Barotrauma.Items.Components
[Editable(0.0f, 10.0f), Serialize(1.0f, IsPropertySaveable.Yes, description: "The scale of the text displayed on the label.", alwaysUseInstanceValues: true)]
public float TextScale
{
get { return textBlock == null ? 1.0f : textBlock.TextScale; }
get { return textBlock == null ? 1.0f : textBlock.TextScale / BaseToRealTextScaleFactor; }
set
{
if (textBlock != null)
{
float prevScale = TextBlock.TextScale;
textBlock.TextScale = MathHelper.Clamp(value, 0.1f, 10.0f);
textBlock.TextScale = MathHelper.Clamp(value * BaseToRealTextScaleFactor, 0.1f, 10.0f);
if (!MathUtils.NearlyEqual(prevScale, TextBlock.TextScale))
{
SetScrollingText();
@@ -210,6 +210,8 @@ namespace Barotrauma.Items.Components
SetScrollingText();
}
private const float BaseTextSize = 12.0f;
private float BaseToRealTextScaleFactor => BaseTextSize / GUIStyle.UnscaledSmallFont.Size;
private void RecreateTextBlock()
{
textBlock = new GUITextBlock(new RectTransform(item.Rect.Size), "",
@@ -217,7 +219,7 @@ namespace Barotrauma.Items.Components
{
TextDepth = item.SpriteDepth - 0.00001f,
RoundToNearestPixel = false,
TextScale = TextScale,
TextScale = TextScale * BaseToRealTextScaleFactor,
Padding = padding * item.Scale
};
}
@@ -785,7 +785,7 @@ namespace Barotrauma.Items.Components
if (item.CurrentHull is { } currentHull && currentHull == hull)
{
Sprite pingCircle = GUIStyle.YouAreHereCircle.Value.Sprite;
Sprite? pingCircle = GUIStyle.YouAreHereCircle.Value?.Sprite;
if (pingCircle is null) { continue; }
Vector2 charPos = item.WorldPosition;
@@ -1241,7 +1241,8 @@ namespace Barotrauma.Items.Components
foreach (Vector2 blip in MiniMapBlips)
{
Vector2 parentSize = miniMapFrame.Rect.Size.ToVector2();
Sprite pingCircle = GUIStyle.PingCircle.Value.Sprite;
Sprite? pingCircle = GUIStyle.PingCircle.Value?.Sprite;
if (pingCircle is null) { continue; }
Vector2 targetSize = new Vector2(parentSize.X / 4f);
Vector2 spriteScale = targetSize / pingCircle.size;
float scale = Math.Min(blipState, maxBlipState / 2f);
@@ -1525,7 +1526,7 @@ namespace Barotrauma.Items.Components
float maxWidth = Math.Max(sizeX, sizeY);
Vector2 drawPos = new Vector2(frame.Rect.Right - sizeX, frame.Rect.Y - sizeY / 2f);
UISprite icon = GUIStyle.IconOverflowIndicator;
UISprite? icon = GUIStyle.IconOverflowIndicator;
if (icon != null)
{
const int iconPadding = 4;