public void LoadSelectedSkills() { SkillsPlayer skills = FindObjectOfType <LoadGameHistory>().AddressSkills(UserInfo.address, new Node(Node.MainNetHost).GetHeight()); if (skills.Skills != null && skills.Skills.Length == 3) { SelectedSkills ss = FindObjectOfType <SelectedSkills>(); ss.SelSkills = skills.Skills; for (int i = 0; i < ss.SelSkills.Length; i++) { ss.selected[i].transform.GetChild(0).GetComponent <Image>().sprite = Resources.LoadAll <Sprite>("SkillPreview")[skills.Skills[i]]; FindObjectOfType <ContentSkillsController>().skillsUI[skills.Skills[i]].GetComponent <ContentSkill>().ChangeColor(); } } else { SelectedSkills ss = FindObjectOfType <SelectedSkills>(); for (int i = 0; i < ss.SelSkills.Length; i++) { if (ss.SelSkills[i] != -1) { ss.selected[i].transform.GetChild(0).GetComponent <Image>().sprite = null; FindObjectOfType <ContentSkillsController>().ClearState(ss.SelSkills[i]); } } for (int i = 0; i < ss.SelSkills.Length; i++) { ss.SelSkills[i] = -1; } } }
public void AddSkill() { SelectedSkills ss = FindObjectOfType <SelectedSkills>(); bool canAddSkill = false; int id = -1; for (int i = 0; i < ss.SelSkills.Length; i++) { if (ss.SelSkills[i] == int.Parse(gameObject.name)) { canAddSkill = false; break; } else if (ss.SelSkills[i] == -1 && id == -1) { id = i; } if (id != -1) { canAddSkill = true; } } if (canAddSkill) { ss.SelSkills[id] = int.Parse(gameObject.name); ss.selected[id].transform.GetChild(0).GetComponent <Image>().sprite = transform.GetChild(0).GetComponent <Image>().sprite; } }
public void MinusSkill() { SelectedSkills ss = FindObjectOfType <SelectedSkills>(); if (ss.SelSkills[int.Parse(gameObject.name)] != -1) { transform.GetChild(0).GetComponent <Image>().sprite = null; FindObjectOfType <ContentSkillsController>().ClearState(ss.SelSkills[int.Parse(gameObject.name)]); ss.SelSkills[int.Parse(gameObject.name)] = -1; SkillInfo.gameObject.SetActive(false); } }
protected virtual void OnAccept(GumpButton button) { if (AcceptHandler != null) { AcceptHandler(button); } if (Callback != null) { Callback(SelectedSkills.ToArray()); } }
private void UpdateRelicSkillDisplay(Armor selected) { SelectedSkills.Text = ""; SelectedArmor.Text = selected.Name; foreach (Skill skill in selected.ActiveSkills) { SelectedSkills.AppendText($"[{SkillManager.ElementToString(skill.Element)}] {skill.ToString()}"); SelectedSkills.AppendText(Environment.NewLine); } selectedArmor = selected; }
public IActionResult OnPost() { foreach (SelectListItem skill in Skills) { if (skill.Selected) { SelectedSkills = $"{skill.Text},{SelectedSkills}"; SelectedSkillIDs = $"{skill.Value},{SelectedSkillIDs}"; } } SelectedSkills = SelectedSkills.TrimEnd(','); SelectedSkillIDs = SelectedSkillIDs.TrimEnd(','); return(RedirectToPage("index")); }
private void SkillsSelectionChangedMethod() { if (SelectedSkills == null) { SelectedSkills = new ObservableCollection <Models.UserPageModel.ProfessionalSkill>(); } if (SelectedSkills.Count > SkillsConditions.Count) { foreach (var selectedSkill in SelectedSkills) { if (SkillsConditions.Where(s => s.Skill.Id == selectedSkill.Id).FirstOrDefault() == null) { SkillsConditions.Add(new SkillCondition { Skill = selectedSkill, From = SkillLevels.First(), To = SkillLevels.Last() }); return; } } } if (SelectedSkills.Count < SkillsConditions.Count) { foreach (var skillCondition in SkillsConditions) { if (SelectedSkills.Where(s => s.Id == skillCondition.Skill.Id).FirstOrDefault() == null) { var skill = SkillsConditions.Where(s => s.Skill.Id == skillCondition.Skill.Id).FirstOrDefault(); if (skill == null) { return; } SkillsConditions.Remove(skill); return; } } } }
protected override int GetLabelHue(int index, int pageIndex, SkillName entry) { return(SelectedSkills.Contains(entry) ? Color.Cyan.ToRgb() : Color.White.ToRgb()); }
protected override void CompileEntryLayout( SuperGumpLayout layout, int length, int index, int pIndex, int yOffset, SkillName entry) { var sup = SupportsUltimaStore; var bgID = sup ? 40000 : 9270; var xOffset = 0; if (pIndex < EntriesPerPage - 20) { xOffset = 10; } else if (pIndex < EntriesPerPage - 10) { xOffset = 145; yOffset = 70 + (pIndex - 10) * 30; } else if (pIndex < EntriesPerPage) { xOffset = 280; yOffset = 70 + (pIndex - 20) * 30; } layout.Replace( "check/list/select/" + index, () => AddButton( xOffset, yOffset, 5033, 5033, b => { if (SelectedSkills.Contains(entry)) { SelectedSkills.Remove(entry); } else { if (SelectedSkills.Count < Limit) { SelectedSkills.Add(entry); } else { new NoticeDialogGump(User, Refresh(true)) { Title = "Limit Reached", Html = "You have selected the maximum of " + Limit + " skills.\nIf you are happy with your selection, click the 'Okay' button." }.Send(); return; } } Refresh(true); })); if (SelectedSkills.Contains(entry)) { layout.Add( "imagetiled/list/entry/" + index, () => { AddImageTiled(xOffset, yOffset, 128, 28, 3004); AddImageTiled(4 + xOffset, 4 + yOffset, 120, 20, bgID + 4); }); } else { layout.Add("imagetiled/list/entry/" + index, () => AddImageTiled(xOffset, yOffset, 128, 28, bgID + 4)); } layout.Add( "html/list/entry/" + index, () => AddHtml( 4 + xOffset, 4 + yOffset, 120, 20, String.Format( "<center><big><basefont color=#{0:X6}>{1}</big></center>", (ushort)GetLabelHue(index, pIndex, entry), GetLabelText(index, pIndex, entry)), false, false)); }
protected override void CompileEntryLayout( SuperGumpLayout layout, int length, int index, int pIndex, int yOffset, SkillName entry) { int xOffset = 0; if (pIndex < 6) { xOffset = 10; } else if (pIndex < 12) { xOffset = 145; yOffset = 70 + (pIndex - 6) * 30; } else if (pIndex < EntriesPerPage) { xOffset = 280; yOffset = 70 + (pIndex - 12) * 30; } layout.AddReplace( "check/list/select/" + index, () => AddButton( xOffset, yOffset, 5033, 5033, b => { if (SelectedSkills.Contains(entry)) { SelectedSkills.Remove(entry); } else { if (SelectedSkills.Count < Limit) { SelectedSkills.Add(entry); } else { new NoticeDialogGump( User, Refresh(true), title: "Limit Reached", html: "You have selected the maximum of " + Limit + " skills.\nIf you are happy with your selection, click the 'Okay' button.").Send(); return; } } Refresh(true); })); if (SelectedSkills.Contains(entry)) { layout.Add( "imagetiled/list/entry/" + index, () => { AddImageTiled(xOffset, yOffset, 128, 28, 3004); AddImageTiled(4 + xOffset, 4 + yOffset, 120, 20, 2624); }); } else { layout.Add("imagetiled/list/entry/" + index, () => AddImageTiled(xOffset, yOffset, 128, 28, 2624)); } layout.Add( "html/list/entry/" + index, () => AddHtml( 4 + xOffset, 4 + yOffset, 120, 20, GetLabelText(index, pIndex, entry).WrapUOHtmlTag("center").WrapUOHtmlColor(DefaultHtmlColor), false, false)); }
private void Find() { Vacancies = new ObservableCollection <object>(CollectionConverter <v_vacancy> .ConvertToObjectList(_executor.GetVacancies( (SelectedIdProfessionCategory != null ? (int)SelectedIdProfessionCategory : -1), (SelectedIdProfession != null ? (int)SelectedIdProfession : -1), (SelectedIdCountry != null ? (int)SelectedIdCountry : -1), (SelectedIdCity != null ? (int)SelectedIdCity : -1), (SelectedIdStreet != null ? (int)SelectedIdStreet : -1), ProfessionName, SelectedExperiences.ToList(), SelectedSchedules.ToList(), SelectedEmploymentTypes.ToList(), SelectedSkills.ToList(), new Model.Logic.Range <DateTime>(BeginValueDateOfRegistration, EndValueDateOfRegistration), BeginValueClosingDate, EndValueClosingDate, BeginValueSalary, EndValueSalary))); }
private void GenerateReport() { Report = new ObservableCollection <v_inDemandSkillsDetailedReport>(_executor.GetInDemandSkillsDetailedReports( new Model.Logic.Range <DateTime>(BeginValueDateOfRegistrationVacancy.Date.Add(new TimeSpan(0, 0, 0, 0, 0)), EndValueDateOfRegistrationVacancy.Date.Add(new TimeSpan(0, 23, 59, 59, 999))), SelectedSkills.ToList())); }