Ejemplo n.º 1
0
    // Token: 0x060019D9 RID: 6617 RVA: 0x002BEF5C File Offset: 0x002BD15C
    public void UpdateNamePos()
    {
        this.RoleNameStr.ClearString();
        CString cstring = StringManager.Instance.StaticString1024();

        if (this.DM.RoleAttr.NickName.Length == 0)
        {
            cstring.Append(this.DM.mStringTable.GetStringByID(9096u));
        }
        else
        {
            cstring.Append(this.DM.RoleAttr.NickName);
        }
        GameConstants.FormatRoleName(this.RoleNameStr, this.DM.RoleAttr.Name, null, cstring, 0, 0, null, null, null, "<color=#4CF5F5>");
        this.RoleName.text = this.RoleNameStr.ToString();
        this.RoleName.SetAllDirty();
        this.RoleName.cachedTextGenerator.Invalidate();
        this.RoleName.cachedTextGeneratorForLayout.Invalidate();
        this.RoleName.fontSize = this.RoleNameSize;
        this.RoleName.fontSize = this.GetFontSize();
        Vector2 anchoredPosition = this.RectChangeName.anchoredPosition;

        anchoredPosition.x = this.RoleName.rectTransform.anchoredPosition.x + this.RoleName.preferredWidth + 27f;
        if (this.RoleName.rectTransform.localScale.x < 0f)
        {
            anchoredPosition.x -= this.RoleName.rectTransform.sizeDelta.x;
        }
        this.RectChangeName.anchoredPosition = anchoredPosition;
    }
Ejemplo n.º 2
0
    // Token: 0x0600138A RID: 5002 RVA: 0x0022CECC File Offset: 0x0022B0CC
    private void SetHiBtnAndText()
    {
        Transform child = this.AGS_Form.GetChild(3).GetChild(0);

        GUIManager.Instance.ChangeHeroItemImg(child, eHeroOrItem.Hero, LeaderBoardManager.Instance.KingHead, 11, 0, 0);
        UIText component = this.AGS_Form.GetChild(3).GetChild(3).GetComponent <UIText>();

        if (LeaderBoardManager.Instance.MobiWorldKingBoard.Count > 0 && LeaderBoardManager.Instance.KingHead != 0)
        {
            GameConstants.FormatRoleName(this.RankValue, LeaderBoardManager.Instance.MobiWorldKingBoard[0].Name, LeaderBoardManager.Instance.MobiWorldKingBoard[0].AllianceTag, null, 0, LeaderBoardManager.Instance.MobiWorldKingBoard[0].HomeKingdomID, null, null, null, null);
            component.text = this.RankValue.ToString();
        }
        if (this.m_WonderID >= 0 && this.m_WonderID < DataManager.MapDataController.YolkPointTable.Length)
        {
            MapYolk mapYolk = DataManager.MapDataController.YolkPointTable[this.m_WonderID];
            bool    flag    = mapYolk.WonderLeader != null && mapYolk.WonderLeader.Length > 0;
            if (mapYolk.WonderState == 0 && flag && LeaderBoardManager.Instance.KingHead > 0)
            {
                child.gameObject.SetActive(true);
                component.gameObject.SetActive(true);
            }
            else
            {
                child.gameObject.SetActive(false);
                component.gameObject.SetActive(false);
            }
        }
        else
        {
            child.gameObject.SetActive(false);
            component.gameObject.SetActive(false);
        }
    }
Ejemplo n.º 3
0
    // Token: 0x060008DC RID: 2268 RVA: 0x000B5C4C File Offset: 0x000B3E4C
    public void Recv_MSG_GAMBLE_JACKPOT(MessagePacket MP)
    {
        GamblingManager.GamebleJackpot gamebleJackpot = new GamblingManager.GamebleJackpot();
        gamebleJackpot.KingdomID = MP.ReadUShort(-1);
        MP.ReadStringPlus(3, gamebleJackpot.Tag, -1);
        MP.ReadStringPlus(13, gamebleJackpot.Name, -1);
        uint num = MP.ReadUInt(-1);

        gamebleJackpot.PrizeWins = MP.ReadUInt(-1);
        gamebleJackpot.GameType  = (UIBattle_Gambling.eMode)MP.ReadByte(-1);
        gamebleJackpot.WonTime   = MP.ReadLong(-1);
        bool flag = DataManager.CompareStr(gamebleJackpot.Name, DataManager.Instance.RoleAttr.Name) == 0;

        this.AddJackpotData(gamebleJackpot);
        if (GUIManager.Instance.FindMenu(EGUIWindow.UI_Battle_Gambling) || gamebleJackpot.KingdomID == DataManager.MapDataController.kingdomData.kingdomID)
        {
            DataManager dataManager = DataManager.Instance;
            CString     cstring     = StringManager.Instance.StaticString1024();
            cstring.Append("<color=#FFFF00>");
            cstring.IntToFormat((long)((ulong)gamebleJackpot.PrizeWins), 1, true);
            cstring.AppendFormat(dataManager.mStringTable.GetStringByID(8473u));
            cstring.Append("</color>");
            MapMonster recordByKey  = DataManager.MapDataController.MapMonsterTable.GetRecordByKey(this.m_GambleEventSave.MonsterID);
            HeroTeam   recordByKey2 = dataManager.TeamTable.GetRecordByKey(recordByKey.MapTeamInfo[0].TeamID);
            Hero       recordByKey3 = dataManager.HeroTable.GetRecordByKey(recordByKey2.Arrays[10].Hero);
            CString    cstring2     = StringManager.Instance.StaticString1024();
            GameConstants.FormatRoleName(cstring2, gamebleJackpot.Name, gamebleJackpot.Tag, null, 0, (gamebleJackpot.KingdomID != DataManager.MapDataController.kingdomData.kingdomID) ? gamebleJackpot.KingdomID : 0, null, null, null, null);
            CString cstring3 = StringManager.Instance.StaticString1024();
            cstring3.Append("<color=#FFFF00>");
            cstring3.Append(cstring2);
            cstring3.Append("</color>");
            CString cstring4 = StringManager.Instance.SpawnString(1024);
            cstring4.StringToFormat(cstring3);
            if (gamebleJackpot.GameType == UIBattle_Gambling.eMode.Normal)
            {
                cstring4.StringToFormat(dataManager.mStringTable.GetStringByID(9171u));
            }
            else
            {
                cstring4.StringToFormat(dataManager.mStringTable.GetStringByID(9179u));
            }
            cstring4.StringToFormat(dataManager.mStringTable.GetStringByID((uint)recordByKey3.HeroName));
            cstring4.StringToFormat(cstring);
            cstring4.AppendFormat(dataManager.mStringTable.GetStringByID(9180u));
            this.GambleCountStr.Add(cstring4);
            GUIManager.Instance.SetRunningText(cstring4);
        }
        GUIManager.Instance.UpdateUI(EGUIWindow.UI_Battle_Gambling, 0, 0);
        GUIManager.Instance.UpdateUI(EGUIWindow.UI_Battle_Gambling, 2, 0);
        if (flag)
        {
            GUIManager.Instance.UpdateUI(EGUIWindow.UI_Battle_Gambling, 9, 0);
        }
        GUIManager.Instance.UpdateUI(EGUIWindow.UI_MonsterCrypt, 0, 0);
    }
Ejemplo n.º 4
0
 // Token: 0x0600151E RID: 5406 RVA: 0x002410B4 File Offset: 0x0023F2B4
 public void Show(byte id, byte index)
 {
     this.gameobject.SetActive(true);
     this.ID    = id;
     this.Index = index;
     DataManager.FBMissionDataManager.GetFriendSocialInfo(this.ID, (int)this.Index, out this.friend, true);
     if (this.friend != null)
     {
         if (this.Icon != null)
         {
             GUIManager.Instance.pushEmojiIcon(this.Icon);
         }
         this.Icon = DataManager.FBMissionDataManager.GetFriendEmoji((ushort)this.friend.IconNo);
         if (this.Icon != null)
         {
             this.Icon.EmojiTransform.SetParent(this.IconTrans, false);
             float iconScale = this.GetIconScale(this.Icon);
             this.Icon.EmojiTransform.localPosition = Vector3.zero;
             this.Icon.EmojiTransform.localScale    = new Vector3(iconScale, iconScale, iconScale);
         }
         this.NameText.gameobject.SetActive(true);
         GameConstants.FormatRoleName(this.NameStr, this.friend.Name, this.friend.AllianceTag, null, 0, 0, null, null, null, null);
         this.LinkNameText.fontSize = this.OriLinkFontSize;
         this.LinkNameText.text     = this.friend.SocialName.ToString();
         this.LinkNameText.SetAllDirty();
         this.LinkNameText.cachedTextGenerator.Invalidate();
         this.LinkNameText.cachedTextGeneratorForLayout.Invalidate();
         if (this.TextHandle != null)
         {
             this.NameText.TextHandle = this.TextHandle;
             this.NameText.SetText(this.NameStr.ToString());
             this.NameText.Button.m_BtnID1 = (int)id;
             this.NameText.Button.m_BtnID2 = (int)index;
             this.LinkStr.ClearString();
             this.LinkStr.Append(this.friend.SocialName);
             this.TextHandle.TextLenCheck(this.LinkNameText, this.LinkStr);
         }
         this.BeiginTime  = this.friend.MissionTime.BeginTime;
         this.RequireTime = this.friend.MissionTime.RequireTime;
         this.UpdateTime();
     }
     else
     {
         this.LinkNameText.text = string.Empty;
         this.NameText.SetText(string.Empty);
         this.TimeText.text = string.Empty;
     }
 }
Ejemplo n.º 5
0
            // Token: 0x06000F6E RID: 3950 RVA: 0x001B380C File Offset: 0x001B1A0C
            public void SetName(CString Name, CString Tag, ushort homeKindom)
            {
                bool flag = false;

                if (ActivityManager.Instance.IsInKvK(0, false) && homeKindom > 0 && homeKindom != DataManager.MapDataController.kingdomData.kingdomID)
                {
                    flag = true;
                }
                this.NameStr.ClearString();
                if (flag)
                {
                    GameConstants.FormatRoleName(this.NameStr, Name, Tag, null, 0, 0, null, "<color=#FF878E>", "<color=#FF878E>", null);
                }
                else
                {
                    GameConstants.FormatRoleName(this.NameStr, Name, Tag, null, 0, 0, null, "<color=#FFCC00>", null, null);
                }
                this.CampsText.text = this.NameStr.ToString();
                this.CampsText.SetAllDirty();
                this.CampsText.cachedTextGenerator.Invalidate();
            }
Ejemplo n.º 6
0
    // Token: 0x060016A6 RID: 5798 RVA: 0x00271410 File Offset: 0x0026F610
    private void Refresh(int arg1 = 0)
    {
        if (this.door && !this.m_Dukedom.sprite && UIPetSkill.nowMapPoint < DataManager.MapDataController.LayoutMapInfo.Length)
        {
            MapPoint mapPoint = DataManager.MapDataController.LayoutMapInfo[UIPetSkill.nowMapPoint];
            if ((int)mapPoint.tableID < DataManager.MapDataController.PlayerPointTable.Length)
            {
                bool flag = DataManager.MapDataController.IsEnemy(DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].kingdomID);
                this.door.TileMapController.getTileMapSprite(ref this.m_Dukedom, DataManager.MapDataController.GetLayoutMapInfoPointKind((uint)UIPetSkill.nowMapPoint), (int)DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].level, (DataManager.MapDataController.OtherKingdomData.kingdomPeriod != KINGDOM_PERIOD.KP_KVK || !flag) ? DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].cityOutward : CITY_OUTWARD.CO_EMEMY);
                this.m_Dukedom.material             = (UnityEngine.Object.Instantiate(this.door.TileMapController.TileSprites.m_Image.material) as Material);
                this.m_Dukedom.material.renderQueue = 3000;
                if (flag)
                {
                    if (DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].allianceTag != null && DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].allianceTag.Length > 0)
                    {
                        GameConstants.FormatRoleName(this.m_Str[0], DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].playerName, DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].allianceTag, null, 0, DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].kingdomID, null, null, null, null);
                    }
                    else
                    {
                        GameConstants.FormatRoleName(this.m_Str[0], DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].playerName, null, null, 0, DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].kingdomID, null, null, null, null);
                    }
                }
                else if (DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].allianceTag != null && DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].allianceTag.Length > 0)
                {
                    GameConstants.FormatRoleName(this.m_Str[0], DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].playerName, DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].allianceTag, null, 0, 0, null, null, null, null);
                }
                else
                {
                    StringManager.Instance.StringToFormat(DataManager.MapDataController.PlayerPointTable[(int)mapPoint.tableID].playerName);
                    this.m_Str[0].AppendFormat("{0}");
                }
                this.m_label[0].text = this.m_Str[0].ToString();
                this.m_label[0].SetAllDirty();
                this.m_label[0].cachedTextGenerator.Invalidate();
                this.m_Dukedom.SetNativeSize();
                this.m_Dukedom.enabled = true;
            }
        }
        this.m_Active.m_BtnID2 = 1;
        this.ItemsHeight.Clear();
        PetBuff.PetSkills.Clear();
        base.SetSkill(true);
        int i     = 0;
        int btnID = 0;

        while (i < PetBuff.PetSkillList.Length)
        {
            for (int j = 0; j < PetBuff.PetSkillList[i].Count; j++)
            {
                if ((int)PetBuff.PetSkillList[i][j].Subject == this.nowCasting)
                {
                    PetBuff.PetSkills.Add(new PetBuff.PetSkill(PetBuff.PetSkillList[i][j].Id, btnID++, (byte)i, PetBuff.PetSkillList[i][j].Slot, PetBuff.PetSkillList[i][j].Pet));
                    if (PetBuff.PetSkillList[i][j].Id == (uint)UIPetSkill.nowSkillId)
                    {
                        this.m_Active.m_BtnID2 = btnID;
                    }
                    this.ItemsHeight.Add(90f);
                }
            }
            i++;
        }
        this.m_scroll.AddNewDataHeight(this.ItemsHeight, true, true);
        if (this.m_Active.m_BtnID2 > 1)
        {
            this.m_scroll.GoTo(UIPetSkill.Positioning, UIPetSkill.Scrolling);
        }
        this.OnButtonClick(this.m_Active);
    }
Ejemplo n.º 7
0
    // Token: 0x060020F8 RID: 8440 RVA: 0x003EB19C File Offset: 0x003E939C
    public void CheckEffect()
    {
        this.mBD                    = this.GUIM.BuildingData.GetBuildData(13, 0);
        this.m_Effect               = (ushort)this.mBD.Level;
        this.text_TimeBar.text      = this.DM.mStringTable.GetStringByID(3931u);
        this.text_TimeBar.alignment = TextAnchor.UpperCenter;
        this.Img_NoHero.gameObject.SetActive(true);
        bool active = true;

        if (this.m_Effect == 25)
        {
            if (this.mStatus == 1 || this.mStatus == 2 || this.mStatus == 3 || this.mStatus == 5 || this.mStatus == 12)
            {
                if (!this.bYolk)
                {
                    this.btn_Prepare.gameObject.SetActive(true);
                }
                active = false;
            }
            if ((this.mStatus == 1 || this.mStatus == 2) && !this.bYolk)
            {
                this.Img_Drop.gameObject.SetActive(true);
            }
        }
        if (this.m_Effect >= 23 && this.mStatus == 11)
        {
            active = false;
        }
        if (this.m_Effect >= 21 && (this.mStatus == 7 || this.mStatus == 8))
        {
            active = false;
        }
        if (this.m_Effect >= 19 && this.mStatus == 13)
        {
            active = false;
        }
        if (this.m_Effect >= 17)
        {
        }
        if (this.m_Effect >= 15)
        {
            this.Img_Hero.gameObject.SetActive(true);
            this.Img_NoHero.gameObject.SetActive(false);
            Hero recordByKey = this.DM.HeroTable.GetRecordByKey(this.DM.m_WT_MH);
            this.Img_Hero.sprite      = this.GUIM.m_IconSpriteAsset.LoadSprite(recordByKey.Graph);
            this.Img_HeroBG.sprite    = this.GUIM.m_IconSpriteAsset.LoadSprite(recordByKey.Graph);
            this.Img_HeroFrame.sprite = this.GUIM.LoadFrameSprite("hf011");
            if (this.mStatus == 1 || this.mStatus == 2 || this.mStatus == 3 || this.mStatus == 11 || this.mStatus == 12)
            {
                this.text_MainHero.gameObject.SetActive(true);
            }
            if (this.DM.m_WT_WithSupremeLeader > 0)
            {
                this.text_MainHero.text = this.DM.mStringTable.GetStringByID(4012u);
                this.ImgShowMain[0].gameObject.SetActive(true);
            }
            else
            {
                this.text_MainHero.text = this.DM.mStringTable.GetStringByID(4013u);
                this.ImgShowMain[0].gameObject.SetActive(false);
            }
            if (this.mStatus == 9)
            {
                active = false;
            }
        }
        if (this.m_Effect >= 13)
        {
        }
        if (this.m_Effect >= 10)
        {
        }
        if (this.m_Effect >= 7)
        {
            if (this.DM.m_WTList_Idx == -1)
            {
                this.text_TimeBar.text = this.DM.mStringTable.GetStringByID(5776u);
                this.text_TimeBar.SetAllDirty();
                this.text_TimeBar.cachedTextGenerator.Invalidate();
                this.text_TimeBar.alignment = TextAnchor.UpperCenter;
                this.timeBar.gameObject.SetActive(false);
            }
            else
            {
                this.text_TimeBar.gameObject.SetActive(false);
                long beginTime = this.DM.tmp_WatchTowerData[(int)this.DM.m_WatchTowerData[this.DM.m_WTList_Idx].ListIdx].MarchTimeData.BeginTime;
                long target    = beginTime + (long)((ulong)this.DM.tmp_WatchTowerData[(int)this.DM.m_WatchTowerData[this.DM.m_WTList_Idx].ListIdx].MarchTimeData.RequireTime);
                this.GUIM.SetTimerBar(this.timeBar, beginTime, target, 0L, eTimeBarType.NormalType, this.DM.mStringTable.GetStringByID(3985u), string.Empty);
                this.GUIM.SetTimerSpriteType(this.timeBar, eTimerSpriteType.Speed);
            }
        }
        if (this.m_Effect >= 4)
        {
            this.Cstr_PlayerName[0].ClearString();
            this.text_PlayerName[1].color = Color.white;
            this.Cstr_PlayerName[0].Append(this.DM.mStringTable.GetStringByID(4009u));
            this.text_PlayerName[0].text = this.Cstr_PlayerName[0].ToString();
            this.text_PlayerName[0].SetAllDirty();
            this.text_PlayerName[0].cachedTextGenerator.Invalidate();
            this.Cstr_PlayerName[1].ClearString();
            CString cstring  = StringManager.Instance.StaticString1024();
            CString cstring2 = StringManager.Instance.StaticString1024();
            CString cstring3 = StringManager.Instance.StaticString1024();
            cstring.ClearString();
            cstring2.ClearString();
            cstring3.ClearString();
            if (this.m_Effect >= 10)
            {
                cstring.Append(this.DM.m_WT_Name);
                if (this.DM.m_WT_AllianceName.Length > 0)
                {
                    cstring2.Append(this.DM.m_WT_AllianceName);
                    if (this.DM.m_WT_KingdomID != DataManager.MapDataController.kingdomData.kingdomID)
                    {
                        this.text_PlayerName[1].color = new Color(1f, 0.294f, 0.459f);
                        GameConstants.FormatRoleName(this.Cstr_PlayerName[1], cstring, cstring2, null, 0, this.DM.m_WT_KingdomID, null, null, null, null);
                    }
                    else
                    {
                        GameConstants.FormatRoleName(this.Cstr_PlayerName[1], cstring, cstring2, null, 0, 0, null, null, null, null);
                    }
                }
                else if (this.DM.m_WT_KingdomID != DataManager.MapDataController.kingdomData.kingdomID)
                {
                    this.text_PlayerName[1].color = new Color(1f, 0.294f, 0.459f);
                    GameConstants.FormatRoleName(this.Cstr_PlayerName[1], cstring, null, null, 0, this.DM.m_WT_KingdomID, null, null, null, null);
                }
                else
                {
                    GameConstants.FormatRoleName(this.Cstr_PlayerName[1], cstring, null, null, 0, 0, null, null, null, null);
                }
            }
            else
            {
                cstring.Append(this.DM.m_WT_Name);
                if (this.DM.m_WT_KingdomID != DataManager.MapDataController.kingdomData.kingdomID)
                {
                    this.text_PlayerName[1].color = new Color(1f, 0.294f, 0.459f);
                    GameConstants.FormatRoleName(this.Cstr_PlayerName[1], cstring, null, null, 0, this.DM.m_WT_KingdomID, null, null, null, null);
                }
                else
                {
                    GameConstants.FormatRoleName(this.Cstr_PlayerName[1], cstring, null, null, 0, 0, null, null, null, null);
                }
            }
            this.text_PlayerName[1].text = this.Cstr_PlayerName[1].ToString();
            this.text_PlayerName[1].SetAllDirty();
            this.text_PlayerName[1].cachedTextGenerator.Invalidate();
            this.Cstr_btnCoordinate[1].ClearString();
            this.tmpV = GameConstants.getTileMapPosbyMapID(GameConstants.PointCodeToMapID(this.DM.m_WT_Point.zoneID, this.DM.m_WT_Point.pointID));
            this.Cstr_btnCoordinate[1].StringToFormat(this.DM.mStringTable.GetStringByID(4505u));
            this.Cstr_btnCoordinate[1].IntToFormat((long)((int)this.tmpV.x), 1, false);
            this.Cstr_btnCoordinate[1].StringToFormat(this.DM.mStringTable.GetStringByID(4506u));
            this.Cstr_btnCoordinate[1].IntToFormat((long)((int)this.tmpV.y), 1, false);
            if (this.GUIM.IsArabic)
            {
                this.Cstr_btnCoordinate[1].AppendFormat("{3}{2} {1}{0}");
            }
            else
            {
                this.Cstr_btnCoordinate[1].AppendFormat("{0}{1} {2}{3}");
            }
            this.text_btnCoordinate[1].text = this.Cstr_btnCoordinate[1].ToString();
            this.text_btnCoordinate[1].SetAllDirty();
            this.text_btnCoordinate[1].cachedTextGenerator.Invalidate();
            for (int i = 0; i < 3; i++)
            {
                this.Coordinate2_RT[i].sizeDelta = new Vector2(this.text_btnCoordinate[1].preferredWidth, this.Coordinate2_RT[i].sizeDelta.y);
            }
        }
        else
        {
            this.text_PlayerName[1].text = this.DM.mStringTable.GetStringByID(3931u);
            this.Cstr_btnCoordinate[1].ClearString();
            this.Cstr_btnCoordinate[1].StringToFormat(this.DM.mStringTable.GetStringByID(4505u));
            this.Cstr_btnCoordinate[1].StringToFormat(this.DM.mStringTable.GetStringByID(3931u));
            this.Cstr_btnCoordinate[1].StringToFormat(this.DM.mStringTable.GetStringByID(4506u));
            this.Cstr_btnCoordinate[1].StringToFormat(this.DM.mStringTable.GetStringByID(3931u));
            if (this.GUIM.IsArabic)
            {
                this.Cstr_btnCoordinate[1].AppendFormat("{3}{2} {1}{0}");
            }
            else
            {
                this.Cstr_btnCoordinate[1].AppendFormat("{0}{1} {2}{3}");
            }
            this.text_btnCoordinate[1].text = this.Cstr_btnCoordinate[1].ToString();
            this.text_btnCoordinate[1].SetAllDirty();
            this.text_btnCoordinate[1].cachedTextGenerator.Invalidate();
            for (int j = 0; j < 3; j++)
            {
                this.Coordinate2_RT[j].sizeDelta = new Vector2(this.text_btnCoordinate[1].preferredWidth, this.Coordinate2_RT[j].sizeDelta.y);
            }
        }
        this.Img_Lock.gameObject.SetActive(active);
        if (this.text_TimeBar.IsActive())
        {
            this.timeBar.m_TimeText.gameObject.SetActive(false);
        }
        else if (!this.timeBar.m_TimeText.IsActive())
        {
            this.timeBar.m_TimeText.gameObject.SetActive(true);
        }
        if (this.bHaveTroops)
        {
            this.tmpPanel.SetPanelData(this._DataIdx, false, true, (int)this.m_Effect, this.mStatus, 0f);
            this.tmpPanel.InitScrollPanel();
        }
        else
        {
            this.text_NoTroops.gameObject.SetActive(true);
        }
    }
Ejemplo n.º 8
0
    // Token: 0x06001BDD RID: 7133 RVA: 0x0031847C File Offset: 0x0031667C
    public void ShowHint(byte type = 1, RectTransform tipRect = null)
    {
        this.m_RectTransform.gameObject.SetActive(true);
        this.Type = type;
        AllianceWarManager allianceWarMgr = ActivityManager.Instance.AllianceWarMgr;

        if (this.Type == 1)
        {
            this.m_BGRectTransform.gameObject.SetActive(false);
            this.m_BGRectTransform2.gameObject.SetActive(true);
            this.m_Main[0].gameObject.SetActive(false);
            float num  = 0f;
            bool  flag = GUIManager.Instance.BuildingData.GetBuildData(8, 0).Level >= 17;
            this.m_Text_F.gameObject.SetActive(flag);
            if (flag)
            {
                num += 22f;
                this.m_Line2.rectTransform.anchoredPosition = new Vector2(this.m_Line2.rectTransform.anchoredPosition.x, -161f);
            }
            else
            {
                this.m_Line2.rectTransform.anchoredPosition = new Vector2(this.m_Line2.rectTransform.anchoredPosition.x, -139f);
            }
            this.m_Main[0].gameObject.SetActive(allianceWarMgr.m_AllianceWarHintData.bMain);
            for (int i = 0; i < 5; i++)
            {
                if (allianceWarMgr.m_AllianceWarHintData.HeroData[i].ID != 0)
                {
                    this.m_HeroBtn2[i].gameObject.SetActive(true);
                    this.m_Frame2[i].gameObject.SetActive(false);
                    GUIManager.Instance.ChangeHeroItemImg(this.m_HeroBtn2[i].transform, eHeroOrItem.Hero, allianceWarMgr.m_AllianceWarHintData.HeroData[i].ID, allianceWarMgr.m_AllianceWarHintData.HeroData[i].Star, allianceWarMgr.m_AllianceWarHintData.HeroData[i].Rank, 0);
                }
                else
                {
                    this.m_HeroBtn2[i].gameObject.SetActive(false);
                    this.m_Frame2[i].gameObject.SetActive(true);
                }
            }
            DataManager instance = DataManager.Instance;
            this.m_StrStrength.ClearString();
            this.m_StrStrength.Append(instance.mStringTable.GetStringByID(9788u));
            this.m_StrStrength.Append(instance.mStringTable.GetStringByID((uint)((ushort)(9778 + (int)allianceWarMgr.m_AllianceWarHintData.ArmyCoordIndex))));
            this.m_Text_F.text = this.m_StrStrength.ToString();
            this.m_Text_F.SetAllDirty();
            this.m_Text_F.cachedTextGenerator.Invalidate();
            int num2 = 0;
            for (int j = 0; j < 16; j++)
            {
                int num3 = 3 - j / 4 + j % 4 * 4;
                if (allianceWarMgr.m_AllianceWarHintData.TroopData[num3] > 0u)
                {
                    SoldierData recordByKey = instance.SoldierDataTable.GetRecordByKey((ushort)(num3 + 1));
                    this.m_dataNum[num2].ClearString();
                    if ((int)recordByKey.SoldierKind < this.mSprite.Length)
                    {
                        this.m_data_Icon[num2].sprite = this.mSprite[(int)recordByKey.SoldierKind];
                    }
                    else
                    {
                        this.m_data_Icon[num2].sprite = this.mSprite[0];
                    }
                    this.m_Text_data_Rank[num2].text = recordByKey.Tier.ToString();
                    this.m_Text_data_Name[num2].text = instance.mStringTable.GetStringByID((uint)recordByKey.Name);
                    this.m_Text_data_Name[num2].SetAllDirty();
                    this.m_Text_data_Name[num2].cachedTextGenerator.Invalidate();
                    this.m_Text_data_Name[num2].cachedTextGeneratorForLayout.Invalidate();
                    this.m_dataNum[num2].ClearString();
                    this.m_dataNum[num2].IntToFormat((long)((ulong)allianceWarMgr.m_AllianceWarHintData.TroopData[num3]), 1, true);
                    this.m_dataNum[num2].AppendFormat("{0}");
                    this.m_Text_data_Num[num2].text = this.m_dataNum[num2].ToString();
                    this.m_Text_data_Num[num2].SetAllDirty();
                    this.m_Text_data_Num[num2].cachedTextGenerator.Invalidate();
                    this.m_Text_data_Num[num2].cachedTextGeneratorForLayout.Invalidate();
                    this.m_T_data[num2].gameObject.SetActive(true);
                    num2++;
                }
            }
            for (int k = num2; k < 16; k++)
            {
                this.m_T_data[k].gameObject.SetActive(false);
            }
            num += (float)(num2 * 28);
            this.m_BGRectTransform2.sizeDelta = new Vector2(this.m_BGRectTransform2.sizeDelta.x, 170f + num);
            RectTransform component = GUIManager.Instance.m_UICanvas.transform.GetComponent <RectTransform>();
            this.m_BGRectTransform2.anchoredPosition = new Vector2(0f, 0f);
            CString cstring  = StringManager.Instance.StaticString1024();
            CString cstring2 = StringManager.Instance.StaticString1024();
            cstring.ClearString();
            cstring2.ClearString();
            cstring.Append(allianceWarMgr.m_AllianceWarHintData.Name);
            if (allianceWarMgr.m_AllianceWarHintData.AllianceTagTag != string.Empty)
            {
                cstring2.Append(allianceWarMgr.m_AllianceWarHintData.AllianceTagTag);
                GameConstants.FormatRoleName(this.m_StrName, cstring, cstring2, null, 0, 0, null, null, null, null);
            }
            else
            {
                GameConstants.FormatRoleName(this.m_StrName, cstring, null, null, 0, 0, null, null, null, null);
            }
            this.m_TextName2.text = this.m_StrName.ToString();
            this.m_TextName2.SetAllDirty();
            this.m_TextName2.cachedTextGenerator.Invalidate();
            if (tipRect != null)
            {
                this.GetTipPosition(tipRect);
            }
        }
    }
Ejemplo n.º 9
0
    // Token: 0x06001BDC RID: 7132 RVA: 0x00318100 File Offset: 0x00316300
    public void Show(UIButtonHint hint, float X = 0f, float Y = 0f, byte type = 0)
    {
        if (this.m_RectTransform.gameObject.activeSelf)
        {
            this.Hide(this.m_ButtonHint);
        }
        this.m_RectTransform.gameObject.SetActive(true);
        ArenaManager instance = ArenaManager.Instance;

        this.m_StrRank.ClearString();
        this.m_StrStrength.ClearString();
        this.m_StrName.ClearString();
        this.Type = type;
        if (this.Type == 0)
        {
            this.m_BGRectTransform.anchoredPosition = new Vector2(X, Y);
            this.m_BGRectTransform.gameObject.SetActive(true);
            this.m_BGRectTransform2.gameObject.SetActive(false);
            for (int i = 0; i < 5; i++)
            {
                if (instance.m_ArenaTargetHint.HeroData != null && instance.m_ArenaTargetHint.HeroData[i].ID != 0)
                {
                    this.m_HeroBtn[i].gameObject.SetActive(true);
                    this.m_Frame[i].gameObject.SetActive(false);
                    GUIManager.Instance.ChangeHeroItemImg(this.m_HeroBtn[i].transform, eHeroOrItem.Hero, instance.m_ArenaTargetHint.HeroData[i].ID, instance.m_ArenaTargetHint.HeroData[i].Star, instance.m_ArenaTargetHint.HeroData[i].Rank, (int)instance.m_ArenaTargetHint.HeroData[i].Level);
                    if (instance.CheckHeroAstrology(instance.m_ArenaTargetHint.HeroData[i].ID))
                    {
                        this.m_Astrology[i].gameObject.SetActive(true);
                    }
                    else
                    {
                        this.m_Astrology[i].gameObject.SetActive(false);
                    }
                }
                else
                {
                    this.m_Astrology[i].gameObject.SetActive(false);
                    this.m_HeroBtn[i].gameObject.SetActive(false);
                    this.m_Frame[i].gameObject.SetActive(true);
                }
            }
            this.m_StrRank.IntToFormat((long)((ulong)instance.m_ArenaTargetHint.Place), 1, true);
            this.m_StrRank.AppendFormat("{0}");
            this.m_TextRank.text = this.m_StrRank.ToString();
            this.m_TextRank.SetAllDirty();
            this.m_TextRank.cachedTextGenerator.Invalidate();
            this.m_StrStrength.IntToFormat((long)((ulong)instance.GetAllPower(0, 0)), 1, true);
            this.m_StrStrength.AppendFormat("{0}");
            this.m_TextStrength.text = this.m_StrStrength.ToString();
            this.m_TextStrength.SetAllDirty();
            this.m_TextStrength.cachedTextGenerator.Invalidate();
            CString cstring  = StringManager.Instance.StaticString1024();
            CString cstring2 = StringManager.Instance.StaticString1024();
            cstring.ClearString();
            cstring2.ClearString();
            cstring.Append(instance.m_ArenaTargetHint.Name);
            if (instance.m_ArenaTargetHint.AllianceTagTag != string.Empty)
            {
                cstring2.Append(instance.m_ArenaTargetHint.AllianceTagTag);
                GameConstants.FormatRoleName(this.m_StrName, cstring, cstring2, null, 0, 0, null, null, null, null);
            }
            else
            {
                GameConstants.FormatRoleName(this.m_StrName, cstring, null, null, 0, 0, null, null, null, null);
            }
            this.m_TextName.text = this.m_StrName.ToString();
            this.m_TextName.SetAllDirty();
            this.m_TextName.cachedTextGenerator.Invalidate();
        }
    }
Ejemplo n.º 10
0
 // Token: 0x0600138E RID: 5006 RVA: 0x0022D754 File Offset: 0x0022B954
 public override void UpDateRowItem(GameObject item, int dataIdx, int panelObjectIdx, int panelId)
 {
     if (dataIdx == 0)
     {
         item.transform.GetChild(0).gameObject.SetActive(true);
         item.transform.GetChild(1).gameObject.SetActive(false);
         UIText component = item.transform.GetChild(0).GetChild(4).GetComponent <UIText>();
         component.text = DataManager.Instance.mStringTable.GetStringByID(7063u);
         component.SetAllDirty();
         component.cachedTextGenerator.Invalidate();
         component      = item.transform.GetChild(0).GetChild(5).GetComponent <UIText>();
         component.text = DataManager.Instance.mStringTable.GetStringByID(11011u);
         component.SetAllDirty();
         component.cachedTextGenerator.Invalidate();
         component      = item.transform.GetChild(0).GetChild(6).GetComponent <UIText>();
         component.text = DataManager.Instance.mStringTable.GetStringByID(11012u);
         component.SetAllDirty();
         component.cachedTextGenerator.Invalidate();
     }
     else
     {
         if (dataIdx > 0 && dataIdx <= LeaderBoardManager.Instance.MobiWorldKingBoard.Count)
         {
             item.transform.GetChild(0).gameObject.SetActive(false);
             item.transform.GetChild(1).gameObject.SetActive(true);
             item.transform.GetChild(1).GetChild(11).gameObject.SetActive(false);
             item.transform.GetChild(1).GetChild(12).gameObject.SetActive(false);
             this.SortTextArray[0, panelObjectIdx].ClearString();
             GameConstants.FormatRoleName(this.SortTextArray[0, panelObjectIdx], LeaderBoardManager.Instance.MobiWorldKingBoard[dataIdx - 1].Name, LeaderBoardManager.Instance.MobiWorldKingBoard[dataIdx - 1].AllianceTag, null, 0, LeaderBoardManager.Instance.MobiWorldKingBoard[dataIdx - 1].HomeKingdomID, null, null, null, null);
             UIText component = item.transform.GetChild(1).GetChild(4).GetComponent <UIText>();
             component.text = this.SortTextArray[0, panelObjectIdx].ToString();
             component.SetAllDirty();
             component.cachedTextGenerator.Invalidate();
             this.SortTextArray[1, panelObjectIdx].ClearString();
             GameConstants.GetTimeString(this.SortTextArray[1, panelObjectIdx], LeaderBoardManager.Instance.MobiWorldKingBoard[dataIdx - 1].OccupyTime, false, false, true, false, true);
             component      = item.transform.GetChild(1).GetChild(5).GetComponent <UIText>();
             component.text = this.SortTextArray[1, panelObjectIdx].ToString();
             component.SetAllDirty();
             component.cachedTextGenerator.Invalidate();
             this.SortTextArray[2, panelObjectIdx].ClearString();
             DateTime dateTime = GameConstants.GetDateTime(LeaderBoardManager.Instance.MobiWorldKingBoard[dataIdx - 1].TakeOfficeTime);
             this.SortTextArray[2, panelObjectIdx].StringToFormat(dateTime.ToString("MM/dd/yy"));
             this.SortTextArray[2, panelObjectIdx].AppendFormat("{0}");
             component           = item.transform.GetChild(1).GetChild(6).GetComponent <UIText>();
             component.text      = this.SortTextArray[2, panelObjectIdx].ToString();
             component.alignment = TextAnchor.MiddleCenter;
             component.SetAllDirty();
             component.cachedTextGenerator.Invalidate();
             UIButton component2 = item.transform.GetChild(1).GetChild(10).GetComponent <UIButton>();
             component2.m_Handler = this;
             component2.m_BtnID1  = 8;
             component2.m_BtnID2  = dataIdx - 1;
         }
         if (dataIdx % 2 == 0)
         {
             UISpritesArray component3 = item.transform.GetChild(1).GetChild(0).GetComponent <UISpritesArray>();
             component3.SetSpriteIndex(1);
             component3 = item.transform.GetChild(1).GetChild(1).GetComponent <UISpritesArray>();
             component3.SetSpriteIndex(1);
             component3 = item.transform.GetChild(1).GetChild(2).GetComponent <UISpritesArray>();
             component3.SetSpriteIndex(1);
             component3 = item.transform.GetChild(1).GetChild(3).GetComponent <UISpritesArray>();
             component3.SetSpriteIndex(1);
         }
         else
         {
             UISpritesArray component3 = item.transform.GetChild(1).GetChild(0).GetComponent <UISpritesArray>();
             component3.SetSpriteIndex(0);
             component3 = item.transform.GetChild(1).GetChild(1).GetComponent <UISpritesArray>();
             component3.SetSpriteIndex(0);
             component3 = item.transform.GetChild(1).GetChild(2).GetComponent <UISpritesArray>();
             component3.SetSpriteIndex(0);
             component3 = item.transform.GetChild(1).GetChild(3).GetComponent <UISpritesArray>();
             component3.SetSpriteIndex(0);
         }
     }
 }
Ejemplo n.º 11
0
 // Token: 0x060010DE RID: 4318 RVA: 0x001E19B0 File Offset: 0x001DFBB0
 public void UpDateRowItem(GameObject item, int dataIdx, int panelObjectIdx, int panelId)
 {
     this.ItemT = item.GetComponent <Transform>();
     if (this.tmpItem[panelObjectIdx] == null)
     {
         this.Img_ItmeRank[panelObjectIdx]             = this.ItemT.GetChild(1).GetComponent <Image>();
         this.tmpItemHIBtn[panelObjectIdx]             = this.ItemT.GetChild(3).GetComponent <UIHIBtn>();
         this.Img_ItmeNew[panelObjectIdx]              = this.ItemT.GetChild(4).GetComponent <Image>();
         this.tmpItemBtn[panelObjectIdx]               = this.ItemT.GetChild(5).GetComponent <UIButton>();
         this.tmpItemBtn[panelObjectIdx].m_Handler     = this;
         this.tmpItemHintBtn[panelObjectIdx]           = this.ItemT.GetChild(6).GetComponent <UIButton>();
         this.tmpItemHintBtn[panelObjectIdx].m_Handler = this;
         this.tmpItemHintBtn[panelObjectIdx].m_BtnID2  = panelObjectIdx;
         this.text_ItmeRank[panelObjectIdx]            = this.ItemT.GetChild(7).GetComponent <UIText>();
         this.text_ItmeResult_W[panelObjectIdx]        = this.ItemT.GetChild(8).GetComponent <UIText>();
         this.text_ItmeResult_L[panelObjectIdx]        = this.ItemT.GetChild(9).GetComponent <UIText>();
         this.text_ItmeTime[panelObjectIdx]            = this.ItemT.GetChild(10).GetComponent <UIText>();
         this.text_ItmeName[panelObjectIdx]            = this.ItemT.GetChild(11).GetComponent <UIText>();
         this.Img_ItmeHint[panelObjectIdx]             = this.ItemT.GetChild(12).GetComponent <Image>();
         this.text_ItmeHint[panelObjectIdx]            = this.ItemT.GetChild(12).GetChild(0).GetComponent <UIText>();
         UIButtonHint component = this.ItemT.GetChild(6).GetComponent <UIButtonHint>();
         component.m_Handler      = this;
         component.ControlFadeOut = this.Img_ItmeHint[panelObjectIdx].gameObject;
     }
     if (dataIdx < this.AM.m_ArenaReportData.Count)
     {
         int index = this.AM.m_ArenaReportData.Count - 1 - dataIdx;
         if ((this.AM.m_ArenaReportData[index].Flag >> 1 & 1) == 1 && (this.AM.m_ArenaReportData[index].Flag & 1) == 0)
         {
             this.Img_ItmeRank[panelObjectIdx].gameObject.SetActive(false);
             this.text_ItmeRank[panelObjectIdx].gameObject.SetActive(false);
         }
         else
         {
             if (this.AM.m_ArenaReportData[index].ChangePlace > 0u)
             {
                 this.Img_ItmeRank[panelObjectIdx].gameObject.SetActive(true);
             }
             else
             {
                 this.Img_ItmeRank[panelObjectIdx].gameObject.SetActive(false);
             }
             this.text_ItmeRank[panelObjectIdx].gameObject.SetActive(true);
         }
         if ((this.AM.m_ArenaReportData[index].Flag & 1) == 1)
         {
             this.Img_ItmeRank[panelObjectIdx].sprite = this.SArray.m_Sprites[0];
             this.text_ItmeResult_W[panelObjectIdx].gameObject.SetActive(true);
             this.text_ItmeResult_L[panelObjectIdx].gameObject.SetActive(false);
         }
         else
         {
             this.text_ItmeResult_W[panelObjectIdx].gameObject.SetActive(false);
             this.text_ItmeResult_L[panelObjectIdx].gameObject.SetActive(true);
             if ((this.AM.m_ArenaReportData[index].Flag >> 1 & 1) == 0)
             {
                 this.Img_ItmeRank[panelObjectIdx].sprite = this.SArray.m_Sprites[1];
             }
         }
         if ((this.AM.m_ArenaReportData[index].Flag >> 1 & 1) == 1)
         {
             this.tmpItemHintBtn[panelObjectIdx].image.sprite = this.SArray.m_Sprites[2];
             this.text_ItmeHint[panelObjectIdx].text          = this.DM.mStringTable.GetStringByID(9166u);
         }
         else
         {
             this.tmpItemHintBtn[panelObjectIdx].image.sprite = this.SArray.m_Sprites[3];
             this.text_ItmeHint[panelObjectIdx].text          = this.DM.mStringTable.GetStringByID(9165u);
         }
         this.text_ItmeHint[panelObjectIdx].SetAllDirty();
         this.text_ItmeHint[panelObjectIdx].cachedTextGenerator.Invalidate();
         this.text_ItmeHint[panelObjectIdx].cachedTextGeneratorForLayout.Invalidate();
         if (this.text_ItmeHint[panelObjectIdx].preferredWidth > this.text_ItmeHint[panelObjectIdx].rectTransform.sizeDelta.x)
         {
             this.text_ItmeHint[panelObjectIdx].rectTransform.sizeDelta = new Vector2(this.text_ItmeHint[panelObjectIdx].preferredWidth, this.text_ItmeHint[panelObjectIdx].rectTransform.sizeDelta.y);
             this.Img_ItmeHint[panelObjectIdx].rectTransform.sizeDelta  = new Vector2(this.text_ItmeHint[panelObjectIdx].preferredWidth + 10f, this.Img_ItmeHint[panelObjectIdx].rectTransform.sizeDelta.y);
         }
         if ((this.AM.m_ArenaReportData[index].Flag >> 2 & 1) == 0)
         {
             this.Img_ItmeNew[panelObjectIdx].gameObject.SetActive(true);
         }
         else
         {
             this.Img_ItmeNew[panelObjectIdx].gameObject.SetActive(false);
         }
         this.Cstr_Rank[panelObjectIdx].ClearString();
         if (this.AM.m_ArenaReportData[index].ChangePlace > 0u)
         {
             this.Cstr_Rank[panelObjectIdx].IntToFormat((long)((ulong)this.AM.m_ArenaReportData[index].ChangePlace), 1, true);
             this.Cstr_Rank[panelObjectIdx].AppendFormat("{0}");
         }
         this.text_ItmeRank[panelObjectIdx].text = this.Cstr_Rank[panelObjectIdx].ToString();
         this.text_ItmeRank[panelObjectIdx].SetAllDirty();
         this.text_ItmeRank[panelObjectIdx].cachedTextGenerator.Invalidate();
         this.GUIM.ChangeHeroItemImg(this.tmpItemHIBtn[panelObjectIdx].transform, eHeroOrItem.Hero, this.AM.m_ArenaReportData[index].EnemyHead, 11, 0, 0);
         this.Cstr_Name[panelObjectIdx].ClearString();
         CString cstring  = StringManager.Instance.StaticString1024();
         CString cstring2 = StringManager.Instance.StaticString1024();
         cstring.ClearString();
         cstring2.ClearString();
         cstring.Append(this.AM.m_ArenaReportData[index].EnemyName);
         if (this.AM.m_ArenaReportData[index].EnemyAllianceTag != string.Empty)
         {
             cstring2.Append(this.AM.m_ArenaReportData[index].EnemyAllianceTag);
             GameConstants.FormatRoleName(this.Cstr_Name[panelObjectIdx], cstring, cstring2, null, 0, 0, null, null, null, null);
         }
         else
         {
             GameConstants.FormatRoleName(this.Cstr_Name[panelObjectIdx], cstring, null, null, 0, 0, null, null, null, null);
         }
         this.text_ItmeName[panelObjectIdx].text = this.Cstr_Name[panelObjectIdx].ToString();
         this.text_ItmeName[panelObjectIdx].SetAllDirty();
         this.text_ItmeName[panelObjectIdx].cachedTextGenerator.Invalidate();
         this.text_ItmeTime[panelObjectIdx].text = GameConstants.GetDateTime(this.AM.m_ArenaReportData[index].Time).ToString("MM/dd/yy HH:mm:ss");
         this.text_ItmeTime[panelObjectIdx].SetAllDirty();
         this.text_ItmeTime[panelObjectIdx].cachedTextGenerator.Invalidate();
     }
 }