private void MenuDone()
        {
            bool invalidName = false;

            string playerName = FrameworkCore.players[0].commanderName;


            if (!Helpers.IsValidPlayerName(playerName))
            {
                invalidName = true;
            }

            if (invalidName)
            {
                FrameworkCore.players[0].commanderName = Helpers.GenerateName("Gamertag");
                return;
            }

            FrameworkCore.players[0].commanderName = Helpers.StripOutAmpersands(FrameworkCore.players[0].commanderName);


            SaveInfo save = FrameworkCore.storagemanager.GetDefaultSaveData();

            FrameworkCore.storagemanager.SaveData(save);

            Deactivate();
            Owner.AddMenu(new MainMenu());
        }
        private void ClickButton()
        {
            if (selectedInventoryIndex < 0)
            {
                return;
            }

            FrameworkCore.PlayCue(sounds.click.activate);

            if (selectedInventoryIndex <= 1)
            {
                //click on a inventorySlot.
                bool           slotOccupied = (FrameworkCore.players[0].campaignShips[selectedIndex].upgradeArray[selectedInventoryIndex] != null);
                InventoryPopup popup        = new InventoryPopup(Owner, slotOccupied);
                Owner.AddMenu(popup);

                ResetMenuPositions();
            }
            else
            {
                //click on an additionalButton.
                if (FrameworkCore.players.Count > 1 && selectedInventoryIndex == 2)
                {
                    //coop
                    FrameworkCore.players[0].campaignShips[selectedIndex].childShip =
                        !FrameworkCore.players[0].campaignShips[selectedIndex].childShip;
                }
                else
                {
                    Deactivate();
                }
            }
        }
Ejemplo n.º 3
0
        private void DeviceCallback(IAsyncResult result)
        {
            try
            {
                StorageDevice deviceTemp = StorageDevice.EndShowSelector(result);

                if (deviceTemp != null && deviceTemp.IsConnected)
                {
                    //a storage device WAS chosen.
                    FrameworkCore.storagemanager.SetDevice(deviceTemp);
                    OpenMainMenu();
                }
                else
                {
                    //device was NOT chosen.
                    SysPopup devicePrompt = new SysPopup(Owner, Resource.SysDeviceChoose);
                    devicePrompt.sideIconRect = sprite.windowIcon.exclamation;
                    MenuItem item = new MenuItem(Resource.SysDeviceChooseConfirm);
                    item.Selected += OnChooseStorageDevice;
                    devicePrompt.AddItem(item);
                    item           = new MenuItem(Resource.SysDeviceChooseIgnore);
                    item.Selected += OnNoStorageDevice;
                    devicePrompt.AddItem(item);
                    Owner.AddMenu(devicePrompt);
                }
            }
            catch
            {
            }
        }
        private void OnCredits(object sender, EventArgs e)
        {
            if (Owner == null)
            {
                return;
            }

            Owner.AddMenu(new CreditsMenu(false));
        }
        private void OnSelectOptions(object sender, EventArgs e)
        {
            if (Owner == null)
            {
                return;
            }

            Owner.AddMenu(new OptionsMenu());
        }
        private void OnHowToPlay(object sender, EventArgs e)
        {
            if (Owner == null)
            {
                return;
            }

            Owner.AddMenu(new HelpTurns());
        }
        private void OnSelectMainMenu(object sender, EventArgs e)
        {
            if (Owner == null)
            {
                return;
            }

            Owner.AddMenu(new QuitConfirm());
        }
        private void OnSelectSelfDestruct(object sender, EventArgs e)
        {
            if (Owner == null)
            {
                return;
            }

            Owner.AddMenu(new SelfDestructConfirm());
        }
        private void OnBugReport(object sender, EventArgs e)
        {
            if (Owner == null)
            {
                return;
            }

            Owner.AddMenu(new BugReport());
        }
        private void OnSelectSkirmish(object sender, EventArgs e)
        {
            if (Owner == null)
            {
                return;
            }

            Owner.AddMenu(new SkirmishMenu());
        }
 private void OnSelectExit(object sender, EventArgs e)
 {
     //quit.
     if (FrameworkCore.isTrialMode())
     {
         Owner.AddMenu(new SellScreen());
     }
     else
     {
         FrameworkCore.Game.Exit();
     }
 }
        private void OnControls(object sender, EventArgs e)
        {
            if (Owner == null)
            {
                return;
            }

#if WINDOWS
            Owner.AddMenu(new HelpControlsPC());
#else
            Owner.AddMenu(new HelpControlsXBOX());
#endif
        }
        private void DoneTitle()
        {
            if (titleIsDone)
            {
                return;
            }

            titleIsDone = true;

            Deactivate();

            if (Owner != null)
            {
                Owner.AddMenu(new TitleMenu());
            }
        }
Ejemplo n.º 14
0
        private void UpdateMouseInput(GameTime gameTime, InputManager inputManager)
        {
            if (Transition < 1)
            {
                return;
            }

            bool confirmHover = false;

            for (int i = 0; i < confirmButtons.Length; i++)
            {
                Rectangle confirmRect = new Rectangle(
                    (int)(confirmButtons[i].X - 110),
                    (int)(confirmButtons[i].Y - 30),
                    220,
                    60);

                if (confirmRect.Contains((int)inputManager.mousePos.X, (int)inputManager.mousePos.Y))
                {
                    hoverConfirmButton = i;
                    confirmHover       = true;

                    if (inputManager.mouseLeftClick)
                    {
                        if (i == 0)
                        {
                            FrameworkCore.PlayCue(sounds.click.activate);
                            Deactivate();
                        }
                        else if (i == 1)
                        {
                            FrameworkCore.PlayCue(sounds.click.activate);
                            Owner.AddMenu(new HelpControlsPC());
                            Deactivate();
                        }
                    }
                }
            }

            if (!confirmHover)
            {
                hoverConfirmButton = -1;
            }
        }
        private void ToggleHardcore()
        {
            if (FrameworkCore.isTrialMode())
            {
                if (FrameworkCore.isHardcoreMode)
                {
                    FrameworkCore.isHardcoreMode = false;
                }

                FrameworkCore.PlayCue(sounds.click.error);


                hardcoreHover = false;

                SysPopup signPrompt = new SysPopup(Owner, Resource.HardcoreTrial);
                signPrompt.transitionOnTime  = 200;
                signPrompt.transitionOffTime = 200;
                signPrompt.darkenScreen      = true;
                signPrompt.hideChildren      = false;
                signPrompt.sideIconRect      = sprite.windowIcon.error;

                MenuItem item = new MenuItem(Resource.MenuOK);
                item.Selected += CloseMenu;
                signPrompt.AddItem(item);

                Owner.AddMenu(signPrompt);



                return;
            }

            if (!FrameworkCore.isHardcoreMode)
            {
                FrameworkCore.PlayCue(sounds.Fanfare.ready);
            }
            else
            {
                FrameworkCore.PlayCue(sounds.click.activate);
            }

            FrameworkCore.isHardcoreMode = !FrameworkCore.isHardcoreMode;
        }
Ejemplo n.º 16
0
        //============== RESOLUTION
        private void OnResolution(object sender, EventArgs e)
        {
            SkirmishPopup popup      = new SkirmishPopup(Owner);
            int           itemHeight = (int)FrameworkCore.Serif.MeasureString("Sample").Y;

            popup.screenPos = new Vector2(selectedItem.position.X + 96,
                                          (resolutions.Length / 2) * itemHeight);
            popup.hideChildren = false;

            MenuItem item = null;

            for (int i = 0; i < resolutions.Length; i++)
            {
                string itemName = resolutions[i].X + Resource.MenuVideoDivider + resolutions[i].Y;
                if (resolutions[i].X * 3 <= resolutions[i].Y * 4)
                {
                    //4:3 aspect ratio or lower.
                }
                else
                {
                    itemName += " " + Resource.MenuVideoWidescreen;
                }

                if (FrameworkCore.Graphics.PreferredBackBufferHeight == resolutions[i].Y &&
                    FrameworkCore.Graphics.PreferredBackBufferWidth == resolutions[i].X)
                {
                    itemName += " " + Resource.MenuVideoCurrent;
                }


                item             = new MenuItem(itemName);
                item.Selected   += OnChooseResolution;
                item.GenericInt1 = resolutions[i].X;
                item.GenericInt2 = resolutions[i].Y;
                popup.AddItem(item);
            }

            item           = new MenuItem(Resource.MenuCancel);
            item.Selected += closePopup;
            popup.AddItem(item);

            Owner.AddMenu(popup);
        }
Ejemplo n.º 17
0
        void client_SendCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            isSending = false;

            SysPopup signPrompt = new SysPopup(Owner, Resource.MenuBugReportThanks);

            signPrompt.transitionOnTime  = 200;
            signPrompt.transitionOffTime = 200;
            signPrompt.darkenScreen      = true;
            signPrompt.hideChildren      = false;
            signPrompt.canBeExited       = false;
            signPrompt.sideIconRect      = sprite.windowIcon.info;

            MenuItem item = new MenuItem(Resource.MenuOK);

            item.Selected += CloseBugPopup;
            signPrompt.AddItem(item);

            Owner.AddMenu(signPrompt);
        }
        private void HandlePatchCheck(string result)
        {
            if (result == null)
            {
                return;
            }

            //convert string to float.
            float newVersion = (float)Convert.ToDouble(result, CultureInfo.InvariantCulture);

            string strUserVersion = FrameworkCore.VERSION;
            float  userVersion    = (float)Convert.ToDouble(strUserVersion, CultureInfo.InvariantCulture);

            //compare version numbers.
            if (newVersion <= userVersion)
            {
                return;
            }

            //new version is available.
            string patchString = string.Format(Resource.MenuPatchAvailable, FrameworkCore.VERSION, result);

            SysPopup signPrompt = new SysPopup(Owner, patchString);

            signPrompt.canBeExited  = false;
            signPrompt.darkenScreen = true;
            signPrompt.sideIconRect = sprite.windowIcon.exclamation;
            MenuItem item = new MenuItem(Resource.MenuPatchGet);

            item.Selected += OnPatch;
            signPrompt.AddItem(item);
            item           = new MenuItem(Resource.MenuPatchLater);
            item.Selected += OnNoPatch;
            signPrompt.AddItem(item);

            Owner.AddMenu(signPrompt);
        }
Ejemplo n.º 19
0
        public override void Update(GameTime gameTime, InputManager inputManager)
        {
#if LiveEnabled
            if (Transition >= 1 && !checkControllingPlayer)
            {
                for (int i = 0; i < 4; i++)
                {
                    PlayerIndex index = PlayerIndex.One;

                    if (i == 0)
                    {
                        index = PlayerIndex.One;
                    }
                    else if (i == 1)
                    {
                        index = PlayerIndex.Two;
                    }
                    else if (i == 2)
                    {
                        index = PlayerIndex.Three;
                    }
                    else
                    {
                        index = PlayerIndex.Four;
                    }

                    if (FrameworkCore.MenuInputs[i].buttonAPressed ||
                        FrameworkCore.MenuInputs[i].buttonStartPressed)
                    {
                        checkControllingPlayer               = true;
                        FrameworkCore.ControllingPlayer      = index;
                        FrameworkCore.players[0].playerindex = index;
                    }
                }
            }

            if (Helpers.GuideVisible)
            {
                return;
            }

            if (checkControllingPlayer)
            {
                SignedInGamer gamer = SignedInGamer.SignedInGamers[FrameworkCore.ControllingPlayer];

                if (gamer != null)
                {
                    FrameworkCore.shouldCheckSignIn = true;
                    ChooseStorageDevice();
                }
                else
                {
                    //controllingplayer is not signed in.

                    if (Owner != null)
                    {
                        SysPopup signPrompt = new SysPopup(Owner, Resource.MenuProfileNotSignedin);
                        signPrompt.canBeExited  = false;
                        signPrompt.darkenScreen = true;
                        signPrompt.sideIconRect = sprite.windowIcon.exclamation;
                        MenuItem item = new MenuItem(Resource.MenuProfileNotSignedinConfirm);
                        item.Selected += ChooseProfile;
                        signPrompt.AddItem(item);
                        item           = new MenuItem(Resource.MenuProfileNotSignedinIgnore);
                        item.Selected += OnDoNotSignin;
                        signPrompt.AddItem(item);

                        Owner.AddMenu(signPrompt);
                    }
                }
            }
#else
            //PC build.

            if (Transition >= 1)
            {
                if (inputManager.buttonAPressed || inputManager.kbSkipScreen || inputManager.mouseLeftClick)
                {
                    OpenMainMenu();
                }
            }
#endif



            base.Update(gameTime, inputManager);
        }
Ejemplo n.º 20
0
        private void OpenMainMenu()
        {
            if (hasOpenedMainMenu)
            {
                return;
            }

            hasOpenedMainMenu = true;

            if (Owner != null)
            {
#if XBOX
                SignedInGamer gamer = SignedInGamer.SignedInGamers[FrameworkCore.ControllingPlayer];

                Owner.AddMenu(new MainMenu());
                if (gamer != null)
                {
                    //player is signed in. load player's data.
                    FrameworkCore.players[0].commanderName = gamer.Gamertag;
                    LoadData();
                }
                else
                {
                    //unsigned player. assign random name.
                    FrameworkCore.players[0].commanderName = Helpers.GenerateName("Gamertag");
                }
#elif (WINDOWS && STEAM)
                //the steam build uses the player's Steam persona name.
                //if there's an error for whatever reason, we let the player type in any name.

                LoadData();

                string playerName = FrameworkCore.GetSteamName();

                if (playerName == null)
                {
                    FrameworkCore.players[0].commanderName = Helpers.GenerateName("Gamertag");
                    Owner.AddMenu(new NameMenu());
                }
                else
                {
                    FrameworkCore.players[0].commanderName = playerName;
                    Owner.AddMenu(new MainMenu());
                }
#else
                SaveInfo optionsData = LoadData();

                if (optionsData.playerName == null)
                {
                    FrameworkCore.players[0].commanderName = Helpers.GenerateName("Gamertag");
                }
                else
                {
                    FrameworkCore.players[0].commanderName = optionsData.playerName;
                }

                Owner.AddMenu(new NameMenu());
#endif
            }

            Deactivate();
        }
Ejemplo n.º 21
0
 private void OnCredits(object sender, EventArgs e)
 {
     Owner.AddMenu(new CreditsMenu(false));
 }
Ejemplo n.º 22
0
 private void OnControls(object sender, EventArgs e)
 {
     Owner.AddMenu(new ControlsMenu());
 }
Ejemplo n.º 23
0
 private void OnJoystick(object sender, EventArgs e)
 {
     Owner.AddMenu(new JoystickMenu());
 }
Ejemplo n.º 24
0
 private void PrevPage()
 {
     FrameworkCore.PlayCue(sounds.click.activate);
     Owner.AddMenu(new HelpTurns());
     Deactivate();
 }
Ejemplo n.º 25
0
 /*
  * public override void RepositionItems()
  * {
  *
  *
  *  base.RepositionItems();
  * }
  */
 private void OnVideo(object sender, EventArgs e)
 {
     Owner.AddMenu(new VideoMenu());
 }
Ejemplo n.º 26
0
 private void NextPage()
 {
     FrameworkCore.PlayCue(sounds.click.activate);
     Owner.AddMenu(new HelpOrders());
     Deactivate();
 }
        private void SlotLogic(int slotNumber, PlayerCommander player)
        {
            //let player2 remove himself.
            if (FrameworkCore.players.Count >= 2)
            {
                //player2 clicked himself.
                if (menuItems[slotNumber].commander == player &&
                    player == FrameworkCore.players[1])
                {
                    SkirmishPopup popup = new SkirmishPopup(Owner);
                    popup.screenPos    = selectedItem.position + new Vector2(96, 16);
                    popup.hideChildren = false;

                    MenuItem item = new MenuItem(Resource.MenuSkirmishSlotClear);
                    item.Selected   += ClearSlot;
                    item.GenericInt1 = slotNumber;
                    popup.AddItem(item);

                    item           = new MenuItem(Resource.MenuCancel);
                    item.Selected += closePopup;
                    popup.AddItem(item);

                    Owner.AddMenu(popup);

                    return;
                }
            }

            if (menuItems[slotNumber].commander == player ||
                menuItems[slotNumber].commander == FrameworkCore.players[0])
            {
                //selected slot this player is already in.
            }
            else
            {
                SkirmishPopup popup = new SkirmishPopup(Owner);
                popup.screenPos    = selectedItem.position + new Vector2(96, 16);
                popup.hideChildren = false;

                MenuItem item = null;

                //ADD COMPUTER.
                if (menuItems[slotNumber].commander == null)
                {
                    item             = new MenuItem(Resource.MenuSkirmishEasyAdd);
                    item.Selected   += AddAI;
                    item.GenericInt1 = slotNumber;
                    popup.AddItem(item);
                }

                //MOVE TO SLOT.
                if (menuItems[slotNumber].commander == null ||
                    (menuItems[slotNumber].commander != null &&
                     menuItems[slotNumber].commander.GetType() != typeof(PlayerCommander)))
                {
                    item             = new MenuItem(Resource.MenuSkirmishSlotMove);
                    item.commander   = player;//stuff data into this menu entry.
                    item.GenericInt1 = slotNumber;
                    item.Selected   += MoveToSlot;
                    popup.AddItem(item);
                }

                if (menuItems[slotNumber].commander != null)
                {
                    if (menuItems[slotNumber].commander != FrameworkCore.players[0])
                    {
                        item             = new MenuItem(Resource.MenuSkirmishSlotClear);
                        item.Selected   += ClearSlot;
                        item.GenericInt1 = slotNumber;
                        popup.AddItem(item);
                    }
                }

                item           = new MenuItem(Resource.MenuCancel);
                item.Selected += closePopup;
                popup.AddItem(item);

                Owner.AddMenu(popup);
            }
        }
        private void OnSelectStart(object sender, EventArgs e)
        {
            bool faction1HasCommander = false;
            bool faction2HasCommander = false;

            //check if both sides have at least 1 commander.
            for (int i = 0; i < menuItems.Count; i++)
            {
                if (menuItems[i].commander != null && i <= 1)
                {
                    faction1HasCommander = true;
                }
                else if (menuItems[i].commander != null && (i == 2 || i == 3))
                {
                    faction2HasCommander = true;
                }
            }

            if (!faction1HasCommander || !faction2HasCommander)
            {
                SysPopup signPrompt = new SysPopup(Owner, Resource.MenuSkirmishMissingPlayer);
                signPrompt.transitionOnTime  = 200;
                signPrompt.transitionOffTime = 200;
                signPrompt.darkenScreen      = true;
                signPrompt.hideChildren      = false;
                signPrompt.sideIconRect      = sprite.windowIcon.error;

                MenuItem item = new MenuItem(Resource.MenuOK);
                item.Selected += CloseMenu;
                signPrompt.AddItem(item);

                Owner.AddMenu(signPrompt);

                FrameworkCore.PlayCue(sounds.click.error);
                return;
            }



            if (FrameworkCore.isTrialMode())
            {
                bool hasInvalidShip = false;

                //check if user has any non-trial ships in the ship array.
                foreach (MenuItem mItem in menuItems)
                {
                    if (menuItems.IndexOf(mItem) > 3)
                    {
                        continue;
                    }

                    for (int i = 0; i < mItem.shipArray.Length; i++)
                    {
                        if (Helpers.getShipByType(mItem.shipArray[i]) > 1)
                        {
                            hasInvalidShip = true;

                            mItem.shipArray[i] = null;
                        }
                    }
                }

                if (hasInvalidShip)
                {
                    SysPopup signPrompt = new SysPopup(Owner, Resource.MenuSkirmishTrialShipError);
                    signPrompt.transitionOnTime  = 200;
                    signPrompt.transitionOffTime = 200;
                    signPrompt.darkenScreen      = true;
                    signPrompt.hideChildren      = false;
                    signPrompt.sideIconRect      = sprite.windowIcon.error;

                    MenuItem item = new MenuItem(Resource.MenuOK);
                    item.Selected += CloseMenuStartSkirmish;
                    signPrompt.AddItem(item);

                    Owner.AddMenu(signPrompt);

                    return;
                }
            }


            //check if all slots have at least one ship.
            bool   showNoShipError       = false;
            string missingShipPlayerName = "";

            foreach (MenuItem mItem in menuItems)
            {
                //only check player slots.
                if (menuItems.IndexOf(mItem) > 3)
                {
                    continue;
                }

                if (mItem.commander == null)
                {
                    continue;
                }

                bool PlayerHasNoShip = true;

                for (int i = 0; i < mItem.shipArray.Length; i++)
                {
                    if (Helpers.getShipByType(mItem.shipArray[i]) >= 0)
                    {
                        PlayerHasNoShip = false;
                    }
                }

                if (PlayerHasNoShip)
                {
                    showNoShipError = true;

                    if (mItem.commander.commanderName != null)
                    {
                        missingShipPlayerName = mItem.commander.commanderName;
                    }

                    break;
                }
            }

            if (showNoShipError)
            {
                String   errorString = string.Format(Resource.MenuSkirmishNoShips, missingShipPlayerName);
                SysPopup signPrompt  = new SysPopup(Owner, errorString);
                signPrompt.transitionOnTime  = 200;
                signPrompt.transitionOffTime = 200;
                signPrompt.darkenScreen      = true;
                signPrompt.hideChildren      = false;
                signPrompt.sideIconRect      = sprite.windowIcon.error;

                MenuItem item = new MenuItem(Resource.MenuOK);
                item.Selected += CloseMenu;
                signPrompt.AddItem(item);

                Owner.AddMenu(signPrompt);

                FrameworkCore.PlayCue(sounds.click.error);
                return;
            }



            IsLoading = true;

            //player wants to start the skirmish.
        }
        private void OpenShipSelection(PlayerIndex index)
        {
            if (selectedItem.commander == null)
            {
                return;
            }

            int playerIndex = (int)index;

            SkirmishPopup popup = new SkirmishPopup(Owner);

            popup.hideChildren = false;
            popup.darkenScreen = true;

            MenuItem item = null;

            item = new MenuItem(Resource.ShipDestroyer);
            item.shipArray[0] = shipTypes.Destroyer;
            item.Selected    += AddShip;
            item.GenericInt1  = playerIndex;
            popup.AddItem(item);

            item = new MenuItem(Resource.ShipBeamFrigate);
            item.shipArray[0] = shipTypes.BeamFrigate;
            item.Selected    += AddShip;
            item.GenericInt1  = playerIndex;
            popup.AddItem(item);

            item = new MenuItem(Resource.ShipBeamGunship);
            item.shipArray[0] = shipTypes.BeamGunship;
            item.Selected    += AddShip;
            item.GenericInt1  = playerIndex;
            popup.AddItem(item);

            item = new MenuItem(Resource.ShipGunship);
            item.shipArray[0] = shipTypes.Gunship;
            item.Selected    += AddShip;
            item.GenericInt1  = playerIndex;
            popup.AddItem(item);


            item = new MenuItem(Resource.ShipDreadnought);
            item.shipArray[0] = shipTypes.Dreadnought;
            item.Selected    += AddShip;
            item.GenericInt1  = playerIndex;
            popup.AddItem(item);


            item = new MenuItem(Resource.ShipBattleship);
            item.shipArray[0] = shipTypes.Battleship;
            item.Selected    += AddShip;
            item.GenericInt1  = playerIndex;
            popup.AddItem(item);

            item = new MenuItem(Resource.ShipFighter);
            item.shipArray[0] = shipTypes.Fighter;
            item.Selected    += AddShip;
            item.GenericInt1  = playerIndex;
            popup.AddItem(item);



#if DEBUG
            item = new MenuItem("DEBUG");
            item.shipArray[0] = shipTypes.DebugShip;
            item.Selected    += AddShip;
            item.GenericInt1  = playerIndex;
            popup.AddItem(item);
#endif


            int shipsInList = 0;
            for (int i = 0; i < selectedItem.shipArray.Length; i++)
            {
                if (selectedItem.shipArray[i] != null)
                {
                    shipsInList++;
                }
            }

            if (selectedItem != null && selectedItem.shipArray[selectedItem.shipArraySelection] != null && shipsInList > 1)
            {
                item           = new MenuItem(Resource.MenuSkirmishSlotClear);
                item.Selected += AddShip;
                popup.AddItem(item);
            }

            item           = new MenuItem(Resource.MenuCancel);
            item.Selected += closePopup;
            popup.AddItem(item);

            Owner.AddMenu(popup);
        }
        private void AddShip(object sender, InputArgs e)
        {
            if (sender.GetType() != typeof(MenuItem))
            {
                return;
            }

            int index = ((MenuItem)sender).GenericInt1;

            ShipData ship = ((MenuItem)sender).shipArray[0];

            if (FrameworkCore.isTrialMode() && ship != null)
            {
                if (Helpers.getShipByType(ship) > 1)
                {
#if WINDOWS
                    string errorString = string.Format(Resource.MenuSkirmishTrialSelection, ship.name);

                    SysPopup signPrompt = new SysPopup(Owner, errorString);
                    signPrompt.transitionOnTime  = 200;
                    signPrompt.transitionOffTime = 200;
                    signPrompt.darkenScreen      = true;
                    signPrompt.hideChildren      = false;
                    signPrompt.sideIconRect      = sprite.windowIcon.error;

                    MenuItem item = new MenuItem(Resource.MenuUnlockFullGame);
                    item.Selected   += OnBuyGame;
                    item.GenericInt1 = index;
                    signPrompt.AddItem(item);

                    item           = new MenuItem(Resource.MenuDemoPlanetMaybeLater);
                    item.Selected += CloseMenu;
                    signPrompt.AddItem(item);

                    Owner.AddMenu(signPrompt);

                    FrameworkCore.PlayCue(sounds.click.error);
                    return;
#else
                    SignedInGamer gamer = SignedInGamer.SignedInGamers[(PlayerIndex)index];

                    //found signed in player. do stuff..
                    if (gamer != null && gamer.Privileges.AllowPurchaseContent)
                    {
                        string errorString = string.Format(Resource.MenuSkirmishTrialSelection, ship.name);

                        SysPopup signPrompt = new SysPopup(Owner, errorString);
                        signPrompt.transitionOnTime  = 200;
                        signPrompt.transitionOffTime = 200;
                        signPrompt.darkenScreen      = true;
                        signPrompt.hideChildren      = false;
                        signPrompt.sideIconRect      = sprite.windowIcon.error;

                        MenuItem item = new MenuItem(Resource.MenuUnlockFullGame);
                        item.Selected   += OnBuyGame;
                        item.GenericInt1 = index;
                        signPrompt.AddItem(item);

                        item           = new MenuItem(Resource.MenuDemoPlanetMaybeLater);
                        item.Selected += CloseMenu;
                        signPrompt.AddItem(item);

                        Owner.AddMenu(signPrompt);
                    }
                    else
                    {
                        //player has no purchasing privileges
                        string errorString = string.Format(Resource.MenuSkirmishTrialSelectionNoSignin, ship.name);

                        SysPopup signPrompt = new SysPopup(Owner, errorString);
                        signPrompt.transitionOnTime  = 200;
                        signPrompt.transitionOffTime = 200;
                        signPrompt.darkenScreen      = true;
                        signPrompt.hideChildren      = false;
                        signPrompt.sideIconRect      = sprite.windowIcon.error;

                        MenuItem item = new MenuItem(Resource.MenuOK);
                        item.Selected += CloseMenu;
                        signPrompt.AddItem(item);

                        Owner.AddMenu(signPrompt);
                    }

                    FrameworkCore.PlayCue(sounds.click.error);
                    return;
#endif
                }
            }

            if (((MenuItem)sender).owner != null)
            {
                ((MenuItem)sender).owner.Deactivate();
            }


            int slotNumber = selectedItem.shipArraySelection;

            if (slotNumber < 0)
            {
                return;
            }


            selectedItem.shipArray[slotNumber] = ship;
        }