Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
|
1c19c0b76b | |
|
480ebac511 | |
|
668912c514 | |
|
60f00fea8d | |
|
4a2c4ccece | |
|
01cb84ab17 |
|
@ -5,7 +5,7 @@ Implements a very minimal but flexible menu for playing taunts while playing Pro
|
||||||
|
|
||||||
## Installation via Workshop
|
## Installation via Workshop
|
||||||
|
|
||||||
This addon will be available via the Steam Workshop.
|
This addon is available for installation on the Steam Workshop [here](http://steamcommunity.com/sharedfiles/filedetails/?id=431297319). Installing it via the workshop will allow you to automatically stay up-to-date.
|
||||||
If you want to install it on your client, subscribe to it with the green Subscribe button. It will be automatically updated appropriately.
|
If you want to install it on your client, subscribe to it with the green Subscribe button. It will be automatically updated appropriately.
|
||||||
If you want to install it on your server, you can add the addon to a collection and use the collection with your server. More info regarding this can be looked up [here](http://wiki.garrysmod.com/page/Workshop_for_Dedicated_Servers).
|
If you want to install it on your server, you can add the addon to a collection and use the collection with your server. More info regarding this can be looked up [here](http://wiki.garrysmod.com/page/Workshop_for_Dedicated_Servers).
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,6 @@ local function Apply(menu, taunts)
|
||||||
return string.lower(a.key) < string.lower(b.key)
|
return string.lower(a.key) < string.lower(b.key)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
menu:AddSpacer()
|
|
||||||
|
|
||||||
-- sort categories
|
-- sort categories
|
||||||
local categories = {}
|
local categories = {}
|
||||||
for key,value in pairs(taunts.categories) do
|
for key,value in pairs(taunts.categories) do
|
||||||
|
@ -77,6 +75,8 @@ local function Apply(menu, taunts)
|
||||||
Apply(menu:AddSubMenu(item.key), item.value)
|
Apply(menu:AddSubMenu(item.key), item.value)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
menu:AddSpacer()
|
||||||
|
|
||||||
-- add sounds to the menu
|
-- add sounds to the menu
|
||||||
for _, item in pairs(sounds) do
|
for _, item in pairs(sounds) do
|
||||||
menu:AddOption(item.key, function()
|
menu:AddOption(item.key, function()
|
||||||
|
|
|
@ -36,7 +36,7 @@ local fixedNames = {
|
||||||
["taunts/ill_be_back.wav"] = "I'll be back",
|
["taunts/ill_be_back.wav"] = "I'll be back",
|
||||||
["taunts/negative.wav"] = "Counter-Strike - Negative",
|
["taunts/negative.wav"] = "Counter-Strike - Negative",
|
||||||
["taunts/doh.wav"] = "Simpsons - D'oh!",
|
["taunts/doh.wav"] = "Simpsons - D'oh!",
|
||||||
["taunts/oh_yea_he_will_pay.wav"] = "You will definitely pay",
|
["taunts/oh_yea_he_will_pay.wav"] = "Counter-Strike - He will definitely pay",
|
||||||
["taunts/ok_i_will_tell_you.wav"] = "Muffin man",
|
["taunts/ok_i_will_tell_you.wav"] = "Muffin man",
|
||||||
["taunts/please_come_again.wav"] = "Please come again",
|
["taunts/please_come_again.wav"] = "Please come again",
|
||||||
["taunts/threat_neutralized.wav"] = "Counter-Strike - Threat neutralized!",
|
["taunts/threat_neutralized.wav"] = "Counter-Strike - Threat neutralized!",
|
||||||
|
@ -150,11 +150,46 @@ end
|
||||||
|
|
||||||
-- Detect changes in the taunt list
|
-- Detect changes in the taunt list
|
||||||
hook.Add("Think", "TauntList_DetectUpdate", function()
|
hook.Add("Think", "TauntList_DetectUpdate", function()
|
||||||
|
-- If we don't have Tauntpack loader installed, we only have the global taunt tables used by Prop Hunt itself.
|
||||||
|
if (GAMEMODE.Hunter_Taunts == nil) or (GAMEMODE.Prop_Taunts == nil) then
|
||||||
|
if (tauntsTable[TEAM_HUNTERS] ~= HUNTER_TAUNTS)
|
||||||
|
or (tauntsTable[TEAM_PROPS] ~= PROP_TAUNTS) then
|
||||||
|
tauntsTable= {}
|
||||||
|
tauntsFixedTable= {}
|
||||||
|
|
||||||
|
-- Replace some of the names with fixed names since Tauntpack Loader
|
||||||
|
-- just uses the file path for them which will look ugly on the UI
|
||||||
|
tauntsTable[TEAM_HUNTERS] = HUNTER_TAUNTS
|
||||||
|
tauntsFixedTable[TEAM_HUNTERS] = {}
|
||||||
|
for index, path in pairs(HUNTER_TAUNTS) do
|
||||||
|
if file.Exists("sound/" .. path, "GAME") then
|
||||||
|
tauntsFixedTable[TEAM_HUNTERS][index] = { path, FixName(path) }
|
||||||
|
else
|
||||||
|
print("[PH Taunt Menu] Taunt not found, not added to menu: " .. path)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
tauntsTable[TEAM_PROPS] = PROP_TAUNTS
|
||||||
|
tauntsFixedTable[TEAM_PROPS] = {}
|
||||||
|
for index, path in pairs(PROP_TAUNTS) do
|
||||||
|
if file.Exists("sound/" .. path, "GAME") then
|
||||||
|
tauntsFixedTable[TEAM_PROPS][index] = { path, FixName(path) }
|
||||||
|
else
|
||||||
|
print("[PH Taunt Menu] Taunt not found, not added to menu: " .. path)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Tables that hold sound paths, see Prop Hunt, sh_config.lua:70-168
|
||||||
|
tauntPathsTable[TEAM_HUNTERS] = HUNTER_TAUNTS
|
||||||
|
tauntPathsTable[TEAM_PROPS] = PROP_TAUNTS
|
||||||
|
|
||||||
|
BroadcastUpdate()
|
||||||
|
end
|
||||||
|
|
||||||
-- Tauntpack loader replaces the old table with a new instance whenever it reloads the taunts.
|
-- Tauntpack loader replaces the old table with a new instance whenever it reloads the taunts.
|
||||||
-- This means we can use reference equality to detect changes quickly here.
|
-- This means we can use reference equality to detect changes quickly here.
|
||||||
-- For reference see sv_ph_tauntpack_loader.lua:55-56
|
-- For reference see sv_ph_tauntpack_loader.lua:55-56
|
||||||
if (GAMEMODE.Hunter_Taunts == nil) or (GAMEMODE.Prop_Taunts == nil) then return end
|
elseif (tauntsTable[TEAM_HUNTERS] ~= GAMEMODE.Hunter_Taunts)
|
||||||
if (tauntsTable[TEAM_HUNTERS] ~= GAMEMODE.Hunter_Taunts)
|
|
||||||
or (tauntsTable[TEAM_PROPS] ~= GAMEMODE.Prop_Taunts) then
|
or (tauntsTable[TEAM_PROPS] ~= GAMEMODE.Prop_Taunts) then
|
||||||
|
|
||||||
tauntsTable= {}
|
tauntsTable= {}
|
||||||
|
|
Loading…
Reference in New Issue