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");
_owner = owner;
MinSize = SetSize = (410, 490);
var resourceCache = IoCManager.Resolve<IResourceCache>();
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
public SpaceVillainArcadeMenu(SpaceVillainArcadeBoundUserInterface owner)
{
MinSize = SetSize = (400, 200);
MinSize = SetSize = (300, 225);
Title = Loc.GetString("Space Villain");
Owner = owner;
@@ -68,9 +68,7 @@ namespace Content.Client.Arcade
{Text = Loc.GetString("New Game")};
grid.AddChild(newGame);
centerContainer = new CenterContainer();
centerContainer.AddChild(grid);
Contents.AddChild(centerContainer);
Contents.AddChild(grid);
}
private void UpdateMetadata(SharedSpaceVillainArcadeComponent.SpaceVillainArcadeMetaDataUpdateMessage message)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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