Update content vectors to numerics (#17759)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
using Content.Client.Actions;
|
||||
using Content.Client.Construction;
|
||||
@@ -71,10 +72,10 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
|
||||
_menuDragHelper = new DragDropHelper<ActionButton>(OnMenuBeginDrag, OnMenuContinueDrag, OnMenuEndDrag);
|
||||
_dragShadow = new TextureRect
|
||||
{
|
||||
MinSize = (64, 64),
|
||||
MinSize = new Vector2(64, 64),
|
||||
Stretch = StretchMode.Scale,
|
||||
Visible = false,
|
||||
SetSize = (64, 64),
|
||||
SetSize = new Vector2(64, 64),
|
||||
MouseFilter = MouseFilterMode.Ignore
|
||||
};
|
||||
|
||||
@@ -738,13 +739,13 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
|
||||
}
|
||||
}
|
||||
|
||||
LayoutContainer.SetPosition(_dragShadow, UIManager.MousePositionScaled.Position - (32, 32));
|
||||
LayoutContainer.SetPosition(_dragShadow, UIManager.MousePositionScaled.Position - new Vector2(32, 32));
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool OnMenuContinueDrag(float frameTime)
|
||||
{
|
||||
LayoutContainer.SetPosition(_dragShadow, UIManager.MousePositionScaled.Position - (32, 32));
|
||||
LayoutContainer.SetPosition(_dragShadow, UIManager.MousePositionScaled.Position - new Vector2(32, 32));
|
||||
_dragShadow.Visible = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Numerics;
|
||||
using Content.Client.Actions.UI;
|
||||
using Content.Client.Cooldown;
|
||||
using Content.Client.Stylesheets;
|
||||
@@ -65,7 +66,7 @@ public sealed class ActionButton : Control
|
||||
HighlightRect = new PanelContainer
|
||||
{
|
||||
StyleClasses = {StyleNano.StyleClassHandSlotHighlight},
|
||||
MinSize = (32, 32),
|
||||
MinSize = new Vector2(32, 32),
|
||||
Visible = false
|
||||
};
|
||||
_bigActionIcon = new TextureRect
|
||||
@@ -94,8 +95,8 @@ public sealed class ActionButton : Control
|
||||
Name = "Big Sprite",
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true,
|
||||
Scale = (2, 2),
|
||||
SetSize = (64, 64),
|
||||
Scale = new Vector2(2, 2),
|
||||
SetSize = new Vector2(64, 64),
|
||||
Visible = false,
|
||||
OverrideDirection = Direction.South,
|
||||
};
|
||||
@@ -113,11 +114,11 @@ public sealed class ActionButton : Control
|
||||
Orientation = LayoutOrientation.Horizontal,
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true,
|
||||
MinSize = (64, 64)
|
||||
MinSize = new Vector2(64, 64)
|
||||
};
|
||||
paddingBoxItemIcon.AddChild(new Control()
|
||||
{
|
||||
MinSize = (32, 32),
|
||||
MinSize = new Vector2(32, 32),
|
||||
});
|
||||
paddingBoxItemIcon.AddChild(new Control
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Client.Actions.UI;
|
||||
using System.Numerics;
|
||||
using Content.Client.Actions.UI;
|
||||
using Content.Client.Cooldown;
|
||||
using Content.Shared.Alert;
|
||||
using Robust.Client.UserInterface;
|
||||
@@ -54,7 +55,7 @@ namespace Content.Client.UserInterface.Systems.Alerts.Controls
|
||||
var specifier = alert.GetIcon(_severity);
|
||||
_icon = new AnimatedTextureRect
|
||||
{
|
||||
DisplayRect = {TextureScale = (2, 2)}
|
||||
DisplayRect = {TextureScale = new Vector2(2, 2)}
|
||||
};
|
||||
|
||||
_icon.SetFromSpriteSpecifier(specifier);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Numerics;
|
||||
using Content.Client.Message;
|
||||
using Content.Client.Resources;
|
||||
using Content.Client.Stylesheets;
|
||||
@@ -75,7 +76,7 @@ namespace Content.Client.UserInterface.Systems.Atmos.GasTank
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical
|
||||
}),
|
||||
new Control {MinSize = (0, 110)}
|
||||
new Control {MinSize = new Vector2(0, 110)}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -125,13 +126,13 @@ namespace Content.Client.UserInterface.Systems.Atmos.GasTank
|
||||
_topContainer.AddChild(topRow);
|
||||
_topContainer.AddChild(new PanelContainer
|
||||
{
|
||||
MinSize = (0, 2),
|
||||
MinSize = new Vector2(0, 2),
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
|
||||
});
|
||||
_topContainer.AddChild(middle);
|
||||
_topContainer.AddChild(new PanelContainer
|
||||
{
|
||||
MinSize = (0, 2),
|
||||
MinSize = new Vector2(0, 2),
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
|
||||
});
|
||||
|
||||
@@ -141,7 +142,7 @@ namespace Content.Client.UserInterface.Systems.Atmos.GasTank
|
||||
|
||||
//internals
|
||||
_lblInternals = new RichTextLabel
|
||||
{MinSize = (200, 0), VerticalAlignment = VAlignment.Center};
|
||||
{MinSize = new Vector2(200, 0), VerticalAlignment = VAlignment.Center};
|
||||
_btnInternals = new Button {Text = Loc.GetString("gas-tank-window-internals-toggle-button") };
|
||||
|
||||
_contentContainer.AddChild(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Content.Client.Administration.Managers;
|
||||
using Content.Client.Administration.Systems;
|
||||
using Content.Client.Administration.UI.Bwoink;
|
||||
@@ -465,7 +466,7 @@ public sealed class UserAHelpUIHandler : IAHelpUIHandler
|
||||
TitleClass="windowTitleAlert",
|
||||
HeaderClass="windowHeaderAlert",
|
||||
Title=Loc.GetString("bwoink-user-title"),
|
||||
MinSize=(500, 200),
|
||||
MinSize = new Vector2(500, 200),
|
||||
};
|
||||
_window.OnClose += () => { OnClose?.Invoke(); };
|
||||
_window.OnOpen += () => { OnOpen?.Invoke(); };
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Content.Client.Administration.Managers;
|
||||
using Content.Client.Chat;
|
||||
using Content.Client.Chat.Managers;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Client.Resources;
|
||||
using System.Numerics;
|
||||
using Content.Client.Resources;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
@@ -55,8 +56,8 @@ public sealed class ChannelFilterButton : ContainerButton
|
||||
{
|
||||
var globalPos = GlobalPosition;
|
||||
var (minX, minY) = ChatFilterPopup.MinSize;
|
||||
var box = UIBox2.FromDimensions(globalPos - (FilterDropdownOffset, 0),
|
||||
(Math.Max(minX, ChatFilterPopup.MinWidth), minY));
|
||||
var box = UIBox2.FromDimensions(globalPos - new Vector2(FilterDropdownOffset, 0),
|
||||
new Vector2(Math.Max(minX, ChatFilterPopup.MinWidth), minY));
|
||||
ChatFilterPopup.Open(box);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Numerics;
|
||||
using Content.Shared.Chat;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
@@ -97,7 +98,7 @@ public sealed class ChannelSelectorButton : Button
|
||||
{
|
||||
var globalLeft = GlobalPosition.X;
|
||||
var globalBot = GlobalPosition.Y + Height;
|
||||
var box = UIBox2.FromDimensions((globalLeft, globalBot), (SizeBox.Width, SelectorDropdownOffset));
|
||||
var box = UIBox2.FromDimensions(new Vector2(globalLeft, globalBot), new Vector2(SizeBox.Width, SelectorDropdownOffset));
|
||||
_channelSelectorPopup.Open(box);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Numerics;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Content.Shared.Ghost;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
@@ -54,7 +55,7 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
VerticalAlignment = VAlignment.Center,
|
||||
SizeFlagsStretchRatio = 1,
|
||||
MinSize = (340, 20),
|
||||
MinSize = new Vector2(340, 20),
|
||||
ClipText = true,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using System.Numerics;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using static Robust.Client.UserInterface.Controls.BaseButton;
|
||||
@@ -14,14 +15,14 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
MakeSentientLabel.MinSize = (150, 0);
|
||||
RoleEntityLabel.MinSize = (150, 0);
|
||||
RoleNameLabel.MinSize = (150, 0);
|
||||
RoleName.MinSize = (300, 0);
|
||||
RoleDescriptionLabel.MinSize = (150, 0);
|
||||
RoleDescription.MinSize = (300, 0);
|
||||
RoleRulesLabel.MinSize = (150, 0);
|
||||
RoleRules.MinSize = (300, 0);
|
||||
MakeSentientLabel.MinSize = new Vector2(150, 0);
|
||||
RoleEntityLabel.MinSize = new Vector2(150, 0);
|
||||
RoleNameLabel.MinSize = new Vector2(150, 0);
|
||||
RoleName.MinSize = new Vector2(300, 0);
|
||||
RoleDescriptionLabel.MinSize = new Vector2(150, 0);
|
||||
RoleDescription.MinSize = new Vector2(300, 0);
|
||||
RoleRulesLabel.MinSize = new Vector2(150, 0);
|
||||
RoleRules.MinSize = new Vector2(300, 0);
|
||||
|
||||
MakeButton.OnPressed += OnPressed;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using System.Numerics;
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user