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

TTT: Enable scoreboard to be sorted by different criteria other than score #1332

Merged
merged 74 commits into from Apr 19, 2017
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
a94b8e3
Base changes
DirkyJerky Feb 14, 2017
c6a6cea
Make the convar
DirkyJerky Feb 15, 2017
c512684
Hook into the convar
DirkyJerky Feb 15, 2017
6d92af5
Remove button selector thing; Probably better in a settings menu
DirkyJerky Feb 15, 2017
53dcb92
Alphabetically by default
DirkyJerky Feb 15, 2017
c82a4d0
Removed unnessesary checks and whitespace
DirkyJerky Feb 15, 2017
6af889b
a,b -> plya, plyb
DirkyJerky Feb 15, 2017
4793be8
That was a weird `CompareAlpha` function
DirkyJerky Feb 15, 2017
0e74c2a
`>` -> `<`
DirkyJerky Feb 15, 2017
d8b7007
TTT: Implement clicking on scoreboard headings to sort by that field
bmwalters Feb 15, 2017
9dbeffe
Merge pull request #1 from bmwalters/feature/scoreboard-sorting
DirkyJerky Feb 15, 2017
b01837b
Well we dont need to ConVar anymore
DirkyJerky Feb 15, 2017
acad015
Role option
DirkyJerky Feb 15, 2017
5d59fad
Add concommand `ttt_scoreboard_setsort`
DirkyJerky Feb 15, 2017
bd5a411
Name & Role headers AND highlight active header
DirkyJerky Feb 15, 2017
9ffde57
Update color display after sort change
DirkyJerky Feb 15, 2017
d785f17
We dont need this concommand anymore
DirkyJerky Feb 15, 2017
ca2fd27
Put it in a ConVar!
DirkyJerky Feb 16, 2017
e9ddcee
If comparison is equal; fall back to comparing name --- Also fix name…
DirkyJerky Feb 16, 2017
d4cd44d
Ascending direction by default
DirkyJerky Feb 16, 2017
29e6e41
Can set sorting via Settings menu
DirkyJerky Feb 16, 2017
2307046
No more clicky column headers for Name & Role
DirkyJerky Feb 16, 2017
705ff0b
Put it in a new settings section
DirkyJerky Feb 16, 2017
e66720c
English translation
DirkyJerky Feb 16, 2017
5c9496f
German!
DirkyJerky Feb 16, 2017
8f7aa65
A colon
DirkyJerky Feb 16, 2017
c988cac
Chinese!
DirkyJerky Feb 16, 2017
f093512
Swedish!
DirkyJerky Feb 16, 2017
a62d62a
Spanish!
DirkyJerky Feb 16, 2017
9e54d20
Russian!
DirkyJerky Feb 16, 2017
f32611c
Portuguese!
DirkyJerky Feb 16, 2017
5711559
Fix scoreboard settings panel
DirkyJerky Feb 17, 2017
77e1c95
Remove redundant word in settings
DirkyJerky Feb 17, 2017
bd40d74
Left aligned fake column headers -- TEST ME
DirkyJerky Feb 17, 2017
849e691
Apply Scheme for the new headers
DirkyJerky Feb 17, 2017
54b555f
Period not colon
DirkyJerky Feb 17, 2017
2b602d8
Swap order
DirkyJerky Feb 17, 2017
1851aa7
Fix stuff...
DirkyJerky Feb 17, 2017
0e2b959
Nil check for karma, probably possible because karma can be disabled
DirkyJerky Feb 17, 2017
aeaf2db
Sort by title header
DirkyJerky Feb 17, 2017
8c3363b
Update english.lua
DirkyJerky Feb 17, 2017
58f65f1
Update german.lua
DirkyJerky Feb 17, 2017
6f70cb8
Update portuguese.lua
DirkyJerky Feb 17, 2017
52027fb
Update russian.lua
DirkyJerky Feb 17, 2017
15b2986
Update spanish.lua
DirkyJerky Feb 17, 2017
2a8d2e7
Update swedish.lua
DirkyJerky Feb 17, 2017
f26c17a
Update tradchinese.lua
DirkyJerky Feb 17, 2017
02c8481
Trailing space in Traditional Chinese
DirkyJerky Feb 17, 2017
b26df01
Move sort settings to end of settings
DirkyJerky Feb 17, 2017
a5942ae
Dim the highlight
DirkyJerky Feb 17, 2017
745d5ca
Fix & Change to light yellow maybe?
DirkyJerky Feb 17, 2017
b5a00d1
Easter egg (sort by name color)
DirkyJerky Feb 18, 2017
ae9b239
I misspelled the reference
DirkyJerky Feb 19, 2017
ab95202
Lookup table is a lot nicer
DirkyJerky Feb 19, 2017
553f3b4
Refactor; Enable custom sort functions to be made for columns
DirkyJerky Feb 21, 2017
23293d6
Tested addon functionallity
DirkyJerky Feb 22, 2017
98d1b51
Tested color sort
DirkyJerky Feb 22, 2017
d055277
Fixes
DirkyJerky Feb 22, 2017
49d9e8a
Translation suggestion via @markusmarkusz
DirkyJerky Feb 22, 2017
b097d78
Remove settings menu additions
DirkyJerky Feb 26, 2017
8b9902f
r.i.p. color
DirkyJerky Mar 10, 2017
9d2a32b
Boolean cvars are numbers not words
DirkyJerky Mar 10, 2017
e1849a4
Optimization
DirkyJerky Mar 10, 2017
2ac8002
Compare names case insensitively
DirkyJerky Mar 10, 2017
b226ea1
I remember the issue with the optimization now; I fixed that
DirkyJerky Mar 10, 2017
a8d55c9
Unnessesary underscore
DirkyJerky Mar 10, 2017
650381f
"Old" New translation
DirkyJerky Mar 10, 2017
dab25a3
Default to english via suggestion of @Kefta
DirkyJerky Mar 10, 2017
702e38d
Default to english fixed
DirkyJerky Mar 10, 2017
ff9ab8d
Translate german via @ markusmarkusz
DirkyJerky Mar 11, 2017
7d9a8fe
Translate spanish via @ Kefta
DirkyJerky Mar 11, 2017
865151b
Use `GetParent()` x3 instead of refering to the global variable refer…
DirkyJerky Apr 18, 2017
7f51348
Global sboard_sort in sb_main.lua
DirkyJerky Apr 18, 2017
e5ee199
Global sboard_sort in sb_team.lua
DirkyJerky Apr 18, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions garrysmod/gamemodes/terrortown/gamemode/cl_help.lua
Expand Up @@ -144,6 +144,35 @@ function HELPSCRN:Show()

dsettings:AddItem(dlanguage)

--- Scoreboard area

local dsb = vgui.Create("DForm", dsettings)
dsb:SetName(GetTranslation("set_title_sb"))

local dsort = vgui.Create("DComboBox", dsb)
dsort:SetConVar("ttt_scoreboard_sorting")

-- TODO: Enable more choices to be added via hooks for addons
dsort:AddChoice(GetTranslation("equip_spec_name"), "name")
dsort:AddChoice(GetTranslation("col_role"), "role")
dsort:AddChoice(GetTranslation("sb_karma"), "karma")
dsort:AddChoice(GetTranslation("sb_score"), "score")
dsort:AddChoice(GetTranslation("sb_deaths"), "deaths")
dsort:AddChoice(GetTranslation("sb_ping"), "ping")

-- Copy pasta; Dont know why this is needed or if it even is
dsort.OnSelect = function(idx, val, data)
RunConsoleCommand("ttt_scoreboard_sorting", data)
end
dsort.Think = dsort.ConVarStringThink

dsb:Help(GetTranslation("set_sb_sort"))
dsb:AddItem(dsort)

dsb:CheckBox(GetTranslation("set_sb_ascending"), "ttt_scoreboard_ascending")

dsettings:AddItem(dsb)

dtabs:AddSheet(GetTranslation("help_settings"), dsettings, "icon16/wrench.png", false, false, GetTranslation("help_settings_tip"))

hook.Call("TTTSettingsTabs", GAMEMODE, dtabs)
Expand Down
5 changes: 4 additions & 1 deletion garrysmod/gamemodes/terrortown/gamemode/init.lua
Expand Up @@ -57,15 +57,18 @@ include("player_ext_shd.lua")
include("player_ext.lua")
include("player.lua")

-- Round times
CreateConVar("ttt_roundtime_minutes", "10", FCVAR_NOTIFY)
CreateConVar("ttt_preptime_seconds", "30", FCVAR_NOTIFY)
CreateConVar("ttt_posttime_seconds", "30", FCVAR_NOTIFY)
CreateConVar("ttt_firstpreptime", "60")

-- Haste mode
local ttt_haste = CreateConVar("ttt_haste", "1", FCVAR_NOTIFY)
CreateConVar("ttt_haste_starting_minutes", "5", FCVAR_NOTIFY)
CreateConVar("ttt_haste_minutes_per_death", "0.5", FCVAR_NOTIFY)

-- Player Spawning
CreateConVar("ttt_spawn_wave_interval", "0")

CreateConVar("ttt_traitor_pct", "0.25")
Expand All @@ -91,7 +94,7 @@ CreateConVar("ttt_det_credits_starting", "1")
CreateConVar("ttt_det_credits_traitorkill", "0")
CreateConVar("ttt_det_credits_traitordead", "1")


-- Other
CreateConVar("ttt_use_weapon_spawn_scripts", "1")
CreateConVar("ttt_weapon_spawn_count", "0")

Expand Down
7 changes: 7 additions & 0 deletions garrysmod/gamemodes/terrortown/gamemode/lang/english.lua
Expand Up @@ -212,6 +212,8 @@ L.sb_mapchange = "Map changes in {num} rounds or in {time}"
L.sb_mia = "Missing In Action"
L.sb_confirmed = "Confirmed Dead"

L.sb_sortby = "Sort by:"

L.sb_ping = "Ping"
L.sb_deaths = "Deaths"
L.sb_score = "Score"
Expand All @@ -237,6 +239,11 @@ L.help_settings = "Settings"
L.help_settings_tip = "Client-side settings"

-- Settings
L.set_title_sb = "Scoreboard settings"

L.set_sb_sort = "Sort by:"
L.set_sb_ascending = "Ascending order (Uncheck for descending order)"

L.set_title_gui = "Interface settings"

L.set_tips = "Show gameplay tips at the bottom of the screen while spectating"
Expand Down
7 changes: 7 additions & 0 deletions garrysmod/gamemodes/terrortown/gamemode/lang/german.lua
Expand Up @@ -211,6 +211,8 @@ L.sb_mapchange = "Die Karte wechselt in {num} Runden oder in {time}"
L.sb_mia = "Vermisst"
L.sb_confirmed = "Definitiv Tot"

L.sb_sortby = "Sortiere nach:"

L.sb_ping = "Ping"
L.sb_deaths = "Tode"
L.sb_score = "Punkte"
Expand All @@ -236,6 +238,11 @@ L.help_settings = "Einstellungen"
L.help_settings_tip = "Spielerseitige Einstellungen"

-- Settings
L.set_title_sb = "Anzeigereinstellungen"
Copy link
Contributor

Choose a reason for hiding this comment

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

Use “Scoreboard-Einstellungen“.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please upsate this.


L.set_sb_sort = "Sortieren nach:"
L.set_sb_ascending = "Aufsteigende Sortierung (in absteigender Reihenfolge aufheben)"

L.set_title_gui = "Anzeigeeinstellungen"

L.set_tips = "Zeige Tipps zum Spiel während des Zuschauens am unteren Bildschirmrand"
Expand Down
7 changes: 7 additions & 0 deletions garrysmod/gamemodes/terrortown/gamemode/lang/portuguese.lua
Expand Up @@ -212,6 +212,8 @@ L.sb_mapchange = "O mapa mudará em {num} rodadas ou em {time}"
L.sb_mia = "Desaparecidos"
L.sb_confirmed = "Mortes Confirmadas"

L.sb_sortby = "Ordenar por:"

L.sb_ping = "Ping"
L.sb_deaths = "Mortes"
L.sb_score = "Score"
Expand All @@ -237,6 +239,11 @@ L.help_settings = "Configurações"
L.help_settings_tip = "Configurações pessoais"

-- Settings
L.set_title_sb = "Configurações do placar"

L.set_sb_sort = "Ordenar por:"
L.set_sb_ascending = "Ordem crescente (desmarque a ordem decrescente)"

L.set_title_gui = "Configurar interface"

L.set_tips = "Mostrar dicas de jogo enquanto for espectador"
Expand Down
7 changes: 7 additions & 0 deletions garrysmod/gamemodes/terrortown/gamemode/lang/russian.lua
Expand Up @@ -212,6 +212,8 @@ L.sb_mapchange = "Карта сменится через {num} раундов
L.sb_mia = "Пропал без Вести"
L.sb_confirmed = "Убит"

L.sb_sortby = "Сортировать по:"

L.sb_ping = "Пинг"
L.sb_deaths = "Смерти"
L.sb_score = "Счет"
Expand All @@ -236,6 +238,11 @@ L.help_settings = "Настройки"
L.help_settings_tip = "Настройки вашего интерфейса"

-- Settings
L.set_title_sb = "Турнирная таблица настройки"

L.set_sb_sort = "Сортировать по:"
L.set_sb_ascending = "Восходящий порядок (снимите флажок для порядке убывания)"

L.set_title_gui = "Настройки Интерфейса"

L.set_tips = "Показывать подсказки наверху"
Expand Down
7 changes: 7 additions & 0 deletions garrysmod/gamemodes/terrortown/gamemode/lang/spanish.lua
Expand Up @@ -212,6 +212,8 @@ L.sb_mapchange = "El mapa cambia en {num} rondas o {time}"
L.sb_mia = "Perdido en combate"
L.sb_confirmed = "Muerto confirmado"

L.sb_sortby = "Ordenar por:"

L.sb_ping = "Ping"
L.sb_deaths = "Muertes"
L.sb_score = "Punt."
Expand All @@ -237,6 +239,11 @@ L.help_settings = "Ajustes"
L.help_settings_tip = "Ajustes del cliente"

-- Settings
L.set_title_sb = "Ajustes del marcador"

L.set_sb_sort = "Ordenar por:"
L.set_sb_ascending = "Orden ascendente (desmarque la orden descendente)"

L.set_title_gui = "Ajustes de la interfaz"

L.set_tips = "Mostrar consejos en la parte inferior de la pantalla mientras estás de espectador"
Expand Down
7 changes: 7 additions & 0 deletions garrysmod/gamemodes/terrortown/gamemode/lang/swedish.lua
Expand Up @@ -213,6 +213,8 @@ L.sb_mapchange = "Kartan ändras om {num} rundor eller om {time}"
L.sb_mia = "Saknad I Strid"
L.sb_confirmed = "Bekräftad Död"

L.sb_sortby = "Sortera efter:"

L.sb_ping = "Ping"
L.sb_deaths = "Döda"
L.sb_score = "Poäng"
Expand All @@ -238,6 +240,11 @@ L.help_settings = "Inställningar"
L.help_settings_tip = "Klient-inställningar"

-- Settings
L.set_title_sb = "resultattavlan inställningar"

L.set_sb_sort = "Sortera efter:"
L.set_sb_ascending = "Stigande ordning (avmarkera för fallande ordning)"

L.set_title_gui = "Gränssnittsinställningar"

L.set_tips = "Visa spel-tips i nedkanten av skärmen vid åskådning"
Expand Down
7 changes: 7 additions & 0 deletions garrysmod/gamemodes/terrortown/gamemode/lang/tradchinese.lua
Expand Up @@ -212,6 +212,8 @@ L.sb_mapchange = "地圖將於 {num} 個回合或是 {time} 後更換 "
L.sb_mia = "下落不明 "
L.sb_confirmed = "確認死亡 "

L.sb_sortby = "排序方式: "

L.sb_ping = "Ping "
L.sb_deaths = "死亡數 "
L.sb_score = "分數 "
Expand All @@ -237,6 +239,11 @@ L.help_settings = "設定 "
L.help_settings_tip = "客戶端設定 "

-- Settings
L.set_title_sb = "記分板設置 "

L.set_sb_sort = "排序: "
L.set_sb_ascending = "升序(取消選擇降序) "

L.set_title_gui = "介面設置 "

L.set_tips = "旁觀時,在螢幕下方顯示遊戲提示 "
Expand Down