Exemple #1
0
        public GameScreen(Control MainControl, int MapIndex, int SavegameIndex, GameControl.MultiplayerMatchStartInformation MPInfo)
        {
            InitializeComponent(); // load GameScreen.xaml
            this.Resources.MergedDictionaries.Add(R.GetLanguageDictionary()); // load dictionary resource

            this.MainControl = MainControl;
            this.GameControl = new GameControl(MainControl, this, MapIndex, SavegameIndex, MPInfo); // bi-directional association between control and gui

            if (GameControl.Game == null) // problems initializing the game object
                return;

            if (GameControl.Game.Map == null) // something went wront
            {
                MainControl.ShowMenuScreen();
            }

            // initialize gui (hide stuff, etc.)
            HideRecruitmentMenu();

            RefreshMap(GameControl.Game.Map);
            RefreshMoneyAndFractionOnTheMove();

            Label_Info_Name.Content = null;
            Label_Info_Type.Content = null;
            Label_AttackBonus.Content = null;
            Label_DefenseBonus.Content = null;
            Image_AttackBonus.Visibility = Visibility.Hidden;
            Image_DefenseBonus.Visibility = Visibility.Hidden;

            // sound
            Sound.PlaySound(Sound.SoundName.GameBackground);
        }
Exemple #2
0
        //private Point LastMouseLocation = new Point(0, 0);
        public MainWindow()
        {
            // splash screen
            SplashScreen SplashScreen = new SplashScreen("Resources/Cover.png");
            SplashScreen.Show(false); // show splash screen;
            Thread.Sleep(1000);
            SplashScreen.Close(new TimeSpan(0)); // close splash screen

            InitializeComponent();
            this.Resources.MergedDictionaries.Add(R.GetLanguageDictionary()); // load dictionary resource

            this.Control = new Control(this);

            // load settings
            if (Data.GetSoundState() == false)
                ToggleVolume();

            if (Data.GetFullScreenState() == true)
                ToggleFullScreen();

            Control.ShowMenuScreen(); // default screen is the menu
        }