-
Notifications
You must be signed in to change notification settings - Fork 522
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
Who/Staffwho in TGUI #3786
Who/Staffwho in TGUI #3786
Conversation
What do they look like? |
brain worms moment |
Apology accepted for the moment. Avoid being a dickhead to maintainers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty good approach. I feel that the data model between backend and front end is quite coupled. In particular how the back end provides the exact text to display - e.g. ' - In Lobby' and how the colour is hardcoded in the backend.
I quite strongly feel that the colouring and styling information should be moved to scss to allow for a more robust solution going forward. I'm happy to discuss this further.
<Window resizable width={600} height={600}> | ||
<Window.Content scrollable> | ||
{administrators !== undefined && ( | ||
<Stack fill vertical> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use a stack to frame the collapsible when you only have one child?
{administrators.map((x, index) => ( | ||
<StaffWhoCollapsible | ||
key={x.index} | ||
title={x.category + ' - ' + x.category_administrators} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally think that string interpolation is better than adding strings together
|
||
const GetAdminInfo = (props, context) => { | ||
const { admin, content, color, text } = props; | ||
return admin ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm generally not a fan of the ternary operator used like this. My personal preference is to do something like:
if admin return admin_button return default_button
Essentially the return early principle. The main issue I have with the ternary operator like this - is that you end up with one operator being dragged across many lines, you gotta jump up and down to read it.
return admin ? ( | ||
<Button | ||
color={'transparent'} | ||
style={{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to style this in scss? Using react to directly plug in style information - works - but isn't great. Using scss we would be able to reduce the amount of code in the button definition here.
<Window resizable width={600} height={600}> | ||
<Window.Content scrollable> | ||
<Stack fill vertical> | ||
{total_players !== undefined && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you expecting the total players list to ever resolve to undefined? I could understand it resolving to an empty list
return ( | ||
<Button | ||
color={'transparent'} | ||
style={{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue I described regarding styling
const GetPlayerInfo = (props, context) => { | ||
const { act } = useBackend(context); | ||
const { admin, ckey, ckey_color, color, text } = props; | ||
return admin ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment regarding the ternary operator
new_mobs_ckey[client.key] = client_mob | ||
if(client_mob) | ||
if(istype(client_mob, /mob/new_player)) | ||
client_payload["text"] += " - in Lobby" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we want to directly change the display code in the backend. I feel that this couples the backend code with the render code quite tightly. I believe that a looser approach of say, a flag variable of being in lobby, would be preferable.
continue | ||
|
||
if(isobserver(client_mob)) | ||
client_payload["text"] += " - Playing as [client_mob.real_name]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above regarding changing the text name
"text" = "Queen: [faction.living_xeno_queen ? "Alive" : "Dead"]", | ||
)) | ||
|
||
/* in future... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still required?
This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself |
About the pull request
I heard some bad feedback on the onyx space about my past WHO window migration, so I decided that's the way to go... I should upgrade it to CM so people would be happy! Not just chic and feast on a dead CMI server.
Explain why it's good for the game
New nice TGUI Who interface, sound COOL, no?
Testing Photographs and Procedure
Screenshots & Videos
Put screenshots and videos here with an empty line between the screenshots and the
<details>
tags.Changelog
🆑
ui: new interface for who/staffwho in tgui
code: change who/staffwho to tgui
/:cl: