Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //================================================================================
- // AuctionWnd.
- //================================================================================
- class AuctionWnd extends UICommonAPI;
- var WindowHandle Me;
- var TextBoxHandle txtRemainStr;
- var TextBoxHandle txtTimeHour;
- var TextBoxHandle txtTimeMin;
- var TextBoxHandle txtTimeSec;
- var TextBoxHandle txtHighBid;
- var TextBoxHandle txtMyAdenaStr;
- var TextBoxHandle txtMyAdena;
- var TextBoxHandle txtItemInfoStr;
- var ButtonHandle BtnBid1;
- var ButtonHandle BtnBid2;
- var ButtonHandle BtnBid3;
- var ButtonHandle BtnBid4;
- var ButtonHandle BtnBidInput;
- var TextBoxHandle txtHighBidStr;
- var TextureHandle txtRemainTimeBg;
- var TextureHandle ItemInfoBg;
- var TextureHandle txtHighBidBg;
- var TextureHandle txtMyAdenaBg;
- var ButtonHandle BtnClose;
- var ButtonHandle BtnNext;
- var ItemWindowHandle AuctionItem;
- var TextBoxHandle txtItemDesc;
- var TextBoxHandle txtItemName;
- var WindowHandle areaScroll;
- var WindowHandle NextAuctionWnd;
- var INT64 m_myLastBidPrice;
- var INT64 m_myBidPrice;
- var INT64 m_currentPrice;
- var int m_auctionID;
- var ItemInfo m_auctionItem;
- var int bShowUI;
- var int iAuctionID;
- var INT64 iCurrentPrice;
- var int iRemainSecond;
- const ADENA_OVER_FLOW= "100000000000";
- const DIALOG_CONFIRM_PRICE= 432;
- const DIALOG_ASK_AUCTION_PRICE= 321;
- const TIMER_DELAY=1000;
- const TIMER_ID=777;
- function OnRegisterEvent ()
- {
- RegisterEvent(3050);
- RegisterEvent(1710);
- }
- function OnLoad ()
- {
- Initialize();
- Load();
- }
- function Initialize ()
- {
- if ( 1 == 0 )
- {
- OnRegisterEvent();
- }
- if ( 1 == 0 )
- {
- Me = GetHandle("AuctionWnd");
- txtRemainStr = TextBoxHandle(GetHandle("AuctionWnd.txtRemainStr"));
- txtTimeHour = TextBoxHandle(GetHandle("AuctionWnd.txtTimeHour"));
- txtTimeMin = TextBoxHandle(GetHandle("AuctionWnd.txtTimeMin"));
- txtTimeSec = TextBoxHandle(GetHandle("AuctionWnd.txtTimeSec"));
- txtHighBid = TextBoxHandle(GetHandle("AuctionWnd.txtHighBid"));
- txtMyAdenaStr = TextBoxHandle(GetHandle("AuctionWnd.txtMyAdenaStr"));
- txtMyAdena = TextBoxHandle(GetHandle("AuctionWnd.txtMyAdena"));
- txtItemInfoStr = TextBoxHandle(GetHandle("AuctionWnd.txtItemInfoStr"));
- BtnBid1 = ButtonHandle(GetHandle("AuctionWnd.BtnBid1"));
- BtnBid2 = ButtonHandle(GetHandle("AuctionWnd.BtnBid2"));
- BtnBid3 = ButtonHandle(GetHandle("AuctionWnd.BtnBid3"));
- BtnBid4 = ButtonHandle(GetHandle("AuctionWnd.BtnBid4"));
- BtnBidInput = ButtonHandle(GetHandle("AuctionWnd.BtnBidInput"));
- txtHighBidStr = TextBoxHandle(GetHandle("AuctionWnd.txtHighBidStr"));
- txtRemainTimeBg = TextureHandle(GetHandle("AuctionWnd.txtRemainTimeBg"));
- ItemInfoBg = TextureHandle(GetHandle("AuctionWnd.ItemInfoBg"));
- txtHighBidBg = TextureHandle(GetHandle("AuctionWnd.txtHighBidBg"));
- txtMyAdenaBg = TextureHandle(GetHandle("AuctionWnd.txtMyAdenaBg"));
- BtnClose = ButtonHandle(GetHandle("AuctionWnd.BtnClose"));
- AuctionItem = ItemWindowHandle(GetHandle("AuctionWnd.AuctionItem"));
- txtItemDesc = TextBoxHandle(GetHandle("AuctionWnd.scrollDesc.txtItemDesc"));
- txtItemName = TextBoxHandle(GetHandle("AuctionWnd.txtItemName"));
- areaScroll = GetHandle("AuctionWnd.scrollDesc");
- NextAuctionWnd = GetHandle("NextAuctionDrawerWnd");
- } else {
- Me = GetWindowHandle("AuctionWnd");
- txtRemainStr = GetTextBoxHandle("AuctionWnd.txtRemainStr");
- txtTimeHour = GetTextBoxHandle("AuctionWnd.txtTimeHour");
- txtTimeMin = GetTextBoxHandle("AuctionWnd.txtTimeMin");
- txtTimeSec = GetTextBoxHandle("AuctionWnd.txtTimeSec");
- txtHighBid = GetTextBoxHandle("AuctionWnd.txtHighBid");
- txtMyAdenaStr = GetTextBoxHandle("AuctionWnd.txtMyAdenaStr");
- txtMyAdena = GetTextBoxHandle("AuctionWnd.txtMyAdena");
- txtItemInfoStr = GetTextBoxHandle("AuctionWnd.txtItemInfoStr");
- BtnBid1 = GetButtonHandle("AuctionWnd.BtnBid1");
- BtnBid2 = GetButtonHandle("AuctionWnd.BtnBid2");
- BtnBid3 = GetButtonHandle("AuctionWnd.BtnBid3");
- BtnBid4 = GetButtonHandle("AuctionWnd.BtnBid4");
- BtnBidInput = GetButtonHandle("AuctionWnd.BtnBidInput");
- txtHighBidStr = GetTextBoxHandle("AuctionWnd.txtHighBidStr");
- txtRemainTimeBg = GetTextureHandle("AuctionWnd.txtRemainTimeBg");
- ItemInfoBg = GetTextureHandle("AuctionWnd.ItemInfoBg");
- txtHighBidBg = GetTextureHandle("AuctionWnd.txtHighBidBg");
- txtMyAdenaBg = GetTextureHandle("AuctionWnd.txtMyAdenaBg");
- BtnClose = GetButtonHandle("AuctionWnd.BtnClose");
- AuctionItem = GetItemWindowHandle("AuctionWnd.AuctionItem");
- txtItemDesc = GetTextBoxHandle("AuctionWnd.scrollDesc.txtItemDesc");
- txtItemName = GetTextBoxHandle("AuctionWnd.txtItemName");
- areaScroll = GetWindowHandle("AuctionWnd.scrollDesc");
- BtnNext = GetButtonHandle("AuctionWnd.BtnNextAuction");
- NextAuctionWnd = GetWindowHandle("NextAuctionDrawerWnd");
- }
- }
- function Load ()
- {
- }
- function OnEvent (int Event_ID, string param)
- {
- local ItemInfo Info;
- switch (Event_ID)
- {
- case 3050:
- ParseInt(param,"ShowUI",bShowUI);
- ParseInt(param,"AuctionID",iAuctionID);
- ParseINT64(param,"CurrentPrice",iCurrentPrice);
- ParseInt(param,"RemainSecond",iRemainSecond);
- ParamToItemInfo(param,Info);
- m_currentPrice = iCurrentPrice;
- m_auctionID = iAuctionID;
- m_auctionItem = Info;
- if ( bShowUI == 1 )
- {
- InsertAuctionItem();
- m_hOwnerWnd.SetTimer(777,1000);
- Me.ShowWindow();
- Me.SetFocus();
- }
- UpdateAuctionWnd();
- break;
- case 1710:
- HandleDialogOK();
- break;
- default:
- }
- }
- function OnTimer (int TimerID)
- {
- if ( TimerID == 777 )
- {
- Class'AuctionAPI'.RequestInfoItemAuction(m_auctionID);
- }
- }
- function InsertAuctionItem ()
- {
- AuctionItem.Clear();
- AuctionItem.AddItem(m_auctionItem);
- AuctionItem.SetTooltipType("Inventory");
- txtItemName.SetText(m_auctionItem.Name);
- ComputeScrollHeight(m_auctionItem.Description);
- txtItemDesc.SetText(m_auctionItem.Description);
- }
- function ComputeScrollHeight (string tempStr)
- {
- local int nHeight;
- local int nWidth;
- local Rect rectWnd;
- rectWnd = txtItemDesc.GetRect();
- GetTextSizeDefault(tempStr,nWidth,nHeight);
- areaScroll.SetScrollHeight((nHeight + 1) * (nWidth / rectWnd.nWidth + 1));
- areaScroll.SetScrollPosition(0);
- }
- function OnShow ()
- {
- BtnNext.EnableWindow();
- BtnBid1.EnableWindow();
- BtnBid2.EnableWindow();
- BtnBid3.EnableWindow();
- BtnBid4.EnableWindow();
- BtnBidInput.EnableWindow();
- }
- function OnHide ()
- {
- Class'UIAPI_WINDOW'.KillUITimer("AuctionWnd",777);
- Class'UIAPI_ITEMWINDOW'.Clear("AuctionWnd.AuctionItem");
- NextAuctionWnd.HideWindow();
- }
- function OnClickButton (string Name)
- {
- m_myBidPrice = -1;
- switch (Name)
- {
- case "BtnBid1":
- m_myBidPrice = UnknownFunction401(m_currentPrice,2);
- }
- function UpdateAuctionWnd ()
- {
- local int temp1;
- local int m_timeHour;
- local int m_timeMin;
- local int m_timeSec;
- local string tempStr;
- local INT64 tempPrice;
- }
- function OnBtnBidInputClick ()
- {
- DialogSetID(321);
- DialogSetEditType("number");
- DialogSetParamInt64(-1);
- DialogSetDefaultOK();
- DialogShow(1,6,GetSystemMessage(2138));
- }
- function HandleDialogOK ()
- {
- local int Id;
- if ( DialogIsMine() )
- {
- Id = DialogGetID();
- if ( Id == 321 )
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement