committed by
GitHub
parent
4cf8e18d1f
commit
26da24c3c5
@@ -50,13 +50,13 @@ namespace Content.Client.Chat
|
|||||||
|
|
||||||
public ChatBox()
|
public ChatBox()
|
||||||
{
|
{
|
||||||
MarginLeft = -475.0f;
|
/*MarginLeft = -475.0f;
|
||||||
MarginTop = 10.0f;
|
MarginTop = 10.0f;
|
||||||
MarginRight = -10.0f;
|
MarginRight = -10.0f;
|
||||||
MarginBottom = 235.0f;
|
MarginBottom = 235.0f;
|
||||||
|
|
||||||
AnchorLeft = 1.0f;
|
AnchorLeft = 1.0f;
|
||||||
AnchorRight = 1.0f;
|
AnchorRight = 1.0f;*/
|
||||||
|
|
||||||
var outerVBox = new VBoxContainer();
|
var outerVBox = new VBoxContainer();
|
||||||
|
|
||||||
|
|||||||
@@ -81,11 +81,11 @@ namespace Content.Client.Chat
|
|||||||
{
|
{
|
||||||
_netManager.RegisterNetMessage<MsgChatMessage>(MsgChatMessage.NAME, _onChatMessage);
|
_netManager.RegisterNetMessage<MsgChatMessage>(MsgChatMessage.NAME, _onChatMessage);
|
||||||
|
|
||||||
_speechBubbleRoot = new Control
|
_speechBubbleRoot = new LayoutContainer
|
||||||
{
|
{
|
||||||
MouseFilter = Control.MouseFilterMode.Ignore
|
MouseFilter = Control.MouseFilterMode.Ignore
|
||||||
};
|
};
|
||||||
_speechBubbleRoot.SetAnchorPreset(Control.LayoutPreset.Wide);
|
LayoutContainer.SetAnchorPreset(_speechBubbleRoot, LayoutContainer.LayoutPreset.Wide);
|
||||||
_userInterfaceManager.StateRoot.AddChild(_speechBubbleRoot);
|
_userInterfaceManager.StateRoot.AddChild(_speechBubbleRoot);
|
||||||
_speechBubbleRoot.SetPositionFirst();
|
_speechBubbleRoot.SetPositionFirst();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ namespace Content.Client.Chat
|
|||||||
private readonly IEntity _senderEntity;
|
private readonly IEntity _senderEntity;
|
||||||
private readonly IChatManager _chatManager;
|
private readonly IChatManager _chatManager;
|
||||||
|
|
||||||
private readonly Control _panel;
|
|
||||||
|
|
||||||
private float _timeLeft = TotalTime;
|
private float _timeLeft = TotalTime;
|
||||||
|
|
||||||
public float VerticalOffset { get; set; }
|
public float VerticalOffset { get; set; }
|
||||||
@@ -57,7 +55,7 @@ namespace Content.Client.Chat
|
|||||||
};
|
};
|
||||||
label.SetMessage(text);
|
label.SetMessage(text);
|
||||||
|
|
||||||
_panel = new PanelContainer
|
var panel = new PanelContainer
|
||||||
{
|
{
|
||||||
StyleClasses = { "tooltipBox" },
|
StyleClasses = { "tooltipBox" },
|
||||||
Children = { label },
|
Children = { label },
|
||||||
@@ -65,16 +63,19 @@ namespace Content.Client.Chat
|
|||||||
ModulateSelfOverride = Color.White.WithAlpha(0.75f)
|
ModulateSelfOverride = Color.White.WithAlpha(0.75f)
|
||||||
};
|
};
|
||||||
|
|
||||||
AddChild(_panel);
|
AddChild(panel);
|
||||||
|
|
||||||
ForceRunStyleUpdate();
|
ForceRunStyleUpdate();
|
||||||
|
|
||||||
_panel.Size = _panel.CombinedMinimumSize;
|
ContentHeight = panel.CombinedMinimumSize.Y;
|
||||||
ContentHeight = _panel.Height;
|
|
||||||
Size = (_panel.Width, 0);
|
|
||||||
_verticalOffsetAchieved = -ContentHeight;
|
_verticalOffsetAchieved = -ContentHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override Vector2 CalculateMinimumSize()
|
||||||
|
{
|
||||||
|
return (base.CalculateMinimumSize().X, 0);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void FrameUpdate(FrameEventArgs args)
|
protected override void FrameUpdate(FrameEventArgs args)
|
||||||
{
|
{
|
||||||
base.FrameUpdate(args);
|
base.FrameUpdate(args);
|
||||||
@@ -109,10 +110,10 @@ namespace Content.Client.Chat
|
|||||||
|
|
||||||
var lowerCenter = _eyeManager.WorldToScreen(worldPos) / UIScale;
|
var lowerCenter = _eyeManager.WorldToScreen(worldPos) / UIScale;
|
||||||
var screenPos = lowerCenter - (Width / 2, ContentHeight + _verticalOffsetAchieved);
|
var screenPos = lowerCenter - (Width / 2, ContentHeight + _verticalOffsetAchieved);
|
||||||
Position = screenPos;
|
LayoutContainer.SetPosition(this, screenPos);
|
||||||
|
|
||||||
var height = (lowerCenter.Y - screenPos.Y).Clamp(0, ContentHeight);
|
var height = (lowerCenter.Y - screenPos.Y).Clamp(0, ContentHeight);
|
||||||
Size = (Size.X, height);
|
LayoutContainer.SetSize(this, (Size.X, height));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Die()
|
private void Die()
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace Content.Client
|
|||||||
{
|
{
|
||||||
var label = new PopupLabel {Text = message};
|
var label = new PopupLabel {Text = message};
|
||||||
var minimumSize = label.CombinedMinimumSize;
|
var minimumSize = label.CombinedMinimumSize;
|
||||||
label.InitialPos = label.Position = coordinates.Position - minimumSize / 2;
|
LayoutContainer.SetPosition(label, label.InitialPos = coordinates.Position - minimumSize / 2);
|
||||||
_userInterfaceManager.PopupRoot.AddChild(label);
|
_userInterfaceManager.PopupRoot.AddChild(label);
|
||||||
_aliveLabels.Add(label);
|
_aliveLabels.Add(label);
|
||||||
}
|
}
|
||||||
@@ -94,7 +94,7 @@ namespace Content.Client
|
|||||||
public void Update(FrameEventArgs eventArgs)
|
public void Update(FrameEventArgs eventArgs)
|
||||||
{
|
{
|
||||||
_timeLeft += eventArgs.DeltaSeconds;
|
_timeLeft += eventArgs.DeltaSeconds;
|
||||||
Position = InitialPos - new Vector2(0, 20 * (_timeLeft * _timeLeft + _timeLeft));
|
LayoutContainer.SetPosition(this, InitialPos - (0, 20 * (_timeLeft * _timeLeft + _timeLeft)));
|
||||||
if (_timeLeft > 0.5f)
|
if (_timeLeft > 0.5f)
|
||||||
{
|
{
|
||||||
Modulate = Color.White.WithAlpha(1f - 0.2f * (float)Math.Pow(_timeLeft - 0.5f, 3f));
|
Modulate = Color.White.WithAlpha(1f - 0.2f * (float)Math.Pow(_timeLeft - 0.5f, 3f));
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ namespace Content.Client.Construction
|
|||||||
private List<CategoryNode> FlattenedCategories;
|
private List<CategoryNode> FlattenedCategories;
|
||||||
private readonly PlacementManager Placement;
|
private readonly PlacementManager Placement;
|
||||||
|
|
||||||
|
protected override Vector2? CustomSize => (500, 350);
|
||||||
|
|
||||||
public ConstructionMenu()
|
public ConstructionMenu()
|
||||||
{
|
{
|
||||||
Size = (500, 350);
|
|
||||||
|
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
Placement = (PlacementManager) IoCManager.Resolve<IPlacementManager>();
|
Placement = (PlacementManager) IoCManager.Resolve<IPlacementManager>();
|
||||||
Placement.PlacementCanceled += OnPlacementCanceled;
|
Placement.PlacementCanceled += OnPlacementCanceled;
|
||||||
|
|||||||
@@ -124,8 +124,6 @@ namespace Content.Client.GameObjects.Components.Actor
|
|||||||
{
|
{
|
||||||
_contentsVBox.AddChild(element.Scene);
|
_contentsVBox.AddChild(element.Scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
Size = CombinedMinimumSize;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ namespace Content.Client.GameObjects.Components.Chemistry
|
|||||||
_window = new ReagentDispenserWindow
|
_window = new ReagentDispenserWindow
|
||||||
{
|
{
|
||||||
Title = _localizationManager.GetString("Reagent dispenser"),
|
Title = _localizationManager.GetString("Reagent dispenser"),
|
||||||
Size = (500, 600)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_window.OpenCenteredMinSize();
|
_window.OpenCenteredMinSize();
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ namespace Content.Client.GameObjects.Components.Chemistry
|
|||||||
[Dependency] private readonly ILocalizationManager _localizationManager;
|
[Dependency] private readonly ILocalizationManager _localizationManager;
|
||||||
#pragma warning restore 649
|
#pragma warning restore 649
|
||||||
|
|
||||||
|
protected override Vector2? CustomSize => (500, 600);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create and initialize the dispenser UI client-side. Creates the basic layout,
|
/// Create and initialize the dispenser UI client-side. Creates the basic layout,
|
||||||
/// actual data isn't filled in until the server sends data about the dispenser.
|
/// actual data isn't filled in until the server sends data about the dispenser.
|
||||||
@@ -118,7 +120,6 @@ namespace Content.Client.GameObjects.Components.Chemistry
|
|||||||
//Currently empty, when server sends state data this will have container contents and fill volume.
|
//Currently empty, when server sends state data this will have container contents and fill volume.
|
||||||
(ContainerInfo = new VBoxContainer
|
(ContainerInfo = new VBoxContainer
|
||||||
{
|
{
|
||||||
MarginLeft = 5.0f,
|
|
||||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||||
Children =
|
Children =
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -165,17 +165,16 @@ namespace Content.Client.GameObjects
|
|||||||
const int width = ButtonSize * 4 + ButtonSeparation * 3 + RightSeparation;
|
const int width = ButtonSize * 4 + ButtonSeparation * 3 + RightSeparation;
|
||||||
const int height = ButtonSize * 4 + ButtonSeparation * 3;
|
const int height = ButtonSize * 4 + ButtonSeparation * 3;
|
||||||
|
|
||||||
var windowContents = new Control {CustomMinimumSize = (width, height)};
|
var windowContents = new LayoutContainer {CustomMinimumSize = (width, height)};
|
||||||
Contents.AddChild(windowContents);
|
Contents.AddChild(windowContents);
|
||||||
|
|
||||||
void AddButton(Slots slot, string textureName, Vector2 position)
|
void AddButton(Slots slot, string textureName, Vector2 position)
|
||||||
{
|
{
|
||||||
var texture = resourceCache.GetTexture($"/Textures/UserInterface/Inventory/{textureName}.png");
|
var texture = resourceCache.GetTexture($"/Textures/UserInterface/Inventory/{textureName}.png");
|
||||||
var storageTexture = resourceCache.GetTexture("/Textures/UserInterface/Inventory/back.png");
|
var storageTexture = resourceCache.GetTexture("/Textures/UserInterface/Inventory/back.png");
|
||||||
var button = new InventoryButton(slot, texture, storageTexture)
|
var button = new InventoryButton(slot, texture, storageTexture);
|
||||||
{
|
|
||||||
Position = position
|
LayoutContainer.SetPosition(button, position);
|
||||||
};
|
|
||||||
|
|
||||||
windowContents.AddChild(button);
|
windowContents.AddChild(button);
|
||||||
buttonDict.Add(slot, button);
|
buttonDict.Add(slot, button);
|
||||||
@@ -206,8 +205,6 @@ namespace Content.Client.GameObjects
|
|||||||
AddButton(Slots.BELT, "belt", (rSep + 3 * (size + sep), size + sep));
|
AddButton(Slots.BELT, "belt", (rSep + 3 * (size + sep), size + sep));
|
||||||
AddButton(Slots.POCKET1, "pocket", (rSep + 3 * (size + sep), 2 * (size + sep)));
|
AddButton(Slots.POCKET1, "pocket", (rSep + 3 * (size + sep), 2 * (size + sep)));
|
||||||
AddButton(Slots.POCKET2, "pocket", (rSep + 3 * (size + sep), 3 * (size + sep)));
|
AddButton(Slots.POCKET2, "pocket", (rSep + 3 * (size + sep), 3 * (size + sep)));
|
||||||
|
|
||||||
Size = CombinedMinimumSize;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,8 +171,6 @@ namespace Content.Client.GameObjects.Components
|
|||||||
};
|
};
|
||||||
facialHairButton.OnPressed += args => _facialHairPickerWindow.Open();
|
facialHairButton.OnPressed += args => _facialHairPickerWindow.Open();
|
||||||
vBox.AddChild(facialHairButton);
|
vBox.AddChild(facialHairButton);
|
||||||
|
|
||||||
Size = CombinedMinimumSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ namespace Content.Client.GameObjects.Components.MedicalScanner
|
|||||||
_window = new MedicalScannerWindow
|
_window = new MedicalScannerWindow
|
||||||
{
|
{
|
||||||
Title = Owner.Owner.Name,
|
Title = Owner.Owner.Name,
|
||||||
Size = (485, 90),
|
|
||||||
};
|
};
|
||||||
_window.OnClose += Close;
|
_window.OnClose += Close;
|
||||||
_window.OpenCentered();
|
_window.OpenCentered();
|
||||||
|
|||||||
@@ -4,12 +4,15 @@ using Robust.Shared.Utility;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Client.UserInterface.CustomControls;
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
|
using Robust.Shared.Maths;
|
||||||
using static Content.Shared.GameObjects.Components.Medical.SharedMedicalScannerComponent;
|
using static Content.Shared.GameObjects.Components.Medical.SharedMedicalScannerComponent;
|
||||||
|
|
||||||
namespace Content.Client.GameObjects.Components.MedicalScanner
|
namespace Content.Client.GameObjects.Components.MedicalScanner
|
||||||
{
|
{
|
||||||
public class MedicalScannerWindow : SS14Window
|
public class MedicalScannerWindow : SS14Window
|
||||||
{
|
{
|
||||||
|
protected override Vector2? CustomSize => (485, 90);
|
||||||
|
|
||||||
public void Populate(MedicalScannerBoundUserInterfaceState state)
|
public void Populate(MedicalScannerBoundUserInterfaceState state)
|
||||||
{
|
{
|
||||||
Contents.RemoveAllChildren();
|
Contents.RemoveAllChildren();
|
||||||
|
|||||||
@@ -21,10 +21,7 @@ namespace Content.Client.GameObjects.Components.Power
|
|||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
|
|
||||||
_window = new ApcWindow
|
_window = new ApcWindow();
|
||||||
{
|
|
||||||
MarginRight = 426.0f, MarginBottom = 270.0f
|
|
||||||
};
|
|
||||||
_window.OnClose += Close;
|
_window.OnClose += Close;
|
||||||
_window.OpenCenteredMinSize();
|
_window.OpenCenteredMinSize();
|
||||||
|
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ namespace Content.Client.GameObjects.Components.Research
|
|||||||
{
|
{
|
||||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||||
MarginTop = 5f,
|
/*MarginTop = 5f,
|
||||||
MarginLeft = 5f,
|
MarginLeft = 5f,
|
||||||
MarginRight = -5f,
|
MarginRight = -5f,
|
||||||
MarginBottom = -5f,
|
MarginBottom = -5f,*/
|
||||||
};
|
};
|
||||||
|
|
||||||
margin.AddChild(_servers);
|
margin.AddChild(_servers);
|
||||||
|
|||||||
@@ -101,10 +101,10 @@ namespace Content.Client.GameObjects.Components.Storage
|
|||||||
private Label Information;
|
private Label Information;
|
||||||
public ClientStorageComponent StorageEntity;
|
public ClientStorageComponent StorageEntity;
|
||||||
|
|
||||||
|
protected override Vector2? CustomSize => (180, 320);
|
||||||
|
|
||||||
public StorageWindow()
|
public StorageWindow()
|
||||||
{
|
{
|
||||||
Size = (180, 320);
|
|
||||||
|
|
||||||
Title = "Storage Item";
|
Title = "Storage Item";
|
||||||
RectClipContent = true;
|
RectClipContent = true;
|
||||||
|
|
||||||
@@ -239,14 +239,14 @@ namespace Content.Client.GameObjects.Components.Storage
|
|||||||
SizeFlagsVertical = SizeFlags.ShrinkCenter,
|
SizeFlagsVertical = SizeFlags.ShrinkCenter,
|
||||||
Text = "Size 6",
|
Text = "Size 6",
|
||||||
Align = Label.AlignMode.Right,
|
Align = Label.AlignMode.Right,
|
||||||
AnchorLeft = 1.0f,
|
/*AnchorLeft = 1.0f,
|
||||||
AnchorRight = 1.0f,
|
AnchorRight = 1.0f,
|
||||||
AnchorBottom = 0.5f,
|
AnchorBottom = 0.5f,
|
||||||
AnchorTop = 0.5f,
|
AnchorTop = 0.5f,
|
||||||
MarginLeft = -38.0f,
|
MarginLeft = -38.0f,
|
||||||
MarginTop = -7.0f,
|
MarginTop = -7.0f,
|
||||||
MarginRight = -5.0f,
|
MarginRight = -5.0f,
|
||||||
MarginBottom = 7.0f
|
MarginBottom = 7.0f*/
|
||||||
};
|
};
|
||||||
|
|
||||||
EntityControl.AddChild(EntitySize);
|
EntityControl.AddChild(EntitySize);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
panel.AddStyleClass(StyleClassEntityTooltip);
|
panel.AddStyleClass(StyleClassEntityTooltip);
|
||||||
panel.ModulateSelfOverride = Color.LightGray.WithAlpha(0.90f);
|
panel.ModulateSelfOverride = Color.LightGray.WithAlpha(0.90f);
|
||||||
_examineTooltipOpen.AddChild(panel);
|
_examineTooltipOpen.AddChild(panel);
|
||||||
panel.SetAnchorAndMarginPreset(Control.LayoutPreset.Wide);
|
//panel.SetAnchorAndMarginPreset(Control.LayoutPreset.Wide);
|
||||||
var vBox = new VBoxContainer();
|
var vBox = new VBoxContainer();
|
||||||
panel.AddChild(vBox);
|
panel.AddChild(vBox);
|
||||||
var hBox = new HBoxContainer { SeparationOverride = 5};
|
var hBox = new HBoxContainer { SeparationOverride = 5};
|
||||||
@@ -145,7 +145,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_examineTooltipOpen.Position += Vector2.ComponentMin(Vector2.Zero,_userInterfaceManager.StateRoot.Size - (panel.Size + _examineTooltipOpen.Position));
|
//_examineTooltipOpen.Position += Vector2.ComponentMin(Vector2.Zero,_userInterfaceManager.StateRoot.Size - (panel.Size + _examineTooltipOpen.Position));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseTooltip()
|
public void CloseTooltip()
|
||||||
|
|||||||
@@ -198,14 +198,14 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
vBox.AddChild(panel);
|
vBox.AddChild(panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
_currentPopup.Size = vBox.CombinedMinimumSize;
|
//_currentPopup.Size = vBox.CombinedMinimumSize;
|
||||||
|
|
||||||
// If we're at the bottom of the window and the menu would go below the bottom of the window,
|
// If we're at the bottom of the window and the menu would go below the bottom of the window,
|
||||||
// shift it up so it extends UP.
|
// shift it up so it extends UP.
|
||||||
var bottomCoords = vBox.CombinedMinimumSize.Y + _currentPopup.Position.Y;
|
var bottomCoords = vBox.CombinedMinimumSize.Y + _currentPopup.Position.Y;
|
||||||
if (bottomCoords > _userInterfaceManager.StateRoot.Size.Y)
|
if (bottomCoords > _userInterfaceManager.StateRoot.Size.Y)
|
||||||
{
|
{
|
||||||
_currentPopup.Position = _currentPopup.Position - new Vector2(0, vBox.CombinedMinimumSize.Y);
|
// _currentPopup.Position = _currentPopup.Position - new Vector2(0, vBox.CombinedMinimumSize.Y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using Robust.Client.Interfaces.ResourceManagement;
|
|||||||
using Robust.Client.Interfaces.UserInterface;
|
using Robust.Client.Interfaces.UserInterface;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Shared.Input;
|
using Robust.Shared.Input;
|
||||||
using Robust.Shared.Interfaces.Network;
|
using Robust.Shared.Interfaces.Network;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
@@ -191,7 +192,7 @@ namespace Content.Client.GameTicking
|
|||||||
_lobby = new LobbyGui(_localization, _resourceCache);
|
_lobby = new LobbyGui(_localization, _resourceCache);
|
||||||
_userInterfaceManager.StateRoot.AddChild(_lobby);
|
_userInterfaceManager.StateRoot.AddChild(_lobby);
|
||||||
|
|
||||||
_lobby.SetAnchorAndMarginPreset(Control.LayoutPreset.Wide, margin: 20);
|
LayoutContainer.SetAnchorPreset(_lobby, LayoutContainer.LayoutPreset.Wide);
|
||||||
|
|
||||||
_chatManager.SetChatBox(_lobby.Chat);
|
_chatManager.SetChatBox(_lobby.Chat);
|
||||||
_lobby.Chat.DefaultChatFormat = "ooc \"{0}\"";
|
_lobby.Chat.DefaultChatFormat = "ooc \"{0}\"";
|
||||||
@@ -246,6 +247,11 @@ namespace Content.Client.GameTicking
|
|||||||
|
|
||||||
_gameChat = new ChatBox();
|
_gameChat = new ChatBox();
|
||||||
_userInterfaceManager.StateRoot.AddChild(_gameChat);
|
_userInterfaceManager.StateRoot.AddChild(_gameChat);
|
||||||
|
LayoutContainer.SetAnchorAndMarginPreset(_gameChat, LayoutContainer.LayoutPreset.TopRight, margin: 10);
|
||||||
|
LayoutContainer.SetAnchorAndMarginPreset(_gameChat, LayoutContainer.LayoutPreset.TopRight, margin: 10);
|
||||||
|
LayoutContainer.SetMarginLeft(_gameChat, -475);
|
||||||
|
LayoutContainer.SetMarginBottom(_gameChat, 235);
|
||||||
|
|
||||||
_userInterfaceManager.StateRoot.AddChild(_gameHud.RootControl);
|
_userInterfaceManager.StateRoot.AddChild(_gameHud.RootControl);
|
||||||
_chatManager.SetChatBox(_gameChat);
|
_chatManager.SetChatBox(_gameChat);
|
||||||
_gameChat.DefaultChatFormat = "say \"{0}\"";
|
_gameChat.DefaultChatFormat = "say \"{0}\"";
|
||||||
@@ -261,6 +267,7 @@ namespace Content.Client.GameTicking
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
chat.Input.IgnoreNext = true;
|
chat.Input.IgnoreNext = true;
|
||||||
chat.Input.GrabKeyboardFocus();
|
chat.Input.GrabKeyboardFocus();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,22 +37,14 @@ namespace Content.Client.Instruments
|
|||||||
{
|
{
|
||||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||||
MarginTop = 5f,
|
|
||||||
MarginLeft = 5f,
|
|
||||||
MarginRight = -5f,
|
|
||||||
MarginBottom = -5f,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
margin.SetAnchorAndMarginPreset(LayoutPreset.Wide);
|
|
||||||
|
|
||||||
var vBox = new VBoxContainer()
|
var vBox = new VBoxContainer()
|
||||||
{
|
{
|
||||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||||
SeparationOverride = 5,
|
SeparationOverride = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
vBox.SetAnchorAndMarginPreset(LayoutPreset.Wide);
|
|
||||||
|
|
||||||
var hBoxTopButtons = new HBoxContainer()
|
var hBoxTopButtons = new HBoxContainer()
|
||||||
{
|
{
|
||||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||||
|
|||||||
@@ -47,22 +47,14 @@ namespace Content.Client.Research
|
|||||||
{
|
{
|
||||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||||
MarginTop = 5f,
|
|
||||||
MarginLeft = 5f,
|
|
||||||
MarginRight = -5f,
|
|
||||||
MarginBottom = -5f,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
margin.SetAnchorAndMarginPreset(LayoutPreset.Wide);
|
|
||||||
|
|
||||||
var vBox = new VBoxContainer()
|
var vBox = new VBoxContainer()
|
||||||
{
|
{
|
||||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||||
SeparationOverride = 5,
|
SeparationOverride = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
vBox.SetAnchorAndMarginPreset(LayoutPreset.Wide);
|
|
||||||
|
|
||||||
var hBoxButtons = new HBoxContainer()
|
var hBoxButtons = new HBoxContainer()
|
||||||
{
|
{
|
||||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||||
@@ -100,8 +92,6 @@ namespace Content.Client.Research
|
|||||||
SizeFlagsStretchRatio = 3,
|
SizeFlagsStretchRatio = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
spacer.SetAnchorAndMarginPreset(LayoutPreset.Wide);
|
|
||||||
|
|
||||||
var hBoxFilter = new HBoxContainer()
|
var hBoxFilter = new HBoxContainer()
|
||||||
{
|
{
|
||||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||||
|
|||||||
@@ -27,24 +27,24 @@ namespace Content.Client.Research
|
|||||||
|
|
||||||
var margin = new MarginContainer()
|
var margin = new MarginContainer()
|
||||||
{
|
{
|
||||||
MarginTop = 5f,
|
/*MarginTop = 5f,
|
||||||
MarginLeft = 5f,
|
MarginLeft = 5f,
|
||||||
MarginRight = -5f,
|
MarginRight = -5f,
|
||||||
MarginBottom = -5f,
|
MarginBottom = -5f,*/
|
||||||
};
|
};
|
||||||
|
|
||||||
margin.SetAnchorAndMarginPreset(LayoutPreset.Wide);
|
// margin.SetAnchorAndMarginPreset(LayoutPreset.Wide);
|
||||||
|
|
||||||
var vBox = new VBoxContainer();
|
var vBox = new VBoxContainer();
|
||||||
|
|
||||||
vBox.SetAnchorAndMarginPreset(LayoutPreset.Wide);
|
// vBox.SetAnchorAndMarginPreset(LayoutPreset.Wide);
|
||||||
|
|
||||||
var descMargin = new MarginContainer()
|
var descMargin = new MarginContainer()
|
||||||
{
|
{
|
||||||
MarginTop = 5f,
|
/*MarginTop = 5f,
|
||||||
MarginLeft = 5f,
|
MarginLeft = 5f,
|
||||||
MarginRight = -5f,
|
MarginRight = -5f,
|
||||||
MarginBottom = -5f,
|
MarginBottom = -5f,*/
|
||||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||||
SizeFlagsStretchRatio = 2,
|
SizeFlagsStretchRatio = 2,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ namespace Content.Client.Sandbox
|
|||||||
SpawnTilesButton
|
SpawnTilesButton
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Size = CombinedMinimumSize;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,15 +59,9 @@ namespace Content.Client.UserInterface.Cargo
|
|||||||
else
|
else
|
||||||
Title = _loc.GetString("Cargo Shuttle Console");
|
Title = _loc.GetString("Cargo Shuttle Console");
|
||||||
|
|
||||||
var rows = new VBoxContainer
|
var rows = new VBoxContainer();
|
||||||
{
|
|
||||||
MarginTop = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
var accountName = new HBoxContainer()
|
var accountName = new HBoxContainer();
|
||||||
{
|
|
||||||
MarginTop = 0
|
|
||||||
};
|
|
||||||
var accountNameLabel = new Label {
|
var accountNameLabel = new Label {
|
||||||
Text = _loc.GetString("Account Name: "),
|
Text = _loc.GetString("Account Name: "),
|
||||||
StyleClasses = { NanoStyle.StyleClassLabelKeyText }
|
StyleClasses = { NanoStyle.StyleClassLabelKeyText }
|
||||||
|
|||||||
@@ -38,10 +38,6 @@ namespace Content.Client.UserInterface.Cargo
|
|||||||
{
|
{
|
||||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||||
MarginTop = 5f,
|
|
||||||
MarginLeft = 5f,
|
|
||||||
MarginRight = -5f,
|
|
||||||
MarginBottom = -5f,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
margin.AddChild(_accounts);
|
margin.AddChild(_accounts);
|
||||||
|
|||||||
@@ -73,8 +73,6 @@ namespace Content.Client.UserInterface
|
|||||||
QuitButton = new Button {Text = "Quit"};
|
QuitButton = new Button {Text = "Quit"};
|
||||||
QuitButton.OnPressed += OnQuitButtonClicked;
|
QuitButton.OnPressed += OnQuitButtonClicked;
|
||||||
vBox.AddChild(QuitButton);
|
vBox.AddChild(QuitButton);
|
||||||
|
|
||||||
Size = CombinedMinimumSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnQuitButtonClicked(BaseButton.ButtonEventArgs args)
|
private void OnQuitButtonClicked(BaseButton.ButtonEventArgs args)
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ namespace Content.Client.UserInterface
|
|||||||
|
|
||||||
public Control HandsContainer { get; private set; }
|
public Control HandsContainer { get; private set; }
|
||||||
public Control InventoryQuickButtonContainer { get; private set; }
|
public Control InventoryQuickButtonContainer { get; private set; }
|
||||||
|
|
||||||
public bool CombatPanelVisible
|
public bool CombatPanelVisible
|
||||||
{
|
{
|
||||||
get => _combatPanelContainer.Visible;
|
get => _combatPanelContainer.Visible;
|
||||||
@@ -105,9 +106,8 @@ namespace Content.Client.UserInterface
|
|||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
RootControl = new Control {MouseFilter = Control.MouseFilterMode.Ignore};
|
RootControl = new LayoutContainer {MouseFilter = Control.MouseFilterMode.Ignore};
|
||||||
|
LayoutContainer.SetAnchorPreset(RootControl, LayoutContainer.LayoutPreset.Wide);
|
||||||
RootControl.SetAnchorPreset(Control.LayoutPreset.Wide);
|
|
||||||
|
|
||||||
var escapeTexture = _resourceCache.GetTexture("/Textures/UserInterface/hamburger.svg.96dpi.png");
|
var escapeTexture = _resourceCache.GetTexture("/Textures/UserInterface/hamburger.svg.96dpi.png");
|
||||||
var characterTexture = _resourceCache.GetTexture("/Textures/UserInterface/character.svg.96dpi.png");
|
var characterTexture = _resourceCache.GetTexture("/Textures/UserInterface/character.svg.96dpi.png");
|
||||||
@@ -122,7 +122,9 @@ namespace Content.Client.UserInterface
|
|||||||
};
|
};
|
||||||
|
|
||||||
RootControl.AddChild(_topButtonsContainer);
|
RootControl.AddChild(_topButtonsContainer);
|
||||||
_topButtonsContainer.SetAnchorAndMarginPreset(Control.LayoutPreset.TopLeft, margin: 10);
|
|
||||||
|
LayoutContainer.SetAnchorAndMarginPreset(_topButtonsContainer, LayoutContainer.LayoutPreset.TopLeft,
|
||||||
|
margin: 10);
|
||||||
|
|
||||||
// TODO: Pull key names here from the actual key binding config.
|
// TODO: Pull key names here from the actual key binding config.
|
||||||
// Escape
|
// Escape
|
||||||
@@ -198,25 +200,22 @@ namespace Content.Client.UserInterface
|
|||||||
|
|
||||||
var inventoryContainer = new HBoxContainer
|
var inventoryContainer = new HBoxContainer
|
||||||
{
|
{
|
||||||
GrowHorizontal = Control.GrowDirection.Begin,
|
|
||||||
GrowVertical = Control.GrowDirection.Begin,
|
|
||||||
SeparationOverride = 10
|
SeparationOverride = 10
|
||||||
};
|
};
|
||||||
|
|
||||||
RootControl.AddChild(inventoryContainer);
|
RootControl.AddChild(inventoryContainer);
|
||||||
inventoryContainer.SetAnchorAndMarginPreset(Control.LayoutPreset.BottomRight);
|
|
||||||
|
LayoutContainer.SetGrowHorizontal(inventoryContainer, LayoutContainer.GrowDirection.Begin);
|
||||||
|
LayoutContainer.SetGrowVertical(inventoryContainer, LayoutContainer.GrowDirection.Begin);
|
||||||
|
LayoutContainer.SetAnchorAndMarginPreset(inventoryContainer, LayoutContainer.LayoutPreset.BottomRight);
|
||||||
|
|
||||||
InventoryQuickButtonContainer = new MarginContainer
|
InventoryQuickButtonContainer = new MarginContainer
|
||||||
{
|
{
|
||||||
GrowHorizontal = Control.GrowDirection.Begin,
|
|
||||||
GrowVertical = Control.GrowDirection.Begin,
|
|
||||||
SizeFlagsVertical = Control.SizeFlags.ShrinkEnd
|
SizeFlagsVertical = Control.SizeFlags.ShrinkEnd
|
||||||
};
|
};
|
||||||
|
|
||||||
HandsContainer = new MarginContainer
|
HandsContainer = new MarginContainer
|
||||||
{
|
{
|
||||||
GrowHorizontal = Control.GrowDirection.Both,
|
|
||||||
GrowVertical = Control.GrowDirection.Begin,
|
|
||||||
SizeFlagsVertical = Control.SizeFlags.ShrinkEnd
|
SizeFlagsVertical = Control.SizeFlags.ShrinkEnd
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -337,7 +336,6 @@ namespace Content.Client.UserInterface
|
|||||||
private static readonly Color ColorHovered = Color.FromHex("#9699bb");
|
private static readonly Color ColorHovered = Color.FromHex("#9699bb");
|
||||||
private static readonly Color ColorPressed = Color.FromHex("#789B8C");
|
private static readonly Color ColorPressed = Color.FromHex("#789B8C");
|
||||||
|
|
||||||
private readonly VBoxContainer _container;
|
|
||||||
private readonly TextureRect _textureRect;
|
private readonly TextureRect _textureRect;
|
||||||
private readonly Label _label;
|
private readonly Label _label;
|
||||||
|
|
||||||
@@ -345,9 +343,18 @@ namespace Content.Client.UserInterface
|
|||||||
{
|
{
|
||||||
ToggleMode = true;
|
ToggleMode = true;
|
||||||
|
|
||||||
_container = new VBoxContainer {MouseFilter = MouseFilterMode.Ignore};
|
AddChild(new MarginContainer
|
||||||
AddChild(_container);
|
{
|
||||||
_container.AddChild(_textureRect = new TextureRect
|
MouseFilter = MouseFilterMode.Ignore,
|
||||||
|
MarginTopOverride = 4,
|
||||||
|
Children =
|
||||||
|
{
|
||||||
|
new VBoxContainer
|
||||||
|
{
|
||||||
|
MouseFilter = MouseFilterMode.Ignore,
|
||||||
|
Children =
|
||||||
|
{
|
||||||
|
(_textureRect = new TextureRect
|
||||||
{
|
{
|
||||||
Texture = texture,
|
Texture = texture,
|
||||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||||
@@ -356,27 +363,27 @@ namespace Content.Client.UserInterface
|
|||||||
ModulateSelfOverride = ColorNormal,
|
ModulateSelfOverride = ColorNormal,
|
||||||
CustomMinimumSize = (0, 32),
|
CustomMinimumSize = (0, 32),
|
||||||
Stretch = TextureRect.StretchMode.KeepCentered
|
Stretch = TextureRect.StretchMode.KeepCentered
|
||||||
});
|
}),
|
||||||
|
(_label = new Label
|
||||||
_container.AddChild(_label = new Label
|
|
||||||
{
|
{
|
||||||
Text = keyName,
|
Text = keyName,
|
||||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||||
MouseFilter = MouseFilterMode.Ignore,
|
MouseFilter = MouseFilterMode.Ignore,
|
||||||
ModulateSelfOverride = ColorNormal
|
ModulateSelfOverride = ColorNormal,
|
||||||
|
StyleClasses = {StyleClassLabelTopButton}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_label.AddStyleClass(StyleClassLabelTopButton);
|
|
||||||
|
|
||||||
_container.SetAnchorAndMarginPreset(LayoutPreset.Wide);
|
|
||||||
|
|
||||||
DrawModeChanged();
|
DrawModeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Vector2 CalculateMinimumSize()
|
protected override Vector2 CalculateMinimumSize()
|
||||||
{
|
{
|
||||||
var styleSize = ActualStyleBox?.MinimumSize ?? Vector2.Zero;
|
var styleSize = ActualStyleBox?.MinimumSize ?? Vector2.Zero;
|
||||||
return (0, 4) + styleSize + _container?.CombinedMinimumSize ?? Vector2.Zero;
|
return (0, 4) + styleSize + base.CalculateMinimumSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Draw(DrawingHandleScreen handle)
|
protected override void Draw(DrawingHandleScreen handle)
|
||||||
@@ -420,21 +427,15 @@ namespace Content.Client.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void StylePropertiesChanged()
|
protected override void LayoutUpdateOverride()
|
||||||
{
|
{
|
||||||
base.StylePropertiesChanged();
|
|
||||||
|
|
||||||
if (_container == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var box = ActualStyleBox ?? new StyleBoxEmpty();
|
var box = ActualStyleBox ?? new StyleBoxEmpty();
|
||||||
|
var contentBox = box.GetContentBox(PixelSizeBox);
|
||||||
|
|
||||||
_container.MarginLeft = box.GetContentMargin(StyleBox.Margin.Left);
|
foreach (var child in Children)
|
||||||
_container.MarginRight = -box.GetContentMargin(StyleBox.Margin.Right);
|
{
|
||||||
_container.MarginTop = box.GetContentMargin(StyleBox.Margin.Top) + 4;
|
FitChildInPixelBox(child, (UIBox2i) contentBox);
|
||||||
_container.MarginBottom = -box.GetContentMargin(StyleBox.Margin.Bottom);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ namespace Content.Client.UserInterface
|
|||||||
private readonly TextureRect CooldownCircleLeft;
|
private readonly TextureRect CooldownCircleLeft;
|
||||||
private readonly TextureRect CooldownCircleRight;
|
private readonly TextureRect CooldownCircleRight;
|
||||||
|
|
||||||
|
private readonly Control _leftContainer;
|
||||||
|
private readonly Control _rightContainer;
|
||||||
|
|
||||||
public HandsGui()
|
public HandsGui()
|
||||||
{
|
{
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
@@ -72,30 +75,35 @@ namespace Content.Client.UserInterface
|
|||||||
_resourceCache.GetTexture($"/Textures/UserInterface/Inventory/cooldown-{i}.png");
|
_resourceCache.GetTexture($"/Textures/UserInterface/Inventory/cooldown-{i}.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
AddChild(new TextureRect
|
_leftContainer = new Control {MouseFilter = MouseFilterMode.Ignore};
|
||||||
|
_rightContainer = new Control {MouseFilter = MouseFilterMode.Ignore};
|
||||||
|
var hBox = new HBoxContainer
|
||||||
|
{
|
||||||
|
SeparationOverride = 0,
|
||||||
|
Children = {_rightContainer, _leftContainer},
|
||||||
|
MouseFilter = MouseFilterMode.Ignore
|
||||||
|
};
|
||||||
|
|
||||||
|
AddChild(hBox);
|
||||||
|
|
||||||
|
_leftContainer.AddChild(new TextureRect
|
||||||
{
|
{
|
||||||
MouseFilter = MouseFilterMode.Ignore,
|
MouseFilter = MouseFilterMode.Ignore,
|
||||||
Texture = TextureHandLeft,
|
Texture = TextureHandLeft,
|
||||||
Size = _handL.Size,
|
|
||||||
Position = _handL.TopLeft,
|
|
||||||
TextureScale = (2, 2)
|
TextureScale = (2, 2)
|
||||||
});
|
});
|
||||||
|
|
||||||
AddChild(new TextureRect
|
_rightContainer.AddChild(new TextureRect
|
||||||
{
|
{
|
||||||
MouseFilter = MouseFilterMode.Ignore,
|
MouseFilter = MouseFilterMode.Ignore,
|
||||||
Texture = TextureHandRight,
|
Texture = TextureHandRight,
|
||||||
Size = _handR.Size,
|
|
||||||
Position = _handR.TopLeft,
|
|
||||||
TextureScale = (2, 2)
|
TextureScale = (2, 2)
|
||||||
});
|
});
|
||||||
|
|
||||||
AddChild(ActiveHandRect = new TextureRect
|
_leftContainer.AddChild(ActiveHandRect = new TextureRect
|
||||||
{
|
{
|
||||||
MouseFilter = MouseFilterMode.Ignore,
|
MouseFilter = MouseFilterMode.Ignore,
|
||||||
Texture = TextureHandActive,
|
Texture = TextureHandActive,
|
||||||
Size = _handL.Size,
|
|
||||||
Position = _handL.TopLeft,
|
|
||||||
TextureScale = (2, 2)
|
TextureScale = (2, 2)
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -104,43 +112,31 @@ namespace Content.Client.UserInterface
|
|||||||
MouseFilter = MouseFilterMode.Ignore,
|
MouseFilter = MouseFilterMode.Ignore,
|
||||||
Scale = (2, 2)
|
Scale = (2, 2)
|
||||||
};
|
};
|
||||||
AddChild(LeftSpriteView);
|
_leftContainer.AddChild(LeftSpriteView);
|
||||||
LeftSpriteView.Size = _handL.Size;
|
|
||||||
LeftSpriteView.Position = _handL.TopLeft;
|
|
||||||
|
|
||||||
RightSpriteView = new SpriteView
|
RightSpriteView = new SpriteView
|
||||||
{
|
{
|
||||||
MouseFilter = MouseFilterMode.Ignore,
|
MouseFilter = MouseFilterMode.Ignore,
|
||||||
Scale = (2, 2)
|
Scale = (2, 2)
|
||||||
};
|
};
|
||||||
AddChild(RightSpriteView);
|
_rightContainer.AddChild(RightSpriteView);
|
||||||
RightSpriteView.Size = _handR.Size;
|
|
||||||
RightSpriteView.Position = _handR.TopLeft;
|
|
||||||
|
|
||||||
// Cooldown circles.
|
// Cooldown circles.
|
||||||
AddChild(CooldownCircleLeft = new TextureRect
|
_leftContainer.AddChild(CooldownCircleLeft = new TextureRect
|
||||||
{
|
{
|
||||||
MouseFilter = MouseFilterMode.Ignore,
|
MouseFilter = MouseFilterMode.Ignore,
|
||||||
Position = _handL.TopLeft + (8, 8),
|
|
||||||
TextureScale = (2, 2),
|
TextureScale = (2, 2),
|
||||||
Visible = false,
|
Visible = false,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddChild(CooldownCircleRight = new TextureRect
|
_rightContainer.AddChild(CooldownCircleRight = new TextureRect
|
||||||
{
|
{
|
||||||
MouseFilter = MouseFilterMode.Ignore,
|
MouseFilter = MouseFilterMode.Ignore,
|
||||||
Position = _handR.TopLeft + (8, 8),
|
|
||||||
TextureScale = (2, 2),
|
TextureScale = (2, 2),
|
||||||
Visible = false
|
Visible = false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Vector2 CalculateMinimumSize()
|
|
||||||
{
|
|
||||||
return new Vector2(BoxSize * 2 + BoxSpacing, BoxSize) * UIScale;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the hands component controling this gui, returns true if successful and false if failure
|
/// Gets the hands component controling this gui, returns true if successful and false if failure
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -169,7 +165,9 @@ namespace Content.Client.UserInterface
|
|||||||
var left = hands.GetEntity("left");
|
var left = hands.GetEntity("left");
|
||||||
var right = hands.GetEntity("right");
|
var right = hands.GetEntity("right");
|
||||||
|
|
||||||
ActiveHandRect.Position = hands.ActiveIndex == "left" ? _handL.TopLeft : _handR.TopLeft;
|
ActiveHandRect.Parent.RemoveChild(ActiveHandRect);
|
||||||
|
var parent = hands.ActiveIndex == "left" ? _leftContainer : _rightContainer;
|
||||||
|
parent.AddChild(ActiveHandRect);
|
||||||
|
|
||||||
if (left != null)
|
if (left != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,6 +22,16 @@ namespace Content.Client.UserInterface
|
|||||||
|
|
||||||
public LobbyGui(ILocalizationManager localization, IResourceCache resourceCache)
|
public LobbyGui(ILocalizationManager localization, IResourceCache resourceCache)
|
||||||
{
|
{
|
||||||
|
var margin = new MarginContainer
|
||||||
|
{
|
||||||
|
MarginBottomOverride = 20,
|
||||||
|
MarginLeftOverride = 20,
|
||||||
|
MarginRightOverride = 20,
|
||||||
|
MarginTopOverride = 20,
|
||||||
|
};
|
||||||
|
|
||||||
|
AddChild(margin);
|
||||||
|
|
||||||
var panelTex = resourceCache.GetTexture("/Nano/button.svg.96dpi.png");
|
var panelTex = resourceCache.GetTexture("/Nano/button.svg.96dpi.png");
|
||||||
var back = new StyleBoxTexture
|
var back = new StyleBoxTexture
|
||||||
{
|
{
|
||||||
@@ -30,53 +40,58 @@ namespace Content.Client.UserInterface
|
|||||||
};
|
};
|
||||||
back.SetPatchMargin(StyleBox.Margin.All, 10);
|
back.SetPatchMargin(StyleBox.Margin.All, 10);
|
||||||
|
|
||||||
var panel = new Panel
|
var panel = new PanelContainer
|
||||||
{
|
{
|
||||||
PanelOverride = back
|
PanelOverride = back
|
||||||
};
|
};
|
||||||
|
|
||||||
AddChild(panel);
|
margin.AddChild(panel);
|
||||||
|
|
||||||
panel.SetAnchorAndMarginPreset(LayoutPreset.Wide);
|
|
||||||
|
|
||||||
var vBox = new VBoxContainer {SeparationOverride = 0};
|
var vBox = new VBoxContainer {SeparationOverride = 0};
|
||||||
|
|
||||||
vBox.SetAnchorAndMarginPreset(LayoutPreset.Wide);
|
margin.AddChild(vBox);
|
||||||
|
|
||||||
vBox.MarginTop = 40;
|
var topHBox = new HBoxContainer
|
||||||
|
{
|
||||||
AddChild(vBox);
|
CustomMinimumSize = (0, 40),
|
||||||
|
Children =
|
||||||
AddChild(new Label
|
{
|
||||||
|
new MarginContainer
|
||||||
|
{
|
||||||
|
MarginLeftOverride = 8,
|
||||||
|
Children =
|
||||||
|
{
|
||||||
|
new Label
|
||||||
{
|
{
|
||||||
Text = localization.GetString("Lobby"),
|
Text = localization.GetString("Lobby"),
|
||||||
StyleClasses = {NanoStyle.StyleClassLabelHeadingBigger},
|
StyleClasses = {NanoStyle.StyleClassLabelHeadingBigger},
|
||||||
MarginBottom = 40,
|
/*MarginBottom = 40,
|
||||||
MarginLeft = 8,
|
MarginLeft = 8,*/
|
||||||
VAlign = Label.VAlignMode.Center
|
VAlign = Label.VAlignMode.Center
|
||||||
});
|
}
|
||||||
|
}
|
||||||
AddChild(ServerName = new Label
|
},
|
||||||
|
(ServerName = new Label
|
||||||
{
|
{
|
||||||
StyleClasses = {NanoStyle.StyleClassLabelHeadingBigger},
|
StyleClasses = {NanoStyle.StyleClassLabelHeadingBigger},
|
||||||
MarginBottom = 40,
|
/*MarginBottom = 40,
|
||||||
GrowHorizontal = GrowDirection.Both,
|
GrowHorizontal = GrowDirection.Both,*/
|
||||||
VAlign = Label.VAlignMode.Center
|
VAlign = Label.VAlignMode.Center,
|
||||||
});
|
SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkCenter
|
||||||
|
}),
|
||||||
ServerName.SetAnchorAndMarginPreset(LayoutPreset.CenterTop);
|
(LeaveButton = new Button
|
||||||
|
|
||||||
AddChild(LeaveButton = new Button
|
|
||||||
{
|
{
|
||||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
|
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
|
||||||
Text = localization.GetString("Leave"),
|
Text = localization.GetString("Leave"),
|
||||||
StyleClasses = {NanoStyle.StyleClassButtonBig},
|
StyleClasses = {NanoStyle.StyleClassButtonBig},
|
||||||
GrowHorizontal = GrowDirection.Begin
|
//GrowHorizontal = GrowDirection.Begin
|
||||||
});
|
})
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
LeaveButton.SetAnchorAndMarginPreset(LayoutPreset.TopRight);
|
vBox.AddChild(topHBox);
|
||||||
|
|
||||||
vBox.AddChild(new Panel
|
vBox.AddChild(new PanelContainer
|
||||||
{
|
{
|
||||||
PanelOverride = new StyleBoxFlat
|
PanelOverride = new StyleBoxFlat
|
||||||
{
|
{
|
||||||
@@ -164,7 +179,7 @@ namespace Content.Client.UserInterface
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
hBox.AddChild(new Panel
|
hBox.AddChild(new PanelContainer
|
||||||
{
|
{
|
||||||
PanelOverride = new StyleBoxFlat {BackgroundColor = NanoStyle.NanoGold}, CustomMinimumSize = (2, 0)
|
PanelOverride = new StyleBoxFlat {BackgroundColor = NanoStyle.NanoGold}, CustomMinimumSize = (2, 0)
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace Content.Client.UserInterface
|
|||||||
return _panel.CombinedMinimumSize;
|
return _panel.CombinedMinimumSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SortChildren()
|
protected override void LayoutUpdateOverride()
|
||||||
{
|
{
|
||||||
FitChildInBox(_panel, SizeBox);
|
FitChildInBox(_panel, SizeBox);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ namespace Content.Client.UserInterface
|
|||||||
Texture = windowHeaderTex,
|
Texture = windowHeaderTex,
|
||||||
PatchMarginBottom = 3,
|
PatchMarginBottom = 3,
|
||||||
ExpandMarginBottom = 3,
|
ExpandMarginBottom = 3,
|
||||||
|
ContentMarginBottomOverride = 0
|
||||||
};
|
};
|
||||||
var windowBackgroundTex = resCache.GetTexture("/Nano/window_background.png");
|
var windowBackgroundTex = resCache.GetTexture("/Nano/window_background.png");
|
||||||
var windowBackground = new StyleBoxTexture
|
var windowBackground = new StyleBoxTexture
|
||||||
@@ -223,14 +224,14 @@ namespace Content.Client.UserInterface
|
|||||||
new SelectorElement(null, new[] {SS14Window.StyleClassWindowPanel}, null, null),
|
new SelectorElement(null, new[] {SS14Window.StyleClassWindowPanel}, null, null),
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty(Panel.StylePropertyPanel, windowBackground),
|
new StyleProperty(PanelContainer.StylePropertyPanel, windowBackground),
|
||||||
}),
|
}),
|
||||||
// Window header.
|
// Window header.
|
||||||
new StyleRule(
|
new StyleRule(
|
||||||
new SelectorElement(typeof(Panel), new[] {SS14Window.StyleClassWindowHeader}, null, null),
|
new SelectorElement(typeof(PanelContainer), new[] {SS14Window.StyleClassWindowHeader}, null, null),
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty(Panel.StylePropertyPanel, windowHeader),
|
new StyleProperty(PanelContainer.StylePropertyPanel, windowHeader),
|
||||||
}),
|
}),
|
||||||
// Window close button base texture.
|
// Window close button base texture.
|
||||||
new StyleRule(
|
new StyleRule(
|
||||||
|
|||||||
@@ -13,11 +13,13 @@ namespace Content.Client.UserInterface
|
|||||||
|
|
||||||
public StatusEffectsUI()
|
public StatusEffectsUI()
|
||||||
{
|
{
|
||||||
_vBox = new VBoxContainer {GrowHorizontal = GrowDirection.Begin};
|
_vBox = new VBoxContainer();
|
||||||
|
MouseFilter = Control.MouseFilterMode.Ignore;
|
||||||
AddChild(_vBox);
|
AddChild(_vBox);
|
||||||
SetAnchorAndMarginPreset(LayoutPreset.TopRight);
|
|
||||||
MarginTop = 250;
|
LayoutContainer.SetGrowHorizontal(this, LayoutContainer.GrowDirection.Begin);
|
||||||
MarginRight = 10;
|
LayoutContainer.SetAnchorAndMarginPreset(this, LayoutContainer.LayoutPreset.TopRight, margin: 10);
|
||||||
|
LayoutContainer.SetMarginTop(this, 250);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace Content.Client.UserInterface
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SortChildren()
|
protected override void LayoutUpdateOverride()
|
||||||
{
|
{
|
||||||
var box = SizeBox;
|
var box = SizeBox;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Client.UserInterface.CustomControls;
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Client.UserInterface
|
namespace Content.Client.UserInterface
|
||||||
@@ -30,6 +31,8 @@ You can't attack anybody with it off, so no more hitting yourself with your own
|
|||||||
If you have any feedback, questions, bug reports, etc..., do not be afraid to tell us!
|
If you have any feedback, questions, bug reports, etc..., do not be afraid to tell us!
|
||||||
You can ask on Discord or heck, just write it in OOC! We'll catch it.";
|
You can ask on Discord or heck, just write it in OOC! We'll catch it.";
|
||||||
|
|
||||||
|
protected override Vector2? CustomSize => (300, 400);
|
||||||
|
|
||||||
public TutorialWindow()
|
public TutorialWindow()
|
||||||
{
|
{
|
||||||
Title = "The Tutorial!";
|
Title = "The Tutorial!";
|
||||||
|
|||||||
@@ -9,13 +9,13 @@
|
|||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
id="svg8"
|
id="svg8"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
viewBox="0 0 53.436268 53.436275"
|
viewBox="0 0 5.8212397 5.8208341"
|
||||||
height="53.436275mm"
|
height="22.000004"
|
||||||
width="53.436268mm"
|
width="22"
|
||||||
sodipodi:docname="cross.svg"
|
sodipodi:docname="cross.svg"
|
||||||
inkscape:export-filename="/home/pj/Projects/space-station-14-content/Resources/Nano/cross.svg.png"
|
inkscape:export-filename="/home/pj/Projects/space-station-14/Resources/Nano/cross.svg.png"
|
||||||
inkscape:export-xdpi="15.21"
|
inkscape:export-xdpi="96"
|
||||||
inkscape:export-ydpi="15.21"
|
inkscape:export-ydpi="96"
|
||||||
inkscape:version="0.92.4 5da689c313, 2019-01-14">
|
inkscape:version="0.92.4 5da689c313, 2019-01-14">
|
||||||
<sodipodi:namedview
|
<sodipodi:namedview
|
||||||
pagecolor="#ffffff"
|
pagecolor="#ffffff"
|
||||||
@@ -26,17 +26,19 @@
|
|||||||
guidetolerance="10"
|
guidetolerance="10"
|
||||||
inkscape:pageopacity="0"
|
inkscape:pageopacity="0"
|
||||||
inkscape:pageshadow="2"
|
inkscape:pageshadow="2"
|
||||||
inkscape:window-width="1347"
|
inkscape:window-width="1920"
|
||||||
inkscape:window-height="915"
|
inkscape:window-height="1043"
|
||||||
id="namedview9"
|
id="namedview9"
|
||||||
showgrid="false"
|
showgrid="false"
|
||||||
inkscape:zoom="1.1685258"
|
inkscape:zoom="13.22036"
|
||||||
inkscape:cx="100.12614"
|
inkscape:cx="6.117966"
|
||||||
inkscape:cy="100.98194"
|
inkscape:cy="7.5630971"
|
||||||
inkscape:window-x="0"
|
inkscape:window-x="0"
|
||||||
inkscape:window-y="0"
|
inkscape:window-y="0"
|
||||||
inkscape:window-maximized="0"
|
inkscape:window-maximized="1"
|
||||||
inkscape:current-layer="svg8" />
|
inkscape:current-layer="layer1"
|
||||||
|
units="px"
|
||||||
|
inkscape:pagecheckerboard="true" />
|
||||||
<defs
|
<defs
|
||||||
id="defs2" />
|
id="defs2" />
|
||||||
<metadata
|
<metadata
|
||||||
@@ -47,16 +49,16 @@
|
|||||||
<dc:format>image/svg+xml</dc:format>
|
<dc:format>image/svg+xml</dc:format>
|
||||||
<dc:type
|
<dc:type
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
<dc:title />
|
<dc:title></dc:title>
|
||||||
</cc:Work>
|
</cc:Work>
|
||||||
</rdf:RDF>
|
</rdf:RDF>
|
||||||
</metadata>
|
</metadata>
|
||||||
<g
|
<g
|
||||||
transform="translate(-71.839158,-135.34432)"
|
transform="matrix(0.16766605,0,0,0.16766605,-13.535398,-24.198299)"
|
||||||
id="layer1">
|
id="layer1">
|
||||||
<g
|
<g
|
||||||
style="fill:#4b596a;fill-opacity:1"
|
style="fill:#4b596a;fill-opacity:1"
|
||||||
transform="rotate(90,69.900258,191.53805)"
|
transform="matrix(0,0.93152169,-0.93152169,0,249.95318,124.23435)"
|
||||||
id="g9787">
|
id="g9787">
|
||||||
<rect
|
<rect
|
||||||
ry="3.5718751"
|
ry="3.5718751"
|
||||||
@@ -66,18 +68,19 @@
|
|||||||
height="10.583333"
|
height="10.583333"
|
||||||
width="46.302082"
|
width="46.302082"
|
||||||
id="rect9783"
|
id="rect9783"
|
||||||
style="fill:#4b596a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.17499995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
|
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.17499995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
|
||||||
transform="rotate(135)" />
|
transform="rotate(135)" />
|
||||||
<rect
|
<rect
|
||||||
transform="rotate(45)"
|
transform="rotate(45)"
|
||||||
style="fill:#4b596a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.17499995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
|
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.17499995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
|
||||||
id="rect10332"
|
id="rect10332"
|
||||||
width="46.302082"
|
width="46.302082"
|
||||||
height="10.583333"
|
height="10.583333"
|
||||||
x="120.55424"
|
x="120.55424"
|
||||||
y="81.56115"
|
y="81.56115"
|
||||||
rx="0"
|
rx="0"
|
||||||
ry="3.5718751" />
|
ry="3.5718751"
|
||||||
|
inkscape:label="rect10332" />
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 372 B |
Submodule RobustToolbox updated: 9b15070126...6cfe6caae2
@@ -406,7 +406,7 @@ namespace SS14.Launcher
|
|||||||
|
|
||||||
visitWebsiteButton.OnPressed += _ => _uriOpener.OpenUri("https://spacestation14.io");
|
visitWebsiteButton.OnPressed += _ => _uriOpener.OpenUri("https://spacestation14.io");
|
||||||
|
|
||||||
RootControl.SetAnchorPreset(LayoutPreset.Wide);
|
//RootControl.SetAnchorPreset(LayoutPreset.Wide);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user