Fix minsizes for all windows that needed it (#3648)

* fix minsizes

* fix scanner height, minsize->setsize for some
This commit is contained in:
mirrorcult
2021-03-15 01:38:08 -07:00
committed by GitHub
parent fe43402ef2
commit e4169ecf0d
15 changed files with 30 additions and 16 deletions

View File

@@ -59,6 +59,8 @@ namespace Content.Client.Arcade
Title = Loc.GetString("Nanotrasen Block Game"); Title = Loc.GetString("Nanotrasen Block Game");
_owner = owner; _owner = owner;
MinSize = SetSize = (410, 490);
var resourceCache = IoCManager.Resolve<IResourceCache>(); var resourceCache = IoCManager.Resolve<IResourceCache>();
var backgroundTexture = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png"); var backgroundTexture = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png");

View File

@@ -20,7 +20,7 @@ namespace Content.Client.Arcade
private readonly Button[] _gameButtons = new Button[3]; //used to disable/enable all game buttons private readonly Button[] _gameButtons = new Button[3]; //used to disable/enable all game buttons
public SpaceVillainArcadeMenu(SpaceVillainArcadeBoundUserInterface owner) public SpaceVillainArcadeMenu(SpaceVillainArcadeBoundUserInterface owner)
{ {
MinSize = SetSize = (400, 200); MinSize = SetSize = (300, 225);
Title = Loc.GetString("Space Villain"); Title = Loc.GetString("Space Villain");
Owner = owner; Owner = owner;
@@ -68,9 +68,7 @@ namespace Content.Client.Arcade
{Text = Loc.GetString("New Game")}; {Text = Loc.GetString("New Game")};
grid.AddChild(newGame); grid.AddChild(newGame);
centerContainer = new CenterContainer(); Contents.AddChild(grid);
centerContainer.AddChild(grid);
Contents.AddChild(centerContainer);
} }
private void UpdateMetadata(SharedSpaceVillainArcadeComponent.SpaceVillainArcadeMetaDataUpdateMessage message) private void UpdateMetadata(SharedSpaceVillainArcadeComponent.SpaceVillainArcadeMetaDataUpdateMessage message)

View File

@@ -36,7 +36,7 @@ namespace Content.Client.GameObjects.Components.Access
public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeManager prototypeManager) public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeManager prototypeManager)
{ {
MinSize = SetSize = (650, 270); MinSize = SetSize = (650, 290);
_owner = owner; _owner = owner;
var vBox = new VBoxContainer(); var vBox = new VBoxContainer();

View File

@@ -33,7 +33,7 @@ namespace Content.Client.GameObjects.Components.Atmos
public GasCanisterWindow() public GasCanisterWindow()
{ {
SetSize = MinSize = (300, 200); SetSize = MinSize = (450, 200);
HBoxContainer releasePressureButtons; HBoxContainer releasePressureButtons;
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer

View File

@@ -54,7 +54,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
/// </summary> /// </summary>
public ChemMasterWindow() public ChemMasterWindow()
{ {
MinSize = SetSize = (400, 200); MinSize = SetSize = (400, 525);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer

View File

@@ -67,7 +67,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ReagentDispenser
/// </summary> /// </summary>
public ReagentDispenserWindow() public ReagentDispenserWindow()
{ {
SetSize = MinSize = (500, 600); SetSize = MinSize = (590, 400);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
var dispenseAmountGroup = new ButtonGroup(); var dispenseAmountGroup = new ButtonGroup();

View File

@@ -28,7 +28,7 @@ namespace Content.Client.GameObjects.Components.Disposal
public DisposalMailingUnitWindow() public DisposalMailingUnitWindow()
{ {
MinSize = SetSize = (460, 220); MinSize = SetSize = (460, 230);
TargetList = new List<string>(); TargetList = new List<string>();
Contents.AddChild(new HBoxContainer Contents.AddChild(new HBoxContainer
{ {

View File

@@ -18,7 +18,7 @@ namespace Content.Client.GameObjects.Components.Disposal
public DisposalRouterWindow() public DisposalRouterWindow()
{ {
MinSize = SetSize = (400, 80); MinSize = SetSize = (500, 110);
Title = Loc.GetString("Disposal Router"); Title = Loc.GetString("Disposal Router");
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer

View File

@@ -18,7 +18,7 @@ namespace Content.Client.GameObjects.Components.Disposal
public DisposalTaggerWindow() public DisposalTaggerWindow()
{ {
MinSize = SetSize = (400, 80); MinSize = SetSize = (500, 110);
Title = Loc.GetString("Disposal Tagger"); Title = Loc.GetString("Disposal Tagger");
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer

View File

@@ -23,7 +23,7 @@ namespace Content.Client.GameObjects.Components.Disposal
public DisposalUnitWindow() public DisposalUnitWindow()
{ {
MinSize = SetSize = (300, 200); MinSize = SetSize = (300, 225);
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer
{ {

View File

@@ -16,7 +16,7 @@ namespace Content.Client.GameObjects.Components.MedicalScanner
private readonly Label _diagnostics; private readonly Label _diagnostics;
public MedicalScannerWindow() public MedicalScannerWindow()
{ {
MinSize = SetSize = (485, 90); SetSize = (250, 100);
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer
{ {
@@ -44,6 +44,7 @@ namespace Content.Client.GameObjects.Components.MedicalScanner
{ {
_diagnostics.Text = Loc.GetString("No patient data."); _diagnostics.Text = Loc.GetString("No patient data.");
ScanButton.Disabled = true; ScanButton.Disabled = true;
SetSize = (250, 100);
} }
else else
{ {
@@ -68,6 +69,8 @@ namespace Content.Client.GameObjects.Components.MedicalScanner
_diagnostics.Text = text.ToString(); _diagnostics.Text = text.ToString();
ScanButton.Disabled = state.IsScanned; ScanButton.Disabled = state.IsScanned;
SetSize = (250, 575);
} }
} }
} }

View File

@@ -28,6 +28,9 @@ namespace Content.Client.GameObjects.Components.Power.AME
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
Title = "Antimatter Control Unit"; Title = "Antimatter Control Unit";
MinSize = SetSize = (250, 250);
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer
{ {
Children = Children =

View File

@@ -188,7 +188,7 @@ namespace Content.Client.GameObjects.Components.Storage
public StorageWindow(ClientStorageComponent storageEntity) public StorageWindow(ClientStorageComponent storageEntity)
{ {
StorageEntity = storageEntity; StorageEntity = storageEntity;
MinSize = SetSize = (180, 320); SetSize = (200, 320);
Title = "Storage Item"; Title = "Storage Item";
RectClipContent = true; RectClipContent = true;

View File

@@ -52,7 +52,7 @@ namespace Content.Client.UserInterface.ParticleAccelerator
public ParticleAcceleratorControlMenu(ParticleAcceleratorBoundUserInterface owner) public ParticleAcceleratorControlMenu(ParticleAcceleratorBoundUserInterface owner)
{ {
SetSize = (400, 300); SetSize = (400, 320);
_greyScaleShader = IoCManager.Resolve<IPrototypeManager>().Index<ShaderPrototype>("Greyscale").Instance(); _greyScaleShader = IoCManager.Resolve<IPrototypeManager>().Index<ShaderPrototype>("Greyscale").Instance();
Owner = owner; Owner = owner;

View File

@@ -23,7 +23,7 @@ namespace Content.Client.VendingMachines
public VendingMachineMenu(VendingMachineBoundUserInterface owner) public VendingMachineMenu(VendingMachineBoundUserInterface owner)
{ {
SetSize = MinSize = (300, 450); SetSize = (300, 450);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
Owner = owner; Owner = owner;
@@ -42,17 +42,25 @@ namespace Content.Client.VendingMachines
{ {
_items.Clear(); _items.Clear();
_cachedInventory = inventory; _cachedInventory = inventory;
var longestEntry = "";
foreach (VendingMachineInventoryEntry entry in inventory) foreach (VendingMachineInventoryEntry entry in inventory)
{ {
var itemName = _prototypeManager.Index<EntityPrototype>(entry.ID).Name; var itemName = _prototypeManager.Index<EntityPrototype>(entry.ID).Name;
if (itemName.Length > longestEntry.Length)
{
longestEntry = itemName;
}
Texture? icon = null; Texture? icon = null;
if(_prototypeManager.TryIndex(entry.ID, out EntityPrototype? prototype)) if(_prototypeManager.TryIndex(entry.ID, out EntityPrototype? prototype))
{ {
icon = SpriteComponent.GetPrototypeIcon(prototype, _resourceCache).Default; icon = SpriteComponent.GetPrototypeIcon(prototype, _resourceCache).Default;
} }
_items.AddItem($"{itemName} ({entry.Amount} left)", icon); _items.AddItem($"{itemName} ({entry.Amount} left)", icon);
} }
SetSize = ((longestEntry.Length + 8) * 12, _items.Count * 40 + 50);
} }
public void ItemSelected(ItemList.ItemListSelectedEventArgs args) public void ItemSelected(ItemList.ItemListSelectedEventArgs args)