public void ExcuteTicket(int itemunique, int recruittype, int season, bool bForceRecruit) { int solCount = SolRecruitDlg.GetSolCount(recruittype); if (!bForceRecruit) { NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList(); if (readySolList == null || readySolList.GetCount() + solCount - 1 >= 100) { string textFromNotify = NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("507"); Main_UI_SystemMessage.ADDMessage(textFromNotify, SYSTEM_MESSAGE_TYPE.NORMAL_MESSAGE); return; } } if (NkUserInventory.GetInstance().GetFirstItemByUnique(itemunique) == null) { string textFromNotify2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("506"); Main_UI_SystemMessage.ADDMessage(textFromNotify2, SYSTEM_MESSAGE_TYPE.NORMAL_MESSAGE); return; } NrTSingleton <NkClientLogic> .Instance.SetCanOpenTicket(false); this.SetRecruitButtonEnable(false); GS_SOLDIER_RECRUIT_REQ gS_SOLDIER_RECRUIT_REQ = default(GS_SOLDIER_RECRUIT_REQ); gS_SOLDIER_RECRUIT_REQ.ItemUnique = itemunique; gS_SOLDIER_RECRUIT_REQ.RecruitType = recruittype; gS_SOLDIER_RECRUIT_REQ.SubData = 0; SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_SOLDIER_RECRUIT_REQ, gS_SOLDIER_RECRUIT_REQ); }
private void ClickTicketSellInfo(IUIObject obj) { if (obj == null || obj.Data == null) { return; } if (this.m_fRequestTime > 0f && Time.time - this.m_fRequestTime < 1f) { string textFromNotify = NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("508"); Main_UI_SystemMessage.ADDMessage(textFromNotify, SYSTEM_MESSAGE_TYPE.NORMAL_MESSAGE); return; } int solCount = SolRecruitDlg.GetSolCount(7); NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList(); if (readySolList == null || readySolList.GetCount() + solCount - 1 >= 100) { string textFromNotify2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("507"); Main_UI_SystemMessage.ADDMessage(textFromNotify2, SYSTEM_MESSAGE_TYPE.NORMAL_MESSAGE); return; } int num = (int)obj.Data; TICKET_SELL_INFO ticketSellInfo = this.GetTicketSellInfo(num); if (ticketSellInfo == null) { return; } string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1699"); string textFromMessageBox = NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("127"); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref textFromMessageBox, new object[] { textFromMessageBox, "count", ticketSellInfo.i32HeartsNum }); MsgBoxUI msgBoxUI = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.MSGBOX_DLG) as MsgBoxUI; if (msgBoxUI != null) { msgBoxUI.SetMsg(new YesDelegate(this.MsgBoxOKTicketSellInfo), num, null, null, textFromInterface, textFromMessageBox, eMsgType.MB_OK_CANCEL); } this.m_fRequestTime = Time.time; this.m_fScrollPosition = this.m_TicketList.ScrollPosition; }
public override void SetTicketList() { COMMON_CONSTANT_Manager instance = COMMON_CONSTANT_Manager.GetInstance(); if (instance == null) { Debug.LogError("ERROR, SolRecruitDlg_ChallengeQuest.cs, SetTicketList(), pkConstant is null"); return; } string text = string.Empty; string empty = string.Empty; this.m_TicketList.Clear(); if (!NrTSingleton <ContentsLimitManager> .Instance.IsLegendHire()) { text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2862"); NewListItem newListItem = new NewListItem(this.m_TicketList.ColumnNum, true, string.Empty); int value = instance.GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_ESSENCE_ITEMUNIQUE); int needItemNum = SolRecruitDlg.GetNeedItemNum(13); newListItem.SetListItemData(1, NrTSingleton <ItemManager> .Instance.GetItemTexture(value), null, null, null); newListItem.SetListItemEnable(3, true); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[] { text, "targetname", NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(value), "count1", needItemNum, "count2", SolRecruitDlg.GetSolCount(13) }); newListItem.SetListItemData(2, empty, null, null, null); newListItem.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("573"), eSolRecruitType.SOLRECRUIT_ESSENCE_ONE, new EZValueChangedDelegate(this.ClickTicketList), null); newListItem.SetListItemData(4, false); newListItem.SetListItemData(6, false); newListItem.Data = eSolRecruitType.SOLRECRUIT_ESSENCE_ONE; this.m_TicketList.Add(newListItem); } this.m_TicketList.RepositionItems(); }
public virtual void SetTicketList() { COMMON_CONSTANT_Manager instance = COMMON_CONSTANT_Manager.GetInstance(); if (instance == null) { return; } string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2016"); string empty = string.Empty; this.m_TicketList.Clear(); if (!NrTSingleton <ContentsLimitManager> .Instance.IsLegendHire()) { textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2862"); NewListItem newListItem = new NewListItem(this.m_TicketList.ColumnNum, true, string.Empty); int value = instance.GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_ESSENCE_ITEMUNIQUE); int needItemNum = SolRecruitDlg.GetNeedItemNum(13); ITEM item = NkUserInventory.GetInstance().GetItem(value); if (item != null) { newListItem.SetListItemData(1, item, null, null, null); if (item.m_nItemNum >= needItemNum) { newListItem.SetListItemEnable(3, true); } else { newListItem.SetListItemEnable(3, false); } } else { newListItem.SetListItemData(1, NrTSingleton <ItemManager> .Instance.GetItemTexture(value), null, null, null); newListItem.SetListItemEnable(3, false); } NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[] { textFromInterface, "targetname", NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(value), "count1", needItemNum, "count2", SolRecruitDlg.GetSolCount(13) }); newListItem.SetListItemData(2, empty, null, null, null); newListItem.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("573"), eSolRecruitType.SOLRECRUIT_ESSENCE_ONE, new EZValueChangedDelegate(this.ClickTicketList), null); newListItem.SetListItemData(4, false); newListItem.SetListItemData(6, false); newListItem.Data = eSolRecruitType.SOLRECRUIT_ESSENCE_ONE; this.m_TicketList.Add(newListItem); } this.AddTicketSellInfo(); List <ITEM> functionItemsByInvenType = NkUserInventory.instance.GetFunctionItemsByInvenType(6, eITEM_SUPPLY_FUNCTION.SUPPLY_GETSOLDIER); foreach (ITEM current in functionItemsByInvenType) { if (NrTSingleton <ItemManager> .Instance.IsItemATB(current.m_nItemUnique, 2048L)) { NewListItem newListItem2 = new NewListItem(this.m_TicketList.ColumnNum, true, string.Empty); string name = NrTSingleton <ItemManager> .Instance.GetName(current); newListItem2.SetListItemData(1, current, null, null, null); newListItem2.SetListItemData(2, name, null, null, null); newListItem2.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("573"), current, new EZValueChangedDelegate(this.ClickTicketList), null); newListItem2.SetListItemData(4, false); newListItem2.SetListItemData(5, string.Empty, current.m_nItemID, new EZValueChangedDelegate(this.ClickTicketItemToolTip), null); newListItem2.SetListItemData(6, false); newListItem2.Data = current.m_nItemUnique; this.m_TicketList.Add(newListItem2); } } foreach (ITEM current2 in functionItemsByInvenType) { if (!NrTSingleton <ItemManager> .Instance.IsItemATB(current2.m_nItemUnique, 2048L)) { NewListItem newListItem3 = new NewListItem(this.m_TicketList.ColumnNum, true, string.Empty); string name2 = NrTSingleton <ItemManager> .Instance.GetName(current2); newListItem3.SetListItemData(1, current2, null, null, null); newListItem3.SetListItemData(2, name2, null, null, null); newListItem3.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("573"), current2, new EZValueChangedDelegate(this.ClickTicketList), null); newListItem3.SetListItemData(4, false); newListItem3.SetListItemData(5, string.Empty, current2.m_nItemID, new EZValueChangedDelegate(this.ClickTicketItemToolTip), null); newListItem3.SetListItemData(6, false); this.m_TicketList.Add(newListItem3); } } this.m_TicketList.RepositionItems(); this.SetLastSelectItemScrol(); }