private void DrawHoverText(SpriteBatch b) { if (!string.IsNullOrEmpty(HoverText)) { IClickableMenu.drawToolTip(b, HoveredItem?.getDescription() ?? HoverText, HoverText, HoveredItem); } }
private void HoverItem(PropertyViewItem item) { if (HoveredItem != null) { HoveredItem.SetValue(PropertyViewItem.IsHoveredPropertyKey, false); } HoveredItem = item; if (HoveredItem != null) { HoveredItem.SetValue(PropertyViewItem.IsHoveredPropertyKey, true); } }
private void DrawHoverText(SpriteBatch b) { if (!string.IsNullOrEmpty(HoverText)) { if (HoveredItem != null) { IClickableMenu.drawToolTip(b, HoveredItem.getDescription(), HoverText, HoveredItem); } else { IClickableMenu.drawHoverText(Game1.spriteBatch, HoverText, Game1.dialogueFont); } } }
private void HoverItem(PropertyViewItem item) { HoveredItem?.SetValue(PropertyViewItem.IsHoveredPropertyKey, false); HoveredItem = item; HoveredItem?.SetValue(PropertyViewItem.IsHoveredPropertyKey, true); }
private void Update() { //if ( !Input.anyKey ) // return; //if ( Input.GetKeyDown( KeyCode.Escape ) ) //{ // Hide(); //} if (Input.GetKeyDown(KeyCode.Return)) { if (HoveredItem != null) { HoveredItem.Select(); } Hide(); } else if (Input.GetKey(KeyCode.DownArrow)) { if (Time.time > LastDownTime + RepeatPeriod) { if (HoveredItem != null) { HoveredItem.HoverNextVisibleItem(); EnsureHoveredItemIsVisible(); } SearchInputField.MoveTextEnd(false); LastDownTime = Time.time; // Delay extra if first press if (Input.GetKeyDown(KeyCode.DownArrow)) { LastDownTime += RepeatDelay; } } } else if (Input.GetKey(KeyCode.UpArrow)) { if (Time.time > LastUpTime + RepeatPeriod) { if (HoveredItem != null) { HoveredItem.HoverPreviousVisibleItem(); EnsureHoveredItemIsVisible(); } SearchInputField.MoveTextEnd(false); LastUpTime = Time.time; if (Input.GetKeyDown(KeyCode.UpArrow)) { LastUpTime += RepeatDelay; } } } }