- [FIX] Les "formiguetes" en les seleccions no es veïen
- [FIX] El item seleccionat per a posar no es veia - [NEW] Al arrastrar un item, també te "formiguetes"
This commit is contained in:
@@ -17,15 +17,20 @@ editor = {
|
|||||||
|
|
||||||
enable = function()
|
enable = function()
|
||||||
app.update = editor.update
|
app.update = editor.update
|
||||||
sys.beat(2)
|
sys.beat(5)
|
||||||
shader.disable();
|
shader.disable();
|
||||||
pal.set(palfade.original)
|
pal.set(palfade.original)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
update = function()
|
update = function()
|
||||||
|
if sys.beat() then
|
||||||
|
editor.ants = (editor.ants<<12) | (editor.ants>>4)
|
||||||
|
end
|
||||||
|
|
||||||
view.origin(0,0)
|
view.origin(0,0)
|
||||||
surf.target(0)
|
surf.target(0)
|
||||||
|
|
||||||
|
-- Pintar fondo quadrejat, per si la capa background està oculta
|
||||||
for y=0,104,8 do
|
for y=0,104,8 do
|
||||||
for x=0,160,8 do
|
for x=0,160,8 do
|
||||||
local color = (((x+y)//8)%2==0) and 23 or 16
|
local color = (((x+y)//8)%2==0) and 23 or 16
|
||||||
@@ -51,12 +56,10 @@ editor = {
|
|||||||
local rx1,ry1,rx2,ry2=editor.selection.x1<<3,editor.selection.y1<<3,editor.selection.x2<<3,editor.selection.y2<<3
|
local rx1,ry1,rx2,ry2=editor.selection.x1<<3,editor.selection.y1<<3,editor.selection.x2<<3,editor.selection.y2<<3
|
||||||
if rx1>rx2 then rx1,rx2=rx2,rx1 end
|
if rx1>rx2 then rx1,rx2=rx2,rx1 end
|
||||||
if ry1>ry2 then ry1,ry2=ry2,ry1 end
|
if ry1>ry2 then ry1,ry2=ry2,ry1 end
|
||||||
|
draw.mode(draw.PATTERN)
|
||||||
draw.pattern(editor.ants)
|
draw.pattern(editor.ants)
|
||||||
draw.rect(rx1-1, ry1-1, rx2-rx1+10, ry2-ry1+10, 28)
|
draw.rect(rx1-1, ry1-1, rx2-rx1+10, ry2-ry1+10, 28)
|
||||||
draw.pattern(0xffff)
|
draw.mode(draw.NORMAL)
|
||||||
if sys.beat() then
|
|
||||||
editor.ants = (editor.ants<<12) | (editor.ants>>4)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
draw.rect(mx-1, my-1, editor.brush.w*8+2, editor.brush.h*8+2, 28)
|
draw.rect(mx-1, my-1, editor.brush.w*8+2, editor.brush.h*8+2, 28)
|
||||||
draw.rect(mx, my, editor.brush.w*8, editor.brush.h*8, 1)
|
draw.rect(mx, my, editor.brush.w*8, editor.brush.h*8, 1)
|
||||||
@@ -121,6 +124,7 @@ editor = {
|
|||||||
end
|
end
|
||||||
if editor.item_selected then
|
if editor.item_selected then
|
||||||
local k = items[editor.item_selected]
|
local k = items[editor.item_selected]
|
||||||
|
surf.source(surf_sprites)
|
||||||
draw.surf(k.visual.x, k.visual.y, k.visual.w, k.visual.h, mx, my, k.visual.w, k.visual.h, editor.flip)
|
draw.surf(k.visual.x, k.visual.y, k.visual.w, k.visual.h, mx, my, k.visual.w, k.visual.h, editor.flip)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -575,8 +575,13 @@ sprites = {
|
|||||||
if (app.update == editor.update) and (editor.item_selected or editor.layer~=LAYER_ITEMS) then ignore_selected = true end
|
if (app.update == editor.update) and (editor.item_selected or editor.layer~=LAYER_ITEMS) then ignore_selected = true end
|
||||||
for i,v in ipairs(sprites.list) do
|
for i,v in ipairs(sprites.list) do
|
||||||
if not ignore_selected and app.update == editor.update and mx>=v.pos.x and mx<=v.pos.x+v.size.w and my>=v.pos.y and my<=v.pos.y+v.size.h then
|
if not ignore_selected and app.update == editor.update and mx>=v.pos.x and mx<=v.pos.x+v.size.w and my>=v.pos.y and my<=v.pos.y+v.size.h then
|
||||||
sprites.draw_sprite_selected(v)
|
|
||||||
editor.item_hovered = i
|
editor.item_hovered = i
|
||||||
|
if editor.item_dragged == editor.item_hovered then
|
||||||
|
draw.mode(draw.PATTERN)
|
||||||
|
draw.pattern(editor.ants)
|
||||||
|
end
|
||||||
|
sprites.draw_sprite_selected(v)
|
||||||
|
draw.mode(draw.NORMAL)
|
||||||
else
|
else
|
||||||
if (not ignore_selected) or (not v.no_shadow) or (app.update ~= game.update) then
|
if (not ignore_selected) or (not v.no_shadow) or (app.update ~= game.update) then
|
||||||
sprites.draw_sprite(v)
|
sprites.draw_sprite(v)
|
||||||
@@ -632,6 +637,7 @@ sprites = {
|
|||||||
draw.surf(sx, sy, w, h, x, y, w, h, f)
|
draw.surf(sx, sy, w, h, x, y, w, h, f)
|
||||||
draw.surf(sx, sy, w, h, x+1, y+1, w, h, f)
|
draw.surf(sx, sy, w, h, x+1, y+1, w, h, f)
|
||||||
pal.subpal()
|
pal.subpal()
|
||||||
|
draw.mode(draw.NORMAL)
|
||||||
draw.surf(sx, sy, w, h, x, y, w, h, f)
|
draw.surf(sx, sy, w, h, x, y, w, h, f)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user