Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public override void UpdateAfterSimulation()
// This is stupid, but prevents the mod profiler cost from being incurred every tick per block when inactive
if (Animation.IsActive)
Animation.UpdateTick();
else
MakePanelsVisible();
}

public override bool IsSerialized()
Expand Down Expand Up @@ -214,6 +216,8 @@ public void MakePanelsVisible()

while (GetNextPanel(idx, out nextBlock))
{
if (nextBlock.Visible)
return;
nextBlock.Visible = true;
idx++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,58 @@ private static void CreateControls()

MyAPIGateway.TerminalControls.AddAction<IMyTerminalBlock>(a);
}

{
var a = MyAPIGateway.TerminalControls.CreateAction<IMyTerminalBlock>("Radiator_SetExtendedTrue");
a.Name = new StringBuilder("Extend Radiator");
a.ValidForGroups = true;

a.Enabled = CustomVisibleCondition;

a.Writer = (block, builder) =>
{
builder.Clear();
if (block?.GameLogic?.GetAs<ExtendableRadiator>()?.IsExtended ?? false)
builder.Append("Extended");
else
builder.Append("Retracted");
};

a.Action = (block) =>
{
var logic = block?.GameLogic?.GetAs<ExtendableRadiator>();
if (logic != null && !logic.IsExtended)
logic.IsExtended = true;
};

MyAPIGateway.TerminalControls.AddAction<IMyTerminalBlock>(a);
}

{
var a = MyAPIGateway.TerminalControls.CreateAction<IMyTerminalBlock>("Radiator_SetExtendedFalse");
a.Name = new StringBuilder("Retract Radiator");
a.ValidForGroups = true;

a.Enabled = CustomVisibleCondition;

a.Writer = (block, builder) =>
{
builder.Clear();
if (block?.GameLogic?.GetAs<ExtendableRadiator>()?.IsExtended ?? false)
builder.Append("Extended");
else
builder.Append("Retracted");
};

a.Action = (block) =>
{
var logic = block?.GameLogic?.GetAs<ExtendableRadiator>();
if (logic != null && logic.IsExtended)
logic.IsExtended = false;
};

MyAPIGateway.TerminalControls.AddAction<IMyTerminalBlock>(a);
}
}
}
}
Loading