Exemplo n.º 1
0
        private void gossipMenuList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            gossip_menu menu = gossipMenuList.SelectedItem as gossip_menu;

            if (menu == null)
            {
                return;
            }
            gossipMenuGrid.DataContext = menu;
            LoadGossipMenu(menu);
        }
Exemplo n.º 2
0
        private void menuItemActionBtn_Click(object sender, RoutedEventArgs e)
        {
            int action = Convert.ToInt32(menuItemAction.Text);

            if (action == 0)
            {
                return;
            }
            // @todo: deal with multiple menu case
            gossip_menu menu = (from d in LegacyToolBox.Data.GossipMenu where d.entry == action select d).FirstOrDefault();

            LoadGossipMenu(menu);
        }
Exemplo n.º 3
0
        private void gossipNew_Click(object sender, RoutedEventArgs e)
        {
            gossip_menu menu = WorldWorker.CreateNewGossip();

            LegacyToolBox.Data.GossipMenu.Add(menu);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
 public static gossip_menu CreateNewGossip()
 {
     npc_text n = CreateNewNpcText();
     int id = (from d in DB.LEGACY.gossip_menu select d.entry).Max() + 1;
     gossip_menu m = new gossip_menu();
     m.entry = id;
     m.text_id = n.ID;
     m.Comment = "";
     SaveGossipMenu(m);
     return m;
 }
Exemplo n.º 6
0
 public static void SaveGossipMenu(gossip_menu menu)
 {
     // @todo: handle duplicate entry case
     var o = (from d in DB.LEGACY.gossip_menu where d.entry == menu.entry select d).FirstOrDefault();
     if (o != null)
         DB.LEGACY.gossip_menu.Remove(o);
     DB.LEGACY.gossip_menu.Add(menu);
     DB.LSave();
 }
Exemplo n.º 7
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);
        }