//Creating necessary PictureBox array and the inventory list for creating Inventory
        public Inventory(MainMethods givenMainMethod, MainVariables givenMainVariables, GameStart givenGameStart)
        {
            InitializeComponent();
            inventoryPicbArray = new PictureBox[]  { picBItemOne, picBItemTwo, picBItemThree, picBItemFour, picBItemFive, picBItemSix, picBItemSeven, picBItemEight,
                                                     picBItemNine, picBItemTen, picBItemEleven, picBItemTwelve, picBItemThirteen, picBItemFourteen, picBItemFifteen, picBItemSixteen };
            inventoryNameList = new List <string>();

            mainMethods   = givenMainMethod;
            mainVariables = givenMainVariables;
            gameStart     = givenGameStart;

            mainMethods.Fill_PictureBox(picBInventoryClose, mainVariables.UserInterface_InventoryClose);
            mainMethods.Form_Background_Change(this, mainVariables.UserInterface_InventoryBackground);

            //Filling the inventory slots by going through each item possible, checking if the countvalue is above 0, inventory name list is necessary for the on click
            //event of each picture box, item count not used yet but if i want to put a label or something on health potions, this might come in handy
            int picBWalker = 0;

            for (int i = 0; i < mainVariables.Items_List.Count; i++)
            {
                string[] stringBreaker = mainVariables.Items_List[i].Split('_');
                if (mainMethods.Check_Item_Above_0(i))
                {
                    int itemcount = Int32.Parse(stringBreaker[1]);
                    mainMethods.Fill_PictureBox(inventoryPicbArray[picBWalker], mainVariables.Items_Bitmap_List[i]);
                    inventoryNameList.Add(stringBreaker[0]);
                    picBWalker++;
                }
            }
        }
 //From the Character Creator to actually starting the game
 private void picBCCSend_Click(object sender, EventArgs e)
 {
     if (txtCharacterCreationName.Text == "")
     {
     }
     else
     {
         mainVariables.Character_Name = txtCharacterCreationName.Text;
         firstScreen = new GameStart(mainMethods, mainVariables, mainFrame);
         firstScreen.Show();
         this.Close();
     }
 }
Example #3
0
        public Main_Dialog(MainVariables givenMainVariables, MainMethods givenMainMethods, string givenName, GameStart GivenGameStart, MainFrame givenMainFrame, int optionCall)
        {
            InitializeComponent();
            gameStart = GivenGameStart;
            mainFrame = givenMainFrame;

            name          = givenName;
            mainVariables = givenMainVariables;
            mainMethods   = givenMainMethods;

            mainMethods.Form_Background_Change(this, mainVariables.UserInterface_DialogboxBackground);
            mainMethods.Fill_PictureBox(picBNextDialog, mainVariables.UserInterface_DialogForward);
            mainMethods.Dialog_Progression(name, optionCall, this, gameStart, mainFrame);
        }
        //Constructor to use the given variables and store the references, filling the pictureboxes etc.
        public IngameMenu(MainVariables givenMainVariables, MainMethods givenMainMethods, GameStart givenGameStart, MainFrame givenMainFrame)
        {
            //Initializing the ingame Menu
            InitializeComponent();

            mainVariables = givenMainVariables;
            mainMethods   = givenMainMethods;
            gamestart     = givenGameStart;
            mainFrame     = givenMainFrame;

            mainMethods.Fill_PictureBox(picBBackToGame, mainVariables.UserInterface_BackToGame);
            mainMethods.Fill_PictureBox(picBSaveGame, mainVariables.UserInterface_SaveGame);
            mainMethods.Fill_PictureBox(picBLoadGame, mainVariables.MainMenu_LoadGame);
            mainMethods.Fill_PictureBox(picBLeaveGame, mainVariables.UserInterface_BackToMainMenu);
            mainMethods.Form_Background_Change(this, mainVariables.UserInterface_IngameMenuBackground);
        }
        //PIC B GO FRONT
        private void PicBGoFront_Click(object sender, EventArgs e)
        {
            switch (mainVariables.StoryLine_Progress)
            {
            case 1:
                mainVariables.StoryLine_Progress++;
                GameStart gameStart = new GameStart(mainMethods, mainVariables, mainFrame);
                gameStart.Show();
                this.Close();
                break;

            case 3:
                main_Dialog = new Main_Dialog(mainVariables, mainMethods, "Ending", this, mainFrame);
                main_Dialog.Show();
                break;
            }
        }