mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-08-15 23:29:09 +00:00
Merge branch 'master' of https://github.com/badvision/lawless-legends
This commit is contained in:
commit
f1bc3f2734
@ -253,7 +253,7 @@ public class MapEditor extends Editor<Map, MapEditor.DrawMode> implements EventH
|
|||||||
idx = (idx + 1) % scripts.size();
|
idx = (idx + 1) % scripts.size();
|
||||||
gc.beginPath();
|
gc.beginPath();
|
||||||
gc.moveTo(xx,yy);
|
gc.moveTo(xx,yy);
|
||||||
gc.setStroke(currentMap.getScriptColor(scripts.get(idx)));
|
currentMap.getScriptColor(scripts.get(idx)).ifPresent(gc::setStroke);
|
||||||
xx += dashLength;
|
xx += dashLength;
|
||||||
gc.lineTo(xx, yy);
|
gc.lineTo(xx, yy);
|
||||||
gc.setEffect(new DropShadow(2, Color.BLACK));
|
gc.setEffect(new DropShadow(2, Color.BLACK));
|
||||||
@ -263,7 +263,7 @@ public class MapEditor extends Editor<Map, MapEditor.DrawMode> implements EventH
|
|||||||
idx = (idx + 1) % scripts.size();
|
idx = (idx + 1) % scripts.size();
|
||||||
gc.beginPath();
|
gc.beginPath();
|
||||||
gc.moveTo(xx,yy);
|
gc.moveTo(xx,yy);
|
||||||
gc.setStroke(currentMap.getScriptColor(scripts.get(idx)));
|
currentMap.getScriptColor(scripts.get(idx)).ifPresent(gc::setStroke);
|
||||||
yy += dashLength;
|
yy += dashLength;
|
||||||
gc.lineTo(xx, yy);
|
gc.lineTo(xx, yy);
|
||||||
gc.setEffect(new DropShadow(2, Color.BLACK));
|
gc.setEffect(new DropShadow(2, Color.BLACK));
|
||||||
@ -273,7 +273,7 @@ public class MapEditor extends Editor<Map, MapEditor.DrawMode> implements EventH
|
|||||||
idx = (idx + 1) % scripts.size();
|
idx = (idx + 1) % scripts.size();
|
||||||
gc.beginPath();
|
gc.beginPath();
|
||||||
gc.moveTo(xx,yy);
|
gc.moveTo(xx,yy);
|
||||||
gc.setStroke(currentMap.getScriptColor(scripts.get(idx)));
|
currentMap.getScriptColor(scripts.get(idx)).ifPresent(gc::setStroke);
|
||||||
xx -= dashLength;
|
xx -= dashLength;
|
||||||
gc.lineTo(xx, yy);
|
gc.lineTo(xx, yy);
|
||||||
gc.setEffect(new DropShadow(2, Color.BLACK));
|
gc.setEffect(new DropShadow(2, Color.BLACK));
|
||||||
@ -283,7 +283,7 @@ public class MapEditor extends Editor<Map, MapEditor.DrawMode> implements EventH
|
|||||||
idx = (idx + 1) % scripts.size();
|
idx = (idx + 1) % scripts.size();
|
||||||
gc.beginPath();
|
gc.beginPath();
|
||||||
gc.moveTo(xx,yy);
|
gc.moveTo(xx,yy);
|
||||||
gc.setStroke(currentMap.getScriptColor(scripts.get(idx)));
|
currentMap.getScriptColor(scripts.get(idx)).ifPresent(gc::setStroke);
|
||||||
yy -= dashLength;
|
yy -= dashLength;
|
||||||
gc.lineTo(xx, yy);
|
gc.lineTo(xx, yy);
|
||||||
gc.setEffect(new DropShadow(2, Color.BLACK));
|
gc.setEffect(new DropShadow(2, Color.BLACK));
|
||||||
|
@ -6,6 +6,7 @@ import java.util.Collections;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javafx.scene.image.WritableImage;
|
import javafx.scene.image.WritableImage;
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
@ -46,8 +47,8 @@ public class TileMap extends ArrayList<ArrayList<Tile>> implements Serializable
|
|||||||
private final java.util.Map<Integer, List<Script>> locationScripts = new HashMap<>();
|
private final java.util.Map<Integer, List<Script>> locationScripts = new HashMap<>();
|
||||||
private final java.util.Map<Script, Color> scriptColors = new HashMap<>();
|
private final java.util.Map<Script, Color> scriptColors = new HashMap<>();
|
||||||
|
|
||||||
public Color getScriptColor(Script s) {
|
public Optional<Color> getScriptColor(Script s) {
|
||||||
return scriptColors.get(s);
|
return Optional.ofNullable(scriptColors.get(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Script> getLocationScripts(int x, int y) {
|
public List<Script> getLocationScripts(int x, int y) {
|
||||||
@ -79,6 +80,7 @@ public class TileMap extends ArrayList<ArrayList<Tile>> implements Serializable
|
|||||||
locationScripts.put(loc, list);
|
locationScripts.put(loc, list);
|
||||||
}
|
}
|
||||||
list.add(s);
|
list.add(s);
|
||||||
|
Application.getInstance().getController().redrawScripts();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getMortonNumber(int x, int y) {
|
private int getMortonNumber(int x, int y) {
|
||||||
|
@ -306,6 +306,7 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
|
|||||||
if (empty || item == null) {
|
if (empty || item == null) {
|
||||||
setText("");
|
setText("");
|
||||||
} else {
|
} else {
|
||||||
|
getCurrentEditor().getCurrentMap().getScriptColor(item).ifPresent(this::setTextFill);
|
||||||
setText(item.getName());
|
setText(item.getName());
|
||||||
scriptDragDrop.registerDragSupport(this, item);
|
scriptDragDrop.registerDragSupport(this, item);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user