public MapWindow(GameOptions options) { InitializeComponent(); profileManager = ProfileManager.InstanceCreator(); InitializeProfileOnGUI(options._Player1); SoundManager.sfxVolume = Properties.Settings.Default.SFXVolume; SoundManager.musicVolume = Properties.Settings.Default.MusicVolume; unMuteMusicVol = SoundManager.musicVolume / 16; unMuteSoundVol = SoundManager.sfxVolume / 16; currentMusicVol = SoundManager.musicVolume / 16; currentSoundVol = SoundManager.sfxVolume / 16; SoundManager.backgroundMusicPlayer.Open(new Uri("GUI/Sounds/24.mp3", UriKind.Relative)); SoundManager.backgroundMusicPlayer.Play(); }
public MapPage(GameOptions options) { InitializeComponent(); profileManager = ProfileManager.InstanceCreator(); InitializeProfileOnGUI(options._Player1); SetUpCampaignProgress(options._Player1.Name); profileName = options._Player1.Name; SoundManager.sfxVolume = Properties.Settings.Default.SFXVolume; SoundManager.musicVolume = Properties.Settings.Default.MusicVolume; unMuteMusicVol = SoundManager.musicVolume / 16; unMuteSoundVol = SoundManager.sfxVolume / 16; currentMusicVol = SoundManager.musicVolume / 16; currentSoundVol = SoundManager.sfxVolume / 16; SoundManager.backgroundMusicPlayer.Open(new Uri("GUI/Sounds/24.mp3", UriKind.Relative)); SoundManager.backgroundMusicPlayer.Play(); vikingArmPivot = new Point(0, System.Windows.SystemParameters.PrimaryScreenHeight - 52); zero = new Point(0, 0); topRight = new Point(System.Windows.SystemParameters.PrimaryScreenWidth, 0); iceGiantArmPivot = new Point(System.Windows.SystemParameters.PrimaryScreenWidth - 261, System.Windows.SystemParameters.PrimaryScreenHeight - 600); }
public MenuPage() { InitializeComponent(); SoundManager.sfxVolume = Properties.Settings.Default.SFXVolume; SoundManager.musicVolume = Properties.Settings.Default.MusicVolume; unMuteMusicVol = SoundManager.musicVolume / 16; unMuteSoundVol = SoundManager.sfxVolume / 16; currentMusicVol = SoundManager.musicVolume / 16; currentSoundVol = SoundManager.sfxVolume / 16; restoreMusicVol(currentMusicVol); restoreSoundVol(currentSoundVol); profileManager = ProfileManager.InstanceCreator(); vikingArmPivot = new System.Windows.Point(167 + 40, this.Height - 420 + 121); zero = new System.Windows.Point(0, 0); topRight = new System.Windows.Point(Width, 0); Stream cur = File.OpenRead("GUI/images/MouseArrow.cur"); this.Cursor = new Cursor(cur); }
public MainMenu() { InitializeComponent(); SoundManager.sfxVolume = Properties.Settings.Default.SFXVolume; SoundManager.musicVolume = Properties.Settings.Default.MusicVolume; unMuteMusicVol = SoundManager.musicVolume / 16; unMuteSoundVol = SoundManager.sfxVolume / 16; currentMusicVol = SoundManager.musicVolume / 16; currentSoundVol = SoundManager.sfxVolume / 16; SoundManager.backgroundMusicPlayer.Open(new Uri("GUI/Sounds/Intro.mp3", UriKind.Relative)); SoundManager.backgroundMusicPlayer.Play(); //Initialize profile manager profileManager = ProfileManager.InstanceCreator(); //MainMenuWindow = this; vikingArmPivot = new System.Windows.Point(167 + 40, this.Height - 420 + 121); zero = new System.Windows.Point(0, 0); topRight = new System.Windows.Point(Width, 0); Stream cur = File.OpenRead("GUI/images/MouseArrow.cur"); this.Cursor = new Cursor(cur); }
public GamePage(GameOptions options) { InitializeComponent(); CreateChildrenList(); quotes = new Quotes(); gameOptions = options; switch (gameOptions._TypeOfGame) { case GameOptions.TypeOfGame.QuickMatch: SoundManager.backgroundMusicPlayer.Open(new Uri("GUI/Sounds/Gameplay.mp3", UriKind.Relative)); SoundManager.backgroundMusicPlayer.Play(); player1 = options._Player1; player2 = options._Player2; gameBrain = new GameBrain(player1); Player1NameText.Text = player1.Name; Player2NameText.Text = player2.Name; isNetwork = false; break; case GameOptions.TypeOfGame.Network: SoundManager.backgroundMusicPlayer.Open(new Uri("GUI/Sounds/Gameplay.mp3", UriKind.Relative)); SoundManager.backgroundMusicPlayer.Play(); player1 = options._Player1; player2 = options._Player2; gameBrain = new GameBrain(player1); Player1NameText.Text = player1.Name; Player2NameText.Text = player2.Name; networkUtil = options._NetworkUtil; networkUtil.MoveReceived += new moveReceivedHandler(NetworkMoveReceived); networkUtil.Disconnected += new peerDisconnectedHancler(PeerDisconnected); isNetwork = true; break; case GameOptions.TypeOfGame.AI: SoundManager.backgroundMusicPlayer.Open(new Uri("GUI/Sounds/Gameplay.mp3", UriKind.Relative)); SoundManager.backgroundMusicPlayer.Play(); player1 = options._Player1; computerPlayer = options._ComputerPlayer; gameBrain = new GameBrain(player1, computerPlayer); Player1NameText.Text = player1.Name; Player2NameText.Text = computerPlayer.Name; if (!player1.ActivePlayer) GetComputerMoveAsynchronously(); isNetwork = false; break; case GameOptions.TypeOfGame.Campaign: profileManager = ProfileManager.InstanceCreator(); levelPlay = options._LevelPlay; SetUpCampaign(options._LevelPlay); player1 = options._Player1; computerPlayer = options._ComputerPlayer; gameBrain = new GameBrain(player1, computerPlayer); Player1NameText.Text = player1.Name; Player2NameText.Text = computerPlayer.Name; if (!player1.ActivePlayer) GetComputerMoveAsynchronously(); isNetwork = false; break; default: break; } ShowActivePlayer(); if (File.Exists("C:\\Users\\Public\\Documents\\Dragon Horde\\" + player1.Name + ".png")) { System.Drawing.Image img = System.Drawing.Image.FromFile("C:\\Users\\Public\\Documents\\Dragon Horde\\" + player1.Name + ".png"); System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(img); BitmapSource bmpSrc = Imaging.CreateBitmapSourceFromHBitmap(bmp.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); bmp.Dispose(); VikingButton.Background = new ImageBrush(bmpSrc); } vikingArmPivot = new Point(167 + 40, System.Windows.SystemParameters.PrimaryScreenHeight - 420 + 121); zero = new Point(0, 0); topRight = new Point(System.Windows.SystemParameters.PrimaryScreenWidth, 0); iceGiantArmPivot = new Point(System.Windows.SystemParameters.PrimaryScreenWidth - 261, System.Windows.SystemParameters.PrimaryScreenHeight - 600); unMuteMusicVol = SoundManager.musicVolume / 16; unMuteSoundVol = SoundManager.sfxVolume / 16; currentMusicVol = SoundManager.musicVolume / 16; currentSoundVol = SoundManager.sfxVolume / 16; restoreMusicVol(currentMusicVol); restoreSoundVol(currentSoundVol); Stream cur = File.OpenRead("GUI/images/MouseArrow.cur"); this.Cursor = new Cursor(cur); InitializeDragonOrigins(); }
public static ProfileManager InstanceCreator() { if (instance == null) instance = new ProfileManager(); return instance; }