Skip to content

Commit

Permalink
Fix UI layout bugs with the PA.
Browse files Browse the repository at this point in the history
  • Loading branch information
PJB3005 committed Feb 6, 2021
1 parent 4272716 commit 5cbb3f1
Showing 1 changed file with 45 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ public ParticleAcceleratorControlMenu(ParticleAcceleratorBoundUserInterface owne
new MarginContainer
{
MarginLeftOverride = 4,
SizeFlagsHorizontal = SizeFlags.FillExpand,
Children =
{
new VBoxContainer
{
SizeFlagsHorizontal = SizeFlags.FillExpand,
Children =
{
new HBoxContainer
Expand Down Expand Up @@ -246,55 +246,61 @@ public ParticleAcceleratorControlMenu(ParticleAcceleratorBoundUserInterface owne
}
}
},
new VBoxContainer
new MarginContainer
{
SizeFlagsHorizontal = SizeFlags.FillExpand,
CustomMinimumSize = (186, 0),
Children =
{
(_statusLabel = new Label
{
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
}),
new Control
{
CustomMinimumSize = (0, 20)
},
new PanelContainer
new VBoxContainer
{
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
PanelOverride = back2,
Children =
{
new GridContainer
(_statusLabel = new Label
{
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
}),
new Control
{
Columns = 3,
VSeparationOverride = 0,
HSeparationOverride = 0,
CustomMinimumSize = (0, 20)
},
new PanelContainer
{
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
PanelOverride = back2,
Children =
{
new Control {CustomMinimumSize = imgSize},
(_endCapTexture = Segment("end_cap")),
new Control {CustomMinimumSize = imgSize},
(_controlBoxTexture = Segment("control_box")),
(_fuelChamberTexture = Segment("fuel_chamber")),
new Control {CustomMinimumSize = imgSize},
new Control {CustomMinimumSize = imgSize},
(_powerBoxTexture = Segment("power_box")),
new Control {CustomMinimumSize = imgSize},
(_emitterLeftTexture = Segment("emitter_left")),
(_emitterCenterTexture = Segment("emitter_center")),
(_emitterRightTexture = Segment("emitter_right")),
new GridContainer
{
Columns = 3,
VSeparationOverride = 0,
HSeparationOverride = 0,
Children =
{
new Control {CustomMinimumSize = imgSize},
(_endCapTexture = Segment("end_cap")),
new Control {CustomMinimumSize = imgSize},
(_controlBoxTexture = Segment("control_box")),
(_fuelChamberTexture = Segment("fuel_chamber")),
new Control {CustomMinimumSize = imgSize},
new Control {CustomMinimumSize = imgSize},
(_powerBoxTexture = Segment("power_box")),
new Control {CustomMinimumSize = imgSize},
(_emitterLeftTexture = Segment("emitter_left")),
(_emitterCenterTexture = Segment("emitter_center")),
(_emitterRightTexture = Segment("emitter_right")),
}
}
}
}
},
(_scanButton = new Button
{
Text = Loc.GetString("Scan Parts"),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
})
}
},
(_scanButton = new Button
{
Text = Loc.GetString("Scan Parts"),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
})
}
}
}
},
}
},
new StripeBack
Expand Down Expand Up @@ -507,7 +513,7 @@ public PASegmentControl(ParticleAcceleratorControlMenu menu, IResourceCache cach
public void SetPowerState(ParticleAcceleratorUIState state, bool exists)
{
_base.ShaderOverride = exists ? null : _menu._greyScaleShader;
_base.ModulateSelfOverride = exists ? (Color?)null : new Color(127, 127, 127);
_base.ModulateSelfOverride = exists ? (Color?) null : new Color(127, 127, 127);

if (!state.Enabled || !exists)
{
Expand Down

0 comments on commit 5cbb3f1

Please sign in to comment.