コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: Josh-Russell/HDATE
        public void hookUpInterface()
        {
            inGameScreen = new inGame(ref p1);
            charCreation = new CharacterCreation(ref p1);
            startScreen = new StartScreen();
            deathScreen = new DeathScreen();

            startScreen.NewGame.Click += NewGame_Click;
            startScreen.LoadGame.Click += loadGame_Click;

            deathScreen.StartScreen.Click += StartGame_Click;
            deathScreen.EndGame.Click+=EndGame_Click;

            charCreation.strUp.Click += plusStr_Click;
            charCreation.dexUp.Click += plusDex_Click;
            charCreation.intUp.Click += plusInt_Click;
            charCreation.strdwn.Click += strdwn_Click;
            charCreation.dexdwn.Click += dexdwn_Click;
            charCreation.intdwn.Click += intdwn_Click;
            charCreation.completeButton.Click += completeButton_Click;

            inGameScreen.muteButton.Click += muteSound_Click;

            inGameScreen.armorBox.SelectionChanged += armorBox_SelectionChanged;
            inGameScreen.weaponBox.SelectionChanged += weaponBox_SelectionChanged;
            inGameScreen.useConsumable.Click += useConsumable_Click;

            inGameScreen.plusDex.Click += plusDex_Click;
            inGameScreen.plusInt.Click += plusInt_Click;
            inGameScreen.plusStr.Click += plusStr_Click;

            inGameScreen.Shop1.sellWeapon.Click += sellWeapon_Click;
            inGameScreen.Shop1.sellArmor.Click += sellArmor_Click;
            inGameScreen.Shop1.sellConsumable.Click += sellConsumable_Click;

            inGameScreen.Shop1.buyWeapon.Click += buyWeapon_Click;
            inGameScreen.Shop1.buyArmor.Click += buyArmor_Click;
            inGameScreen.Shop1.buyConsumable.Click += buyConsumable_Click;

            inGameScreen.Shop1.weaponBox.ItemsSource = p1.weaponInventory;
            inGameScreen.Shop1.armorBox.ItemsSource = p1.armorInventory;
            inGameScreen.Shop1.consumeBox.ItemsSource = p1.itemInventory;

            inGameScreen.Shop1.weaponBox.SelectionChanged += storeWeaponBox_SelectionChanged;
            inGameScreen.Shop1.armorBox.SelectionChanged += storeArmorBox_SelectionChanged;
            inGameScreen.Shop1.consumeBox.SelectionChanged += storeConsumeBox_SelectionChanged;

            inGameScreen.Shop1.shopWeaponBox.SelectionChanged += shopWeaponBox_SelectionChanged;
            inGameScreen.Shop1.shopArmorBox.SelectionChanged += shopArmorBox_SelectionChanged;
            inGameScreen.Shop1.shopConsumeBox.SelectionChanged += shopConsumeBox_SelectionChanged;

            inGameScreen.Shop1.shopWeaponBox.ItemsSource = shopWeaponInventory;
            inGameScreen.Shop1.shopArmorBox.ItemsSource = shopArmorInventory;
            inGameScreen.Shop1.shopConsumeBox.ItemsSource = shopConsumableInventory;

            inGameScreen.Shop1.playerGold.DataContext = p1;

            inGameScreen.Shop1.Visibility = Visibility.Hidden;
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: Josh-Russell/HDATE
        public void startLoadedGame()
        {
            if (playSound)
            {
                sp.SoundLocation = "Resources/HDATE Main Theme.wav";
                sp.PlayLooping();
            }
            inGameScreen = new inGame(ref p1);
            hookUpInterface();
            currentScene = Scenes.Ingame;

            clearPlayArea();
            generateMap(0);
            displayMap();
            screenArea.Children.Add(inGameScreen);
        }