コード例 #1
0
        internal static void WidthWriter(IMyTerminalBlock blk, StringBuilder sb)
        {
            var comp = blk?.GameLogic?.GetAs <DefenseShields>();

            if (comp == null)
            {
                return;
            }
            sb.Append(DsUi.GetOffsetWidth(blk));
        }
コード例 #2
0
        internal static void TerminalActioWidthIncrease(IMyTerminalBlock blk)
        {
            var comp = blk?.GameLogic?.GetAs <DefenseShields>();

            if (comp == null)
            {
                return;
            }
            var max          = comp.ShieldMode == DefenseShields.ShieldType.Station ? 70 : 39;
            var currentValue = DsUi.GetOffsetWidth(blk);
            var nextValue    = currentValue + 1 < max ? currentValue + 1 : currentValue;

            DsUi.SetOffsetWidth(blk, nextValue);
        }