private int ComparisonByWeight(ResHeadImage left, ResHeadImage right) { HeadImgInfo info = this.GetInfo(left.dwID); HeadImgInfo info2 = this.GetInfo(right.dwID); if ((info != null) && (info2 == null)) { return(-10000); } if ((info == null) && (info2 != null)) { return(0x2710); } if ((info == null) && (info2 == null)) { return(0); } if ((info.bNtfFlag == 1) && (info2.bNtfFlag == 0)) { return(-100); } if ((info.bNtfFlag == 0) && (info2.bNtfFlag == 1)) { return(100); } if (left.bSortWeight >= right.bSortWeight) { return(-1); } return(1); }
private void OnShowDetailPanel(int index) { CUIFormScript form = Singleton <CUIManager> .instance.GetForm(s_headImgChgForm); if (form != null) { enHeadImgTab curTab = this.GetCurTab(); ListView <ResHeadImage> curHeadImgList = this.GetCurHeadImgList(curTab); if (index == -1) { Utility.FindChild(form.gameObject, "pnlBg/Panel_Detail/Node").SetActive(false); } else if (index < curHeadImgList.Count) { Utility.FindChild(form.gameObject, "pnlBg/Panel_Detail/Node").SetActive(true); ResHeadImage image = curHeadImgList[index]; HeadImgInfo info = this.GetInfo(image.dwID); Text componetInChild = Utility.GetComponetInChild <Text>(form.gameObject, "pnlBg/Panel_Detail/Node/DescTxt"); Text text2 = Utility.GetComponetInChild <Text>(form.gameObject, "pnlBg/Panel_Detail/Node/AvaildTimeTxt"); Image image2 = Utility.GetComponetInChild <Image>(form.gameObject, "pnlBg/Panel_Detail/Node/HeadImg"); Button button = Utility.GetComponetInChild <Button>(form.gameObject, "pnlBg/Panel_Detail/Node/Button"); Text text3 = Utility.GetComponetInChild <Text>(form.gameObject, "pnlBg/Panel_Detail/Node/SrcTxt"); componetInChild.text = image.szHeadDesc; image2.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Nobe_Dir, image.szHeadIcon), form, true, false, false); if (image.dwValidSecond == 0) { text2.text = Singleton <CTextManager> .instance.GetText("HeadImg_Tips_1"); } else if (info != null) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); if (masterRoleInfo != null) { DateTime time = Utility.ToUtcTime2Local(masterRoleInfo.getCurrentTimeSinceLogin() + image.dwValidSecond); string[] args = new string[] { time.Year.ToString(), time.Month.ToString(), time.Day.ToString() }; text2.text = Singleton <CTextManager> .instance.GetText("HeadImg_Tips_2", args); } } else { string[] textArray2 = new string[] { Math.Ceiling((double)(((float)image.dwValidSecond) / 86400f)).ToString() }; text2.text = Singleton <CTextManager> .instance.GetText("HeadImg_Tips_3", textArray2); } if (info != null) { button.gameObject.CustomSetActive(!this.IsHeadIconInUse(info.dwID)); text3.gameObject.SetActive(false); } else { button.gameObject.CustomSetActive(false); text3.gameObject.SetActive(true); text3.text = image.szHeadAccess; } } } }
private void Start() { Resetsetting(); Instance = this; #if UNITY_ANDROID //AndroidDevice.Initialization(); #elif UNITY_IPHONE IOSDevice.Initialization(); #endif }
public void OnHeadIconSyncList(ushort count, COMDT_ACNT_HEADIMG_INFO[] astHeadImgInfo) { this.m_headImgInfo.Clear(); for (int i = 0; i < count; i++) { HeadImgInfo item = new HeadImgInfo { dwID = astHeadImgInfo[i].dwID, dwGetTime = astHeadImgInfo[i].dwGetTime, bNtfFlag = astHeadImgInfo[i].bNtfFlag }; this.m_headImgInfo.Add(item); } }
private int ComparisonByTab(ResHeadImage left, ResHeadImage right) { HeadImgInfo info = this.GetInfo(left.dwID); HeadImgInfo info2 = this.GetInfo(right.dwID); if ((info != null) && (info2 == null)) { return(-10000); } if ((info == null) && (info2 != null)) { return(0x2710); } if ((info == null) && (info2 == null)) { if (left.bHeadType < right.bHeadType) { return(-1); } if ((left.bHeadType <= right.bHeadType) && (left.dwID < right.dwID)) { return(-1); } return(1); } if ((info != null) && (info2 != null)) { if ((info.bNtfFlag == 1) && (info2.bNtfFlag == 0)) { return(-100); } if ((info.bNtfFlag == 0) && (info2.bNtfFlag == 1)) { return(100); } if ((info.bNtfFlag == 0) && (info2.bNtfFlag == 0)) { if (left.bHeadType < right.bHeadType) { return(-1); } if ((left.bHeadType <= right.bHeadType) && (left.dwID < right.dwID)) { return(-1); } return(1); } } return(0); }
private void On_HeadIcon_Change_Icon_Click(CUIEvent uiEvent) { if (Singleton <CUIManager> .instance.GetForm(s_headImgChgForm) != null) { int selectedIndex = uiEvent.m_srcWidget.GetComponent <CUIListScript>().GetSelectedIndex(); this.OnShowDetailPanel(selectedIndex); ResHeadImage selectedHeadImg = this.GetSelectedHeadImg(); if (selectedHeadImg != null) { HeadImgInfo info = this.GetInfo(selectedHeadImg.dwID); if ((info != null) && (info.bNtfFlag == 1)) { OnHeadIconFlagClearReq(info.dwID); } } } }
public void AddHeadImgInfo(uint dwHeadImgID, uint dwGetTime) { HeadImgInfo item = new HeadImgInfo { dwID = dwHeadImgID, dwGetTime = dwGetTime, bNtfFlag = 1 }; for (int i = 0; i < this.m_headImgInfo.Count; i++) { if (this.m_headImgInfo[i].dwID == dwHeadImgID) { this.m_headImgInfo.RemoveAt(i); i--; } } this.m_headImgInfo.Add(item); }
private int ComparisonByTime(ResHeadImage left, ResHeadImage right) { HeadImgInfo info = this.GetInfo(left.dwID); HeadImgInfo info2 = this.GetInfo(right.dwID); if ((info != null) && (info2 == null)) { return(-10000); } if ((info == null) && (info2 != null)) { return(0x2710); } if ((info == null) && (info2 == null)) { if (left.bSortWeight > right.bSortWeight) { return(-10); } if (left.bSortWeight < right.bSortWeight) { return(10); } if (left.dwID < right.dwID) { return(-1); } return(1); } if ((info == null) || (info2 == null)) { return(0); } if ((info.bNtfFlag == 1) && (info2.bNtfFlag == 0)) { return(-1000); } if ((info.bNtfFlag == 0) && (info2.bNtfFlag == 1)) { return(0x3e8); } if (info.dwGetTime > info2.dwGetTime) { return(-100); } if (info.dwGetTime < info2.dwGetTime) { return(100); } if (left.bSortWeight > right.bSortWeight) { return(-10); } if (left.bSortWeight < right.bSortWeight) { return(10); } if (left.dwID < right.dwID) { return(-1); } return(1); }