forked from wrefgtzweve/gmod-better-dupe
make the user aware that duplicator is now advdupe2
This commit is contained in:
parent
183c45aa5e
commit
ad83258105
47
lua/autorun/client/cl_betterdupe.lua
Normal file
47
lua/autorun/client/cl_betterdupe.lua
Normal file
@ -0,0 +1,47 @@
|
||||
if not AdvDupe2 then
|
||||
PrintMessage( 3, "Advanced duplicator 2 is not installed. Better dupe has been disabled." )
|
||||
return
|
||||
end
|
||||
|
||||
hook.Add( "PostGamemodeLoaded", "BetterDupeLoad", function()
|
||||
local duper = weapons.GetStored( "gmod_tool" )["Tool"]["duplicator"]
|
||||
|
||||
function duper.BuildCPanel( CPanel, tool )
|
||||
CPanel:ClearControls()
|
||||
|
||||
CPanel:AddControl( "Header", { Description = "#tool.duplicator.desc" } )
|
||||
|
||||
CPanel:AddControl( "Button", { Text = "#tool.duplicator.showsaves", Command = "dupe_show" } )
|
||||
|
||||
if ( !tool && IsValid( LocalPlayer() ) ) then tool = LocalPlayer():GetTool( "duplicator" ) end
|
||||
if ( !tool || !tool.CurrentDupeName ) then return end
|
||||
|
||||
local info = "Name: " .. tool.CurrentDupeName
|
||||
info = info .. "\nEntities: " .. tool.CurrentDupeEntCount
|
||||
|
||||
CPanel:AddControl( "Label", { Text = info } )
|
||||
|
||||
if ( tool.CurrentDupeWSIDs && #tool.CurrentDupeWSIDs > 0 ) then
|
||||
CPanel:AddControl( "Label", { Text = "Required workshop content:" } )
|
||||
for _, wsid in pairs( tool.CurrentDupeWSIDs ) do
|
||||
local subbed = ""
|
||||
if ( steamworks.IsSubscribed( wsid ) ) then subbed = " (Subscribed)" end
|
||||
local b = CPanel:AddControl( "Button", { Text = wsid .. subbed } )
|
||||
b.DoClick = function( s, ... ) steamworks.ViewFile( wsid ) end
|
||||
steamworks.FileInfo( wsid, function( result )
|
||||
if ( !IsValid( b ) ) then return end
|
||||
b:SetText( result.title .. subbed )
|
||||
end )
|
||||
end
|
||||
end
|
||||
|
||||
if ( tool.CurrentDupeCanSave ) then
|
||||
local b = CPanel:AddControl( "Button", { Text = "#dupes.savedupe", Command = "dupe_save" } )
|
||||
hook.Add( "DupeSaveUnavailable", b, function() b:Remove() end )
|
||||
end
|
||||
|
||||
CPanel:AddControl( "Label", { Text = "" } )
|
||||
CPanel:AddControl( "Label", { Text = "!!! Advanced Duplicator 2 Settings In-Effect !!!" } )
|
||||
CPanel:AddControl( "Label", { Text = "Adjust Advanced Duplicator 2 to disable automatic freezing." } )
|
||||
end
|
||||
end )
|
@ -41,6 +41,9 @@ hook.Add( "PostGamemodeLoaded", "BetterDupeLoad", function()
|
||||
ply.AdvDupe2.Name = "Better dupe"
|
||||
ply.AdvDupe2.Revision = advDupe2Revision
|
||||
|
||||
ply.AdvDupe2.Pasting = true
|
||||
AdvDupe2.Notify( ply, "Pasting..." )
|
||||
|
||||
AdvDupe2.InitPastingQueue( ply, ply.AdvDupe2.Position, ply.AdvDupe2.Angle, nil, true, true, true, tobool( ply:GetInfo( "advdupe2_paste_protectoveride" ) ) )
|
||||
end
|
||||
end )
|
||||
|
Loading…
Reference in New Issue
Block a user