Exemplo n.º 1
0
    public void InnerHandle_InBat_PreConfigMsg(COM_INBATTLE_CHAT_TYPE chatType, uint herocfgID, uint cfg_id, ulong ullUid)
    {
        ResInBatMsgHeroActCfg heroActCfg = Singleton <InBattleMsgMgr> .instance.GetHeroActCfg(herocfgID, cfg_id);

        ResInBatMsgCfg cfgData = Singleton <InBattleMsgMgr> .instance.GetCfgData(cfg_id);

        if (cfgData != null)
        {
            if (heroActCfg != null)
            {
                InBattleMsgUT.ShowInBattleMsg(chatType, ullUid, herocfgID, heroActCfg.szContent, heroActCfg.szSound, true);
            }
            else
            {
                InBattleMsgUT.ShowInBattleMsg(chatType, ullUid, herocfgID, cfgData.szContent, cfgData.szSound, false);
            }
            if ((chatType == COM_INBATTLE_CHAT_TYPE.COM_INBATTLE_CHATTYPE_SIGNAL) && (Singleton <CBattleSystem> .instance.TheMinimapSys.CurMapType() == MinimapSys.EMapType.Mini))
            {
                ReadonlyContext <PoolObjHandle <ActorRoot> > allHeroes = Singleton <GamePlayerCenter> .instance.GetPlayerByUid(ullUid).GetAllHeroes();

                for (int i = 0; i < allHeroes.Count; i++)
                {
                    PoolObjHandle <ActorRoot> handle = allHeroes[i];
                    ActorRoot root = handle.handle;
                    if ((root != null) && (root.TheActorMeta.ConfigId == herocfgID))
                    {
                        Vector2 sreenLoc = CUIUtility.WorldToScreenPoint(this.m_battleForm.GetCamera(), root.HudControl.GetSmallMapPointer_WorldPosition());
                        Singleton <CUIParticleSystem> .instance.AddParticle(cfgData.szMiniMapEffect, 2f, sreenLoc);

                        return;
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
        public static void SendInBattleMsg_PreConfig(uint id, COM_INBATTLE_CHAT_TYPE msgType, uint heroID)
        {
            CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x514);

            msg.stPkgData.stChatReq.stChatMsg.bType = 7;
            msg.stPkgData.stChatReq.stChatMsg.stContent.select(7L);
            msg.stPkgData.stChatReq.stChatMsg.stContent.stInBattle.bChatType = (byte)msgType;
            msg.stPkgData.stChatReq.stChatMsg.stContent.stInBattle.stChatInfo.select((long)msgType);
            msg.stPkgData.stChatReq.stChatMsg.stContent.stInBattle.stFrom.dwAcntHeroID = heroID;
            if (msgType == COM_INBATTLE_CHAT_TYPE.COM_INBATTLE_CHATTYPE_SIGNAL)
            {
                msg.stPkgData.stChatReq.stChatMsg.stContent.stInBattle.stChatInfo.stSignalID.dwTextID = id;
            }
            else if (msgType == COM_INBATTLE_CHAT_TYPE.COM_INBATTLE_CHATTYPE_BUBBLE)
            {
                msg.stPkgData.stChatReq.stChatMsg.stContent.stInBattle.stChatInfo.stBubbleID.dwTextID = id;
            }
            Singleton <NetworkModule> .GetInstance().SendGameMsg(ref msg, 0);
        }
Exemplo n.º 3
0
        public static void SendInBattleMsg_PreConfig(uint id, COM_INBATTLE_CHAT_TYPE msgType, uint heroID)
        {
            CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1300u);

            cSPkg.stPkgData.get_stChatReq().stChatMsg.bType = 7;
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.select(7L);
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stInBattle().bChatType = msgType;
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stInBattle().stChatInfo.select(msgType);
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stInBattle().stFrom.dwAcntHeroID = heroID;
            if (msgType == 1)
            {
                cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stInBattle().stChatInfo.get_stSignalID().dwTextID = id;
            }
            else if (msgType == 2)
            {
                cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stInBattle().stChatInfo.get_stBubbleID().dwTextID = id;
            }
            Singleton <NetworkModule> .GetInstance().SendGameMsg(ref cSPkg, 0u);
        }
        public static void ShowInBattleMsg(COM_INBATTLE_CHAT_TYPE type, ulong playerid, uint heroID, string content, string sound)
        {
            if (type == COM_INBATTLE_CHAT_TYPE.COM_INBATTLE_CHATTYPE_SIGNAL)
            {
                CSignalTips_InBatMsg obj = new CSignalTips_InBatMsg(playerid, heroID, content, sound);
                Singleton <CBattleSystem> .instance.FightForm.GetSignalPanel().Add_SignalTip(obj);

                InBattleMsgUT.PlaySound(sound, playerid);
            }
            else if (type == COM_INBATTLE_CHAT_TYPE.COM_INBATTLE_CHATTYPE_BUBBLE)
            {
                InBattleMsgUT.ShowBubble(playerid, heroID, content);
                InBattleShortcut shortcutChat = Singleton <InBattleMsgMgr> .instance.m_shortcutChat;
                if (shortcutChat != null)
                {
                    shortcutChat.UpdatePlayerBubbleTimer(playerid, heroID);
                }
                InBattleMsgUT.PlaySound(sound, playerid);
            }
        }
Exemplo n.º 5
0
    public void InnerHandle_InBat_PreConfigMsg(COM_INBATTLE_CHAT_TYPE chatType, uint herocfgID, uint cfg_id, ulong ullUid)
    {
        ResInBatMsgHeroActCfg heroActCfg = Singleton <InBattleMsgMgr> .get_instance().GetHeroActCfg(herocfgID, cfg_id);

        ResInBatMsgCfg cfgData = Singleton <InBattleMsgMgr> .get_instance().GetCfgData(cfg_id);

        if (cfgData == null)
        {
            return;
        }
        if (heroActCfg != null)
        {
            InBattleMsgUT.ShowInBattleMsg(chatType, ullUid, herocfgID, heroActCfg.szContent, heroActCfg.szSound);
        }
        else
        {
            InBattleMsgUT.ShowInBattleMsg(chatType, ullUid, herocfgID, cfgData.szContent, cfgData.szSound);
        }
        if (chatType == 1 && Singleton <CBattleSystem> .get_instance().TheMinimapSys.CurMapType() == MinimapSys.EMapType.Mini)
        {
            Player playerByUid = Singleton <GamePlayerCenter> .get_instance().GetPlayerByUid(ullUid);

            ReadonlyContext <PoolObjHandle <ActorRoot> > allHeroes = playerByUid.GetAllHeroes();
            for (int i = 0; i < allHeroes.get_Count(); i++)
            {
                ActorRoot handle = allHeroes.get_Item(i).get_handle();
                if (handle != null && (long)handle.TheActorMeta.ConfigId == (long)((ulong)herocfgID))
                {
                    Camera currentCamera = Singleton <Camera_UI3D> .GetInstance().GetCurrentCamera();

                    if (currentCamera != null)
                    {
                        Vector2 sreenLoc = currentCamera.WorldToScreenPoint(handle.HudControl.GetSmallMapPointer_WorldPosition());
                        Singleton <CUIParticleSystem> .get_instance().AddParticle(cfgData.szMiniMapEffect, 2f, sreenLoc);
                    }
                }
            }
        }
    }
Exemplo n.º 6
0
        public static void ShowInBattleMsg(COM_INBATTLE_CHAT_TYPE type, ulong playerid, uint heroID, string content, string sound)
        {
            if (type == COM_INBATTLE_CHAT_TYPE.COM_INBATTLE_CHATTYPE_SIGNAL)
            {
                CSignalTips_InBatMsg msg = new CSignalTips_InBatMsg(playerid, heroID, content, sound);
                Singleton <CBattleSystem> .instance.GetSignalPanel().Add_SignalTip(msg);

                if (!string.IsNullOrEmpty(sound))
                {
                    Singleton <CSoundManager> .GetInstance().PlayBattleSound(sound, null);
                }
            }
            else if (type == COM_INBATTLE_CHAT_TYPE.COM_INBATTLE_CHATTYPE_BUBBLE)
            {
                ShowBubble(playerid, heroID, content);
                Singleton <InBattleMsgMgr> .instance.UpdatePlayerBubbleTimer(playerid, heroID);

                if (!string.IsNullOrEmpty(sound))
                {
                    Singleton <CSoundManager> .GetInstance().PlayBattleSound(sound, null);
                }
            }
        }