private TipViewData GetTipViewDataByEquip(ItemEquipment equip) { TipViewData viewData = new TipViewData() { priority = TIP_TYPE_EQUIP, itemId = equip.templateId, tipText = LanguageData.GetContent(3020) + "\n" + equip.name, btnName = LanguageData.GetContent(3021), btnAction = () => { //TimerHeap.DelTimer(timerId); TipUIManager.Instance.Hide(TIP_TYPE_EQUIP); ItemParent temp = InventoryManager.Instance.GetItemByItemID(equip.templateId); if (temp == null) { MogoMsgBox.Instance.ShowFloatingText(LanguageData.GetContent(472)); } else { MogoWorld.thePlayer.RpcCall("ExchangeEquipment", temp.id, (byte)temp.gridIndex); } } }; return(viewData); }
private TipViewData GetTipViewDataByEquipToDecompose(ItemEquipment equip) { TipViewData viewData = new TipViewData() { priority = TIP_TYPE_ENHANCE, itemId = equip.templateId, tipText = LanguageData.GetContent(3028) + "\n" + LanguageData.GetContent(3029), btnName = LanguageData.GetContent(3030), btnAction = () => { //TimerHeap.DelTimer(timerId); TipUIManager.Instance.HideAll(TIP_TYPE_ENHANCE); ItemParent temp = InventoryManager.Instance.GetItemByItemID(equip.templateId); if (temp == null) { MogoMsgBox.Instance.ShowFloatingText(LanguageData.GetContent(472)); } else { MogoWorld.thePlayer.StopMove(); MogoUIManager.Instance.SwitchDecomposeUI(); } } }; return(viewData); }
public void removeItemFromList(ItemParent item) { if (items.Contains(item)) { items.Remove(item); } }
private void OnEquipSelect(int index) { if (index >= m_equipmentList.Count) { return; } m_currentEquipment = m_equipmentList[index]; ShowEquipInfo(m_currentEquipment); }
/// <exception cref="System.Exception"></exception> protected override void Store() { var parent = new ItemParent (); var child = new Item ("child"); parent.child = child; Store(parent); }
private void AddGiftTip(int level) { int gap = 10; if (level % gap != 0) { return; } int index = level / gap; int itemId = 1100100; ItemParent item = null; int count = 1; while (item == null && count <= index) { itemId++; item = InventoryManager.Instance.GetItemByItemID(itemId); count++; } if (item == null) { LoggerHelper.Warning("can not find item:" + itemId); return; } //uint timerId = TimerHeap.AddTimer(TIME_LENGTH, 0, () => { TipUIManager.Instance.Hide(TIP_TYPE_GIFT); }); TipViewData viewData = new TipViewData() { priority = TIP_TYPE_GIFT, itemId = item.templateId, btnName = LanguageData.GetContent(3024), tipText = LanguageData.GetContent(3022) + "\n" + LanguageData.GetContent(3023, (count - 1) * gap), btnAction = () => { //TimerHeap.DelTimer(timerId); TipUIManager.Instance.HideAll(TIP_TYPE_GIFT); if (InventoryManager.Instance.GetItemByItemID(itemId) != null) { MogoWorld.thePlayer.RpcCall("UseItemReq", item.id, item.gridIndex, TIP_TYPE_GIFT); //防止使用未回调就弹出新的tip TimerHeap.AddTimer(1000, 0, () => { AddGiftTip(MogoWorld.thePlayer.level); }); } else { MogoMsgBox.Instance.ShowFloatingText(LanguageData.GetContent(2115)); AddGiftTip(MogoWorld.thePlayer.level); } } }; TipUIManager.Instance.AddTipViewData(viewData); }
private void Awake() { ItemArray = new string[3] { "Boost", "Trap", "UnguidedMissile" }; ThisKart = GetComponent <KartScript>(); try { ItemList = GameObject.FindGameObjectWithTag("ItemParent").GetComponent <ItemParent>(); ItemUI = GameObject.FindGameObjectWithTag("CurrentItemText").GetComponent <Text>(); } catch { //In time trial } }
public void SetInventoryGridItem(ItemParent item) { if (item.maxStack < 1) { MenuUIViewManager.Instance.SetPackageGridNumVisible(item.gridIndex, false); } else { MenuUIViewManager.Instance.SetPackageGridNum(item.stack.ToString(), item.gridIndex); MenuUIViewManager.Instance.SetPackageGridNumVisible(item.gridIndex); } MenuUIViewManager.Instance.SetPackageGridImage(item.icon, item.gridIndex, item.color); if (item.itemType == 2) MenuUIViewManager.Instance.SetPackageGridBG(IconData.blankBox, item.gridIndex); else MenuUIViewManager.Instance.SetPackageGridBG(IconData.GetIconByQuality(item.quality), item.gridIndex); }
public void SetInventoryGridItem(ItemParent item) { if (item.maxStack < 1) { MenuUIViewManager.Instance.SetPackageGridNumVisible(item.gridIndex, false); } else { MenuUIViewManager.Instance.SetPackageGridNum(item.stack.ToString(), item.gridIndex); MenuUIViewManager.Instance.SetPackageGridNumVisible(item.gridIndex); } MenuUIViewManager.Instance.SetPackageGridImage(item.icon, item.gridIndex, item.color); if (item.itemType == 2) { MenuUIViewManager.Instance.SetPackageGridBG(IconData.blankBox, item.gridIndex); } else { MenuUIViewManager.Instance.SetPackageGridBG(IconData.GetIconByQuality(item.quality), item.gridIndex); } }
public void ShowEquipInfo(ItemParent item) { List <ButtonInfo> btnList = new List <ButtonInfo>(); ButtonInfo btn = new ButtonInfo() { action = OnLockChange }; int textId = 0; if (((ItemEquipment)item).locked) { textId = 1081; } else { textId = 1082; } btn.text = LanguageData.GetContent(textId); btn.id = textId; btnList.Add(btn); InventoryManager.Instance.ShowEquipTip(item as ItemEquipment, btnList, MogoWorld.thePlayer.level); }
public void RemoveInventoryGridItem(ItemParent item) { RemoveInventoryGridItem(item.gridIndex); }
public void ShowEquipInfo(ItemParent item) { List<ButtonInfo> btnList = new List<ButtonInfo>(); ButtonInfo btn = new ButtonInfo() { action = OnLockChange }; int textId = 0; if (((ItemEquipment)item).locked) { textId = 1081; } else { textId = 1082; } btn.text = LanguageData.GetContent(textId); btn.id = textId; btnList.Add(btn); InventoryManager.Instance.ShowEquipTip(item as ItemEquipment, btnList, MogoWorld.thePlayer.level); }
private void OnEquipSelect(int index) { if (index >= m_equipmentList.Count) return; m_currentEquipment = m_equipmentList[index]; ShowEquipInfo(m_currentEquipment); }
private void OnExchangeEquip(ItemParent item) { EquipTipManager.Instance.CloseEquipTip(); EquipExchangeManager.Instance.ShowUI(item.level, item.subtype); }
public bool CanUpgrade(ItemParent item) { return item.effectId > 0; }
/// <summary> /// 背包物品被点击后 /// </summary> /// <param name="index"></param> private void OnSelectItemInbag(int index) { if (!m_itemsInBag[CurrentTagIndex].ContainsKey(index)) return; ItemParent item = m_itemsInBag[CurrentTagIndex][index]; m_selectedItem = item; switch (CurrentTagIndex) { case ITEM_TYPE_EQUIPMENT: LoggerHelper.Debug("ShowEquipTip"); if (m_selectedItem.itemType == 1) { ShowEquipTipInBag(m_selectedItem); } else { ShowPropTip(m_selectedItem); } break; case ITEM_TYPE_JEWEL: List<ButtonInfo> btnList = new List<ButtonInfo>(); ButtonInfo btn1 = new ButtonInfo() { action = InsetJewel, text = LanguageData.GetContent(905), id = 905 }; ButtonInfo btn2 = new ButtonInfo() { action = OnCompose, text = LanguageData.GetContent(906), id = 906 }; btnList.Add(btn1); btnList.Add(btn2); ShowJewelTip((ItemJewel)m_selectedItem, btnList); break; case ITEM_TYPE_MATERIAL: ShowMaterialTip(m_selectedItem); break; } }
private void Awake() { ThisKart = GetComponent <AIScript>(); ItemList = GameObject.FindGameObjectWithTag("ItemParent").GetComponent <ItemParent>(); }
/// <summary> /// 角色界面中装备被点时 /// </summary> /// <param name="_typeId"></param> public void OnEquipGridUp(int _typeId) { if (!m_itemsOnEquip.ContainsKey(_typeId)) return; LoggerHelper.Debug("OnEquipGridUp:" + _typeId); ItemEquipment item = m_itemsOnEquip[_typeId]; m_selectedItem = item; List<ButtonInfo> btnList = new List<ButtonInfo>(); ButtonInfo btn; if (item.enchant != null && item.enchant.Count > 0) { btn = new ButtonInfo() { action = () => { OnFumo(_typeId); }, text = LanguageData.GetContent(1349), id = 1349 }; btnList.Add(btn); } btn = new ButtonInfo() { action = ShowItem, text = LanguageData.GetContent(903), id = 903 }; btnList.Add(btn); btn = new ButtonInfo() { action = EquipToInsetJewel, text = LanguageData.GetContent(905), id = 905 }; btnList.Add(btn); btn = new ButtonInfo() { action = StrengthEquip, text = LanguageData.GetContent(907), id = 907 }; btnList.Add(btn); //ButtonInfo btn3 = new ButtonInfo() { action = OnRemoveEquip, text = "卸下" }; //if (EquipUpgradeManager.Instance.CanUpgrade(item)) //{ // //Debug.LogError(item.effectId); // btn = new ButtonInfo() { action = OnUpGragdeEquip, text = LanguageData.GetContent(902), id = 902 }; // btnList.Add(btn); //} //btnList.Add(btn3); ShowEquipTip(item, btnList, MogoWorld.thePlayer.level, true, _typeId); //ShowEquipInfo(item); }
public void OnEquipUpgradeIconUp(int _typeId) { Mogo.Util.LoggerHelper.Debug("typeId:" + _typeId); Mogo.Util.LoggerHelper.Debug("m_currentTagIndex:" + CurrentTagIndex); if (!m_itemsInBag[CurrentTagIndex].ContainsKey(_typeId)) return; ItemParent item = m_itemsInBag[CurrentTagIndex][_typeId]; m_selectedItem = item; OnEquip(); }
private void OnActivate(ItemParent item) { List<EquipExchangeViewData> viewDataList = GetActivateViewDataList(ItemParentData.GetItem(item.templateId)); EquipExchangeUIViewManager.Instance.Show(0, viewDataList, false); EquipTipManager.Instance.CloseEquipTip(); EquipExchangeUIViewManager.Instance.SetGold(MogoWorld.thePlayer.gold + ""); EquipExchangeUIViewManager.Instance.SetMaterial(item.templateId, GetItemNumById(item.templateId) + ""); }
private void ShowEquipTipInBag(ItemParent item) { //显示选中装备tip List<ButtonInfo> btnList = new List<ButtonInfo>(); ButtonInfo btn = new ButtonInfo() { action = OnEquip, text = LanguageData.GetContent(900), id = 900 }; //显示当前装备tip int slot = (item.type == 10 ? 11 : item.type); //戒指的情况 if (item.type == (int)EquipType.Ring) { if (m_itemsOnEquip.ContainsKey(item.type) && m_itemsOnEquip.ContainsKey(item.type + 1)) { btn.text = LanguageData.GetContent(901); btn.id = 901; ItemEquipment item1 = m_itemsOnEquip.Get(item.type); ItemEquipment item2 = m_itemsOnEquip.Get(item.type + 1); ItemEquipment item3 = item1.score < item2.score ? item1 : item2; ShowCurrentEquipInfo(item3, MogoWorld.thePlayer.level); } } else//非戒指的情况 { if (m_itemsOnEquip.ContainsKey(slot)) { LoggerHelper.Debug("has equip on:" + m_itemsOnEquip[slot].templateId); btn.text = LanguageData.GetContent(901); btn.id = 901; ShowCurrentEquipInfo(m_itemsOnEquip[slot], MogoWorld.thePlayer.level); } } btnList.Add(btn); //Debug.LogError(item.effectId); //装备升级 if (EquipUpgradeManager.Instance.CanUpgrade(item)) { //Debug.LogError(item.effectId); btn = new ButtonInfo() { action = OnUpGragdeEquip, text = LanguageData.GetContent(902), id = 902 }; btnList.Add(btn); } btn = new ButtonInfo() { action = ShowItem, text = LanguageData.GetContent(903), id = 903 }; btnList.Add(btn); //btn = new ButtonInfo() { action = OnDecompose, text = LanguageData.GetContent(904), id = 904 }; //btnList.Add(btn); ShowEquipTip((ItemEquipment)item, btnList, MogoWorld.thePlayer.level); LoggerHelper.Debug("ShowEquipTip done"); }
private void ShowPropTip(ItemParent item) { ItemMaterial material = (ItemMaterial)item; string stack = ""; if (material.maxStack > 1) { stack = material.stack + "/" + material.maxStack + ""; //view.SetPropTipStack(material.stack + "/" + material.maxStack + ""); } List<ButtonInfo> btnList = new List<ButtonInfo>(); ButtonInfo btn; if (CanMaterialExchangeEquip(item)) { btn = new ButtonInfo() { action = () => { OnExchangeEquip(item); }, id = 899, text = LanguageData.GetContent(899) }; btnList.Add(btn); } //激活套装材料 if (item.type == 8) { btn = new ButtonInfo() { action = () => { OnActivate(item); }, id = 899, text = LanguageData.GetContent(899) }; btnList.Add(btn); } if (material.effectId > 0 && material.type != 8) { btn = new ButtonInfo() { action = OnPropUse, text = LanguageData.GetContent(909), id = 909 }; btnList.Add(btn); } if (material.price > 0) { btn = new ButtonInfo() { action = OnMaterialTipSell, text = LanguageData.GetContent(908), id = 908 }; btnList.Add(btn); } ShowPropTip(item.templateId, btnList, stack); }
public void ShowCurrentEquipInfo(ItemParent item, int _level) { ItemEquipment equip = (ItemEquipment)item; EquipTipViewData data = GetEquipInfoByItem(equip, _level); //MenuUIViewManager view = MenuUIViewManager.Instance; EquipTipManager view = EquipTipManager.Instance; //界面静态部分 view.SetEquipDetailInfoImageCurrent(data.iconName); view.ShowEquipDetailInfoImageUsedCurrent(data.isEquipOn); view.SetEquipDetailInfoNameCurrent(data.name); view.SetEquipDetailInfoImageBgCurrent(IconData.GetIconByQuality(equip.quality)); view.SetEquipDetailInfoScoreNumCurrent(equip.score); //界面动态排版部分 List<string> attrList = equip.GetAttrDescriptionList(_level); List<string> jewelList = new List<string>(); foreach (string s in data.jewelHoles) { if (s == "") continue; jewelList.Add(s); } string suitName = ""; List<string> suitAttr = new List<string>(); if (equip.suitId > 0 && equip.isActive) { suitName = ItemSuitEquipmentsData.GetSuitName(equip.suitId); int suitPutOnNum = GetSuitPutonNum(equip.suitId); int suitMaxNum = ItemSuitEquipmentsData.GetSuitMaxNum(equip.suitId); suitName = String.Concat(suitName, "(", suitPutOnNum, "/", suitMaxNum, ")"); suitAttr = ItemSuitEquipmentsData.GetSuitAttrList(equip.suitId, suitPutOnNum); } string levelDesp = equip.levelDesp; view.SetEquipDetailInfoLevelTextCurrent(levelDesp); string vocation = LanguageData.dataMap[equip.vocation].content; if (equip.vocation != (int)MogoWorld.thePlayer.vocation) { vocation = string.Concat("[ff0000]", vocation, "[-]"); } view.ShowEquipTipCurrent(suitName, suitAttr, attrList, jewelList, data.jewelSlotIcons, vocation, null); }
public bool CanUpgrade(ItemParent item) { return(item.effectId > 0); }
private void Equip() { //LoggerHelper.Debug("Equip:" + this.m_selectedItem.templateId); ItemEquipment selectedItem = (ItemEquipment)this.m_selectedItem; Mogo.Util.LoggerHelper.Debug("selectedItem.templateId:" + selectedItem.templateId); m_itemsInBag[ITEM_TYPE_EQUIPMENT].Remove(selectedItem.gridIndex); MenuUILogicManager.Instance.RemoveInventoryGridItem(selectedItem.gridIndex); if (selectedItem.type == (sbyte)EquipType.Weapon) { selectedItem.gridIndex = 11; } else { selectedItem.gridIndex = selectedItem.type; } if (m_itemsOnEquip.ContainsKey(selectedItem.gridIndex)) { ItemEquipment old = m_itemsOnEquip[selectedItem.gridIndex]; m_selectedItem = old; OnRemoveEquip(); } //else //{ //} //这里temp++暂时处理 m_itemsOnEquip[selectedItem.gridIndex] = (ItemEquipment)selectedItem; selectedItem.bagType = ITEM_TYPE_ONEQUIP; MenuUIViewManager.Instance.ShowPackageDetailInfo(false); MenuUIViewManager.Instance.ShowPacakgeCurrentDetailInfo(false); myself.Equip(selectedItem.templateId); m_versionId++; RefreshUI(); //myself.RpcCall("JewelAddEquiReq", selectedItem.templateId); }
private void ShowMaterialTip(ItemParent item) { //Debug.LogError("ShowMaterialTip:" + item.id); ItemMaterial material = (ItemMaterial)item; List<ButtonInfo> btnList = new List<ButtonInfo>(); ButtonInfo btn; if (material.type == 1) { btn = new ButtonInfo() { action = OnMaterialTipEnhance, text = LanguageData.GetContent(907), id = 907 }; btnList.Add(btn); } if (CanMaterialExchangeEquip(item)) { btn = new ButtonInfo() { action = () => { OnExchangeEquip(item); }, id = 899, text = LanguageData.GetContent(899) }; btnList.Add(btn); } if (material.price > 0) { btn = new ButtonInfo() { action = OnMaterialTipSell, text = LanguageData.GetContent(908), id = 908 }; btnList.Add(btn); } ShowMaterialTip(material.templateId, btnList, material.stack, material.maxStack); }
private bool CanMaterialExchangeEquip(ItemParent item) { return item.type == 9; }