summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/PairsPetInviteView.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-25 14:28:30 +0800
committerchai <chaifix@163.com>2021-01-25 14:28:30 +0800
commit6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch)
tree7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/UI/PairsPetInviteView.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UI/PairsPetInviteView.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/PairsPetInviteView.cs203
1 files changed, 203 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/UI/PairsPetInviteView.cs b/Client/Assets/Scripts/XMainClient/UI/PairsPetInviteView.cs
new file mode 100644
index 00000000..694ac524
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/PairsPetInviteView.cs
@@ -0,0 +1,203 @@
+using System;
+using KKSG;
+using UILib;
+using UnityEngine;
+using XMainClient.UI.UICommon;
+using XUtliPoolLib;
+
+namespace XMainClient.UI
+{
+ internal class PairsPetInviteView : DlgBase<PairsPetInviteView, PairsPetInviteBehaviour>
+ {
+ public override string fileName
+ {
+ get
+ {
+ return "GameSystem/DoublepetInvitation";
+ }
+ }
+
+ public override bool autoload
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public override bool hideMainMenu
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public override bool pushstack
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public override bool fullscreenui
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ private XPetDocument m_doc;
+
+ protected override void OnLoad()
+ {
+ base.OnLoad();
+ }
+
+ public override void RegisterEvent()
+ {
+ base.RegisterEvent();
+ base.uiBehaviour.m_closeBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClicked));
+ base.uiBehaviour.m_ignoreBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickIgnoreAllBtn));
+ base.uiBehaviour.m_tempRejectBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickTempRejectBtn));
+ }
+
+ protected override void OnUnload()
+ {
+ base.OnUnload();
+ }
+
+ protected override void Init()
+ {
+ base.Init();
+ this.m_doc = XDocuments.GetSpecificDocument<XPetDocument>(XPetDocument.uuID);
+ base.uiBehaviour.m_wrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.WrapContentItemUpdated));
+ }
+
+ protected override void OnHide()
+ {
+ base.OnHide();
+ }
+
+ protected override void OnShow()
+ {
+ base.OnShow();
+ base.uiBehaviour.m_wrapContent.gameObject.SetActive(false);
+ this.m_doc.OnReqInviteList();
+ }
+
+ public override void StackRefresh()
+ {
+ base.StackRefresh();
+ }
+
+ public void RefreshUi()
+ {
+ this.FillContent();
+ }
+
+ private void FillContent()
+ {
+ base.uiBehaviour.m_wrapContent.gameObject.SetActive(true);
+ base.uiBehaviour.m_wrapContent.SetContentCount(this.m_doc.PetInviteInfolist.Count, false);
+ }
+
+ private void WrapContentItemUpdated(Transform t, int index)
+ {
+ bool flag = index >= this.m_doc.PetInviteInfolist.Count;
+ if (flag)
+ {
+ XSingleton<XDebug>.singleton.AddErrorLog("index >= PetInviteInfolist.Count", null, null, null, null, null);
+ }
+ else
+ {
+ PetInviteInfo petInviteInfo = this.m_doc.PetInviteInfolist[index];
+ IXUISprite ixuisprite = t.Find("head").GetComponent("XUISprite") as IXUISprite;
+ ixuisprite.spriteName = XSingleton<XProfessionSkillMgr>.singleton.GetSuperRiskAvatar(petInviteInfo.profession % 10u);
+ IXUILabelSymbol ixuilabelSymbol = t.Find("Name").GetComponent("XUILabelSymbol") as IXUILabelSymbol;
+ ixuilabelSymbol.InputText = petInviteInfo.rolename;
+ IXUILabel ixuilabel = t.Find("PPT").GetComponent("XUILabel") as IXUILabel;
+ ixuilabel.SetText(petInviteInfo.ppt.ToString());
+ PetInfoTable.RowData petInfo = XPetDocument.GetPetInfo(petInviteInfo.petconfigid);
+ ixuisprite = (t.Find("Item/Quality").GetComponent("XUISprite") as IXUISprite);
+ bool flag2 = petInfo != null;
+ if (flag2)
+ {
+ ixuisprite.SetSprite(XSingleton<UiUtility>.singleton.GetItemQualityFrame((int)petInfo.quality, 0));
+ }
+ else
+ {
+ ixuisprite.SetSprite("");
+ }
+ ixuisprite = (t.Find("Item/PetIcon").GetComponent("XUISprite") as IXUISprite);
+ bool flag3 = petInfo != null;
+ if (flag3)
+ {
+ ixuisprite.SetSprite(petInfo.icon, petInfo.Atlas, false);
+ }
+ else
+ {
+ ixuisprite.SetSprite("");
+ }
+ ixuilabel = (t.Find("PetName").GetComponent("XUILabel") as IXUILabel);
+ bool flag4 = petInfo != null;
+ if (flag4)
+ {
+ ixuilabel.SetText(petInfo.name);
+ }
+ else
+ {
+ ixuilabel.SetText("");
+ }
+ ixuilabel = (t.Find("PetPPT").GetComponent("XUILabel") as IXUILabel);
+ ixuilabel.SetText(petInviteInfo.petppt.ToString());
+ ixuilabel = (t.Find("SpeedUp").GetComponent("XUILabel") as IXUILabel);
+ bool flag5 = petInfo != null;
+ if (flag5)
+ {
+ BuffTable.RowData buffData = XSingleton<XBuffTemplateManager>.singleton.GetBuffData((int)petInfo.SpeedBuff, 1);
+ bool flag6 = buffData != null;
+ if (flag6)
+ {
+ ixuilabel.SetText(string.Format("{0}%", (buffData.BuffChangeAttribute[0, 1] + 100f).ToString()));
+ }
+ }
+ else
+ {
+ ixuilabel.SetText("");
+ }
+ IXUIButton ixuibutton = t.Find("Mentorship").GetComponent("XUIButton") as IXUIButton;
+ ixuibutton.ID = petInviteInfo.roleid;
+ ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickDrive));
+ }
+ }
+
+ private bool OnCloseClicked(IXUIButton btn)
+ {
+ this.SetVisible(false, true);
+ return true;
+ }
+
+ private bool OnClickIgnoreAllBtn(IXUIButton btn)
+ {
+ this.SetVisible(false, true);
+ this.m_doc.OnReqIgnoreAll();
+ return true;
+ }
+
+ private bool OnClickTempRejectBtn(IXUIButton btn)
+ {
+ this.SetVisible(false, true);
+ return true;
+ }
+
+ private bool OnClickDrive(IXUIButton btn)
+ {
+ ulong id = btn.ID;
+ this.m_doc.ReqPetPetOperationOther(PetOtherOp.AgreePetPairRide, id);
+ return true;
+ }
+ }
+}