implemented selection of train destination
This commit is contained in:
@@ -282,7 +282,7 @@ public abstract class Block extends StretchableTile{
|
||||
replacements.put("%text%",name);
|
||||
if (isSet(train)) replacements.put("%text%",train.directedName());
|
||||
Tag tag = super.tag(replacements);
|
||||
if (isSet(train)) tag.clazz(tag.get("class")+" occupied");
|
||||
tag.clazz(tag.get("class")+" Block");
|
||||
return tag;
|
||||
}
|
||||
|
||||
@@ -355,4 +355,4 @@ public abstract class Block extends StretchableTile{
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package de.srsoftware.web4rail.tiles;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
import de.srsoftware.tools.Tag;
|
||||
import de.srsoftware.web4rail.Connector;
|
||||
import de.srsoftware.web4rail.Plan.Direction;
|
||||
import de.srsoftware.web4rail.tiles.Turnout.State;
|
||||
@@ -25,4 +27,11 @@ public class Shadow extends Tile{
|
||||
public Tile overlay() {
|
||||
return overlay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tag tag(Map<String, Object> replacements) throws IOException {
|
||||
Tag tag = super.tag(replacements);
|
||||
if (overlay instanceof Block) tag.attr("class", tag.get("class")+" Block");
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user