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

Updated deprecated CPanel calls (Continuation & Conclusion) #2194

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,6 @@ function PANEL:AddControl( control, data )

if ( data.default ) then
ctrl:SetDefaultValue( data.default )
elseif ( data.command ) then
local cvar = GetConVar( data.command )
if ( cvar ) then
ctrl:SetDefaultValue( cvar:GetDefault() )
end
end
robotboy655 marked this conversation as resolved.
Show resolved Hide resolved

return ctrl
Expand Down
114 changes: 59 additions & 55 deletions garrysmod/lua/autorun/utilities_menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end

local function ServerSettings( pnl )

pnl:AddControl( "Header", { Description = "#utilities.serversettings" } )
pnl:Help( "#utilities.serversettings" )

local ConVarsDefault = {
hostname = "Garry's Mod",
Expand All @@ -40,36 +40,38 @@ local function ServerSettings( pnl )
g_ragdoll_maxcount = "32",
sv_timeout = "65"
}
pnl:AddControl( "ComboBox", { MenuButton = 1, Folder = "util_server", Options = { [ "#preset.default" ] = ConVarsDefault }, CVars = table.GetKeys( ConVarsDefault ) } )
pnl:ToolPresets( "util_server", ConVarsDefault )

pnl:AddControl( "TextBox", { Label = "#utilities.hostname", Command = "hostname", WaitForEnter = "1" } )
pnl:AddControl( "TextBox", { Label = "#utilities.password", Command = "sv_password", WaitForEnter = "1" } )
pnl:TextEntry( "#utilities.hostname", "hostname" )
pnl:TextEntry( "#utilities.password", "sv_password" )

pnl:AddControl( "CheckBox", { Label = "#utilities.kickerrornum", Command = "sv_kickerrornum" } )
pnl:AddControl( "CheckBox", { Label = "#utilities.allowcslua", Command = "sv_allowcslua" } )
pnl:AddControl( "CheckBox", { Label = "#utilities.sticktoground", Command = "sv_sticktoground", Help = true } )
pnl:AddControl( "CheckBox", { Label = "#utilities.epickupallowed", Command = "sv_playerpickupallowed" } )
pnl:AddControl( "CheckBox", { Label = "#utilities.falldamage", Command = "mp_falldamage" } )
pnl:AddControl( "CheckBox", { Label = "#utilities.gmod_suit", Command = "gmod_suit" } )
pnl:CheckBox( "#utilities.kickerrornum", "sv_kickerrornum" )
pnl:CheckBox( "#utilities.allowcslua", "sv_allowcslua" )
pnl:CheckBox( "#utilities.sticktoground", "sv_sticktoground" )
pnl:ControlHelp( "#utilities.sticktoground.help" )
pnl:CheckBox( "#utilities.epickupallowed", "sv_playerpickupallowed" )
pnl:CheckBox( "#utilities.falldamage", "mp_falldamage" )
pnl:CheckBox( "#utilities.gmod_suit", "gmod_suit" )

-- Fun convars
pnl:AddControl( "Slider", { Label = "#utilities.gravity", Type = "Integer", Command = "sv_gravity", Min = "-500", Max = "1000" } )
pnl:AddControl( "Slider", { Label = "#utilities.friction", Type = "Integer", Command = "sv_friction", Min = "0", Max = "16" } ) -- Float
pnl:AddControl( "Slider", { Label = "#utilities.timescale", Type = "Float", Command = "phys_timescale", Min = "0", Max = "2" } )
pnl:AddControl( "Slider", { Label = "#utilities.deployspeed", Type = "Float", Command = "sv_defaultdeployspeed", Min = "0.1", Max = "10" } )
pnl:AddControl( "Slider", { Label = "#utilities.noclipspeed", Type = "Integer", Command = "sv_noclipspeed", Min = "1", Max = "10" } ) -- Switch this and friction back to Float once Sliders don't reset the convar from 8 to 8.00, etc
pnl:AddControl( "Slider", { Label = "#utilities.maxammo", Type = "Integer", Command = "gmod_maxammo", Min = "0", Max = "9999", Help = true } )
pnl:AddControl( "Slider", { Label = "#utilities.max_ragdolls", Type = "Integer", Command = "g_ragdoll_maxcount", Min = "0", Max = "128" } )
pnl:NumSlider( "#utilities.gravity", "sv_gravity", -500, 1000, 0 )
pnl:NumSlider( "#utilities.friction", "sv_friction", 0, 16, 2 )
pnl:NumSlider( "#utilities.timescale", "phys_timescale", 0, 2, 2 )
pnl:NumSlider( "#utilities.deployspeed", "sv_defaultdeployspeed", 0.1, 10, 2 )
pnl:NumSlider( "#utilities.noclipspeed", "sv_noclipspeed", 1, 10, 2 )
pnl:NumSlider( "#utilities.maxammo", "gmod_maxammo", 0, 9999, 0 )
pnl:ControlHelp( "#utilities.maxammo.help" )
pnl:NumSlider( "#utilities.max_ragdolls", "g_ragdoll_maxcount", 0, 128, 0 )

-- Technical convars
pnl:AddControl( "Slider", { Label = "#utilities.iterations", Type = "Integer", Command = "gmod_physiterations", Min = "1", Max = "10" } )
pnl:AddControl( "Slider", { Label = "#utilities.sv_timeout", Type = "Integer", Command = "sv_timeout", Min = "60", Max = "300" } )
pnl:NumSlider( "#utilities.iterations", "gmod_physiterations", 1, 10, 0 )
pnl:NumSlider( "#utilities.sv_timeout", "sv_timeout", 60, 300, 0 )

end

local function SandboxClientSettings( pnl )

pnl:AddControl( "Header", { Description = "#utilities.sandboxsettings_cl" } )
pnl:Help( "#utilities.sandboxsettings_cl" )

local ConVarsDefault = {
sbox_search_maxresults = "1024",
Expand All @@ -84,12 +86,13 @@ local function SandboxClientSettings( pnl )
cl_showhints = "1",
}

pnl:AddControl( "ComboBox", { MenuButton = 1, Folder = "util_sandbox_cl", Options = { [ "#preset.default" ] = ConVarsDefault }, CVars = table.GetKeys( ConVarsDefault ) } )
pnl:ToolPresets( "util_sandbox_cl", ConVarsDefault )

pnl:AddControl( "Slider", { Label = "#utilities.max_results", Type = "Integer", Command = "sbox_search_maxresults", Min = "1024", Max = "8192", Help = true } )
pnl:NumSlider( "#utilities.max_results", "sbox_search_maxresults", 1024, 8192, 0 )
pnl:ControlHelp( "#utilities.max_results.help" )

local function AddCheckbox( title, cvar )
pnl:AddControl( "CheckBox", { Label = title, Command = cvar } )
pnl:CheckBox( title, cvar )
end

AddCheckbox( "#menubar.drawing.hud", "cl_drawhud" )
Expand All @@ -106,7 +109,7 @@ end

local function SandboxSettings( pnl )

pnl:AddControl( "Header", { Description = "#utilities.sandboxsettings" } )
pnl:Help( "#utilities.sandboxsettings" )

local ConVarsDefault = {
sbox_persist = "",
Expand Down Expand Up @@ -134,33 +137,32 @@ local function SandboxSettings( pnl )
} )
end

pnl:AddControl( "ComboBox", { MenuButton = 1, Folder = "util_sandbox", Options = { [ "#preset.default" ] = ConVarsDefault }, CVars = table.GetKeys( ConVarsDefault ) } )
pnl:ToolPresets( "util_sandbox", ConVarsDefault )

pnl:AddControl( "TextBox", { Label = "#persistent_mode", Command = "sbox_persist", WaitForEnter = "1" } )
pnl:TextEntry( "#persistent_mode", "sbox_persist" )
pnl:ControlHelp( "#persistent_mode.help" ):DockMargin( 16, 4, 16, 8 )

pnl:AddControl( "CheckBox", { Label = "#enable_weapons", Command = "sbox_weapons" } )
pnl:AddControl( "CheckBox", { Label = "#allow_god_mode", Command = "sbox_godmode" } )
pnl:CheckBox( "#enable_weapons", "sbox_weapons" )
pnl:CheckBox( "#allow_god_mode", "sbox_godmode" )

pnl:ControlHelp( "#utilities.mp_only" ):DockMargin( 16, 16, 16, 4 )

pnl:AddControl( "CheckBox", { Label = "#players_damage_players", Command = "sbox_playershurtplayers" } )
pnl:AddControl( "CheckBox", { Label = "#allow_noclip", Command = "sbox_noclip" } )
pnl:CheckBox( "#players_damage_players", "sbox_playershurtplayers" )
pnl:CheckBox( "#allow_noclip", "sbox_noclip" )

pnl:AddControl( "CheckBox", { Label = "#bone_manipulate_npcs", Command = "sbox_bonemanip_npc" } )
pnl:AddControl( "CheckBox", { Label = "#bone_manipulate_players", Command = "sbox_bonemanip_player" } )
pnl:AddControl( "CheckBox", { Label = "#bone_manipulate_others", Command = "sbox_bonemanip_misc" } )
pnl:CheckBox( "#bone_manipulate_npcs", "sbox_bonemanip_npc" )
pnl:CheckBox( "#bone_manipulate_players", "sbox_bonemanip_player" )
pnl:CheckBox( "#bone_manipulate_others", "sbox_bonemanip_misc" )

for id, t in SortedPairsByMemberValue( ConVarsLimits, "label" ) do
local ctrl = pnl:AddControl( "Slider", { Label = t.label, Command = t.command, Min = "0", Max = "200" } )
ctrl:SetHeight( 16 ) -- This makes the controls all bunched up like how we want
pnl:NumSlider( t.label, t.command, 0, 200, 0 ):SetHeight( 16 ) -- This makes the controls all bunched up like how we want
end

end

local function PhysgunSettings( pnl )

pnl:AddControl( "Header", { Description = "#utilities.physgunsettings" } )
pnl:Help( "#utilities.physgunsettings" )

local ConVarsDefault = {
physgun_halo = "1",
Expand All @@ -172,24 +174,24 @@ local function PhysgunSettings( pnl )
physgun_rotation_sensitivity = "0.05",
physgun_wheelspeed = "10"
}
pnl:AddControl( "ComboBox", { MenuButton = 1, Folder = "util_physgun", Options = { [ "#preset.default" ] = ConVarsDefault }, CVars = table.GetKeys( ConVarsDefault ) } )
pnl:ToolPresets( "util_physgun", ConVarsDefault )

pnl:AddControl( "CheckBox", { Label = "#utilities.physgun_halo", Command = "physgun_halo" } )
pnl:AddControl( "CheckBox", { Label = "#utilities.physgun_drawbeams", Command = "physgun_drawbeams" } )
pnl:AddControl( "CheckBox", { Label = "#menubar.drawing.freeze", Command = "effects_freeze" } )
pnl:AddControl( "CheckBox", { Label = "#menubar.drawing.unfreeze", Command = "effects_unfreeze" } )
pnl:CheckBox( "#utilities.physgun_halo", "physgun_halo" )
pnl:CheckBox( "#utilities.physgun_drawbeams", "physgun_drawbeams" )
pnl:CheckBox( "#menubar.drawing.freeze", "effects_freeze" )
pnl:CheckBox( "#menubar.drawing.unfreeze", "effects_unfreeze" )

pnl:AddControl( "Slider", { Label = "#utilities.gm_snapgrid", Type = "Integer", Command = "gm_snapgrid", Min = "0", Max = "128" } )
pnl:AddControl( "Slider", { Label = "#utilities.gm_snapangles", Type = "Integer", Command = "gm_snapangles", Min = "5", Max = "90" } )
pnl:NumSlider( "#utilities.gm_snapgrid", "gm_snapgrid", 0, 128, 0 )
pnl:NumSlider( "#utilities.gm_snapangles", "gm_snapangles", 5, 90, 0 )

pnl:AddControl( "Slider", { Label = "#utilities.physgun_rotation_sensitivity", Type = "Float", Command = "physgun_rotation_sensitivity", Min = "0.01", Max = "1" } )
pnl:AddControl( "Slider", { Label = "#utilities.physgun_wheelspeed", Type = "Integer", Command = "physgun_wheelspeed", Min = "0", Max = "50" } )
pnl:NumSlider( "#utilities.physgun_rotation_sensitivity", "physgun_rotation_sensitivity", 0.01, 1, 2 )
pnl:NumSlider( "#utilities.physgun_wheelspeed", "physgun_wheelspeed", 0, 50, 0 )

end

local function PhysgunSVSettings( pnl )

pnl:AddControl( "Header", { Description = "#utilities.physgunsvsettings" } )
pnl:Help( "#utilities.physgunsvsettings" )

local ConVarsDefault = {
physgun_limited = "0",
Expand All @@ -200,22 +202,24 @@ local function PhysgunSVSettings( pnl )
physgun_timeToArrive = "0.05",
physgun_timeToArriveRagdoll = "0.1"
}
pnl:AddControl( "ComboBox", { MenuButton = 1, Folder = "util_physgun_sv", Options = { [ "#preset.default" ] = ConVarsDefault }, CVars = table.GetKeys( ConVarsDefault ) } )
pnl:ToolPresets( "util_physgun_sv", ConVarsDefault )

pnl:AddControl( "CheckBox", { Label = "#utilities.physgun_limited", Command = "physgun_limited", Help = true } )
pnl:CheckBox( "#utilities.physgun_limited", "physgun_limited" )
pnl:ControlHelp( "#utilities.physgun_limited.help" )

pnl:AddControl( "Slider", { Label = "#utilities.physgun_maxrange", Type = "Integer", Command = "physgun_maxrange", Min = "128", Max = "8192" } )
pnl:AddControl( "Slider", { Label = "#utilities.physgun_tpdist", Type = "Integer", Command = "physgun_teleportdistance", Min = "0", Max = "10000" } )
pnl:AddControl( "Slider", { Label = "#utilities.physgun_maxspeed", Type = "Integer", Command = "physgun_maxspeed", Min = "0", Max = "10000" } )
pnl:AddControl( "Slider", { Label = "#utilities.physgun_maxangular", Type = "Integer", Command = "physgun_maxangular", Min = "0", Max = "10000" } )
pnl:AddControl( "Slider", { Label = "#utilities.physgun_timetoarrive", Type = "Float", Command = "physgun_timetoarrive", Min = "0", Max = "2" } )
pnl:AddControl( "Slider", { Label = "#utilities.physgun_timetoarriveragdoll", Type = "Float", Command = "physgun_timetoarriveragdoll", Min = "0", Max = "2", Help = true } )
pnl:NumSlider( "#utilities.physgun_maxrange", "physgun_maxrange", 128, 8192, 0 )
pnl:NumSlider( "#utilities.physgun_tpdist", "physgun_teleportdistance", 0, 10000, 0 )
pnl:NumSlider( "#utilities.physgun_maxspeed", "physgun_maxspeed", 0, 10000, 0 )
pnl:NumSlider( "#utilities.physgun_maxangular", "physgun_maxangular", 0, 10000, 0 )
pnl:NumSlider( "#utilities.physgun_timetoarrive", "physgun_timetoarrive", 0, 2, 2 )
pnl:NumSlider( "#utilities.physgun_timetoarriveragdoll", "physgun_timetoarriveragdoll", 0, 2, 2 )
pnl:ControlHelp( "#utilities.physgun_timetoarriveragdoll.help" )

end

local function PlayerOptions( pnl )

pnl:AddControl( "Header", { Description = "#smwidget.playermodel_title" } )
pnl:Help( "#smwidget.playermodel_title" )

pnl:Button( "#smwidget.playermodel_title", "open_playermodel_selector" )

Expand Down
4 changes: 2 additions & 2 deletions garrysmod/lua/includes/modules/cleanup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ else
local Panel = controlpanel.Get( "User_Cleanup" )
if ( IsValid( Panel ) ) then
Panel:Clear()
Panel:AddControl( "Header", { Description = "#spawnmenu.utilities.cleanup.help" } )
Panel:Help( "#spawnmenu.utilities.cleanup.help" )
Panel:Button( "#CleanupAll", "gmod_cleanup" )

for key, val in SortedPairs( cleanup_types_s ) do
Expand All @@ -226,7 +226,7 @@ else
local AdminPanel = controlpanel.Get( "Admin_Cleanup" )
if ( IsValid( AdminPanel ) ) then
AdminPanel:Clear()
AdminPanel:AddControl( "Header", { Description = "#spawnmenu.utilities.cleanup.help" } )
AdminPanel:Help( "#spawnmenu.utilities.cleanup.help" )
AdminPanel:Button( "#CleanupAll", "gmod_admin_cleanup" )

for key, val in SortedPairs( cleanup_types_s ) do
Expand Down
2 changes: 1 addition & 1 deletion garrysmod/lua/includes/modules/undo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if ( CLIENT ) then
if ( !IsValid( Panel ) ) then return end

Panel:Clear()
Panel:AddControl( "Header", { Description = "#spawnmenu.utilities.undo.help" } )
Panel:Help( "#spawnmenu.utilities.undo.help" )

local ComboBox = Panel:ListBox()
ComboBox:SetTall( 500 )
Expand Down
24 changes: 11 additions & 13 deletions garrysmod/lua/postprocess/bloom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ list.Set( "PostProcess", "#bloom_pp", {

cpanel = function( CPanel )

CPanel:AddControl( "Header", { Description = "#bloom_pp.desc" } )
CPanel:AddControl( "CheckBox", { Label = "#bloom_pp.enable", Command = "pp_bloom" } )
CPanel:Help( "#bloom_pp.desc" )
CPanel:CheckBox( "#bloom_pp.enable", "pp_bloom" )

local params = { Options = {}, CVars = {}, MenuButton = "1", Folder = "bloom" }
params.Options[ "#preset.default" ] = {
local options = {
pp_bloom_passes = "4",
pp_bloom_darken = "0.65",
pp_bloom_multiply = "1.0",
Expand All @@ -96,17 +95,16 @@ list.Set( "PostProcess", "#bloom_pp", {
pp_bloom_color_g = "255",
pp_bloom_color_b = "255"
}
params.CVars = table.GetKeys( params.Options[ "#preset.default" ] )
CPanel:AddControl( "ComboBox", params )
CPanel:ToolPresets( "bloom", options )

CPanel:AddControl( "Slider", { Label = "#bloom_pp.passes", Command = "pp_bloom_passes", Type = "Integer", Min = "0", Max = "30" } )
CPanel:AddControl( "Slider", { Label = "#bloom_pp.darken", Command = "pp_bloom_darken", Type = "Float", Min = "0", Max = "1" } )
CPanel:AddControl( "Slider", { Label = "#bloom_pp.multiply", Command = "pp_bloom_multiply", Type = "Float", Min = "0", Max = "5" } )
CPanel:AddControl( "Slider", { Label = "#bloom_pp.blurx", Command = "pp_bloom_sizex", Type = "Float", Min = "0", Max = "50" } )
CPanel:AddControl( "Slider", { Label = "#bloom_pp.blury", Command = "pp_bloom_sizey", Type = "Float", Min = "0", Max = "50" } )
CPanel:AddControl( "Slider", { Label = "#bloom_pp.multiplier", Command = "pp_bloom_color", Type = "Float", Min = "0", Max = "20" } )
CPanel:NumSlider( "#bloom_pp.passes", "pp_bloom_passes", 0, 30, 0 )
CPanel:NumSlider( "#bloom_pp.darken", "pp_bloom_darken", 0, 1, 2 )
CPanel:NumSlider( "#bloom_pp.multiply", "pp_bloom_multiply", 0, 5, 2 )
CPanel:NumSlider( "#bloom_pp.blurx", "pp_bloom_sizex", 0, 50, 2 )
CPanel:NumSlider( "#bloom_pp.blury", "pp_bloom_sizey", 0, 50, 2 )
CPanel:NumSlider( "#bloom_pp.multiplier", "pp_bloom_color", 0, 20, 2 )

CPanel:AddControl( "Color", { Label = "#bloom_pp.color", Red = "pp_bloom_color_r", Green = "pp_bloom_color_g", Blue = "pp_bloom_color_b", ShowAlpha = "0", ShowHSV = "1", ShowRGB = "1" } )
CPanel:ColorPicker( "#bloom_pp.color", "pp_bloom_color_r", "pp_bloom_color_g", "pp_bloom_color_b" )

end

Expand Down
39 changes: 24 additions & 15 deletions garrysmod/lua/postprocess/color_modify.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,30 @@ list.Set( "PostProcess", "#colormod_pp", {

cpanel = function( CPanel )

CPanel:AddControl( "Header", { Description = "#colormod_pp.desc" } )
CPanel:AddControl( "CheckBox", { Label = "#colormod_pp.enable", Command = "pp_colormod" } )

local params = { Options = {}, CVars = {}, MenuButton = "1", Folder = "colormod" }
params.Options[ "#preset.default" ] = { pp_colormod_addr = "0", pp_colormod_addg = "0", pp_colormod_addb = "0", pp_colormod_brightness = "0", pp_colormod_contrast = "1", pp_colormod_color = "1", pp_colormod_mulr = "0", pp_colormod_mulg = "0", pp_colormod_mulb = "0", pp_colormod_inv = "0" }
params.CVars = table.GetKeys( params.Options[ "#preset.default" ] )
CPanel:AddControl( "ComboBox", params )

CPanel:AddControl( "Slider", { Label = "#colormod_pp.brightness", Command = "pp_colormod_brightness", Type = "Float", Min = "-2", Max = "2" } )
CPanel:AddControl( "Slider", { Label = "#colormod_pp.contrast", Command = "pp_colormod_contrast", Type = "Float", Min = "0", Max = "10" } )
CPanel:AddControl( "Slider", { Label = "#colormod_pp.color", Command = "pp_colormod_color", Type = "Float", Min = "0", Max = "5" } )
CPanel:AddControl( "Slider", { Label = "#colormod_pp.invert", Command = "pp_colormod_inv", Type = "Float", Min = "0", Max = "1" } )

CPanel:AddControl( "Color", { Label = "#colormod_pp.color_add", Red = "pp_colormod_addr", Green = "pp_colormod_addg", Blue = "pp_colormod_addb", ShowAlpha = "0", ShowHSV = "1", ShowRGB = "1" } )
CPanel:AddControl( "Color", { Label = "#colormod_pp.color_multiply", Red = "pp_colormod_mulr", Green = "pp_colormod_mulg", Blue = "pp_colormod_mulb", ShowAlpha = "0", ShowHSV = "1", ShowRGB = "1" } )
CPanel:Help( "#colormod_pp.desc" )
CPanel:CheckBox( "#colormod_pp.enable", "pp_colormod" )

local options = {
pp_colormod_addr = "0",
pp_colormod_addg = "0",
pp_colormod_addb = "0",
pp_colormod_brightness = "0",
pp_colormod_contrast = "1",
pp_colormod_color = "1",
pp_colormod_mulr = "0",
pp_colormod_mulg = "0",
pp_colormod_mulb = "0",
pp_colormod_inv = "0"
}
CPanel:ToolPresets( "colormod", options )

CPanel:NumSlider( "#colormod_pp.brightness", "pp_colormod_brightness", -2, 2, 2 )
CPanel:NumSlider( "#colormod_pp.contrast", "pp_colormod_contrast", 0, 10, 2 )
CPanel:NumSlider( "#colormod_pp.color", "pp_colormod_color", 0, 5, 2 )
CPanel:NumSlider( "#colormod_pp.invert", "pp_colormod_inv", 0, 1, 2 )

CPanel:ColorPicker( "#colormod_pp.color_add", "pp_colormod_addr", "pp_colormod_addg", "pp_colormod_addb" )
CPanel:ColorPicker( "#colormod_pp.color_multiply", "pp_colormod_mulr", "pp_colormod_mulg", "pp_colormod_mulb" )

end

Expand Down
13 changes: 5 additions & 8 deletions garrysmod/lua/postprocess/dof.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,13 @@ list.Set( "PostProcess", "#dof_pp", {

cpanel = function( CPanel )

CPanel:AddControl( "Header", { Description = "#dof_pp.desc" } )
CPanel:AddControl( "CheckBox", { Label = "#dof_pp.enable", Command = "pp_dof" } )
CPanel:Help( "#dof_pp.desc" )
CPanel:CheckBox( "#dof_pp.enable", "pp_dof" )

local params = { Options = {}, CVars = {}, MenuButton = "1", Folder = "dof" }
params.Options[ "#preset.default" ] = { pp_dof_initlength = "256", pp_dof_spacing = "512" }
params.CVars = table.GetKeys( params.Options[ "#preset.default" ] )
CPanel:AddControl( "ComboBox", params )
CPanel:ToolPresets( "dof", { pp_dof_initlength = "256", pp_dof_spacing = "512" } )

CPanel:AddControl( "Slider", { Label = "#dof_pp.spacing", Command = "pp_dof_spacing", Type = "Float", Min = "8", Max = "1024" } )
CPanel:AddControl( "Slider", { Label = "#dof_pp.start_distance", Command = "pp_dof_initlength", Type = "Float", Min = "9", Max = "1024" } )
CPanel:NumSlider( "#dof_pp.spacing", "pp_dof_spacing", 8, 1024, 2 )
CPanel:NumSlider( "#dof_pp.start_distance", "pp_dof_initlength", 9, 1024, 2 )

end

Expand Down
Loading