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

TGUI Minor Updates (2024 Pre-React Typescript Edition) #12066

Merged
merged 22 commits into from
Dec 31, 2024

Conversation

itsmeow
Copy link
Member

@itsmeow itsmeow commented Dec 22, 2024

About The Pull Request

Guess Who's Back!!!

Gets a bunch of smaller TGUI PRs prior to the React conversion and ports them.

Minor Tweaks/Features

TGUI Package Updates

Webpack Speedup

Typescript Conversions + Unit Tests

Ancient tgchat link stuff (included as part of typescript conversion for links.ts)

Dropdown v2 Improvements

JSX Conversion

Why It's Good For The Game

Gets us ready for bigger TGUI changes

Testing Photographs and Procedure

Screenshots&Videos

image
image
image
image
image

Changelog

🆑 itsmeow, jlsnow301, esainane, Watermelon914, ZephyrTFA, san7890, Cyberboss, stylemistake, AnturK, lebedev, KoJIT2009
tweak: The TGUI Blue Screen will now always include the correct in-universe year.
tweak: TGUI Dropdowns will now highlight the currently selected item inside the dropdown
tweak: Gas bars shown inside TGUI have more distinct colors.
refactor: Converted many core TGUI files to typescript
fix: Dropdown prev/next buttons will now work even if nothing is initially selected.
fix: External TGChat links starting with www will no longer open incorrectly.
code: Added string capitalization utils to TGUI
code: Renamed goon style folder to tgchat
code: All TGUI component files that return JSX have been renamed from .js to .jsx
code: Updated several TGUI dependencies.
code: TGUI should build faster.
tweak: Dropped IE8 transpilation support from TGUI, since IE8 doesn't work currently anyway.
fix: Updated TGUI initialization hook to work with newer browsers (OpenDream/Webview2)
/:cl:

esainane and others added 11 commits December 22, 2024 14:09
Bitwise OR coerces to an integral value. This is fine for the rgb
components as they have a domain of [0,255], but is less useful for
the alpha component, which has a domain of [0,1].

This retains the safely of | while permitting colors that are neither
fully opaque nor fully transparent, including NaN handling.
This PR adds color mappings for new gases, and disambiguates color mappings for old gases where multiple gases used one color - many used red, or purple.

Most of these have been around for a while, but were missing color mappings in interfaces.

This mainly affects the HFR gas list interface.
Co-authored-by: Watermelon914 <[email protected]>
* initial commit

* by suggestion

Co-Authored-By: Aleksej Komarov <[email protected]>

Co-authored-by: Aleksej Komarov <[email protected]>
I think it was previously named "goon" in relation to "goonchat", but
that was phased out three years ago, so it's just confusing to have a
"goon" folder especially when historically those tend to refer to
specialized folders meant for containing content under a non aGPL
license

However, everything in this folder appears to just be styles ported from
goonchat when tgchat was created, which is fine, but it's just confusing
since none of the stuff is licensed under anything from goon- just an
odd name to my eyes.

It's a much more fitting name as to what these files specifically
pertain too, rather than be an arcane reference to a system that has not
been used in quite a while...
nothing that concerns players
Mind you I am very tired while making this and it's purely a thought
project (... unless?)

Otherwise, title. No gameplay changes
Typescript is just universally better. Even if the types are wrong, we
still can get some sort of idea what the author was going for, and
autocompletion
:cl:
refactor: Tgui's state manager is in typescript now, huzzah
/:cl:

---------

Co-authored-by: Jeremiah <[email protected]>
Converts the remaining core tgui files into typescript
Builds tests for these files
Completed some todos to rewrite/refactor functions
Typescript good
N/A nothing player facing

---------

Co-authored-by: Jeremiah <[email protected]>
This PR makes selected elements in Dropdowns to be highlighted.
Without this:

![image](https://user-images.githubusercontent.com/5000549/236760396-5eb71a23-7b3d-4a9e-98d4-6bd4dc5fe1c7.png)
With this:

![image](https://user-images.githubusercontent.com/5000549/236758675-b2ab90a7-0482-492e-b911-9e59f827f6b8.png)
It's convenient to have this kind of selection indication, especially in
long lists.
:cl:
qol: Made selected elements highlighted in TGUI Dropdowns
/:cl:
## About The Pull Request

If dropdown not receive `selected` prop, buttons will be change value to
first(when press next) or last element(when press back)

## Changelog
:cl:
fix: Fixed dropdown buttons empty selected case
/:cl:
@itsmeow itsmeow requested a review from Crossedfall as a code owner December 22, 2024 20:16
@github-actions github-actions bot added GitHub TGUI-Changes Contains changes to TGUI. Make sure its up to date with TGUI 4.0 labels Dec 22, 2024
@itsmeow itsmeow force-pushed the tgui-small-updates-2024 branch from dd39174 to d59db34 Compare December 22, 2024 21:07
@itsmeow itsmeow force-pushed the tgui-small-updates-2024 branch from d59db34 to d949c92 Compare December 22, 2024 21:08
itsmeow and others added 8 commits December 23, 2024 14:01
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

We currently transpile TGUI down into ie8. This was primarily for Linux
compatibility, which, to my understanding, hasn't worked for quite some
time. As we approach 2024, consider that ie8 is nearly 15 years old and
had its support ended in 2016. I believe sunsetting ie8 is in order.

>I have no objections to remove IE8 support and fully target IE11.

tgstation/tgstation#79943 (comment)

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

- Probably improves performance to some degree, you're only as slow as
your weakest link.
- Reduced maintenance burden
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

N/A if they can even see this message it doesn't affect them

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
@itsmeow
Copy link
Member Author

itsmeow commented Dec 23, 2024

OK I'm done adding stuff to this. The remaining PRs are too large to be included and will be done after this one.

Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@itsmeow
Copy link
Member Author

itsmeow commented Dec 25, 2024

Gwarrhhhhh

Copy link
Member

@PowerfulBacon PowerfulBacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay

@PowerfulBacon PowerfulBacon added this pull request to the merge queue Dec 31, 2024
Merged via the queue into BeeStation:master with commit d00a23d Dec 31, 2024
21 checks passed
Dejaku51 added a commit that referenced this pull request Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Improvement Fix GitHub Refactor TGUI-Changes Contains changes to TGUI. Make sure its up to date with TGUI 4.0 Tweak
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants