mirror of
https://github.com/CapsAdmin/pac3.git
synced 2025-03-04 03:03:01 -05:00
Improve style
This commit is contained in:
parent
a4620a90dd
commit
7a44cece34
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user