private async void RuneComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!QuickLoad) //Make loading quicker
                return;

            SpellBookPageDTO SelectedRunePage = new SpellBookPageDTO();
            int i = 0;
            bool HasChanged = false;
            foreach (SpellBookPageDTO RunePage in MyRunes.BookPages)
            {
                string RunePageName = RunePage.Name;
                if (RunePageName.StartsWith("@@"))
                {
                    RunePageName = "Rune Page " + ++i;
                }
                RunePage.Current = false;
                if (RunePageName == (string)RuneComboBox.SelectedItem)
                {
                    RunePage.Current = true;
                    SelectedRunePage = RunePage;
                    HasChanged = true;
                    TextRange tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
                    tr.Text = "Selected " + RunePageName + " as Rune Page" + Environment.NewLine;
                    tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White);
                }
            }
            if (HasChanged)
            {
                await Client.PVPNet.SelectDefaultSpellBookPage(SelectedRunePage);
            }
        }
Ejemplo n.º 2
0
 private void RunePageListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     foreach (SpellBookPageDTO SpellPage in Client.LoginPacket.AllSummonerData.SpellBook.BookPages)
     {
         if (SpellPage.Current)
         {
             SpellPage.Current = false;
         }
     }
     Client.LoginPacket.AllSummonerData.SpellBook.BookPages[RunePageListView.SelectedIndex].Current = true;
     SelectedBook = Client.LoginPacket.AllSummonerData.SpellBook.BookPages[RunePageListView.SelectedIndex];
     RuneTextBox.Text = SelectedBook.Name;
     RefreshAvailableRunes();
     RenderRunes();
 }
Ejemplo n.º 3
0
 /// 53.)
 public void SelectDefaultSpellBookPage(SpellBookPageDTO spellBookPage, SpellBookPageDTO.Callback callback)
 {
     SpellBookPageDTO cb = new SpellBookPageDTO(callback);
     InvokeWithCallback("spellBookService", "selectDefaultSpellBookPage",
         new object[] { spellBookPage.GetBaseTypedObject() }, cb);
 }
Ejemplo n.º 4
0
 public SpellBookPageDTO SelectDefaultSpellBookPage(SpellBookPageDTO spellBookPage)
 {
     int Id = Invoke("spellBookService", "selectDefaultSpellBookPage",
         new object[] { spellBookPage.GetBaseTypedObject() });
     while (!results.ContainsKey(Id))
         System.Threading.Thread.Sleep(10);
     TypedObject messageBody = results[Id].GetTO("data").GetTO("body");
     SpellBookPageDTO result = new SpellBookPageDTO(messageBody);
     results.Remove(Id);
     return result;
 }
 public async Task<SpellBookPageDTO> SelectDefaultSpellBookPage(SpellBookPageDTO spellBookPage)
 {
     int Id = Invoke("spellBookService", "selectDefaultSpellBookPage",
         new object[] { spellBookPage.GetBaseTypedObject() });
     while (!results.ContainsKey(Id))
         await Task.Delay(10);
     TypedObject messageBody = results[Id].GetTO("data").GetTO("body");
     SpellBookPageDTO result = new SpellBookPageDTO(messageBody);
     results.Remove(Id);
     return result;
 }