Commit Graph
99 Commits
Author SHA1 Message Date
Pieter-Jan Briers 7890c1b39c Fix bogus nullability errors from Rider.
None of these are actual nullability warnings but they make Rider shut up so.
2020-08-25 17:48:23 +02:00
9d1bec9bb2 Merge FloatMath and MathHelper (#1234)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-08-20 19:21:07 +02:00
Pieter-Jan Briers d4a47778ef Remove this parameter from FloatMath.Clamp.
That was a stupid idea.
2020-08-12 21:17:18 +02:00
Pieter-Jan Briers b45ea725d7 Remove CannyFastMath. 2020-08-12 21:17:17 +02:00
Acruid 5e448f20c0 Move parts of the simulation update back into engine, from Content's StateBase.
Allow content to push modal windows in the UI framework.
The MenuBar now closes it's MenuButton frame when you select one of the buttons.
Modal controls on the stack now actually block input from the rest of the UI.
Adds the `scene` concommand for instantly switching between game states (scenes).
2020-07-19 12:31:13 -07:00
Pieter-Jan Briers 6088df4018 Make LineEdit cull rendering on the left of its bounding box aswell.
Fixes https://github.com/space-wizards/space-station-14/issues/1300, although realistically this is more an optimization that happens to fix the bug.
2020-07-08 03:14:38 +02:00
Pieter-Jan Briers c2ce37517f Mouse wheel scrolling for Tree control.
Fixes https://github.com/space-wizards/space-station-14/issues/1309
2020-07-08 02:50:27 +02:00
ShadowCommanderandGitHub 6c2157c10f Change ScrollContainer ScrollBars to not affect layout when not visible (#1162) 2020-07-01 16:36:53 +02:00
chairbenderandGitHub 2558201ae4 implement dragging of split in split containers (#1141) 2020-06-22 18:50:34 +02:00
Tyler YoungandGitHub 9cbdd1058c Use CannyFastMath & Update Some Packages (#1130)
update a bunch of packages and use JetBrains.Annotations as private asset as needed

mark some hot math methods agg inline to benefit from loop opts

use FMA for interp

use canny min/max/clamp

make Quaternion NormalizeAngle fixed time and faster

clean up YamlDotNet references
2020-06-18 02:25:36 +02:00
Pieter-Jan BriersandGitHub 6674be3adc Client NRTs (#1121) 2020-06-12 12:57:39 +02:00
Pieter-Jan Briers 6a2f8f2767 Fix tree control jittering. 2020-06-09 21:28:02 +02:00
Pieter-Jan Briers 12c866b8d6 Fix LayoutContainer margins to be virtual pixels. 2020-06-06 14:13:21 +02:00
Pieter-Jan Briers 49b452eca4 Fix layout of buttons at higher UI scaling factors. 2020-06-06 13:02:49 +02:00
ShadowCommanderandGitHub 1b52093c5d Change buttons to use MouseFilterMode.Stop (#1095) 2020-06-01 15:35:06 +02:00
Pieter-Jan Briers 75707c1db0 Use AttachedProperty for TabContainer, TabVisibleProperty. 2020-05-31 00:35:19 +02:00
Pieter-Jan Briers 79fc210395 Typing into LineEdit when you have a selection replaces the selection. 2020-05-24 17:24:23 +02:00
Pieter-Jan Briers d6b25945e4 Adds AltOrigin functionality property to PopupContainer. 2020-05-13 17:55:33 +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
Pieter-Jan Briers f8e7ded2f0 Handle empty clipboard when pasting text. 2020-05-04 23:38:01 +02:00
Pieter-Jan Briers 51b87513ed Improve LineEdit
Fixes #748, Closes #1010

Can select text now, can move by words, and all the other stuff you'd expect from a control like this.
2020-05-04 17:13:29 +02:00
Pieter-Jan Briers 2da1640ab7 Makes BoxContainer default separation 0. 2020-04-18 12:16:40 +02:00
Pieter-Jan Briers 832a4e01f1 High level cursor API. 2020-04-17 16:57:51 +02:00
Pieter-Jan Briers 50ad9bacf0 Replace OutputPanel.RemoveLine(int) with RemoveEntry(Index) 2020-03-25 02:13:50 +01: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 91467ecdb9 Implement HistoryLineEdit (#990)
* Implement HistoryLineEdit

* Refactor DebugConsole to use HistoryLineEdit

* Clean up LineEdit

Add args.Handle() for each BoundKeyFunction

Clean up if statements

* Rearrange LineEdit variables

* Reimplement DebugConsole saving and loading
2020-02-22 17:56:35 +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
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