Commit Graph
56 Commits
Author SHA1 Message Date
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
Pieter-Jan Briers 0de8615033 Document some GUI controls. 2019-07-08 23:02:59 +02:00
Pieter-Jan BriersandGitHub 09c36b57cd Shift half of Clyde around to implement better outline rendering. (#830)
* Attempted Clyde cleanup, didn't get far.

* Add negation operator to Vector2i.

* Add RenderOrder to ISpriteComponent.

* Post process shaders.

Adds "post process" shaders to sprite component.
These are executed on the WHOLE sprite component (every layer)
in one draw.

This is necessary to implement functional outlines.
2019-07-06 19:17:33 +02:00
Pieter-Jan Briers 300c2c05e4 Implement Label ClipText. 2019-05-29 01:05:43 +02:00
Pieter-Jan Briers f9e192b01e Vertically center checkboxes. 2019-05-29 00:55:34 +02:00
Pieter-Jan Briers 4892d0d0fa Fix some compiler warnings and remove dead code. 2019-05-28 00:30:18 +02:00
moneylandPieter-Jan Briers 110bd0921a Add StyleBox overrides to ProgressBar (#818)
* Add StyleBox overrides to ProgressBar

The overrides are StyleBoxFlat instead of StyleBox as StyleBox does not expose or possess a color property. _getBackground and _getForeground were also changed to return StyleBoxFlat instead of StyleBox to keep things simple.

* Change ProgressBar _getBackground and _getForeground back to StyleBox

* Change ProgressBar style box overrides from StyleBoxFlat to StyleBox
2019-05-25 01:41:39 +02:00
moneylandPieter-Jan Briers b92ea9a2aa Remove GUI dependence on tscn files (#812)
* Remove unused options menu tscn

* Move SS14Window to pure C#

* Move SpriteView to pure C#

* Move EntitySpawnWindow and EntitySpawnItem to pure C#

* Removes using statements accidentally added by resharper

* Set EntitySpawnWindow default size to normal value

Note that in construction menu and storage menu this had to be done in the object initializer and didn't work if it was set in the Initialize function for the respective menus. For whatever reason setting it in the EntitySpawnWindow.Initialize works fine.
2019-05-24 16:57:13 +02:00
Pieter-Jan Briers bb7288d26a ItemList only shows scrollbar when necessary. 2019-05-14 12:54:26 +02:00
Pieter-Jan Briers b30c2155c7 Improve ItemList rendering to correctly handle margins. 2019-05-14 11:26:37 +02:00
Pieter-Jan Briers f7ccac2c11 Make Label align individual lines to center. 2019-05-14 01:19:01 +02:00
Pieter-Jan Briers 9db3473b7a Containers handle size flags better. 2019-05-13 14:51:50 +02:00
Pieter-Jan Briers 1403c14acb Fix MarginContainer layout. 2019-05-13 09:14:23 +02:00
Pieter-Jan Briers ab8feee660 Add ItemList.ClearSelections() 2019-05-12 15:07:07 +02:00
Pieter-Jan Briers e6417582c8 Fix OptionButton popup going under other controls. 2019-05-12 12:09:38 +02:00
Pieter-Jan BriersandGitHub 17ebeac107 UI Scaling Support. (#809)
Not quite perfect, but quite usable.

Adds the ability to scale the UI. Scaling is controlled via a cvar,
and can be changed at runtime.
Fractional scaling is supported.

Some controls could be better (SpriteView, TextureRect),
but for now it's a good start.
2019-05-11 16:04:14 +02:00