Example #1
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;
        }
Example #2
0
        private void menuItemNpcFlagBtn_Click(object sender, RoutedEventArgs e)
        {
            gossip_menu_option o = gossipMenuItems.SelectedItem as gossip_menu_option;

            if (o == null)
            {
                return;
            }
            new NpcFlagSelector(o).Show();
        }
Example #3
0
        private void menuItemBoxTextBtn_Click(object sender, RoutedEventArgs e)
        {
            gossip_menu_option o = gossipMenuItems.SelectedItem as gossip_menu_option;

            if (o == null)
            {
                return;
            }
            new BroadcastTextEditor(o, true).Show();
        }
Example #4
0
        private void gossipMenuItems_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (gossipMenuItems == null || gossipMenuItems.SelectedItem == null)
            {
                return;
            }

            _SelectedMenuItem          = gossipMenuItems.SelectedItem as gossip_menu_option;
            gossipItemGrid.DataContext = _SelectedMenuItem;
        }
Example #5
0
        private void menuItemDelete_Click(object sender, RoutedEventArgs e)
        {
            if (_SelectedMenuItem == null)
            {
                return;
            }

            WorldWorker.DeleteGossipOption(_SelectedMenuItem);
            LoadGossipMenuItems(_SelectedMenuItem.menu_id);
            _SelectedMenuItem = null;
        }
Example #6
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;
        }
Example #7
0
 public NpcFlagSelector(gossip_menu_option o)
 {
     InitializeComponent();
     _o = o;
     CheckFlags(_o.npc_option_npcflag);
 }
Example #8
0
 public NpcFlagSelector(gossip_menu_option o)
 {
     InitializeComponent();
     _o = o;
     CheckFlags(_o.npc_option_npcflag);
 }
Example #9
0
 public void LoadGossipMenuItems(int menu)
 {
     _SelectedMenuItem           = null;
     _SelectedGossipItems        = WorldWorker.GetGossipOptions(menu);
     gossipMenuItems.ItemsSource = _SelectedGossipItems;
 }
Example #10
0
 public static void DeleteGossipOption(gossip_menu_option p)
 {
     var o = (from d in DB.LEGACY.gossip_menu_option where d.menu_id == p.menu_id && d.id == p.id select d).SingleOrDefault();
     if (o != null)
     {
         DB.LEGACY.gossip_menu_option.Remove(o);
         DB.LSave();
     }
 }
Example #11
0
 public static gossip_menu_option CreateNewGossipItem(int menu)
 {
     int id = 0;
     var g = from d in DB.LEGACY.gossip_menu_option where d.menu_id == menu select d.id;
     if (g.Count() != 0)
         id = g.Max() + 1;
     broadcast_text t = CreateNewBroadCastText();
     gossip_menu_option o = new gossip_menu_option();
     o.menu_id = menu;
     o.id = id;
     o.npc_option_npcflag = 0;
     o.option_icon = 0;
     o.option_id = 0;
     o.OptionBroadcastTextID = t.ID;
     o.SingleTimeCheck = 0;
     o.action_menu_id = 0;
     o.action_poi_id = 0;
     o.box_coded = 0;
     o.box_money = 0;
     o.BoxBroadcastTextID = 0;
     SaveGossipOption(o);
     return o;
 }
Example #12
0
        private void menuItemDelete_Click(object sender, RoutedEventArgs e)
        {
            if (_SelectedMenuItem == null)
                return;

            WorldWorker.DeleteGossipOption(_SelectedMenuItem);
            LoadGossipMenuItems(_SelectedMenuItem.menu_id);
            _SelectedMenuItem = null;
        }
Example #13
0
        private void gossipMenuItems_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (gossipMenuItems == null || gossipMenuItems.SelectedItem == null)
                return;

            _SelectedMenuItem = gossipMenuItems.SelectedItem as gossip_menu_option;
            gossipItemGrid.DataContext = _SelectedMenuItem;
        }
Example #14
0
 public void LoadGossipMenuItems(int menu)
 {
     _SelectedMenuItem = null;
     _SelectedGossipItems = WorldWorker.GetGossipOptions(menu);
     gossipMenuItems.ItemsSource = _SelectedGossipItems;
 }
Example #15
0
 public static void SaveGossipOption(gossip_menu_option p)
 {
     var o = (from d in DB.LEGACY.gossip_menu_option where d.menu_id == p.menu_id && d.id == p.id select d).SingleOrDefault();
     if (o != null)
         DB.LEGACY.gossip_menu_option.Remove(o);
     DB.LEGACY.gossip_menu_option.Add(p);
     DB.LEGACY.SaveChanges(); DB.Refresh();
 }