Commit Graph
71 Commits
Author SHA1 Message Date
4dplannerandGitHub 4470443445 SpriteView checks for deleted sprites (#977) 2020-02-13 23:12:05 +01:00
ShadowCommanderandGitHub b9fdda85ef Add check to LineEdit cursor position (#971) 2020-02-13 13:35:02 +01:00
Pieter-Jan Briers 768121bc57 Fix popups going off-screen with a new PopupContainer. 2020-01-25 17:26:37 +01:00
8f16b188dd Add delete key behavior to LineEdit (#934)
* Add delete key behavior to LineEdit

Pressing delete will now delete the character in front of your cursor like usual.

* Update Robust.Client/UserInterface/Controls/LineEdit.cs

Co-Authored-By: Pieter-Jan Briers <pieterjan.briers@gmail.com>

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2020-01-21 18:10:26 +01:00
Pieter-Jan Briers dfc1e99092 Fix OptionButton throwing an exception when the first item added doesn't have ID 0. 2020-01-19 03:17:08 +01:00
DamianXandPieter-Jan Briers 18f90bd125 HOME and END keys work in LineEdit (#929) 2020-01-16 13:19:47 +01:00
Pieter-Jan Briers 0739367013 Fix a bunch of compiler warnings. 2020-01-15 14:50:46 +01:00
Pieter-Jan Briers 0348919104 Implement Slider UI control. 2020-01-15 14:10:05 +01:00
Pieter-Jan Briers 414a264ea9 Adds Range.SetAsRatio. 2020-01-15 14:10:05 +01:00
Pieter-Jan Briers c09fc5f021 TabContainer no longer crashes on controls without name. 2020-01-15 14:10:05 +01:00
Pieter-Jan Briers 14116cdbdf Fix LayoutContainer on HiDPI. 2020-01-09 03:12:35 +01:00
Pieter-Jan Briers dadaa3fb8f Very basic GUI animations. 2020-01-09 00:13:37 +01:00
Pieter-Jan BriersandGitHub 3c08f56619 Sprite orientation improvements (#917)
* Fold animation delays into a single set for all directions.

* Update systems to use new RSI animations API.

* Fetching layer directions now done in sprite render.

* Allow overriding direction in SpriteView.
2019-12-24 01:15:44 +01:00
Pieter-Jan BriersandGitHub 52e5afd277 Switch to GLFW for windowing (#914)
* Use GLFW instead of OpenTK windows

* Seems to work pretty well now.

* Fix stackalloc issue on Framework.

* Add GLFW project to sln.

* Fix package downgrade.

* Fix SLN more.

* Please work.

* Fix C# version error.
2019-12-15 15:53:30 +01:00
Pieter-Jan BriersandGitHub ab1f4fb0e7 UI layout v2. (#908)
* UI layout v2.

All controls now act like containers.
Moved anchor/margin layout model to LayoutContainer

Implement basic WPF-like attached properties for the above LayoutContainer.

* Fix VV.
2019-12-05 13:37:58 +01:00
Pieter-Jan Briers 13ef4e8423 Various optimizations focused on the entity spawn panel:
Give BoxContainer a preset capacity to reduce allocations in layout.

Removed Control.GetChild(string) and similar. This was no longer used (and was a pretty bad idea in general), and the implementation had a lot of wasted book keeping to do.

Use UpdateLayout() instead of DoUpdateLayout() in Control minsize changed to avoid doing redundant layout, and by extension style & minsize, updates.

Used RemoveAllChildren instead of DisposeAllChildren in EntitySpawnWindow because it's faster (way less stuff to clear, just let the GC handle it).

Optimized ResourcePath with a better GetHashCode(), better Equals, replacement for List<T>.ToArray()

Fixed enumerator allocations in stylesheet SelectorElement matching to speed up style updates.

ResourceCache now caches fallbacks to avoid constructing Resource instance when fetching fallback explicitly.

ResourceCache now has nested dictionaries for Type -> ResourcePath -> BaseResource storage of resources.

Use calculated property instead of auto property for TextureResource.Fallback
2019-11-28 14:19:02 +01:00
Peter WedderandPieter-Jan Briers 063c30e2bf Scrollbar minimum size (#903) 2019-11-24 11:35:52 +01:00
ShadowCommanderandPieter-Jan Briers 1493f67c94 Add to OptionButton and SpinBox (#893)
* Add prefix to OptionButton

* Add validation to SpinBox
2019-11-17 18:38:56 +01:00
Pieter-Jan Briers a7d7fdd12b Fix crash apparently. 2019-10-22 18:55:12 +02:00
Pieter-Jan Briers 86be98005c Some engine optimizations. 2019-10-22 18:05:08 +02:00
DamianXandPieter-Jan Briers 6e621f6398 Scrollbars properly handle clicks (#881) 2019-10-20 01:45:31 +02:00
Pieter-Jan Briers 5c550888f6 Fix DefaultSeparation in BoxContainer being hardcoded. 2019-10-20 01:36:04 +02:00
Pieter-Jan Briers 3f1c33fc96 Implement radio buttons. 2019-10-20 00:50:35 +02:00
Pieter-Jan Briers 0494d59a5a Fix GridContainer minimum size calculation. 2019-10-19 02:13:58 +02:00
Pieter-Jan Briers 896b664590 Make ItemList ScrollFollowing default to false. 2019-10-13 01:27:14 +02:00
Pieter-Jan Briers be2904ca17 Fix Scrollbar and ItemList while placement is active. 2019-10-12 23:27:28 +02:00
Pieter-Jan Briers 8aaacce195 Fix TextureRect and TextureButton UI scaling.
Thanks to nirnael for helping me investigate this and getting me to do it.
2019-10-10 17:14:00 +02:00
Pieter-Jan Briers 324770630d Reduce speed of scrollbar animation.
Makes it way easier to track for me.
2019-10-10 16:17:27 +02:00
DamianXandAcruid 7dde058319 Removed debug message from ItemList (#868) 2019-09-19 16:53:20 -07:00
ShadowCommanderandPieter-Jan Briers d08823322a Implemented SpinBox and added a filter to LineEdit (#866)
* Implemented SpinBox and added a filter to LineEdit

* Update SpinBox.cs

* Added requested changes and summaries
2019-09-15 20:07:28 +02:00
Víctor Aguilera PuertoandPieter-Jan Briers 7fc99ee528 Improved ItemLists (#863)
* Improve ItemList

* Address reviews

* Items can only be at one ItemList at a time

* Nested Item class
2019-09-13 15:23:04 +02:00
Pieter-Jan Briers f2ac151917 Scrolling so smooth it puts half the apps I use daily to shame. 2019-08-31 17:32:48 +02:00
Pieter-Jan Briers 3d00d491c4 BoxContainer ignores invisible children for minsize calculations.
This is inline with what Godot does and it makes VV a hell of a lot compacter.
2019-08-30 08:53:13 +02:00
ShadowCommanderandPieter-Jan Briers 366d0ab2d5 Fixed LineEdit triggering when hovered but not selected (#854)
* Revert "Don't fire regular keybinds for controls under the mouse."

This reverts commit bb322e30ee.

* Fixed LineEdit triggering when hovered
2019-08-26 00:23:09 +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
CatTheSystemandPieter-Jan Briers fc67c5069c Allowed multiple Pseudo Classes per element. (#846)
* Quick fix to flashlight radius

* SomethingAbout CSS Class

* Shitty update

* fuck

* Creativ!

* Last But not least

* Quick Change

* Fixed version

* Tiny fix

* Next Fix

* Another fix
2019-08-20 21:22:14 +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 7fce46ec44 Fix some issues Sonar caught. 2019-08-10 14:17:13 +02:00
Pieter-Jan Briers b6bc2e591b Very rough menu bar control. 2019-08-05 14:45:38 +02:00
Pieter-Jan Briers 0a41ef3c9a Unified those messy FrameEventArgs. 2019-08-04 01:08:44 +02:00
Pieter-Jan Briers 0e31193e7f Improve rich text system.
Improved word wrapping to reduce edge cases.
Allowed setting a "maximum" size for rich text label.
2019-07-30 23:10:03 +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 a1d899ee31 Updating control size flags now notifies parent container. 2019-07-29 23:08:49 +02:00
Pieter-Jan Briers 83c738e423 Correctly handle fractional scrolling coming in from OpenTK. 2019-07-24 09:31:16 +02:00
Pieter-Jan Briers 17424cc3f3 TextureButton can now be scaled. 2019-07-23 19:44:24 +02:00
Pieter-Jan Briers ecb641f403 Allow scaling SpriteView. 2019-07-20 15:49:44 +02:00
Pieter-Jan Briers e3720ebe01 Implement MinSize for TextureButton 2019-07-13 14:49:46 +02:00
Pieter-Jan Briers 5d07887251 TextureRect can now be scaled. 2019-07-12 19:11:43 +02:00