public void Load_ServerValue(TIMESHOP_SERVERDATA _pData) { if (_pData == null) { return; } if (_pData.i8Type > 1) { return; } if (!this.m_dicTimeshopData.ContainsKey(_pData.i8Type)) { return; } if (this.m_dicTimeshopData[_pData.i8Type].ContainsKey(_pData.i64Idx)) { this.m_dicTimeshopData[_pData.i8Type][_pData.i64Idx].m_nMoneyType = _pData.i32MoneyType; this.m_dicTimeshopData[_pData.i8Type][_pData.i64Idx].m_fRate = (float)_pData.i32Rate; this.m_dicTimeshopData[_pData.i8Type][_pData.i64Idx].m_lPrice = _pData.i64Price; this.m_dicTimeshopData[_pData.i8Type][_pData.i64Idx].m_nItemUnique = _pData.i32ItemUnique; this.m_dicTimeshopData[_pData.i8Type][_pData.i64Idx].m_lItemNum = _pData.i64ItemNum; } else { TIMESHOP_DATA tIMESHOP_DATA = new TIMESHOP_DATA(); tIMESHOP_DATA.m_lIdx = _pData.i64Idx; tIMESHOP_DATA.m_byType = _pData.i8Type; tIMESHOP_DATA.m_nMoneyType = _pData.i32MoneyType; tIMESHOP_DATA.m_fRate = (float)_pData.i32Rate; tIMESHOP_DATA.m_lPrice = _pData.i64Price; tIMESHOP_DATA.m_nItemUnique = _pData.i32ItemUnique; tIMESHOP_DATA.m_lItemNum = _pData.i64ItemNum; this.m_dicTimeshopData[_pData.i8Type].Add(_pData.i64Idx, tIMESHOP_DATA); } }
public override bool ParseDataFromNDT(TsDataReader dr) { NrTSingleton <NrTableTimeShopManager> .Instance.Clear_DataValue(); foreach (TsDataReader.Row data in dr) { TIMESHOP_DATA tIMESHOP_DATA = new TIMESHOP_DATA(); tIMESHOP_DATA.SetData(data); NrTSingleton <NrTableTimeShopManager> .Instance.Set_DataValue(tIMESHOP_DATA); } return(true); }
private void Click_Buy(IUIObject _obj) { TIMESHOP_DATA tIMESHOP_DATA = _obj.Data as TIMESHOP_DATA; if (tIMESHOP_DATA == null) { return; } int num = this.Get_ItemIndex(tIMESHOP_DATA.m_lIdx); if (num < 0) { return; } if (num > (int)(this.m_i8SlotCount - 1)) { byte vipLevelByTimeShopCount = NrTSingleton <NrTableVipManager> .Instance.GetVipLevelByTimeShopCount((byte)(num + 1)); LackGold_dlg lackGold_dlg = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.GOLDLACK_DLG) as LackGold_dlg; if (lackGold_dlg != null) { lackGold_dlg.SetDataTimeShop((int)vipLevelByTimeShopCount); } return; } if (!this.CanBuyItemByMoneyType((eTIMESHOP_MONEYTYPE)this.m_dicTimeShopItem[num].m_nMoneyType, this.m_dicTimeShopItem[num].m_lPrice)) { return; } string textFromMessageBox = NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("78"); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref textFromMessageBox, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("78"), "targetname", NrTSingleton <NrTextMgr> .Instance.GetTextFromItem(tIMESHOP_DATA.m_strProductTextKey) }); MsgBoxUI msgBoxUI = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.MSGBOX_DLG) as MsgBoxUI; if (msgBoxUI != null) { msgBoxUI.SetMsg(new YesDelegate(this.Request_Buy), num, string.Empty, textFromMessageBox, eMsgType.MB_OK_CANCEL, 2); } }
public void Set_DataValue(TIMESHOP_DATA _pData) { if (_pData == null) { return; } if (this.m_dicTimeshopData.ContainsKey(_pData.m_byType)) { if (!this.m_dicTimeshopData[_pData.m_byType].ContainsKey(_pData.m_lIdx)) { this.m_dicTimeshopData[_pData.m_byType].Add(_pData.m_lIdx, _pData); } } else { this.m_dicTimeshopData.Add(_pData.m_byType, new Dictionary <long, TIMESHOP_DATA>()); this.m_dicTimeshopData[_pData.m_byType].Add(_pData.m_lIdx, _pData); } }
private void Click_ToolTip(IUIObject _obj) { TIMESHOP_DATA tIMESHOP_DATA = _obj.Data as TIMESHOP_DATA; if (tIMESHOP_DATA == null) { return; } int num = this.Get_ItemIndex(tIMESHOP_DATA.m_lIdx); if (num < 0) { return; } ItemMallProductDetailDlg itemMallProductDetailDlg = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.ITEMMALL_PRODUCTDETAIL_DLG) as ItemMallProductDetailDlg; if (itemMallProductDetailDlg == null) { return; } itemMallProductDetailDlg.SetTimeShopItem(tIMESHOP_DATA, num); itemMallProductDetailDlg.SetButtonEvent(new FunDelegate(this.Click_Buy)); itemMallProductDetailDlg.AddBlackBgClickCloseForm(); }
public void Set_ItemList() { if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo == null) { return; } List <TIMESHOP_ITEMINFO> userTimeShopItemList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.Get_UserTimeShopItemList(); if (userTimeShopItemList == null) { return; } int value; if (NrTSingleton <ContentsLimitManager> .Instance.IsVipExp()) { this.m_i8SlotCount = (byte)COMMON_CONSTANT_Manager.GetInstance().GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_TIMESHOP_MIN_SLOTCOUNT); value = COMMON_CONSTANT_Manager.GetInstance().GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_TIMESHOP_MIN_SLOTCOUNT); } else { this.m_i8SlotCount = NrTSingleton <NrTableVipManager> .Instance.GetTimeShopCountByVipLevel(this.m_i8VipLevel); value = COMMON_CONSTANT_Manager.GetInstance().GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_TIMESHOP_TYPE_SLOTNUM); } this.m_nlbItemList.Clear(); this.m_dicTimeShopItem.Clear(); for (int i = 0; i < userTimeShopItemList.Count; i++) { byte byType; if (i < value - 1) { byType = 0; } else { byType = 1; } TIMESHOP_DATA tIMESHOP_DATA = NrTSingleton <NrTableTimeShopManager> .Instance.Get_TimeShopDataByIDX(byType, userTimeShopItemList[i].i64IDX); if (tIMESHOP_DATA != null) { NewListItem newListItem = new NewListItem(this.m_nlbItemList.ColumnNum, true, string.Empty); newListItem.SetListItemData(1, NrTSingleton <NrTextMgr> .Instance.GetTextFromItem(tIMESHOP_DATA.m_strProductTextKey), null, null, null); newListItem.SetListItemData(3, tIMESHOP_DATA.m_strIconPath, true, null, null); string empty = string.Empty; NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3335"), "itemname", NrTSingleton <NrTextMgr> .Instance.GetTextFromItem(tIMESHOP_DATA.m_strProductTextKey), "itemnum", tIMESHOP_DATA.m_lItemNum }); newListItem.SetListItemData(4, empty, null, null, null); newListItem.SetListItemData(5, string.Empty, tIMESHOP_DATA, new EZValueChangedDelegate(this.Click_Buy), null); UIBaseInfoLoader loader = NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary(NrTSingleton <NrTableTimeShopManager> .Instance.Get_MoneyTypeTextureName((eTIMESHOP_MONEYTYPE)tIMESHOP_DATA.m_nMoneyType)); newListItem.SetListItemData(6, loader, null, null, null); newListItem.SetListItemData(7, tIMESHOP_DATA.m_lPrice.ToString(), null, null, null); newListItem.SetListItemData(9, string.Empty, tIMESHOP_DATA, new EZValueChangedDelegate(this.Click_ToolTip), null); newListItem.SetListItemData(14, false); newListItem.SetListItemData(15, NrTSingleton <NrTableTimeShopManager> .Instance.IsRecommend(byType, tIMESHOP_DATA.m_lIdx)); newListItem.SetListItemData(16, false); newListItem.SetListItemData(17, false); newListItem.SetListItemData(19, false); if (tIMESHOP_DATA.m_lDisplayPrice > 0L) { newListItem.SetListItemData(7, false); newListItem.SetListItemData(12, tIMESHOP_DATA.m_lDisplayPrice.ToString(), null, null, null); newListItem.SetListItemData(13, tIMESHOP_DATA.m_lPrice.ToString(), null, null, null); newListItem.SetListItemData(14, true); } if (i <= (int)(this.m_i8SlotCount - 1)) { if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.IsBuy_TimeShopItemByIDX(tIMESHOP_DATA.m_lIdx)) { newListItem.SetListItemEnable(5, false); newListItem.SetListItemData(5, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3341"), null, null, null); newListItem.SetListItemData(6, false); newListItem.SetListItemData(7, false); newListItem.SetListItemData(12, false); newListItem.SetListItemData(13, false); newListItem.SetListItemData(14, false); newListItem.SetListItemData(19, true); } } else { if (NrTSingleton <ContentsLimitManager> .Instance.IsVipExp()) { goto IL_3E0; } newListItem.SetListItemData(16, true); newListItem.SetListItemData(17, true); string empty2 = string.Empty; NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty2, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3304"), "level", NrTSingleton <NrTableVipManager> .Instance.GetVipLevelByTimeShopCount((byte)(i + 1)).ToString() }); newListItem.SetListItemData(18, empty2, null, null, null); } newListItem.Data = i; this.m_nlbItemList.Add(newListItem); this.m_dicTimeShopItem.Add(i, tIMESHOP_DATA); } IL_3E0 :; } this.m_nlbItemList.RepositionItems(); }
public void SetTimeShopItem(TIMESHOP_DATA _pTimeShopItem, int _i32CharKind) { if (_pTimeShopItem == null) { return; } this.m_DrawTexture_Won.SetTexture(NrTSingleton <NrTableTimeShopManager> .Instance.Get_MoneyTypeTextureName((eTIMESHOP_MONEYTYPE)_pTimeShopItem.m_nMoneyType)); this.m_Label_Price.Text = _pTimeShopItem.m_lPrice.ToString(); this.m_Button_Price.Data = _pTimeShopItem; this.m_Label_Price.Visible = true; this.m_Button_Price.Visible = true; this.m_DrawTexture_Won.Visible = true; if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.IsBuy_TimeShopItemByIDX(_pTimeShopItem.m_lIdx)) { this.m_Button_Price.SetEnabled(false); this.m_Label_Price.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3341"); this.m_DrawTexture_Won.Visible = false; } byte b = 6; int level = 50; string strSolKind = string.Empty; NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(_i32CharKind); if (charKindInfo != null) { strSolKind = charKindInfo.GetCode(); } ITEMINFO itemInfo = NrTSingleton <ItemManager> .Instance.GetItemInfo(_pTimeShopItem.m_nItemUnique); if (itemInfo != null) { b = (byte)(itemInfo.m_nParam[1] + 1); if (b <= 1) { b = NrTSingleton <ItemManager> .Instance.GetTopGrade_GroupSolTicket((long)_pTimeShopItem.m_nItemUnique, strSolKind); } if (b > 15) { b = 15; } } else { List <SOL_GUIDE> value = NrTSingleton <NrTableSolGuideManager> .Instance.GetValue(); foreach (SOL_GUIDE current in value) { if (current.m_i32CharKind == _i32CharKind) { b = (byte)current.m_iSolGrade; } } } if (charKindInfo != null) { level = (int)charKindInfo.GetGradeMaxLevel((short)(b - 1)); } this.SetSolKind(_i32CharKind, b, level); this.m_eParentUI = G_ID.TIMESHOP_DLG; }
public void SetTimeShopItem(TIMESHOP_DATA _pData, int _nIndex) { if (_pData == null) { return; } this.m_pTimeShopItem = _pData; this.m_lbProductName.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromItem(_pData.m_strProductTextKey); if (_pData.m_strItemToolTip.Equals("0")) { this.m_lbDecription.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromItemHelper(_pData.m_nItemUnique.ToString()); } else { this.m_lbDecription.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(_pData.m_strItemToolTip); } this.m_dtProductImg.SetFadeTextureFromBundle(_pData.m_strIconPath); this.m_lbPrice.Text = _pData.m_lPrice.ToString(); this.m_btPrice.Data = _pData; this.m_btPrice.AddValueChangedDelegate(new EZValueChangedDelegate(this.OnClicked)); this.m_dt_won.SetTexture(NrTSingleton <NrTableTimeShopManager> .Instance.Get_MoneyTypeTextureName((eTIMESHOP_MONEYTYPE)_pData.m_nMoneyType)); if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.IsBuy_TimeShopItemByIDX(_pData.m_lIdx)) { this.m_btPrice.SetEnabled(false); this.m_lbPrice.Text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3341"); this.m_dt_won.Visible = false; } eTIMESHOP_TYPE type_ByIDX = NrTSingleton <NrTableTimeShopManager> .Instance.GetType_ByIDX(_pData.m_lIdx); if (NrTSingleton <NrTableTimeShopManager> .Instance.IsRecommend((byte)type_ByIDX, _pData.m_lIdx)) { this.SetEffect(); } this.VisibleContent(false); char[] separator = new char[] { '+' }; string[] array = _pData.m_strSolKind.Split(separator); if (array == null) { return; } int num = 0; string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text = array2[i]; string text2 = text.Trim(); if (!(text2 == string.Empty)) { int charKindByCode = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindByCode(text2); if (charKindByCode != 0) { NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(charKindByCode); this.m_btSol[num].Visible = true; this.m_btSol2[num].Visible = true; this.m_btSol[num].Data = charKindByCode; this.m_btSol[num].Text = string.Format("{0} {1}", charKindInfo.GetName(), NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("788")); this.m_btSol[num].SetValueChangedDelegate(new EZValueChangedDelegate(this.Click_SolGuide)); this.m_btSol2[num].Data = charKindByCode; this.m_btSol2[num].SetValueChangedDelegate(new EZValueChangedDelegate(this.Click_SolGuide)); num++; } } } this.m_lbGiftHelp.Visible = false; this.m_lbSaleNum.Visible = false; this.m_lbSaleNumHelp.Visible = false; this.m_dtProductLine.Visible = false; }