Esempio n. 1
0
        public void SetXPSkillInfo(int nSpellID)
        {
            if (nSpellID <= 0)
            {
                Debug.LogWarning("XPSKill," + nSpellID);
                return;
            }

            IntPtr Ptr = GameLogicAPI.getSpellData(nSpellID);

            if (Ptr == IntPtr.Zero)
            {
                Debug.LogWarning("XPSKill,Ptr == IntPtr.Zero," + nSpellID);
                return;
            }

            SPELL.SPELL_DATA spellData = IntPtrHelper.toData <SPELL.SPELL_DATA>(Ptr);
            IntPtr           strPtr    = GameLogicAPI.getSpellStrData(nSpellID, (int)SPELL_DATA_ID.SPDATA_DESC);
            String           szDesc    = IntPtrHelper.Ptr2Str(strPtr);

            Debug.Log("XPSKill," + spellData.nID + "," + szDesc + "," + nSpellID);

            UBB.toHtml(ref szDesc, UBB_FORMAT_TYPE.UGUI);

            slotTooltipTrigger.SetText(UTooltipParamName.BodyText, szDesc);
            slotTooltipTrigger.enabled = true;

            skillImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_Skill, WndID.WND_ID_WAR_XPSKILL, 1, spellData.nIcon);
            skillImage.gameObject.SetActive(true);

            xpSkillName = spellData.szName;
        }
Esempio n. 2
0
        public void onTeamSubInvitedSideButton(IntPtr ptr, int nLen)
        {
            // 邀请加入队伍
            cmd_team_invited2view data = IntPtrHelper.toData <cmd_team_invited2view>(ptr);

            // 邀请加入队伍
            DIDAAddData msg = new DIDAAddData();

            msg.nItemID          = (int)EDIDAType.EDIDA_Team;
            msg.bAllowRepeatItem = true;
            msg.nButtonIconID    = (int)EDIDAType.EDIDA_Team;
            msg.strButtonText    = ULocalizationService.Instance.Get("UIView", "Team", "inviteButtonDes");
            msg.strTooltip       = ULocalizationService.Instance.Get("UIView", "Team", "inviteButtonDes");

            SideButtonDataBuildingSN dataInfo = new SideButtonDataBuildingSN();

            dataInfo.nBuildingSN = data.nBuildingSN;
            msg.sCustomData      = dataInfo;
            msg.callBack         = (CustomerInfo) =>
            {
                SideButtonDataBuildingSN customerInfo = CustomerInfo as SideButtonDataBuildingSN;
                UIDialogData             tooltipData  = new UIDialogData(
                    title: ULocalizationService.Instance.Get("UIView", "Team", "TeamTitleDes"),
                    message: "[" + data.szInviterName + "]" + ULocalizationService.Instance.Get("UIView", "Team", "inviteMsgBoxDes"),
                    buttons: new UIWidgets.DialogActions()
                {
                    { ULocalizationService.Instance.Get("UIView", "Team", "AgreeButtonDes"), () => { InvitedSideButtonCallBack(customerInfo, (int)EBuildFlowResult.EBuildFlowResult_Agree); return(true); } },
                    { ULocalizationService.Instance.Get("UIView", "Team", "DisAgreeButtonDes"), () => { InvitedSideButtonCallBack(customerInfo, (int)EBuildFlowResult.EBuildFlowResult_Disagree); return(true); } }
                });
                UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_DIALOG, tooltipData);
            };

            LogicDataCenter.didaDataManager.AddItem(msg);
        }
Esempio n. 3
0
        public void SetXPSkill(UIXPSkillCD msg)
        {
            if (msg == null)
            {
                return;
            }

            SWar2ViewMsgXPBeginCD data = msg.data;
            PlayerCombatData      playerWarData;

            if (m_dicPlayerWarInfo.TryGetValue((int)data.uID, out playerWarData))
            {
                IntPtr Ptr = GameLogicAPI.getSpellData(data.nSkillID);
                if (Ptr == IntPtr.Zero)
                {
                    Debug.LogWarning("SetXPSkill:Ptr is null");
                    return;
                }

                SPELL.SPELL_DATA spellData = IntPtrHelper.toData <SPELL.SPELL_DATA>(Ptr);
                Sprite           sprite    = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_Skill, WndID.WND_ID_WAR_XPSKILL, 1, spellData.nIcon);
                if (sprite == null)
                {
                    Debug.LogFormat("sprite is null.{0},{1}", data.nSkillID, spellData.nIcon);
                }
                playerWarData.summonerSkill3Image.enabled = true;
                playerWarData.summonerSkill3Image.sprite  = sprite;
                int elapseTime = (int)((double)GameLogicAPI.getSyncTickCount() - (double)data.nBeginCDTick / 1000);
                int remainTime = data.nCDTime / 1000 - elapseTime;

                playerWarData.summonerSkill3Image.AddNewMaterial(EUIShaderType.EST_Gray);
            }
        }
Esempio n. 4
0
        // 接受消息
        public override void OnMessage(WndMsgID msgID, UIMsgData msgData)
        {
            switch (msgID)
            {
            case WndMsgID.WND_MSG_COMMON_OPEN_LOGINQUEUE:
            {
                if (m_wndView == null || !m_wndView.IsVisible())
                {
                    SetVisible(true);
                }

                UIMsgCmdData       uData   = msgData as UIMsgCmdData;
                cmd_open_queue_wnd cmdData = IntPtrHelper.toData <cmd_open_queue_wnd>(uData.ptrParam);
                if (m_wndView != null)
                {
                    m_wndView.updateLoginQueueInfo(cmdData.order, cmdData.RemainTime);
                }
            }
            break;

            case WndMsgID.WND_MSG_COMMON_LOADSCENE:
            {
                SetVisible(false);
            }
            break;

            default:
                break;
            }
        }
Esempio n. 5
0
        public override void OnMessage(WndMsgID msgID, UIMsgData msgData)
        {
            switch (msgID)
            {
            case WndMsgID.WND_MSG_WAR_XPSKILL_SET_XP_SKILL_SELF:
            {
                SetVisible(true);

                UIMsgCmdData uData = msgData as UIMsgCmdData;

                cmd_creature_ShowPromptUI cmdData = IntPtrHelper.toData <cmd_creature_ShowPromptUI>(uData.ptrParam);

                m_wndView.setXpSkill(cmdData);
                m_wndView.SetXPSkillInfo(m_nSkillID);
            }
            break;

            case WndMsgID.WND_MSG_WAR_XPSKILL_XP_RANDOM_SELF_BEGINCOOL:
            {
                SetVisible(true);
                m_wndView.SetXPSkillInfo(m_nSkillID);
                m_wndView.IncreaseProgressPart();
            }
            break;

            case WndMsgID.WND_MSG_COMMON_WAREND:
            case WndMsgID.WND_MSG_COMMON_BATTLESTATE_LEAVE:
            {
                if (m_wndView == null)
                {
                    return;
                }

                UnloadView();
                m_wndView = null;
            }
            break;

            case WndMsgID.WND_MSG_WARBUTTOMCENTER_SKILLSETSLOT:
            {
                UIMsgCmdData          uiSkillSlot = (UIMsgCmdData)msgData;
                cmd_creature_set_slot data        = IntPtrHelper.toData <cmd_creature_set_slot>(uiSkillSlot.ptrParam);
                if (data.nSlotIndex != 5)
                {
                    return;
                }

                // SSchemeHeroXPskillConfig config = HeroXPskillConfig.Instance.GetHeroXPskillConfig(EntityFactory.MainHeroID, data.slotview.nId);
                // if (config == null)
                //     return;

                m_nSkillID = data.slotview.nId;
            }
            break;

            default:
                break;
            }
        }
Esempio n. 6
0
        public void SetSpellOverlay(EntityView ev, IntPtr ptrParam)
        {
            CurrentUID = ev.createinfo.EntityID;
            cmd_set_spell_overlay data      = IntPtrHelper.toData <cmd_set_spell_overlay>(ptrParam);
            OB_PersonSpellData    spellData = GetPersonSpellData(ev.createinfo.EntityID, data.nSlotIndex);

            spellData.spellOverlay = data;
        }
Esempio n. 7
0
        public void SetSpellSlot(EntityView ev, IntPtr ptrParam)
        {
            CurrentUID = ev.createinfo.EntityID;
            cmd_creature_set_slot data      = IntPtrHelper.toData <cmd_creature_set_slot>(ptrParam);
            OB_PersonSpellData    spellData = GetPersonSpellData(ev.createinfo.EntityID, data.nSlotIndex);

            spellData.slotSpell = data;
        }
Esempio n. 8
0
        public void ChangeSlot(EntityView ev, IntPtr ptrParam)
        {
            CurrentUID = ev.createinfo.EntityID;
            cmd_creature_set_slot data      = IntPtrHelper.toData <cmd_creature_set_slot>(ptrParam);
            OB_PersonSpellData    spellData = GetPersonSpellData(ev.createinfo.EntityID, data.nSlotIndex);

            spellData.changeSlot = data;
            spellData.initCDTime = (int)GameLogicAPI.getTickCount() - (data.slotview.nMaxData - data.slotview.nCurData);
        }
Esempio n. 9
0
        public void recvWarInfo(IntPtr ptrParam, int nPtrLen)
        {
            cmd_war_info info = IntPtrHelper.toData <cmd_war_info>(ptrParam);

            // 本局的战场信息
            m_WarInfo = info;

            Debug.LogWarning("summerid=" + GameLogicAPI.getWarSummerID());
        }
Esempio n. 10
0
        public void SetCurrentPlayerSlotSpellCD(UIMsgCmdData uiSpellEffect)
        {
            if (CurrentPlayer == null || CurrentPlayer.nEntityID != LogicDataCenter.warOBUIDataManager.CurrentUID)
            {
                return;
            }

            SetSpellCD(IntPtrHelper.toData <cmd_creature_set_slot>(uiSpellEffect.ptrParam));
        }
Esempio n. 11
0
        public override void OnMessage(WndMsgID msgID, UIMsgData data)
        {
            switch (msgID)
            {
            case WndMsgID.WND_MSG_COMMON_LOGINSTATE_ENTER:
            {
                LoadView();
            }
            break;

            case WndMsgID.WND_MSG_CREATEHERO_OPEN:
            {
                SceneManager.Instance.LoadSelectHeroScene(SceneLoadFinish);
            }
            break;

            case WndMsgID.WND_MSG_COMMON_CHOOSESTATE_LEAVE:
            {
                UnloadView();
                SceneManager.Instance.UnLoadSelectHeroScene();
            }
            break;

            case WndMsgID.WND_MSG_CREATEHERO_RANDOMNAMERESULT:
            {
                UIMsgCmdData uiData = (UIMsgCmdData)data;
                game_player_request_name_result cmdData = IntPtrHelper.toData <game_player_request_name_result>(uiData.ptrParam);
                if (m_wndView != null)
                {
                    DataCenter.CreateHeroDataManager.Instance.PlayerName = cmdData.szName;
                    DataCenter.CreateHeroDataManager.Instance.PlayerSex  = (PERSON_SEX)cmdData.nSex;
                    m_wndView.SetRandomName();
                }
            }
            break;

            case WndMsgID.WND_MSG_CREATEHERO_CREATE_PLAYER_RESULT:
            {
                if (m_wndView != null)
                {
                    UIMsgCmdData uiData = (UIMsgCmdData)data;

                    gamelogic_create_player_result cmdData = IntPtrHelper.toData <gamelogic_create_player_result>(uiData.ptrParam);
                    if (cmdData.nResult == 1)
                    {
                        m_wndView.SwitchState(ECreateHero.ECH_Hero);
                    }
                }
            }
            break;


            default:
                break;
            }
        }
Esempio n. 12
0
        public void OnReceiveRankDetail(IntPtr ptrParam, int nPtrLen)
        {
            cmd_entity_rank_season_detail detail = IntPtrHelper.toData <cmd_entity_rank_season_detail>(ptrParam);

            ScoreFrame.SetData();
            TaskFrame.SetData();
            HonorFrame.SetData(detail);
            PrizeFrame.SetData(detail);
            MiscFrame.SetData();
        }
Esempio n. 13
0
        public void OnBuyGoodsSuccess(UIMsgCmdData msg)
        {
            if (msg == null)
            {
                return;
            }

            SNPCGoodsBuySuccess data = IntPtrHelper.toData <SNPCGoodsBuySuccess>(msg.ptrParam);

            goodsTile.UpdateGoodsMask(data);
        }
Esempio n. 14
0
    static public bool getMinimapIconInfo(int nIconID, ref SMinimapIcon data)
    {
        IntPtr ptr = _getMinimapIconInfo(nIconID);

        if ((int)ptr == 0)
        {
            return(false);
        }

        data = IntPtrHelper.toData <SMinimapIcon>(ptr);
        return(true);
    }
Esempio n. 15
0
    static public bool GetPersonModel(UInt16 wHeroID, ref PersonSkinModelItem data)
    {
        IntPtr ptr = getPersonModel(wHeroID);

        if ((int)ptr == 0)
        {
            return(false);
        }

        data = IntPtrHelper.toData <PersonSkinModelItem>(ptr);
        return(true);
    }
Esempio n. 16
0
        public void SetSKillOverEffect(UIMsgCmdData uiSpellOverEffect)
        {
            Trace.Log("SetSKillOverEffect WND_MSG_WARBUTTOMCENTER_SKILLOVEREFFECT");
            if (CurrentPlayer == null || CurrentPlayer.nEntityID != LogicDataCenter.warOBUIDataManager.CurrentUID)
            {
                return;
            }

            cmd_set_spell_overlay data = IntPtrHelper.toData <cmd_set_spell_overlay>(uiSpellOverEffect.ptrParam);

            SetSpellSlotFlagEffect(data);
        }
Esempio n. 17
0
    public static SlotSpellID GetSlotSpellID(int nHeroID)
    {
        IntPtr ptr = getSlotSpellID(nHeroID);

        if (ptr == IntPtr.Zero)
        {
            Debug.LogWarning("GetSlotSpellID 获取slot错误");
            return(new SlotSpellID());
        }

        return(IntPtrHelper.toData <SlotSpellID>(ptr));
    }
Esempio n. 18
0
        private void OnMsgRegistResult(IntPtr ptrParam)
        {
            gamelogic_antiaddict_regist_result data = IntPtrHelper.toData <gamelogic_antiaddict_regist_result>(ptrParam);

            if (data.ret > 0)
            {
                RemoveSideButtonAntiAddict();
                m_wndView.registFrame.gameObject.SetActive(false);
            }

            m_wndView.ShowResultFrame(data);
        }
Esempio n. 19
0
        public void GainPrizeSuccess(UIMsgCmdData msg)
        {
            if (msg == null)
            {
                return;
            }
            int targetID = IntPtrHelper.toData <int>(msg.ptrParam);

            (m_subFrameViewList[(int)GamePromotionButtonType.BTN_TAITANSAYSAY] as TaiTanSaySayFrame).GainPrizeSuccess(targetID);

            UIUtil.ShowSystemMessage(EMChatTipID.CHAT_TIP_GAMEPROMOTION_OBTAIN_SUCCESS);
        }
Esempio n. 20
0
    static public bool getMinimapStaticObjInfo(int nMapID, int nIndex, ref SMinimapStaticIcon data)
    {
        IntPtr ptr = _getMinimapStaticObjInfo(nMapID, nIndex);

        if ((int)ptr == 0)
        {
            Trace.LogWarning("getMinimapStaticObjInfo mapID=" + nMapID + " nIndex=" + nIndex);
            return(false);
        }

        data = IntPtrHelper.toData <SMinimapStaticIcon>(ptr);
        return(true);
    }
Esempio n. 21
0
    public static bool getHeroStarConfig(int nHeroID, int nStarLv, ref SHeroStarSchemeInfo _sData)
    {
        IntPtr infoPtr = getHeroStarConfig(nHeroID, nStarLv);

        if ((int)infoPtr == 0)
        {
            Trace.LogWarning(String.Format("getHeroStarConfig 获取HeroID:{0}, StarLv:{1}的星级信息无效", nHeroID, nStarLv));
            return(false);
        }

        _sData = IntPtrHelper.toData <SHeroStarSchemeInfo>(infoPtr);
        return(true);
    }
Esempio n. 22
0
        public void UpdateCardlist(IntPtr ptrParam, int nPtrLen)
        {
            cmd_entity_pointshop_update_cardlist data = IntPtrHelper.toData <cmd_entity_pointshop_update_cardlist>(ptrParam);

            m_leftReflushTime = (int)data.nLeftReflushTime;
            m_leftReflushNum  = data.nLeftReflushNum;
            cardlistInfo.Clear();
            for (int i = 0; i < data.nSellID.Length; ++i)
            {
                cardlistInfo.Add(data.nSellID[i]);
            }
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_POINTSHOP_UPDATECARDLIST, null);
        }
Esempio n. 23
0
    static public bool getNextMinimapStaticIcon(int nMapID, int nFromIndex, ref SMinimapStaticIcon data)
    {
        IntPtr ptr = _getNextMinimapStaticIcon(nMapID, nFromIndex);

        if ((int)ptr == 0)
        {
            //Trace.LogError("getNextMinimapStaticIcon mapID=" + nMapID + " nFromIndex=" + nFromIndex);
            return(false);
        }

        data = IntPtrHelper.toData <SMinimapStaticIcon>(ptr);
        return(true);
    }
Esempio n. 24
0
        // 接受消息
        public override void OnMessage(WndMsgID msgID, UIMsgData msgData)
        {
            switch (msgID)
            {
            case WndMsgID.WND_ID_LOADINGWARVIEW_LOADPLAYERINFO:
            {
                if (m_wndView == null)
                {
                    return;
                }

                UIMsgCmdData uiLoadPlayerInfo = (UIMsgCmdData)msgData;
                InitLoadingPlayerFrameInfo(uiLoadPlayerInfo.ptrParam, uiLoadPlayerInfo.nPtrLen);
            }
            break;

            case WndMsgID.WND_ID_LOADINGWARVIEW_LOADPROGREESERATE:
            {
                if (m_wndView == null)
                {
                    return;
                }

                UIMsgCmdData        uiLoadRateInfo = (UIMsgCmdData)msgData;
                cmd_load_scene_rate data           = IntPtrHelper.toData <cmd_load_scene_rate>(uiLoadRateInfo.ptrParam);
                m_wndView.SetLoadingRate(data);
            }
            break;

            case WndMsgID.WND_MSG_COMMON_LOGINMOBA:
            {
                SetVisible(true);
            }
            break;

            case WndMsgID.WND_MSG_COMMON_BATTLESTATE_ENTER:
            {
                this.UnloadView();
            }
            break;

            case WndMsgID.WND_MSG_COMMON_BATTLESTATE_ENTER_PlayMovie:
            {
                this.UnloadView();
            }
            break;

            default:
                break;
            }
        }
Esempio n. 25
0
        public override void OnMessage(WndMsgID msgID, UIMsgData msgData)
        {
            switch (msgID)
            {
            case WndMsgID.WND_MSG_COMMON_BATTLESTATE_ENTER:
            {
                this.LoadView();
                this.SetVisible(false);
            }
            break;

            case WndMsgID.WND_MSG_COMMON_WAREND:
            case WndMsgID.WND_MSG_COMMON_BATTLESTATE_LEAVE:
            {
                this.UnloadView();
            }
            break;

            case WndMsgID.WND_MSG_WAR_EXTRAPLAYERSELECTION_SHOWENEMY:
            {
                if (msgData == null || m_wndView == null)
                {
                    return;
                }

                UIMsgCmdData ShowChooseTargetData = (UIMsgCmdData)msgData;

                if (ShowChooseTargetData == null || ShowChooseTargetData.ptrParam == null)
                {
                    return;
                }

                cmd_creature_ShowChooseTarget data = IntPtrHelper.toData <cmd_creature_ShowChooseTarget>(ShowChooseTargetData.ptrParam);

                bool toggleSelection = Convert.ToBoolean(data.nType);
                m_eChooseTargetType    = (SHOW_CHOOSE_TARGET_TYPE)data.nTargetType;
                SearchNearPlayerRadius = data.nDistance == 0 ? 35 : data.nDistance;

                RangeActivityEntity.Clear();

                if (toggleSelection)
                {
                    GetAroundEnemy();
                }
                SetVisible(toggleSelection);
                SelectionSpellID = data.nSpellID;
                m_wndView.ToggleExtraPlayerSelection(toggleSelection);
            }
            break;
            }
        }
Esempio n. 26
0
    static public bool getMinimapInfo(int nMapID, ref SMinimapInfo data)
    {
        IntPtr ptr = _getMinimapInfo(nMapID);

        if ((int)ptr == 0)
        {
            Trace.LogError("getMinimapInfo(" + nMapID + "), failed");
            return(false);
        }

        data = IntPtrHelper.toData <SMinimapInfo>(ptr);

        return(true);
    }
Esempio n. 27
0
    public static bool GetEntityLocation(ENTITY_ID viewID, ref entity_location location)
    {
        IntPtr locationPtr = getEntityLocation(viewID);

        if (locationPtr == IntPtr.Zero)
        {
            Trace.LogWarning("getEntityLocation 获取Entity位置错误");
            return(false);
        }

        location = IntPtrHelper.toData <entity_location>(locationPtr);

        return(true);
    }
Esempio n. 28
0
    public static bool GetHeroSkinInfo(int nSkinID, ref SkinInfoScheme _sData)
    {
        IntPtr infoPtr = getHeroSkinConfig(nSkinID);

        if ((int)infoPtr == 0)
        {
            Trace.LogWarning("getHeroSkinConfig 获取ID:" + nSkinID + "的皮肤信息无效");
            return(false);
        }

        _sData = IntPtrHelper.toData <SkinInfoScheme>(infoPtr);

        return(true);
    }
Esempio n. 29
0
        public void TeammateInfoChangeCaptain(IntPtr ptr)
        {
            cmd_team_changeCaptain2view data = IntPtrHelper.toData <cmd_team_changeCaptain2view>(ptr);

            foreach (var item in m_playerItems)
            {
                if (item.PDBID <= 0)
                {
                    continue;
                }

                item.ChangeCaptain(data.nCaptainPDBID);
            }
        }
Esempio n. 30
0
    public bool OnEnter(IntPtr lParam)
    {
        tr          = m_pFSM.transform;
        startUpTick = 0;
        if (m_pFSM.animator != null)
        {
            m_pFSM.animator.SetBool("isLanding", false);
        }
        m_bIsLanding = false;
        m_bIsJumping = false;

        m_bLongJump = false;
        if (lParam != IntPtr.Zero)
        {
            //非空格键触发的特殊跳跃,由上层发放相关参数,这里只记录参数,仍然靠inputJump触发起跳
            m_pFSM.inputJump = true;
            m_bLongJump      = true;
            m_longjumpParam  = IntPtrHelper.toData <cmd_creature_longjump>(lParam);
        }
        else if (m_pFSM.inputJump == false)
        {
            //不是主动跳跃,是直接跌落的
            m_bIsLanding = false;
            m_bIsJumping = true;
            if (m_pFSM.animator != null)
            {
                m_pFSM.animator.SetBool("Jumping", true);//.CrossFade("Jump_Front", 0.1f);
            }
            Vector3 jumpDir = Vector3.up;
            Send_Sync_Jump();
            grounded            = false;
            m_pFSM.groundNormal = Vector3.zero;
        }
        else
        {
            if (m_pFSM.creaturePropety.effectIDForJump > 0)
            {
                m_pFSM.creaturePropety.Master.LightingEffectManager.BindLighting(m_pFSM.creaturePropety.effectIDForJump);
            }
        }

        startHeight   = m_pFSM.transform.position.y;
        oldDodgeSpeed = m_pFSM.maxDodgeSpeed;

        //设置一开始的位置,时刻监测高度差
        glideLastHitPoint = m_pFSM.transform.position + new Vector3(0, 0.1f, 0);

        return(true);
    }