public override void UpdateUI() { SetInputSubmitEvent((Enum)UI.IPT_POST, new EventDelegate(delegate { OnTouchPost(); })); SetActive((Enum)UI.OBJ_TARGET, true); SetActive((Enum)UI.OBJ_OWNER, false); SetInputValue((Enum)UI.IPT_POST, base.sectionData.GetText("TEXT_HELP")); SetInputLabel((Enum)UI.IPT_POST, base.sectionData.GetText("TEXT_HELP")); SetLabelText((Enum)UI.LBL_USER_NAME, MonoBehaviourSingleton <UserInfoManager> .I.userInfo.name); SetLabelText((Enum)UI.LBL_MATERIAL_NAME, data.GetName()); SetLabelText(UI.LBL_QUATITY, data.GetNum()); SetLabelText(UI.LBL_DONATE_NUM, data.GetNum()); SetLabelText(UI.LBL_DONATE_MAX, needNum); SetButtonEnabled((Enum)UI.BTN_GIFT, false); SetSliderValue((Enum)UI.SLD_PROGRESS, (float)data.GetNum() / (float)needNum); Transform ctrl = GetCtrl(UI.OBJ_MATERIAL_ICON); Item item = new Item(); item.uniqId = "0"; item.itemId = (int)data.GetTableID(); item.num = data.GetNum(); ItemInfo item2 = ItemInfo.CreateItemInfo(item); ItemSortData itemSortData = new ItemSortData(); itemSortData.SetItem(item2); SetItemIcon(ctrl, itemSortData, ctrl); }
private void InitGuildDonateInvite(int index, Transform t) { DonateInvitationInfo info = guildDonateInvites[index]; if (MonoBehaviourSingleton <GuildManager> .I.guildData.emblem != null && MonoBehaviourSingleton <GuildManager> .I.guildData.emblem.Length >= 3) { SetSprite(t, UI.SPR_EMBLEM_LAYER_1, GuildItemManager.I.GetItemSprite(MonoBehaviourSingleton <GuildManager> .I.guildData.emblem[0])); SetSprite(t, UI.SPR_EMBLEM_LAYER_2, GuildItemManager.I.GetItemSprite(MonoBehaviourSingleton <GuildManager> .I.guildData.emblem[1])); SetSprite(t, UI.SPR_EMBLEM_LAYER_3, GuildItemManager.I.GetItemSprite(MonoBehaviourSingleton <GuildManager> .I.guildData.emblem[2])); } else { SetSprite(t, UI.SPR_EMBLEM_LAYER_1, string.Empty); SetSprite(t, UI.SPR_EMBLEM_LAYER_2, string.Empty); SetSprite(t, UI.SPR_EMBLEM_LAYER_3, string.Empty); } double num = info.expired / 1000.0 - DateTimeToTimestampSeconds(); if (!(num < 1.0) && info.itemNum < info.quantity) { int itemNum = MonoBehaviourSingleton <InventoryManager> .I.GetItemNum((ItemInfo x) => x.tableData.id == info.itemId, 1, false); bool flag = info.itemNum >= info.quantity; SetLabelText(t, UI.LBL_CHAT_MESSAGE, info.msg); SetLabelText(t, UI.LBL_USER_NAME, info.nickName); SetLabelText(t, UI.LBL_MATERIAL_NAME, info.itemName); SetLabelText(t, UI.LBL_QUATITY, itemNum); SetLabelText(t, UI.LBL_DONATE_NUM, info.itemNum); SetLabelText(t, UI.LBL_DONATE_MAX, info.quantity); SetSliderValue(t, UI.SLD_PROGRESS, (float)info.itemNum / (float)info.quantity); if (!flag && itemNum > 0 && info.itemNum < info.quantity) { SetButtonEvent(t, UI.BTN_GIFT, new EventDelegate(delegate { DispatchEvent("SEND_GUILD_DONATE", info.ParseDonateInfo()); })); } else { SetButtonEnabled(t, UI.BTN_GIFT, false); } Transform val = FindCtrl(t, UI.OBJ_MATERIAL_ICON); Item item = new Item(); item.uniqId = "0"; item.itemId = info.itemId; item.num = info.itemNum; ItemInfo item2 = ItemInfo.CreateItemInfo(item); ItemSortData itemSortData = new ItemSortData(); itemSortData.SetItem(item2); SetItemIcon(val, itemSortData, val); } }
public override void UpdateUI() { SetActive((Enum)UI.STR_NON_LIST, _donateList.Count <= 0); SetTable(UI.TBL_QUEST, "GuildDonateInvitationListItem", _donateList.Count, true, (int i, Transform t) => null, delegate(int i, Transform t, bool b) { GuildDonateInvitationList guildDonateInvitationList = this; DonateInvitationInfo info = _donateList[i]; int itemNum = MonoBehaviourSingleton <InventoryManager> .I.GetItemNum((ItemInfo x) => x.tableData.id == info.itemId, 1, false); bool flag = info.itemNum >= info.quantity; SetActive(t, UI.OBJ_FULL, flag); SetActive(t, UI.OBJ_NORMAL, !flag); SetLabelText((Enum)UI.LBL_CHAT_MESSAGE, info.msg); SetLabelText((Enum)UI.LBL_USER_NAME, info.nickName); SetLabelText((Enum)UI.LBL_MATERIAL_NAME, info.itemName); SetLabelText(UI.LBL_QUATITY, itemNum); SetLabelText(UI.LBL_DONATE_NUM, info.itemNum); SetLabelText(UI.LBL_DONATE_MAX, info.quantity); SetSliderValue((Enum)UI.SLD_PROGRESS, (float)info.itemNum / (float)info.quantity); if (!flag && itemNum > 0 && info.itemNum < info.quantity) { SetButtonEvent(t, UI.BTN_GIFT, new EventDelegate(delegate { guildDonateInvitationList.DispatchEvent("SEND", info.ParseDonateInfo()); })); } else { SetButtonEnabled(t, UI.BTN_GIFT, false); } Transform ctrl = GetCtrl(UI.OBJ_MATERIAL_ICON); ItemInfo item = ItemInfo.CreateItemInfo(new Item { uniqId = "0", itemId = info.itemId, num = info.itemNum }); ItemSortData itemSortData = new ItemSortData(); itemSortData.SetItem(item); SetItemIcon(ctrl, itemSortData, ctrl); }); }