Beispiel #1
0
        private void researchList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            capital_city_research_data data = researchList.SelectedItem as capital_city_research_data;

            if (data == null) // set filter changed
            {
                return;
            }
            _SelectedResearchData    = data;
            researchGrid.DataContext = data;
            if (data.Description != 0)
            {
                npc_text t = WorldWorker.GetNpcText(data.Description);
                _SelectedNpcText = t;
                if (t != null)
                {
                    broadcast_text b = WorldWorker.GetBroadCastText(t.BroadcastTextID0);
                    _SelectedBroadcastText = b;
                    if (b != null)
                    {
                        Binding binding = new Binding();
                        binding.Source = b;
                        binding.Path   = new PropertyPath("MaleText");
                        descriptionText.SetBinding(TextBox.TextProperty, binding);
                    }
                }
            }
            else
            {
                _SelectedNpcText       = null;
                _SelectedBroadcastText = null;
                descriptionText.Text   = "";
            }

            if (data.Spell != 0)
            {
                capital_city_research_trainer_data t = WorldWorker.GetResearchSpell(data.Spell);
                _SelectedResearchSpell = t;
            }
            else
            {
                _SelectedResearchSpell = null;
            }

            if (data.Item != 0)
            {
                capital_city_research_vendor_data t = WorldWorker.GetResearchItem(data.Item);
                _SelectedResearchItem = t;
            }
            else
            {
                _SelectedResearchItem = null;
            }

            researchSpellGrid.DataContext = _SelectedResearchSpell;
            researchItemGrid.DataContext  = _SelectedResearchItem;

            _ResearchQuest = WorldWorker.GetResearchQuests(_SelectedResearchData.QuestSet);
            researchQuestList.ItemsSource = _ResearchQuest;
        }
Beispiel #2
0
        public BroadcastTextEditor(gossip_menu_option o, bool boxText = false)
        {
            InitializeComponent();
            Util.AssignDefine(language, LegacyToolBox.Data.Language);
            Util.AssignDefine(emote0, LegacyToolBox.Data.Emotes);
            Util.AssignDefine(emote1, LegacyToolBox.Data.Emotes);
            Util.AssignDefine(emote2, LegacyToolBox.Data.Emotes);
            if (boxText)
            {
                _Text = WorldWorker.GetBroadCastText(o.BoxBroadcastTextID);
            }
            else
            {
                _Text = WorldWorker.GetBroadCastText(o.OptionBroadcastTextID);
            }

            if (_Text == null || _Text.ID == 0)
            {
                _Text = WorldWorker.CreateNewBroadCastText();
                if (boxText)
                {
                    o.BoxBroadcastTextID = _Text.ID;
                }
                else
                {
                    o.OptionBroadcastTextID = _Text.ID;
                }
            }

            bctGrid.DataContext = _Text;
        }
Beispiel #3
0
        private void createResearchDesc_Click(object sender, RoutedEventArgs e)
        {
            if (_SelectedResearchData == null)
            {
                return;
            }

            npc_text t = WorldWorker.CreateNewNpcText();

            _SelectedResearchData.Description = t.ID;
            researchGrid.DataContext          = _SelectedResearchData;
            _SelectedNpcText       = t;
            _SelectedBroadcastText = WorldWorker.GetBroadCastText(t.BroadcastTextID0);
            Binding binding = new Binding();

            binding.Source = _SelectedBroadcastText;
            binding.Path   = new PropertyPath("MaleText");
            descriptionText.SetBinding(TextBox.TextProperty, binding);
        }
Beispiel #4
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            int entry = System.Convert.ToInt32(value);

            if (entry == 0)
            {
                return("<no bct assigned>");
            }
            else
            {
                var t = WorldWorker.GetBroadCastText(entry);
                if (t == null)
                {
                    return("<invalid bct id>");
                }
                if (t.MaleText == "")
                {
                    return(t.FemaleText);
                }
                return(t.MaleText);
            }
        }
Beispiel #5
0
        public void LoadGossipMenu(gossip_menu menu)
        {
            if (menu == null)
            {
                return;
            }

            _SelectedGossipMenu = menu;

            npc_text text = WorldWorker.GetNpcText(menu.text_id);

            _SelectedNpcText = text;
            if (text == null)
            {
                return;
            }

            Binding binding0 = new Binding();

            binding0.Source = _SelectedNpcText;
            binding0.Path   = new PropertyPath("BroadcastTextID0");
            this.gossipText0Bct.SetBinding(TextBox.TextProperty, binding0);

            Binding binding1 = new Binding();

            binding1.Source = _SelectedNpcText;
            binding1.Path   = new PropertyPath("BroadcastTextID1");
            this.gossipText1Bct.SetBinding(TextBox.TextProperty, binding1);

            Binding binding2 = new Binding();

            binding2.Source = _SelectedNpcText;
            binding2.Path   = new PropertyPath("BroadcastTextID2");
            this.gossipText2Bct.SetBinding(TextBox.TextProperty, binding2);

            Binding binding3 = new Binding();

            binding3.Source = _SelectedNpcText;
            binding3.Path   = new PropertyPath("BroadcastTextID3");
            this.gossipText3Bct.SetBinding(TextBox.TextProperty, binding3);

            Binding binding4 = new Binding();

            binding4.Source = _SelectedNpcText;
            binding4.Path   = new PropertyPath("BroadcastTextID4");
            this.gossipText4Bct.SetBinding(TextBox.TextProperty, binding4);

            Binding binding5 = new Binding();

            binding5.Source = _SelectedNpcText;
            binding5.Path   = new PropertyPath("BroadcastTextID5");
            this.gossipText5Bct.SetBinding(TextBox.TextProperty, binding5);

            Binding binding6 = new Binding();

            binding6.Source = _SelectedNpcText;
            binding6.Path   = new PropertyPath("BroadcastTextID6");
            this.gossipText6Bct.SetBinding(TextBox.TextProperty, binding6);

            Binding binding7 = new Binding();

            binding7.Source = _SelectedNpcText;
            binding7.Path   = new PropertyPath("BroadcastTextID7");
            this.gossipText7Bct.SetBinding(TextBox.TextProperty, binding7);

            Binding binding0c = new Binding();

            binding0c.Source = _SelectedNpcText;
            binding0c.Path   = new PropertyPath("prop0");
            this.gossipText0Chance.SetBinding(TextBox.TextProperty, binding0c);

            Binding binding1c = new Binding();

            binding1c.Source = _SelectedNpcText;
            binding1c.Path   = new PropertyPath("prop1");
            this.gossipText1Chance.SetBinding(TextBox.TextProperty, binding1c);

            Binding binding2c = new Binding();

            binding2c.Source = _SelectedNpcText;
            binding2c.Path   = new PropertyPath("prop2");
            this.gossipText2Chance.SetBinding(TextBox.TextProperty, binding2c);

            Binding binding3c = new Binding();

            binding3c.Source = _SelectedNpcText;
            binding3c.Path   = new PropertyPath("prop3");
            this.gossipText3Chance.SetBinding(TextBox.TextProperty, binding3c);

            Binding binding4c = new Binding();

            binding4c.Source = _SelectedNpcText;
            binding4c.Path   = new PropertyPath("prop4");
            this.gossipText4Chance.SetBinding(TextBox.TextProperty, binding4c);

            Binding binding5c = new Binding();

            binding5c.Source = _SelectedNpcText;
            binding5c.Path   = new PropertyPath("prop5");
            this.gossipText0Chance.SetBinding(TextBox.TextProperty, binding5c);

            Binding binding6c = new Binding();

            binding6c.Source = _SelectedNpcText;
            binding6c.Path   = new PropertyPath("prop6");
            this.gossipText6Chance.SetBinding(TextBox.TextProperty, binding6c);

            Binding binding7c = new Binding();

            binding7c.Source = _SelectedNpcText;
            binding7c.Path   = new PropertyPath("prop7");
            this.gossipText7Chance.SetBinding(TextBox.TextProperty, binding7c);

            _bct0            = text.BroadcastTextID0 == 0 ? null : WorldWorker.GetBroadCastText(text.BroadcastTextID0);
            bct0.DataContext = _bct0;
            _bct1            = text.BroadcastTextID1 == 0 ? null : WorldWorker.GetBroadCastText(text.BroadcastTextID1);
            bct1.DataContext = _bct1;
            _bct2            = text.BroadcastTextID2 == 0 ? null : WorldWorker.GetBroadCastText(text.BroadcastTextID2);
            bct2.DataContext = _bct2;
            _bct3            = text.BroadcastTextID3 == 0 ? null : WorldWorker.GetBroadCastText(text.BroadcastTextID3);
            bct3.DataContext = _bct3;
            _bct4            = text.BroadcastTextID4 == 0 ? null : WorldWorker.GetBroadCastText(text.BroadcastTextID4);
            bct4.DataContext = _bct4;
            _bct5            = text.BroadcastTextID5 == 0 ? null : WorldWorker.GetBroadCastText(text.BroadcastTextID5);
            bct5.DataContext = _bct5;
            _bct6            = text.BroadcastTextID6 == 0 ? null : WorldWorker.GetBroadCastText(text.BroadcastTextID6);
            bct6.DataContext = _bct6;
            _bct7            = text.BroadcastTextID7 == 0 ? null : WorldWorker.GetBroadCastText(text.BroadcastTextID7);
            bct7.DataContext = _bct7;

            LoadGossipMenuItems(menu.entry);
        }