mirror of
https://github.com/Xevion/RimWorld-Hydroponics-Expanded.git
synced 2026-01-31 02:25:33 -06:00
Fix/reformat growth percentage bar drawing
This commit is contained in:
@@ -146,23 +146,28 @@ namespace HydroponicsExpanded {
|
|||||||
public override void Draw() {
|
public override void Draw() {
|
||||||
base.Draw();
|
base.Draw();
|
||||||
|
|
||||||
// TODO: Shouldn't this be checking the bay grow stage?
|
// Only draw growth percentage bar during Sowing stage
|
||||||
if (_innerContainer.Count < _capacity || !base.CanAcceptSowNow()) return;
|
if (_stage == HydroponicsStage.Grow) {
|
||||||
|
var bar = default(GenDraw.FillableBarRequest);
|
||||||
|
|
||||||
var fillableBar = default(GenDraw.FillableBarRequest);
|
bar.center = DrawPos + Vector3.up * 0.1f;
|
||||||
|
bar.size = new Vector2(3.6f, 0.6f);
|
||||||
|
bar.margin = 0.15f;
|
||||||
|
bar.fillPercent = _highestGrowth;
|
||||||
|
|
||||||
fillableBar.center = DrawPos + Vector3.up * 0.1f;
|
// Switch to red when no power is provided.
|
||||||
fillableBar.size = new Vector2(3.6f, 0.6f);
|
bar.filledMat = SolidColorMaterials.SimpleSolidColorMaterial(base.CanAcceptSowNow()
|
||||||
fillableBar.fillPercent = _highestGrowth;
|
? new Color(0.2f, 0.85f, 0.2f)
|
||||||
fillableBar.filledMat = SolidColorMaterials.SimpleSolidColorMaterial(new Color(0.2f, 0.85f, 0.2f));
|
: new Color(0.82f, 0f, 0f));
|
||||||
fillableBar.unfilledMat = SolidColorMaterials.SimpleSolidColorMaterial(new Color(0.3f, 0.3f, 0.3f));
|
bar.unfilledMat = SolidColorMaterials.SimpleSolidColorMaterial(new Color(0.3f, 0.3f, 0.3f));
|
||||||
fillableBar.margin = 0.15f;
|
|
||||||
|
|
||||||
Rot4 rotation = Rotation;
|
|
||||||
rotation.Rotate(RotationDirection.Clockwise);
|
|
||||||
fillableBar.rotation = rotation;
|
|
||||||
|
|
||||||
GenDraw.DrawFillableBar(fillableBar);
|
Rot4 rotation = base.Rotation;
|
||||||
|
rotation.Rotate(RotationDirection.Clockwise);
|
||||||
|
bar.rotation = rotation;
|
||||||
|
|
||||||
|
GenDraw.DrawFillableBar(bar);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string GetInspectString() {
|
public override string GetInspectString() {
|
||||||
|
|||||||
Reference in New Issue
Block a user