public void SetCursor(object locker, Texture2D texture, Vector2 hotspot, CursorMode mode)
        {
            if (m_locker != null && m_locker != locker)
            {
                return;
            }

            if (texture != null)
            {
                hotspot = new Vector2(texture.width * hotspot.x, texture.height * hotspot.y);
            }
            else
            {
                texture = DefaultCursorTexture;
                if (texture != null)
                {
                    hotspot = new Vector2(texture.width * DefaultCursorHotspot.x, texture.height * DefaultCursorHotspot.y);
                }
            }

            m_locker = locker;
            if (m_texture != texture)
            {
                Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
                Cursor.SetCursor(texture, hotspot, mode);
                m_texture = texture;
            }
        }
Ejemplo n.º 2
0
 public Cursor(Color drawcol)
     : base(Player.Position, Vector2.Zero, UILayer.MouseTex)
 {
     normalColor = drawcol;
     mode        = CursorMode.Free;
     scale       = 1.5f;
 }
Ejemplo n.º 3
0
    public void Update()
    {
        if (!CustomCursor.Get())
        {
            return;
        }
        bool       visible    = Cursor.visible;
        CursorMode cursorMode = (Inventory3DManager.Get() && Inventory3DManager.Get().gameObject.activeSelf&& Inventory3DManager.Get().m_CarriedItem) ? CursorMode.ForceSoftware : CursorMode.Auto;

        if (cursorMode != this.m_Mode)
        {
            this.m_Mode = cursorMode;
            if (this.m_Mode == CursorMode.ForceSoftware)
            {
                CustomCursor.Get().Show(true);
                this.m_SystemCursorActive = false;
            }
            else
            {
                CustomCursor.Get().Show(false);
                this.m_SystemCursorActive = true;
            }
            if (CustomCursor.Get())
            {
                CustomCursor.Get().m_Texture = this.m_TexturesMap[this.m_Type];
            }
            Cursor.SetCursor(this.m_TexturesMap[this.m_Type], Vector2.zero, this.m_Mode);
        }
    }
Ejemplo n.º 4
0
    public void ChangeCursorTextureUsingSprite(Sprite cursorSprite, Vector2 hotSpot, CursorMode cursorMode)
    {
        //this method will use the sprite to change the cursor texture 2D into the cursor img
        Texture2D cursorTexture = cursorSprite.texture;

        Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);
    }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     cursorTexture2 = cursorTexture;
     cursorMode2    = cursorMode;
     Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);
     DontDestroyOnLoad(this);
 }
Ejemplo n.º 6
0
        public override bool Equals(object obj)
        {
            // Potentially use hashcode to avoid garbage made from unboxing?
            CursorMode other = (CursorMode)obj;

            return(Visible == other.Visible && LockMode == other.LockMode);
        }
Ejemplo n.º 7
0
    // do state checking inside method
    public void UpdateCursorTexture()
    {
        Texture2D  cursorType = null;
        CursorMode cursorMode = CursorMode.Auto;

        switch (mouseInputStatus)
        {
        case MouseInputState.Attack:
            cursorType = PrefabManager.instance.crosshairCursorType;
            Cursor.SetCursor(cursorType, new Vector2(cursorType.width / 2, cursorType.height / 2), cursorMode);
            break;

        case MouseInputState.AddTower:
            cursorType = PrefabManager.instance.addTowerCursorType;
            cursorMode = CursorMode.ForceSoftware;
            Cursor.SetCursor(cursorType, new Vector2(cursorType.width / 2, cursorType.height / 2), cursorMode);
            break;

        case MouseInputState.UpgradeTower:
            cursorType = PrefabManager.instance.upgradeTowerCursorType;
            cursorMode = CursorMode.ForceSoftware;
            Cursor.SetCursor(cursorType, new Vector2(cursorType.width / 2, cursorType.height / 2), cursorMode);
            break;

        case MouseInputState.InteractUI:
        default:
            cursorType = PrefabManager.instance.pickerCursorType;
            Cursor.SetCursor(cursorType, new Vector2(cursorType.width / 3, 0), cursorMode);
            break;
        }
    }
Ejemplo n.º 8
0
 /// <summary>
 /// Handles losing the focus.
 /// </summary>
 /// <param name="e">An EventArgs that contains the event data.</param>
 protected override void OnLostFocus(EventArgs e)
 {
     base.OnLostFocus(e);
     this.hoverBottomBorder = this.hoverLeftBorder = this.hoverRightBorder = this.hoverTopBorder = false;
     this.hitBottomBorder   = this.hitLeftBorder = this.hitRightBorder = this.hitTopBorder = false;
     this.cursorMode        = CursorMode.Main;
 }
Ejemplo n.º 9
0
 //public static bool IsCursorOpperationValidOnCube(CursorMode mode, Cube cube)
 //{
 //    if (cube == null)
 //        return false;
 //    if (mode == CursorMode.None)
 //        return true;
 //    if (mode == CursorMode.Mine &&
 //        (cube.ElementType == MapElementType.Rock)
 //        )
 //    {
 //        return true;
 //    }
 //    return false;
 //}
 public static bool IsCursorOpperationValidOnMapElement(CursorMode mode, MapElement element)
 {
     if (element == null)
         return false;
     if (mode == CursorMode.Mine &&
         (
         element.ElementType == MapElementType.Rock ||
         element.ElementType == MapElementType.IronOreCube
         ) &&
         element.Position.Z == WorldMap.Instance.GetSurfacePoint()
         )
         return true;
     else if ((mode == CursorMode.CropArea || mode == CursorMode.Pasture) &&
         element.Position.Z == WorldMap.Instance.GetSurfacePoint() + 1 &&
         element.ElementState == MapElementState.Free)
     {
         if (WorldMap.Instance.GetMapElement(element.Position.X, element.Position.Y, element.Position.Z - 1) != null)
             return false;
         return true;
     }
     else if (mode == CursorMode.PlacingBuilding && element.ElementEffect == MapElementEffect.Moveable)
         return true;
     else if (mode == CursorMode.PlacingWorldObject && element.ElementEffect == MapElementEffect.Moveable)
     {
         return true;
     }
     //if (mode == CursorMode.Chopping && element.ElementType == MapElementType.Tree)
     //{
     //    return true;
     //}
     return false;
 }
    /// <summary>
    /// Method calls Extinguish() method of all the grass under mouse cursor(selection circle).
    /// </summary>
    /// <param name="cursorMode"></param>
    /// <param name="selectionSize"></param>
    public override void OnMouseClick(CursorMode cursorMode, float selectionSize)
    {
        RaycastHit hit;

        switch (cursorMode)
        {
        case CursorMode.point:
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            if (Physics.Raycast(ray, out hit))
            {
                Debug.Log(hit.transform.tag);
                if (hit.transform.CompareTag("Grass"))
                {
                    hit.transform.GetComponent <Grass>().Extinguish();
                }
            }
            break;

        case CursorMode.circle:
            Ray          cRay  = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit[] grass = Physics.SphereCastAll(cRay, selectionSize / 2);

            foreach (RaycastHit r in grass)
            {
                if (r.transform.tag == "Grass")
                {
                    r.transform.GetComponent <Grass>().Extinguish();
                }
            }
            break;

        default:
            break;
        }
    }
Ejemplo n.º 11
0
 void SetCursor(Texture2D texture, Vector2 hotspot, CursorMode cursorMode)
 {
     if (Input.mousePresent)
     {
         Cursor.SetCursor(texture, hotspot, cursorMode);
     }
 }
Ejemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        CursorMode cursorMode = CursorMode.Auto;
        Vector2    hotSpot    = new Vector2(cursorTexture.width * 0.5f, cursorTexture.height * 0.5f);

        Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);
    }
        public void Complete(Vector2 startingPoint, Vector2 point, bool isOutNodeDistance)
        {
            CursorMode cursorMode = this.CursorMode;

            this.CursorMode = CursorMode.None;

            switch (cursorMode)
            {
            case CursorMode.Transformer:
                ToolBase.TransformerTool.Complete(startingPoint, point);     //TransformerTool
                break;

            case CursorMode.Move:
                ToolBase.MoveTool.Complete(startingPoint, point);    //MoveTool
                break;

            case CursorMode.BoxChoose:
            {
                if (isOutNodeDistance)
                {
                    //BoxChoose
                    Layerage         layerage        = this.SelectionViewModel.GetFirstSelectedLayerage();
                    IList <Layerage> parentsChildren = this.ViewModel.LayerageCollection.GetParentsChildren(layerage);
                    this.BoxChoose(parentsChildren);

                    this.SelectionViewModel.SetMode(this.ViewModel.LayerageCollection);        //Selection

                    LayerageCollection.ArrangeLayersBackground(this.ViewModel.LayerageCollection);

                    this.ViewModel.Invalidate(InvalidateMode.HD);        //Invalidate
                }
            }
            break;
            }
        }
Ejemplo n.º 14
0
 void Start()
 {
     // ustawienie własnego kursora
     cursorMode = CursorMode.Auto;
     hotSpot    = Vector2.zero;
     Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);
 }
Ejemplo n.º 15
0
        public void SetAttackCursor()
        {
            Texture2D  cursorTexture = cursors[0];
            CursorMode cursorMode    = CursorMode.ForceSoftware;

            Cursor.SetCursor(cursorTexture, Vector2.zero, cursorMode);
        }
Ejemplo n.º 16
0
 //change current curose type based on player action mode
 void ChangeCursor()
 {
     if (currentMode != pa.playerMode)
     {
         if (pa.playerMode == Mode.attack)
         {
             Vector2    hotspot    = Vector2.zero;
             CursorMode cursorMode = CursorMode.Auto;
             Cursor.SetCursor(cursorBattle, hotspot, cursorMode);
         }
         else if (pa.playerMode == Mode.chat)
         {
             Vector2    hotspot    = Vector2.zero;
             CursorMode cursorMode = CursorMode.Auto;
             Cursor.SetCursor(cursorChat, hotspot, cursorMode);
         }
         else if (pa.playerMode == Mode.farm)
         {
             Vector2    hotspot    = Vector2.zero;
             CursorMode cursorMode = CursorMode.Auto;
             Cursor.SetCursor(cursorFarm1, hotspot, cursorMode);
         }
         currentMode = pa.playerMode;
     }
 }
Ejemplo n.º 17
0
        public void Cursor(CursorMode mode)
        {
            var cursorMode = "";

            switch (mode)
            {
            case CursorMode.Arrow:
                cursorMode = "default";
                break;

            case CursorMode.Cross:
                cursorMode = "crosshair";
                break;

            case CursorMode.Hand:
                cursorMode = "pointer";
                break;

            case CursorMode.Move:
                cursorMode = "move";
                break;

            case CursorMode.Text:
                cursorMode = "text";
                break;

            case CursorMode.Wait:
                cursorMode = "wait";
                break;

            default:
                throw new Exception("Invalid CursorMode");
            }
            Cursor(cursorMode);
        }
        public void Started(Vector2 startingPoint, Vector2 point)
        {
            this.CursorMode = CursorMode.None;

            if (ToolBase.TransformerTool.Started(startingPoint, point))//TransformerTool
            {
                this.CursorMode = CursorMode.Transformer;
                return;
            }

            if (ToolBase.MoveTool.Started(startingPoint, point))//MoveTool
            {
                this.CursorMode = CursorMode.Move;
                return;
            }

            //Box
            this.CursorMode = CursorMode.BoxChoose;

            Matrix3x2 inverseMatrix       = this.ViewModel.CanvasTransformer.GetInverseMatrix();
            Vector2   canavsStartingPoint = Vector2.Transform(startingPoint, inverseMatrix);
            Vector2   canvasPoint         = Vector2.Transform(point, inverseMatrix);

            this.BoxRect = new TransformerRect(canavsStartingPoint, canvasPoint);

            this.ViewModel.Invalidate(InvalidateMode.Thumbnail);//Invalidate
        }
Ejemplo n.º 19
0
        public void Update(GameTime gameTime)
        {
            if (Height < 0)
            {
                Height = 0;
            }
            if (Height > 31)
            {
                Height = 25;
            }

            if (destructable < 0)
            {
                destructable = 0;
            }
            if (destructable > 2)
            {
                destructable = 2;
            }

            if ((int)Mode > 4)
            {
                Mode = 0;
            }
        }
Ejemplo n.º 20
0
    public void setMouseWhite()
    {
        CursorMode cursorMode = CursorMode.Auto;
        Vector2    hotSpot    = Vector2.zero;

        Cursor.SetCursor(CursorImage, hotSpot, cursorMode);
    }
Ejemplo n.º 21
0
    void Awake()
    {
        _cursorMode = CursorMode.Auto;
        _hotSpot = Vector2.zero;

        Cursor.SetCursor(cursorTexture, _hotSpot, _cursorMode);
    }
Ejemplo n.º 22
0
        protected override Boolean IsValid(CSSValue value)
        {
            if (value.Is("auto"))
            {
                _mode = _auto;
            }
            else if (value is CSSValueList)
            {
                return(Evaluate((CSSValueList)value));
            }
            else if (value == CSSValue.Inherit)
            {
                return(true);
            }
            else
            {
                var mode = Evaluate(value);

                if (mode == null)
                {
                    return(false);
                }

                _mode = mode;
            }

            return(true);
        }
Ejemplo n.º 23
0
        private void SetCursor(bool refresh = false)
        {
            int cursorWidth  = 32;
            int cursorHeight = 32;

            if (TextureReplacement.TryImportTexture("Cursor", true, out Texture2D tex))
            {
                CursorMode cursorMode = CursorMode.Auto;
                cursorWidth  = tex.width;
                cursorHeight = tex.height;

                // Cases when true cursor size cannot be achieved using hardware accelerated cursor
                if (SystemInfo.operatingSystemFamily == OperatingSystemFamily.Windows && (cursorWidth > 32 || cursorHeight > 32))
                {
                    cursorMode = CursorMode.ForceSoftware;
                }

                Cursor.SetCursor(tex, Vector2.zero, cursorMode);
                Debug.Log("Cursor texture overridden by mods.");
            }
            else
            {
                Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
            }

            DaggerfallUnity.Settings.CursorWidth  = cursorWidth;
            DaggerfallUnity.Settings.CursorHeight = cursorHeight;

            if (!refresh)
            {
                StateManager.OnStateChange += StateManager_OnStateChange;
            }
        }
Ejemplo n.º 24
0
 // Use this for initialization
 void Start()
 {
     cursorTexture2 = cursorTexture;
     cursorMode2 = cursorMode;
     Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);
     DontDestroyOnLoad (this);
 }
Ejemplo n.º 25
0
 private void SetCursor(Texture2D texture, Vector3 hotspot, CursorMode mode)
 {
     if (VR.GUI.SoftCursor)
     {
         VR.GUI.SoftCursor.SetCursor(texture ?? this.Cursor00);
     }
 }
Ejemplo n.º 26
0
    void SpawnParticleOnClick()
    {
        //if (Input.GetKey(KeyCode.Mouse0))
        switch (_CursorMode)
        {
        case CursorMode.NORMAL:
        {
            if ((_Paint) ? Input.GetMouseButton(0) : Input.GetMouseButtonDown(0))
            {
                //Debug.Log("SPAWNed IT!!!!");
                //instantiate and add in the list
                Vector3    positionToSpawn = ParticleSpawner.transform.position;
                GameObject ParticleObject;
                ParticleObject = Instantiate(ParticlePrefab, new Vector3(positionToSpawn.x, positionToSpawn.y, positionToSpawn.z), Quaternion.identity) as GameObject;
                //Debug.Log("ParticleObject.transform.position: " + ParticleObject.transform.position);
                _Particles.Add(ParticleObject);

                RootOcTree.Insert(ParticleObject);
            }
            if (Input.GetMouseButtonUp(1))
            {
                //TODO: fix right click at appropriate time
                //ClearQuadtree();
                //_QuadTree.ParticleUnderCursor(hit.point);
                //
                Debug.Log("CHANGEDS!!!!");
                _CursorMode = CursorMode.SPAWN_MULTIPLE;
            }
            break;
        }

        case CursorMode.SPAWN_MULTIPLE:
        {
            if ((_Paint) ? Input.GetMouseButton(0) : Input.GetMouseButtonDown(0))
            {
                //Debug.Log("SPAWNed IT!!!!");
                //instantiate and add in the list
                Vector3    positionToSpawn = ParticleSpawner.transform.position;
                GameObject ParticleObject;
                float      tempWidth = CubeWidth.x;
                for (int i = -10; i < 10; ++i)
                {
                    ParticleObject = Instantiate(ParticlePrefab, new Vector3(UnityEngine.Random.Range(-tempWidth, tempWidth), UnityEngine.Random.Range(-tempWidth, tempWidth), UnityEngine.Random.Range(-tempWidth, tempWidth)), Quaternion.identity) as GameObject;
                    _Particles.Add(ParticleObject);

                    RootOcTree.Insert(ParticleObject);
                }
            }

            if (Input.GetMouseButtonUp(1))
            {
                //
                _CursorMode = CursorMode.NORMAL;
            }

            break;
        }
        }        //switch end
    }
Ejemplo n.º 27
0
    // Use this for initialization
    void Start()
    {
        CursorMode cursorMode = CursorMode.Auto;

//		this.player_script = gameObject.GetComponent<mainPlayer> ();
        //this.mouse_cursor = Resources.Load ("Sprites/hud/cursor") as Texture2D;
        Cursor.SetCursor(this.mouse_cursor, Vector2.zero, cursorMode);
    }
Ejemplo n.º 28
0
    // Use this for initialization
    void Start()
    {
        _playerHealth = Player.GetComponentInChildren <Health> ();
        CursorMode cursorMode = CursorMode.Auto;
        Vector2    hotSpot    = Vector2.zero;

        Cursor.SetCursor(CursorImage, hotSpot, cursorMode);
    }
Ejemplo n.º 29
0
 private void SetPointsRadioButton_Checked(object sender, RoutedEventArgs e)
 {
     m_cursorMode = CursorMode.SettingPoints;
     if (MovePointsRadioButton != null)
     {
         MovePointsRadioButton.IsChecked = false;
     }
 }
Ejemplo n.º 30
0
 private void SetCursor(Texture2D texture, Vector2 hotspot, CursorMode cursorMode)
 {
     if (!Input.get_mousePresent())
     {
         return;
     }
     Cursor.SetCursor(texture, hotspot, cursorMode);
 }
Ejemplo n.º 31
0
 protected void SetCursor(Texture2D new_cursor, Vector2 offset, CursorMode mode)
 {
     if ((UnityEngine.Object)new_cursor != (UnityEngine.Object)activeCursor)
     {
         activeCursor = new_cursor;
         Cursor.SetCursor(new_cursor, offset, mode);
     }
 }
Ejemplo n.º 32
0
 // Use this for initialization
 void Start()
 {
     pCtrl       = FindObjectOfType <SideScrollController>();
     grappleCtrl = FindObjectOfType <GrappleController>();
     paused      = gm.frozen;
     cursorMode  = CursorMode.Auto;
     Cursor.SetCursor(reticle, new Vector2(reticle.width / 2f, reticle.height / 2f), CursorMode.Auto);
 }
Ejemplo n.º 33
0
 void OnMouseEnter()
 {
     cursorMode = CursorDefecto.getDefaultCursorMode();
     if (VariablesGenerales.Instance.getOnConversation())
     {
         Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);
     }
 }
Ejemplo n.º 34
0
        //public static bool IsCursorOpperationValidOnCube(CursorMode mode, Cube cube)
        //{
        //    if (cube == null)
        //        return false;
        //    if (mode == CursorMode.None)
        //        return true;
        //    if (mode == CursorMode.Mine &&
        //        (cube.ElementType == MapElementType.Rock)
        //        )
        //    {
        //        return true;
        //    }
        //    return false;
        //}
        public static bool IsCursorOpperationValidOnMapElement(CursorMode mode, MapElement element)
        {
            if (element == null)
                return false;

            if (mode == CursorMode.Mine &&
                (
                element.ElementType == MapElementType.Rock ||
                element.ElementType == MapElementType.IronOreCube
                ) &&
                element.Position.Z == WorldMap.Instance.GetSurfacePoint()
                )
                return true;

            else if ((mode == CursorMode.CropArea || mode == CursorMode.Pasture || mode == CursorMode.IndoorCropArea || mode == CursorMode.Wall) &&
                element.Position.Z == WorldMap.Instance.GetSurfacePoint() + 1 &&
                element.ElementState == MapElementState.Free)
            {
                bool valid = true;

                // Check if there is a rock in the way
                if (WorldMap.Instance.GetMapElement(element.Position.X, element.Position.Y, element.Position.Z - 1) != null)
                    valid = false;

                // Check if outside
                if (mode == CursorMode.IndoorCropArea)
                {
                    if (WorldMap.Instance.IsOutside(element.Position.X, element.Position.Y) == true)
                        valid = false;
                }
                if (mode == CursorMode.CropArea)
                {
                    if (WorldMap.Instance.IsOutside(element.Position.X, element.Position.Y) == false)
                        valid = false;
                }

                return valid;
            }

            else if (mode == CursorMode.PlacingBuilding && element.ElementEffect == MapElementEffect.Moveable)
                return true;

            else if (mode == CursorMode.PlacingWorldObject && element.ElementEffect == MapElementEffect.Moveable)
            {
                return true;
            }
            //if (mode == CursorMode.Chopping && element.ElementType == MapElementType.Tree)
            //{
            //    return true;
            //}
            return false;
        }
Ejemplo n.º 35
0
 //public static bool IsCursorOpperationValidOnCube(CursorMode mode, Cube cube)
 //{
 //    if (cube == null)
 //        return false;
 //    if (mode == CursorMode.None)
 //        return true;
 //    if (mode == CursorMode.Mine &&
 //        (cube.ElementType == MapElementType.Rock)
 //        )
 //    {
 //        return true;
 //    }
 //    return false;
 //}
 public static bool IsCursorOpperationValidOnMapElement(CursorMode mode, MapElement element)
 {
     if (element == null)
         return false;
     if (mode == CursorMode.Mine &&
         element.ElementType == MapElementType.Rock &&
         element.Position.Z == 0
         )
     {
         return true;
     }
     if (mode == CursorMode.Chopping && element.ElementType == MapElementType.Tree)
     {
         return true;
     }
     return false;
 }
Ejemplo n.º 36
0
 public void SetCursorMode(CursorMode mode)
 {
     switch (mode)
     {
         case CursorMode.Finger:
             this.cursorMode = new FingerCursorMode();
             break;
         case CursorMode.CenterOfHand:
             this.cursorMode = new CenterOfHandCursorMode();
             break;
         case CursorMode.CenterOfCluster:
             this.cursorMode = new CenterOfClusterCursorMode();
             break;
         case CursorMode.HandTracking:
             this.cursorMode = new HandTrackingCursorMode(this.trackingClusterDataSource);
             break;
     }
 }
Ejemplo n.º 37
0
	    public void ApplyMode()
	    {
            switch (lockMode) 
			{
			case CurState.None:
				_newMode = CursorLockMode.None;
				break;
			case CurState.LockedToCenter:
				_newMode = CursorLockMode.Locked;
				break;
			case CurState.ConfinedToGameWindow:
				_newMode = CursorLockMode.Confined;
				break;
			}

			switch (renderMode) 
			{
			case RenderMode.Auto:
				_renderAs = CursorMode.Auto;
				break;
			case RenderMode.ForceSoftware:
				_renderAs = CursorMode.ForceSoftware;
				break;
			}

			Cursor.visible = !hideCursor.Value;

            Texture2D newTexture = cursorTexture.Value as Texture2D;
		    Cursor.SetCursor(newTexture, (hotSpot.IsNone) 
                ? Vector2.zero
                : hotSpot.Value, _renderAs);

			Cursor.lockState = _newMode;
	    }
Ejemplo n.º 38
0
 public void SetCursorMode(CursorMode mode)
 {
     _cursorMode = mode;
     _cursorState = CursorState.Free;
     _markedCubes.Clear();
 }
Ejemplo n.º 39
0
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 private void graphCursorModeButton_Checked(object sender, RoutedEventArgs e)
 {
     currentCursorMode = CursorMode.graphBuildMode;
 }
Ejemplo n.º 40
0
 private static void SetCursor(Texture2D texture, CursorMode cursorMode)
 {
   Cursor.SetCursor(texture, Vector2.zero, cursorMode);
 }
Ejemplo n.º 41
0
 public ModeCombination(CursorMode cursorMode, ClickMode clickMode)
 {
     this.CursorMode = cursorMode;
     this.ClickMode = clickMode;
 }
Ejemplo n.º 42
0
 private void Input()
 {
     // Decides cursormode
     if (KeyboardInput.IsKeyClicked(Keys.M))
     {
         _cursorMode = CursorMode.Mine;
         _markingCursor.SetCursorMode(_cursorMode);
         _buildingSelectionCursor.CursorChange();
     }
     if (KeyboardInput.IsKeyClicked(Keys.C))
     {
         _cursorMode = CursorMode.Free;
     }
     else if (KeyboardInput.IsKeyClicked(Keys.B))
     {
         _cursorMode = CursorMode.PlacingBuilding;
         _buildingSelectionCursor.CursorChange();
     }
     else if (KeyboardInput.IsKeyClicked(Keys.N))
     {
         _cursorMode = CursorMode.PlacingWorldObject;
         _buildingSelectionCursor.CursorChange();
     }
     else if (KeyboardInput.IsKeyClicked(Keys.V))
     {
         _cursorMode = CursorMode.CropArea;
         _markingCursor.SetCursorMode(_cursorMode);
         _buildingSelectionCursor.CursorChange();
     }
     else if (KeyboardInput.IsKeyClicked(Keys.X))
     {
         _cursorMode = CursorMode.Pasture;
         _markingCursor.SetCursorMode(_cursorMode);
         _buildingSelectionCursor.CursorChange();
     }
     else if (MouseInput.IsRightMouseClicked())
     {
         _cursorMode = CursorMode.Free;
         _buildingSelectionCursor.CursorChange();
     }
 }
Ejemplo n.º 43
0
 public static void SetInputMode(GlfwWindowPtr window, InputMode mode, CursorMode value)
 {
     GLFWDelegates.glfwSetInputMode(window, mode, value);
 }
 public InventoryCursorIcon(Texture2D texture, Vector2 hotspot, CursorMode cursorMode = CursorMode.Auto)
 {
     this.texture = texture;
     this.hotspot = hotspot;
     this.cursorMode = cursorMode;
 }
Ejemplo n.º 45
0
		private static void SetCursor(Texture2D texture, CursorMode cursorMode){}
Ejemplo n.º 46
0
 internal static extern void glfwSetInputMode(GlfwWindowPtr window, InputMode mode, CursorMode value);
Ejemplo n.º 47
0
	void OnMouseEnter() {
		cursorMode = CursorDefecto.getDefaultCursorMode ();
		if (VariablesGenerales.Instance.getOnConversation())
			Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);
	}
Ejemplo n.º 48
0
        private void Input()
        {
            if (KeyboardInput.IsKeyClicked(Keys.M))
            {
                _cursorMode = CursorMode.Mine;
            }
            else if (KeyboardInput.IsKeyClicked(Keys.N))
            {
                _cursorMode = CursorMode.Chopping;
            }
            else if (MouseInput.IsLeftMouseClicked() &&
                    IsHighlightValid() &&
                    _cursorState == CursorState.Free &&
                    (_cursorMode == CursorMode.Mine ||
                    _cursorMode == CursorMode.Chopping))
            {
                StartMarking();
            }
            else if (MouseInput.IsRightMouseClicked() && _cursorState == CursorState.Marking)
            {
                StopMarking();
            }

            else if (MouseInput.IsLeftMouseClicked() && _cursorState == CursorState.Marking)
            {
                ExecuteMarking();
            }
        }
Ejemplo n.º 49
0
		public static void SetInputMode(WindowPtr window, InputMode mode, CursorMode value) {
			glfwSetInputMode(window, mode, value);
		}
Ejemplo n.º 50
0
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 private void RadioButton_Checked(object sender, RoutedEventArgs e)
 {
     currentCursorMode = CursorMode.doubleGraph;
 }
Ejemplo n.º 51
0
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 private void RadioButton_Checked_1(object sender, RoutedEventArgs e)
 {
     currentCursorMode = CursorMode.tableBuildMode;
 }
Ejemplo n.º 52
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //                    Вычитание опорной плоскости
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void choosePointsClicked(object sender, RoutedEventArgs e)
        {
            currentCursorMode = CursorMode.defaultMode;

            if (mainImage.Source == null)  { MessageBox.Show("Главное изображение пустое");  return;  }

            if (zArrayDescriptor == null)  { MessageBox.Show("Z-массив пуст");               return;  }

            needPointsCapture = true;
            firstClick = null;
            secondClick = null;

            PointsChooseForm pointsChooseForm = new PointsChooseForm();
            pointsChooseForm.cosinusChoosed+= PointsChooseFormOnCosinusChoosed;
            pointsChooseForm.Show();
        }
Ejemplo n.º 53
0
        /// <summary>
        /// Creates the window.
        /// </summary>
	protected void CreateWindow ()
        {
            Glfw.WindowHint (WindowHint.OpenGLProfile, (int) OpenGLProfile.Core);
            Glfw.WindowHint (WindowHint.OpenGLForwardCompat, 1);
#if LINUX_INTEL_COMPATIBLE
            Logger.Log.AddLogEntry (LogLevel.Warning, ClassName, Status.ItsNotABugItsAFeature,
                "You are using an unsupported graphics mode! Disable LINUX_INTEL_COMPATIBLE compile flag to fix it.");
            Glfw.WindowHint (WindowHint.ContextVersionMajor, 3);
            Glfw.WindowHint (WindowHint.ContextVersionMinor, 3);
#else
            Glfw.WindowHint (WindowHint.ContextVersionMajor, 4);
            Glfw.WindowHint (WindowHint.ContextVersionMinor, 0);
#endif
#if DEBUG
            Glfw.WindowHint (WindowHint.OpenGLDebugContext, 1);
#endif


            if (ConfigManager.Instance["freezing_archer"].GetBool ("general", "fullscreen"))
                Win = Glfw.CreateWindow (Resolution.X, Resolution.Y, Title,
                    Glfw.GetMonitors ()[
                        ConfigManager.Instance["freezing_archer"].GetInteger ("general", "fullscreen_monitor")],
                    GlfwWindowPtr.Null);
            else
                Win = Glfw.CreateWindow (Size.X, Size.Y, Title, GlfwMonitorPtr.Null, GlfwWindowPtr.Null);

            Glfw.MakeContextCurrent (Win);

            Glfw.SetCursorPosCallback     (Win, MouseMove);
            Glfw.SetCursorEnterCallback   (Win, MouseOver);
            Glfw.SetMouseButtonCallback   (Win, MouseButton);
            Glfw.SetScrollCallback        (Win, MouseScroll);
            Glfw.SetKeyCallback           (Win, KeyAction);
            Glfw.SetWindowCloseCallback   (Win, WindowClose);
            Glfw.SetWindowFocusCallback   (Win, WindowFocus);
            Glfw.SetWindowIconifyCallback (Win, WindowMinimize);
            Glfw.SetWindowPosCallback     (Win, WindowMove);
            Glfw.SetWindowSizeCallback    (Win, WindowResize);
            Glfw.SetErrorCallback         (WindowError);

            CursorMode = 0;
        }
Ejemplo n.º 54
0
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //Методы из пункта "Информация"
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 private void defaultCursorModeButton_Checked(object sender, RoutedEventArgs e)
 {
     currentCursorMode = CursorMode.defaultMode;
 }
Ejemplo n.º 55
0
 /// <summary>
 ///   <para>Specify a custom cursor that you wish to use as a cursor.</para>
 /// </summary>
 /// <param name="texture">The texture to use for the cursor or null to set the default cursor. Note that a texture needs to be imported with "Read/Write enabled" in the texture importer (or using the "Cursor" defaults), in order to be used as a cursor.</param>
 /// <param name="hotspot">The offset from the top left of the texture to use as the target point (must be within the bounds of the cursor).</param>
 /// <param name="cursorMode">Allow this cursor to render as a hardware cursor on supported platforms, or force software cursor.</param>
 public static void SetCursor(Texture2D texture, Vector2 hotspot, CursorMode cursorMode)
 {
   Cursor.INTERNAL_CALL_SetCursor(texture, ref hotspot, cursorMode);
 }
Ejemplo n.º 56
0
 private static extern void INTERNAL_CALL_SetCursor(Texture2D texture, ref Vector2 hotspot, CursorMode cursorMode);
Ejemplo n.º 57
0
 internal CSSCursorProperty()
     : base(PropertyNames.Cursor)
 {
     _mode = _auto;
     _inherited = true;
 }
Ejemplo n.º 58
0
        /// <summary>
        /// Determines if the given value represents a valid state of this property.
        /// </summary>
        /// <param name="value">The state that should be used.</param>
        /// <returns>True if the state is valid, otherwise false.</returns>
        protected override Boolean IsValid(CSSValue value)
        {
            if (value.Is("auto"))
                _mode = _auto;
            else if (value is CSSValueList)
                return Evaluate((CSSValueList)value);
            else if (value == CSSValue.Inherit)
                return true;
            else
            {
                var mode = Evaluate(value);

                if (mode == null)
                    return false;

                _mode = mode;
            }

            return true;
        }
Ejemplo n.º 59
0
		public static void SetCursor(Texture2D texture, Vector2 hotspot, CursorMode cursorMode){}
Ejemplo n.º 60
0
	void OnMouseExit() {
		cursorMode = CursorDefecto.getDefaultCursorMode ();
		cursorTexture2 = CursorDefecto.getDefaultCursor();
		Cursor.SetCursor(cursorTexture2, Vector2.zero, cursorMode);
	}