From 356316aaa386928e2cc3de920c5aa19be5142575 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sat, 26 Jun 2021 01:42:18 +0800 Subject: [PATCH] =?UTF-8?q?MES.new=E4=BC=9A=E6=A0=B9=E6=8D=AE=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=9F=BA=E7=A1=80=E6=B6=88=E6=81=AF=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=83=8C=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/message.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Zframework/message.lua b/Zframework/message.lua index dff4e7b9..1a294b49 100644 --- a/Zframework/message.lua +++ b/Zframework/message.lua @@ -60,12 +60,24 @@ local mesIcon={ local MES={} function MES.new(icon,str,time) - if type(icon)=='string'then icon=mesIcon[icon]end + local backColor={.5,.5,.5,.7} + if type(icon)=='string'then + if icon=='check'then + backColor={.3,.5,.3,.7} + elseif icon=='broadcast'then + backColor={.2,.2,.8,.8} + elseif icon=='warn'then + backColor={.7,.7,.3,.8} + elseif icon=='error'then + backColor={.8,.3,.3,.8} + end + icon=mesIcon[icon] + end local t=gc.newText(getFont(30),str) local w=math.max(t:getWidth()+(icon and 45 or 5),200)+20 local h=math.max(t:getHeight(),46)+3 local L={w,h, - {'clear',.5,.5,.5,.7}, + {'clear',backColor}, {'setCL',.7,.7,.7}, {'setLW',2}, {'dRect',1,1,w-2,h-2},