private void OnRemoteStorageGetPublishedFileDetailsResult(RemoteStorageGetPublishedFileDetailsResult_t pCallback, bool bIOFailure)
        {
            Console.WriteLine("Got file details for " + pCallback.m_pchFileName + " with preview image " + pCallback.m_hPreviewFile);
            if (pCallback.m_eResult == EResult.k_EResultOK)
            {
                if (published.Count > 0)
                {
                    Console.WriteLine("Handling published level and downloading the next");
                    myLevels.Add(pCallback.m_pchFileName.ToLower());
                    published.Pop();
                    DownloadNextPublishedFileDetails();
                }
                else
                {
                    if (!subscribedItemButtonMap.ContainsKey(pCallback.m_hFile))
                    {
                        int x = (LevelButton.lvButtonList.Count) % 3;
                        int y = (int)Math.Floor((LevelButton.lvButtonList.Count) / 3f) % 2;
                        Texture2D thumbnail = Textures.GetCustomThumbnail();
                        Vector2 position = new Vector2((float)((220 * (x % 3)) + 80), (float)((220 * (y % 2)) + 0x69));
                        WorkshopLevelButton button = new WorkshopLevelButton(pCallback.m_pchFileName, position, thumbnail);
                        LevelButton.CalculateGroup();
                        LevelButton.lvButtonList.Add(button);

                        subscribedItemButtonMap.Add(pCallback.m_hFile, button);
                        subscribedThumbnailButtonMap.Add(pCallback.m_hPreviewFile, button);

                        levelDataStack.Push(pCallback.m_hFile);
                        levelThumbnailStack.Push(pCallback.m_hPreviewFile);
                    }
                    subscriptions.Pop();
                    if (subscriptions.Count > 0)
                    {
                        DownloadNextLevel();
                    }
                    else
                    {
                        DownloadNextLevelData();
                        DownloadNextLevelThumbnail();
                    }
                }
            }
            else
            {
                System.Windows.Forms.MessageBox.Show(
                    "An unexpected error occured (Get published file details result)\n" + pCallback.m_eResult, "Error");
            }
        }
Exemple #2
0
        public static void Draw(SpriteBatch spriteBatch)
        {
            if (ScreenManager.Mainmenu || ScreenManager.Levelselect)
            {
                if (ScreenManager.Credits)
                {
                    spriteBatch.Draw(Textures.GetTexture("SkyB"), Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, 0, 0.8f);
                }
                else
                {
                    spriteBatch.Draw(Textures.GetTexture("SkyA"), Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, 0, 0.8f);
                }

                spriteBatch.Draw(Textures.GetTexture("Cursor"), new Vector2((float)InputManager.Mousestate[0].X, (float)InputManager.Mousestate[0].Y), null, Color.White, 0f, Vector2.Zero, 1f, 0, 1f);
                Button.DrawAll(spriteBatch);
                LevelButton.DrawAll(spriteBatch);
                TextSprite.DrawAll(spriteBatch);
                FallingObject.DrawAll(spriteBatch);
            }
        }
Exemple #3
0
        public static void NextScreen()
        {
            if (InputManager.Mousestate[1].LeftButton != Microsoft.Xna.Framework.Input.ButtonState.Pressed)
            {
                int i;
                if (!LevelSelect_Nav())
                {
                    for (i = 0; i < Button.ButtonList.Count; i++)
                    {
                        if (Button.ButtonList[i].Active && MouseClick.Rect.Intersects(Button.ButtonList[i].Rect))
                        {
                            switch (Button.ButtonList[i].Text.Text)
                            {
                            case "New Game":
                                ScreenManager.NewGame();
                                return;

                            case "Continue":
                                ScreenManager.NoMode();
                                ScreenManager.Mainmenu    = true;
                                ScreenManager.Levelselect = true;
                                MainMenu.LevelSelectOn();
                                return;

                            case "Stats":
                                ScreenManager.StatsOn();
                                return;

                            case "Erase Save Data":
                                MainMethod.popupBox = new PopupBox(new string[] {
                                    "Really delete all saved data?",
                                    "This will bring you back to level 1",
                                    "All of your custom levels will NOT be deleted"
                                }, PopupType.START_NEW_GAME);
                                return;

                            case "Play Custom":
                                ScreenManager.LoadingCustomOn();
                                return;

                            case "Editor":
                                ScreenManager.EditingOn();
                                return;

                            case "Credits":
                                ScreenManager.CreditsOn();
                                return;

                            case "Exit":
                                ScreenManager.ExitGame();
                                return;

                            case "Main Menu":
                                BClick_MainMenu();
                                return;

                            case "Resume":
                                PauseMenu.Unpause();
                                return;

                            case "Move":
                                BClick_Move();
                                return;

                            case "Entity":
                                BClick_Entity();
                                return;

                            case "Static":
                                BClick_Static();
                                return;

                            case "Items":
                                BClick_Items();
                                return;

                            case "Save":
                                Save();
                                return;

                            case "Save & Test":
                                if (Save())
                                {
                                    ScreenManager.Testing = true;
                                }
                                return;

                            case "Back to Editor":
                                LevelLoader.StartEditorLevel(Level.Current - 1, Level.CurrentLevelButton);
                                return;

                            case "+":
                                Plus_Minus.Plus(i);
                                return;

                            case "-":
                                Plus_Minus.Minus(i);
                                return;

                            case "Delete Map":
                                if (Level.CurrentLevelButton is WorkshopLevelButton)
                                {
                                    MessageBox.StatusMessage = new MessageBox("Workshop levels can't be deleted!", new Microsoft.Xna.Framework.Vector2(217, 190), 120);
                                }
                                else
                                {
                                    MainMethod.popupBox = new PopupBox(new string[] { "Are you sure?", "This map can not be restored", "once deleted." }, PopupType.DELETE_LEVEL);
                                }
                                return;

                            case "Publish to Workshop":
                                if (Save())
                                {
                                    LevelSaver.IsPublishingToWorkshop = true;
                                }
                                return;

                            case "Delete All Objects":
                                MainMethod.popupBox = new PopupBox(new string[] { "Are you sure?", "This will delete all objects", "in this level permanently." }, PopupType.ERASE_ALL_OBJECTS);
                                return;


                            case "Cycle Entities":
                                BClick_CycleEntities();
                                return;

                            case "Next":
                                LevelButton.NextGroup();
                                return;

                            case "Previous":
                                LevelButton.PreviousGroup();
                                return;
                            }
                        }
                    }
                }
            }
        }