- [NEW] Convertit a mini v1.0 RC2
This commit is contained in:
@@ -20,23 +20,23 @@ fileselect={
|
||||
end,
|
||||
|
||||
update=function()
|
||||
rectfill(10,10, 150, 130,5)
|
||||
rect(10,10, 150, 130,8)
|
||||
if fileselect.title then prnt(fileselect.title,20,13) end
|
||||
rectfill(20,20, 140, 120,6)
|
||||
draw.rectf(10,10, 140, 120,5)
|
||||
draw.rect(10,10, 140, 120,8)
|
||||
if fileselect.title then draw.text(fileselect.title,20,13,8) end
|
||||
draw.rectf(20,20, 120, 100,6)
|
||||
local i = 22
|
||||
for k,dir in pairs(fileselect.file_list) do
|
||||
color(8)
|
||||
local color=8
|
||||
if k==fileselect.selected then
|
||||
rectfill(20,i-2, 140, i+6,11)
|
||||
color(15)
|
||||
draw.rectf(20,i-1, 120, 8,11)
|
||||
color=15
|
||||
end
|
||||
prnt(dir, 23, i)
|
||||
draw.text(dir, 23, i, color)
|
||||
i=i+7
|
||||
end
|
||||
rect(20,20, 140, 120,8)
|
||||
draw.rect(20,20, 120, 100,8)
|
||||
|
||||
local mx,my=mouse()
|
||||
local mx,my=mouse.pos()
|
||||
if (mx~=fileselect.old_mx or my~=fileselect.old_my) then
|
||||
fileselect.old_mx,fileselect.old_my=mx,my
|
||||
if mx>20 and mx<140 and my>20 and my<120 then
|
||||
@@ -46,7 +46,7 @@ fileselect={
|
||||
end
|
||||
end
|
||||
end
|
||||
if mbtnp(1) then
|
||||
if mouse.press(mouse.LEFT) then
|
||||
if mx>20 and mx<140 and my>20 and my<120 then
|
||||
local y = math.floor((my-21)/7)+1
|
||||
if (y<=#fileselect.file_list) then
|
||||
@@ -57,20 +57,20 @@ fileselect={
|
||||
end
|
||||
end
|
||||
-- if textbox.value then
|
||||
-- prnt(textbox.value,43,73)
|
||||
-- draw.text(textbox.value,43,73)
|
||||
-- if (math.floor(time()*4)%2)==0 then
|
||||
-- prnt("_",43+#textbox.value*4,73)
|
||||
-- draw.text("_",43+#textbox.value*4,73)
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
local tecla=btnp()
|
||||
if tecla==KEY_DOWN then
|
||||
local tecla=key.press()
|
||||
if tecla==key.DOWN then
|
||||
if fileselect.selected < #fileselect.file_list then fileselect.selected = fileselect.selected + 1 end
|
||||
elseif tecla==KEY_UP then
|
||||
elseif tecla==key.UP then
|
||||
if fileselect.selected > 1 then fileselect.selected = fileselect.selected - 1 end
|
||||
-- elseif tecla==KEY_BACKSPACE then
|
||||
-- textbox.value=string.sub(textbox.value,1,-2)
|
||||
elseif tecla==KEY_RETURN then
|
||||
elseif tecla==key.RETURN then
|
||||
update=fileselect.old_update
|
||||
fileselect.return_function(fileselect.file_list[fileselect.selected])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user