TTT2 icon indicating copy to clipboard operation
TTT2 copied to clipboard

Implement TT2 Guide -> Roles

Open ROODAY opened this issue 5 months ago • 5 comments

Implemented a very basic roles page that lists the available roles, and when a role is clicked it will display some basic info about the role

image

ROODAY avatar Aug 12 '25 04:08 ROODAY

There are still some things I'd like to fix:

  • Add a search bar to make finding a role easier
  • Remove the margin around the submenu content for this page, so that the list of roles is flush
  • Make the displayed information prettier

I think I can figure out the first one, but this is my first time making a PR to this codebase, so any help regarding the other two would be greatly appreciated! TBH I'm not even sure what info should be displayed/how to make it pretty

ROODAY avatar Aug 12 '25 04:08 ROODAY

First of: I really appreciate what you did here. However, I have to say that it does not fit our design language so far. I'm a bit confused why your scrollbar looks different. And you should put the content in forms instead of bare strings

TimGoll avatar Aug 12 '25 07:08 TimGoll

@TimGoll sure, I can use forms like how admin Roles page works, I guess these would be in form help text and just not have any of the config toggles/inputs?

As for the scrollbar looking different, I'm not sure why it's like that. I'm using a DScrollPanel instead of a DSubmenuList as the latter required a bunch of fields/data to be set that seems to only be on pages derived from base_gamemodemenu.lua, but this guide->roles page is derived from base_gamemodesubmenu.lua. I initially tried just replicating the admin roles page but ran into a ton of errors/stuff just not rendering and not knowing what was going on, so it felt easier to just rebuild from scratch with the components that DSubmenuList uses internally.

Sidenote, would you know how to remove the margin around the content area in this gamemode submenu? I don't think I explicitly set any margin here (and in other submenus I see there is a margin so it looks like something set at a default level)

ROODAY avatar Aug 12 '25 16:08 ROODAY

Also just linking the thread from discord to bring the discussion together: https://discord.com/channels/442107660955942932/1402951259601768519

ROODAY avatar Aug 12 '25 17:08 ROODAY

I guess these would be in form help text and just not have any of the config toggles/inputs?

Yes, for example by using help boxes which automatically support localization and line wrapping. However, I envisioned something way more in-depth for the guide, but I struggle to find any time to work on it.

As for the scrollbar looking different, I'm not sure why it's like that. I'm using a DScrollPanel instead of a DSubmenuList

That's probably it. The submenu list is heavily modified to have the style I was aiming for. It has been a while, I'm not so sure anymore how exactly it works. As you can see in #1752 I also started to completely refactor the codebase of vgui, because stuff like you encountered here really annoyed me.

Sidenote, would you know how to remove the margin around the content area in this gamemode submenu? I don't think I explicitly set any margin here (and in other submenus I see there is a margin so it looks like something set at a default level)

I think this is defined in the base menu in cl_help. If you want to change it, it will probably cause some pain for you because this propagates through the whole menu.

TimGoll avatar Aug 14 '25 08:08 TimGoll