コード例 #1
0
ファイル: App.xaml.cs プロジェクト: edekk/rawr-2.3.23
        //private System.Threading.Timer _timerUpdates;
        //private void _timerUpdates_Tick(object state)
        //{
        //	Application.Current.RootVisual.Dispatcher.BeginInvoke(SayCheckingForUpdates);
        //}

        //private void SayCheckingForUpdates()
        //{
        //	MessageBox.Show("Checking for updates...");
        //}

        private void Application_Startup(object sender, StartupEventArgs e)
        {
#if SILVERLIGHT
            Properties.NetworkSettings.UseAspx = e.InitParams.ContainsKey("UseAspx");
#endif
            Grid       g  = new Grid();
            LoadScreen ls = new LoadScreen();
            g.Children.Add(ls);
            RootVisual = g;
            ls.StartLoading(new EventHandler(LoadFinished));
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: LucasPeacecraft/rawr
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     Properties.NetworkSettings.UseAspx = e.InitParams.ContainsKey("UseAspx");
     if (this.IsRunningOutOfBrowser) {
         this.MainWindow.WindowState = WindowState.Maximized;
     }
     Grid g = new Grid();
     LoadScreen ls = new LoadScreen();
     g.Children.Add(ls);
     RootVisual = g;
     ls.StartLoading(new EventHandler(LoadFinished));
 }
コード例 #3
0
ファイル: MainPage.xaml.cs プロジェクト: tsebalj1/rawr
 private void ResetItemCaches_Confirmation(object sender, EventArgs e)
 {
     if (((ConfirmationWindow)sender).DialogResult == true)
     {
         Character = new Character();
         new FileUtils("ItemCache.xml").Delete();
         LoadScreen ls = new LoadScreen();
         (App.Current.RootVisual as Grid).Children.Add(ls);
         this.Visibility = Visibility.Collapsed;
         ls.StartLoading(new EventHandler(ResetCaches_Finished));
         Character = new Character();
     }
 }
コード例 #4
0
ファイル: MainPage.xaml.cs プロジェクト: tsebalj1/rawr
 private void ResetAllCaches_Confirmation(object sender, EventArgs e)
 {
     if (((ConfirmationWindow)sender).DialogResult == true)
     {
         Character = new Character();
         new FileUtils(new string[] {
             "BuffCache.xml",
             "EnchantCache.xml",
             "ItemCache.xml",
             "Talents.xml",
             "PetTalents.xml",
             "BuffSets.xml",
             "ItemSource.xml",
             "ItemFilter.xml",
             "Settings.xml"
         }).Delete();
         LoadScreen ls = new LoadScreen();
         (App.Current.RootVisual as Grid).Children.Add(ls);
         this.Visibility = Visibility.Collapsed;
         ls.StartLoading(new EventHandler(ResetCaches_Finished));
         Character = new Character();
     }
 }
コード例 #5
0
ファイル: App.xaml.cs プロジェクト: edekk/rawr-2.3.23
 private void Application_Exit(object sender, EventArgs e)
 {
     LoadScreen.SaveFiles();
 }
コード例 #6
0
ファイル: MainPage.xaml.cs プロジェクト: LucasPeacecraft/rawr
        private void ResetItemCaches_Confirmation(object sender, EventArgs e)
        {
            if (((ConfirmationWindow)sender).DialogResult == true)
            {
                Rawr.Properties.GeneralSettings.Default.IsNewVersionRunning = false;
                Character = new Character() { IsLoading = false };
                string dir = "";
#if !SILVERLIGHT
                dir = "ClientBin\\";
#endif
                new FileUtils(new string[] { dir + "ItemCache.xml", }).Delete();
                LoadScreen ls = new LoadScreen();
                (App.Current.RootVisual as Grid).Children.Add(ls);
                this.Visibility = Visibility.Collapsed;
                ls.StartLoading(new EventHandler(ResetCaches_Finished));
                Character = new Character() { IsLoading = false };
            }
        }
コード例 #7
0
ファイル: MainPage.xaml.cs プロジェクト: LucasPeacecraft/rawr
        public void ResetAllCaches_Action()
        {
            Character = new Character() { IsLoading = false };
            string dir = "";
#if !SILVERLIGHT
            dir = "ClientBin\\";
#endif
            new FileUtils(new string[] {
                dir+"BuffSets.xml", 
                dir+"ItemCache.xml",
                dir+"ItemFilter.xml",
                dir+"PetTalents.xml",
                dir+"Settings.xml",
                dir+"Talents.xml",
            }).Delete();
            LoadScreen ls = new LoadScreen();
            (App.Current.RootVisual as Grid).Children.Add(ls);
            this.Visibility = Visibility.Collapsed;
            ls.StartLoading(new EventHandler(ResetCaches_Finished));
            Character = new Character() { IsLoading = false };
        }
コード例 #8
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if (CurrentItem != null)
            {
                CurrentItem.Name       = NameText.Text;
                CurrentItem.SetName    = SetNameText.Text;
                CurrentItem.IconPath   = IconPathText.Text;
                CurrentItem.Unique     = UniqueCheck.IsChecked.GetValueOrDefault(false);
                CurrentItem.ItemLevel  = (int)IlvlNum.Value;
                CurrentItem.Id         = (int)IdNum.Value;
                CurrentItem.MinDamage  = (int)MinDamageNum.Value;
                CurrentItem.MaxDamage  = (int)MaxDamageNum.Value;
                CurrentItem.Speed      = (float)SpeedNum.Value;
                CurrentItem.Stats      = clonedStats;
                CurrentItem.Type       = (ItemType)TypeCombo.SelectedIndex;
                CurrentItem.Slot       = (ItemSlot)SlotCombo.SelectedIndex;
                CurrentItem.Bind       = (BindsOn)BindCombo.SelectedIndex;
                CurrentItem.Quality    = (ItemQuality)QualityCombo.SelectedIndex;
                CurrentItem.DamageType = (ItemDamageType)DamageTypeComboBox.SelectedIndex;
                CurrentItem.Cost       = (float)CostText.Value;

                if (Gem1Combo.SelectedIndex == 1)
                {
                    CurrentItem.SocketColor1 = ItemSlot.Meta;
                }
                else if (Gem1Combo.SelectedIndex == 2)
                {
                    CurrentItem.SocketColor1 = ItemSlot.Red;
                }
                else if (Gem1Combo.SelectedIndex == 3)
                {
                    CurrentItem.SocketColor1 = ItemSlot.Yellow;
                }
                else if (Gem1Combo.SelectedIndex == 4)
                {
                    CurrentItem.SocketColor1 = ItemSlot.Blue;
                }
                else if (Gem1Combo.SelectedIndex == 5)
                {
                    CurrentItem.SocketColor1 = ItemSlot.Cogwheel;
                }
                else if (Gem1Combo.SelectedIndex == 6)
                {
                    CurrentItem.SocketColor1 = ItemSlot.Hydraulic;
                }
                else if (Gem1Combo.SelectedIndex == 7)
                {
                    CurrentItem.SocketColor1 = ItemSlot.Prismatic;
                }
                else
                {
                    CurrentItem.SocketColor1 = ItemSlot.None;
                }
                if (Gem2Combo.SelectedIndex == 1)
                {
                    CurrentItem.SocketColor2 = ItemSlot.Meta;
                }
                else if (Gem2Combo.SelectedIndex == 2)
                {
                    CurrentItem.SocketColor2 = ItemSlot.Red;
                }
                else if (Gem2Combo.SelectedIndex == 3)
                {
                    CurrentItem.SocketColor2 = ItemSlot.Yellow;
                }
                else if (Gem2Combo.SelectedIndex == 4)
                {
                    CurrentItem.SocketColor2 = ItemSlot.Blue;
                }
                else if (Gem2Combo.SelectedIndex == 5)
                {
                    CurrentItem.SocketColor2 = ItemSlot.Cogwheel;
                }
                else if (Gem2Combo.SelectedIndex == 6)
                {
                    CurrentItem.SocketColor2 = ItemSlot.Hydraulic;
                }
                else if (Gem2Combo.SelectedIndex == 7)
                {
                    CurrentItem.SocketColor2 = ItemSlot.Prismatic;
                }
                else
                {
                    CurrentItem.SocketColor2 = ItemSlot.None;
                }
                if (Gem3Combo.SelectedIndex == 1)
                {
                    CurrentItem.SocketColor3 = ItemSlot.Meta;
                }
                else if (Gem3Combo.SelectedIndex == 2)
                {
                    CurrentItem.SocketColor3 = ItemSlot.Red;
                }
                else if (Gem3Combo.SelectedIndex == 3)
                {
                    CurrentItem.SocketColor3 = ItemSlot.Yellow;
                }
                else if (Gem3Combo.SelectedIndex == 4)
                {
                    CurrentItem.SocketColor3 = ItemSlot.Blue;
                }
                else if (Gem3Combo.SelectedIndex == 5)
                {
                    CurrentItem.SocketColor3 = ItemSlot.Cogwheel;
                }
                else if (Gem3Combo.SelectedIndex == 6)
                {
                    CurrentItem.SocketColor3 = ItemSlot.Hydraulic;
                }
                else if (Gem3Combo.SelectedIndex == 7)
                {
                    CurrentItem.SocketColor3 = ItemSlot.Prismatic;
                }
                else
                {
                    CurrentItem.SocketColor3 = ItemSlot.None;
                }

                if (SourcesChanged /* && tempSources != null*/)
                {
                    CurrentItem.LocationInfo = tempSources;
                }

                if (CB_Faction.SelectedIndex == 0)
                {
                    currentItem.Faction = ItemFaction.Neutral;
                }
                else if (CB_Faction.SelectedIndex == 1)
                {
                    currentItem.Faction = ItemFaction.Alliance;
                }
                else if (CB_Faction.SelectedIndex == 2)
                {
                    currentItem.Faction = ItemFaction.Horde;
                }
                else
                {
                    currentItem.Faction = ItemFaction.Neutral;
                }

                foreach (PropertyInfo info in Stats.PropertyInfoCache)
                {
                    if (Extensions.DisplayName(info).Equals(BonusStat.SelectedItem))
                    {
                        PropertyInfo oldStat = BonusStat.Tag as PropertyInfo;
                        object[]     param   = new object[1] {
                            0
                        };
                        oldStat.GetSetMethod().Invoke(CurrentItem.SocketBonus, param);
                        param = new object[1] {
                            float.Parse(BonusAmount.Text)
                        };
                        info.GetSetMethod().Invoke(CurrentItem.SocketBonus, param);
                        BonusStat.Tag = info;
                        break;
                    }
                }

                string req = null;
                foreach (KeyValuePair <string, CheckBox> kvp in ClassCheckBoxes)
                {
                    if (kvp.Value.IsChecked.GetValueOrDefault(false))
                    {
                        if (req == null)
                        {
                            req = kvp.Key;
                        }
                        else
                        {
                            req += "|" + kvp.Key;
                        }
                    }
                }
                CurrentItem.RequiredClasses = req;
                CurrentItem.InvalidateCachedData();
                ItemCache.OnItemsChanged();
            }
            LoadScreen.SaveFiles();
            this.DialogResult = true;
        }