public EditSave(string gameName, string saveDate)
        {
            // Start up the form
            NavigationClass.SaveNextForm(new string[] { "Game Settings", gameName });
            InitializeComponent();
            splt_saveAndNotes.SplitterWidth    = 16;
            splt_saveAndNotes.SplitterDistance = splt_saveAndNotes.Height / 2;
            CenterToScreen();

            // Get the global variables
            GameIndex = FormNav.ScreenCode.Games.FindIndex(x => x.Name == gameName);
            SaveIndex = FormNav.ScreenCode.Games[GameIndex].Saves.FindIndex(x => x.Date.ToString(Save.Culture) == saveDate);
            if (SaveIndex == -1)
            {
                Save = new Save("Save " + (FormNav.ScreenCode.Games[GameIndex].Saves.Count + 1), null, false, "", new string[] { });
            }
            else
            {
                Save = new Save(FormNav.ScreenCode.Games[GameIndex].Saves[SaveIndex]);
            }

            // Sets the favourited status
            if (Save.Favourited)
            {
                img_favourited.Image = Properties.Resources.Favourited;
            }
            else
            {
                img_favourited.Image = Properties.Resources.Unfavourited;
            }
        }
Beispiel #2
0
        private void editSave_Click(object sender, EventArgs e)
        {
            Control control = sender as Control;

            NavigationClass.SaveNextForm(new string[] { "Edit Save", Game.Name, control.Name });
            Close();
        }
Beispiel #3
0
 public DisplayScreen()
 {
     // Start up the form
     NavigationClass.SaveNextForm(new string[] { "null" });
     InitializeComponent();
     CenterToScreen();
     splitContainer1.SplitterDistance = splitContainer1.Width / 2;
 }
Beispiel #4
0
 private void btn_gameSettings_Click(object sender, EventArgs e)
 {
     // Only closes if something is selected
     if (cBo_gameSelector.SelectedItem != null)
     {
         NavigationClass.SaveNextForm(new string[] { "Game Settings", cBo_gameSelector.SelectedItem.ToString() });
         Close();
     }
 }
Beispiel #5
0
        public GameSettings(string gameName)
        {
            // Sets up the game variables
            GameIndex = FormNav.ScreenCode.Games.FindIndex(x => x.Name == gameName);
            Game      = FormNav.ScreenCode.Games[GameIndex];

            // Starts up the form
            NavigationClass.SaveNextForm(new string[] { "Display Screen" });
            InitializeComponent();
            CenterToScreen();
            RefreshSaves();
        }
Beispiel #6
0
        private void FormNav_Load(object sender, EventArgs e)
        {
            NavigationClass.SaveNextForm(new string[] { "Display Screen" });
            ExtraMusic.Start();

            while (NavigationClass.GetNextForm()[0] != "null")
            {
                // Get the next form
                string[] nextForm = NavigationClass.GetNextForm();
                Form     newForm;

                // Choose which form to create a new class of (dictionaries don't work due to not creating a new class when value called)
                if (nextForm[0] == "Display Screen")
                {
                    newForm = new DisplayScreen();
                }
                else if (nextForm[0] == "Game Settings")
                {
                    newForm = new GameSettings(nextForm[1]);
                }
                else if (nextForm[0] == "Edit Save")
                {
                    newForm = new EditSave(nextForm[1], nextForm[2]);
                }
                else if (nextForm[0] == "View Save")
                {
                    newForm = new ViewSave(nextForm[1], nextForm[2]);
                }
                else
                {
                    newForm = new Form();
                    NavigationClass.SaveNextForm(new string[] { "null" });
                }

                Hide();
                newForm.ShowDialog();

                // Show loading form
                CreateControl();
                Show();
                Update();
            }

            ExtraMusic.Abort();
            Close();

            File.Delete(NavigationClass.FormSaveLocation);
            ScreenCode.Save();
        }
        public ViewSave(string gameName, string saveDate)
        {
            // Start up form
            InitializeComponent();
            CenterToScreen();
            NavigationClass.SaveNextForm(new string[] { "Game Settings", gameName });

            // Set the public variables for the save
            int gameIndex = FormNav.ScreenCode.Games.FindIndex(x => x.Name == gameName);

            SaveIndex = FormNav.ScreenCode.Games[gameIndex].Saves.FindIndex(x => x.Date.ToString(Save.Culture) == saveDate);
            Save      = FormNav.ScreenCode.Games[gameIndex].Saves[SaveIndex];

            // Resets the music image and starts a new thread for the music
            ResetMusicImage();
            CheckMusicThread = new Thread(() => CheckMusic());
            CheckMusicThread.Start();
        }
Beispiel #8
0
 private void btn_addSave_Click(object sender, EventArgs e)
 {
     NavigationClass.SaveNextForm(new string[] { "Edit Save", Game.Name, "" });
     Close();
 }