Halt during upload (#488)

* Halt during upload

* Improve messages

* Rename opening to uploading for more clarity
This commit is contained in:
Redox 2024-11-19 00:20:14 +01:00 committed by GitHub
parent 31d066cc10
commit 293b094899
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 5 deletions

View File

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

View File

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