mirror of
https://github.com/wiremod/advdupe2.git
synced 2025-03-04 03:03:05 -05:00
Halt during upload (#488)
* Halt during upload * Improve messages * Rename opening to uploading for more clarity
This commit is contained in:
parent
31d066cc10
commit
293b094899
@ -137,7 +137,7 @@ local function AdvDupe2_ReceiveFile(len, ply)
|
||||
AdvDupe2.Notify(ply, "Duplicator is Busy!", NOTIFY_ERROR, 5)
|
||||
elseif stream then
|
||||
ply.AdvDupe2.Uploading = true
|
||||
AdvDupe2.InitProgressBar(ply, "Opening: ")
|
||||
AdvDupe2.InitProgressBar(ply, "Uploading: ")
|
||||
end
|
||||
end
|
||||
net.Receive("AdvDupe2_ReceiveFile", AdvDupe2_ReceiveFile)
|
||||
|
@ -199,6 +199,11 @@ if(SERVER) then
|
||||
Params: <trace> trace
|
||||
Returns: <boolean> success
|
||||
]]
|
||||
local messages = {
|
||||
["Pasting"] = "pasting.",
|
||||
["Downloading"] = "downloading.",
|
||||
["Uploading"] = "uploading."
|
||||
}
|
||||
function TOOL:LeftClick( trace )
|
||||
if(not trace) then return false end
|
||||
|
||||
@ -207,9 +212,11 @@ if(SERVER) then
|
||||
|
||||
if not (dupe and dupe.Entities) then return false end
|
||||
|
||||
if(dupe.Pasting or dupe.Downloading) then
|
||||
AdvDupe2.Notify(ply,"Advanced Duplicator 2 is busy.",NOTIFY_ERROR)
|
||||
return false
|
||||
for key, msg in pairs(messages) do
|
||||
if dupe[key] then
|
||||
AdvDupe2.Notify(ply, "Advanced Duplicator 2 is busy " .. msg, NOTIFY_ERROR)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
dupe.Angle = GetDupeAngleOffset(ply)
|
||||
@ -411,7 +418,7 @@ if(SERVER) then
|
||||
return
|
||||
else
|
||||
if(dupe.Uploading) then
|
||||
AdvDupe2.InitProgressBar(ply, "Opening: ")
|
||||
AdvDupe2.InitProgressBar(ply, "Uploading: ")
|
||||
return
|
||||
elseif(dupe.Downloading) then
|
||||
AdvDupe2.InitProgressBar(ply, "Saving: ")
|
||||
|
Loading…
Reference in New Issue
Block a user