Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overrides restyle #1972

Merged
merged 20 commits into from
Apr 23, 2020
Merged

Overrides restyle #1972

merged 20 commits into from
Apr 23, 2020

Conversation

Wibble199
Copy link
Collaborator

@Wibble199 Wibble199 commented Apr 23, 2020

This PR changes the overrides system from being based on dropdowns to a drag-drop system.

  • The user is presented with a "toolbox" of available evaluatables at the bottom, sorted by category. They are then able to drag and drop these into the canvas rather than having to find the one they want in a single long list.
  • The user is also able to drag around already-placed evaluatables to new positions, swapping them over (or holding to Ctrl to copy and overwrite the destination).
  • Users can also drag already-placed evaluatables into the toolbox to allow them to save it for future re-use. This feature is replacing the somewhat limited copy-paste system that existed previously. These saved "templates" are stored in the global configuration and are available to any profile (although invalid state variable paths will be reset).
  • Thanks to the dropdowns being removed, the decluttered interface is a lot more approchable now and is easier to understand.

A preview of the new UI

From a technical standpoint, the SetApplication method has been removed from the evaluatables, since most did not actually need to use the application context (only the ones that presented the user with the ability to choose a game state variable).

Instead, an inherited attached property has been added which is set at the root level of the override editor. This property is then automatically propogated down to other controls in the logical tree and when a variable picker needs to be used it can access it through this attached property instead. This has fixed issues with manually propogating it, such as #1927.


This PR also adds a new control for allowing picking of game state variables, saving all layers from having to manually populate a dropdown box.

Game state parameter picker


Finally, this PR also adds some new evaluatables:

  • A delay (for boolean, number and string) which delays the signal passed to it by a set amount of time.
  • A flip-flop boolean evaluatable, which takes two booleans 'set' and 'reset'. When set is true, the flip-flip will start outputting true until the reset becomes true. This can be used as a basic togglable gate, for example making some keys light up when the A key is pressed and then turn off only when the B key is next pressed.

…ol()` on IEvaluatable.

An inherited attached application property has been added which can be used to pass an application context down through the visual tree of the nested nodes. This fixes issues where the application context is not applied properly and variable lists don't appear. No more having to manually forward the application down to child evaluatables.
Logic for checking for a valid path has been moved into the GameStateParameterPicker, so this logic can be removed from all evaluatables and the code-behind for all layer controls where this was done.
On the downside, Evaluatables no longer know their own application, though I couldn't think of an actual use case where they'd need to anymore.
Only done the core dragging system so far, still need to add the toolbox.
Removes some margins from some of the evals and generally reduces the amount of "stuff" on the controls.
…x as "templates".

These are saved in the global config and are available to every application. Note that game state variable paths (excluding LocalPCInfo) are cleared if they are moved to a different application.
Also added a reusabale text prompt window.
Made textbox autofocus, made it submit on enter keypress, made description and error collapse when empty, increased font size.
Made the toolbox sort tabs by the order the tabs are defined, then sort evaluatables by name.
Removed some redundant code in many of the layers' code that queries the profile parameter.
But by god it's ugly. :S Animation rewrite when.
Also fixed bug where it would not always create a new boolean evaluatable when required.
@Wibble199 Wibble199 marked this pull request as ready for review April 23, 2020 14:16
…o paths sharing the first part of the name. (E.G. CPU and CPUUsage).
Thank DrMeteor for the idea.
Also made the display name of the parameters get converted to space case.
@diogotr7 diogotr7 merged commit 09b9cf1 into antonpup:dev Apr 23, 2020
@Wibble199 Wibble199 deleted the feature/overrides-rework branch April 23, 2020 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants