Пример #1
0
 private void SetNormalMode()
 {
     _clickMode  = ClickModes.Normal;
     base.Cursor = Cursors.Arrow;
     this.ResetGestureToNone();
     _viewport3D.RotateGesture = new MouseGesture(MouseAction.LeftClick);
 }
        protected override void WhenLeftDown(Point cursor, Point tile)
        {
            this.ContextMenu.Cursor = cursor;
            if (this.ContextMenu.Visible && this.ContextMenu.Focused)
            {
                // 컨텍스트 메뉴 클릭
                this.ContextMenu.OnClick(cursor);
            }
            else
            {
                switch (m_clickMode)
                {
                case ClickModes.BuildCountry:
                    m_clickMode = ClickModes.Wait;     // NOTE: 이걸 먼저해야 callback 호출에서 클릭모드를 변경하는게 적용됨.
                    this.Client.GameBoardDirector.BuildCountry(tile.X, tile.Y,
                                                               this.WhenMyCountryBuilt);
                    break;

                case ClickModes.Normal:
                    this.ProceedNormalClick(tile);
                    break;
                }
            }


            // 컨텍스트 메뉴 닫기
            this.ContextMenu.Visible = false;
        }
Пример #3
0
    private void OnMouseUp()
    {
        if (IsCoveredByUI())
        {
            return;
        }

        this.mouseDown = false;

        if (this.clickMode != ClickModes.NONE)
        {
            if (this.MouseUp != null)
            {
                this.MouseUp.Invoke(this);
            }

            if (this.clickMode == ClickModes.CLICK && this.over)    // Cannot click if you're not still pointing at the object
            {
                if (this.Click != null)
                {
                    this.Click.Invoke(this);
                }
            }

            this.clickMode = ClickModes.NONE;
        }

        if (this.cr_mouseDown != null)
        {
            StopCoroutine(this.cr_mouseDown);
            this.cr_mouseDown = null;
        }
    }
Пример #4
0
 private void SetZoomOutMode()
 {
     this.ResetGestureToNone();
     _viewport3D.ZoomGesture = new MouseGesture(MouseAction.LeftClick);
     _clickMode  = ClickModes.ZoomOut;
     base.Cursor = ChartPlotter3D.cursorZoomOut;
     _viewport3D.CameraController.ZoomIn = false;
 }
        private void WhenReceiveNewTerritory(int tileX, int tileY)
        {
            m_clickMode = ClickModes.BuildCountry;

            // 해당 지역으로 화면 옮기기
            this.BoardView.MoveScreenTo(tileX, tileY);

            // 해당 지역의 땅 정보 요청
            this.Client.GameBoardDirector.UpdateChunkContainsTileAt(tileX, tileY);
        }
Пример #6
0
 private void OnResetViewCommand(object sender, ExecutedRoutedEventArgs args)
 {
     _clickMode  = ClickModes.Normal;
     base.Cursor = Cursors.Arrow;
     this.ResetGestureToNone();
     _viewport3D.RotateGesture = new MouseGesture(MouseAction.LeftClick);
     _viewport3D.ResetCamera();
     _dataPointTip.Children.Clear();
     _ptToolTip.Visibility = Visibility.Hidden;
     _showMesh             = false;
 }
        private void WhenMyCountryBuilt(bool bSuccess, int tileX, int tileY)
        {
            if (bSuccess)
            {
                m_clickMode = ClickModes.Normal;

                this.BoardView.MoveScreenTo(tileX, tileY);
            }
            else
            {
                m_clickMode = ClickModes.BuildCountry;
            }
        }
Пример #8
0
    private void OnMouseDown()
    {
        if (IsCoveredByUI())
        {
            return;
        }

        this.mouseDown = true;

        if (this.cr_mouseDown != null)
        {
            StopCoroutine(this.cr_mouseDown);
        }

        this.clickMode    = ClickModes.CLICK;
        this.cr_mouseDown = StartCoroutine(CR_ClickTimer());
    }
        //#####################################################################################

        private void WhenReceiveCountryLocation(bool exist, int tileX, int tileY)
        {
            if (exist)
            {
                m_clickMode = ClickModes.Normal;

                // 해당 지역으로 화면 옮기기
                this.BoardView.MoveScreenTo(tileX, tileY);

                // 플레이어 땅 정보 요청
                this.Client.GameBoardDirector.RequestMyTerritory();

                // 플레이어 시야 정보 요청
                this.Client.GameBoardDirector.RequestMyVision();
            }
            else
            {
                // 건국할 지역 요청
                this.Client.GameBoardDirector.RequestNewTerritory(this.WhenReceiveNewTerritory);
            }
        }
Пример #10
0
        private void OnMOuseLeftBtnDown(object sender, MouseButtonEventArgs e)
        {
            ClickModes clickMode = _clickMode;

            if (clickMode != ClickModes.Normal)
            {
                if (clickMode == ClickModes.DataCursor)
                {
                    this.FindNearPoint(e);
                }
            }
            else if (!_showPointGraph)
            {
                _viewport3D.Children.Remove(_axisGrid);
                _viewport3D.Children.Remove(_curveModel);
                _viewport3D.Children.Remove(_wireFrame);
                _viewport3D.Children.Remove(_mesh3D);
                _viewport3D.Children.Add(_pntsModel);
                _showPointGraph       = true;
                _dataTipVsisible      = _ptToolTip.Visibility;
                _ptToolTip.Visibility = Visibility.Hidden;
            }
        }
Пример #11
0
 private void SetCusorMode()
 {
     _clickMode  = ClickModes.DataCursor;
     base.Cursor = Cursors.Cross;
     this.ResetGestureToNone();
 }
Пример #12
0
    private IEnumerator CR_ClickTimer()
    {
        yield return(new WaitForSecondsRealtime(CLICK_THRESHOLD));

        this.clickMode = ClickModes.UP_ONLY;
    }