Ejemplo n.º 1
0
        private void InitializeList()
        {
            try
            {
                costumeList = new List <string>()
                {
                    "기본"
                };

                if (doll.Costumes != null)
                {
                    costumeList.AddRange(doll.Costumes);
                }

                costumeList.TrimExcess();

                TDollDic_ImageViewer_CostumeSelector.DataSource = costumeList;

                _ = LoadImage();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("이미지 뷰어 초기화 오류", "이미지 뷰어를 초기화 하는 중 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 2
0
        private async Task InitializeTDollDic()
        {
            await Task.Delay(1);

            try
            {
                TDollDic_SplitContainer.Panel1.Hide();

                for (int i = 0; i < TDollDic_TDollInfo_FormationBuffTable.RowCount; ++i)
                {
                    for (int k = 0; k < TDollDic_TDollInfo_FormationBuffTable.ColumnCount; ++k)
                    {
                        PictureBox pb = new PictureBox();
                        pb.Dock = DockStyle.Fill;

                        TDollDic_TDollInfo_FormationBuffTable.Controls.Add(pb);
                    }
                }

                _ = ListDoll(null);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("도감 초기화 오류", "인형 도감 초기화 중 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 3
0
        private async Task LoadEquipImage(bool isRefresh)
        {
            try
            {
                string fileName = equip.Icon;

                try
                {
                    string url    = Path.Combine(ETC.server, "Data", "Images", "Equipments", $"{fileName}.png");
                    string target = Path.Combine(ETC.cachePath, "Equip", "Normal", $"{fileName}.gfdcache");

                    if (!File.Exists(target) || isRefresh)
                    {
                        using (WebClient wc = new WebClient())
                            await wc.DownloadFileTaskAsync(url, target);
                    }

                    EquipDic_EquipInfo_FullImageView.ImageLocation = target;
                }
                catch (Exception ex)
                {
                    ETC.LogError(ex);
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("장비 불러오기 오류", "이미지를 불러오는 동안 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 4
0
        private void LoadAbilityFairy()
        {
            Label[] abilityMags =
            {
                FairyDic_FairyInfo_AbilityFRMag,
                FairyDic_FairyInfo_AbilityACMag,
                FairyDic_FairyInfo_AbilityEVMag,
                FairyDic_FairyInfo_AbilityAMMag,
                FairyDic_FairyInfo_AbilityCRMag
            };

            try
            {
                string[] abilities = { "FireRate", "Accuracy", "Evasion", "Armor", "Critical" };

                for (int i = 0; i < abilities.Length; ++i)
                {
                    abilityMags[i].Text = fairy.Abilities[abilities[i]];
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("요정 불러오기 오류", "능력치 정보를 불러오는 동안 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 5
0
        private async Task LoadDollImages(bool isRefresh)
        {
            try
            {
                string fileName = $"{doll.DicNumber}{(modIndex == 3 ? "_M" : "")}";

                try
                {
                    string url    = Path.Combine(ETC.server, "Data", "Images", "Guns", "Normal", $"{fileName}.png");
                    string target = Path.Combine(ETC.cachePath, "Doll", "Normal", $"{fileName}.gfdcache");

                    if (!File.Exists(target) || isRefresh)
                    {
                        using (WebClient wc = new WebClient())
                            await wc.DownloadFileTaskAsync(url, target);
                    }

                    TDollDic_TDollInfo_FullImageView.ImageLocation = target;
                }
                catch (Exception ex)
                {
                    ETC.LogError(ex);
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("인형 불러오기 오류", "이미지를 불러오는 동안 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 6
0
        private async Task LoadFairyInfo(bool isRefresh = false)
        {
            await Task.Delay(10);

            isFairyLoad = true;

            try
            {
                FairyDic_SplitContainer.Panel1.Show();

                FairyDic_FairyInfo_DicNumber.Text = $"No. {fairy.DicNumber}";
                FairyDic_FairyInfo_Name.Text      = fairy.Name;
                FairyDic_FairyInfo_Type.Text      = fairy.Type;

                await LoadFairyImage(isRefresh);

                FairyDic_FairyInfo_ProductTimeLabel.Text = fairy.GetProductTimeToString;

                LoadAbilityFairy();

                FairyDic_FairyInfo_GainToolTip.SetToolTip(FairyDic_FairyInfo_FullImageView, fairy.ProductDialog);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("요정 불러오기 오류", "요정 정보를 불러오는 중 오류가 발생했습니다.");
            }
            finally
            {
                isFairyLoad = false;
            }
        }
Ejemplo n.º 7
0
        private async Task LoadFairyImage(bool isRefresh)
        {
            try
            {
                string fileName = fairy.DicNumber.ToString();

                try
                {
                    string url    = Path.Combine(ETC.server, "Data", "Images", "Fairy", "Normal_Crop", $"{fileName}.png");
                    string target = Path.Combine(ETC.cachePath, "Fairy", "Normal", $"{fileName}.gfdcache");

                    if (!File.Exists(target) || isRefresh)
                    {
                        using (WebClient wc = new WebClient())
                            await wc.DownloadFileTaskAsync(url, target);
                    }

                    FairyDic_FairyInfo_FullImageView.ImageLocation = target;
                }
                catch (Exception ex)
                {
                    ETC.LogError(ex);
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("요정 불러오기 오류", "이미지를 불러오는 동안 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 8
0
        private void LoadCostumeVoiceList()
        {
            try
            {
                TDollDic_TDollInfo_CostumeVoiceSelector.Items.Clear();

                List <string> vcList = new List <string>()
                {
                    "기본"
                };

                if (doll.CostumeVoices != null)
                {
                    for (int i = 0; i < (doll.CostumeVoices.Length / doll.CostumeVoices.Rank); ++i)
                    {
                        vcList.Add(doll.Costumes[int.Parse(doll.CostumeVoices[i, 0])]);
                    }
                }

                vcList.TrimExcess();

                TDollDic_TDollInfo_CostumeVoiceSelector.Items.AddRange(vcList.ToArray());
                TDollDic_TDollInfo_CostumeVoiceSelector.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("인형 불러오기 오류", "코스튬 보이스 목록을 불러오는 동안 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 9
0
        private void TDollDic_TDollInfo_CostumeVoiceSelector_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                vCostumeIndex = (sender as ComboBox).SelectedIndex;

                dollVoiceList.Clear();
                TDollDic_TDollInfo_VoiceSelector.Items.Clear();

                switch (vCostumeIndex)
                {
                case 0:
                    dollVoiceList.AddRange(doll.Voices);
                    break;

                default:
                    dollVoiceList.AddRange(doll.CostumeVoices[vCostumeIndex - 1, 1].Split(';'));
                    break;
                }
                dollVoiceList.TrimExcess();

                TDollDic_TDollInfo_VoiceSelector.Items.AddRange(dollVoiceList.ToArray());
                TDollDic_TDollInfo_VoiceSelector.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("인형 불러오기 오류", "보이스 목록을 불러오는 중 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 10
0
        private async Task LoadTDollSkill(bool isRefresh, bool isMod)
        {
            try
            {
                string skillName = isMod ? doll.ModSkillName : doll.SkillName;
                string url       = Path.Combine(ETC.server, "Data", "Images", "SkillIcons", $"{skillName}.png");
                string target    = Path.Combine(ETC.cachePath, "Doll", "Skill", $"{skillName}.gfdcache");

                try
                {
                    if ((File.Exists(target) == false) || (isRefresh == true))
                    {
                        using (WebClient wc = new WebClient())
                            await wc.DownloadFileTaskAsync(url, target);
                    }

                    SkillViewer_SkillIconBox.ImageLocation = target;
                }
                catch (Exception ex)
                {
                    ETC.LogError(ex);
                }

                SkillViewer_SkillName.Text    = skillName;
                SkillViewer_SkillExplain.Text = isMod ? doll.ModSkillExplain : doll.SkillExplain;

                LoadSkillEffect(isMod);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("스킬 정보 불러오기 오류", "인형 스킬 정보를 불러오는 동안 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 11
0
        private async Task DownloadStory(string category, string fileName)
        {
            try
            {
                string server = "";
                string target = "";

                if (category == "ModStory")
                {
                    server = Path.Combine(ETC.server, "Data", "Text", "Story", "ko", "Sub", category, $"{fileName}.txt");
                    target = Path.Combine(ETC.cachePath, "Story", category, $"{fileName}.gfdcache");
                }
                else
                {
                    server = Path.Combine(ETC.server, "Data", "Text", "Story", "ko", "Main", category, $"{fileName}.txt");
                    target = Path.Combine(ETC.cachePath, "Story", category, $"{fileName}.gfdcache");
                }

                DirectoryInfo di = new DirectoryInfo(Path.Combine(ETC.cachePath, "Story", category));
                if (di.Exists == false)
                {
                    di.Create();
                }

                using (WebClient wc = new WebClient())
                    await wc.DownloadFileTaskAsync(server, target);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("텍스트 뷰어 오류", "스토리 데이터를 다운로드 하는 중 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 12
0
        private async Task LoadStory(string fileName = "", bool isRefresh = false)
        {
            try
            {
                string file;

                if (category == "ModStory")
                {
                    file = Path.Combine(ETC.cachePath, "Story", category, $"{fileName}_{index}.gfdcache");
                    TextViewer_NowStatus.Text = $"개조 이야기 - {doll.Name} {index}화";
                }
                else
                {
                    file = Path.Combine(ETC.cachePath, "Story", category, $"{index}.gfdcache");
                    TextViewer_NowStatus.Text = $"{category} - {storyName}";
                }

                if ((File.Exists(file) == false) || (isRefresh == true))
                {
                    await DownloadStory(category, Path.GetFileNameWithoutExtension(file));
                }



                using (StreamReader sr = new StreamReader(new FileStream(file, FileMode.Open, FileAccess.Read)))
                    TextViewer_TextField.Text = await sr.ReadToEndAsync();
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("텍스트 뷰어 오류", "스토리 데이터를 불러오는 중 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 13
0
        private async Task LoadImage(bool IsRefresh = false)
        {
            try
            {
                string ImageName = doll.DicNumber.ToString();

                if (costumeIndex >= 1)
                {
                    ImageName += $"_{costumeIndex + 1}";
                }
                else if
                ((costumeIndex == 0) && (modIndex == 3))
                {
                    ImageName += "_M";
                }

                if (isDamage == true)
                {
                    ImageName += "_D";
                }

                if ((doll.HasCensored == true) && (enableCensored == true) && (modIndex != 3))
                {
                    if (CheckCensorType() == true)
                    {
                        ImageName += "_C";
                    }
                }

                string ImagePath = Path.Combine(ETC.cachePath, "Doll", "Normal", $"{ImageName}.gfdcache");
                string URL       = Path.Combine(ETC.server, "Data", "Images", "Guns", "Normal", $"{ImageName}.png");

                if ((File.Exists(ImagePath) == false) || (IsRefresh == true))
                {
                    using (WebClient wc = new WebClient())
                        await Task.Run(async() => { await wc.DownloadFileTaskAsync(URL, ImagePath); });
                }

                await Task.Delay(100);

                TDollDic_ImageViewer_ImageView.ImageLocation = ImagePath;

                string damageText = isDamage ? "중상" : "정상";

                TDollDic_ImageViewer_DamageToggle.Text = damageText;
                TDollDic_ImageViewer_ImageStatus.Text  = $"{doll.Name} - {costumeList[costumeIndex]} - {damageText}";
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("이미지 로드 오류", "이미지를 로드하는 중 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 14
0
        private void LoadSkillEffect(bool isMod)
        {
            int hSize = 30;

            try
            {
                string[] skillEffect = isMod ? doll.ModSkillEffect : doll.SkillEffect;
                string[] skillMags   = isMod ? doll.ModSkillMag : doll.SkillMag;

                SkillViewer_InitialCoolTime.Text = skillMags[0];
                SkillViewer_CoolTime.Text        = skillMags[1];

                if (SkillViewer_SkillEffectTable.RowCount < skillEffect.Length - 2)
                {
                    SkillViewer_SkillEffectTable.Height += hSize * (skillEffect.Length - 4);
                    Height += hSize * (skillEffect.Length - 4);
                    SkillViewer_SkillEffectTable.RowCount = skillEffect.Length - 2;
                }

                for (int i = 2; i < skillEffect.Length; ++i)
                {
                    Label effect = new Label();
                    effect.Dock      = DockStyle.Fill;
                    effect.TextAlign = ContentAlignment.MiddleCenter;
                    effect.Text      = skillEffect[i];
                    effect.Font      = new Font(effect.Font.FontFamily, effect.Font.Size, FontStyle.Bold);

                    Label mag = new Label();
                    mag.Dock      = DockStyle.Fill;
                    mag.TextAlign = ContentAlignment.MiddleCenter;
                    mag.Text      = skillMags[i];

                    SkillViewer_SkillEffectTable.Controls.Add(effect, 0, i - 2);
                    SkillViewer_SkillEffectTable.Controls.Add(mag, 1, i - 2);

                    if (i >= 4)
                    {
                        SkillViewer_SkillEffectTable.RowStyles.Add(new RowStyle(SizeType.Absolute));
                    }
                }

                for (int i = 0; i < SkillViewer_SkillEffectTable.RowCount; ++i)
                {
                    SkillViewer_SkillEffectTable.RowStyles[i].SizeType = SizeType.Absolute;
                    SkillViewer_SkillEffectTable.RowStyles[i].Height   = 30;
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("스킬 정보 불러오기 오류", "인형 스킬 세부 효과 정보를 불러오는 동안 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 15
0
        private async Task ListDoll(string searchName)
        {
            await Task.Delay(10);

            try
            {
                TDollDic_TDollListView.Items.Clear();

                CheckApplyDollFilter();

                foreach (Doll doll in dollRootList)
                {
                    if ((searchName != null) && !doll.Name.ToUpper().Contains(searchName.ToUpper()))
                    {
                        continue;
                    }

                    if (!CheckFilter(doll))
                    {
                        continue;
                    }

                    string grade = "";

                    if (doll.Grade == 0)
                    {
                        grade = "★";
                    }
                    else
                    {
                        grade = $"☆{doll.Grade}";
                    }

                    TDollDic_TDollListView.Items.Add(new ListViewItem(new string[]
                    {
                        doll.DicNumber.ToString(),
                        doll.Type,
                        grade,
                        doll.Name,
                        doll.HasMod ? "O" : "X"
                    }));
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("리스트 오류", "인형 리스트를 생성하는 중 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 16
0
        private async Task ListEquip(string searchName)
        {
            await Task.Delay(10);

            try
            {
                EquipDic_EquipListView.Items.Clear();

                CheckApplyEquipFilter();

                foreach (Equip equip in equipRootList)
                {
                    if ((searchName != null) && !equip.Name.ToUpper().Contains(searchName.ToUpper()))
                    {
                        continue;
                    }

                    if (!CheckFilter(equip))
                    {
                        continue;
                    }

                    string grade = "";

                    if (equip.Grade == 0)
                    {
                        grade = "★";
                    }
                    else
                    {
                        grade = $"☆{equip.Grade}";
                    }

                    EquipDic_EquipListView.Items.Add(new ListViewItem(new string[]
                    {
                        equip.Id.ToString(),
                        grade,
                        equip.Name,
                        equip.Category,
                        equip.Type
                    }));
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("리스트 오류", "장비 리스트를 생성하는 중 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 17
0
        private async Task InitializeFairyDic()
        {
            await Task.Delay(1);

            try
            {
                FairyDic_SplitContainer.Panel1.Hide();

                _ = ListFairy(null);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("도감 초기화 오류", "요정 도감 초기화 중 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 18
0
        private async Task LoadText(string url)
        {
            string text;

            try
            {
                using (WebClient wc = new WebClient())
                    text = await wc.DownloadStringTaskAsync(url);

                TextViewer_TextField.Text = text;
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("텍스트 뷰어 오류", "네트워크에서 텍스트를 불러오는 중 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 19
0
        private void LoadAbilityEquip()
        {
            Label[] abilityControls =
            {
                EquipDic_EquipInfo_Ability1,
                EquipDic_EquipInfo_Ability2,
                EquipDic_EquipInfo_Ability3,
                EquipDic_EquipInfo_Ability4
            };
            Label[] initMagControls =
            {
                EquipDic_EquipInfo_InitMag1,
                EquipDic_EquipInfo_InitMag2,
                EquipDic_EquipInfo_InitMag3,
                EquipDic_EquipInfo_InitMag4
            };
            Label[] maxMagControls =
            {
                EquipDic_EquipInfo_MaxMag1,
                EquipDic_EquipInfo_MaxMag2,
                EquipDic_EquipInfo_MaxMag3,
                EquipDic_EquipInfo_MaxMag4
            };

            try
            {
                for (int i = 0; i < equip.Abilities.Length; ++i)
                {
                    abilityControls[i].Text = equip.Abilities[i];
                    initMagControls[i].Text = equip.InitMags[i];
                    maxMagControls[i].Text  = equip.MaxMags[i];
                }

                for (int i = equip.Abilities.Length; i < abilityControls.Length; ++i)
                {
                    abilityControls[i].Text = "";
                    initMagControls[i].Text = "";
                    maxMagControls[i].Text  = "";
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("장비 능력치 오류", "장비 능력치를 불러오는 중 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 20
0
        private void EquipDic_EquipListView_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            try
            {
                if (e.IsSelected)
                {
                    equip = new Equip(ETC.FindDataRow(ETC.equipmentList, "Id", int.Parse(e.Item.Text)));

                    _ = LoadEquipInfo();
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("장비 불러오기 오류", "장비 정보를 불러오는 동안 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 21
0
        private void FairyDic_FairyListView_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            try
            {
                if (e.IsSelected)
                {
                    fairy = new Fairy(ETC.FindDataRow(ETC.fairyList, "DicNumber", int.Parse(e.Item.Text)));

                    _ = LoadFairyInfo();
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("요정 불러오기 오류", "요정 정보를 불러오는 동안 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 22
0
        private void TDollDic_TDollListView_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            try
            {
                if (e.IsSelected)
                {
                    doll          = new Doll(ETC.FindDataRow(ETC.dollList, "DicNumber", int.Parse(e.Item.Text)));
                    vCostumeIndex = 0;

                    _ = LoadTDollInfo();
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("인형 불러오기 오류", "인형 정보를 불러오는 동안 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 23
0
        private async Task ListFairy(string searchName)
        {
            await Task.Delay(10);

            try
            {
                FairyDic_FairyListView.Items.Clear();

                CheckApplyFairyFilter();

                foreach (Fairy fairy in fairyRootList)
                {
                    if ((searchName != null) && !fairy.Name.ToUpper().Contains(searchName.ToUpper()))
                    {
                        continue;
                    }

                    if (!CheckFilter(fairy))
                    {
                        continue;
                    }

                    FairyDic_FairyListView.Items.Add(new ListViewItem(new string[]
                    {
                        fairy.DicNumber.ToString(),
                        fairy.Type,
                        fairy.Name
                    }));
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("리스트 오류", "요정 리스트를 생성하는 중 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 24
0
        private async Task LoadAbility()
        {
            await Task.Delay(10);

            Label[] abilityMags =
            {
                TDollDic_TDollInfo_AbilityHPMag,
                TDollDic_TDollInfo_AbilityFRMag,
                TDollDic_TDollInfo_AbilityEVMag,
                TDollDic_TDollInfo_AbilityACMag,
                TDollDic_TDollInfo_AbilityASMag
            };

            try
            {
                string[] abilities = { "HP", "FireRate", "Evasion", "Accuracy", "AttackSpeed" };


                string[] grow_ratio = doll.Abilities["Grow"].Split(';');

                for (int i = 0; i < abilityMags.Length; ++i)
                {
                    string[] basic_ratio = doll.Abilities[abilities[i]].Split(';');

                    int value = 0;

                    switch (modIndex)
                    {
                    case 0:
                        value = das.CalcAbility(abilities[i], int.Parse(basic_ratio[0]), int.Parse(grow_ratio[0]), abilityLv, abilityFavor, false);
                        break;

                    case 1:
                    case 2:
                    case 3:
                        value = das.CalcAbility(abilities[i], int.Parse(basic_ratio[1]), int.Parse(grow_ratio[1]), abilityLv, abilityFavor, true);
                        break;
                    }

                    abilityValues[i] = value;

                    abilityMags[i].Text = $"{value} ({doll.AbilityGrade[i]})";
                }

                if ((doll.Type == "MG") || (doll.Type == "SG"))
                {
                    TDollDic_TDollInfo_AbilityBulletPanel.Visible = true;
                    TDollDic_TDollInfo_AbilityReloadPanel.Visible = true;

                    double ReloadTime = CalcReloadTime(doll, doll.Type, abilityValues[4]);
                    int    Bullet     = 0;

                    if (doll.HasMod == false)
                    {
                        Bullet = int.Parse(doll.Abilities["Bullet"]);
                    }
                    else
                    {
                        Bullet = int.Parse(doll.Abilities["Bullet"].Split(';')[modIndex]);
                    }

                    TDollDic_TDollInfo_AbilityBulletMag.Text = Bullet.ToString();
                    TDollDic_TDollInfo_AbilityReloadMag.Text = $"{ReloadTime} 초";
                }
                else
                {
                    TDollDic_TDollInfo_AbilityBulletPanel.Visible = false;
                    TDollDic_TDollInfo_AbilityReloadPanel.Visible = false;
                }

                if (doll.Type == "SG")
                {
                    TDollDic_TDollInfo_AbilityAMPanel.Visible = true;

                    string[] basic_ratio = doll.Abilities["Armor"].Split(';');
                    int      value       = 0;

                    switch (modIndex)
                    {
                    case 0:
                        value = das.CalcAbility("Armor", int.Parse(basic_ratio[0]), int.Parse(grow_ratio[0]), abilityLv, abilityFavor, false);
                        break;

                    case 1:
                    case 2:
                    case 3:
                        value = das.CalcAbility("Armor", int.Parse(basic_ratio[1]), int.Parse(grow_ratio[1]), abilityLv, abilityFavor, true);
                        break;
                    }

                    abilityValues[5] = value;
                    TDollDic_TDollInfo_AbilityAMMag.Text = $"{value} ({doll.AbilityGrade[6]})";
                }
                else
                {
                    abilityValues[5] = 0;
                    TDollDic_TDollInfo_AbilityAMPanel.Visible = false;
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("인형 불러오기 오류", "능력치 정보를 불러오는 동안 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 25
0
        private void LoadFormationBuff()
        {
            int[]    formation;
            string[] type;
            string[] mag;
            TableLayoutControlCollection collection;
            StringBuilder sb;

            try
            {
                if (modIndex == 0)
                {
                    formation = doll.BuffFormation;
                    type      = doll.BuffType;
                    mag       = doll.BuffInfo;
                }
                else
                {
                    formation = doll.ModBuffFormation;
                    type      = doll.BuffType;
                    mag       = doll.ModBuffInfo;
                }


                // 버프 진형 채우기
                collection = TDollDic_TDollInfo_FormationBuffTable.Controls;

                for (int i = 0; i < formation.Length; ++i)
                {
                    Color c;

                    switch (formation[i])
                    {
                    default:
                    case 0:
                        c = Color.LightGray;
                        break;

                    case 1:
                        c = Color.Green;
                        break;

                    case 2:
                        c = Color.Black;
                        break;
                    }

                    collection[i].BackColor = c;
                }


                // 버프 타입
                sb = new StringBuilder();

                for (int i = 0; i < type.Length; ++i)
                {
                    sb.Append(type[i]);
                    sb.Append(" ");
                }

                TDollDic_TDollInfo_FormationBuffType.Text = $"{sb.ToString()} 적용";


                // 버프 효과 및 효과치
                PictureBox[] buffTypeIcons =
                {
                    TDollDic_TDollInfo_FormationBuffIcon1,
                    TDollDic_TDollInfo_FormationBuffIcon2
                };
                Label[] buffMags =
                {
                    TDollDic_TDollInfo_FormationBuffMag1,
                    TDollDic_TDollInfo_FormationBuffMag2
                };
                string[] buffType = mag[0].Split(',');

                for (int i = 0; i < buffTypeIcons.Length; ++i)
                {
                    buffTypeIcons[i].Image = null;
                    buffMags[i].Text       = "";
                }

                for (int i = 0; i < buffType.Length; ++i)
                {
                    Bitmap btBitmap;

                    switch (buffType[i])
                    {
                    case "AC":
                        btBitmap = Resources.AC_Icon;
                        break;

                    case "AM":
                        btBitmap = Resources.AM_Icon;
                        break;

                    case "AS":
                        btBitmap = Resources.AS_Icon;
                        break;

                    case "CR":
                        btBitmap = Resources.CR_Icon;
                        break;

                    case "EV":
                        btBitmap = Resources.EV_Icon;
                        break;

                    case "FR":
                        btBitmap = Resources.FR_Icon;
                        break;

                    case "CL":
                        btBitmap = Resources.CL_Icon;
                        break;

                    default:
                        btBitmap = null;
                        break;
                    }

                    buffTypeIcons[i].Image = btBitmap;

                    sb.Clear();

                    for (int k = 1; k < mag.Length; ++k)
                    {
                        string[] m = mag[k].Split(',');

                        sb.Append(m[i]);
                        sb.Append("%");

                        if (k < mag.Length - 1)
                        {
                            sb.Append("/");
                        }
                    }

                    buffMags[i].Text = sb.ToString();
                }
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("인형 불러오기 오류", "진형 버프를 불러오는 동안 오류가 발생했습니다.");
            }
        }
Ejemplo n.º 26
0
        private async Task LoadTDollInfo(bool isRefresh = false)
        {
            await Task.Delay(10);

            isDollLoad = true;

            try
            {
                TDollDic_SplitContainer.Panel1.Show();
                TDollDic_TDollInfo_FullImageLoadProcessBar.Visible = true;
                TDollDic_TDollInfo_FullImageLoadProcessBar.Style   = ProgressBarStyle.Marquee;

                if (doll.HasMod)
                {
                    TDollDic_TDollInfo_ModStoryButton.Enabled = true;
                    TDollDic_TDollInfo_ModSkillButton.Enabled = true;
                }
                else
                {
                    TDollDic_TDollInfo_ModStoryButton.Enabled = false;
                    TDollDic_TDollInfo_ModSkillButton.Enabled = false;
                }

                das = new DollAbilitySet(doll.Type);

                if (doll.HasMod)
                {
                    TDollDic_TDollInfo_ModSelector1.Enabled = true;
                    TDollDic_TDollInfo_ModSelector2.Enabled = true;
                    TDollDic_TDollInfo_ModSelector3.Enabled = true;
                }
                else
                {
                    TDollDic_TDollInfo_ModSelector1.Enabled = false;
                    TDollDic_TDollInfo_ModSelector2.Enabled = false;
                    TDollDic_TDollInfo_ModSelector3.Enabled = false;
                }

                TDollDic_TDollInfo_ModSelector0.Checked = true;

                TDollDic_TDollInfo_DicNumber.Text        = $"No. {doll.DicNumber}";
                TDollDic_TDollInfo_Name.Text             = doll.Name;
                TDollDic_TDollInfo_CodeName.Text         = doll.CodeName;
                TDollDic_TDollInfo_ProductTimeLabel.Text =
                    $"{(doll.GetProductTimeToString == "None" ? "제조 불가" : doll.GetProductTimeToString)}";
                TDollDic_TDollInfo_IllustratorInfo.Text = doll.Illustrator;
                TDollDic_TDollInfo_NickNameInfo.Text    = doll.NickName;

                await LoadDollImages(isRefresh);

                Bitmap gBitmap;

                switch (doll.Grade)
                {
                default:
                case 0:
                    gBitmap = Resources.PSGrade_0;
                    break;

                case 2:
                    gBitmap = Resources.PSGrade_2;
                    break;

                case 3:
                    gBitmap = Resources.PSGrade_3;
                    break;

                case 4:
                    gBitmap = Resources.PSGrade_4;
                    break;

                case 5:
                    gBitmap = Resources.PSGrade_5;
                    break;
                }

                TDollDic_TDollInfo_FullImageView.BackgroundImage = gBitmap;

                switch (doll.Type)
                {
                default:
                case "HG":
                    TDollDic_TDollInfo_TypeIconImage.Image = Resources.HG;
                    break;

                case "SMG":
                    TDollDic_TDollInfo_TypeIconImage.Image = Resources.SMG;
                    break;

                case "AR":
                    TDollDic_TDollInfo_TypeIconImage.Image = Resources.AR;
                    break;

                case "RF":
                    TDollDic_TDollInfo_TypeIconImage.Image = Resources.RF;
                    break;

                case "MG":
                    TDollDic_TDollInfo_TypeIconImage.Image = Resources.MG;
                    break;

                case "SG":
                    TDollDic_TDollInfo_TypeIconImage.Image = Resources.SG;
                    break;
                }

                LoadFormationBuff();

                // 능력치 정보 불러오기도 동시 실행됨
                abilityLv = 1;

                if (TDollDic_TDollInfo_AbilityFavorSelector.SelectedIndex != 1)
                {
                    TDollDic_TDollInfo_AbilityFavorSelector.SelectedIndex = 1;
                }
                else
                {
                    _ = LoadAbility();
                }

                if (doll.HasVoice)
                {
                    TDollDic_TDollInfo_VoiceGroup.Visible = true;
                    LoadCostumeVoiceList();
                }
                else
                {
                    TDollDic_TDollInfo_VoiceGroup.Visible = false;
                }

                TDollDic_TDollInfo_GainTooltip.SetToolTip(TDollDic_TDollInfo_FullImageView, doll.ProductDialog);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("인형 불러오기 오류", "인형 정보를 불러오는 중 오류가 발생했습니다.");
            }
            finally
            {
                isDollLoad = false;
            }
        }
Ejemplo n.º 27
0
        private async Task LoadEquipInfo(bool isRefresh = false)
        {
            await Task.Delay(10);

            isEquipLoad = true;

            try
            {
                EquipDic_SplitContainer.Panel1.Show();

                EquipDic_EquipInfo_DicNumber.Text    = $"No. {equip.Id}";
                EquipDic_EquipInfo_Name.Text         = equip.Name;
                EquipDic_EquipInfo_TypeCategory.Text = $"{equip.Category} - {equip.Type}";

                await LoadEquipImage(isRefresh);

                Bitmap gBitmap;

                switch (equip.Grade)
                {
                default:
                case 2:
                    gBitmap = Resources.EquipBG_2;
                    break;

                case 3:
                    gBitmap = Resources.EquipBG_3;
                    break;

                case 4:
                    gBitmap = Resources.EquipBG_4;
                    break;

                case 0:
                case 5:
                    gBitmap = Resources.EquipBG_5;
                    break;
                }

                EquipDic_EquipInfo_FullImageView.BackgroundImage = gBitmap;

                EquipDic_EquipInfo_ProductTimeLabel.Text = equip.GetProductTimeToString;

                if (equip.OnlyUse == null)
                {
                    EquipDic_EquipInfo_OnlyUseDollPanel.Visible = false;
                    EquipDic_EquipInfo_DollTypePanel.Visible    = true;
                    LoadEquipDollType();
                }
                else
                {
                    EquipDic_EquipInfo_DollTypePanel.Visible    = false;
                    EquipDic_EquipInfo_OnlyUseDollPanel.Visible = true;
                    LoadEquipOnlyUseDoll();
                }

                LoadAbilityEquip();

                EquipDic_EquipInfo_GainTooltip.SetToolTip(EquipDic_EquipInfo_FullImageView, equip.ProductDialog);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("장비 불러오기 오류", "장비 정보를 불러오는 중 오류가 발생했습니다.");
            }
            finally
            {
                isEquipLoad = false;
            }
        }