private void btnStop_click(object sender, RoutedEventArgs e) { //var list = _role.GameHelper.GetWorkerStatic(); //foreach (var item in list) //{ // Debug.WriteLine(item.lv + " " + item.name); //} //return; QuenchingViewModel model = SoftContext.Locator.Quenching; List <Equips> equipsList = new List <Equips>(); //初始化装备数据 var rootObj = _role.GameHelper.GetData(Const.GET_EQUIPS_LIST); if (rootObj != null) { JArray equips = rootObj.action.data.equips; if (equips != null) { equipsList = JsonHelper.FromJson <List <Equips> >(equips.ToString()); } else { return; } foreach (var equip in equipsList) { 套装 taozhuang = model.TaozhuangList.FirstOrDefault(x => equip.refreshAttribute.Count == 4 && ((Equipment)x.GetType().GetProperty(equip.name).GetValue(x)).类型.ToString() == equip.refreshAttribute[0].attrName && ((Equipment)x.GetType().GetProperty(equip.name).GetValue(x)).IsHave == false); if (taozhuang != null) { ((Equipment)taozhuang.GetType().GetProperty(equip.name).GetValue(taozhuang)).IsHave = true; equip.IsBelong = true; } } } else { MessageBox.Show("获取数据失败!请点击洗练."); return; } int i = 1; foreach (var equip in equipsList) { if (equip.IsBelong == false && equip.refreshAttribute.Count == 4) { Debug.WriteLine(i + " " + equip.name + " " + equip.refreshAttribute[0].attrName); } i++; } }
private void Reset() { QuenchingViewModel model = SoftContext.Locator.Quenching; model.TaozhuangList.ToList().ForEach(x => { x.套装名称.IsHave = false; x.麒麟双枪.IsHave = false; x.麒麟.IsHave = false; x.昧纯阳铠.IsHave = false; x.蝶凤舞阳.IsHave = false; x.伏龙帅印.IsHave = false; x.蟠龙华盖.IsHave = false; }); SoftContext.Locator.Main.StatusBar = "套装初始化成功"; }
private void RegisterMessengers() { Messenger.Default.Register <SendData <Role> >(this, Notifications.XilianFlyout, sendData => { if (sendData.Message == "OpenXilianFlyout") { OpenXilianFlyout(); _role = sendData.Data; QuenchingViewModel model = SoftContext.Locator.Quenching; model.TaozhuangList = new ObservableCollection <套装>(_role.TaozhuangList); this.isSkip.IsChecked = _role.IsSkipIfOne; this.gb.Header = "洗练助手--" + _role.WindowTitle; SoftContext.Locator.Main.StatusBar = "套装初始化成功"; } }); }
private void CheckBox_Unchecked(object sender, RoutedEventArgs e) { CheckBox cb = sender as CheckBox; if (cb == null) { return; } 套装 taozhuang = cb.DataContext as 套装; QuenchingViewModel model = SoftContext.Locator.Quenching; int index = model.TaozhuangList.IndexOf(taozhuang); if (index >= 0) { var t = model.TaozhuangList[index]; t.麒麟双枪.IsHave = false; t.麒麟.IsHave = false; t.昧纯阳铠.IsHave = false; t.蝶凤舞阳.IsHave = false; t.伏龙帅印.IsHave = false; t.蟠龙华盖.IsHave = false; } }