private void UpdateUpgradeContent() { WingData wd = tipData; WingLevelData wld = wd.GetLevelData(m_wings[wd.id].level); WingLevelData wnld = wd.GetLevelData(m_wings[wd.id].level + 1); WingUIViewManager.Instance.SetWingTipTitle(LanguageData.GetContent(wd.name)); List <string> attrs = wld.GetPropertEffect(); List <string> nextAttrs = null; if (wnld != null) { nextAttrs = wnld.GetPropertEffect(); WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogCost("x" + wnld.trainDiamondCost); WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogNextLevel(LanguageData.GetContent(200005, wnld.level)); } WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogCurrentLevel(LanguageData.GetContent(200005, wld.level)); WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogIcon(IconData.GetIconPath(wd.icon)); WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogTitle(LanguageData.GetContent(wd.name)); Wing w = m_wings[wd.id]; float p = 0; if (wld.nextLevelExp == 0) { p = 1; WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogProgressText(w.exp + "/" + w.exp); } else { p = (float)w.exp / (float)wld.nextLevelExp; WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogProgressText(w.exp + "/" + wld.nextLevelExp); } WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogProgressSize(p); for (int i = 0; i < attrs.Count; i++) { WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogCurrentAttr(attrs[i], i); if (nextAttrs != null) { WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogNextAttr(nextAttrs[i], i); } else { WingUIUpgradeDialogLogicManager.Instance.SetUpgradeDialogNextAttr("", i); } } WingUIUpgradeDialogLogicManager.Instance.SetUIDirty(); }
private void UpdateProperty() { WingProperty wp = new WingProperty(); foreach (var item in m_wings) { WingData d = WingData.dataMap.Get(item.Value.id); WingLevelData wld = d.GetLevelData(item.Value.level); PropertyEffectData p = wld.GetProperEffectData(); wp.AddProperty(p); } List <string> attrs = wp.GetPropertEffect(); WingUILogicManager.Instance.SetWingAttribute(attrs); }
private void Preview(MarketItem data) { preview = data; int id = ItemEffectData.dataMap[ItemMaterialData.dataMap[data.resData.itemId].effectId].reward1[13]; m_myself.PreviewWing(id); WingData d = WingData.dataMap.Get(id); WingLevelData ld = d.GetLevelData(1); List <string> attrs = ld.GetPropertEffect(); WingUIPreviewInMarketUILogicManager.Instance.SetTitle(LanguageData.GetContent(d.name)); WingUIPreviewInMarketUILogicManager.Instance.SetTipAttr(attrs); WingUIPreviewInMarketUILogicManager.Instance.SetWingAttr(attrs); WingUIPreviewInMarketUILogicManager.Instance.SetUIDirty(); MFUIManager.GetSingleton().SwitchUIWithLoad(MFUIManager.MFUIID.WingPreviewInMarketUI); }
private void OpenBuy(int id, int diamond) { int iid = ItemEffectData.dataMap[ItemMaterialData.dataMap[id].effectId].reward1[13];//13是reward1中的翅膀类型 MFUIManager.GetSingleton().SwitchUIWithLoad(MFUIManager.MFUIID.WingUIBuyDialog, MFUIManager.MFUIID.None, 0, true); WingData d = WingData.dataMap.Get(iid); WingLevelData ld = d.GetLevelData(1); WingUIBuyDialogLogicManager.Instance.SetBuyDialodTitle(LanguageData.GetContent(d.name)); List <string> attrs = ld.GetPropertEffect(); for (int i = 0; i < attrs.Count; i++) { WingUIBuyDialogLogicManager.Instance.SetBuyDialogAttr(attrs[i], i); } WingUIBuyDialogLogicManager.Instance.SetBuyDialogCost(" " + diamond); WingUIBuyDialogLogicManager.Instance.SetBuyDialogIcon(IconData.dataMap.Get(ItemMaterialData.dataMap[id].icon).path); WingUIBuyDialogLogicManager.Instance.SetUIDirty(); }
private void OpenTip(int idx) { WingGridData d = m_grids[idx]; if (page == 0) { d = m_common[idx]; } else if (page == 1) { d = m_magic[idx]; } m_self.PreviewWing(d.wingId); WingData wd = WingData.dataMap.Get(d.wingId); tipData = wd; WingLevelData wld = wd.GetLevelData(1); WingLevelData wnld = wd.GetLevelData(2); if (m_wings.ContainsKey(wd.id)) { wld = wd.GetLevelData(m_wings[wd.id].level); wnld = wd.GetLevelData(m_wings[wd.id].level + 1); } if (m_wings.ContainsKey(d.wingId)) { WingUIViewManager.Instance.ShowTipUpgradeBtn(wd.type == 1); if (wd.type == 1) { WingUIViewManager.Instance.ShowTipBuyBtn(d.wingId != dressed); } else { WingUIViewManager.Instance.ShowTipBuyBtn(d.wingId != dressed && d.IsActive); } WingUIViewManager.Instance.SetBuyText(LanguageData.GetContent(47281)); } else { WingUIViewManager.Instance.ShowTipUpgradeBtn(false); WingUIViewManager.Instance.ShowTipBuyBtn(false); //wd.type == 1); WingUIViewManager.Instance.SetBuyText(LanguageData.GetContent(1026)); } WingUIViewManager.Instance.SetWingTipTitle(LanguageData.GetContent(wd.name)); List <string> attrs = wld.GetPropertEffect(); PropertyEffectData a = wld.GetProperEffectData(); List <string> nextAttrs = null; if (wnld != null) { nextAttrs = wnld.GetPropertEffect(); } for (int i = 0; i < attrs.Count; i++) { WingUIViewManager.Instance.SetWingTipAttrDescripe("", i); WingUIViewManager.Instance.SetWingTipCurAttr(attrs[i], i); if (nextAttrs != null) { WingUIViewManager.Instance.SetWingTipNextAttr(nextAttrs[i], i); } else { WingUIViewManager.Instance.SetWingTipNextAttr("", i); } } }