mirror of
https://github.com/wiremod/advdupe2.git
synced 2025-03-04 03:03:05 -05:00
Fixed up and added back limit ghost feature (#353)
This commit is contained in:
parent
72dff27b04
commit
92442ff183
@ -176,7 +176,7 @@ local function SpawnGhosts()
|
||||
if AdvDupe2.CurrentGhost==AdvDupe2.HeadEnt then AdvDupe2.CurrentGhost = AdvDupe2.CurrentGhost + 1 end
|
||||
|
||||
local g = AdvDupe2.GhostToSpawn[AdvDupe2.CurrentGhost]
|
||||
if g then
|
||||
if g and AdvDupe2.CurrentGhost/AdvDupe2.TotalGhosts*100 <= GetConVarNumber("advdupe2_limit_ghost") then
|
||||
AdvDupe2.GhostEntities[AdvDupe2.CurrentGhost] = MakeGhostsFromTable(g)
|
||||
if(not AdvDupe2.BusyBar)then
|
||||
AdvDupe2.ProgressBar.Percent = AdvDupe2.CurrentGhost/AdvDupe2.TotalGhosts*100
|
||||
@ -250,7 +250,7 @@ function AdvDupe2.StartGhosting()
|
||||
AdvDupe2.TotalGhosts = #AdvDupe2.GhostToSpawn
|
||||
|
||||
if AdvDupe2.TotalGhosts > 1 then
|
||||
if(not AdvDupe2.BusyBar)then
|
||||
if not AdvDupe2.BusyBar then
|
||||
AdvDupe2.InitProgressBar("Ghosting: ")
|
||||
AdvDupe2.BusyBar = false
|
||||
end
|
||||
|
@ -934,6 +934,7 @@ if(CLIENT)then
|
||||
CreateClientConVar("advdupe2_preserve_freeze", 0, false, true)
|
||||
CreateClientConVar("advdupe2_copy_outside", 0, false, true)
|
||||
CreateClientConVar("advdupe2_copy_only_mine", 1, false, true)
|
||||
CreateClientConVar("advdupe2_limit_ghost", 100, false, true)
|
||||
CreateClientConVar("advdupe2_area_copy_size", 300, false, true)
|
||||
CreateClientConVar("advdupe2_auto_save_contraption", 0, false, true)
|
||||
CreateClientConVar("advdupe2_auto_save_overwrite", 1, false, true)
|
||||
@ -1039,6 +1040,23 @@ if(CLIENT)then
|
||||
CPanel:AddItem(Check)
|
||||
|
||||
local NumSlider = vgui.Create( "DNumSlider" )
|
||||
NumSlider:SetText( "Ghost Percentage:" )
|
||||
NumSlider.Label:SetDark(true)
|
||||
NumSlider:SetMin( 0 )
|
||||
NumSlider:SetMax( 100 )
|
||||
NumSlider:SetDecimals( 0 )
|
||||
NumSlider:SetConVar( "advdupe2_limit_ghost" )
|
||||
NumSlider:SetToolTip("Change the percent of ghosts to spawn")
|
||||
--If these funcs are not here, problems occur for each
|
||||
local func = NumSlider.Slider.OnMouseReleased
|
||||
NumSlider.Slider.OnMouseReleased = function(self, mcode) func(self, mcode) AdvDupe2.StartGhosting() end
|
||||
local func2 = NumSlider.Slider.Knob.OnMouseReleased
|
||||
NumSlider.Slider.Knob.OnMouseReleased = function(self, mcode) func2(self, mcode) AdvDupe2.StartGhosting() end
|
||||
local func3 = NumSlider.Wang.Panel.OnLoseFocus
|
||||
NumSlider.Wang.Panel.OnLoseFocus = function(txtBox) func3(txtBox) AdvDupe2.StartGhosting() end
|
||||
CPanel:AddItem(NumSlider)
|
||||
|
||||
NumSlider = vgui.Create( "DNumSlider" )
|
||||
NumSlider:SetText( "Area Copy Size:" )
|
||||
NumSlider.Label:SetDark(true)
|
||||
NumSlider:SetMin( 0 )
|
||||
|
Loading…
Reference in New Issue
Block a user