Ejemplo n.º 1
0
        public ChampionDetails(ChampionContainer champion)
        {
            InitializeComponent();
            pictureBox1.Image = HelpMethods.getImageFromLocalDirectory(champion.Image);
            championName.Text = champion.Name;
            championDetailsText.Text = champion.Description;
            searchTag.Text = champion.SearchTag;
            ChangesMade = false;

            resultChampion = champion;
        }
Ejemplo n.º 2
0
 public MatchupDetails(ChampionContainer champion,ChampionContainer enemyChampion)
 {
     InitializeComponent();
     matchupDetails = champion.GetMatchupInfo(enemyChampion.Name);
     enemyChampionName = enemyChampion.Name;
     resultChampion = champion;
     ChangesMade = false;
     championImage.Image = HelpMethods.getImageFromLocalDirectory(champion.Image);
     enemyImage.Image = HelpMethods.getImageFromLocalDirectory(enemyChampion.Image);
     championName.Text = champion.Name;
     enemyName.Text = enemyChampionName;
     if (matchupDetailsText != null)
     {
         matchupDetailsText.Text = matchupDetails;
     }
 }
Ejemplo n.º 3
0
        public void Add(Champion champion)
        {
            ChampionContainer newChampion;
            if(_mainForm==null)
            {
                newChampion = new ChampionContainer(champion);
            }
            else
            {

                newChampion = new ChampionContainer(champion, _mainForm);
            }

            if(_controlPanel!=null)
            {
                _controlPanel.Controls.Add(newChampion.PictureBox);
            }
            if(_contextMenu!=null)
            {
                newChampion.PictureBox.ContextMenuStrip = _contextMenu;
            }

            _listOfChampions.Add(newChampion);
        }
Ejemplo n.º 4
0
        public void ProcessChampionPictureClick(ChampionContainer selChamp)
        {
            if (displayChampionMatchupsList == false)
            {
                selectedChampion = selChamp;
                if (selChamp != null)
                {
                    pictureSelectedChamp.Image = HelpMethods.getImageFromLocalDirectory(selChamp.Image);
                    selectedChampTextBox.Text = selChamp.Name;

                    SetFormState(Form1State.ChampionSelected);
                }
                else
                {
                    pictureSelectedChamp.Image = Properties.Resources.DefaultImage;
                    selectedChampTextBox.Text = "";

                    SetFormState(Form1State.ListsView);
                }
            }
            else
            {
                if (selectedChampion != null)
                {
                    MatchupDetails championDialog = new MatchupDetails(selectedChampion,selChamp);

                    championDialog.ShowDialog();

                    if (championDialog.ChangesMade)
                    {
                        HelpMethods.UpdateChampionAcrossAllCollections(ref collectionList,championDialog.Result);
                        saveFile.ImportLines(collectionList);
                        saveFile.saveToFile("rekt.gg");
                    }
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// initListCollection assumes that the clast list collection has not been loaded or has just been reloaded from a file.
        /// It's job is to set all apropriate variables correctly, unsuring that the screen will load correctly with the new data.
        /// </summary>
        private void initListCollection()
        {
            if (collectionList == null)
            {
                MessageBox.Show("Awww shit n***a");
            }
            else
            {
                foreach (ChampionCollection List in collectionList)
                {

                    List.AddControlPanel(ref this.controlPanel);
                    List.AddFormReference(this);

                    if (List.Name == Constants.ALL_CHAMPIONS)
                    {
                        List.AddContextMenu(this.AllChampsContextMenu);
                        selectedCollection = List;
                        allChampionsCollection = List;
                        allChampionsCollection.Sort();

                    }
                    else
                    {
                        List.AddContextMenu(this.CustomListsStrip);
                    }
                }

            }

            selectedChampion = null;
            updateListCollectionDropdown();
            BuildContextMenu();
            SetFormState(Form1State.InitialView);

            selectedCollection.Print("");
        }
Ejemplo n.º 6
0
        private void ChampionDetailsButton_Click(object sender, EventArgs e)
        {
            if (selectedChampion != null)
            {
                ChampionDetails championDialog = new ChampionDetails(selectedChampion);

                championDialog.ShowDialog();

                if (championDialog.ChangesMade)
                {
                    HelpMethods.UpdateChampionAcrossAllCollections(ref collectionList, championDialog.Result);
                    selectedChampion = championDialog.Result;
                    saveFile.ImportLines(collectionList);
                    saveFile.saveToFile("rekt.gg");
                }
            }
        }
Ejemplo n.º 7
0
 public void ReplaceExistingChampion(ChampionContainer modChampion)
 {
     for (int i = 0; i<_listOfChampions.Count; i++)
     {
         if (_listOfChampions[i].Name == modChampion.Name)
         {
             _listOfChampions[i] = modChampion;
         }
     }
 }