From 84a0bb10006a1b9103735f7f403ca89ed17611ba Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Wed, 21 Oct 2020 10:59:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E7=BB=86=E8=8A=82?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/init.lua | 2 ++ Zframework/widget.lua | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Zframework/init.lua b/Zframework/init.lua index 41cbe52d..f3a2a933 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -264,6 +264,8 @@ function love.textinput(text) if not W.regex or text:match(W.regex)then WIDGET.sel.value=WIDGET.sel.value..text SFX.play("move") + else + SFX.play("finesseError",.3) end end end diff --git a/Zframework/widget.lua b/Zframework/widget.lua index bd2d7416..eff23dd6 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -625,20 +625,20 @@ function textBox:draw() --Text setFont(self.font) + t=self.text + if t then + gc.printf(t,x-412,y+h*.5-self.font*.7,400,"right") + end if self.secret then for i=1,#self.value do gc.print("*",x-5+self.font*.5*i,y+h*.5-self.font*.7) end else gc.print(self.value,x+10,y+h*.5-self.font*.7) - end - t=self.text - if t then - gc.printf(t,x-412,y+h*.5-self.font*.7,400,"right") - end - setFont(self.font-10) - if WIDGET.sel==self then - gc.print(EDITING,x+10,y+5-self.font*1.4) + setFont(self.font-10) + if WIDGET.sel==self then + gc.print(EDITING,x+10,y+12-self.font*1.4) + end end end function textBox:getInfo()