Exemple #1
0
        void GetUserData()
        {
            _user_data = MainWindow._user_data_manager.Data;

            foreach (KeyValuePair <EQUIP_TYPE_ENUM, EQUIP.EquipItem> equipment in _user_data.Equip.Dic)
            {
                if (equipment.Value == null)
                {
                    continue;
                }

                EquipId equip_id = new EquipId()
                {
                    Id        = equipment.Value.EquipInfo.Id,
                    Name      = equipment.Value.EquipInfo.Name,
                    Refine    = equipment.Value.Refine,
                    ImageRoot = equipment.Value.EquipInfo.ImageName
                };
                SetUserItemChanged(equip_id, equipment.Key);
            }

            string job_name = Enum.GetName(typeof(JOB_SELECT_LIST), ((int)((int)_user_data.Job / 100) * 100)).ToLower();
            string filename = "Resources/Job/" + job_name + ".png";

            Image_Char.Source = new BitmapImage(ResourceExtension.GetAssemblyUri(filename));
        }
Exemple #2
0
        private void SelectCard_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            EquipId item = ((sender as ContentControl).Content as StackPanel).DataContext as EquipId;

            _user_data.Equip.Dic[now_selected_equip_type].AddCard(item.Id);
            SetUserItemChanged(item, now_selected_equip_type, ITEM_TYPE_ENUM.CARD);
        }
Exemple #3
0
        private void Item_RefineWheel(object sender, MouseWheelEventArgs e)
        {
            EquipId item = ((sender as ContentControl).Content as StackPanel).DataContext as EquipId;

            item.Refine += e.Delta > 0 ? 1 : -1;
            SetItemTextBlock(item);
        }
Exemple #4
0
        private void Enchant_Option_MouseEnter(object sender, MouseEventArgs e)
        {
            EquipId item = ((sender as ContentControl).Content as StackPanel).DataContext as EquipId;

            SetEnchantTextBlock(item);
            itemPopup.PlacementTarget = ((sender as ContentControl).Content as StackPanel).Children[0];
            itemPopup.IsOpen          = true;
        }
Exemple #5
0
        void setItemTextBlock(EquipId item)
        {
            TextBlock PopupText = new TextBlock();

            PopupText.Text       = "+" + Convert.ToString(item.Refine) + " " + item.Name;
            PopupText.Background = Brushes.Silver;
            itemPopup.Child      = PopupText;
        }
Exemple #6
0
        private void SelectCard_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            EquipId item = ((sender as ContentControl).Content as StackPanel).DataContext as EquipId;

            _user_data.Equip.List[(int)now_selected_equip_type].AddCard(MainWindow._roo_db.Card_db[item.Id]);
            GetEquipTypeItem(now_selected_equip_type).ItemsSource = new EquipList(_user_data.Equip.List[(int)now_selected_equip_type]);
            MainWindow._user_data_manager.CalcUserData();
        }
Exemple #7
0
        private void Enchant_Option_MouseWheel(object sender, MouseWheelEventArgs e)
        {
            EquipId item = ((sender as ContentControl).Content as StackPanel).DataContext as EquipId;

            int changeValue = e.Delta > 0 ? 1 : -1;

            if ((Keyboard.IsKeyDown(Key.LeftShift)) || (Keyboard.IsKeyDown(Key.RightShift)))
            {
                changeValue *= 10;
            }
            item.Point += changeValue;
            SetEnchantTextBlock(item);
        }
Exemple #8
0
        private void Enchant_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            EquipId item = ((sender as ContentControl).Content as StackPanel).DataContext as EquipId;

            if (item.Point == 0)
            {
                return;
            }

            _user_data.Equip.Dic[now_selected_equip_type].AddEnchant(item.Name_Eng, item.Point - 1);
            SetUserItemChanged(item, now_selected_equip_type, ITEM_TYPE_ENUM.ENCHANT);
            SetUsedItem(now_selected_equip_type);
        }
Exemple #9
0
        private void SelectItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            EquipId item = ((sender as ContentControl).Content as StackPanel).DataContext as EquipId;

            if (!_user_data.Equip.Dic.ContainsKey(now_selected_equip_type))
            {
                _user_data.Equip.Dic[now_selected_equip_type] = new EQUIP.EquipItem();
            }
            _user_data.Equip.Dic[now_selected_equip_type].EquipType = now_selected_equip_type;
            _user_data.Equip.Dic[now_selected_equip_type].Equip     = item.Id;
            _user_data.Equip.Dic[now_selected_equip_type].Refine    = item.Refine;

            SetUserItemChanged(item, now_selected_equip_type);
            ItemSlectorTab.SelectedIndex = 1;
        }
Exemple #10
0
        private void SelectItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            EquipId item = ((sender as ContentControl).Content as StackPanel).DataContext as EquipId;

            _user_data.Equip.List[(int)now_selected_equip_type].Equip  = MainWindow._roo_db.Equip_db[(int)EnumBaseTable_Kor.EQUIP_TYPE_TO_DB_ENUM[now_selected_equip_type]][item.Id];
            _user_data.Equip.List[(int)now_selected_equip_type].Refine = item.Refine;
            GetEquipTypeItem(now_selected_equip_type).Header           = string.Format("+{0} {1}", item.Refine, item.Name);
            GetEquipTypeItem(now_selected_equip_type).ItemsSource      = new EquipList(_user_data.Equip.List[(int)now_selected_equip_type]);

            CardItemList             = new ItemListFilter(ref _user_data, ITEM_TYPE_ENUM.CARD, now_selected_equip_type);
            CardSelector.ItemsSource = CardItemList;
            //EnchantList = new ItemListFilter(ref _user_data, ITEM_TYPE_ENUM.ENCHANT, now_selected_equip_type);

            ItemSlectorTab.SelectedIndex = 1;
            MainWindow._user_data_manager.CalcUserData();
        }
Exemple #11
0
        void SetUserItemChanged(EquipId item, EQUIP_TYPE_ENUM equip_type, ITEM_TYPE_ENUM item_type = ITEM_TYPE_ENUM.EQUIPMENT)
        {
            if (item_type == ITEM_TYPE_ENUM.EQUIPMENT)
            {
                GetEquipTypeItem(equip_type).Header      = string.Format("+{0} {1}", item.Refine, item.Name);
                GetEquipTypeItem(equip_type).ItemsSource = new EquipList(_user_data.Equip.Dic[equip_type]);

                CardItemList             = new ItemListFilter(ref _user_data, ITEM_TYPE_ENUM.CARD, equip_type);
                CardSelector.ItemsSource = CardItemList;
                //EnchantList = new ItemListFilter(ref _user_data, ITEM_TYPE_ENUM.ENCHANT, now_selected_equip_type);
            }
            else if ((item_type == ITEM_TYPE_ENUM.CARD) || (item_type == ITEM_TYPE_ENUM.ENCHANT))
            {
                GetEquipTypeItem(equip_type).ItemsSource = new EquipList(_user_data.Equip.Dic[equip_type]);
            }

            MainWindow._user_data_manager.CalcUserData();
        }
Exemple #12
0
        void SetEnchantTextBlock(EquipId item)
        {
            EnchantInfo enchant_info = Equip._enchant_db.Dic[item.Name_Eng];
            string      txt;

            if (enchant_info.IsAdvanced)
            {
                txt = enchant_info.NAME_KOR + " " + Convert.ToString(item.Point);
            }
            else
            {
                txt = enchant_info.NAME_KOR + " " + Convert.ToString(item.Point);
            }

            TextBlock PopupText = new TextBlock
            {
                Text       = txt,
                Background = Brushes.Silver
            };

            itemPopup.Child = PopupText;
        }
Exemple #13
0
        void SetUserItemChanged(EquipId item, EQUIP_TYPE_ENUM equip_type, ITEM_TYPE_ENUM item_type = ITEM_TYPE_ENUM.EQUIPMENT)
        {
            StackPanel now_panel = GetEquipTypeItem(equip_type);

            if (now_panel == null)
            {
                return;
            }

            switch (item_type)
            {
            case ITEM_TYPE_ENUM.EQUIPMENT:
                (now_panel.Children[(int)EQUIP_UI_ENUM.EQUIP_IMAGE] as Image).Source  = item.ImageFile;
                (now_panel.Children[(int)EQUIP_UI_ENUM.EQUIP_NAME] as TextBlock).Text = string.Format("+{0} {1}", item.Refine, item.Name);
                //GetEquipTypeItem(equip_type).ItemsSource = new EquipList(_user_data.Equip.Dic[equip_type]);

                CardItemList             = new ItemListFilter(ref _user_data, ITEM_TYPE_ENUM.CARD, equip_type);
                CardSelector.ItemsSource = CardItemList;
                EnchantList = new ItemListFilter(ITEM_TYPE_ENUM.ENCHANT, equip_type);
                EnchantSelector.ItemsSource = EnchantList;
                break;

            case ITEM_TYPE_ENUM.CARD:
                (now_panel.Children[(int)EQUIP_UI_ENUM.CARD_ITEM_CTRL] as ItemsControl).ItemsSource = new UsedItemList(_user_data.Equip.Dic[equip_type], ITEM_TYPE_ENUM.CARD, equip_type);
                break;

            case ITEM_TYPE_ENUM.ENCHANT:
                (now_panel.Children[(int)EQUIP_UI_ENUM.ENCHANT_ITEM_CTRL] as ItemsControl).ItemsSource = new UsedItemList(_user_data.Equip.Dic[equip_type], ITEM_TYPE_ENUM.ENCHANT, equip_type);
                break;

            case ITEM_TYPE_ENUM.GEAR:
                break;

            default:
                break;
            }
            MainWindow._user_data_manager.CalcUserData();
        }