예제 #1
0
 private void RefreshAvailableRunes()
 {
     AvailableRuneList.Items.Clear();
     foreach (runes Rune in Client.Runes)
     {
         bool filteredRune = true;
         if (RuneFilterComboBox.SelectedIndex == 0)
             filteredRune = false;
         else
         {
             foreach (string filter in Rune.tags)
             {
                 if (filter.ToLower().Contains(((Label)RuneFilterComboBox.SelectedItem).Content.ToString().ToLower()))
                 {
                     filteredRune = false;
                 }
             }
         }
         if (!filteredRune)
         {
             foreach (PVPNetConnect.RiotObjects.Platform.Summoner.Runes.SummonerRune rune in runes)
             {
                 if (Rune.id == rune.RuneId)
                 {
                     RuneItem item = new RuneItem();
                     item.RuneImage.Source = Rune.icon;
                     item.Margin = new Thickness(2, 2, 2, 2);
                     item.Tag = Rune;
                     item.Owned = rune.Quantity;
                     item.Used = rune.Quantity;
                     AvailableRuneList.Items.Add(item);
                     item.MouseMove += item_MouseMove;
                     item.MouseLeave += item_MouseLeave;
                 }
             }
         }
     }
 }
예제 #2
0
 private void AvailableRuneList_DoubleClickOrRightClick(object sender, MouseButtonEventArgs e)
 {
     if (((RuneItem)((ListView)sender).SelectedItem).Used <= 0)
         return;
     runes Rune = ((runes)((RuneItem)((ListView)sender).SelectedItem).Tag);
     RuneItem item = new RuneItem();
     item.RuneImage.Source = Rune.icon;
     item.Margin = new Thickness(2, 2, 2, 2);
     item.Tag = Rune;
     item.MouseRightButtonDown += item_MouseRightButtonDown;
     item.MouseMove += item_MouseMove;
     item.MouseLeave += item_MouseLeave;
     ListView tempRuneListView = new ListView();
     double tempAvailCount = 0;
     if (Rune.name.Contains("Mark"))
     {
         tempAvailCount = RedRunesAvail;
         tempRuneListView = RedListView;
     }
     if (Rune.name.Contains("Seal"))
     {
         tempAvailCount = YellowRunesAvail;
         tempRuneListView = YellowListView;
     }
     if (Rune.name.Contains("Glyph"))
     {
         tempAvailCount = BlueRunesAvail;
         tempRuneListView = BlueListView;
     }
     if (Rune.name.Contains("Quint"))
     {
         tempAvailCount = BlackRunesAvail;
         tempRuneListView = BlackListView;
     }
     if (tempRuneListView.Items.Count < tempAvailCount)
     {
         tempRuneListView.Items.Add(item);
         UpdateStatList();
         ((RuneItem)((ListView)sender).SelectedItem).Used--;
         AvailableRuneList.Items.Refresh();
     }
 }
예제 #3
0
        public void RenderRunes()
        {
            RedListView.Items.Clear();
            YellowListView.Items.Clear();
            BlueListView.Items.Clear();
            BlackListView.Items.Clear();
            if (SelectedBook != null)
            {
                foreach (SlotEntry RuneSlot in SelectedBook.SlotEntries)
                {
                    foreach (var obj in AvailableRuneList.Items)
                    {
                        try
                        {
                            if (((runes)((RuneItem)obj).Tag).id == RuneSlot.RuneId)
                            {
                                ((RuneItem)obj).Used--;
                            }
                        }
                        catch
                        {
                        }
                    }
                    AvailableRuneList.Items.Refresh();
                    UpdateStatList();
                    foreach (runes Rune in Client.Runes)
                    {
                        if (RuneSlot.RuneId == Rune.id)
                        {
                            RuneItem item = new RuneItem();
                            item.RuneImage.Source = Rune.icon;
                            item.Margin = new Thickness(2, 2, 2, 2);
                            item.Tag = Rune;
                            item.MouseRightButtonDown += item_MouseRightButtonDown;
                            item.MouseMove += item_MouseMove;
                            item.MouseLeave += item_MouseLeave;
                            if (Rune.name.Contains("Mark"))
                            {
                                RedListView.Items.Add(item);
                            }
                            else if (Rune.name.Contains("Seal"))
                            {
                                YellowListView.Items.Add(item);
                            }
                            else if (Rune.name.Contains("Glyph"))
                            {
                                BlueListView.Items.Add(item);
                            }
                            else if (Rune.name.Contains("Quint"))
                            {
                                BlackListView.Items.Add(item);
                            }

                        }
                    }
                }
            }
        }
예제 #4
0
        private void AvailableRuneList_doubleClickOrRightClick(object sender, MouseButtonEventArgs e)
        {
            if (((ListBox) sender).SelectedItem == null)
            {
                return;
            }

            if (((RuneItem) ((ListBox) sender).SelectedItem).Used <= 0)
            {
                return;
            }

            var rune = ((runes) ((RuneItem) ((ListBox) sender).SelectedItem).Tag);
            var item = new RuneItem
            {
                RuneImage = {Source = rune.icon},
                Margin = new Thickness(2, 2, 2, 2),
                Tag = rune,
                RuneName = {Content = rune.name},
                RuneEffect = {Content = rune.description}
            };
            item.MouseRightButtonDown += item_MouseRightButtonDown;
            item.MouseMove += item_MouseMove;
            item.MouseLeave += item_MouseLeave;
            var tempRuneListBox = new ListBox();
            double tempAvailCount = 0;
            if (rune.name.Contains("Mark"))
            {
                tempAvailCount = redRunesAvail;
                tempRuneListBox = RedListBox;
            }
            if (rune.name.Contains("Seal"))
            {
                tempAvailCount = yellowRunesAvail;
                tempRuneListBox = YellowListBox;
            }
            if (rune.name.Contains("Glyph"))
            {
                tempAvailCount = blueRunesAvail;
                tempRuneListBox = BlueListBox;
            }
            if (rune.name.Contains("Quint"))
            {
                tempAvailCount = blackRunesAvail;
                tempRuneListBox = BlackListBox;
            }
            if (!(tempRuneListBox.Items.Count < tempAvailCount))
            {
                return;
            }

            tempRuneListBox.Items.Add(item);
            UpdateStatList();
            ((RuneItem) ((ListBox) sender).SelectedItem).Used--;
            AvailableRuneList.Items.Refresh();
        }
예제 #5
0
        public void RenderRunes()
        {
            RedListBox.Items.Clear();
            YellowListBox.Items.Clear();
            BlueListBox.Items.Clear();
            BlackListBox.Items.Clear();
            if (selectedBook == null)
            {
                return;
            }

            foreach (var runeSlot in selectedBook.SlotEntries)
            {
                foreach (var obj in AvailableRuneList.Items)
                {
                    try
                    {
                        if (((runes) ((RuneItem) obj).Tag).id == runeSlot.RuneId)
                        {
                            ((RuneItem) obj).Used--;
                        }
                    }
                    catch
                    {
                    }
                }
                AvailableRuneList.Items.Refresh();
                UpdateStatList();
                foreach (var rune in Client.Runes)
                {
                    if (runeSlot.RuneId != rune.id)
                    {
                        continue;
                    }

                    var item = new RuneItem
                    {
                        RuneImage = {Source = rune.icon},
                        RuneName = {Content = rune.name},
                        RuneEffect = {Content = rune.description},
                        Margin = new Thickness(2, 2, 2, 2),
                        Tag = rune
                    };
                    item.MouseRightButtonDown += item_MouseRightButtonDown;
                    item.MouseMove += item_MouseMove;
                    item.MouseLeave += item_MouseLeave;
                    if (rune.name.Contains("Mark"))
                    {
                        RedListBox.Items.Add(item);
                    }
                    else if (rune.name.Contains("Seal"))
                    {
                        YellowListBox.Items.Add(item);
                    }
                    else if (rune.name.Contains("Glyph"))
                    {
                        BlueListBox.Items.Add(item);
                    }
                    else if (rune.name.Contains("Quint"))
                    {
                        BlackListBox.Items.Add(item);
                    }
                }
            }
        }
예제 #6
0
        private void RefreshAvailableRunes()
        {
            AvailableRuneList.Items.Clear();
            foreach (var Rune in Client.Runes)
            {
                var filteredRune = true;
                if (RuneFilterComboBox.SelectedIndex == 0)
                {
                    filteredRune = false;
                }
                else
                {
                    foreach (var filter in Rune.tags.Cast<string>().Where(filter => filter.ToLower()
                        .Contains(((Label) RuneFilterComboBox.SelectedItem).Content.ToString().ToLower())))
                    {
                        filteredRune = false;
                    }
                }

                if (filteredRune)
                {
                    continue;
                }

                foreach (var rune in runes)
                {
                    if (Rune.id != rune.RuneId)
                    {
                        continue;
                    }

                    var item = new RuneItem
                    {
                        RuneImage = {Source = Rune.icon},
                        Margin = new Thickness(2, 2, 2, 2),
                        Tag = Rune,
                        Owned = rune.Quantity,
                        Used = rune.Quantity
                    };
                    AvailableRuneList.Items.Add(item);
                    item.MouseMove += item_MouseMove;
                    item.MouseLeave += item_MouseLeave;
                }
            }
        }