コード例 #1
0
    public void SetCursorState(CursorState newState)
    {
        activeCursorState = newState;

        switch (newState)
        {
            case CursorState.Default:
                activeCursor = defaultCursor;
                break;

            case CursorState.Select:
                activeCursor = selectCursor;
                break;

            case CursorState.Attack:
                currentFrame = (int)Time.time % attackCursors.Length;
                activeCursor = attackCursors[currentFrame];
                break;

            case CursorState.Move:
                currentFrame = (int)Time.time % moveCursors.Length;
                activeCursor = moveCursors[currentFrame];
                break;

            case CursorState.Harvest:
                currentFrame = (int)Time.time % harvestCursors.Length;
                activeCursor = harvestCursors[currentFrame];
                break;
            default: break;
        }
    }
コード例 #2
0
ファイル: PitchBar.cs プロジェクト: puthutp/Waver
 public PitchBar()
 {
     cursorState = CursorState.Nothing;
     Height = Program.GRID_VERTICAL - 2;
     Visible = true;
     Lyric = "";
 }
コード例 #3
0
ファイル: CursorManager.cs プロジェクト: Streus/Time-Is-Not
    void RefreshCursorType()
    {
        lastCursorState = cursorState;

        // If setting actual Cursor texture, the second parameter should be half of the cursor's size so that is is centered

        switch (cursorState)
        {
        case CursorState.GAMEPLAY:
            break;

        case CursorState.MENU:
            mainCursorRend.sprite = cursorMenu;
            break;

        case CursorState.DEACTIVATED:
            mainCursorRend.sprite = cursorDeactivated;
            break;

        default:
            Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
            Cursor.visible = true;
            break;
        }

        if (cursorState == CursorState.GAMEPLAY)
        {
            dashCursorRend.enabled = true;
        }
        else
        {
            dashCursorRend.enabled = false;
        }
    }
コード例 #4
0
ファイル: GameManager.cs プロジェクト: artochesterli/Bubbles
    private void Init()
    {
        gameState   = GameState.MainMenu;
        levelState  = LevelState.SetUp;
        cursorState = CursorState.Release;

        HeldBubbleType = BubbleType.Null;

        UseableBubbleList = new List <GameObject>();

        GetLevelInfo();

        if (!LoadProgress())
        {
            SaveProgress();
        }

        if (!LoadConfig())
        {
            SaveConfig();
        }
        else
        {
            EventManager.instance.Fire(new UpdateConfig());
        }

        if (SystemInfo.deviceType == DeviceType.Desktop)
        {
            int height = Screen.currentResolution.height * 4 / 5;
            int width  = height * 9 / 16;

            Screen.SetResolution(width, height, false);
        }
    }
コード例 #5
0
ファイル: GameInstance.cs プロジェクト: Mattias1/td
 public GameInstance(GameState state, GameCamera camera, IRequestDispatcher requestDispatcher)
 {
     State             = state;
     Camera            = camera;
     RequestDispatcher = requestDispatcher;
     Cursor            = new CursorState(this); // bad.
 }
コード例 #6
0
        protected void OnUpdateFrame(object sender, FrameEventArgs e)
        {
            // update the window mode if we have an update queued
            WindowMode?mode = pendingWindowMode;

            if (mode.HasValue)
            {
                pendingWindowMode = null;

                bool currentFullScreen = styleMask.HasFlag(NSWindowStyleMask.FullScreen);
                bool toggleFullScreen  = mode.Value == Configuration.WindowMode.Borderless || mode.Value == Configuration.WindowMode.Fullscreen ? !currentFullScreen : currentFullScreen;

                if (toggleFullScreen)
                {
                    Cocoa.SendVoid(WindowInfo.Handle, selToggleFullScreen, IntPtr.Zero);
                }
                else if (currentFullScreen)
                {
                    NSApplication.PresentationOptions = fullscreen_presentation_options;
                }

                WindowMode.Value = mode.Value;
            }

            // If the cursor should be hidden, but something in the system has made it appear (such as a notification),
            // invalidate the cursor rects to hide it.  OpenTK has a private function that does this.
            if (CursorState.HasFlag(CursorState.Hidden) && Cocoa.CGCursorIsVisible() && !menuBarVisible)
            {
                methodInvalidateCursorRects.Invoke(nativeWindow, new object[0]);
            }
        }
コード例 #7
0
 void ListenDestSelection()
 {
     ListenCursorMovement();
     if (Input.GetKeyDown(KeyCode.Space))
     {
         if (CheckMovable())
         {
             ClearAllHighlightedSquares();
             MoveUnitToCursor();
             highlightedUnit = null;
             if (gameMap.playerUnits.HasAttackableEnemies(cursorX, cursorY))
             {
                 attackableEnemies     = gameMap.playerUnits.GetAttackableEnemies(cursorX, cursorY);
                 attackableTargetIndex = 0;
                 HighlightAttackableTargetTile(true);
                 currState = CursorState.SelectTarget;
             }
             else
             {
                 CheckTurnFinished();
             }
         }
         else
         {
             Debug.Log("You can't move to that square!");
         }
     }
 }
コード例 #8
0
ファイル: CursorManager.cs プロジェクト: tmahlstrom/unity_RTS
    private void SetMouseCursor(CursorState newCursorState)
    {
        switch (newCursorState)
        {
        case CursorState.DefaultCursor:
            newCursorTexture = defaultCursor;
            break;

        case CursorState.TransparentCursor:
            newCursorTexture = transparentCursor;
            break;

        case CursorState.AllyCursor:
            coroutine = CycleCursors(allyCursors, CursorState.AllyCursor);
            if (coroutine != null)
            {
                StartCoroutine(coroutine);
            }
            break;

        case CursorState.EnemyCursor:
            coroutine = CycleCursors(enemyCursors, CursorState.EnemyCursor);
            if (coroutine != null)
            {
                StartCoroutine(coroutine);
            }
            break;
        }
        Cursor.SetCursor(newCursorTexture, cursorPositionModifier, CursorMode.Auto);
    }
コード例 #9
0
                public bool MoveMany(long count)
                {
                    // Note: If we decide to allow count == 0, then we need to special case
                    // that MoveNext() has never been called. It's not entirely clear what the return
                    // result would be in that case.
                    Ch.CheckParam(count > 0, nameof(count));

                    if (State == CursorState.Done)
                    {
                        return(false);
                    }

                    Ch.Assert(State == CursorState.NotStarted || State == CursorState.Good);
                    if (MoveManyCore(count))
                    {
                        Ch.Assert(State == CursorState.NotStarted || State == CursorState.Good);

                        _position += count;
                        State      = CursorState.Good;
                        return(true);
                    }

                    Dispose();
                    return(false);
                }
コード例 #10
0
        void OnWindowPush(Window callingWindow)
        {
            mLastFrameCursorXRelativeToWindow = CursorXRelativeToWindow;
            mLastFrameCursorYRelativeToWindow = CursorYRelativeToWindow;

            if (mSideOver != Sides.None)
            {
                mCursorState = CursorState.DraggingSides;
            }
            else if (!mCursor.ResizingWindow && !IsCursorInSelectedArea && mCursor.mWindowGrabbed == null)
            {
                mSelectedArea.Visible = true;

                mLeftTU = mRightTU = XToU(CursorXRelativeToWindow);
                mTopTV  = mBottomTV = YToV(CursorYRelativeToWindow);

                originalClickX = CursorXRelativeToWindow;
                originalClickY = CursorYRelativeToWindow;

                mLastFrameCursorXRelativeToWindow = originalClickX;
                mLastFrameCursorYRelativeToWindow = originalClickY;

                mSelectedArea.X      = CursorXRelativeToWindow;
                mSelectedArea.ScaleX = 0;

                mSelectedArea.Y      = CursorYRelativeToWindow;
                mSelectedArea.ScaleY = 0;

                mCursorState = CursorState.DraggingCorner;
            }
            else if (IsCursorInSelectedArea)
            {
                mCursorState = CursorState.MovingSelection;
            }
        }
コード例 #11
0
ファイル: HUD.cs プロジェクト: RolandLittlehales/RTS
 public void SetCursorState(CursorState newState)
 {
     activeCursorState = newState;
             switch (newState) {
             case CursorState.Select:
                     activeCursor = selectCursor;
                     break;
             case CursorState.Attack:
                     currentFrame = (int)Time.time % attackCursors.Length;
                     activeCursor = attackCursors [currentFrame];
                     break;
             case CursorState.Harvest:
                     currentFrame = (int)Time.time % harvestCursors.Length;
                     activeCursor = harvestCursors [currentFrame];
                     break;
             case CursorState.Move:
                     currentFrame = (int)Time.time % moveCursors.Length;
                     activeCursor = moveCursors [currentFrame];
                     break;
             case CursorState.PanLeft:
                     activeCursor = leftCursor;
                     break;
             case CursorState.PanRight:
                     activeCursor = rightCursor;
                     break;
             case CursorState.PanUp:
                     activeCursor = upCursor;
                     break;
             case CursorState.PanDown:
                     activeCursor = downCursor;
                     break;
             default:
                     break;
             }
 }
コード例 #12
0
    public static void SetState(CursorState state)
    {
        if (Instance == null)
        {
            Debug.LogWarning("No CursorController found in scene. Skipping settings state");
            return;
        }

        var prevState = Instance._currentState;

        Instance._currentState = state;
        if (Instance._overUI && state != CursorState.Targeting)
        {
            Instance._overUIState = state;
        }
        else if (state < CursorState.MoveCameraUp && state > CursorState.DownOverUI)
        {
            Instance._normalState = state;
        }

        if (prevState != state)
        {
            stateChanged(state);
        }
    }
コード例 #13
0
    //概要 : カーソルの見た目を変更する
    //引数 : CursorState state    カーソルの状態
    //返値 : なし
    public void ChangeCursor(CursorState state)
    {
        Texture2D cursorTex = null;

        switch (state)
        {
        default:
        case CursorState.NormalCursor:
            if (NormalCursorTexture)
            {
                cursorTex = NormalCursorTexture;
            }
            break;

        case CursorState.LockOnCursor:
            if (LockOnCursorTexture)
            {
                cursorTex = LockOnCursorTexture;
            }
            break;
        }
        if (cursorTex == null)
        {   //デフォルトのカーソルを使う
            Cursor.SetCursor(null, new Vector2(0, 0), CursorMode.Auto);
            return;
        }
        //カーソルに画像を使う
        Cursor.SetCursor(cursorTex, new Vector2(cursorTex.width / 2, cursorTex.height / 2), CursorMode.ForceSoftware);
    }
コード例 #14
0
    public void Initialize()
    {
        //UnityEngine.Cursor.visible = false;

        CursorDefault = GameObject.Find("CursorDefault");
        CursorAim     = GameObject.Find("CursorAim");
        CursorHand    = GameObject.Find("CursorHand");
        CursorTalk    = GameObject.Find("CursorTalk");
        CursorPortal  = GameObject.Find("CursorPortal");

        NGUITools.SetActive(CursorDefault.gameObject, false);
        NGUITools.SetActive(CursorHand.gameObject, false);
        NGUITools.SetActive(CursorTalk.gameObject, false);
        NGUITools.SetActive(CursorPortal.gameObject, false);

        Default = Resources.Load("HWCursorDefault") as Texture2D;
        Hand    = Resources.Load("HWCursorHand") as Texture2D;
        Talk    = Resources.Load("HWCursorTalk") as Texture2D;
        Portal  = Resources.Load("HWCursorPortal") as Texture2D;

        CurrentState = CursorState.Default;
        RefreshCursor();

        ToolTip      = GameObject.Find("ToolTip").GetComponent <UILabel>();
        ToolTipDelay = 0.01f;
        NGUITools.SetActive(ToolTip.gameObject, false);

        UIEventHandler.OnCloseWindow     += OnResetCursor;
        UIEventHandler.OnLootBody        += OnResetCursor;
        UIEventHandler.OnLootChest       += OnResetCursor;
        UIEventHandler.OnToggleInventory += OnResetCursor;
    }
コード例 #15
0
    public void SetCursorState(CursorState newState)
    {
        if (activeCursorState != newState)
        {
            previousCursorState = activeCursorState;
        }
        activeCursorState = newState;
        switch (newState)
        {
        case CursorState.Select:
            activeCursor = selectCursor;
            break;

        case CursorState.Attack:
            currentFrame = (int)Time.time % attackCursors.Length;
            activeCursor = attackCursors[currentFrame];
            break;

        case CursorState.Harvest:
            currentFrame = (int)Time.time % harvestCursors.Length;
            activeCursor = harvestCursors[currentFrame];
            break;

        case CursorState.Move:
            currentFrame = (int)Time.time % moveCursors.Length;
            activeCursor = moveCursors[currentFrame];
            break;

        case CursorState.PanLeft:
            activeCursor = leftCursor;
            break;

        case CursorState.PanRight:
            activeCursor = rightCursor;
            break;

        case CursorState.PanUp:
            activeCursor = upCursor;
            break;

        case CursorState.PanDown:
            activeCursor = downCursor;
            break;

        case CursorState.RallyPoint:
            activeCursor = rallyPointCursor;
            break;

        case CursorState.Plus:
            activeCursor = leftCursor;
            break;

        case CursorState.Minus:
            activeCursor = rallyPointCursor;
            break;

        default: break;
        }
    }
コード例 #16
0
 public void SetCursorState(CursorState state)
 {
     if (CurrentState != state)
     {
         CurrentState = state;
         RefreshCursor();
     }
 }
コード例 #17
0
 // For the General Cursor we want to simply override these states
 public override void OnStateChange(CursorState state)
 {
     if (cursorAnim != null)
     {
         cursorAnim.SetInteger("CursorState", (int)state);
     }
     base.OnStateChange(state);
 }
コード例 #18
0
ファイル: Cursor.cs プロジェクト: pmprog/OpenXCOM.Tools
		public Cursor(PckFile cursorFile)
		{
			state = CursorState.Select;	
			this.cursorFile=cursorFile;

			foreach(PckImage pi in cursorFile)
				pi.Image.MakeTransparent(cursorFile.Pal.Transparent);
		}
コード例 #19
0
 public CursorType(TemporaryViewCursorColumn <TRepValue> view, Func <int, bool> needCol, IRowCursor otherValues)
 {
     _needCol           = needCol;
     _view              = view;
     _state             = CursorState.NotStarted;
     _otherValues       = otherValues;
     _ignoreOtherColumn = view._ignoreOtherColumn;
 }
コード例 #20
0
    public void SetDrawLock()
    {
        UpdateCursorTransformState();
        _StateChangeDistance = 0.01f;

        _CursorState = CursorState.lockRad;
        locked       = true;
    }
コード例 #21
0
        /// <summary>
        /// Creates an instance of the <see cref="RootCursorBase"/> class
        /// </summary>
        /// <param name="provider">Channel provider</param>
        protected RootCursorBase(IChannelProvider provider)
        {
            Contracts.CheckValue(provider, nameof(provider));
            Ch = provider.Start("Cursor");

            _position = -1;
            _state    = CursorState.NotStarted;
        }
コード例 #22
0
ファイル: KinectButton3D.cs プロジェクト: janchuvi/prototipo2
    public void TriggerNormal()
    {
        isHovering  = false;
        isPressing  = true;
        cursorState = CursorState.Up;

        ValidateEvents();
    }
コード例 #23
0
    public void Tick(int power, int seed, CursorState cursorState, bool visible)
    {
        isVisible       = visible;
        _powerText.text = "Power: " + power.ToString();
        _seed.text      = "Level: " + seed.ToString();

        DrawCursor(cursorState);
    }
コード例 #24
0
 public virtual void Dispose()
 {
     if (_state != CursorState.Done)
     {
         Ch.Dispose();
         _state = CursorState.Done;
     }
 }
コード例 #25
0
        public void SaveCursor()
        {
            LogController("SaveCursor()");

            SavedCursorState = CursorState.Clone();

            LogController("     C=" + CursorState.CurrentColumn.ToString() + ",R=" + CursorState.CurrentRow.ToString());
        }
コード例 #26
0
        public void Up()
        {
            _cursorState = CursorState.OnReturn;

            Player.SetDefaultPlayerState();

            Player.PlayerBody.drag = 0.0f;
        }
コード例 #27
0
 public void Dispose()
 {
     // NB keep cursor state for reuse
     // dispose is called on the result of Initialize(), the cursor from
     // constructor could be uninitialized but contain some state, e.g. _value for this ArithmeticCursor
     _cursor.Dispose();
     State = CursorState.None;
 }
コード例 #28
0
ファイル: UIContext.cs プロジェクト: ly774508966/Alensia
        public UIContext()
        {
            _style           = new UIStyleReactiveProperty();
            _activeComponent = new ReactiveProperty <IInteractableComponent>();

            _defaultCursor = CursorNames.Default;
            _cursorState   = CursorState.Vislbe;
        }
コード例 #29
0
 public static void CursorStateChange(CursorState state)
 {
     if (state != currentCursorState)
     {
         currentCursorState = state;
         SetCursor();
     }
 }
コード例 #30
0
 private void RectangleProvider_MouseUp(object sender, MouseEventArgs e)
 {
     if (handler.Active)
     {
         handler.EndControllerAction();
         state = CursorState.Hover;
     }
 }
コード例 #31
0
    private void init()
    {
        setTransitions();

        _camera       = this.gameObject.GetComponent <Camera>();
        _currentState = CursorState.Default;
        SelectionPanel.GetComponent <RectTransform>().sizeDelta = Vector2.zero;
    }
コード例 #32
0
 void ListenEnemyMovement()
 {
     if (!gameMap.playerUnits.HasAllPlayerUnitsMoved())
     {
         currState = CursorState.MovingCursor;
         cursor.GetComponent <SpriteRenderer>().color = Color.yellow;
     }
 }
コード例 #33
0
 private void StartManualOp()
 {
     Application.Current.Dispatcher.Invoke(() =>
     {
         RunningManualOp   = true;
         manualCursorState = new CursorState(Cursors.Wait);
     });
 }
コード例 #34
0
 public StreamBlockRecordCursor(StreamBlockIndex blockIndex, StreamLogId slid)
 {
     _blockIndex         = blockIndex;
     _slid               = slid;
     _chunkCursorState   = CursorState.Initialized;
     _cursorCurrentKey   = default;
     _chunkCursorCurrent = default;
 }
コード例 #35
0
ファイル: CursorManager.cs プロジェクト: rotorist/Warzone
	public void SetCursorState(CursorState state)
	{
		if(CurrentState != state)
		{
			CurrentState = state;
		}

		RefreshCursor();
	}
コード例 #36
0
 public PlayerCursor(int playernumber, CursorPosition pos, ControlSet contr, string tokenloc, string slotloc, Vector2 corner)
 {
     this.Position = pos;
     this.control = contr;
     Token = new Texture(tokenloc);
     Slot = new Texture(slotloc, false);
     this.Corner = corner;
     this.PlayerNumber = playernumber;
     State = CursorState.PokemonSelect;
 }
コード例 #37
0
ファイル: CursorManager.cs プロジェクト: rafaelhrasko/Griddy
    /// <summary>
    /// This class...
    /// </summary>
    public void Clear()
    {
        // Resets cursor
        state = CursorState.None;

        // Ghost Tower exists, it is destroyed.
        if(Griddy.Tower.ghost != null) {
            Destroy(Griddy.Tower.ghost.gameObject);
        }
    }
コード例 #38
0
ファイル: CursorManager.cs プロジェクト: rafaelhrasko/Griddy
    void Awake()
    {
        // Hide Screen Cursor
        Screen.showCursor = false;

        // Set initial Cursor state
        state = CursorState.None;

        // Set initial Cursor texture
        cursor = mouseUp;
        Debug.Log(dimensions.ToString());
    }
コード例 #39
0
ファイル: MouseCursor.cs プロジェクト: pentiumx/HLSLTest
        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime)
        {
            base.Draw(gameTime);

            if (MouseInput.BUTTONR()) {
                State = CursorState.CameraRotation;
            } else {
                State = CursorState.Normal;
            }

            Vector2 pos = MouseInput.GetMousePosition();
            spriteBatch.Begin();
            spriteBatch.Draw(texture, State == CursorState.Normal ? MouseInput.GetMousePosition() : MouseInput.GetCachedPosition(), Color.White);
            spriteBatch.End();
        }
コード例 #40
0
ファイル: BtreeCursor.cs プロジェクト: JiujiangZhu/feaserver
        public uint[] OverflowIDs; // Cache of overflow page locations

        #endif

        #region Methods

        // was:sqlite3BtreeCursorZero
        public void Zero()
        {
            Next = null;
            Prev = null;
            KeyInfo = null;
            RootID = 0;
            _cachedRowID = 0;
            Info = new MemPage.CellInfo();
            Writeable = false;
            AtLast = false;
            ValidNKey = false;
            State = 0;
            Key = null;
            NKey = 0;
            SkipNext = 0;
            #if !SQLITE_OMIT_INCRBLOB
            IsIncrblob = false;
            OverflowIDs = null;
            #endif
            PageID = 0;
        }
コード例 #41
0
ファイル: CursorManager.cs プロジェクト: rotorist/Warzone
	public void Initialize()
	{
		UnityEngine.Cursor.visible = false;

		CursorDefault = GameObject.Find("CursorDefault");
		CursorAim = GameObject.Find("CursorAim");
		CursorHand = GameObject.Find("CursorHand");
		CursorTalk = GameObject.Find("CursorTalk");

		CurrentState = CursorState.Default;
		RefreshCursor();

		ToolTip = GameObject.Find("ToolTip").GetComponent<UILabel>();
		ToolTipDelay = 0.5f;
		NGUITools.SetActive(ToolTip.gameObject, false);

		UIEventHandler.OnCloseWindow += OnResetCursor;
		UIEventHandler.OnLootBody += OnResetCursor;
		UIEventHandler.OnLootChest += OnResetCursor;
		UIEventHandler.OnToggleInventory += OnResetCursor;

	}
コード例 #42
0
ファイル: PitchBar.cs プロジェクト: puthutp/Waver
 protected void OnMouseUp(MouseEventArgs mevent)
 {
     if (isClick && Click != null)
     {
         cursorState = CursorState.Nothing;
         Click(this);
     }
     else
     {
         if (cursorState == CursorState.IsResizingLeft)
         {
             int realEX = Left - tempLeft + mevent.X;
             Left = tempLeft + realEX - resizeFirstClickX;
             Width = tempWidth + tempLeft - Left;
             StartTime = tempStartTime + ((Left - tempLeft) / Program.PixelPerSecond);
             PitchBar.ResizeToNeighbour(Program.PitchBars, this);
             if (Length < Program.MinimumLength) // check collision
             {
                 StartTime = tempStartTime;
                 EndTime = tempEndTime;
                 Width = tempWidth;
             }
             if (Resizing != null)
                 Resizing(this);
         }
         else if (cursorState == CursorState.IsResizingRight)
         {
             Width = tempWidth + mevent.X - resizeFirstClickX;
             EndTime = StartTime + (Width / Program.PixelPerSecond);
             PitchBar.ResizeToNeighbour(Program.PitchBars, this);
             if (Length < Program.MinimumLength) // check collision
             {
                 StartTime = tempStartTime;
                 EndTime = tempEndTime;
                 Width = tempWidth;
             }
             if (Resizing != null)
                 Resizing(this);
         }
         else if (cursorState == CursorState.IsMovingVertically)
         {
             int deltaIndex = 0;
             if (mevent.Y < 0)
                 deltaIndex = (mevent.Y - Program.GRID_VERTICAL) / Program.GRID_VERTICAL;
             else
                 deltaIndex = mevent.Y / Program.GRID_VERTICAL;
             NoteIndex -= deltaIndex;
             NoteIndex = (NoteIndex < Program.PANEL_PIANO_START_NOTE_INDEX) ? Program.PANEL_PIANO_START_NOTE_INDEX : ((NoteIndex >= Program.RegisteredNotes.Count) ? Program.RegisteredNotes.Count - 1 : NoteIndex);
             Top += deltaIndex * Program.GRID_VERTICAL;
             if (Resizing != null)
                 Resizing(this);
         }
         cursorState = CursorState.Nothing;
     }
 }
コード例 #43
0
ファイル: MarkingCursor.cs プロジェクト: steffan88/Bevelle
 public void SetCursorMode(CursorMode mode)
 {
     _cursorMode = mode;
     _cursorState = CursorState.Free;
     _markedCubes.Clear();
 }
コード例 #44
0
ファイル: PitchBar.cs プロジェクト: puthutp/Waver
 protected void OnMouseDown(MouseEventArgs mevent)
 {
     if (cursorState == CursorState.WaitingResizeLeft || cursorState == CursorState.WaitingResizeRight)
     {
         if (cursorState == CursorState.WaitingResizeLeft)
             cursorState = CursorState.IsResizingLeft;
         else
             cursorState = CursorState.IsResizingRight;
         resizeFirstClickX = mevent.X;
         tempStartTime = StartTime;
         tempEndTime = EndTime;
         tempWidth = Width;
         tempLeft = Left;
     }
     else if (cursorState == CursorState.WaitingMoveVertically)
     {
         cursorState = CursorState.IsMovingVertically;
     }
     isClick = true;
 }
コード例 #45
0
ファイル: PitchBar.cs プロジェクト: puthutp/Waver
 protected void OnMouseMove(MouseEventArgs mevent)
 {
     if (cursorState == CursorState.Nothing || cursorState == CursorState.WaitingMoveVertically || cursorState == CursorState.WaitingResizeLeft || cursorState == CursorState.WaitingResizeRight)
     {
         int widthHover = Width / 4;
         if (widthHover > 20)
             widthHover = 20;
         if (mevent.X <= widthHover)
         {
             Cursor.Current = Cursors.SizeWE;
             cursorState = CursorState.WaitingResizeLeft;
         }
         else if (mevent.X >= (Width - widthHover))
         {
             Cursor.Current = Cursors.SizeWE;
             cursorState = CursorState.WaitingResizeRight;
         }
         else
         {
             Cursor.Current = Cursors.SizeNS;
             cursorState = CursorState.WaitingMoveVertically;
         }
     }
     else if (cursorState == CursorState.IsMovingVertically)
     {
         int deltaIndex = 0;
         if (mevent.Y < 0)
             deltaIndex = (mevent.Y - Program.GRID_VERTICAL) / Program.GRID_VERTICAL;
         else
             deltaIndex = mevent.Y / Program.GRID_VERTICAL;
         NoteIndex -= deltaIndex;
         NoteIndex = (NoteIndex < Program.PANEL_PIANO_START_NOTE_INDEX) ? Program.PANEL_PIANO_START_NOTE_INDEX : ((NoteIndex >= Program.RegisteredNotes.Count) ? Program.RegisteredNotes.Count - 1 : NoteIndex);
         Top += deltaIndex * Program.GRID_VERTICAL;
         if (Resizing != null)
             Resizing(this);
     }
     else // is resizing
     {
         isClick = false;
         if (cursorState == CursorState.IsResizingLeft)
         {
             int realEX = Left - tempLeft + mevent.X;
             Left = tempLeft + realEX - resizeFirstClickX;
             Width = tempWidth + tempLeft - Left;
             StartTime = tempStartTime + ((Left - tempLeft) / Program.PixelPerSecond);
         }
         else if (cursorState == CursorState.IsResizingRight)
         {
             Width = tempWidth + mevent.X - resizeFirstClickX;
         }
         if (Resizing != null)
             Resizing(this);
     }
 }
コード例 #46
0
 private Node SetState(CursorState state, string word)
 {
     Node node = null;
     if (state != currentState)
     {
         if (state == CursorState.FieldName)
         {
             node = new FieldNode(word);
         }
         if (state == CursorState.Condition)
         {
             node = new ConditionNode(word);
         }
         if (state == CursorState.Parameter)
         {
             node = new ParameterNode(word);
         }
         if (state == CursorState.Constant)
         {
             node = new ConstantNode(word);
         }
         if (state == CursorState.ArrayOfValues)
         {
             node = new ArrayOfValues(word);
         }
         if (state == CursorState.OpenBracket)
         {
             node = new OpenBracketNode();
         }
         if (state == CursorState.CloseBracket)
         {
             node = new CloseBracketNode();
         }
         if (state == CursorState.Operator)
         {
             node = new OperatorNode(word);
         }
         if (node != null)
             nodes.Add(node);
         currentState = state;
     }
     return node;
 }
コード例 #47
0
        private void AnimTimer_Tick(object sender, EventArgs e)
        {
            if (!_animating && _animQueue.Count > 0)
            {
                CursorState nextState = CursorState.ClosedHand, tryState;
                while (_animQueue.TryDequeue(out tryState))
                {
                    nextState = tryState;
                }

                if (nextState != _cursorState)
                {
                    _animating = true;
                    if (_cursorState == CursorState.OpenHand)
                    {
                        _openToCloseHandAnimation.Begin();
                    }
                    else
                    {
                        _closeToOpenHandAnimation.Begin();
                    }
                    _cursorState = nextState;
                }
            }
        }
コード例 #48
0
        private void EnterCursorState(CursorState state)
        {
            if (this.mouseState != CursorState.Normal)
                this.LeaveCursorState();

            this.mouseState = state;
            this.createPolyIndex = 0;
            this.selectedBody.BeginUpdateBodyShape();
            this.MouseActionAllowed = false;
            this.UpdateToolbar();
            this.UpdateCursorImage();
            this.Invalidate();

            if (Sandbox.State == SandboxState.Playing)
                Sandbox.Pause();
            DualityEditorApp.Deselect(this, ObjectSelection.Category.Other);
        }
コード例 #49
0
ファイル: AtavismCursor.cs プロジェクト: zukeru/ageofasura
 public void SetCursor(CursorState cursorState)
 {
     this.cursorState = cursorState;
 }
コード例 #50
0
ファイル: Cursor.cs プロジェクト: steffan88/Bevelle
 private void StartMarking()
 {
     _cursorState = CursorState.Marking;
     _clickedMapElement = _highlighted;
 }
コード例 #51
0
ファイル: Cursor.cs プロジェクト: steffan88/Bevelle
 private void StopMarking()
 {
     _cursorState = CursorState.Free;
 }
コード例 #52
0
ファイル: Cursor.cs プロジェクト: steffan88/Bevelle
        private void ExecuteMarking()
        {
            _cursorState = CursorState.Free;

            if (_cursorMode == CursorMode.Mine)
            {
                foreach (Vector3Int cube in _markedCubes)
                {
                    _worldMap.GetMapElement(cube.X, cube.Y, cube.Z).Mark(MapElementState.MiningScheduled);
                }
            }
            else if (_cursorMode == CursorMode.Chopping)
            {
                foreach (Vector3Int cube in _markedCubes)
                {
                    _worldMap.GetMapElement(cube.X, cube.Y, cube.Z).Mark(MapElementState.ChobbingScheduled);
                }
            }
        }
コード例 #53
0
 public void SetCursorState(CursorState aState)
 {
     _animQueue.Enqueue(aState);
 }
コード例 #54
0
ファイル: HUD.cs プロジェクト: matkal-2/Unity-Projects
 public void PlacedRallyPoint()
 {
     SetCursorState(CursorState.Select);
     previousCursorState = activeCursorState;
 }
コード例 #55
0
ファイル: Hud.cs プロジェクト: Blkx-Darkreaper/Unity
        public void SetCursorState(CursorState state)
        {
            if (activeCursorState != state)
            {
                PreviousCursorState = activeCursorState;
            }

            activeCursorState = state;
            UpdateCursorAnimation();
        }
コード例 #56
0
		public CursorEvent(CursorState state)
		{
			currentcursorstate = state;
		}
コード例 #57
0
ファイル: MarkingCursor.cs プロジェクト: steffan88/Bevelle
 private void StopMarking()
 {
     _cursorState = CursorState.Free;
     _markedCubes.Clear();
     _invalidCubes.Clear();
 }
コード例 #58
0
        internal static void ListenForMouseoverUnit()
        {
            mInPlayObjectList.Reset();

            for (int i = 0; i < mInPlayObjectList.GetCount(); i++)
            {

                if (mInPlayObjectList.GetCurrent().gameObject.Hostility == Hostility.ENEMY &&
                    mInPlayObjectList.GetCurrent().gameObject.Sprite.SpriteFrame.Contains(mouseRectangle))
                {
                    cursorState = CursorState.ATTACK;
                    break;
                }
                else
                {
                    cursorState = CursorState.GAUNTLET;
                }

                mInPlayObjectList.NextNode();
            }
        }
コード例 #59
0
        private void LeaveCursorState()
        {
            if (this.mouseState == CursorState.Normal)
                return;

            this.mouseState = CursorState.Normal;
            this.MouseActionAllowed = true;
            this.selectedBody.EndUpdateBodyShape();
            this.UpdateToolbar();
            this.Invalidate();
        }
コード例 #60
0
        void OnWindowPush(Window callingWindow)
        {
            mLastFrameCursorXRelativeToWindow = CursorXRelativeToWindow;
            mLastFrameCursorYRelativeToWindow = CursorYRelativeToWindow;

            if (mSideOver != Sides.None)
            {
                mCursorState = CursorState.DraggingSides;
            }            
            else if (!mCursor.ResizingWindow && !IsCursorInSelectedArea && mCursor.mWindowGrabbed == null)
            {
                mSelectedArea.Visible = true;

                mLeftTU = mRightTU = XToU(CursorXRelativeToWindow);
                mTopTV = mBottomTV = YToV(CursorYRelativeToWindow);

                originalClickX = CursorXRelativeToWindow;
                originalClickY = CursorYRelativeToWindow;

                mLastFrameCursorXRelativeToWindow = originalClickX;
                mLastFrameCursorYRelativeToWindow = originalClickY;

                mSelectedArea.X = CursorXRelativeToWindow;
                mSelectedArea.ScaleX = 0;

                mSelectedArea.Y = CursorYRelativeToWindow;
                mSelectedArea.ScaleY = 0;

                mCursorState = CursorState.DraggingCorner;
            }
            else if (IsCursorInSelectedArea)
            {
                mCursorState = CursorState.MovingSelection;
            }
        }