Пример #1
0
 override public void Update()
 {
     if (InputManager.GetKey(FuntionShortCutCtrl.GetInstance().GetKeyCodeByIndex(FuntionShortCutSlotIndex.SystemPannel)))
     {
         SetState(ESummonerState.ESS_None);
     }
 }
Пример #2
0
    /// <summary>
    /// 检测功能按键是否有按下
    /// </summary>
    /// <param name="keyCtrlIndex">功能按键槽位序号</param>
    /// <returns></returns>
    public static bool CheckFunctionShortcutKeyDown(FuntionShortCutSlotIndex keyCtrlIndex)
    {
        if (!FuntionShortCutCtrl.GetInstance().dicCombinationShortcutKey.ContainsKey((int)keyCtrlIndex))
        {
            return(false);
        }

        //获取此槽位权限Flag, 如果为0代表全局开启,不限制
        //不为0则与场景保姆中的快捷键方案标识做&运算,判断当前是否有权限使用该槽位
        //如果无权限使用,则直接return掉
        int flag = SlotKeyCodeConfig.Instance.GetSlotFlag((int)SlotType.Function, (int)keyCtrlIndex);

        if (flag != 0 && (flag & GameLogicAPI.getHotkeyIndex()) == 0)
        {
            return(false);
        }

        if (FuntionShortCutCtrl.GetInstance().dicCombinationShortcutKey[(int)keyCtrlIndex].ModifierKeyCodeList.Count <= 0)//((int)keyCtrlIndex < (int)FuntionShortCutSlotIndex.Com_UpgradeSpellSlot0)
        {
            return(FuntionShortCutCtrl.GetInstance().CheckKeyCodeKeyStatus(keyCtrlIndex, KeyStatus.Down));
        }
        else
        {
            return(FuntionShortCutCtrl.GetInstance().CheckCombinationKeyStatus(keyCtrlIndex, KeyStatus.Down));
        }
    }
Пример #3
0
    public void Updata()
    {
        KeyCode nEscapeKeyCode = FuntionShortCutCtrl.GetInstance().GetKeyCodeByIndex(FuntionShortCutSlotIndex.SystemPannel);

        //不要ESC界面的时候这里也记得关掉
        if ((!BindKeyCodeForMovieTable.ContainsKey(nEscapeKeyCode)) && PopupMovieStack.Count > 0)
        {
            PopMovie();
        }


        foreach (DictionaryEntry keypair in BindKeyCodeForMovieTable)
        {
            KeyCode   key   = (KeyCode)keypair.Key;
            SFMovieEx movie = (SFMovieEx)keypair.Value;

            if (InputManager.GetKeyUp(key))
            {
                if (key == nEscapeKeyCode && PopupMovieStack.Count > 0)
                {
                    PopMovie();
                    continue;
                }

                if (!IsMovieAllowed(movie))
                {
                    PushMovie(movie);
                }
                else
                {
                    PopMovie(movie);
                }
            }
        }
    }
Пример #4
0
 public void Update()
 {
     if (InputManager.Raw_GetKeyDown(FuntionShortCutCtrl.GetInstance().GetKeyCodeByIndex(FuntionShortCutSlotIndex.Exit)))
     {
         UISystem.Instance.ShowWnd(WndID.WND_ID_GAME_PROMOTION, false);
     }
 }
Пример #5
0
    //进入登录状态的操作
    private void onEnterLoginState()
    {
        FuntionShortCutCtrl.GetInstance().ClearAndRest();
        LogicDataCenter.onEnterLoginState();
        CurStageSubState = EStage_SubState.ESSS_NONE;

        UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_LOGINSTATE_ENTER, null);
    }
Пример #6
0
 public override void OnRegisterDocument(Value _root)
 {
     base.OnRegisterDocument(_root);
     GetMemberWithCheck(MyRoot, "MainChatTable", out _vMainChatTable);
     PopupMovieManager.Instance.BindKeyCodeForMovie(FuntionShortCutCtrl.GetInstance().GetKeyCodeByIndex(FuntionShortCutSlotIndex.EnterLeft), this);
     PopupMovieManager.Instance.BindKeyCodeForMovie(FuntionShortCutCtrl.GetInstance().GetKeyCodeByIndex(FuntionShortCutSlotIndex.EnterRight), this);
     SetMovieVisibleOnCreate();
     this.SetMovieVisible(true);
 }
Пример #7
0
    override public void Update()
    {
        onTick();

        if (InputManager.GetKey(FuntionShortCutCtrl.GetInstance().GetKeyCodeByIndex(FuntionShortCutSlotIndex.SystemPannel)))
        {
            SetState(EHallWinState.EHWS_None);
        }
    }
Пример #8
0
 /// <summary>
 /// 还原默认槽位配置
 /// </summary>
 public void RestSlotData()
 {
     CurrentSlotMap.Clear();
     CurrentSpellMode = defaultSpellMode;
     foreach (KeyValuePair <int, SlotKeyCodeData> kv in defaultSlotMap)
     {
         SlotKeyCodeData data = new SlotKeyCodeData(kv.Value.nSlotIndex, kv.Value.nSlotType, kv.Value.nReleaseCondition, kv.Value.nAutoCasting, kv.Value.nFlag, kv.Value.szKeySequence, kv.Value.szSlotFunction);
         CurrentSlotMap.Add(kv.Key, data);
     }
     FuntionShortCutCtrl.GetInstance().ClearAndRest();
     SetSlotData(true);
 }
Пример #9
0
        /// <summary>
        /// 修改槽位方法
        /// </summary>
        /// <param name="nIndex">槽位索引 槽位类型(slotType) * 每类槽位最大数量(1000)+当前槽位索引(slotIndex)</param>
        /// <param name="nAuto">智能施法状态(0:默认;1:快捷 ;2:常规;3:推荐)</param>
        /// <param name="szKeyCode">槽位键值</param>
        public void ChangeSlotData(int nIndex, int nAuto, string szKeyCode)
        {
            if (CurrentSlotMap.ContainsKey(nIndex))
            {
                int index = CurrentSlotMap[nIndex].nSlotIndex;
                int type  = CurrentSlotMap[nIndex].nSlotType;

                if (szKeyCode != CurrentSlotMap[nIndex].szKeySequence)
                {
                    CurrentSlotMap[nIndex].szKeySequence = szKeyCode;

                    if (type == (int)SlotType.Function)
                    {
                        FuntionShortCutCtrl.GetInstance().ChangeKeyCodeToDic(index, szKeyCode, 0);
                    }
                    else
                    {
                        if (!EntityFactory.MainHero)
                        {
                            return;
                        }
                        SkillCtrl sc = EntityFactory.MainHero.GetComponent <SkillCtrl>();
                        if (sc != null)
                        {
                            sc.SetSlotKeyCode(type, index, CurrentSlotMap[nIndex].nReleaseCondition, szKeyCode);
                            UIMsgCmdData uiPlayerProgress = new UIMsgCmdData((int)WndMsgID.WND_MSG_WARBUTTOMCENTER_SETSHORTCUT, type, szKeyCode.ToUpper(), IntPtr.Zero, index);
                            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_WARBUTTOMCENTER_SETSHORTCUT, uiPlayerProgress);
                        }
                    }
                }

                if (nAuto != CurrentSlotMap[nIndex].nAutoCasting)
                {
                    if (type == (int)SlotType.Function)
                    {
                        return;
                    }

                    CurrentSlotMap[nIndex].nAutoCasting = nAuto;
                    cmd_entity_set_smart_cast data = new cmd_entity_set_smart_cast();
                    data.nSlotIndex   = index;
                    data.nSlotType    = type;
                    data.nSmartCast   = nAuto;
                    slotSmartDatas[0] = data;
                    SendSmartDataToLogic();
                    slotSmartDatas.Clear();
                }
            }
        }
Пример #10
0
    public override void OnRegisterDocument(Value _root)
    {
        base.OnRegisterDocument(_root);
        GetMemberWithCheck(MyRoot, "SettingWindow", out vSettingWindow);
        //this.SetDepth((int)SFGFxMovieManager.EGFxMovieLayer.EGFxLayer_PopupLayer);
        m_ValueMap.Add("HeroKeyCode1", null);
        m_ValueMap.Add("HeroKeyCode2", null);
        m_ValueMap.Add("HeroKeyCode3", null);
        m_ValueMap.Add("SkillKeyCode1", null);
        m_ValueMap.Add("PropKeyCode1", null);
        m_ValueMap.Add("PropKeyCode2", null);
        m_ValueMap.Add("PropKeyCode3", null);
        m_ValueMap.Add("PropKeyCode4", null);
        m_ValueMap.Add("PropKeyCode5", null);
        m_ValueMap.Add("PropKeyCode6", null);
        m_ValueMap.Add("OrnamentKeyCode", null);
        m_HotKeyAttrStringMap.Add("HeroKeyCode1", GameSettingsXmlModel.heroKeyCode1);
        m_HotKeyAttrStringMap.Add("HeroKeyCode2", GameSettingsXmlModel.heroKeyCode2);
        m_HotKeyAttrStringMap.Add("HeroKeyCode3", GameSettingsXmlModel.heroKeyCode3);
        m_HotKeyAttrStringMap.Add("SkillKeyCode1", GameSettingsXmlModel.skillKeyCode1);
        m_HotKeyAttrStringMap.Add("PropKeyCode1", GameSettingsXmlModel.propKeyCode1);
        m_HotKeyAttrStringMap.Add("PropKeyCode2", GameSettingsXmlModel.propKeyCode2);
        m_HotKeyAttrStringMap.Add("PropKeyCode3", GameSettingsXmlModel.propKeyCode3);
        m_HotKeyAttrStringMap.Add("PropKeyCode4", GameSettingsXmlModel.propKeyCode4);
        m_HotKeyAttrStringMap.Add("PropKeyCode5", GameSettingsXmlModel.propKeyCode5);
        m_HotKeyAttrStringMap.Add("PropKeyCode6", GameSettingsXmlModel.propKeyCode6);
        m_HotKeyAttrStringMap.Add("OrnamentKeyCode", GameSettingsXmlModel.ornamentKeyCode);

        m_HotKeyAttrIntMap.Add("HeroKeyState1", GameSettingsXmlModel.heroKeyState1);
        m_HotKeyAttrIntMap.Add("HeroKeyState2", GameSettingsXmlModel.heroKeyState2);
        m_HotKeyAttrIntMap.Add("HeroKeyState3", GameSettingsXmlModel.heroKeyState3);
        m_HotKeyAttrIntMap.Add("SkillKeyState1", GameSettingsXmlModel.skillKeyState1);
        m_HotKeyAttrIntMap.Add("PropKeyState1", GameSettingsXmlModel.propKeyState1);
        m_HotKeyAttrIntMap.Add("PropKeyState2", GameSettingsXmlModel.propKeyState2);
        m_HotKeyAttrIntMap.Add("PropKeyState3", GameSettingsXmlModel.propKeyState3);
        m_HotKeyAttrIntMap.Add("PropKeyState4", GameSettingsXmlModel.propKeyState4);
        m_HotKeyAttrIntMap.Add("PropKeyState5", GameSettingsXmlModel.propKeyState5);
        m_HotKeyAttrIntMap.Add("PropKeyState6", GameSettingsXmlModel.propKeyState6);
        m_HotKeyAttrIntMap.Add("OrnamentKeyState", GameSettingsXmlModel.ornamentKeyState);
        m_AttrBoolMap.Add("ShowPlayerBlood", GameSettingsXmlModel.showPlayerBlood);
        m_AttrBoolMap.Add("ShowBloodInfo", GameSettingsXmlModel.showBloodInfo);

        m_AttrIntMap.Add("MusicVolume", GameSettingsXmlModel.currentBGMValue);

        PopupMovieManager.Instance.BindKeyCodeForMovie(FuntionShortCutCtrl.GetInstance().GetKeyCodeByIndex(FuntionShortCutSlotIndex.SystemPannel), this);
        SetMovieVisibleOnCreate();
    }
Пример #11
0
    public override void OnRegisterDocument(Value _root)
    {
        base.OnRegisterDocument(_root);
        GetMemberWithCheck(MyRoot, "StoreWindow", out vStoreWindow);

        GetMemberWithCheck(vStoreWindow, "MoneyTF", out vMoneyTF);
        GetMemberWithCheck(vStoreWindow, "AllGoodsPage", out vAllGoodsPage);

        GetMemberWithCheck(vAllGoodsPage, "AllGoodsTypeFrame", out vAllGoodsTypeFrame);

        GetMemberWithCheck(vStoreWindow, "RecommendedGoodsPage", out vRecommendedGoodsPage);
        GetMemberWithCheck(vStoreWindow, "CanComposeFrame", out vCanComposeFrame);
        GetMemberWithCheck(vStoreWindow, "GoodsComposeTreeMgr", out vGoodsComposeTreeMgr);
        GetMemberWithCheck(vStoreWindow, "GoodsDetalInfo", out vGoodsDetalInfo);

        PopupMovieManager.Instance.BindKeyCodeForMovie(FuntionShortCutCtrl.GetInstance().GetKeyCodeByIndex(FuntionShortCutSlotIndex.OpenGoodStore), this);

        GameMobaSchemesManager.MobaGoodsSchemesInitEndEvent += GetMobaGoodsFromSchemes;

        SetMovieVisibleOnCreate();
    }
Пример #12
0
    /// <summary>
    /// 检测功能按键是否按住
    /// </summary>
    /// <param name="keyCtrlIndex">功能按键槽位序号</param>
    /// <returns></returns>
    public static bool CheckFunctionShortcutKeyPressing(FuntionShortCutSlotIndex keyCtrlIndex)
    {
        if (!FuntionShortCutCtrl.GetInstance().dicCombinationShortcutKey.ContainsKey((int)keyCtrlIndex))
        {
            return(false);
        }

        int flag = SlotKeyCodeConfig.Instance.GetSlotFlag((int)SlotType.Function, (int)keyCtrlIndex);

        if (flag != 0 && (flag & GameLogicAPI.getHotkeyIndex()) == 0)
        {
            return(false);
        }


        if (FuntionShortCutCtrl.GetInstance().dicCombinationShortcutKey[(int)keyCtrlIndex].ModifierKeyCodeList.Count <= 0)//((int)keyCtrlIndex < (int)FuntionShortCutSlotIndex.Com_UpgradeSpellSlot0)
        {
            return(FuntionShortCutCtrl.GetInstance().CheckKeyCodeKeyStatus(keyCtrlIndex, KeyStatus.Pressing));
        }
        else
        {
            return(FuntionShortCutCtrl.GetInstance().CheckCombinationKeyStatus(keyCtrlIndex, KeyStatus.Pressing));
        }
    }
Пример #13
0
 public static void Destroy()
 {
     FuntionShortCutCtrl.GetInstance().destroy();
 }
Пример #14
0
        /// <summary>
        /// 设置槽位信息
        /// </summary>
        public void SetSlotData(bool isForceDefault = false)
        {
            if (!EntityFactory.MainHero)
            {
                return;
            }
            SkillCtrl sc = EntityFactory.MainHero.GetComponent <SkillCtrl>();

            if (!sc)
            {
                return;
            }
            int vocationID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_VOCATION);

            foreach (KeyValuePair <int, SlotKeyCodeData> kv in CurrentSlotMap)
            {
                switch (kv.Value.nSlotType)
                {
                case (int)SlotType.Equip:
                case (int)SlotType.Skill:
                {
                    sc.SetSlotKeyCode(kv.Value.nSlotType, kv.Value.nSlotIndex, kv.Value.nReleaseCondition, kv.Value.szKeySequence);
                    UIMsgCmdData uiPlayerProgress = new UIMsgCmdData((int)WndMsgID.WND_MSG_WARBUTTOMCENTER_SETSHORTCUT, kv.Value.nSlotType, kv.Value.szKeySequence.ToUpper(), IntPtr.Zero, kv.Value.nSlotIndex);
                    UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_WARBUTTOMCENTER_SETSHORTCUT, uiPlayerProgress);
                    cmd_entity_set_smart_cast data     = new cmd_entity_set_smart_cast();
                    List <PlayerSlotItem>     slotList = null;
                    int       maxSlotIndexForEachType  = 1000;  //一类slot最多有多少个index,用于将index和type合并编码
                    int       nSlotID       = kv.Value.nSlotType * maxSlotIndexForEachType + kv.Value.nSlotIndex;
                    SpellMode useType       = SpellMode.ST_Normal;
                    bool      hasUserConfig = PlayerSlotSettingConfig.Instance.GetLocalData(EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_VOCATION), out slotList);
                    if (hasUserConfig && !isForceDefault)         //如果用户配置了就使用用户的配置
                    {
                        for (int i = 0; i < slotList.Count; i++)
                        {
                            if (nSlotID == slotList[i].slotID)
                            {
                                useType = (SpellMode)Enum.Parse(typeof(SpellMode), slotList[i].useType.ToString());
                            }
                        }
                    }
                    else           //默认施法:使用策划在技能编辑器的配置
                    {
                        if (sc != null)
                        {
                            OrderData odata = sc.GetCurOrderData(nSlotID);
                            if (odata == null)
                            {
                                useType = SpellMode.ST_Normal;
                            }
                            else
                            {
                                useType = (SpellMode)Enum.Parse(typeof(SpellMode), (odata.nAdvanceUseType).ToString());
                            }
                        }
                    }
                    kv.Value.nAutoCasting = (int)useType;
                    data.nSlotIndex       = kv.Value.nSlotIndex;
                    data.nSlotType        = kv.Value.nSlotType;
                    data.nSmartCast       = kv.Value.nAutoCasting;
                    slotSmartDatas[0]     = data;
                    SendSmartDataToLogic();
                    slotSmartDatas.Clear();
                }
                break;

                case (int)SlotType.Function:
                    FuntionShortCutCtrl.GetInstance().SaveKeyCodeToDic(kv.Value.nSlotIndex, kv.Value.szKeySequence);
                    break;

                default:
                    break;
                }
            }
        }
Пример #15
0
    // Update is called once per frame
    public void Update()
    {
        UpdateDeviceLost();
        if (!mainCam)
        {
            mainCam = Camera.main;
        }
        // 帧
        GameFrameManager.OnUpdate();
        // 定时器
        TimerManager.OnUpdate();
        DoTask();
        // 当前正在载入地图,不要处理消息
        if (loading != null)
        {
            if (!loading.isDone)
            {
                ViewEventHelper.Instance.SendCommand(GameLogicDef.GVIEWCMD_PROGRESSING, (int)(loading.progress * 100));
                return;
            }
            else
            {
                loading = null;
                ViewEventHelper.Instance.SendCommand(GameLogicDef.GVIEWCMD_PROGRESSING, 100);
                Trace.Log("load level asyn ok!");
            }
        }

        if (bCreated)
        {
            GameLogicAPI.onFrameUpdate();
        }
        FuntionShortCutCtrl nFunctionCtr = FuntionShortCutCtrl.GetInstance();

        if (InputManager.Raw_GetKeyUp(nFunctionCtr.GetKeyCodeByIndex(FuntionShortCutSlotIndex.ControlTraceOpen)))
        {
            if (!string.IsNullOrEmpty(LogFileName))
            {
                Process.Start(LogFileName);
            }
        }

        SkinManager.OnUpdate();
        SafeZone.Update();
        SafeZoneEffectManager.Update();
        if (isNeedToQuit)
        {
            bForbidQuit = false;
            Application.Quit();
        }


        if (NeedToReStart)
        {
            enabled       = false;
            NeedToReStart = false;
            ReStartApplication();
            return;
        }

        GUIDE.GuideManager.Update();

        // 通知逻辑层处理消息
        //ViewEventHelper.Instance.SendCommand(GameLogicDef.GVIEWCMD_FRAME_UPDATE);
    }