Exemple #1
0
 public static void LoadSaveSlots()
 {
     Vector2 postemp = new Vector2(5 * game.Width / 6, 60 + game.Height/ 2 - (((CELLWIDTH + 20) * SAVE_SLOTS) / 2));
     for (int i = 0; i < SAVE_SLOTS; i++)
     {
         if (File.Exists("saveSlot" + (i + 1) + ".bro"))
         {
             saveSlots[i] = new UIButton(new Vector2(postemp.X, postemp.Y + (CELLWIDTH + 20) * i), false, "UI/FilledSaveSlot", "Slot " + (i + 1));
             saveSlots[i].toolTip = "Selecting this save slot\nwill overwrite the previous save!";
         }
         else
         {
             saveSlots[i] = new UIButton(new Vector2(postemp.X, postemp.Y + (CELLWIDTH + 20) * i), false, "UI/FreeSaveSlot", "Slot " + (i + 1));
             saveSlots[i].toolTip = "Select a save slot to start a game.";
         }
     }
 }
Exemple #2
0
        public static void Start(Game1 injectedGame)
        {
            game = injectedGame;
            hero = new HeroClasses.Warrior();
            GenerateLevel();

            windowSizeInTiles = new IntVec(game.Width / CELLWIDTH, game.Height / CELLWIDTH);
            cameraPosition = currentLevel.CharacterEntities.FindPosition(hero);
            modifiedCameraPosition.X = cameraPosition.X - (windowSizeInTiles.X / 2);
            modifiedCameraPosition.Y = cameraPosition.Y - (windowSizeInTiles.Y / 2);

            LogPosition = new Vector2(12, 12);
            // = new Vector2(game.Width - 48, game.Height - 48);
            InventoryPosition = new Vector2(game.Width - 5 * (CELLWIDTH), game.Height - 4 * (CELLWIDTH));
            InvButtonPosition = new Vector2(game.Width - CELLWIDTH, game.Height - CELLWIDTH);
            abilityPosition = new Vector2(game.Width / 2, game.Height - CELLWIDTH);
            charSheetPosition = new Vector2(0, 60);
            InventorySize = new Vector2(4 * CELLWIDTH, 4 * CELLWIDTH);
            weaponEquipPosition = new Vector2(0, game.Height - 2 * CELLWIDTH - 20);
            armorEquipPosition = new Vector2(0, game.Height - CELLWIDTH);
            game.IsMouseVisible = true;

            LoadMainMenu();

            saveButton = new UIButton(new Vector2(game.Width / 2 - 150, game.Height / 2), true, "UI/Save", "Save and quit");
            continueButton = new UIButton(new Vector2(game.Width / 2 + 150, game.Height / 2), true, "UI/Continue", "Continue");

            headSlot = new UIButton(armorEquipPosition, false, "UI/HelmOverlay", "Helm");
            chestSlot = new UIButton(new Vector2(armorEquipPosition.X + CELLWIDTH, armorEquipPosition.Y),
                false, "UI/ChestOverlay", "Chest");
            legSlot = new UIButton(new Vector2(armorEquipPosition.X + 2 * (CELLWIDTH), armorEquipPosition.Y),
                false, "UI/LegsOverlay", "Legs");
            ringSlot1 = new UIButton(new Vector2(armorEquipPosition.X + 3 * (CELLWIDTH), armorEquipPosition.Y),
                false, "UI/RingOverlay", "Ring");
            ringSlot2 = new UIButton(new Vector2(armorEquipPosition.X + 4 * (CELLWIDTH), armorEquipPosition.Y),
                false, "UI/RingOverlay", "Ring");
            neckSlot = new UIButton(new Vector2(armorEquipPosition.X + 5 * (CELLWIDTH), armorEquipPosition.Y),
                false, "UI/NeckOverlay", "Neck");

            weaponSlot1 = new UIButton(new Vector2(weaponEquipPosition.X, weaponEquipPosition.Y),
                false, "UI/InvSlot", "Left");
            weaponSlot2 = new UIButton(new Vector2(weaponEquipPosition.X + CELLWIDTH, weaponEquipPosition.Y),
                false, "UI/InvSlot", "Right");

            texState.AddressU = TextureAddressMode.Clamp;
            texState.AddressV = TextureAddressMode.Clamp;
            texState.AddressW = TextureAddressMode.Clamp;
            texState.Filter = TextureFilter.Linear;

            //StartGame();
        }
Exemple #3
0
        public static void LoadMainMenu()
        {
            LoadContent(game.Content);
            warriorButton = new CharButton(new Vector2(game.Width / 3, 2 * game.Height / 3), true, "UI/WarriorCharCreation", "UI/WarriorCharCreationHigh");
            mageButton = new CharButton(new Vector2(game.Width / 3 - 220, game.Height / 4), true, "UI/MageCharCreation", "UI/MageCharCreationHigh");
            rogueButton = new CharButton(new Vector2(game.Width / 3 + 220,game.Height / 4), true, "UI/RogueCharCreation", "UI/RogueCharCreationHigh");

            rangerButton = new CharButton(new Vector2(game.Width / 3, game.Height / 3 * 2), true, "UI/RangerCharCreation", "UI/RangerCharCreationHigh");
            duelistButton = new CharButton(new Vector2(game.Width / 3 * 2, game.Height / 3 * 2), true, "UI/DuelistCharCreation", "UI/DuelistCharCreationHigh");

            sentinelButton = new CharButton(new Vector2(game.Width / 3, game.Height / 3 * 2), true, "UI/SentinelCharCreation", "UI/SentinelCharCreationHigh");
            bralwerButton = new CharButton(new Vector2(game.Width / 3 * 2, game.Height / 3 * 2), true, "UI/BrawlerCharCreation", "UI/BrawlerCharCreationHigh");

            sorcererButton = new CharButton(new Vector2(game.Width / 3, game.Height / 3 * 2), true, "UI/SorcererCharCreation", "UI/SorcererCharCreationHigh");
            magusButton = new CharButton(new Vector2(game.Width / 3 * 2, game.Height / 3 * 2), true, "UI/MagusCharCreation", "UI/MagusCharCreationHigh");

            quitButton = new UIButton(new Vector2(game.Width - CELLWIDTH, 0), false, "UI/QuitButton", "");

            restartButton = new UIButton(new Vector2(game.Width / 2 - 40, game.Height / 2), true, "UI/RestartButton", "");
            quitDeathButton = new UIButton(new Vector2(game.Width / 2 + 40, game.Height / 2), true, "UI/QuitButton", "");
            mainMenuOpen = true;

            escMainMenu = new UIButton(new Vector2(game.Width / 4, game.Height / 2), true, "UI/RestartButton", "Main Menu");
            escContinue = new UIButton(new Vector2(game.Width / 4 * 2, game.Height / 2), true, "UI/Continue", "Continue");
            escQuit = new UIButton(new Vector2(game.Width / 4 * 3, game.Height / 2), true, "UI/QuitButton", "Quit (NO SAVE)");

            Audio.playMusic("Stoneworld Battle", 1.0f);

            LoadSaveSlots();

            for (int i = 0; i < 4; i ++)
            {
                for (int j = 0; j < 4; j ++)
                {
                    inventoryButtons[i + j  * 4] = new InventoryButton(InventoryPosition + new Vector2(CELLWIDTH * i, CELLWIDTH * j), false, InventoryPosition + new Vector2(-300, -200));
                }
            }
        }