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)