From 152aa0406e8e5eeabe9653b8ed8757a244198902 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 21 May 2021 11:18:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=8F=AA=E7=94=A8=E5=88=B0=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E7=9A=84DOGC=E7=A7=BB=E5=87=BATEXTURE=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/init.lua | 10 +++++----- parts/gametoolfunc.lua | 15 ++++++++++++++- parts/scenes/main.lua | 11 ++++++++++- parts/texture.lua | 25 ------------------------- 4 files changed, 29 insertions(+), 32 deletions(-) diff --git a/Zframework/init.lua b/Zframework/init.lua index b13bbc44..56c49fe7 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -540,12 +540,12 @@ function love.run() TASK.update() WS.update(dt) VOC.update() - BG.update(dt)--BG animation + BG.update(dt) SYSFX.update(dt) - WIDGET.update()--Widgets animation - if SCN.update then SCN.update(dt)end--Scene updater - if SCN.swapping then SCN.swapUpdate()end--Scene swapping animation - TEXT.update()--Update global texts animation + WIDGET.update() + if SCN.update then SCN.update(dt)end + if SCN.swapping then SCN.swapUpdate()end + TEXT.update() LOG.update() --DRAW diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index fc39dc4d..d670cebb 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -545,6 +545,19 @@ end --Game draw do--function drawSelfProfile() + local lvIcon=setmetatable({},{__index=function(self,lv) + local img={25,25} + + ins(img,{"clear",0,0,0}) + ins(img,{"setLW",4}) + ins(img,{"setCL",.5,.8,1}) + ins(img,{"dRect",2,2,21,21}) + --TODO: draw with lv + + img=DOGC(img) + rawset(self,lv,img) + return img + end}) local name local textObject,scaleK,width,offY function drawSelfProfile() @@ -570,7 +583,7 @@ do--function drawSelfProfile() gc_draw(textObject,-82,26,nil,scaleK,nil,width,offY) --Draw lv. & xp. - gc_draw(TEXTURE.lvIcon[USER.lv],-295,50) + gc_draw(lvIcon[USER.lv],-295,50) gc_line(-270,55,-80,55,-80,70,-270,70) gc_rectangle('fill',-210,55,150*USER.xp/USER.lv/USER.lv,15) diff --git a/parts/scenes/main.lua b/parts/scenes/main.lua index 1782e66d..7453d0df 100644 --- a/parts/scenes/main.lua +++ b/parts/scenes/main.lua @@ -172,7 +172,16 @@ scene.widgetList={ WIDGET.newButton{name="manual", x=2480,y=570,w=800,h=100, color='lC',font=40,align='L',edge=30,code=pressKey","}, WIDGET.newButton{name="music", x=130,y=80,w=200,h=90, color='lO',font=35,code=pressKey"2"}, - WIDGET.newButton{name="lang", x=300,y=80,w=90,h=90, color='lN',font=40,code=pressKey"3",fText=TEXTURE.earth}, + WIDGET.newButton{name="lang", x=300,y=80,w=90,h=90, color='lN',font=40,code=pressKey"3", + fText=DOGC{64,64, + {"setLW",4}, + {"dCirc",32,32,30}, + {"line",2,31,62,31}, + {"line",31,2,31,62}, + {"dArc",10,31,40,-.8,.8}, + {"dArc",53,31,40,2.3,3.9}, + } + }, WIDGET.newButton{name="about", x=-110,y=670,w=600,h=70, color='lB',font=35,align='R',edge=30,code=pressKey"x"}, WIDGET.newButton{name="back", x=1390,y=670,w=600,h=70, color='lR',font=40,align='L',edge=30,code=backScene}, } diff --git a/parts/texture.lua b/parts/texture.lua index ba3098b1..43408731 100644 --- a/parts/texture.lua +++ b/parts/texture.lua @@ -65,21 +65,6 @@ for i=0,9 do } end ---Level icons -TEXTURE.lvIcon=setmetatable({},{__index=function(self,lv) - local img={25,25} - - ins(img,{"clear",0,0,0}) - ins(img,{"setLW",4}) - ins(img,{"setCL",.5,.8,1}) - ins(img,{"dRect",2,2,21,21}) - --TODO: draw with lv - - img=DOGC(img) - rawset(self,lv,img) - return img -end}) - --Setting icon TEXTURE.setting=DOGC{64,64, {"setLW",8}, @@ -95,16 +80,6 @@ TEXTURE.setting=DOGC{64,64, {"line",45,19,55,9}, } ---Earth icon -TEXTURE.earth=DOGC{64,64, - {"setLW",4}, - {"dCirc",32,32,30}, - {"line",2,31,62,31}, - {"line",31,2,31,62}, - {"dArc",10,31,40,-.8,.8}, - {"dArc",53,31,40,2.3,3.9}, -} - gc.setDefaultFilter('linear','linear')