예제 #1
0
        void OnClickKickOut()
        {
            FusionAudio.PostEvent("UI/General/ButtonClick");
            if (!isCouldClick())
            {
                return;
            }

            messageTips = string.Format(LegionConfig.GetLegionText("ID_LEGION_MEMBERINFO_TIP_MESSAGE3"), mData.memberName);
            if (onClickKickOut != null)
            {
                isNeedCloseUI = true;
                onClickKickOut(_choiceUid);
            }
        }
예제 #2
0
        void OnClickDemote()
        {
            FusionAudio.PostEvent("UI/General/ButtonClick");
            if (!isCouldClick())
            {
                return;
            }

            messageTips = string.Format(LegionConfig.GetLegionText("ID_LEGION_MEMBERINFO_TIP_MESSAGE2"), mData.memberName, GetMemberPos(mData.dutyType, false));

            if (onClickDemote != null)
            {
                onClickDemote(_choiceUid);
            }
        }
예제 #3
0
        void OnClickGiveOwner()
        {
            FusionAudio.PostEvent("UI/General/ButtonClick");
            if (!isCouldClick())
            {
                return;
            }

            messageTips = string.Format(LegionConfig.GetLegionText("ID_LEGION_MEMBERINFO_TIP_MESSAGE4"), mData.memberName);

            if (onClickGiveOwner != null)
            {
                onClickGiveOwner(_choiceUid);
                UpdateAnchors();
            }
        }
예제 #4
0
        //获取军团职位文本
        public string GetMemberPosName(eAllianceMemberRole type)
        {
            string str = "";

            if (type == eAllianceMemberRole.Owner)
            {
                str = LegionConfig.GetLegionText("ID_LEGION_ROLE_OWNER_NAME");
            }
            else if (type == eAllianceMemberRole.ExtraOwner)
            {
                str = LegionConfig.GetLegionText("ID_LEGION_ROLE_EXTRA_OWNER_NAME");
            }
            else if (type == eAllianceMemberRole.Admin)
            {
                str = LegionConfig.GetLegionText("ID_LEGION_ROLE_ADMIN_NAME");
            }
            else if (type == eAllianceMemberRole.Member)
            {
                str = LegionConfig.GetLegionText("ID_LEGION_ROLE_MEMBER_NAME");
            }

            return(str);
        }
예제 #5
0
        public void SetLegionMessages(List <AllianceMessage> messages)
        {
            if (messages == null)
            {
                return;
            }

            legionData.listMessageItem.Clear();

            for (int i = 0; i < messages.Count; i++)
            {
                if (messages[i].Time > legionData.messageLastTime)
                {
                    legionData.messageLastTime        = messages[i].Time; //须记下最后一次的时间用来进行增量下载
                    legionData.messageLastRuntimeTime = Time.unscaledTime;
                }
                System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区
                DateTime        dt        = startTime.AddSeconds(messages[i].Time);
                int             year      = dt.Year;
                int             month     = dt.Month;
                int             day       = dt.Day;
                int             hour      = dt.Hour;
                int             min       = dt.Minute;

                MessageCellData cellData = new MessageCellData(); //先构建必须构建的单元
                cellData.hour = hour;
                cellData.min  = dt.Minute;

                string hourStr = hour < 10 ? "0" + hour : hour.ToString();
                string minStr  = min < 10 ? "0" + min : min.ToString();
                switch (messages[i].Type)
                {
                case "create":
                    cellData.content = string.Format(LegionConfig.GetLegionText("ID_LEGION_SYSTEM_MESSAGE1"), hourStr, minStr, messages[i].Name);
                    break;

                case "join":
                    cellData.content = string.Format(LegionConfig.GetLegionText("ID_LEGION_SYSTEM_MESSAGE2"), hourStr, minStr, messages[i].Name);
                    break;

                case "leave":
                    cellData.content = string.Format(LegionConfig.GetLegionText("ID_LEGION_SYSTEM_MESSAGE3"), hourStr, minStr, messages[i].Name);
                    break;

                case "kick":
                    cellData.content = string.Format(LegionConfig.GetLegionText("ID_LEGION_SYSTEM_MESSAGE4"), hourStr, minStr, messages[i].Name);
                    break;

                case "promote":
                    cellData.content = string.Format(LegionConfig.GetLegionText("ID_LEGION_SYSTEM_MESSAGE5"), hourStr, minStr, messages[i].Name);
                    break;

                case "demote":
                    cellData.content = string.Format(LegionConfig.GetLegionText("ID_LEGION_SYSTEM_MESSAGE6"), hourStr, minStr, messages[i].Name);
                    break;

                case "newOwner":
                    cellData.content = string.Format(LegionConfig.GetLegionText("ID_LEGION_SYSTEM_MESSAGE7"), hourStr, minStr, messages[i].Name);
                    break;

                case "levelup":
                    cellData.content = string.Format(LegionConfig.GetLegionText("ID_LEGION_SYSTEM_MESSAGE8"), hourStr, minStr, messages[i].Name);
                    break;

                default:
                    break;
                }
                bool isFind = false;
                for (int j = 0; j < legionData.listMessageItem.Count; j++)
                {
                    if (legionData.listMessageItem[j].IsContain(year, month, day))
                    {
                        isFind = true;
                        legionData.listMessageItem[j].listCell.Add(cellData);
                        break;
                    }
                }

                if (!isFind)
                {
                    MessageItemData mid = new MessageItemData(); //找不到就创建大节点 并将单元加入
                    mid.year  = year;
                    mid.day   = day;
                    mid.month = month;
                    mid.listCell.Add(cellData);
                    legionData.listMessageItem.Insert(0, mid);
                }
            }

            if (LegionEvent.NotifyUpdateLegionMessages != null)
            {
                LegionEvent.NotifyUpdateLegionMessages(legionData.listMessageItem);
            }
        }