Commit Graph
77 Commits
Author SHA1 Message Date
Pieter-Jan BriersandGitHub 6674be3adc Client NRTs (#1121) 2020-06-12 12:57:39 +02:00
Pieter-Jan Briers afb0624a2b Fix DebugTimePanel to report prediction size correctly.
It was not taking into the account that CurTick increments after the mainloop runs tick meaning that it was offset by one.
2020-06-12 12:42:05 +02:00
ClyybberandGitHub 71b06c0791 Placement improvements (#1105) 2020-06-08 13:51:22 +02:00
Pieter-Jan Briers 537b444eae DebugConsole doesn't spam position changes if hidden. 2020-06-06 14:13:00 +02:00
Pieter-Jan Briers 044eeb61f4 Fix OnClose not firing on windows correctly. 2020-05-28 13:18:39 +02:00
Pieter-Jan Briers 32c1b1e3b2 Split off SS14 into BaseWindow. 2020-05-27 14:08:52 +02:00
Pieter-Jan Briers cc4069d526 Fix clear button in tile spawn window not resetting search results. 2020-05-21 23:39:14 +02:00
Pieter-Jan Briers 7f508f7719 Show largest clyde batch size in F3. 2020-05-21 13:44:41 +02:00
Pieter-Jan Briers b7f3627ef1 Remove List<>/Dictionary<,> usage from low-level GameState serialization.
NetSerializer does not handle these well and sends the entire backing array instead of a more compact representation. This can then cause it to start sending lists of length 1 with a *capacity* of 4096 resulting in 250 KiB/s down to send updates for a single entity. As it just did on the public server...
2020-05-12 18:34:16 +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 400dcb06fc Server scripting. 2020-04-30 00:06:59 +02:00
Pieter-Jan Briers b366070cd4 Adds entity prototype editor suffix system. 2020-04-26 01:16:49 +02:00
Pieter-Jan BriersandGitHub 0c8f869cb4 Prediction (#1027) 2020-04-18 17:35:54 +02:00
Pieter-Jan Briers 832a4e01f1 High level cursor API. 2020-04-17 16:57:51 +02:00
Pieter-Jan Briers 50abd155c2 Opened() hook for SS14Window 2020-03-25 02:14:01 +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
Acruid 0a32938c23 DebugCoordsPanel now just prints the Map and Grid coordinates. This looks more uniform, gives more info, and saves a line in the pannel. 2020-03-05 14:42:11 -08: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 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
Víctor Aguilera PuertoandGitHub 8a2ae5ec85 Makes spawnlist use prototype ID if prototype name is null or em… (#954) 2020-02-06 16:12:34 +01:00
Pieter-Jan Briers 766e2c81e2 Fixes debug coords panel throwing in main menu.
Fixes #938
2020-01-22 23:55:41 +01:00
DamianXandPieter-Jan Briers ae1e9c3a71 Entity spawn window's search bar grabs keyboard focus (#928) 2020-01-21 18:10:04 +01:00
Pieter-Jan Briers 861e19da76 Clarify terminology in debug memory panel. 2020-01-21 02:11:09 +01:00
Pieter-Jan Briers 1f0ec7fa68 Pulling down debug console no longer captures all mouse input. 2020-01-18 03:18:33 +01:00
moneylandPieter-Jan Briers 928a5e3521 Fix the entity spawn panel clear button (#926)
Previously the entity spawn panel clear button caused nothing to show up. This fixes that so it rebuilds the entity list with a empty search.
2020-01-08 17:37:13 +01:00
Pieter-Jan Briers 21b29e26e2 Fix a bunch of warnings. 2019-12-22 13:50:29 +01:00
Pieter-Jan Briers f893d308ad Cut cruft from DebugCoordsPanel. 2019-12-11 07:50:19 +01:00
Pieter-Jan Briers 66ea13684b Remove GameScreen from engine. 2019-12-06 00:40:37 +01:00
Pieter-Jan Briers 69ff3638ba Make framegraph not catch clicks. 2019-12-06 00:10:14 +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 4eb100076d Entity spawn window no longer lags when opening. 2019-12-04 13:26:37 +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
Pieter-Jan Briers 5025178203 Very shitty allocation rate tracker. 2019-11-17 22:31:21 +01:00
Pieter-Jan Briers 07b0548532 Input monitor. 2019-11-17 17:28:20 +01:00
Pieter-Jan Briers d092a63b28 Adds debug panel to show Clyde info & stats. 2019-10-18 14:28:54 +02:00
Pieter-Jan Briers 414177973d Fix SS14Window handling with UI Scaling applied. 2019-10-10 17:23:36 +02:00
Pieter-Jan Briers 6ecd86b9af Fancy animation for debug console opening. 2019-10-10 16:18:57 +02:00
Pieter-Jan Briers 6fdb09aa06 Show collections count in memory debug. 2019-10-08 00:50:20 +02:00
Acruid 6ed7684954 Reverts 00f982cb89.
Reverts b40413dfd6.
Decorates EntityPrototype.Name with CanBeNull.
The entity spawn window now properly handles prototypes with null names. Previously, a null name would throw a NullException. Entities with null names will never show up in the spawn window search results.
2019-09-16 13:08:59 -07: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 daf0d1dd6c Fix memory leak with entity spawn window 2019-08-31 18:39:19 +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 6e32588be7 Adds new placement alignment mode to place lights correctly. 2019-08-13 12:05:08 +02:00
Pieter-Jan Briers 7fce46ec44 Fix some issues Sonar caught. 2019-08-10 14:17:13 +02:00
DamianXandPieter-Jan Briers 89726ebeec Fix missing semicolon (#839)
* Fix missing semicolon

* Fixed CopyToArray
2019-08-04 11:42:40 +02:00
Pieter-Jan Briers 0a41ef3c9a Unified those messy FrameEventArgs. 2019-08-04 01:08:44 +02:00
Pieter-Jan Briers 0e65843f39 Memory debug panel to show memory usage info. 2019-08-03 23:59:54 +02:00
Pieter-Jan Briers 85a4375905 Various performance optimizations. 2019-08-01 00:10:20 +02:00
Pieter-Jan Briers d7e5c12a3d Make FpsCounter internal so it gets out of my face. 2019-07-30 13:55:58 +02:00