make the user aware that duplicator is now advdupe2

This commit is contained in:
edshot99 2024-02-12 19:06:02 -06:00
parent 183c45aa5e
commit ad83258105
2 changed files with 50 additions and 0 deletions

View 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 )

View File

@ -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 )