Skip to content
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
5d63312
Tighten up padding in F1 menu submenu list
nike4613 Dec 30, 2024
c0c48fc
Move role-related administrative panels into Roles top-level tab
nike4613 Dec 30, 2024
5e27cd5
Add a proper message when search yields no results
nike4613 Dec 30, 2024
bcb4604
Add roles overview page in UI
nike4613 Dec 31, 2024
c6c0f1d
Re-add administration submenu files to override the Workshop files
nike4613 Jan 1, 2025
5d4ea01
Insert prints to debug rolelayering sync
nike4613 Jan 1, 2025
26d362f
Fix role layering menu
nike4613 Jan 1, 2025
c978a5b
Tweak debug prints
nike4613 Jan 1, 2025
d1fb33e
Revert "Insert prints to debug rolelayering sync"
nike4613 Jan 1, 2025
03a4b3d
Finish role overview document
nike4613 Jan 1, 2025
180c984
Update role layering description to be more descriptive.
nike4613 Jan 1, 2025
23db47a
stylua
nike4613 Jan 1, 2025
3e80013
Changelog
nike4613 Jan 1, 2025
a29c74e
glualint
nike4613 Jan 1, 2025
bf96018
Document DSubmenuListTTT2:ResetSubmenuList()
nike4613 Jan 1, 2025
787e076
Add the infra for role decision inspection
nike4613 Jan 2, 2025
7c4a9d3
Instrument GetAllSelectableRolesList with role inspection
nike4613 Jan 2, 2025
6acbd82
Instrument GetSelectableRolesList
nike4613 Jan 2, 2025
36e0f05
Try out putting highlight on search bar above text
nike4613 Jan 7, 2025
e38641a
Report subrole selection order in GetSelectableRolesList
nike4613 Jan 7, 2025
66b2f45
Instrument baserole, subrole, and final role selection
nike4613 Jan 7, 2025
21cb2be
Fix ReportDecision call in SelectBaseRolePlayers
nike4613 Jan 7, 2025
8659385
Begin implementing UI for role distribution inspection
nike4613 Jan 7, 2025
28f3cf5
Adjust roleinspect UI to be slightly more easy to work with
nike4613 Jan 8, 2025
642883b
Add skeleton for final 3 roleinspect stages
nike4613 Jan 8, 2025
900a1ee
Render role layers for STAGE_LAYERING
nike4613 Jan 8, 2025
9ea91b1
Add language strings for the first 2 stages of the roleinspect GUI
nike4613 Jan 8, 2025
33a452d
Add subrole upgrade order UI
nike4613 Jan 9, 2025
7d3ca56
Implement baserole assignment stage UI
nike4613 Jan 9, 2025
9584776
Collapse all roleinspect sections by default
nike4613 Jan 9, 2025
1b342b1
Render baserole distribution correctly when derandomization is disabled
nike4613 Jan 11, 2025
0eda1c5
Implement UI for subrole upgrades and final roles
nike4613 Jan 11, 2025
e6997a2
stylua
nike4613 Jan 12, 2025
9a7c826
glualint
nike4613 Jan 12, 2025
3199223
changelog
nike4613 Jan 12, 2025
590faf8
Add sort mode player name to DPlayerGraph
nike4613 Jan 12, 2025
d8d60f2
splling
nike4613 Jan 12, 2025
90168e1
Merge remote-tracking branch 'upstream/master' into role-scrutability
nike4613 Jan 12, 2025
24f4b78
Merge remote-tracking branch 'upstream/master' into gui
nike4613 Jan 12, 2025
a3eaa40
Merge branch 'gui' into role-scrutability
nike4613 Jan 12, 2025
d9fc055
neodoc
nike4613 Jan 12, 2025
f68949e
Make sure the UI doesn't fail when no subroles are present
nike4613 Jan 14, 2025
a6dcbe9
Tweak some help messages to be a bit more clear
nike4613 Jan 14, 2025
c86b063
Fix empty roleinspect info message
nike4613 Jan 14, 2025
10fb438
stylua
nike4613 Jan 14, 2025
44f16e1
Merge remote-tracking branch 'upstream/master' into role-scrutability
nike4613 Jan 19, 2025
9c12b6a
Remove duplicate GetVisibleNonSearchedSubmenus
nike4613 Jan 19, 2025
6b94ba3
Merge remote-tracking branch 'upstream/master' into role-scrutability
nike4613 Jan 19, 2025
714f735
toggle role indicator
TimGoll Jan 19, 2025
2c919a5
fixed doc string
TimGoll Jan 19, 2025
c19cb75
Merge branch 'toggle-role-check-indicator' of github.com:TTT-2/TTT2 i…
nike4613 Jan 19, 2025
b1e8d2d
Merge branch 'toggle-role-check-indicator' of github.com:TTT-2/TTT2 i…
nike4613 Jan 19, 2025
62081c0
also hide the outline
TimGoll Jan 19, 2025
3e167fc
Merge branch 'toggle-role-check-indicator' of github.com:TTT-2/TTT2 i…
nike4613 Jan 19, 2025
905f3a3
remove outline offset when no outline
TimGoll Jan 19, 2025
06da787
Merge branch 'toggle-role-check-indicator' of github.com:TTT-2/TTT2 i…
nike4613 Jan 19, 2025
76d8dcf
Adjust for new DRoleImage changes
nike4613 Jan 19, 2025
5828433
Darken roles which aren't considered because they're not selectable a…
nike4613 Jan 19, 2025
b721225
Update gamemodes/terrortown/gamemode/client/cl_vskin/default_skin.lua
TimGoll Jan 19, 2025
0f58faa
Merge branch 'toggle-role-check-indicator' of github.com:TTT-2/TTT2 i…
nike4613 Jan 19, 2025
a3d9aff
Merge remote-tracking branch 'upstream/master' into role-scrutability
nike4613 Jan 20, 2025
12484ef
Add translation string for ROLEINSPECT_REASON_NO_DECISION
nike4613 Jan 20, 2025
f7f97d7
Merge branch 'master' into role-scrutability
TimGoll Jan 22, 2025
0993284
Use existing text wrapping code
nike4613 Jan 23, 2025
326ed93
Remove commented out prints
nike4613 Jan 23, 2025
1c40987
Move roleinspect to libraries folder
nike4613 Jan 24, 2025
efd9d5b
Remove some unused bits
nike4613 Jan 26, 2025
614e95b
Address more feedback
nike4613 Jan 26, 2025
8883a25
Add an extra help box to unknown layer sroleinspect
nike4613 Jan 26, 2025
bdd7080
stylua
nike4613 Jan 26, 2025
2df44ec
bruh
nike4613 Jan 26, 2025
4419fbc
Update gamemodes/terrortown/gamemode/server/sv_roleselection.lua
nike4613 Jan 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Added `GM:TTT2PlayDeathScream` hook to cancel or overwrite/change the deathscream sound that plays, when you die (by @NickCloudAT)
- Added support for "toggle_zoom" binds to trigger the radio commands menu (by @TW1STaL1CKY)
- Added option to use right click to enable/disable roles in the role layering menu (by @TimGoll)
- Added a menu to allow admins to inspect, in detail, how and why roles are distributed as they are (by @nike4613)
- Added option to enable team name next to role name on the HUD (by @milkwxter)

### Fixed
Expand Down
3 changes: 3 additions & 0 deletions gamemodes/terrortown/gamemode/client/cl_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ttt_include("sh_sprint")
ttt_include("sh_main")
ttt_include("sh_shop")
ttt_include("sh_shopeditor")
ttt_include("sh_roleinspect")
ttt_include("sh_rolelayering")
ttt_include("sh_scoring")
ttt_include("sh_corpse")
Expand Down Expand Up @@ -85,6 +86,8 @@ ttt_include("cl_vskin__vgui__dprofilepanel")
ttt_include("cl_vskin__vgui__dinfoitem")
ttt_include("cl_vskin__vgui__dsubmenulist")
ttt_include("cl_vskin__vgui__dweaponpreview")
ttt_include("cl_vskin__vgui__dpippanel")
ttt_include("cl_vskin__vgui__dplayergraph")

ttt_include("cl_changes")
ttt_include("cl_network_sync")
Expand Down
121 changes: 111 additions & 10 deletions gamemodes/terrortown/gamemode/client/cl_vskin/default_skin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ local drawFilteredShadowedTexture = draw.FilteredShadowedTexture
local drawOutlinedBox = draw.OutlinedBox
local drawFilteredTexture = draw.FilteredTexture
local drawSimpleText = draw.SimpleText
local drawDrawText = draw.DrawText
local drawLine = draw.Line
local drawGetWrappedText = draw.GetWrappedText
local drawGetTextSize = draw.GetTextSize
Expand Down Expand Up @@ -1345,15 +1346,30 @@ function SKIN:PaintTooltipTTT2(panel, w, h)
)

if panel:HasText() then
drawSimpleText(
TryT(panel:GetText()),
panel:GetFont(),
0.5 * w,
0.5 * (h + sizeArrow),
utilGetDefaultColor(colors.background),
TEXT_ALIGN_CENTER,
TEXT_ALIGN_CENTER
)
local text = TryT(panel:GetText())

if string.find(text, "\n") then
-- has newlines, use drawDrawText
drawDrawText(
text,
panel:GetFont(),
10, --0.5 * w,
4 + sizeArrow,
utilGetDefaultColor(colors.background),
TEXT_ALIGN_LEFT
)
else
-- no newlines, can use drawSimpleText
drawSimpleText(
text,
panel:GetFont(),
0.5 * w,
0.5 * (h + sizeArrow),
utilGetDefaultColor(colors.background),
TEXT_ALIGN_CENTER,
TEXT_ALIGN_CENTER
)
end
end
end

Expand Down Expand Up @@ -1893,7 +1909,10 @@ function SKIN:PaintSearchbar(panel, w, h)
)

-- Draw small blue bar on the bottom
drawBox(leftPad, h - sizes.border - bottomPad, w - widthPad, sizes.border, colorBar)
--drawBox(leftPad, h - sizes.border - bottomPad, w - widthPad, sizes.border, colorBar)

-- Draw small blue bar across the top
drawBox(leftPad, topPad, w - widthPad, sizes.border, colorBar)

-- If not focussed draw placeholder text
if panel:GetIsOnFocus() then
Expand Down Expand Up @@ -2293,5 +2312,87 @@ function SKIN:PaintWeaponPreviewTTT2(panel, w, h)
end
end

---
-- @param Panel panel
-- @param number w
-- @param number h
-- @realm client
function SKIN:PaintPlayerGraphTTT2(panel, w, h)
local renderData = panel.renderData
local padding = panel:GetPadding()

if panel.title ~= "" then
-- title text
drawSimpleText(
panel.title,
panel:GetFont(),
renderData.titleX,
renderData.titleY,
colors.helpText,
TEXT_ALIGN_LEFT,
TEXT_ALIGN_TOP
)
end

local barColor = utilGetChangedColor(colors.background, 30)
local valueInsideColor = utilGetDefaultColor(barColor)
local valueOutsideColor = utilGetDefaultColor(colors.background)

if renderData.sepY then
-- title separator
drawBox(0, renderData.sepY, w, 1, barColor)
end

local hBarColor = colors.accent
local hValueInsideColor = colors.accentText

-- then the items
for i = 1, #renderData.order do
local item = renderData.order[i]
-- first, draw the bar
local thisBarColor
if item.data.highlight then
thisBarColor = hBarColor
else
thisBarColor = barColor
end
--print(item.x, item.y)
drawBox(item.x, item.y, item.w, item.h, thisBarColor)
-- then the value text
if item.valueWidth > w - item.x - item.w - padding then
-- the value would take up too much space outside, put it inside
local thisTextCol
if item.data.highlight then
thisTextCol = hValueInsideColor
else
thisTextCol = valueInsideColor
end
local x = item.x + item.w - item.valueWidth - padding
--print(x, item.y)
drawSimpleText(
tostring(item.data.value),
panel:GetFont(),
x,
item.y,
thisTextCol,
TEXT_ALIGN_LEFT,
TEXT_ALIGN_TOP
)
else
-- the value will fit outside the bar, draw it there
--print(item.x + item.w + padding, item.y)
drawSimpleText(
tostring(item.data.value),
panel:GetFont(),
item.x + item.w + padding,
item.y,
valueOutsideColor,
TEXT_ALIGN_LEFT,
TEXT_ALIGN_TOP
)
end
end
end

-- REGISTER DERMA SKIN
derma.DefineSkin(SKIN.Name, "TTT2 default skin for all vgui elements", SKIN)
Loading
Loading