Ejemplo n.º 1
0
        internal static void HeightWriter(IMyTerminalBlock blk, StringBuilder sb)
        {
            var comp = blk?.GameLogic?.GetAs <DefenseShields>();

            if (comp == null)
            {
                return;
            }
            sb.Append(DsUi.GetOffsetHeight(blk));
        }
Ejemplo n.º 2
0
        internal static void TerminalActionHeightDecrease(IMyTerminalBlock blk)
        {
            var comp = blk?.GameLogic?.GetAs <DefenseShields>();

            if (comp == null)
            {
                return;
            }

            var max          = comp.ShieldMode == DefenseShields.ShieldType.Station ? 70 : 39;
            var currentValue = DsUi.GetOffsetHeight(blk);
            var nextValue    = currentValue - 1 > -max ? currentValue - 1 : currentValue;

            DsUi.SetOffsetHeight(blk, nextValue);
        }