Beispiel #1
0
 public Message(MessageType type, FightPlayerInfo player, int popupInfoId)
 {
     this.type        = type;
     this.player      = player;
     this.popupInfoId = popupInfoId;
 }
Beispiel #2
0
        public void ShowMessage(MessageType type, FightPlayerInfo player, Action noAction = null, Action yesAction = null)
        {
            string    text = (player != null) ? player.Info.Nickname : "Player";
            PopupInfo info;
            int       popupInfoId;

            switch (type)
            {
            case MessageType.InvitationReceived:
            {
                StateContext stateContext5 = m_stateContext;
                info = new PopupInfo
                {
                    message = new RawTextData(22824, text),
                    buttons = new ButtonData[2]
                    {
                        new ButtonData(9912, yesAction),
                        new ButtonData(68421, noAction, closeOnClick: true, ButtonStyle.Negative)
                    },
                    selectedButton = 1,
                    style          = PopupStyle.Normal,
                    useBlur        = true
                };
                popupInfoId = PopupInfoManager.Show(stateContext5, info);
                break;
            }

            case MessageType.InvitationDeclined:
            {
                StateContext stateContext4 = m_stateContext;
                info = new PopupInfo
                {
                    message = new RawTextData(32703, text),
                    buttons = new ButtonData[1]
                    {
                        new ButtonData(27169)
                    },
                    selectedButton = 1,
                    style          = PopupStyle.Normal,
                    useBlur        = true
                };
                popupInfoId = PopupInfoManager.Show(stateContext4, info);
                break;
            }

            case MessageType.InvitationFail:
            {
                StateContext stateContext3 = m_stateContext;
                info = new PopupInfo
                {
                    message = new RawTextData(18236, text),
                    buttons = new ButtonData[1]
                    {
                        new ButtonData(27169)
                    },
                    style   = PopupStyle.Error,
                    useBlur = true
                };
                popupInfoId = PopupInfoManager.Show(stateContext3, info);
                break;
            }

            case MessageType.PlayerLeaveGroup:
            {
                StateContext stateContext2 = m_stateContext;
                info = new PopupInfo
                {
                    message = new RawTextData(34361, text),
                    buttons = new ButtonData[1]
                    {
                        new ButtonData(27169)
                    },
                    style   = PopupStyle.Normal,
                    useBlur = true
                };
                popupInfoId = PopupInfoManager.Show(stateContext2, info);
                break;
            }

            case MessageType.JoinGroupFail:
            {
                StateContext stateContext = m_stateContext;
                info = new PopupInfo
                {
                    message = new RawTextData(80127),
                    buttons = new ButtonData[1]
                    {
                        new ButtonData(27169)
                    },
                    style   = PopupStyle.Normal,
                    useBlur = true
                };
                popupInfoId = PopupInfoManager.Show(stateContext, info);
                break;
            }

            default:
                throw new ArgumentOutOfRangeException("type", type, null);
            }
            m_messageStack.Add(new Message(type, player, popupInfoId));
        }