コード例 #1
0
ファイル: SNSChatWndView.cs プロジェクト: zwong91/Titan
        //     private bool isChatWndAlreadyOpen(int nSessionID)
        //     {
        //SNSChatSubWndView subWndView = null;

        //string sessionName = LogicDataCenter.snsDataManager.getSessionName(nSessionID);
        //         if (m_subChatWndList.TryGetValue(sessionName, out subWndView))
        //         {
        //             return subWndView.gameObject.activeSelf;
        //         }
        //         else
        //         {
        //             return false;
        //         }
        //     }

        private void addNewMsgDIDA(long SessionID, DIDARemoveData removeData)
        {
            if (!m_DIDAList.ContainsKey(SessionID))
            {
                m_DIDAList.Add(SessionID, new List <DIDARemoveData>());
            }
            m_DIDAList[SessionID].Add(removeData);
        }
コード例 #2
0
        public void addNewMsgDIDA(DIDARemoveData removeData)
        {
            if (removeData == null)
            {
                return;
            }

            m_NewMsgDIDAList.Add(removeData);
        }
コード例 #3
0
ファイル: SNSChatWndView.cs プロジェクト: zwong91/Titan
        public void onAddMsgData(SNSAddChatMsgData data)
        {
            if (data == null)
            {
                return;
            }

            long SessionID = data.SessionID;

            // 如果窗口已经打开了,则更新到窗口
            if (IsVisible() && m_CurSessionID == SessionID)
            {
                m_CurSessionID = SessionID;
                onUpdateView();
            }
            else   // 如果窗口没打开,提示有新的消息
            {
                // 新的聊听消息
                DIDAAddData msg = new DIDAAddData();
                msg.eLayout          = EDIDALayout.EDT_Left;
                msg.nDIDATime        = 60;
                msg.nItemID          = (int)EDIDAType.EDIDA_Chat;
                msg.bAllowRepeatItem = true;
                msg.nButtonIconID    = (int)EDIDAType.EDIDA_Chat;
                msg.strTooltip       = ULocalizationService.Instance.Get("UIView", "SNS", "NewChatMsgDesc");
                msg.bShowInWar       = true;


                SNSNewChatMsgInfo newChatInfo = new SNSNewChatMsgInfo();
                newChatInfo.SessionID = SessionID;
                msg.sCustomData       = newChatInfo;
                msg.callBack          = (CustomerInfo) =>
                {
                    // 显示聊天框
                    SNSOpenChatWndMsgData msgData = new SNSOpenChatWndMsgData();
                    msgData.msgID     = (int)WndMsgID.WND_MSG_SNS_SHOW_CHAT_WND;
                    msgData.SessionID = SessionID;
                    UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_SNS_SHOW_CHAT_WND, msgData);
                };

                LogicDataCenter.didaDataManager.AddItem(msg);

                // 添加DIDA到窗口缓存
                DIDARemoveData removeMsg = new DIDARemoveData();
                removeMsg.nItemID     = msg.nItemID;
                removeMsg.sCustomData = newChatInfo;
                addNewMsgDIDA(SessionID, removeMsg);
            }
        }
コード例 #4
0
        // DIDA移除有三处:1、时间到2、点DIDA3、点参加    设置DIDA:该位置、线上赛
        public void SetLegendCupDIDA(bool bActive, long nLegendCupID, int nRoundID, int nSearchID)
        {
            cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(nLegendCupID);

            if (cupBaseData.nLegendCupID == 0 || cupBaseData.nIsOnline <= 0)
            {
                return;
            }

            SideButtonLegendBuildingSN dataInfo = new SideButtonLegendBuildingSN();

            dataInfo.nLegendCupID = (uint)nLegendCupID;
            dataInfo.nSearchID    = nSearchID;
            if (bActive)
            {
                DIDAAddData addMsg = new DIDAAddData();
                addMsg.nItemID          = (int)EDIDAType.EDIDA_LegendCup;
                addMsg.bAllowRepeatItem = true;
                addMsg.nButtonIconID    = (int)EDIDAType.EDIDA_LegendCup;
                addMsg.strButtonText    = ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "JoinCupRoom");
                addMsg.strTooltip       = ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "JoinCupRoom");
                addMsg.sCustomData      = dataInfo;
                addMsg.callBack         = (CustomerData) =>
                {
                    SideButtonDataBuildingSN customerData = CustomerData as SideButtonDataBuildingSN;
                    UIDialogData             tooltipData  = new UIDialogData(
                        title: cupBaseData.szCupName,
                        message: "[" + cupBaseData.szCupName + "]" + ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "JoinCupRoomContent"),
                        buttons: new UIWidgets.DialogActions()
                    {
                        { ULocalizationService.Instance.Get("UIView", "Team", "AgreeButtonDes"), () => { RequestDIDACallBack(true, nLegendCupID, nRoundID, nSearchID); return(true); } },
                        { ULocalizationService.Instance.Get("UIView", "Team", "DisAgreeButtonDes"), () => { RequestDIDACallBack(false, nLegendCupID, nRoundID, nSearchID); return(true); } }
                    });
                    UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_DIALOG, tooltipData);
                };

                LogicDataCenter.didaDataManager.AddItem(addMsg);
            }
            else
            {
                DIDARemoveData rmMsg = new DIDARemoveData();
                rmMsg.nItemID     = (int)EDIDAType.EDIDA_LegendCup;
                rmMsg.sCustomData = dataInfo;
                LogicDataCenter.didaDataManager.RemoveItem(rmMsg);
            }
        }
コード例 #5
0
ファイル: DIDAWnd.cs プロジェクト: zwong91/Titan
        public void OnClick()
        {
            //if (LogicDataCenter.didaDataManager.bInProcessList[m_nItemID])
            //{
            //    UIUtil.ShowSystemMessage(EMChatTipID.CHAT_TIP_ENTITY_DIDA_CANNOT_OPEN);
            //    return;
            //}

            //// 置位该类型正在处理中
            //LogicDataCenter.didaDataManager.bInProcessList[m_nItemID] = true;

            callBack(sCustomData);

            DIDARemoveData msg = new DIDARemoveData();

            msg.nItemID     = m_nItemID;
            msg.sCustomData = sCustomData;
            LogicDataCenter.didaDataManager.RemoveItem(msg);
        }
コード例 #6
0
        private void addNewMsgDIDA(int nSessionID, DIDARemoveData removeData)
        {
            // 显示窗口,没有就创建窗口
            string     sessionName   = LogicDataCenter.snsDataManager.getSessionName(nSessionID);
            GameObject subChatWndObj = null;

            if (!m_subChatWndList.TryGetValue(sessionName, out subChatWndObj))
            {
                subChatWndObj = ResNode.InstantiateRes(ChatWndDefaultITem);
                subChatWndObj.SetActive(false);
                subChatWndObj.transform.SetParent(ChatWndDefaultITem.transform.parent, false);
                m_subChatWndList.Add(sessionName, subChatWndObj);
                subChatWndObj.GetComponent <SNSChatWndView>().Init();
                subChatWndObj.GetComponent <SNSChatWndView>().SessionName = sessionName;
                subChatWndObj.GetComponent <SNSChatWndView>().SessionID   = nSessionID;
            }
            // 增加DIDA提示消息
            subChatWndObj.GetComponent <SNSChatWndView>().addNewMsgDIDA(removeData);
        }
コード例 #7
0
 public void RemoveItem(DIDARemoveData data)
 {
     for (int i = 0; i < (int)EDIDALayout.MAX; i++)
     {
         List <DIDAAddData> dataList = m_itemList[(EDIDALayout)i];
         List <float>       timeList = m_nTimeList[(EDIDALayout)i];
         for (int j = dataList.Count - 1; j >= 0; --j)
         {
             if (dataList[j].nItemID == data.nItemID && dataList[j].sCustomData.Equals(data.sCustomData))
             {
                 dataList.RemoveAt(j);
                 timeList.RemoveAt(j);
             }
         }
         m_itemList[(EDIDALayout)i]  = dataList;
         m_nTimeList[(EDIDALayout)i] = timeList;
         RefreshViewData((EDIDALayout)i);
     }
 }
コード例 #8
0
        public void onAddMsgData(int nSessionID)
        {
            // 如果窗口已经打开了,则更新到窗口
            if (isChatWndAlreadyOpen(nSessionID))
            {
                GameObject subChatWndObj;

                string sessionName = LogicDataCenter.snsDataManager.getSessionName(nSessionID);
                if (m_subChatWndList.TryGetValue(sessionName, out subChatWndObj))
                {
                    subChatWndObj.GetComponent <SNSChatWndView>().onUpdateChatMessage();
                }
            }
            else   // 如果窗口没打开,提示有新的消息
            {
                // 新的聊听消息
                DIDAAddData msg = new DIDAAddData();
                msg.eLayout          = EDIDALayout.EDT_Left;
                msg.nDIDATime        = 60;
                msg.nItemID          = (int)EDIDAType.EDIDA_Chat;
                msg.bAllowRepeatItem = true;
                msg.nButtonIconID    = (int)EDIDAType.EDIDA_Chat;
                msg.strTooltip       = ULocalizationService.Instance.Get("UIView", "SNS", "NewChatMsgDesc");

                SNSNewChatMsgInfo newChatInfo = new SNSNewChatMsgInfo();
                newChatInfo.nSessionID = nSessionID;
                msg.sCustomData        = newChatInfo;
                msg.callBack           = (CustomerInfo) =>
                {
                    onOpenChatWnd(nSessionID);
                };

                LogicDataCenter.didaDataManager.AddItem(msg);

                // 添加DIDA到窗口缓存
                DIDARemoveData removeMsg = new DIDARemoveData();
                removeMsg.nItemID     = msg.nItemID;
                removeMsg.sCustomData = newChatInfo;
                addNewMsgDIDA(nSessionID, removeMsg);
            }
        }