public void InitDefaults() { LoadIfNull(ref ArrowDown, "arrow_down"); LoadIfNull(ref ArrowLeft, "arrow_left"); LoadIfNull(ref ArrowRight, "arrow_right"); LoadIfNull(ref ArrowUp, "arrow_up"); LoadIfNull(ref Circle, "circle"); LoadIfNull(ref Checked, "checked"); LoadIfNull(ref Close, "close"); LoadIfNull(ref CurvedArrowDown, "curved_arrow_down"); LoadIfNull(ref CurvedArrowLeft, "curved_arrow_left"); LoadIfNull(ref CurvedArrowRight, "curved_arrow_right"); LoadIfNull(ref CurvedArrowUp, "curved_arrow_up"); LoadIfNull(ref DateTimePicker, "datetimepicker"); LoadIfNull(ref DropDownRightArrow, "dropdown_rightArrow"); LoadIfNull(ref FileDialogBack, "filedialog_back"); LoadIfNull(ref FileDialogFile, "filedialog_file"); LoadIfNull(ref FileDialogFolder, "filedialog_folder"); LoadIfNull(ref FileDialogRefresh, "filedialog_refresh"); LoadIfNull(ref FileDialogUp, "filedialog_up"); LoadIfNull(ref FormResize, "form_resize"); LoadIfNull(ref NumericDown, "numeric_down"); LoadIfNull(ref NumericUp, "numeric_up"); LoadIfNull(ref RadioButton_Checked, "radioButton_checked"); LoadIfNull(ref RadioButton_Hovered, "radioButton_hovered"); LoadIfNull(ref RadioButton_Unchecked, "radioButton_unchecked"); LoadIfNull(ref TreeNodeCollapsed, "treenode_collapsed"); LoadIfNull(ref TreeNodeExpanded, "treenode_expanded"); Cursors.InitDefaults(); }
public void UpdateCursor(Cursors c) { currentCursor = c; /// NOTE:: mouseShadowSprites[0].sprite is the MAIN cursor. It's the first child in the gameobject and I ceebs distinguishing it lmao - Max. mouseShadowSprites[0].sprite = currentCursor.cursor; }
/*--------------------------------------------------------------------------------------------*/ public void Update() { gameObject.GetComponentsInChildren(true, vCursorsForInput); Cursors.Clear(); SelectableCursors.Clear(); ExcludedCursors.Clear(); vCursorMap.Clear(); for (int i = 0; i < vCursorsForInput.Count; i++) { ICursorDataForInput cursor = vCursorsForInput[i]; if (vCursorMap.ContainsKey(cursor.Type)) { ExcludedCursors.Add(cursor); continue; } Cursors.Add(cursor); vCursorMap.Add(cursor.Type, cursor); if (cursor.CanCauseSelections) { SelectableCursors.Add(cursor); } } }
/// <summary> /// Attempts to find a scope cursor's lines at the the specified position. /// Cursors at the end of the cursor list have the highest priority. /// </summary> /// <param name="searchPosition">The position to search at.</param> /// <param name="selectableOnly"> /// A value indicating whether to restrict the search to selectable cursor lines. /// </param> /// <returns>A scope cursor selection at the position or <c>null</c>.</returns> public ScopeCursorSelection FindScopeCursorLines(PointD searchPosition, bool selectableOnly) { var extents = _currentScopeGraphicsRangeExtents; var userRange = extents != null ? CreateScopeGraphicsRange(extents, _xMinimumGraticuleUnits, _yMinimumGraticuleUnits, _userOriginOffset) : null; if (userRange == null) { return(null); } return(Cursors .Select(cursor => { var deviceCursorPosition = userRange.Matrix.TransformPoint(cursor.Position.CairoPoint); // Select each axis we are nearby and which a visible line exists for. return new ScopeCursorSelection(cursor, // X axis ((cursor.Lines & ScopeCursorLines.X) != ScopeCursorLines.None && ((cursor.SelectableLines & ScopeCursorLines.X) != ScopeCursorLines.None || !selectableOnly) && Math.Abs(searchPosition.X - deviceCursorPosition.X) < _maxSnapDistance ? ScopeCursorLines.X : ScopeCursorLines.None) | // Y axis ((cursor.Lines & ScopeCursorLines.Y) != ScopeCursorLines.None && ((cursor.SelectableLines & ScopeCursorLines.Y) != ScopeCursorLines.None || !selectableOnly) && Math.Abs(searchPosition.Y - deviceCursorPosition.Y) < _maxSnapDistance ? ScopeCursorLines.Y : ScopeCursorLines.None)); }) .LastOrDefault(cursorSelection => cursorSelection.SelectedLines != ScopeCursorLines.None)); }
void Update() { if (isPointerOn) { Cursors.SetMapOrderCursor(); } }
public void Clear() { MathItems.Clear(); Cursors.Clear(); Markers.Clear(); Traces.Clear(); }
protected virtual void OnStartup(StartupEventArgs e) { Mouse.set_OverrideCursor(Cursors.get_Wait()); try { Application.get_Current().add_DispatcherUnhandledException(new DispatcherUnhandledExceptionEventHandler(this.Current_DispatcherUnhandledException)); this.add_DispatcherUnhandledException(new DispatcherUnhandledExceptionEventHandler(this.App_DispatcherUnhandledException)); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(this.CurrentDomain_UnhandledException); base.OnStartup(e); SplashScreenWindow splashScreen = new SplashScreenWindow(); SplashScreenWindow splashScreenWindow = splashScreen; splashScreen.Show(); Task.Factory.StartNew((Action) (() => { Thread.Sleep(4000); ((DispatcherObject) this).Dispatcher.Invoke((Action) (() => { new UserLogin().Show(); splashScreen.Close(); })); })); } finally { Mouse.set_OverrideCursor((Cursor) null); } }
// Methods protected override void Awake() { base.Awake(); Cursors.Add(lookCursor.Type, lookCursor); defaulLookCursorScale = lookCursor.transform.localScale; }
// MonoBehaviour methods protected override void Awake() { base.Awake(); foreach (var cursor in cursors) { Cursors.Add(cursor.Type, cursor); } }
public static void SetCursor(Cursors cursor) { if (cursor != instance.currentCursor) { instance.currentCursor = cursor; Cursor.SetCursor(instance.cursorTextures[(int)cursor], instance.cursorHotspots[(int)cursor], CursorMode.Auto); } }
public void OnPointerEnter(PointerEventData eventData) { if (Controls.Selection.selectedUnits.Count > 0 && Controls.Selection.selectedUnits[0].data.hasMoveModule) { isPointerOn = true; Cursors.SetMapOrderCursor(); } }
internal static void Terminate() { for (int loop = 0; loop < 3; loop++) { SoundSources.DestroyAll(); Cursors.DestroyAll(); Texture2Ds.DestroyAll(); CubemapTextures.DestroyAll(); Fonts.DestroyAll(); Chip2Ds.DestroyAll(); Shader2Ds.DestroyAll(); Shader3Ds.DestroyAll(); Material2Ds.DestroyAll(); Material3Ds.DestroyAll(); MaterialPropertyBlocks.DestroyAll(); ImagePackages.DestroyAll(); Effects.DestroyAll(); Meshs.DestroyAll(); Deformers.DestroyAll(); Models.DestroyAll(); MassModels.DestroyAll(); Terrain3Ds.DestroyAll(); KeyframeAnimations.DestroyAll(); AnimationSources.DestroyAll(); Scenes.DestroyAll(); Layer2Ds.DestroyAll(); Object2Ds.DestroyAll(); Layer3Ds.DestroyAll(); Object3Ds.DestroyAll(); PostEffects.DestroyAll(); Transitions.DestroyAll(); StaticFiles.DestroyAll(); StreamFiles.DestroyAll(); Shapes.DestroyAll(); //Profilers.DestroyAll(); Collector.Collect(); System.GC.Collect(); System.GC.WaitForPendingFinalizers(); System.GC.Collect(); Collector.Collect(); } }
public Cursor(ContentManager content) { //What determines which cursor should be drawn is handled in the GameScreen.cs, but this says if the cursor should be "normal" draw the "normal cursor" etc. m_cursors = new Dictionary <Cursors, Texture2D>(); m_cursors[Cursors.normal] = content.Load <Texture2D>("cursor"); m_cursors[Cursors.hammer] = content.Load <Texture2D>("hammer"); m_cursors[Cursors.sword] = content.Load <Texture2D>("sword"); m_current = Cursors.normal; }
private Cursor MapCursor(Cursors cursorToSet) { switch (cursorToSet) { case Cursors.Arrow: return(Glfw.CreateStandardCursor(CursorType.Arrow)); case Cursors.Cross: case Cursors.Default: return(Glfw.CreateStandardCursor(CursorType.Arrow)); case Cursors.Hand: return(Glfw.CreateStandardCursor(CursorType.Hand)); case Cursors.Help: return(Glfw.CreateStandardCursor(CursorType.Arrow)); case Cursors.HSplit: return(Glfw.CreateStandardCursor(CursorType.ResizeVertical)); case Cursors.IBeam: return(Glfw.CreateStandardCursor(CursorType.Beam)); case Cursors.No: case Cursors.NoMove2D: case Cursors.NoMoveHoriz: case Cursors.NoMoveVert: case Cursors.PanEast: case Cursors.PanNE: case Cursors.PanNorth: case Cursors.PanNW: case Cursors.PanSE: case Cursors.PanSouth: case Cursors.PanSW: case Cursors.PanWest: case Cursors.SizeAll: case Cursors.SizeNESW: case Cursors.SizeNS: return(Glfw.CreateStandardCursor(CursorType.ResizeVertical)); case Cursors.SizeNWSE: case Cursors.SizeWE: return(Glfw.CreateStandardCursor(CursorType.ResizeHorizontal)); case Cursors.UpArrow: return(Glfw.CreateStandardCursor(CursorType.Arrow)); case Cursors.VSplit: return(Glfw.CreateStandardCursor(CursorType.ResizeHorizontal)); case Cursors.WaitCursor: return(Glfw.CreateStandardCursor(CursorType.Arrow)); } return(Glfw.CreateStandardCursor(CursorType.Arrow)); }
private void EnableCursor(Cursors cursor) { if (!_cursorDictionary.ContainsKey(cursor)) { return; } _currentCursorGameObject = _cursorDictionary[cursor]; _currentCursorGameObject.SetActive(true); }
public void ClearData() { MathItems.Clear(); Cursors.Clear(); Markers.Clear(); foreach (var v in Traces) { v.Points.Clear(); } }
/// <summary> /// Loads the art assets for the Cursor. /// </summary> protected override void LoadContent() { _arrowTexture = Game.Content.Load <Texture2D>(@"Cursors/ArrowCursor"); _iBeamTexture = Game.Content.Load <Texture2D>("Cursors/IBeam"); _handTexture = Game.Content.Load <Texture2D>(@"Cursors/Hand"); Cursors = Cursors.Arrow; base.LoadContent(); }
public static void Init(ContentManager content) { texures = new Textures(content); fonts = new Fonts(content); cursors = new Cursors(content); effects = new Effects(content); lights = new Lights(content); prebuiltSprites = new PrebuiltSprites(); gameSprites = new GameSprites(); }
/// <summary> /// Attempts to find a scope cursor's lines at the the specified position and /// highlights them accordingly. /// </summary> /// <param name="searchPosition">The position to search at.</param> public void FindAndHighlightCursorLines(PointD searchPosition) { Cursors.ToList().ForEach(s => s.HighlightedLines = ScopeCursorLines.None); var cursorSelection = FindScopeCursorLines(searchPosition, true); if (cursorSelection != null && cursorSelection.Cursor != null) { cursorSelection.Cursor.HighlightedLines = cursorSelection.SelectedLines; } }
public void DisableCursors() { _currentCursor = Cursors.None; _currentCursorGameObject = null; foreach (var go in _cursorDictionary.Values) { go.SetActive(false); } }
public void BindCursorResult(IAnalysisResult cursorResult, IParser parser) { if (!Cursors.ContainsKey(cursorResult.Name)) { Cursors.Add(cursorResult.Name, cursorResult); } else { parser.ReportSyntaxError(cursorResult.LocationIndex, cursorResult.LocationIndex + cursorResult.Name.Length, string.Format("Module cursor {0} defined more than once.", cursorResult.Name), Severity.Error); } }
private CursorMapping GetCursorMapping(Cursors cursor) { foreach (CursorMapping cursorMap in cursorMapping) { if (cursorMap.type == cursor) { return(cursorMap); } } return(cursorMapping[0]); }
public override void OnUpdate(MyStateMachine stateMachine) { if (m_instance == null) { foreach (var transitionNamesToVariableStorage in m_transitionNamesToVariableStorages.Values) { transitionNamesToVariableStorage.SetValue(MyStringId.GetOrCompute("Left"), true); } return; } if (string.IsNullOrEmpty(m_instance.TransitionTo)) { m_instance.Update(); } // trigger transition when script triggers complete method if (!string.IsNullOrEmpty(m_instance.TransitionTo)) { // Correct way to clear a cursor if (OutTransitions.Count == 0) { // Read the first cursor member var enumerator = Cursors.GetEnumerator(); enumerator.MoveNext(); var cursor = enumerator.Current; stateMachine.DeleteCursor(cursor.Id); } else { bool found = false; var sId = MyStringId.GetOrCompute(m_instance.TransitionTo); foreach (var outTransition in OutTransitions) { if (outTransition.Name == sId) { found = true; break; } } Debug.Assert(found, "State with outgoing transitions triggered non existent transition! Fix your scripts (or mission machines)!"); IMyVariableStorage <bool> storage; // unblock one of the transitions if (m_transitionNamesToVariableStorages.TryGetValue(MyStringId.GetOrCompute(m_instance.TransitionTo), out storage)) { storage.SetValue(MyStringId.GetOrCompute("Left"), true); } else { Debug.Fail("Transition was not found."); } } } }
protected override void LoadContent() { blankTexture = new Texture2D(GraphicsDevice, 1, 1); blankTexture.SetData <Color>(new Color[] { Color.White }); Cursors.LoadContent(this, Content); // default cursorManager.Cursor = Cursors.Default; base.LoadContent(); }
public override void SetMouseCursor(Cursors cursors) { var cursor = GetCursor(cursors); for (int i = 0; i < App.System.Windows.Count; i++) { if (App.System.Windows[i].Implementation is GLFW_Window window) { GLFW.SetCursor(window.pointer, cursor); } } }
internal static void Update() { if (Collector.Collect()) { SoundSources.Collect(); Cursors.Collect(); Texture2Ds.Collect(); CubemapTextures.Collect(); Fonts.Collect(); Chip2Ds.Collect(); Shader2Ds.Collect(); Shader3Ds.Collect(); Material2Ds.Collect(); Material3Ds.Collect(); MaterialPropertyBlocks.Collect(); ImagePackages.Collect(); MediaPlayers.Collect(); Effects.Collect(); Meshs.Collect(); Deformers.Collect(); Models.Collect(); MassModels.Collect(); Terrain3Ds.Collect(); KeyframeAnimations.Collect(); AnimationSources.Collect(); AnimationClips.Collect(); Scenes.Collect(); Layer2Ds.Collect(); Object2Ds.Collect(); Layer3Ds.Collect(); Object3Ds.Collect(); PostEffects.Collect(); Transitions.Collect(); StaticFiles.Collect(); StreamFiles.Collect(); Shapes.Collect(); Collider2Ds.Collect(); } }
/// <summary> /// Resets values. /// </summary> public static void ResetValues() { DebugEx.Verbose("Assets.Common.ResetValues()"); Fonts.ResetValues(); Cursors.ResetValues(); Windows.ResetValues(); DockWidgets.ResetValues(); Popups.ResetValues(); Tooltips.ResetValues(); Toasts.ResetValues(); }
public PrepareStatement PreparedCursorResolver(string prepIdent) { IAnalysisResult prepRes; if (Cursors.TryGetValue(prepIdent, out prepRes)) { if (prepRes is PrepareStatement) { return(prepRes as PrepareStatement); } } return(null); }
private void SetCursorType(Cursors currentCursor) { foreach (var cursor in _cursors) { if (cursor.Type == currentCursor) { cursor.Enabled(true, _menu.Item("Colorblind").GetValue <bool>()); } else { cursor.Enabled(false, _menu.Item("Colorblind").GetValue <bool>()); } } }
//... protected override void OnLoad(EventArg e){ this.Cursor=Cursors.Wait(); this.Enabled=false; // do a long running DB operation without blocking the UI Thread ThreadPool.QueueUserWorkItem(state=>{ DoLongDBOperation(); // re enable the form BeginInvoke(new Action(()=>{ this.Cursor=Cursors.Default;this.Enabled=true;})); }); }
protected virtual void SetCursorOnEnter(Cursors cursorToSet) { if (Parent != null) { Parent.SetCursorOnEnter(cursorToSet); } }