Exemplo n.º 1
0
    /// <summary>
    /// 收到X键回调
    /// </summary>
    /// <param name="callback">热键状态</param>
    private void OnXCallback(HotkeyCallback callback)
    {
        if (!callback.performed)
        {
            return;
        }

        if (OwnerView == null)
        {
            return;
        }

        if (m_NextCategoryIndex != -1)
        {
            return;
        }

        int index = State.GetPageCategoryIndex(State.GetPageIndex());

        UIViewCategory[] categorys = State.GetPage().Categorys;

        if (index >= categorys.Length - 1)
        {
            index = 0;
        }
        else
        {
            index++;
        }

        ChangeFilterIndex(index);
    }
Exemplo n.º 2
0
 /// <summary>
 /// esc
 /// </summary>
 /// <param name="callback"></param>
 private void OnEscClick(HotkeyCallback callback)
 {
     if (callback.performed)
     {
         GameFacade.Instance.SendNotification(NotificationName.MSG_CLOSE_MAIN_PANEL);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 收到交互相关联的热键回调时
 /// </summary>
 /// <param name="info"></param>
 private void OnHotKeyCallbackByHold(HotkeyCallback info)
 {
     if (info.performed)
     {
         UIManager.Instance.StartCoroutine(DelayExecute(0.5f));
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// esc操作
 /// </summary>
 /// <param name="callback"></param>
 protected override void OnEscCallback(HotkeyCallback callback)
 {
     if (callback.performed)
     {
         OnEscClick?.Invoke(callback);
     }
 }
Exemplo n.º 5
0
    /// <summary>
    /// 处理删除角色热键回调
    /// </summary>
    /// <param name="callbackContext"></param>
    private void OnDeleteHotkeyCallback(HotkeyCallback callbackContext)
    {
        if (callbackContext.performed)
        {
            WwiseUtil.PlaySound((int)WwiseMusic.Music_deleteRole_Over, false, null);
            OpenParameter openParameter = new OpenParameter();
            openParameter.Title   = TableUtil.GetLanguageString("common_text_id_1018");
            openParameter.Content = string.Format(TableUtil.GetLanguageString("common_text_id_1017"),
                                                  m_ServerListProxy.GetCurrentCharacterVO().Name, m_ServerListProxy.GetCurrentCharacterVO().Level);
            openParameter.backgroundColor = BackgroundColor.Error;

            HotKeyButton HotKeyQuit = new HotKeyButton();
            HotKeyQuit.actionName = HotKeyID.FuncX;
            HotKeyQuit.showText   = TableUtil.GetLanguageString("common_hotkey_id_1001");
            HotKeyQuit.onEvent    = OnSubmitDeleteCharacter;

            HotKeyButton HotKeyCancel = new HotKeyButton();
            HotKeyCancel.actionName = HotKeyID.FuncB;
            HotKeyCancel.showText   = TableUtil.GetLanguageString("common_hotkey_id_1002");
            HotKeyCancel.onEvent    = OnCancelDeleteCharacter;

            openParameter.HotkeyArray = new HotKeyButton[] { HotKeyQuit, HotKeyCancel };
            UIManager.Instance.OpenPanel(UIPanel.ConfirmPanel, openParameter);
            WwiseUtil.PlaySound((int)WwiseMusic.Music_Panel_PopupPanel_Open, false, null);
        }
    }
Exemplo n.º 6
0
 private void OnDropMission(HotkeyCallback cellback)
 {
     if (cellback.performed && m_MissionUID > 0)
     {
         NetworkManager.Instance.GetMissionController().SendDropMission(m_MissionUID);
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// 关闭弹窗
 /// </summary>
 /// <param name="callback"></param>
 private void Close(HotkeyCallback callback)
 {
     if (callback.performed)
     {
         UIManager.Instance.ClosePanel(this);
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// 空格键按下 领取
 /// </summary>
 public void OnRevecie(HotkeyCallback callbackContext)
 {
     if (callbackContext.started)
     {
         if (m_SelectProduceTid > 0)
         {
             m_ProducingTid = m_SelectProduceTid;
             if (m_FoundryProxy.GetBluePrintDic().TryGetValue(m_SelectProduceTid, out ProduceInfoVO girdInfo))
             {
                 if (girdInfo.BluePrintState == ProduceState.Finsh)
                 {
                     ProduceInfoVO foundryMember = m_FoundryProxy.GetFoundryMemberByTID(girdInfo.TID);
                     if (foundryMember != null)
                     {
                         Receive(foundryMember.TID);
                     }
                 }
                 if (girdInfo.BluePrintState == ProduceState.CanProduce)
                 {
                     Make(girdInfo.TID);
                 }
             }
         }
     }
 }
Exemplo n.º 9
0
    private void OnItemUse(HotkeyCallback callback)
    {
        if (callback.performed)
        {
            if (OwnerView.State.GetTipData() == null)
            {
                return;
            }
            if (m_CurrentSelectedItemData != null)
            {
                if (m_CurrentItemData?.GetReference() == m_CurrentSelectedItemData.UID)                //拆
                {
                    NetworkManager.Instance.GetPackageController().ReqestMove(
                        m_CurrentItemData.GetUID(),
                        PackageProxy.GetPackage(m_Category).UID,
                        Parent.Data.CurrentShip.GetUID());

                    PlayerSound(isAdd: false, m_Category == Category.Equipment ? (m_CurrentSelectedItemData as ItemEquipmentVO).EquipmentType : 0);
                }
                else                //装
                {
                    NetworkManager.Instance.GetPackageController().ReqestMove(
                        m_CurrentSelectedItemData.UID,
                        m_ContainerUID,
                        m_ContainerPOS,
                        Parent.Data.CurrentShip.GetUID());

                    PlayerSound(isAdd: true, m_Category == Category.Equipment ? (m_CurrentSelectedItemData as ItemEquipmentVO).EquipmentType : 0);
                }
            }
        }
    }
Exemplo n.º 10
0
 /// <summary>
 /// 重置操作
 /// </summary>
 /// <param name="callbackContext"></param>
 public void OnReset(HotkeyCallback callbackContext)
 {
     if (callbackContext.performed)
     {
         m_TalentProxy.GetTalentOperation(TalentCode.Reset, (ulong)m_CurrentTalentRootId);
     }
 }
Exemplo n.º 11
0
    /// <summary>
    /// 放大
    /// </summary>
    /// <param name="callbackContext"></param>
    public void OnMagnify(HotkeyCallback callbackContext)
    {
        if (callbackContext.started)
        {
            m_Down      = true;
            m_Coroutine = UIManager.Instance.StartCoroutine(OpUpdate(() =>
            {
                m_ZoomValue += m_OffSet;
                if (m_ZoomValue > m_ZoomMax)
                {
                    m_ZoomValue = m_ZoomMax;
                }
                Vector3 targetPos = new Vector3(m_ToggleGroup.transform.localPosition.x,
                                                m_ToggleGroup.transform.localPosition.y, m_ZoomValue);
                m_ToggleGroup.transform.localPosition = Vector3.Lerp(m_ToggleGroup.transform.localPosition, targetPos, m_Time);
            }));
        }
        if (callbackContext.performed)
        {
            m_Down = false;

            if (m_Coroutine != null)
            {
                UIManager.Instance.StopCoroutine(m_Coroutine);
                m_Time = m_MaxTime;
            }
        }
    }
Exemplo n.º 12
0
 /// <summary>
 /// 停用
 /// </summary>
 /// <param name="callbackContext"></param>
 public void OnStopUse(HotkeyCallback callbackContext)
 {
     if (callbackContext.performed)
     {
         m_TalentProxy.GetTalentOperation(TalentCode.StopUse, (ulong)m_CurrentTalentVO.Id);
     }
 }
Exemplo n.º 13
0
 /// <summary>
 /// 激活->>>>>升级
 /// </summary>
 /// <param name="callbackContext"></param>
 public void OnActivate(HotkeyCallback callbackContext)
 {
     if (callbackContext.started)
     {
         if (m_CurrentTalentVO.State == TalentState.CanActivate)
         {
             m_CurrentTalentVO.MTalentElement.ShowUnLock(true);
         }
     }
     if (callbackContext.performed)
     {
         m_CurrentTalentVO.MTalentElement.ShowUnLock(false);
         if (m_CurrentTalentVO.State == TalentState.CanActivate)
         {
             m_TalentProxy.GetTalentOperation(TalentCode.Active, (ulong)m_CurrentTalentVO.Id);
         }
         else if (m_CurrentTalentVO.State == TalentState.Activate)
         {
             m_TalentProxy.GetTalentOperation(TalentCode.UpLevel, (ulong)m_CurrentTalentVO.Id);
         }
     }
     if (callbackContext.cancelled)
     {
         m_CurrentTalentVO.MTalentElement.ShowUnLock(false);
     }
 }
Exemplo n.º 14
0
    /// <summary>
    /// 排序键按下时
    /// </summary>
    /// <param name="callback">热键状态</param>
    private void OnSortKeyPress(HotkeyCallback callback)
    {
        if (!callback.performed)
        {
            return;
        }

        if (OwnerView == null)
        {
            return;
        }

        int index = State.GetPage().SortIndex;

        if (index >= State.GetPage().Sorters.Length - 1)
        {
            index = 0;
        }
        else
        {
            index++;
        }

        State.SetPageSortIndex(State.GetPageIndex(), index);
    }
Exemplo n.º 15
0
 /// <summary>
 /// 位置复位
 /// </summary>
 /// <param name="callback"></param>
 private void OnR3(HotkeyCallback callback)
 {
     if (callback.performed)
     {
         m_AreaPointContainer.DOLocalMove(Vector3.zero, 0.5F).SetEase(Ease.OutExpo);
     }
 }
Exemplo n.º 16
0
    /// <summary>
    /// 按下时
    /// </summary>
    /// <param name="eventData">指针事件</param>
    public void OnPointerDown(PointerEventData eventData)
    {
        if (m_Button && m_Button.isActiveAndEnabled && m_Button.interactable && eventData.button == PointerEventData.InputButton.Left)
        {
            m_PressTime = Time.time;

            if (m_State.Mode == HotkeyManager.HotkeyMode.Press)
            {
                HotkeyManager.Instance.PlayHotKeySound(m_State, InputActionPhase.Started);

                if (m_State.Callback != null)
                {
                    m_State.Callback.Invoke(HotkeyCallback.CreateFrom(HotkeyPhase.Started, Time.time, m_PressTime, Time.time - m_PressTime, true));
                }
            }
            else if (m_State.Mode == HotkeyManager.HotkeyMode.Hold)
            {
                if (!m_State.Holding)
                {
                    PlayStartAnim();

                    HotkeyManager.Instance.PlayHotKeySound(m_State, InputActionPhase.Started);

                    if (m_State.Callback != null)
                    {
                        m_State.Callback.Invoke(HotkeyCallback.CreateFrom(HotkeyPhase.Started, Time.time, m_PressTime, m_State.HoldDuration, true));
                    }

                    Progress = 0;
                }
            }
        }
    }
Exemplo n.º 17
0
 /// <summary>
 /// 关闭星图面板
 /// </summary>
 /// <param name="callback"></param>
 private void OnCloseClick(HotkeyCallback callback)
 {
     if (callback.performed)
     {
         UIManager.Instance.ClosePanel(UIPanel.StarAreaPanel);
     }
 }
Exemplo n.º 18
0
 /// <summary>
 /// 手表键松开时
 /// </summary>
 /// <param name="callback">热键状态</param>
 private void OnItemKeyStateChangedFromUI(HotkeyCallback callback)
 {
     if (!callback.started)
     {
         m_WatchKeyHolding = false;
     }
 }
Exemplo n.º 19
0
 private void OnToggleTips(HotkeyCallback callback)
 {
     if (callback.performed)
     {
         m_StarAreaPanelLeftTips.SelectNextCell();
     }
 }
Exemplo n.º 20
0
 /// <summary>
 /// 关闭ConfirmPanel 面板
 /// </summary>
 /// <param name="callback"></param>
 private void ConfirmPanelClose(HotkeyCallback callback)
 {
     if (callback.performed)
     {
         UIManager.Instance.ClosePanel((ConfirmPanel)Facade.RetrieveMediator(UIPanel.ConfirmPanel));
     }
 }
Exemplo n.º 21
0
 /// <summary>
 /// 退出按钮点击时
 /// </summary>
 private void OnExitButtonClick(HotkeyCallback callbackContext)
 {
     if (callbackContext.performed)
     {
         OpenExitPanel();
     }
 }
Exemplo n.º 22
0
 /// <summary>
 /// 设为标记
 /// </summary>
 /// <param name="callbackContext"></param>
 private void SetMarkMail(HotkeyCallback callbackContext)
 {
     if (callbackContext.performed)
     {
         NetworkManager.Instance.GetMailController().C_to_S_MarkMail(m_LastMailSelectVo.Id);
     }
 }
Exemplo n.º 23
0
        private void SetHotkey(HotkeyModel hotkeyModel, HotkeyCallback action)
        {
            string hotkeyStr = hotkeyModel.ToString();

            try
            {
                Hotkey hotkey = new Hotkey
                {
                    Alt   = hotkeyModel.Alt,
                    Shift = hotkeyModel.Shift,
                    Ctrl  = hotkeyModel.Ctrl,
                    Win   = hotkeyModel.Win,
                    Key   = (byte)KeyInterop.VirtualKeyFromKey(hotkeyModel.CharKey),
                };

                _hotkeyHandle = HotkeyManager.RegisterHotkey(hotkey, action);
            }
#pragma warning disable CA1031 // Do not catch general exception types
            catch (Exception)
#pragma warning restore CA1031 // Do not catch general exception types
            {
                string errorMsg = string.Format(CultureInfo.InvariantCulture, InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed"), hotkeyStr);
                MessageBox.Show(errorMsg);
            }
        }
Exemplo n.º 24
0
 /// <summary>
 /// 关闭确认弹窗
 /// </summary>
 /// <param name="notification"></param>
 /// <param name="obj"></param>
 private void ConfirmPanelClose(HotkeyCallback callback)
 {
     if (callback.performed)
     {
         UIManager.Instance.ClosePanel(UIPanel.ConfirmPanel);
     }
 }
Exemplo n.º 25
0
 /// <summary>
 /// 关闭面板
 /// </summary>
 public void ClosePanel(HotkeyCallback callbackContext)
 {
     if (callbackContext.performed)
     {
         UIManager.Instance.ClosePanel(this);
     }
 }
Exemplo n.º 26
0
 /// <summary>
 /// esc按键
 /// </summary>
 /// <param name="callbackContext"></param>
 private void OnEscClose(HotkeyCallback callbackContext)
 {
     if (callbackContext.performed)
     {
         Close(false);
     }
 }
Exemplo n.º 27
0
 /// <summary>
 /// 任命出战
 /// </summary>
 private void OnAppointClick(HotkeyCallback callback)
 {
     if (callback.performed)
     {
         NetworkManager.Instance.GetPackageController().ReqestMove(m_CurrentShip.GetUID(), m_PackageProxy.GetHeroItem().UID, 1, 0);
     }
 }
Exemplo n.º 28
0
 /// <summary>
 /// 选择mod 操作
 /// </summary>
 /// <param name="callback"></param>
 private void OnModSelected(HotkeyCallback callback)
 {
     if (callback.performed)
     {
         OpenModList();
     }
 }
Exemplo n.º 29
0
    /// <summary>
    /// 飞船移动时
    /// </summary>
    /// <param name="info">热键状态</param>
    private void OnShipMove(HotkeyCallback info)
    {
        Vector2 dir = info.ReadValue <Vector2>();

        m_XOffset = dir.x;
        m_ZOffset = dir.y;
    }
Exemplo n.º 30
0
    public void OnChangeWeaponRight(HotkeyCallback callbackContext)
    {
        switch (m_SpacecraftInputProperty.GetMotionType())
        {
        case MotionType.Mmo:
        case MotionType.Dof4:
        case MotionType.Dof6:
        {
            if (!callbackContext.performed ||
                m_SpacecraftInputProperty.GetCurrentState().IsHasSubState(EnumSubState.Peerless) ||         //转化炉模式
                m_SpacecraftInputProperty.GetCurrentState().GetMainState() != EnumMainState.Fight ||        //非战斗模式
                m_SpacecraftInputProperty.GetCurrSkillId() > 0            //有技能在释放
                )
            {
                return;
            }

            m_PlayerSkillProxy.ToggleCurrentWeapon();
        }
        break;

        default:
            break;
        }
    }