Super Sexy Properties Panel

Properties panel now allows nested lists with foldouts, item selection and click callbacks
Properties Panel UI has a new look
Refactored lambdas in control module code into methods for readability
This commit is contained in:
hyperion51 2020-05-31 03:10:11 +01:00
commit 50a8059ed4
43 changed files with 894 additions and 916 deletions

View file

@ -85,17 +85,7 @@ public class MiningController : ControllerBase, IBehavior, IPersistentBehavior,
else
{
_entity.SetMessage("Out of cargo space. Returning home to offload cargo.");
GoHome(() =>
{
var homeEntity = _context.Cache.Get<Entity>(HomeEntity);
if (!_entity.Cargo.ToArray().All(ii =>
_context.MoveCargo(_entity, homeEntity, _context.Cache.Get<ItemInstance>(ii))))
{
homeEntity.SetMessage("Colony is out of cargo space. Closing Mining Task.");
FinishTask();
_taskStarted = false;
}
});
GoHome(OnArriveHome);
}
}
}
@ -103,6 +93,17 @@ public class MiningController : ControllerBase, IBehavior, IPersistentBehavior,
return base.Update(delta);
}
private void OnArriveHome()
{
var homeEntity = _context.Cache.Get<Entity>(HomeEntity);
if (!_entity.Cargo.ToArray().All(ii => _context.MoveCargo(_entity, homeEntity, _context.Cache.Get<ItemInstance>(ii))))
{
homeEntity.SetMessage("Colony is out of cargo space. Closing Mining Task.");
FinishTask();
_taskStarted = false;
}
}
private void NextAsteroid()
{
var miningTask = _context.Cache.Get<Mining>(Task);