From ed5acc7f5081c003fe89ed5b26f71e664392e484 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Tue, 11 Nov 2025 11:59:14 +0100 Subject: [PATCH] =?UTF-8?q?-=20[FIX]=20view.origin()=20estaba=20invertit?= =?UTF-8?q?=20-=20[FIX]=20Al=20generar=20un=20jailmoji=20no=20s'actualitza?= =?UTF-8?q?va=20la=20cadena=20de=20generaci=C3=B3=20-=20[NEW]=20Al=20pulsa?= =?UTF-8?q?r=20amb=20el=20bot=C3=B3=20de=20la=20dreta=20sobre=20un=20spin?= =?UTF-8?q?=5Fbutton=20o=20color=5Fbutton,=20se=20va=20cap=20arrere?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/jailmoji.lua | 57 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/data/jailmoji.lua b/data/jailmoji.lua index b0f939a..b0fdd0a 100644 --- a/data/jailmoji.lua +++ b/data/jailmoji.lua @@ -91,6 +91,9 @@ jailmoji={ pal.subpal() surf.target(0) + + jailmoji.editor.str="" + for i=1,#jailmoji.gendata do jailmoji.editor.str = jailmoji.editor.str .. string.char(jailmoji.gendata[i]+65) end end, random=function() @@ -156,19 +159,28 @@ jailmoji={ spin_button=function(x, y, current_value, max_value) local rect,color = draw.rect, 8 - local mx,my = mouse.pos() mx,my = view.tolocal(mx,my) + local mx,my = mouse.pos() --mx,my = view.tolocal(mx,my) local hover = mx>=x and mx=y and my max_value then - return 0 - else - return current_value+1 + if hover then + if mouse.press(mouse.LEFT) then + jailmoji.editor.changed = true + if current_value+1 > max_value then + return 0 + else + return current_value+1 + end + elseif mouse.press(mouse.RIGHT) then + jailmoji.editor.changed = true + if current_value == 0 then + return max_value + else + return current_value-1 + end end end return current_value @@ -176,17 +188,26 @@ jailmoji={ color_button=function(x, y, current_value) local c1,c2,c3 = current_value+1,6,8 - local mx,my = mouse.pos() mx,my = view.tolocal(mx,my) + local mx,my = mouse.pos() --mx,my = view.tolocal(mx,my) local hover = mx>=x and mx=y and my 15 then - return 0 - else - return current_value+1 + if hover then + if mouse.press(mouse.LEFT) then + jailmoji.editor.changed = true + if current_value+1 > 15 then + return 0 + else + return current_value+1 + end + elseif mouse.press(mouse.RIGHT) then + jailmoji.editor.changed = true + if current_value == 0 then + return 15 + else + return current_value-1 + end end end return current_value @@ -214,7 +235,7 @@ jailmoji={ self.view=self.text_button(39,74,"S",self.view, 2) self.animated=self.text_button(60,74,"A",self.animated, not self.animated) - view.origin(-70,-23) + view.origin(70,23) draw.text("Vestit:",1,2,8) jailmoji.gendata[1] = self.spin_button(28,0,jailmoji.gendata[1],jailmoji.MAX_BASE) @@ -251,14 +272,14 @@ jailmoji={ if jailmoji.editor.changed then jailmoji.editor.changed = false jailmoji.generate() - self.str="" - for i=1,#jailmoji.gendata do self.str = self.str .. string.char(jailmoji.gendata[i]+65) end + --self.str="" + --for i=1,#jailmoji.gendata do self.str = self.str .. string.char(jailmoji.gendata[i]+65) end end draw.rectf(19,88, 122, 9,7) draw.rect(19,88, 122, 9,8) draw.text(self.str,21,90,8) - local mx,my = mouse.pos() mx,my = view.tolocal(mx,my) + --local mx,my = mouse.pos() --mx,my = view.tolocal(mx,my) -- 'COPY' button draw.rectf(19,98, 24, 9,9)