added new action DisableEnableBlock
This commit is contained in:
@@ -297,10 +297,12 @@ public abstract class Block extends StretchableTile{
|
||||
internalContacts.remove(blockContact);
|
||||
}
|
||||
|
||||
public static Select selector(Block preselected,Collection<Block> exclude) {
|
||||
public static Select selector(Object preset,Collection<Block> exclude) {
|
||||
Block preselected = preset instanceof Block ? (Block) preset : null;
|
||||
String firstEntry = preset instanceof String ? (String) preset : t("unset");
|
||||
if (isNull(exclude)) exclude = new Vector<Block>();
|
||||
Select select = new Select(Block.class.getSimpleName());
|
||||
new Tag("option").attr("value","0").content(t("unset")).addTo(select);
|
||||
new Tag("option").attr("value","0").content(firstEntry).addTo(select);
|
||||
List<Block> blocks = BaseClass.listElements(Block.class);
|
||||
Collections.sort(blocks, (b1,b2) -> b1.name.compareTo(b2.name));
|
||||
for (Block block : blocks) {
|
||||
|
||||
@@ -93,7 +93,7 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
|
||||
public Map<Connector,Turnout.State> connections(Direction from){
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
|
||||
public int height() {
|
||||
return 1;
|
||||
}
|
||||
@@ -477,6 +477,11 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
|
||||
plan.place(this);
|
||||
}
|
||||
|
||||
public void setEnabled(boolean newState) {
|
||||
disabled = !newState;
|
||||
plan.place(this);
|
||||
}
|
||||
|
||||
public void unlock() {
|
||||
route = null;
|
||||
train = null;
|
||||
|
||||
Reference in New Issue
Block a user