public bool CanInherit(uint eqp1, uint eqp2) { a3_BagItemData equipByAll = this.getEquipByAll(eqp1); a3_BagItemData equipByAll2 = this.getEquipByAll(eqp2); bool flag = equipByAll.confdata.equip_type != equipByAll2.confdata.equip_type; bool result; if (flag) { result = false; } else { bool flag2 = equipByAll.equipdata.stage * 15 + equipByAll.equipdata.intensify_lv >= equipByAll2.equipdata.stage * 15 + equipByAll2.equipdata.intensify_lv; if (flag2) { result = false; } else { bool flag3 = equipByAll.equipdata.add_level > equipByAll2.equipdata.add_level; result = !flag3; } } return(result); }
public GameObject createA3ItemIcon(a3_BagItemData data, bool istouch = false, int num = -1, float scale = 1f, bool tip = false) { bool isUpEquip = false; bool isEquip = data.isEquip; if (isEquip) { bool flag = ModelBase <a3_EquipModel> .getInstance().getEquips().ContainsKey(data.id); if (!flag) { bool flag2 = ModelBase <a3_EquipModel> .getInstance().getEquipsByType().ContainsKey(data.confdata.equip_type) && ModelBase <a3_EquipModel> .getInstance().checkisSelfEquip(data.confdata); if (flag2) { a3_BagItemData a3_BagItemData = ModelBase <a3_EquipModel> .getInstance().getEquipsByType()[data.confdata.equip_type]; bool flag3 = data.equipdata.combpt > a3_BagItemData.equipdata.combpt; if (flag3) { isUpEquip = true; } } else { isUpEquip = true; } } } return(this.createA3ItemIcon(data.confdata, istouch, num, scale, tip, data.equipdata.stage, data.equipdata.blessing_lv, data.isNew, isUpEquip, data.ismark, data.equipdata.attribute, false, false)); }
public void unEquipOneByPart(int part) { a3_BagItemData a3_BagItemData = this.Equips_byType[part]; this.Equips.Remove(a3_BagItemData.id); this.Equips_byType.Remove(part); this.playAudio(a3_BagItemData); bool flag = this.active_eqp.ContainsKey(a3_BagItemData.confdata.equip_type); if (flag) { this.active_eqp.Remove(a3_BagItemData.confdata.equip_type); } bool flag2 = this.Equips_byType.ContainsKey(this.eqp_type_act_fanxiang[a3_BagItemData.confdata.equip_type]); if (flag2) { bool flag3 = this.active_eqp.ContainsKey(this.Equips_byType[this.eqp_type_act_fanxiang[a3_BagItemData.confdata.equip_type]].confdata.equip_type); if (flag3) { this.active_eqp.Remove(this.Equips_byType[this.eqp_type_act_fanxiang[a3_BagItemData.confdata.equip_type]].confdata.equip_type); } } this.equipModel_down(a3_BagItemData); }
void onlink(GameEvent v) { Transform con = r2.transform.FindChild("sumcon/summons/scroll/content"); GameObject item = r2.transform.FindChild("sumcon/summons/scroll/0").gameObject; for (int i = 0; i < con.childCount; i++) { GameObject.Destroy(con.GetChild(i).gameObject); } summonObj.Clear(); foreach (uint id in A3_SummonModel.getInstance().link_list) { a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[id]; GameObject clon = GameObject.Instantiate(item) as GameObject; clon.SetActive(true); clon.transform.SetParent(con.transform, false); clon.name = data.summondata.id.ToString(); clon.transform.FindChild("articles").gameObject.SetActive(true); new BaseButton(clon.transform).onClick = (GameObject go) => { getSummonWin().setCurSummonID((uint)data.summondata.id); getSummonWin().setframe(); setframe(); }; summonObj[(uint)data.summondata.id] = clon; setSum_one((uint)data.summondata.id); } setframe(); setBtn(); refreSumlist((int)CurSummonID, true); }
a3_BagItemData ReadItem(Variant data) { uint id = data["id"]; uint tpid = data["tpid"]; a3_BagItemData item = new a3_BagItemData(); item.id = id; item.tpid = tpid; if (data.ContainsKey("num")) { item.num = data["num"]; } item.confdata = a3_BagModel.getInstance().getItemDataById(tpid); Variant eqpdata = data["itm"]; a3_EquipModel.getInstance().equipData_read(item, eqpdata); item.auctiondata.cid = data["cid"]; item.auctiondata.tm = data["tm"]; item.auctiondata.pro_tm = data["puttm_type"]; item.auctiondata.cost = data["cost"]; if (data.ContainsKey("get_type")) { item.auctiondata.get_type = data["get_type"]; } if (data.ContainsKey("get_tm")) { item.auctiondata.get_tm = data["get_tm"]; } if (data.ContainsKey("seller_name")) { item.auctiondata.seller = data["seller_name"]; } return(item); }
public override void onShowed() { buynum = 0; bar.value = 0; backEvent = null; transform.SetAsLastSibling(); item_data = (a3_BagItemData)uiData[0]; _type = (eType)uiData[1]; backEvent = (Action)uiData[2]; Transform info = transform.FindChild("info"); Transform buy = transform.FindChild("buy"); if (_type == eType.info) { info.gameObject.SetActive(true); buy.gameObject.SetActive(false); initItemInfo(); } else if (_type == eType.buy) { info.gameObject.SetActive(false); buy.gameObject.SetActive(true); initItemBuy(); } bs_bt1.interactable = true; bs_bt2.interactable = true; bs_buy.interactable = true; buy_text.text = "1"; }
public bool isActive_eqp(a3_BagItemData data) { bool flag = data.equipdata.attribute == 0; bool result; if (flag) { result = false; } else { int key = this.eqp_type_act[data.confdata.equip_type]; bool flag2 = !this.Equips_byType.ContainsKey(key); if (flag2) { result = false; } else { int num = this.eqp_att_act[data.equipdata.attribute]; bool flag3 = this.Equips_byType[key].equipdata.attribute == num; result = flag3; } } return(result); }
private void onMailItemClick(a3_BagItemData itmdata) { bool isEquip = itmdata.isEquip; if (isEquip) { ArrayList arrayList = new ArrayList(); arrayList.Add(itmdata); arrayList.Add(equip_tip_type.Comon_tip); InterfaceMgr.getInstance().open(InterfaceMgr.A3_EQUIPTIP, arrayList, false); } else { bool isSummon = itmdata.isSummon; if (isSummon) { ArrayList arrayList2 = new ArrayList(); arrayList2.Add(itmdata); InterfaceMgr.getInstance().open(InterfaceMgr.A3TIPS_SUMMON, arrayList2, false); } else { ArrayList arrayList3 = new ArrayList(); arrayList3.Add(itmdata); arrayList3.Add(equip_tip_type.Comon_tip); InterfaceMgr.getInstance().open(InterfaceMgr.A3_ITEMTIP, arrayList3, false); } } }
//private void checkItemLoaded(ItemData item, Action<ItemData, GameObject> loaded, bool istouch, int num, float scale, GameObject icon_prefab, Sprite s_icon, Sprite s_border) //{ // if (icon_prefab == null || s_icon == null || s_border == null) // { // loaded(item, null); // return; // } // GameObject iconPrefab = icon_prefab; // GameObject root = GameObject.Instantiate(iconPrefab) as GameObject; // Image icon = root.transform.FindChild("icon").GetComponent<Image>(); // icon.sprite = s_icon; // Image iconborder = root.transform.FindChild("iconborder").GetComponent<Image>(); // iconborder.sprite = s_border; // Text numText = root.transform.FindChild("num").GetComponent<Text>(); // if (istouch) // { // root.transform.GetComponent<Button>().enabled = true; // } // else // { // root.transform.GetComponent<Button>().enabled = false; // } // if (num != -1) // { // numText.text = num.ToString(); // numText.gameObject.SetActive(true); // } // else // { // numText.gameObject.SetActive(false); // } // root.name = "icon"; // root.transform.localScale = new Vector3(scale, scale, 1.0f); // loaded(item, root); //} //public void waitItemIcon(ItemData item, Action<ItemData, GameObject> loaded, bool istouch = false, int num = -1, float scale = 1.0f) //{ // GameObject icon_prefab = null; // Sprite s_icon = null; // Sprite s_border = null; // int res_count = 3; // IAsset res_icon = os.asset.getAsset<IAssetMesh>("prefab/iconimage", (IAsset ast) => // { // icon_prefab = (ast as AssetMeshImpl).assetObj; // res_count--; // if( res_count == 0 ) checkItemLoaded(item, loaded, istouch, num, scale, icon_prefab, s_icon, s_border); // }, null, // (IAsset ast, string err) => // { // //加载失败 // debug.Log("加载UI失败prefab/iconimage"); // res_count--; // if (res_count == 0) loaded(item, null); // }); // (res_icon as AssetImpl).loadImpl(false); // ////////////////////////////////////////////////////////////////////////////////////// // IAsset res_pic1 = os.asset.getAsset<IAssetBitmap>(item.file, (IAsset ast) => // { // s_icon = (ast as AssetBitmapImpl).sprite; // res_count--; // if (res_count == 0) checkItemLoaded(item, loaded, istouch, num, scale, icon_prefab, s_icon, s_border); // }, null, // (IAsset ast, string err) => // { // debug.Log("加载图片失败:" + item.file); // res_count--; // if (res_count == 0) loaded(item, null); // }); // (res_pic1 as AssetImpl).loadImpl(false); // ////////////////////////////////////////////////////////////////////////////////////// // IAsset res_pic2 = os.asset.getAsset<IAssetBitmap>(item.borderfile, (IAsset ast) => // { // s_border = (ast as AssetBitmapImpl).sprite; // res_count--; // if (res_count == 0) checkItemLoaded(item, loaded, istouch, num, scale, icon_prefab, s_icon, s_border); // }, null, // (IAsset ast, string err) => // { // debug.Log("加载图片失败:" + item.borderfile); // res_count--; // if (res_count == 0) loaded(item, null); // }); // (res_pic2 as AssetImpl).loadImpl(false); //} public GameObject createA3ItemIcon(a3_BagItemData data, bool istouch = false, int num = -1, float scale = 1.0f, bool tip = false) { bool isUpEquip = false; if (data.isEquip) {//装备战斗力更高标识 if (a3_EquipModel.getInstance().getEquips().ContainsKey(data.id)) { } else if (a3_EquipModel.getInstance().getEquipsByType().ContainsKey(data.confdata.equip_type) && a3_EquipModel.getInstance().checkisSelfEquip(data.confdata)) { a3_BagItemData have_one = a3_EquipModel.getInstance().getEquipsByType()[data.confdata.equip_type]; if (data.equipdata.combpt > have_one.equipdata.combpt) { isUpEquip = true; } } else { isUpEquip = true; } } return(createA3ItemIcon(data.confdata, istouch, num, scale, tip, data.equipdata.stage, data.equipdata.blessing_lv, data.isNew, isUpEquip, data.ismark, data.equipdata.attribute)); }
public bool HasBaoshi(a3_BagItemData data) { bool flag = false; bool flag2 = data.equipdata.baoshi != null; bool result; if (flag2) { bool flag3 = data.equipdata.baoshi.Count <= 0; if (flag3) { result = false; return(result); } foreach (int current in data.equipdata.baoshi.Keys) { bool flag4 = data.equipdata.baoshi[current] > 0; if (flag4) { flag = true; break; } } } result = flag; return(result); }
public void AddMyItem(Variant data) { this.myitems_up.Clear(); this.myitems_down.Clear(); bool flag = data.ContainsKey("auc_data"); if (flag) { Variant variant = data["auc_data"]; foreach (Variant current in variant._arr) { a3_BagItemData a3_BagItemData = this.ReadItem(current); this.RemoveItem(a3_BagItemData.id); this.myitems_up[a3_BagItemData.id] = a3_BagItemData; } } bool flag2 = data.ContainsKey("get_list"); if (flag2) { Variant variant2 = data["get_list"]; foreach (Variant current2 in variant2._arr) { a3_BagItemData a3_BagItemData2 = this.ReadItem(current2); this.RemoveItem(a3_BagItemData2.id); this.myitems_down[a3_BagItemData2.id] = a3_BagItemData2; } } }
private void CreateIconGo(Transform parent) { a3_BagItemData data = _rollItemdata.eqpData == null ? _rollItemdata.itemData : _rollItemdata.eqpData; _iconGo = IconImageMgr.getInstance().createA3ItemIcon(data, true, data.num, 0.75f); _iconGo.transform.SetParent(parent); _iconGo.transform.localPosition = Vector3.zero; _iconGo.transform.localScale = new Vector3(0.65f, 0.65f, 0.65f); if (data.num <= 1) { _iconGo.transform.FindChild("num").gameObject.SetActive(false); } BaseButton bs_bt = new BaseButton(_iconGo.transform); bs_bt.onClick = delegate(GameObject go) { if (data.isEquip) { ArrayList uidata = new ArrayList(); uidata.Add(data); uidata.Add(equip_tip_type.Comon_tip); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_EQUIPTIP, uidata); } else { ArrayList uidata = new ArrayList(); uidata.Add(data); uidata.Add(equip_tip_type.Comon_tip); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMTIP, uidata); } }; }
public a3_BagItemData DressupInfos(Variant data) { a3_BagItemData a3_BagItemData = default(a3_BagItemData); a3_BagItemData.id = data["fushi"]["id"]; a3_BagItemData.tpid = data["fushi"]["tpid"]; a3_BagItemData.isrunestone = true; bool flag = data["fushi"].ContainsKey("mark"); if (flag) { a3_BagItemData.ismark = data["fushi"]["mark"]; } bool flag2 = data["fushi"].ContainsKey("stone_att"); if (flag2) { foreach (Variant current in data["fushi"]["stone_att"]._arr) { a3_BagItemData.runestonedata.runeston_att = new Dictionary <int, int>(); int key = current["att_type"]; int value = current["att_value"]; a3_BagItemData.runestonedata.runeston_att[key] = value; } } return(a3_BagItemData); }
//9个位置icon的创建 void creatrveicon(int id) { Dictionary <int, hallowsData> dic = A3_HallowsModel.getInstance().now_hallows(); GameObject iconf = lsts_nine_region[id - 1].transform.FindChild("icon/icon").gameObject; GameObject icon = IconImageMgr.getInstance().createA3ItemIcon((uint)dic[id].item_id, true, -1, 1, true); icon.transform.SetParent(iconf.transform, false); Text name = lsts_nine_region[id - 1].transform.FindChild("name").GetComponent <Text>(); string item_name = XMLMgr.instance.GetSXML("item.item", "id==" + (uint)dic[id].item_id).getString("item_name"); name.text = Globle.getColorStrByQuality(item_name, dic[id].h_s_d.quality); a3_BagItemData data = new a3_BagItemData(); data.tpid = (uint)dic[id].item_id; data.num = 1; a3_ItemData da = new a3_ItemData(); da = a3_BagModel.getInstance().getItemDataById(data.tpid); data.confdata = da; data.ishallows = true; new BaseButton(icon.transform).onClick = delegate(GameObject go) { this.itemOnclick(icon, data, 3); ShoworHideModel(false); }; }
//取出物品 public void outItem_chushou(uint id, int num = 1, bool isequip = false) { GameObject con = transform.FindChild("info_bg/scroll_view/icon").gameObject; if (isequip) { itemcon_chushou[id].transform.parent.SetAsLastSibling(); Destroy(itemcon_chushou[id].gameObject); itemcon_chushou.Remove(id); dic_BagItem_shll.Remove(id); ShowMoneyCount(a3_BagModel.getInstance().getUnEquips()[id].tpid, 1, false); } else { if (num >= dic_BagItem_shll[id].num) { itemcon_chushou[id].transform.parent.SetAsLastSibling(); Destroy(itemcon_chushou[id].gameObject); itemcon_chushou.Remove(id); dic_BagItem_shll.Remove(id); ShowMoneyCount(a3_BagModel.getInstance().getItems()[id].tpid, num, false); } else { a3_BagItemData one = dic_BagItem_shll[id]; one.num = dic_BagItem_shll[id].num - num; dic_BagItem_shll[id] = one; itemcon_chushou[id].transform.FindChild("num").GetComponent <Text>().text = one.num.ToString(); ShowMoneyCount(dic_BagItem_shll[id].tpid, num, false); } } }
private void addlibao(a3_BagItemData data) { bool flag = (ulong)ModelBase <PlayerModel> .getInstance().up_lvl > (ulong)((long)data.confdata.use_limit); if (flag) { this.newshow_item[data.id] = data; } bool flag2 = (ulong)ModelBase <PlayerModel> .getInstance().up_lvl == (ulong)((long)data.confdata.use_limit); if (flag2) { bool flag3 = (ulong)ModelBase <PlayerModel> .getInstance().lvl >= (ulong)((long)data.confdata.use_lv); if (flag3) { this.newshow_item[data.id] = data; } } bool flag4 = a3_equipup.instance != null; if (flag4) { a3_equipup.instance.showUse(); } }
void CreateItemIcon_chushou(a3_BagItemData data, int i) { uint id = data.id; GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(data, false, data.num); icon.transform.SetParent(item_Parent_chushou.transform.GetChild(i), false); itemcon_chushou[data.id] = icon; if (data.num <= 1) { icon.transform.FindChild("num").gameObject.SetActive(false); } BaseButton bs_bt = new BaseButton(icon.transform); bs_bt.onClick = delegate(GameObject go) { if (data.isEquip) { ArrayList data1 = new ArrayList(); a3_BagItemData one = a3_BagModel.getInstance().getItems()[id]; data1.Add(one); data1.Add(equip_tip_type.tip_forchushou); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_EQUIPTIP, data1); } else { if (dic_BagItem_shll.ContainsKey(id)) { ArrayList data1 = new ArrayList(); a3_BagItemData one = dic_BagItem_shll[id]; data1.Add(one); data1.Add(equip_tip_type.tip_forchushou); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMTIP, data1); } } }; }
private a3_BagItemData SetBagItemData(a3_BagItemData itemData, Variant item) { SXML itemXml = this.GetItemXml((uint)itemData.summondata.tpid); itemData.confdata.item_name = itemXml.getString("name"); itemData.id = item["id"]; itemData.tpid = item["tpid"]; SXML itemXml2 = ModelBase <a3_BagModel> .getInstance().getItemXml(item["tpid"]); bool flag = itemXml2 != null; if (flag) { itemData.confdata.file = "icon/item/" + itemXml2.getString("icon_file"); itemData.confdata.borderfile = "icon/itemborder/b039_0" + itemXml2.getString("quality"); itemData.confdata.item_name = itemXml2.getString("item_name"); itemData.confdata.quality = itemXml2.getInt("quality"); itemData.confdata.desc = itemXml2.getString("desc"); itemData.confdata.desc2 = itemXml2.getString("desc2"); itemData.confdata.value = itemXml2.getInt("value"); itemData.confdata.use_lv = itemXml2.getInt("use_lv"); itemData.confdata.use_limit = itemXml2.getInt("use_limit"); itemData.confdata.use_type = itemXml2.getInt("use_type"); int @int = itemXml2.getInt("intensify_score"); itemData.confdata.intensify_score = @int; itemData.confdata.item_type = itemXml2.getInt("item_type"); itemData.confdata.equip_type = itemXml2.getInt("equip_type"); itemData.confdata.equip_level = itemXml2.getInt("equip_level"); itemData.confdata.job_limit = itemXml2.getInt("job_limit"); itemData.confdata.modelId = itemXml2.getInt("model_id"); } return(itemData); }
public a3_BagItemData SetBabyData(a3_BagItemData itemData, Variant item) { if (!IsBaby(itemData)) { return(itemData); } itemData.isSummon = true; var xmldata = GetItemFromBaby(itemData.tpid); var vv = xmldata.getInt("talent_id"); var strv = GetSummonTypeById(vv); if (strv.Length >= 2) { itemData.summondata.isSpecial = true; itemData.summondata.grade = strv[1]; itemData.summondata.naturaltype = strv[2]; } else if (strv.Length >= 1) { itemData.summondata.isSpecial = false; itemData.summondata.grade = strv[1]; itemData.summondata.naturaltype = strv[2]; } return(itemData); }
public void equipModel_on(a3_BagItemData data) { bool flag = data.confdata.equip_type == 3 && SelfRole._inst != null; if (flag) { int tpid = (int)data.tpid; int stage = data.equipdata.stage; SelfRole._inst.m_roleDta.m_BodyID = tpid; SelfRole._inst.m_roleDta.m_BodyFXID = stage; SelfRole._inst.set_body(tpid, stage); SelfRole._inst.rebind_ani(); uint color = data.equipdata.color; SelfRole._inst.m_roleDta.m_EquipColorID = color; SelfRole._inst.set_equip_color(color); } bool flag2 = data.confdata.equip_type == 6 && SelfRole._inst != null; if (flag2) { int tpid2 = (int)data.tpid; int stage2 = data.equipdata.stage; switch (ModelBase <PlayerModel> .getInstance().profession) { case 2: SelfRole._inst.m_roleDta.m_Weapon_RID = tpid2; SelfRole._inst.m_roleDta.m_Weapon_RFXID = stage2; SelfRole._inst.set_weaponr(tpid2, stage2); break; case 3: SelfRole._inst.m_roleDta.m_Weapon_LID = tpid2; SelfRole._inst.m_roleDta.m_Weapon_LFXID = stage2; SelfRole._inst.set_weaponl(tpid2, stage2); break; case 5: SelfRole._inst.m_roleDta.m_Weapon_LID = tpid2; SelfRole._inst.m_roleDta.m_Weapon_LFXID = stage2; SelfRole._inst.m_roleDta.m_Weapon_RID = tpid2; SelfRole._inst.m_roleDta.m_Weapon_RFXID = stage2; SelfRole._inst.set_weaponl(tpid2, stage2); SelfRole._inst.set_weaponr(tpid2, stage2); break; } } bool flag3 = SelfRole._inst != null; if (flag3) { SelfRole._inst.clear_eff(); } bool flag4 = this.active_eqp.Count >= 10 && SelfRole._inst != null; if (flag4) { SelfRole._inst.set_equip_eff(this.GetEqpIdbyType(3), false); } }
//背包里面icon的创建 void creatrveicon_bag(int i, a3_BagItemData data) { GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(data, true, data.num); dic_havehallows[data.confdata.tpid] = icon; icon.transform.SetParent(contain_h_bag.transform.GetChild(i).transform, false); new BaseButton(icon.transform).onClick = delegate(GameObject go) { this.itemOnclick(icon, data, 2); ShoworHideModel(false); }; }
/*刷新符石*/ public void addHaveRunestones(a3_BagItemData data) { if (!dic_runestones_obj.ContainsKey(data.id)) { RefreshSccrollHaveRunestonsGrid(); CreatrveIcons(data, dic_runestones_obj.Count); } }
void onEquipClick(GameObject go, a3_BagItemData one) { ArrayList data = new ArrayList(); data.Add(one); data.Add(equip_tip_type.tip_ForLook); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_EQUIPTIP, data); }
public void SetRollDropItem(List <Variant> s2cDataLst) { if (s2cDataLst == null) { return; } for (int i = 0; i < s2cDataLst.Count; i++) { ROllItem rollItem = new ROllItem(); rollItem.dpid = s2cDataLst[i]["dpid"]; rollItem.tp = s2cDataLst[i]["tp"]; rollItem.left_tm = s2cDataLst[i]["left_tm"]; rollItem.teamid = s2cDataLst[i]["teamid"]; rollItem.roll_tm = s2cDataLst[i]["roll_tm"]; rollItem.roll_owner = s2cDataLst[i]["roll_owner"]; if (s2cDataLst[i].ContainsKey("eqp")) { Variant eqpary = s2cDataLst[i]["eqp"]; a3_BagItemData itemData = new a3_BagItemData(); if (eqpary.ContainsKey("tpid")) { itemData.tpid = eqpary["tpid"]; } if (eqpary.ContainsKey("bnd")) { itemData.bnd = eqpary["bnd"]; } a3_EquipModel.getInstance().equipData_read(itemData, eqpary); itemData.confdata = a3_BagModel.getInstance().getItemDataById(itemData.tpid); rollItem.eqpData = itemData; } if (s2cDataLst[i].ContainsKey("itm")) { Variant itm = s2cDataLst[i]["itm"]; a3_BagItemData itemData = new a3_BagItemData(); itemData.tpid = itm["id"]; itemData.num = itm["cnt"]; itemData.confdata = a3_BagModel.getInstance().getItemDataById(itemData.tpid); rollItem.itemData = itemData; } rollItemMapping[rollItem.dpid] = rollItem; if (a3_RollItem.single != null) { a3_RollItem.single.AddRollItemGo(rollItem); } } }
public a3_BagItemData GetSummonData(a3_BagItemData itemData, Variant item) { bool flag = !this.IsSummon(itemData, item); a3_BagItemData result; if (flag) { result = itemData; } else { itemData.isSummon = true; bool flag2 = this.IsBaby(itemData); if (flag2) { itemData.isSummon = false; SXML itemFromBaby = this.GetItemFromBaby(itemData.tpid); int @int = itemFromBaby.getInt("talent_id"); bool flag3 = @int >= 0; if (flag3) { int[] summonTypeById = this.GetSummonTypeById(@int); bool flag4 = summonTypeById.Length >= 2; if (flag4) { itemData.summondata.isSpecial = true; itemData.summondata.grade = summonTypeById[1]; itemData.summondata.naturaltype = summonTypeById[2]; } else { bool flag5 = summonTypeById.Length >= 1; if (flag5) { itemData.summondata.isSpecial = false; itemData.summondata.grade = summonTypeById[1]; itemData.summondata.naturaltype = summonTypeById[2]; } } } else { itemData.summondata.isSpecial = false; itemData.summondata.grade = 0; itemData.summondata.naturaltype = 0; } result = itemData; } else { itemData = this.SetDataFromVariant(itemData, item); itemData = this.SetDataFromXML(itemData); result = itemData; } } return(result); }
void refreshShow(a3_BagItemData data) { Transform Image = this.transform.FindChild("bg/icon"); if (Image.childCount > 0) { for (int i = 0; i < Image.childCount; i++) { Destroy(Image.GetChild(i).gameObject); } } GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(data); icon.transform.SetParent(Image, false); new BaseButton(this.transform.FindChild("bg/do")).onClick = (GameObject go) => { if (data.isEquip) { EquipProxy.getInstance().sendChangeEquip(data.id); } else if (data.confdata.use_type == 13) { a3_BagModel.getInstance().useItemByTpid(data.confdata.tpid, 1); } else if (data.confdata.use_type == 20)//宠物在开启功能之前获得 { if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.PET)) { a3_BagModel.getInstance().useItemByTpid(data.confdata.tpid, 1); } else { flytxt.instance.fly(ContMgr.getCont("func_limit_8")); } } else if (data.isSummon) { A3_SummonProxy.getInstance().sendUseSummon((uint)data.id); } }; new BaseButton(this.transform.FindChild("bg/close")).onClick = (GameObject go) => { if (data.isEquip) { a3_BagModel.getInstance().neweqp.Remove(data.id); } else if (data.confdata.use_type == 13 || data.confdata.use_type == 20) { a3_BagModel.getInstance().newshow_item.Remove(data.id); } else if (data.isSummon) { a3_BagModel.getInstance().newshow_summon.Remove(data.id); } showUse(); }; }
public void AddSummon(Variant item) { a3_BagItemData itemData = new a3_BagItemData(); itemData = A3_SummonModel.getInstance().SetDataFromVariant(itemData, item); itemData = A3_SummonModel.getInstance().SetDataFromXML(itemData); itemData = A3_SummonModel.getInstance().SetBagItemData(itemData, item); _summons[itemData.id] = itemData; }
void onRoomTurn(GameEvent e) { Variant data = e.data; if (data.ContainsKey("add")) { foreach (Variant item in data["add"]._arr) { uint id = item["id"]; if (a3_BagModel.getInstance().getHouseItems().ContainsKey(id)) { a3_BagItemData one = a3_BagModel.getInstance().getHouseItems()[id]; CreateItemIcon(one, house_Parent.transform.GetChild(houseicon.Count), true); } } } if (data.ContainsKey("modcnts")) { foreach (Variant item in data["modcnts"]._arr) { uint id = item["id"]; if (houseicon.ContainsKey(id)) { houseicon[id].transform.FindChild("num").GetComponent <Text>().text = item["cnt"]; if ((int)item["cnt"] <= 1) { houseicon[id].transform.FindChild("num").gameObject.SetActive(false); } else { houseicon[id].transform.FindChild("num").gameObject.SetActive(true); } } } } if (data.ContainsKey("rmvids")) { foreach (uint itemid in data["rmvids"]._arr) { uint id = itemid; if (houseicon.ContainsKey(id)) { GameObject go = houseicon[id].transform.parent.gameObject; Destroy(go); houseicon.Remove(id); GameObject item = transform.FindChild("house_scroll/scroll_view/icon").gameObject; GameObject itemclone = ((GameObject)GameObject.Instantiate(item)); itemclone.SetActive(true); itemclone.transform.SetParent(house_Parent.transform, false); itemclone.transform.SetSiblingIndex(houseicon.Count + 1); } } } }
public override void onShowed() { this.tiptype = equip_tip_type.Bag_tip; base.transform.SetAsLastSibling(); bool flag = this.uiData == null; if (!flag) { bool flag2 = this.uiData.Count != 0; if (flag2) { this.item_data = (a3_BagItemData)this.uiData[0]; this.curid = this.item_data.id; this.tiptype = (equip_tip_type)this.uiData[1]; } base.transform.FindChild("info/use").gameObject.SetActive(false); base.transform.FindChild("info/sell").gameObject.SetActive(false); base.transform.FindChild("info/put").gameObject.SetActive(false); this.bodyNum.gameObject.SetActive(true); bool flag3 = this.tiptype == equip_tip_type.HouseOut_tip; if (flag3) { this.is_put_in = false; base.transform.FindChild("info/put/Text").GetComponent <Text>().text = "取出"; base.transform.FindChild("info/put").gameObject.SetActive(true); } else { bool flag4 = this.tiptype == equip_tip_type.HouseIn_tip; if (flag4) { this.is_put_in = true; base.transform.FindChild("info/put/Text").GetComponent <Text>().text = "放入"; base.transform.FindChild("info/put").gameObject.SetActive(true); } else { bool flag5 = this.tiptype == equip_tip_type.Bag_tip; if (flag5) { base.transform.FindChild("info/sell").gameObject.SetActive(true); base.transform.FindChild("info/use").gameObject.SetActive(true); } else { bool flag6 = this.tiptype == equip_tip_type.Chat_tip; if (flag6) { this.bodyNum.gameObject.SetActive(false); } } } } this.initItemInfo(); } }
public void setSum_one(uint id) { if (summonObj.ContainsKey(id)) { a3_BagItemData it = model.GetSummons()[id]; summonObj[id].transform.FindChild("lv").GetComponent <Text>().text = it.summondata.level.ToString(); SetIcon(it, summonObj[id].transform.FindChild("icon")); setStar(summonObj[id].transform.FindChild("stars"), it.summondata.star); } }