Exemplo n.º 1
0
    public static void Show(Action <string> doWithSelectedManeuver, Action callback, Func <string, bool> filter = null, bool isRegularPlanning = false)
    {
        PrepareSubphase(doWithSelectedManeuver, callback);

        GameObject prefab = (GameObject)Resources.Load("Prefabs/UI/DirectionsWindow", typeof(GameObject));

        DirectionsWindow = MonoBehaviour.Instantiate(prefab, GameObject.Find("UI/DirectionsPanel").transform);

        if (Selection.ThisShip.Owner is Players.HumanPlayer)
        {
            GameObject.Find("UI").transform.Find("ContextMenuPanel").gameObject.SetActive(false);
            CustomizeDirectionsMenu(filter);
            CustomizeForStressed();
            DirectionsWindow.transform.localPosition = FixMenuPosition(
                DirectionsWindow.transform.gameObject,
                Input.mousePosition
                );
        }
        else
        {
            DirectionsMenu.Hide();
        }

        Phases.CurrentSubPhase.IsReadyForCommands = true;

        if (isRegularPlanning)
        {
            Selection.ThisShip.Owner.AskAssignManeuver();
        }
    }
Exemplo n.º 2
0
    private static void Activate()
    {
        UI.HideNextButton();

        IsActive = true;

        DirectionsMenu.ShowForAll(AssignManeuverToAllShips, CheckForFinish, AnyShipHasManeuver);
    }
Exemplo n.º 3
0
    public static void AssignManeuverButtonPressed()
    {
        HideDirectionMenu();

        string maneuverCode = EventSystem.current.currentSelectedGameObject.name;

        DirectionsMenu.Callback(maneuverCode);
    }
Exemplo n.º 4
0
    private static void AssignManeuverToAllShips(string maneuverCode)
    {
        IsActive = false;

        GameMode.CurrentGameMode.SetSwarmManagerManeuver(maneuverCode);

        DirectionsMenu.FinishManeuverSelections();
    }
        public override void Execute()
        {
            int shipId = int.Parse(GetString("id"));

            Console.Write($"\nShip is selected to assign a maneuver: {Roster.GetShipById("ShipId:" + shipId).PilotInfo.PilotName} (ID:{shipId})");

            Selection.ChangeActiveShip("ShipId:" + shipId);
            DirectionsMenu.Show(ShipMovementScript.SendAssignManeuverCommand, PlanningSubPhase.CheckForFinish, isRegularPlanning: true);
        }
Exemplo n.º 6
0
    public static void AssignManeuver(int shipId, string maneuverCode)
    {
        Selection.ChangeActiveShip("ShipId:" + shipId);
        UI.HideContextMenu();

        Selection.ThisShip.SetAssignedManeuver(MovementFromString(maneuverCode));

        DirectionsMenu.FinishManeuverSelections();
    }
Exemplo n.º 7
0
 private void AskChangeManeuver(object sender, System.EventArgs e)
 {
     if (Selection.ThisShip.AssignedManeuver.Bearing == Movement.ManeuverBearing.Bank)
     {
         DirectionsMenu.Show(IsBankManeuversSameSpeed);
     }
     else
     {
         Triggers.FinishTrigger();
     }
 }
Exemplo n.º 8
0
        private void AskAssignManeuver(GenericShip host, GenericShip docked, bool isEmergencyDeploy = false)
        {
            Selection.ChangeActiveShip("ShipId:" + docked.ShipId);

            if (Editions.Edition.Current is Editions.SecondEdition)
            {
                DirectionsMenu.Show(GameMode.CurrentGameMode.AssignManeuver, delegate { RegisterPerformManeuver(isEmergencyDeploy); }, FilterOnlyForward);
            }
            else
            {
                DirectionsMenu.Show(GameMode.CurrentGameMode.AssignManeuver, delegate { RegisterPerformManeuver(isEmergencyDeploy); });
            }
        }
Exemplo n.º 9
0
    public static void AssignManeuverButtonPressed(string buttonName)
    {
        string maneuverCode = buttonName;

        //OLD: EventSystem.current.currentSelectedGameObject.name;

        if (maneuverCode.Split('.').Length == 3)
        {
            HideDirectionMenu();

            DirectionsMenu.Callback(maneuverCode);
        }
        else
        {
            Messages.ShowError($"Error: maneuver button is required, but name of pressed UI element: \"{maneuverCode}\"");
        }
    }
Exemplo n.º 10
0
 private void SelectSlamManeuver(object sender, System.EventArgs e)
 {
     DirectionsMenu.Show(IsSameSpeed);
 }
Exemplo n.º 11
0
        public override void ChangeManeuver(Action <string> doWithManeuverString, Action callback, Func <string, bool> filter = null)
        {
            DirectionsMenu.Show(doWithManeuverString, callback, filter);

            doWithManeuverString(Selection.ThisShip.AssignedManeuver.ToString());
        }
Exemplo n.º 12
0
 public override void Execute()
 {
     Selection.ChangeActiveShip("ShipId:" + int.Parse(GetString("id")));
     DirectionsMenu.Show(GameMode.CurrentGameMode.AssignManeuver, PlanningSubPhase.CheckForFinish, isRegularPlanning: true);
 }
Exemplo n.º 13
0
 private void AskChangeManeuver(object sender, System.EventArgs e)
 {
     DirectionsMenu.Show(GameMode.CurrentGameMode.AssignManeuver);
 }
Exemplo n.º 14
0
 public void ShowDirectionMenu()
 {
     DirectionsMenu.Show();
 }
Exemplo n.º 15
0
 public override void SelectManeuver(Action <string> callback, Func <string, bool> filter = null)
 {
     DirectionsMenu.Show(callback, filter);
 }
Exemplo n.º 16
0
        public override void ChangeManeuver(Action <string> callback, Func <string, bool> filter = null)
        {
            base.ChangeManeuver(callback, filter);

            DirectionsMenu.Show(callback, filter);
        }
Exemplo n.º 17
0
 private void AskChangeManeuver(object sender, System.EventArgs e)
 {
     DirectionsMenu.Show(IsSameBearingAndDirection);
 }
Exemplo n.º 18
0
 public static void ShowDirectionMenu()
 {
     DirectionsMenu.Show(GameMode.CurrentGameMode.AssignManeuver);
 }
Exemplo n.º 19
0
        public override void SelectManeuver(Action <string> doWithManeuverString, Action callback, Func <string, bool> filter = null)
        {
            DirectionsMenu.Show(doWithManeuverString, callback, filter);

            base.SelectManeuver(doWithManeuverString, callback, filter);
        }
Exemplo n.º 20
0
 private static void ShowSwarmManagerWindow(object sender, EventArgs e)
 {
     Phases.StartTemporarySubPhaseNew("Swarm Manager", typeof(SwarmManagerSubPhase), delegate { });
     DirectionsMenu.ShowForAll(AssignManeuverToAllShips, AnyShipHasManeuver);
 }
Exemplo n.º 21
0
 private void UpdateDirectionsMenu()
 {
     DirectionsMenu.Update();
 }
 public override void Execute()
 {
     Selection.ChangeActiveShip("ShipId:" + int.Parse(GetString("id")));
     DirectionsMenu.Show(ShipMovementScript.SendAssignManeuverCommand, PlanningSubPhase.CheckForFinish, isRegularPlanning: true);
 }
Exemplo n.º 23
0
 public static void HideDirectionMenu()
 {
     DirectionsMenu.Hide();
 }
Exemplo n.º 24
0
 public override void ChangeManeuver(Action <string> doWithManeuverString, Action callback, Func <string, bool> filter = null)
 {
     DirectionsMenu.Show(doWithManeuverString, callback, filter);
     GameController.CheckExistingCommands();
 }