MES模块添加公告图标
This commit is contained in:
@@ -23,6 +23,14 @@ local mesIcon={
|
|||||||
{'fRect',18,11,4,4},
|
{'fRect',18,11,4,4},
|
||||||
{'fRect',18,17,4,12},
|
{'fRect',18,17,4,12},
|
||||||
},
|
},
|
||||||
|
broadcast=DOGC{40,40,
|
||||||
|
{'setCL',1,1,1},
|
||||||
|
{'fRect',2,4,36,26,3},
|
||||||
|
{'fPoly',2,27,2,37,14,25},
|
||||||
|
{'setCL',.5,.5,.5},
|
||||||
|
{'fRect',6,11,4,4},{'fRect',14,11,19,4},
|
||||||
|
{'fRect',6,19,4,4},{'fRect',14,19,19,4},
|
||||||
|
},
|
||||||
warn=DOGC{40,40,
|
warn=DOGC{40,40,
|
||||||
{'setCL',.95,.83,.4},
|
{'setCL',.95,.83,.4},
|
||||||
{'fPoly',20.5,1,0,38,40,38},
|
{'fPoly',20.5,1,0,38,40,38},
|
||||||
@@ -52,7 +60,6 @@ local mesIcon={
|
|||||||
local MES={}
|
local MES={}
|
||||||
|
|
||||||
function MES.new(icon,str,time)
|
function MES.new(icon,str,time)
|
||||||
-- icon=mesIcon.info
|
|
||||||
if type(icon)=='string'then icon=mesIcon[icon]end
|
if type(icon)=='string'then icon=mesIcon[icon]end
|
||||||
local t=gc.newText(getFont(30),str)
|
local t=gc.newText(getFont(30),str)
|
||||||
local w=math.max(t:getWidth()+(icon and 45 or 5),200)
|
local w=math.max(t:getWidth()+(icon and 45 or 5),200)
|
||||||
|
|||||||
@@ -416,10 +416,10 @@ function NET.updateWS_app()
|
|||||||
if VERSION.code<res.newestCode then
|
if VERSION.code<res.newestCode then
|
||||||
MES.new('warn',text.oldVersion:gsub("$1",res.newestName),3)
|
MES.new('warn',text.oldVersion:gsub("$1",res.newestName),3)
|
||||||
end
|
end
|
||||||
MES.new('info',res.notice,5)
|
MES.new('broadcast',res.notice,5)
|
||||||
NET.tryLogin(true)
|
NET.tryLogin(true)
|
||||||
elseif res.action==0 then--Broadcast
|
elseif res.action==0 then--Broadcast
|
||||||
MES.new('info',res.data.message,5)
|
MES.new('broadcast',res.data.message,5)
|
||||||
elseif res.action==1 then--Get notice
|
elseif res.action==1 then--Get notice
|
||||||
--?
|
--?
|
||||||
elseif res.action==2 then--Register
|
elseif res.action==2 then--Register
|
||||||
|
|||||||
@@ -303,6 +303,7 @@ local commands={}do
|
|||||||
if
|
if
|
||||||
arg=='check'or
|
arg=='check'or
|
||||||
arg=='info'or
|
arg=='info'or
|
||||||
|
arg=='broadcast'or
|
||||||
arg=='warn'or
|
arg=='warn'or
|
||||||
arg=='error'
|
arg=='error'
|
||||||
then
|
then
|
||||||
@@ -310,7 +311,7 @@ local commands={}do
|
|||||||
else
|
else
|
||||||
log{C.A,"Show a message on the up-left corner"}
|
log{C.A,"Show a message on the up-left corner"}
|
||||||
log""
|
log""
|
||||||
log{C.A,"Usage: mes <check|info|warn|error> [message]"}
|
log{C.A,"Usage: mes <check|info|broadcast|warn|error> [message]"}
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
description="Show a message",
|
description="Show a message",
|
||||||
|
|||||||
Reference in New Issue
Block a user