Improve style

This commit is contained in:
Redox 2023-07-07 20:11:36 +02:00
parent a4620a90dd
commit 7a44cece34
No known key found for this signature in database
GPG Key ID: C10A433A95068388

View File

@ -2,8 +2,8 @@ local BUILDER, PART = pac.PartTemplate("base")
PART.ClassName = "command"
PART.Group = 'advanced'
PART.Icon = 'icon16/application_xp_terminal.png'
PART.Group = "advanced"
PART.Icon = "icon16/application_xp_terminal.png"
BUILDER:StartStorableVars()
BUILDER:GetSet("String", "", {editor_panel = "string"})
@ -24,10 +24,8 @@ function PART:OnWorn()
end
function PART:OnShow(from_rendering)
if not from_rendering then
if self:GetExecuteOnShow() then
self:Execute()
end
if not from_rendering and self:GetExecuteOnShow() then
self:Execute()
end
end
@ -57,9 +55,10 @@ function PART:ShouldHighlight(str)
end
function PART:GetNiceName()
if self.UseLua then return ("lua: " .. self.String) end
if self.UseLua then
return ("lua: " .. self.String)
end
return "command: " .. self.String
end
function PART:Execute()
@ -77,7 +76,7 @@ function PART:Execute()
else
local msg = "clientside lua is disabled (sv_allowcslua 0)"
self:SetError(msg)
pac.Message(tostring(self) .. ' - '.. msg)
pac.Message(tostring(self) .. " - ".. msg)
end
else
if hook.Run("PACCanRunConsoleCommand", self.String) == false then return end