Commit Graph
31 Commits
Author SHA1 Message Date
Jessica MandGitHub e128a7f695 Partially Revert "More Cursor Usage in Controls" (#6654)
revert button and scrollbar changes
2026-06-29 18:49:43 +10:00
ThomasandGitHub 0a648ab619 More Cursor Usage in Controls (#6583)
* Add cursors for controls

Have TextEdot use NotAllowed instead of Arrow for Disabled

Make ScrollBar use {H,V}Resize

Make BaseButton use Pointer/NotAllowed instead of Arrow

Make ItemList use NotALlowed/Pointer/Arrow

Make MenuTopButton use Pointer

Make Slider use HResize

Fix SplitContainer not changing DefaultCursorShape if it changed
orientation

Make Tree use Pointer/Arrow

Make TabContainer use Pointer

* Fix ScrollBar

It needs to also change MouseMove because we don't have track
functionality yet and thus we only want to show interactivity when we're
directly hovering/grabbing the scrollbar.

* Address review
2026-05-25 18:14:44 +02:00
eoineoineoinandGitHub 83a1098476 Fix bug where ButtonGroup would erroneously unpress buttons (#6271) 2025-11-30 16:57:12 +01:00
StalenandGitHub f467a7027b Added MuteSounds property for BaseButton control (#5465) 2024-09-29 00:25:56 +02:00
Pieter-Jan Briers a70e511fcb Change default of ButtonGroup.IsNoneSetAllowed to true.
This brings default ButtonGroup behavior back to before #4841.

The original comments in the code *did* clearly intend for the other behavior to be the default, but the code was blatantly bugged (whoops) so this didn't happen. Content relied on this A LOT and it's quite sane behavior regardless so just change the default back call it a day.
2024-02-17 22:09:23 +01:00
Leon Friedrich fd9d5c8aa8 Make ButtonGroup setter behaviour consistent with comment 2024-02-16 11:19:14 +13:00
Pieter-Jan Briers 4677296934 Add IsNoneSetAllowed mode to ButtonGroup.
This allows a button group to have no button pressed by default, which is the behavior of most radio buttons.
2024-02-15 01:16:33 +01:00
a9d17337a3 RT Patches for UI improvements (#4841)
* fix up buttons

* wah

* ough

* huhwuhuahsdhsfdj

* loud incorrect buzzer

* wawa

* Allow XmlnsDefinition

* wawa

* Release notes.

* Expose keybind loading.

* address reviews and other things

---------

Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2024-02-11 17:18:39 +01:00
56e03eae3e Add UI click sound support (#4705)
* Add UI click sound support

* Audio option

* Add Cvar

* Note and fix disabled sounds

* Fix double sound

* Comment removal

* ou

---------

Co-authored-by: Kara <lunarautomaton6@gmail.com>
2023-12-28 16:15:42 -08:00
Pieter-Jan Briers 31a3f145de Add [ViewVariables] to BaseButton.EnableAllKeybinds
Makes it show up in the devwindow UI inspector.
2023-12-13 00:28:33 +01:00
Jacob TongandGitHub f812b307b5 Toggle button updates (#3018)
* Change toggle button to only trigger on UIClick

* Add tests for toggle buttons
2022-07-29 13:28:59 +10:00
de4d255841 Analyzer to enforce classes to be either [Virtual], abstract, or sealed. (#2469)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-02-05 19:31:58 +01:00
ShadowCommanderandGitHub 3e718575ff Change Button Pressed to work with non-focus keybinds (#1978) 2021-11-21 14:52:41 +01:00
ShadowCommanderandGitHub b8cb037151 Fix _enableAllKeybinds buttons breaking due to Use (#2157) 2021-10-24 01:43:46 -07:00
ad8b0b3c83 Add bytes or sbytes to enum where available (#1430)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-12-08 12:46:30 +01:00
b8e5b47e7a Use 'new' expression in places where the type is evident for the engine (#1415)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-11-26 00:16:55 +01:00
Pieter-Jan BriersandGitHub 6674be3adc Client NRTs (#1121) 2020-06-12 12:57:39 +02:00
ShadowCommanderandGitHub 1b52093c5d Change buttons to use MouseFilterMode.Stop (#1095) 2020-06-01 15:35:06 +02:00
Pieter-Jan Briers f54f4ffe52 Quite possibly break the whole input system.
Made it so keybinds don't block other keybinds from firing.

Why is this necessary? This allows us to have "same keybind, different functionality" binds sanely, like shift click being both TextCursorSelect and (in content) ExamineEntity. Before this change the latter was temporarily broken in UI controls because of TextCursorSelect taking priority and instantly treating the event as handled because it's CanFocus.

The offshoot of this is that all the "args.CanFocus == mouse left" UI code had to be fixed, since multiple things were now firing for that and breaking everything. For example TextCursorSelect actually BROKE because now ExamineEntity was firing inside UI again and that was seen as a left click.

EngineKeyFunctions.UIClick has been introduced as "mouse left for the UI" for this purpose.
2020-05-05 23:58:21 +02:00
ShadowCommanderandGitHub 2f819cf781 Refactor Controls to default to MouseFilterMode.Ignore (#1011)
* Refactor Controls to default to MouseFilterMode.Ignore

* Clean up MouseFilterMode.Ignore from Controls

* Fix BoxContainer eating UI clicks

* Fix ScrollContainer using the wrong variable

* Refactor ContainerButtons to use a StyleClass for formatting instead of typeof

* Refactor BaseButton to work when child has MouseFilter.Pass
2020-03-15 07:29:51 +01:00
ShadowCommanderandGitHub 2a825ffe9e Fix ButtonGroup (#991) 2020-02-21 12:19:17 +01:00
ShadowCommanderandGitHub 3b49e0df82 Implement ContainerButton and refactor buttons (#975)
* Add style to TextureRect

* Implement ContainerButton

ContainerButton is a button that resizes to fit the Controls it contains.

* Refactor OptionButton to use ContainerButton

This allows OptionButton to have an inverted triangle icon on the right to make it more obvious that the button is an OptionButton.

* Fix Popup not updating size when opened

* Fix DrawMode not getting updated when _pressed is changed

* Refactor Button to inherit from ContainerButton

* Refactor CheckBox to inherit from ContainerButton

* Fix Control.StyleClasses.GetEnumerator

It was calling GetEnumerator in an infinite loop instead of getting _styleClasses.GetEnumerator like it was supposed to do.

* Update Button references

* Fix Styling
2020-02-17 11:06:16 +01:00
Pieter-Jan Briers 3f1c33fc96 Implement radio buttons. 2019-10-20 00:50:35 +02:00
ShadowCommanderandPieter-Jan Briers 117cf14e5c Add a check in OnContextChanged to fix some crashes and refactored BaseButton (#851)
* Add a check in OnContextChanged to fix some crashes

Fixes crashes due to double input like the Quit button in the Esc menu

* Changed BaseButton to only trigger on KeyBindDown and KeyBindUp on the same control
2019-08-25 13:13:07 +02:00
ShadowCommanderandPieter-Jan Briers a8d6c294ab Input System Refactor (#840)
* Fixes right click menu stopping input

Removed a flag change when the modal stack was showing, which preventing the click from getting passed to the next function.

* Added parsing for mod2 and mod3 from Keybind YAML

* Fixes a crash on context change when a keybind is not defined in keybinds.yml

* Implemented ShowDebugConsole Hotkey

* Refactored input system

Refactored input system to run Key and Mouse input through the InputManager before doing stuff.

* Upgraded LineEdit and classes that use it. Fixed input while KeyboardFocused.

Upgraded LineEdit to use Keybinds.
Upgraded DebugConsole to use Keybinds.
Replaced all references to MouseDown, MouseUp, KeyDown, and KeyUp with KeyBindUp and KeyBindDown.
Moved UserInterfaceManager call from GameController.Input to InputManager event.
Stopped input going to simulation while a control has focus in UserInterfaceManager.

* Some fixes for input system

Fixed keybinds getting stuck when selecting a LineEdit.
Changed MenuBar to not error.
Fixed a few cases where LineEdit would eat input if you hovered over it and where mouse input got eaten when clicking in the world while a LineEdit was selected.

* Removed extra dependencies

* Added GUIBoundKeyEventArgs to ButtonEventArgs

* Fixes for input with LineEdit selected

Fixed multiple keybinds mapped to the same key not triggering.
Fixed keybind input not getting to LineEdit when hovering over a control.

* Implemented Key Repeat for LineEdit

* Fix for input on Robust.Lite Launcher

* Renames NonFocusKeybinds to EnableAllKeybinds

Renamed NonFocusKeybinds to EnableAllKeybinds and added comment to clarify usage

* Adds repeating keybinds

Used for TextBackspace, TextCursorLeft, and TextCursorRight
Reverts a change to LineEdit that implemented repeating keys
Adds some documentation comments
2019-08-21 17:13:48 +02:00
Pieter-Jan BriersandGitHub cb5f2ffae1 Refactor UI system. (#843)
* Refactor UI system.

Deferred updating is used for styling & layout. This fixes the awful time complexity of containers.
Removed SetDefaults and Initialize. They were a bad idea alright.

* Fix build on .NET Framework.
2019-08-14 22:03:51 +02:00
Pieter-Jan Briers 3d0d999f25 Remove ControlWrapAttribute. 2019-07-30 13:46:33 +02:00
Pieter-Jan Briers 7e13447455 Remove Godot scene instantiation. 2019-07-30 13:39:56 +02:00
Pieter-Jan Briers 0de8615033 Document some GUI controls. 2019-07-08 23:02:59 +02:00
Pieter-Jan BriersandGitHub cf2995437f Remove Godot support. (#805)
Let's be real, it's pretty damn broken already and will never be fixed.
2019-05-05 01:58:24 +02:00
SilverandGitHub 25926a17b7 Renames SS14.* to Robust.* (#793)
RobustToolbox projects should be named Robust.* 

This PR changes the RobustToolbox projects from SS14.* to Robust.*

Updates SS14.* prefixes/namespaces to Robust.*
Updates SpaceStation14.sln to RobustToolbox.sln
Updates MSBUILD/SS14.* to MSBUILD/Robust.*
Updates CSProject and MSBuild references for the above
Updates git_helper.py
Removes Runserver and Runclient as they are unusable
2019-04-15 20:24:59 -06:00