mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-04-01 07:33:09 +00:00
Account for scrolled view when assigning and unassigning scripts.
This commit is contained in:
parent
7901dba5f3
commit
fdb36f9aab
@ -117,15 +117,15 @@ public class MapEditor extends Editor<Map, MapEditor.DrawMode> implements EventH
|
||||
}
|
||||
|
||||
public void assignScript(Script script, double x, double y) {
|
||||
int xx = (int) (x / tileWidth);
|
||||
int yy = (int) (y / tileHeight);
|
||||
int xx = (int) (x / tileWidth) + posX;
|
||||
int yy = (int) (y / tileHeight) + posY;
|
||||
getCurrentMap().putLocationScript(xx, yy, script);
|
||||
redraw();
|
||||
}
|
||||
|
||||
public void unassignScripts(double x, double y) {
|
||||
int xx = (int) (x / tileWidth);
|
||||
int yy = (int) (y / tileHeight);
|
||||
int xx = (int) (x / tileWidth) + posX;
|
||||
int yy = (int) (y / tileHeight) + posY;
|
||||
getCurrentMap().removeLocationScripts(xx, yy);
|
||||
redraw();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user