forked from TeamUlysses/ulx
Merge pull request #220 from TeamUlysses/feature/settings-improvements
XGUI settings fixes and improvements
This commit is contained in:
commit
edc002d27c
@ -3,10 +3,18 @@
|
||||
## v3.81 - *(00/00/0000)*
|
||||
* [ADD] Added chat commands to both banid and unban. (Thanks, TheByKotik)
|
||||
* [ADD] Added convar (ulx_motdDisabledMessage <0/1>) to disable the MOTD Disabled on server message if desired.
|
||||
* [ADD] XGUI: Support new sandbox and server settings in the Server and Sandbox settings tabs, removed deprecated settings.
|
||||
* [FIX] Recipient filter was not being used with vote confirmations. (Thanks, plally)
|
||||
* [FIX] ulx resettodefaults will now also reset bans and users in SQLite.
|
||||
* [FIX] Changed how the eye trace on the player for teleport is calculated to make it more accurate.
|
||||
* [FIX] On listen servers, using the slider on some gmod server settings would cause the setting to constantly jump around.
|
||||
* [FIX] XGUI: "Keep AI Ragdoll" setting replaced with "Keep Corpses", which should work now.
|
||||
* [FIX] XGUI: Sandbox "Persist" setting now supports setting the persistence file name.
|
||||
* [FIX] XLIB: Alpha slider bar no longer saves decimal, no longer backwards while typing in a value.
|
||||
* [CHANGE] Exposed ragdoll and unragdoll functions to the ulx table so they can be called externally. (Thanks, brandonsturgeon)
|
||||
* [CHANGE] XGUI: Update sandbox limit definitions and slider maximums, removed deprecated limits.
|
||||
* [ADD] XLIB: New helper element "Scrollable panel".
|
||||
* [ADD] XLIB: Some helper elements now suport DOCK layout.
|
||||
|
||||
## v3.80 - *(08/04/2022)*
|
||||
* [CHANGE] Muted players can no longer use psay (thanks, PixeLInc).
|
||||
|
@ -207,28 +207,27 @@ Not yet, I'm being attacked by an... OH CRAP!
|
||||
files["sbox_limits.txt"] =
|
||||
[[;The number by each cvar indicates the maximum value for the slider in XGUI.
|
||||
|Sandbox
|
||||
sbox_maxballoons 100
|
||||
sbox_maxballoons 200
|
||||
sbox_maxbuttons 200
|
||||
sbox_maxdynamite 75
|
||||
sbox_maxcameras 200
|
||||
sbox_maxdynamite 200
|
||||
sbox_maxeffects 200
|
||||
sbox_maxemitters 100
|
||||
sbox_maxemitters 200
|
||||
sbox_maxhoverballs 200
|
||||
sbox_maxlamps 50
|
||||
sbox_maxlights 50
|
||||
sbox_maxnpcs 50
|
||||
sbox_maxlamps 200
|
||||
sbox_maxlights 200
|
||||
sbox_maxnpcs 200
|
||||
sbox_maxprops 1000
|
||||
sbox_maxragdolls 50
|
||||
sbox_maxragdolls 200
|
||||
sbox_maxsents 1024
|
||||
sbox_maxspawners 50
|
||||
sbox_maxthrusters 200
|
||||
sbox_maxturrets 50
|
||||
sbox_maxvehicles 50
|
||||
sbox_maxturrets 200
|
||||
sbox_maxvehicles 200
|
||||
sbox_maxwheels 200
|
||||
|Other
|
||||
sbox_maxdoors 100
|
||||
sbox_maxhoverboards 10
|
||||
sbox_maxkeypads 100
|
||||
sbox_maxwire_keypads 100
|
||||
sbox_maxpylons 100
|
||||
|Wire
|
||||
sbox_maxwire_addressbuss 100
|
||||
@ -239,6 +238,7 @@ sbox_maxwire_cameracontrollers 100
|
||||
sbox_maxwire_cd_disks 100
|
||||
sbox_maxwire_cd_locks 100
|
||||
sbox_maxwire_cd_rays 100
|
||||
sbox_maxwire_characterlcds 10
|
||||
sbox_maxwire_clutchs 10
|
||||
sbox_maxwire_colorers 100
|
||||
sbox_maxwire_consolescreens 100
|
||||
@ -247,6 +247,8 @@ sbox_maxwire_damage_detectors 50
|
||||
sbox_maxwire_data_satellitedishs 100
|
||||
sbox_maxwire_data_stores 100
|
||||
sbox_maxwire_data_transferers 100
|
||||
sbox_maxwire_data_Wireless_recv 10
|
||||
sbox_maxwire_data_Wireless_srv 10
|
||||
sbox_maxwire_dataplugs 100
|
||||
sbox_maxwire_dataports 100
|
||||
sbox_maxwire_datarates 100
|
||||
@ -255,8 +257,11 @@ sbox_maxwire_deployers 5
|
||||
sbox_maxwire_detonators 100
|
||||
sbox_maxwire_dhdds 100
|
||||
sbox_maxwire_digitalscreens 100
|
||||
sbox_maxwire_door_controllers 50
|
||||
sbox_maxwire_dual_inputs 100
|
||||
sbox_maxwire_dupeports 50
|
||||
sbox_maxwire_dynamic_buttons 100
|
||||
sbox_maxwire_dynmemorys 50
|
||||
sbox_maxwire_egps 10
|
||||
sbox_maxwire_emarkers 30
|
||||
sbox_maxwire_exit_points 10
|
||||
@ -264,8 +269,10 @@ sbox_maxwire_explosives 50
|
||||
sbox_maxwire_expressions 100
|
||||
sbox_maxwire_extbuss 100
|
||||
sbox_maxwire_eyepods 15
|
||||
sbox_maxwire_field_device 50
|
||||
sbox_maxwire_forcers 100
|
||||
sbox_maxwire_freezers 50
|
||||
sbox_maxwire_friendslists 10
|
||||
sbox_maxwire_fx_emitters 100
|
||||
sbox_maxwire_gate_angles 30
|
||||
sbox_maxwire_gate_arithmetics 30
|
||||
@ -285,6 +292,7 @@ sbox_maxwire_gates 30
|
||||
sbox_maxwire_gimbals 10
|
||||
sbox_maxwire_gpss 50
|
||||
sbox_maxwire_gpus 10
|
||||
sbox_maxwire_gpulib_controllers 10
|
||||
sbox_maxwire_grabbers 100
|
||||
sbox_maxwire_graphics_tablets 100
|
||||
sbox_maxwire_gyroscopes 50
|
||||
@ -293,45 +301,71 @@ sbox_maxwire_holoemitters 50
|
||||
sbox_maxwire_hologrids 100
|
||||
sbox_maxwire_hoverballs 30
|
||||
sbox_maxwire_hoverdrivecontrolers 5
|
||||
sbox_maxwire_hsholoemitters 10
|
||||
sbox_maxwire_hsrangers 50
|
||||
sbox_maxwire_hudindicators 100
|
||||
sbox_maxwire_hydraulics 16
|
||||
sbox_maxwire_igniters 100
|
||||
sbox_maxwire_indicators 100
|
||||
sbox_maxwire_inputs 100
|
||||
sbox_maxwire_interactiveprops 100
|
||||
sbox_maxwire_keyboards 100
|
||||
sbox_maxwire_keypads 50
|
||||
sbox_maxwire_keycardreaders 50
|
||||
sbox_maxwire_keycardspawners 50
|
||||
sbox_maxwire_keypads 100
|
||||
sbox_maxwire_lamps 50
|
||||
sbox_maxwire_las_receivers 100
|
||||
sbox_maxwire_latchs 15
|
||||
sbox_maxwire_levers 50
|
||||
sbox_maxwire_lights 10
|
||||
sbox_maxwire_locators 30
|
||||
sbox_maxwire_magnets 50
|
||||
sbox_maxwire_materializers 50
|
||||
sbox_maxwire_microphones 25
|
||||
sbox_maxwire_modular_panels 50
|
||||
sbox_maxwire_motors 50
|
||||
sbox_maxwire_nailers 100
|
||||
sbox_maxwire_numpads 100
|
||||
sbox_maxwire_oscilloscopes 100
|
||||
sbox_maxwire_oscilloscopes 50
|
||||
sbox_maxwire_outputs 50
|
||||
sbox_maxwire_painters 50
|
||||
sbox_maxwire_pixels 100
|
||||
sbox_maxwire_plugs 100
|
||||
sbox_maxwire_pods 100
|
||||
sbox_maxwire_radios 100
|
||||
sbox_maxwire_ramcardreaders 50
|
||||
sbox_maxwire_ramcardspawners 50
|
||||
sbox_maxwire_rangers 50
|
||||
sbox_maxwire_relays 100
|
||||
sbox_maxwire_rfid_filters 50
|
||||
sbox_maxwire_rfid_implanters 50
|
||||
sbox_maxwire_rfid_reader_acts 50
|
||||
sbox_maxwire_rfid_reader_beams 50
|
||||
sbox_maxwire_rfid_reader_proxs 50
|
||||
sbox_maxwire_rt_cameras 25
|
||||
sbox_maxwire_rt_screens 25
|
||||
sbox_maxwire_screens 100
|
||||
sbox_maxwire_sensors 100
|
||||
sbox_maxwire_servos 50
|
||||
sbox_maxwire_simple_explosives 100
|
||||
sbox_maxwire_simple_servos 50
|
||||
sbox_maxwire_sockets 100
|
||||
sbox_maxwire_soundemitters 50
|
||||
sbox_maxwire_spawners 50
|
||||
sbox_maxwire_speedometers 50
|
||||
sbox_maxwire_spus 10
|
||||
sbox_maxwire_target_finders 100
|
||||
sbox_maxwire_teleporters 50
|
||||
sbox_maxwire_textentrys 50
|
||||
sbox_maxwire_textreceivers 50
|
||||
sbox_maxwire_textscreens 100
|
||||
sbox_maxwire_thrusters 50
|
||||
sbox_maxwire_touchplates 100
|
||||
sbox_maxwire_trails 100
|
||||
sbox_maxwire_triggers 100
|
||||
sbox_maxwire_turrets 100
|
||||
sbox_maxwire_twoway_radios 100
|
||||
sbox_maxwire_useholoemitters 50
|
||||
sbox_maxwire_users 100
|
||||
sbox_maxwire_values 100
|
||||
sbox_maxwire_vectorthrusters 50
|
||||
@ -340,6 +374,8 @@ sbox_maxwire_watersensors 100
|
||||
sbox_maxwire_waypoints 30
|
||||
sbox_maxwire_weights 100
|
||||
sbox_maxwire_wheels 30
|
||||
sbox_maxwire_wirers 25
|
||||
sbox_maxwire_xyzbeacons 25
|
||||
]]
|
||||
|
||||
files["votemaps.txt"] =
|
||||
|
@ -9,6 +9,9 @@ function xlib.makecheckbox( t )
|
||||
local pnl = vgui.Create( "DCheckBoxLabel", t.parent )
|
||||
pnl:SetPos( t.x, t.y )
|
||||
pnl:SetText( t.label or "" )
|
||||
if t.dock then pnl:Dock( t.dock ) end -- NODOCK, FILL, LEFT, RIGHT, TOP, BOTTOM
|
||||
if t.dockmargin then pnl:DockMargin( t.dockmargin[1], t.dockmargin[2], t.dockmargin[3], t.dockmargin[4] ) end
|
||||
if t.dockpadding then pnl:DockPadding( t.dockpadding[1], t.dockpadding[2], t.dockpadding[3], t.dockpadding[4] ) end
|
||||
pnl:SizeToContents()
|
||||
pnl:SetValue( t.value or 0 )
|
||||
pnl:SetZPos( t.zpos or 0 )
|
||||
@ -67,6 +70,9 @@ end
|
||||
function xlib.makelabel( t )
|
||||
local pnl = vgui.Create( "DLabel", t.parent )
|
||||
pnl:SetPos( t.x, t.y )
|
||||
if t.dock then pnl:Dock( t.dock ) end -- NODOCK, FILL, LEFT, RIGHT, TOP, BOTTOM
|
||||
if t.dockmargin then pnl:DockMargin( t.dockmargin[1], t.dockmargin[2], t.dockmargin[3], t.dockmargin[4] ) end
|
||||
if t.dockpadding then pnl:DockPadding( t.dockpadding[1], t.dockpadding[2], t.dockpadding[3], t.dockpadding[4] ) end
|
||||
pnl:SetText( t.label or "" )
|
||||
pnl:SetZPos( t.zpos or 0 )
|
||||
if not t.tooltipwidth then t.tooltipwidth = 250 end
|
||||
@ -180,6 +186,9 @@ function xlib.maketextbox( t )
|
||||
pnl:SetPos( t.x, t.y )
|
||||
pnl:SetWide( t.w )
|
||||
pnl:SetTall( t.h or 20 )
|
||||
if t.dock then pnl:Dock( t.dock ) end -- NODOCK, FILL, LEFT, RIGHT, TOP, BOTTOM
|
||||
if t.dockmargin then pnl:DockMargin( t.dockmargin[1], t.dockmargin[2], t.dockmargin[3], t.dockmargin[4] ) end
|
||||
if t.dockpadding then pnl:DockPadding( t.dockpadding[1], t.dockpadding[3], t.dockpadding[3], t.dockpadding[4] ) end
|
||||
pnl:SetEnterAllowed( true )
|
||||
pnl:SetZPos( t.zpos or 0 )
|
||||
if t.convar then pnl:SetConVar( t.convar ) end
|
||||
@ -282,6 +291,22 @@ function xlib.makepanel( t )
|
||||
local pnl = vgui.Create( "DPanel", t.parent )
|
||||
pnl:SetPos( t.x, t.y )
|
||||
pnl:SetSize( t.w, t.h )
|
||||
if t.dock then pnl:Dock( t.dock ) end -- NODOCK, FILL, LEFT, RIGHT, TOP, BOTTOM
|
||||
if t.dockmargin then pnl:DockMargin( t.dockmargin[1], t.dockmargin[2], t.dockmargin[3], t.dockmargin[4] ) end
|
||||
if t.dockpadding then pnl:DockPadding( t.dockpadding[1], t.dockpadding[2], t.dockpadding[3], t.dockpadding[4] ) end
|
||||
pnl:SetZPos( t.zpos or 0 )
|
||||
if t.skin then pnl:SetSkin( t.skin ) end
|
||||
if t.visible ~= nil then pnl:SetVisible( t.visible ) end
|
||||
return pnl
|
||||
end
|
||||
|
||||
function xlib.makescrollpanel( t )
|
||||
local pnl = vgui.Create( "DScrollPanel", t.parent )
|
||||
pnl:SetPos( t.x, t.y )
|
||||
pnl:SetSize( t.w, t.h )
|
||||
if t.dock then pnl:Dock( t.dock ) end -- NODOCK, FILL, LEFT, RIGHT, TOP, BOTTOM
|
||||
if t.dockmargin then pnl:DockMargin( t.dockmargin[1], t.dockmargin[2], t.dockmargin[3], t.dockmargin[4] ) end
|
||||
if t.dockpadding then pnl:DockPadding( t.dockpadding[1], t.dockpadding[2], t.dockpadding[3], t.dockpadding[4] ) end
|
||||
pnl:SetZPos( t.zpos or 0 )
|
||||
if t.skin then pnl:SetSkin( t.skin ) end
|
||||
if t.visible ~= nil then pnl:SetVisible( t.visible ) end
|
||||
@ -314,6 +339,9 @@ function xlib.makecombobox( t )
|
||||
local pnl = vgui.Create( "DComboBox", t.parent )
|
||||
t.w = t.w or 100
|
||||
t.h = t.h or 20
|
||||
if t.dock then pnl:Dock( t.dock ) end -- NODOCK, FILL, LEFT, RIGHT, TOP, BOTTOM
|
||||
if t.dockmargin then pnl:DockMargin( t.dockmargin[1], t.dockmargin[2], t.dockmargin[3], t.dockmargin[4] ) end
|
||||
if t.dockpadding then pnl:DockPadding( t.dockpadding[1], t.dockpadding[2], t.dockpadding[3], t.dockpadding[4] ) end
|
||||
pnl:SetPos( t.x, t.y )
|
||||
pnl:SetSize( t.w, t.h )
|
||||
pnl:SetZPos( t.zpos or 0 )
|
||||
@ -539,6 +567,9 @@ function xlib.makeslider( t )
|
||||
pnl:SetWide( t.w or 100 )
|
||||
pnl:SetTall( t.h or 20 )
|
||||
pnl:SetText( t.label or "" )
|
||||
if t.dock then pnl:Dock( t.dock ) end -- NODOCK, FILL, LEFT, RIGHT, TOP, BOTTOM
|
||||
if t.dockmargin then pnl:DockMargin( t.dockmargin[1], t.dockmargin[2], t.dockmargin[3], t.dockmargin[4] ) end
|
||||
if t.dockpadding then pnl:DockPadding( t.dockpadding[1], t.dockpadding[2], t.dockpadding[3], t.dockpadding[4] ) end
|
||||
pnl:SetMinMax( t.min or 0, t.max or 100 )
|
||||
pnl:SetDecimals( t.decimal or 0 )
|
||||
pnl.TextArea:SetDrawBackground( true )
|
||||
@ -886,7 +917,7 @@ function PANEL:AddAlphaBar()
|
||||
local val = tonumber( self:GetValue() )
|
||||
if not val then val = 0 end
|
||||
if val ~= math.Clamp( val, 0, 255 ) then self:SetValue( math.Clamp( val, 0, 255 ) ) end
|
||||
p.AlphaBar:SetValue( 1 - ( val / 255) )
|
||||
p.AlphaBar:SetValue( val / 255 )
|
||||
p:OnChangeImmediate( p:GetColor() )
|
||||
end
|
||||
self.txtA.OnLoseFocus = function( self )
|
||||
@ -911,7 +942,7 @@ function PANEL:AddAlphaBar()
|
||||
end
|
||||
|
||||
self.AlphaBar = vgui.Create( "DAlphaBar", self )
|
||||
self.AlphaBar.OnChange = function( ctrl, alpha ) self:SetColorAlpha( alpha*255 ) end
|
||||
self.AlphaBar.OnChange = function( ctrl, alpha ) self:SetColorAlpha( math.floor( ( alpha * 255 ) ) ) end
|
||||
self.AlphaBar:SetPos( 25,5 )
|
||||
self.AlphaBar:SetSize( 15, 100 )
|
||||
self.AlphaBar:SetValue( 1 )
|
||||
@ -1198,4 +1229,19 @@ local function fadeAnim_end( data )
|
||||
if data.panelOut then data.panelOut:SetVisible( false ) end
|
||||
if data.panelIn then data.panelIn:SetAlpha( 255 ) end
|
||||
end
|
||||
xlib.registerAnimType( "pnlFade", fadeAnim_run, fadeAnim_start, fadeAnim_end )
|
||||
xlib.registerAnimType( "pnlFade", fadeAnim_run, fadeAnim_start, fadeAnim_end )
|
||||
|
||||
|
||||
-------------------------
|
||||
-- Convar/Listen helpers
|
||||
-------------------------
|
||||
|
||||
-- Useful for switching between cvar or replicated cvar depending on if the player is the host
|
||||
xlib.ifListenHost = function(value)
|
||||
if LocalPlayer():IsListenServerHost() then return value end
|
||||
return nil
|
||||
end
|
||||
xlib.ifNotListenHost = function(value)
|
||||
if not LocalPlayer():IsListenServerHost() then return value end
|
||||
return nil
|
||||
end
|
||||
|
@ -4,29 +4,47 @@
|
||||
xgui.prepareDataType( "sboxlimits" )
|
||||
local sbox_settings = xlib.makepanel{ parent=xgui.null }
|
||||
|
||||
xlib.makecheckbox{ x=10, y=10, label="Enable Noclip", repconvar="rep_sbox_noclip", parent=sbox_settings }
|
||||
xlib.makecheckbox{ x=10, y=30, label="Enable Godmode", repconvar="rep_sbox_godmode", parent=sbox_settings }
|
||||
xlib.makecheckbox{ x=10, y=50, label="Enable PvP Damage", repconvar="rep_sbox_playershurtplayers", parent=sbox_settings }
|
||||
xlib.makecheckbox{ x=10, y=70, label="Spawn With Weapons", repconvar="rep_sbox_weapons", parent=sbox_settings }
|
||||
xlib.makecheckbox{ x=10, y=90, label="Limited Physgun", repconvar="rep_physgun_limited", parent=sbox_settings }
|
||||
local sidepanel = xlib.makescrollpanel{ x=5, y=5, w=160, h=322, spacing=4, parent=sbox_settings }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,0,0,0}, label="Give weapons on spawn", convar=xlib.ifListenHost("sbox_weapons"), repconvar=xlib.ifNotListenHost("rep_sbox_weapons"), parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,5,0,0}, label="Players have god mode", convar=xlib.ifListenHost("sbox_godmode"), repconvar=xlib.ifNotListenHost("rep_sbox_godmode"), parent=sidepanel }
|
||||
|
||||
xlib.makecheckbox{ x=10, y=130, label="Persist Props", repconvar="rep_sbox_persist", parent=sbox_settings }
|
||||
xlib.makecheckbox{ x=10, y=150, label="Bone Manip. Misc", repconvar="rep_sbox_bonemanip_misc", parent=sbox_settings }
|
||||
xlib.makecheckbox{ x=10, y=170, label="Bone Manip. NPC", repconvar="rep_sbox_bonemanip_npc", parent=sbox_settings }
|
||||
xlib.makecheckbox{ x=10, y=190, label="Bone Manip. Player", repconvar="rep_sbox_bonemanip_player", parent=sbox_settings }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,20,0,0}, label="Allow PvP", convar=xlib.ifListenHost("sbox_playershurtplayers"), repconvar=xlib.ifNotListenHost("rep_sbox_playershurtplayers"), parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,5,0,0}, label="Allow noclip", convar=xlib.ifListenHost("sbox_noclip"), repconvar=xlib.ifNotListenHost("rep_sbox_noclip"), parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,5,0,0}, label="Bone manip. NPCs", convar=xlib.ifListenHost("sbox_bonemanip_npc"), repconvar=xlib.ifNotListenHost("rep_sbox_bonemanip_npc"), parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,5,0,0}, label="Bone manip. players", convar=xlib.ifListenHost("sbox_bonemanip_player"), repconvar=xlib.ifNotListenHost("rep_sbox_bonemanip_player"), parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,5,0,0}, label="Bone manip. everything", convar=xlib.ifListenHost("sbox_bonemanip_misc"), repconvar=xlib.ifNotListenHost("rep_sbox_bonemanip_misc"), parent=sidepanel }
|
||||
|
||||
xlib.makelabel{ x=5, y=247, w=140, wordwrap=true, label="NOTE: The non-ulx cvars configurable in XGUI are provided for easy access only and DO NOT SAVE when the server is shut down or crashes.", parent=sbox_settings }
|
||||
sbox_settings.plist = xlib.makelistlayout{ x=140, y=5, h=322, w=440, spacing=1, padding=2, parent=sbox_settings }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,20,0,0}, label="Limited physgun", convar=xlib.ifListenHost("physgun_limited"), repconvar=xlib.ifNotListenHost("rep_physgun_limited"), parent=sidepanel }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Max beam range", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=128, max=8192, convar=xlib.ifListenHost("physgun_maxrange"), repconvar=xlib.ifNotListenHost("rep_physgun_maxrange"), parent=sidepanel, fixclip=true }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Teleport Distance", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=0, max=10000, convar=xlib.ifListenHost("physgun_teleportDistance"), repconvar=xlib.ifNotListenHost("rep_physgun_teleportDistance"), parent=sidepanel, fixclip=true }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Max Prop Speed", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=0, max=10000, convar=xlib.ifListenHost("physgun_maxSpeed"), repconvar=xlib.ifNotListenHost("rep_physgun_maxSpeed"), parent=sidepanel, fixclip=true }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Max Angular Speed", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=0, max=10000, convar=xlib.ifListenHost("physgun_maxAngular"), repconvar=xlib.ifNotListenHost("rep_physgun_maxAngular"), parent=sidepanel, fixclip=true }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Time To Arrive", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=0, max=2, decimal=2, convar=xlib.ifListenHost("physgun_timeToArrive"), repconvar=xlib.ifNotListenHost("rep_physgun_timeToArrive"), parent=sidepanel, fixclip=true }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Time To Arrive (Ragdolls)", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=0, max=2, decimal=2, convar=xlib.ifListenHost("physgun_timeToArriveRagdoll"), repconvar=xlib.ifNotListenHost("rep_physgun_timeToArriveRagdoll"), parent=sidepanel, fixclip=true }
|
||||
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,20,0,0}, w=138, label="Persistence file:", parent=sidepanel }
|
||||
xlib.maketextbox{ h=25, dock=TOP, dockmargin={0,5,5,0}, label="Persist Props", convar=xlib.ifListenHost("sbox_persist"), repconvar=xlib.ifNotListenHost("rep_sbox_persist"), parent=sidepanel }
|
||||
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,20,0,0}, w=138, wordwrap=true, label="NOTE: Sandbox settings are provided for convience and are not saved after the server restarts or crashes.", parent=sidepanel }
|
||||
|
||||
sbox_settings.plist = xlib.makelistlayout{ x=170, y=5, h=322, w=410, spacing=1, padding=2, parent=sbox_settings }
|
||||
|
||||
function sbox_settings.processLimits()
|
||||
sbox_settings.plist:Clear()
|
||||
for g, limits in ipairs( xgui.data.sboxlimits ) do
|
||||
if #limits > 0 then
|
||||
local panel = xlib.makepanel{ h=5+math.ceil( #limits/2 )*25 }
|
||||
local panel = xlib.makepanel{ dockpadding={ 0,0,0,5 } }
|
||||
local i=0
|
||||
for _, cvar in ipairs( limits ) do
|
||||
local cvardata = string.Explode( " ", cvar ) --Split the cvarname and max slider value number
|
||||
xgui.queueFunctionCall( xlib.makeslider, "sboxlimits", { x=10+(i%2*205), y=5+math.floor(i/2)*25, w=200, label="Max " .. cvardata[1]:sub(9), min=0, max=cvardata[2], repconvar="rep_"..cvardata[1], parent=panel, fixclip=true } )
|
||||
xgui.queueFunctionCall( xlib.makelabel, "sboxlimits", { x=10+(i%2*195), y=5+math.floor(i/2)*40, w=185, label="Max " .. cvardata[1]:sub(9), parent=panel } )
|
||||
xgui.queueFunctionCall( xlib.makeslider, "sboxlimits", { x=10+(i%2*195), y=20+math.floor(i/2)*40, w=185, label="<--->", min=0, max=cvardata[2], convar=xlib.ifListenHost(cvardata[1]), repconvar=xlib.ifNotListenHost("rep_"..cvardata[1]), parent=panel, fixclip=true } )
|
||||
i = i + 1
|
||||
end
|
||||
sbox_settings.plist:Add( xlib.makecat{ label=limits.title .. " (" .. #limits .. " limit" .. ((#limits > 1) and "s" or "") .. ")", contents=panel, expanded=( g==1 ) } )
|
||||
|
@ -5,16 +5,24 @@ local function init()
|
||||
if ULib.isSandbox() then --Only execute the following code if it's a sandbox gamemode
|
||||
xgui.addDataType( "sboxlimits", function() return xgui.sboxLimits end, "xgui_gmsettings", 0, -20 )
|
||||
|
||||
ULib.replicatedWritableCvar( "physgun_limited", "rep_physgun_limited", GetConVarNumber( "physgun_limited" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "sbox_noclip", "rep_sbox_noclip", GetConVarNumber( "sbox_noclip" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "sbox_godmode", "rep_sbox_godmode", GetConVarNumber( "sbox_godmode" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "sbox_playershurtplayers", "rep_sbox_playershurtplayers", GetConVarNumber( "sbox_playershurtplayers" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "sbox_weapons", "rep_sbox_weapons", GetConVarNumber( "sbox_weapons" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "sbox_godmode", "rep_sbox_godmode", GetConVarNumber( "sbox_godmode" ), false, false, "xgui_gmsettings" )
|
||||
|
||||
ULib.replicatedWritableCvar( "sbox_persist", "rep_sbox_persist", GetConVarNumber( "sbox_persist" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "sbox_bonemanip_misc", "rep_sbox_bonemanip_misc", GetConVarNumber( "sbox_bonemanip_misc" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "sbox_playershurtplayers", "rep_sbox_playershurtplayers", GetConVarNumber( "sbox_playershurtplayers" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "sbox_noclip", "rep_sbox_noclip", GetConVarNumber( "sbox_noclip" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "sbox_bonemanip_npc", "rep_sbox_bonemanip_npc", GetConVarNumber( "sbox_bonemanip_npc" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "sbox_bonemanip_player", "rep_sbox_bonemanip_player", GetConVarNumber( "sbox_bonemanip_player" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "sbox_bonemanip_misc", "rep_sbox_bonemanip_misc", GetConVarNumber( "sbox_bonemanip_misc" ), false, false, "xgui_gmsettings" )
|
||||
|
||||
ULib.replicatedWritableCvar( "physgun_limited", "rep_physgun_limited", GetConVarNumber( "physgun_limited" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "physgun_maxrange", "rep_physgun_maxrange", GetConVarNumber( "physgun_maxrange" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "physgun_teleportDistance", "rep_physgun_teleportDistance", GetConVarNumber( "physgun_teleportDistance" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "physgun_maxSpeed", "rep_physgun_maxSpeed", GetConVarNumber( "physgun_maxSpeed" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "physgun_maxAngular", "rep_physgun_maxAngular", GetConVarNumber( "physgun_maxAngular" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "physgun_timeToArrive", "rep_physgun_timeToArrive", GetConVarNumber( "physgun_timeToArrive" ), false, false, "xgui_gmsettings" )
|
||||
ULib.replicatedWritableCvar( "physgun_timeToArriveRagdoll", "rep_physgun_timeToArriveRagdoll", GetConVarString( "physgun_timeToArriveRagdoll" ), false, false, "xgui_gmsettings" )
|
||||
|
||||
ULib.replicatedWritableCvar( "sbox_persist", "rep_sbox_persist", GetConVarNumber( "sbox_persist" ), false, false, "xgui_gmsettings" )
|
||||
|
||||
--Process the list of known Sandbox Cvar Limits and check if they exist
|
||||
xgui.sboxLimits = {}
|
||||
|
@ -13,13 +13,23 @@ function settings.init()
|
||||
xgui.addDataType( "motdsettings", function() return ulx.motdSettings end, nil, 0, -20 )
|
||||
xgui.addDataType( "banmessage", function() return {message=ULib.BanMessage} end, nil, 0, 0 )
|
||||
|
||||
ULib.replicatedWritableCvar( "sv_voiceenable", "rep_sv_voiceenable", GetConVarNumber( "sv_voiceenable" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "sv_alltalk", "rep_sv_alltalk", GetConVarNumber( "sv_alltalk" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "sv_voiceenable", "rep_sv_voiceenable", GetConVarNumber( "sv_voiceenable" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "ai_disabled", "rep_ai_disabled", GetConVarNumber( "ai_disabled" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "ai_keepragdolls", "rep_ai_keepragdolls", GetConVarNumber( "ai_keepragdolls" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "ai_ignoreplayers", "rep_ai_ignoreplayers", GetConVarNumber( "ai_ignoreplayers" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "ai_serverragdolls", "rep_ai_serverragdolls", GetConVarNumber( "ai_serverragdolls" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "sv_sticktoground", "rep_sv_sticktoground", GetConVarNumber( "sv_sticktoground" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "sv_playerpickupallowed", "rep_sv_playerpickupallowed", GetConVarNumber( "sv_playerpickupallowed" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "mp_falldamage", "rep_mp_falldamage", GetConVarNumber( "mp_falldamage" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "gmod_suit", "rep_gmod_suit", GetConVarNumber( "gmod_suit" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "sv_gravity", "rep_sv_gravity", GetConVarNumber( "sv_gravity" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "sv_friction", "rep_sv_friction", GetConVarNumber( "sv_friction" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "phys_timescale", "rep_phys_timescale", GetConVarNumber( "phys_timescale" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "sv_defaultdeployspeed", "rep_sv_defaultdeployspeed", GetConVarNumber( "sv_defaultdeployspeed" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "sv_noclipspeed", "rep_sv_noclipspeed", GetConVarNumber( "sv_noclipspeed" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "gmod_maxammo", "rep_gmod_maxammo", GetConVarNumber( "gmod_maxammo" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "gmod_physiterations", "rep_gmod_physiterations", GetConVarNumber( "gmod_physiterations" ), false, false, "xgui_svsettings" )
|
||||
ULib.replicatedWritableCvar( "sv_timeout", "rep_sv_timeout", GetConVarNumber( "sv_timeout" ), false, false, "xgui_svsettings" )
|
||||
|
||||
function settings.addGimp( ply, args )
|
||||
if ULib.ucl.query( ply, "xgui_svsettings" ) then
|
||||
|
@ -4,26 +4,39 @@
|
||||
local server = xlib.makepanel{ parent=xgui.null }
|
||||
|
||||
--------------------------GMOD Settings--------------------------
|
||||
xlib.makecheckbox{ x=10, y=10, label="Enable Voice Chat", repconvar="rep_sv_voiceenable", parent=server }
|
||||
xlib.makelabel{ x=10, y=33, label="Alltalk setting:", parent=server }
|
||||
xlib.makecombobox{ x=10, y=50, w=120, repconvar="rep_sv_alltalk", isNumberConvar=true, choices={ "Team near you", "Team only", "Everyone near you", "Everyone" }, parent=server }
|
||||
xlib.makecheckbox{ x=10, y=75, label="Disable AI", repconvar="rep_ai_disabled", parent=server }
|
||||
xlib.makecheckbox{ x=10, y=95, label="AI Ignore Players", repconvar="rep_ai_ignoreplayers", parent=server }
|
||||
local offset = 0
|
||||
if game.SinglePlayer() then
|
||||
offset = 20
|
||||
xlib.makecheckbox{ x=10, y=115, label="Keep AI Ragdolls", repconvar="rep_ai_keepragdolls", parent=server }
|
||||
end
|
||||
xlib.makelabel{ x=10, y=120+offset, label="sv_gravity", parent=server }
|
||||
xlib.makeslider{ x=10, y=135+offset, label="<--->", w=125, min=-1000, max=1000, repconvar="rep_sv_gravity", parent=server }
|
||||
xlib.makelabel{ x=10, y=165+offset, label="phys_timescale", parent=server }
|
||||
xlib.makeslider{ x=10, y=180+offset, label="<--->", w=125, min=0, max=4, decimal=2, repconvar="rep_phys_timescale", parent=server }
|
||||
local sidepanel = xlib.makescrollpanel{ x=5, y=5, w=140, h=322, spacing=4, parent=server }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,0,0,0}, label="Alltalk setting:", parent=sidepanel }
|
||||
xlib.makecombobox{ dock=TOP, dockmargin={0,2,0,0}, w=140, repconvar="rep_sv_alltalk", isNumberConvar=true, choices={ "Team near you", "Team only", "Everyone near you", "Everyone" }, parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,5,0,0}, label="Enable Voice Chat", convar=xlib.ifListenHost("sv_voiceenable"), repconvar=xlib.ifNotListenHost("rep_sv_voiceenable"), parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,20,0,0}, label="Disable AI", convar=xlib.ifListenHost("ai_disabled"), repconvar=xlib.ifNotListenHost("rep_ai_disabled"), parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,5,0,0}, label="AI Ignore Players", convar=xlib.ifListenHost("ai_ignoreplayers"), repconvar=xlib.ifNotListenHost("rep_ai_ignoreplayers"), parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,5,0,0}, label="Keep Corpses", convar=xlib.ifListenHost("ai_serverragdolls"), repconvar=xlib.ifNotListenHost("rep_ai_serverragdolls"), parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,20,0,0}, label="Stick to ground", convar=xlib.ifListenHost("sv_sticktoground"), repconvar=xlib.ifNotListenHost("rep_sv_sticktoground"), parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,5,0,0}, label="USE key prop pickups", convar=xlib.ifListenHost("sv_playerpickupallowed"), repconvar=xlib.ifNotListenHost("rep_sv_playerpickupallowed"), parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,5,0,0}, label="Realistic fall damage", convar=xlib.ifListenHost("mp_falldamage"), repconvar=xlib.ifNotListenHost("rep_mp_falldamage"), parent=sidepanel }
|
||||
xlib.makecheckbox{ dock=TOP, dockmargin={0,5,0,0}, label="HEV Suit functionality", convar=xlib.ifListenHost("gmod_suit"), repconvar=xlib.ifNotListenHost("rep_gmod_suit"), parent=sidepanel }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Gravity", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=-1000, max=1000, convar=xlib.ifListenHost("sv_gravity"), repconvar=xlib.ifNotListenHost("rep_sv_gravity"), parent=sidepanel, fixclip=true }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Ground Friction", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=-2, max=16, convar=xlib.ifListenHost("sv_friction"), repconvar=xlib.ifNotListenHost("rep_sv_friction"), parent=sidepanel, fixclip=true }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Physics Timescale", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=0, max=4, decimal=2, convar=xlib.ifListenHost("phys_timescale"), repconvar=xlib.ifNotListenHost("rep_phys_timescale"), parent=sidepanel, fixclip=true }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Weapon Deploy Speed", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=0.1, max=10, decimal=2, convar=xlib.ifListenHost("sv_defaultdeployspeed"), repconvar=xlib.ifNotListenHost("rep_sv_defaultdeployspeed"), parent=sidepanel, fixclip=true }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Noclip Speed", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=1, max=10, convar=xlib.ifListenHost("sv_noclipspeed"), repconvar=xlib.ifNotListenHost("rep_sv_noclipspeed"), parent=sidepanel, fixclip=true }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Ammo Limit", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=0, max=9999, convar=xlib.ifListenHost("gmod_maxammo"), repconvar=xlib.ifNotListenHost("rep_gmod_maxammo"), parent=sidepanel, fixclip=true }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Physics Iterations", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=0, max=10, convar=xlib.ifListenHost("gmod_physiterations"), repconvar=xlib.ifNotListenHost("rep_gmod_physiterations"), parent=sidepanel, fixclip=true }
|
||||
xlib.makelabel{ dock=TOP, dockmargin={0,5,0,0}, label="Client Timeout", parent=sidepanel }
|
||||
xlib.makeslider{ dock=TOP, dockmargin={0,2,5,0}, label="<--->", w=125, min=60, max=300, convar=xlib.ifListenHost("sv_timeout"), repconvar=xlib.ifNotListenHost("rep_sv_timeout"), parent=sidepanel, fixclip=true }
|
||||
|
||||
------------------------ULX Category Menu------------------------
|
||||
server.mask = xlib.makepanel{ x=295, y=5, w=290, h=322, parent=server }
|
||||
server.mask = xlib.makepanel{ x=300, y=5, w=285, h=322, parent=server }
|
||||
server.panel = xlib.makepanel{ x=5, w=285, h=322, parent=server.mask }
|
||||
|
||||
server.catList = xlib.makelistview{ x=145, y=5, w=150, h=322, parent=server }
|
||||
server.catList = xlib.makelistview{ x=150, y=5, w=150, h=322, parent=server }
|
||||
server.catList:AddColumn( "Server Setting Modules" )
|
||||
server.catList.Columns[1].DoClick = function() end
|
||||
server.catList.OnRowSelected = function( self, LineID, Line )
|
||||
|
Loading…
Reference in New Issue
Block a user