-
-
Notifications
You must be signed in to change notification settings - Fork 666
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
Add TGUI inputs and alerts #8080
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds TGUI-based alerts to replace the old tgalert system. Replaces all uses of tgalert with tgui_alert except for one, the 'Report Issue' button, as people were (understandably) concerned that this button using tgui will prevent a tgui bug from being easily reported. These windows have a nice little progress bar indicator of how much time they have left, and will automatically close themselves after this time elapses. Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This was requested by someone downstream. Some TGUI alerts offer two options e.g. (Kill Bob, Kill Janice), In byond alerts you'd be able to cancel by pressing the X, but tgui alerts don't support this. I've added an option to enable the normal X in the top right, so you can cancel out of alerts if you enable it.
Ported over from https://gitlab.com/cmdevs/colonial-warfare/-/merge_requests/613 which provides an input box to select an option from a list. Has a search bar to allow filtering for results and an onKeyDown event to replicate default behaviour from the default list input boxes that BYOND provides (where you are able to type the first letter of an element in the list and it'll jump to the first element that matches and then the next and so on) Right now, it is only applied to the holopad and "Drop Bomb" verb for administrators. Credits to bobbahbrown for the Loader element from AlertModal.js which allows for a timed input (was needed on the CM codebase for timed inputs) and for the majority of the DM code. Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com> Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
Ported over from https://gitlab.com/cmdevs/colonial-warfare/-/merge_requests/647 When you open the TGUI list input, it'll auto-focus the first element so that you can easily navigate with the arrow keys without having to click on the page beforehand. Small QoL when opening the thing, don't have to click on it if you want to navigate via arrows keys, etc.
Swapped OK/Cancel buttons in tgui list input, so that it stays consistent with Windows UI guidelines (was Cancel/OK before).
pressing enter or space now selects the selected button duplicate keys no longer cause input lists to break
* Fix tgui async modal constructor order * Fix another bug with the async modals
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
About The Pull Request Creates the framework for two new TGUI input boxes that can be toggled via game prefs. This does not convert any actual inputs to TGUI This does not convert any tgui_list_inputs into being toggleable Example pictures Input on a hand labeler. This has a MAX_LENGTH set, so it can be invalidated. Cancel always returns null. Enter button submits, if valid. text input (OUTDATED) Multiline input on newscaster. Newer version fills the window with a section, like the others multiline Sheets from a stack number input Why It's Good For The Game 1 So I did... Much sleeker input boxes Result should be a in place swap for most occurrences of input Renders casting as text/num/null obsolete but still doable Input validation from both sides handled Prefs toggle if you don't like the look Changelog cl add: TGUI input boxes are on the way! You can find new preferences in the menu. They will be on by default. /cl
…e song editor. (#65008)
itsmeow
commented
Nov 18, 2022
Are we going to test their feasibility at some point? Maybe start with something simple like ghostroles alerts for a testmerge? |
I intend to make another PR actually implementing these into the codebase to see how they work. I'd rather we just have this in so I can port TGUI-Say though because it depends on these. |
PowerfulBacon
approved these changes
Jan 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Administration
Feature
Fix
TGUI-Changes
Contains changes to TGUI. Make sure its up to date with TGUI 4.0
Tweak
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About The Pull Request
Simply adds them to the codebase. Does not actually replace a single input.
Also improves the "Close window" response on existing alerts/inputs, making it equivalent to No or Cancel in most cases. This means closing the alert will not trigger it, previously it could.
I tried to break this into cherry picks but near the end my dude just went mad with unatomized PRs that make 500 changes, so I just copy-pasted the newest versions from TG, however I can list PRs that this does include mainly:
Why It's Good For The Game
These look much better and add potential for additional functionality and accessibility. They've also quite improved from when we first tried porting TGUI list input.
Testing Photographs and Procedure
Screenshots&Videos
I removed the capitalization from all of the SUBMIT/CANCELS here.
Alert with three or more buttons
Alert with two buttons
Input list (using cameranet as example, unsorted, ignore that)
Number input (min/max buttons show the min/max values, the reload button resets to the default)
Single line text input
Multi line text input
Results
Changelog
🆑
add: Added TGUI inputs and alerts internally, however they are not enabled.
fix: Improved the response of most alert menus when you X them out rather than hitting No/Cancel.
tweak: Increased the contrast of selected/hovered TGUI buttons to 30% (from 15%)
/:cl: