Skip to content

Commit ad8a6b9

Browse files
author
googer
committed
feat: soundpacks
1 parent ff13009 commit ad8a6b9

File tree

20 files changed

+58
-4
lines changed

20 files changed

+58
-4
lines changed

data_static/gwater2/locale/gwater2_en.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,16 @@ gwater2_adminonly (0-1)
11491149
IN CONSOLE
11501150
]]
11511151

1152+
"gwater2.menu.Menu.soundpack"=[[
1153+
Menu Soundpack
1154+
]]
1155+
1156+
"gwater2.menu.Menu.soundpack.desc"=[[
1157+
Selects menu soundpack - sounds that play when you interact with menu.
1158+
]]
1159+
11521160
------------------------
1153-
-------- РАЗНОЕ --------
1161+
--------- MISC ---------
11541162
------------------------
11551163

11561164
"gwater2.menu.Fluid Preview.title"=[[

data_static/gwater2/locale/gwater2_ru.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,12 +1145,21 @@ gwater2_adminonly (0-1)
11451145
В КОНСОЛИ
11461146
]]
11471147

1148+
"gwater2.menu.Menu.soundpack"=[[
1149+
Пак Звуков Меню
1150+
]]
1151+
1152+
"gwater2.menu.Menu.soundpack.desc"=[[
1153+
Выбирает пак звуков меню - звуки которые играют когда вы взаимодействуете с меню.
1154+
]]
1155+
1156+
11481157
------------------------
11491158
-------- РАЗНОЕ --------
11501159
------------------------
11511160

11521161
"gwater2.menu.Fluid Preview.title"=[[
1153-
Предпросмотр жидкости
1162+
Предпросмотр
11541163
]]
11551164

11561165
"gwater2.menu.Explanation Area.title"=[[

lua/gwater2_menu.lua

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ local function create_menu(init)
480480
end
481481
})
482482

483-
if LocalPlayer():IsSuperAdmin() then
483+
if LocalPlayer():IsListenServerHost() then
484484
_util.make_parameter_check(tab, "Menu.admin_only", "Admin Only", {
485485
nosync=true,
486486
func=function(val)
@@ -494,6 +494,39 @@ local function create_menu(init)
494494
end
495495
})
496496
end
497+
498+
local soundpacks = {
499+
[1] = "default", ["default"] = 1
500+
}
501+
502+
for _, pack in ipairs(select(-1, file.Find("sound/gwater2/menu/packs/*", "GAME"))) do
503+
if pack == "default" then continue end
504+
soundpacks[#soundpacks+1] = pack
505+
soundpacks[pack] = #soundpacks
506+
end
507+
local _soundpack_label
508+
_util.make_parameter_scratch(tab, "Menu.soundpack", "Sound Pack", {
509+
nosync=true,
510+
func=function(val)
511+
gwater2.options.write_config({["menusp"]=soundpacks[val] or "default"})
512+
_soundpack_label:SetText(soundpacks[val] or "default")
513+
return true
514+
end,
515+
setup=function(slider)
516+
slider:GetParent().button:Remove()
517+
local label = slider:GetParent():Add("DLabel")
518+
slider:GetParent().dlabel = label
519+
_soundpack_label = label
520+
label:Dock(BOTTOM)
521+
label:SetText(gwater2.options.read_config().menusp)
522+
label:SetFont("GWater2Text")
523+
slider:GetParent():SetTall(slider:GetParent():GetTall() * 2)
524+
slider:SetValue(soundpacks[gwater2.options.read_config().menusp])
525+
return true
526+
end,
527+
min=1,
528+
max=#soundpacks
529+
})
497530
end
498531

499532
tabs.help_text = help_text

lua/menu/gwater2_util.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ local _styling = include("menu/gwater2_styling.lua")
3333

3434
local function emit_sound(type)
3535
if not gwater2.options.read_config().sounds then return end
36-
surface.PlaySound("gwater2/menu/"..type..".wav")
36+
surface.PlaySound("gwater2/menu/packs/"..(gwater2.options.read_config().menusp or "default").."/"..type..".wav")
3737
end
3838

3939
local function set_gwater_parameter(option, val, ply)
26.2 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Valve - all of HL2 sounds
2+
dukeofthechickens - making the soundpack
35.1 KB
Binary file not shown.
31.5 KB
Binary file not shown.
23.6 KB
Binary file not shown.
Binary file not shown.
25.1 KB
Binary file not shown.
39.8 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Valve - all of HL:A sounds
2+
googer - making the soundpack

0 commit comments

Comments
 (0)