Exemple #1
0
        public static void CreateTerminalUi <T>(Session session) where T : IMyTerminalBlock
        {
            try
            {
                if (ControlsAlreadyExist <T>(session))
                {
                    return;
                }
                AlterActions <T>(session);
                AlterControls <T>(session);

                TerminalHelpers.CreateGenericControls <T>(session);
                TerminalHelpers.AddUiControls <T>(session);

                if (typeof(T) == typeof(IMyLargeTurretBase) || typeof(T) == typeof(IMySmallMissileLauncher) || typeof(T) == typeof(IMySmallGatlingGun) || typeof(T) == typeof(IMySmallMissileLauncherReload))
                {
                    session.BaseControlsActions = true;
                    CreateCustomActionSet <T>(session);
                }
                else if (typeof(T) == typeof(IMyConveyorSorter))
                {
                    CreateDefaultActions <T>(session);
                }

                TerminalHelpers.AddTurretOrTrackingControls <T>(session);
            }
            catch (Exception ex) { Log.Line($"Exception in CreateControlUi: {ex}"); }
        }