Add support for world-level hide/show in visibleregions and hiddenregions using "world:<worldname>" syntax

This commit is contained in:
Mike Primm 2011-12-25 05:05:22 +08:00 committed by mikeprimm
parent 74ab9442bd
commit 7dcae62dc4
2 changed files with 7 additions and 5 deletions

View File

@ -138,19 +138,19 @@ public class DynmapFactionsPlugin extends JavaPlugin {
return v;
}
private boolean isVisible(String id) {
private boolean isVisible(String id, String worldname) {
if((visible != null) && (visible.size() > 0)) {
if(visible.contains(id) == false) {
if((visible.contains(id) == false) && (visible.contains("world:" + worldname) == false)) {
return false;
}
}
if((hidden != null) && (hidden.size() > 0)) {
if(hidden.contains(id))
if(hidden.contains(id) || hidden.contains("world:" + worldname))
return false;
}
return true;
}
private void addStyle(String resid, AreaMarker m) {
AreaStyle as = cusstyle.get(resid);
if(as == null) {
@ -224,7 +224,7 @@ public class DynmapFactionsPlugin extends JavaPlugin {
String desc = formatInfoWindow(fact);
/* Handle areas */
if(isVisible(factname)) {
if(isVisible(factname, world)) {
if(blocks.isEmpty())
return;
LinkedList<FactionBlock> nodevals = new LinkedList<FactionBlock>();

View File

@ -25,9 +25,11 @@ regionstyle:
homeicon: "redflag"
# Optional setting to limit which regions to show, by name - if commented out, all regions are shown
# To show all regions on a given world, add 'world:<worldname>' to the list
visibleregions: [ ]
# Optional setting to hide specific regions, by name
# To hide all regions on a given world, add 'world:<worldname>' to the list
hiddenregions: [ ]
# Optional per-region overrides for regionstyle (any defined replace those in regionstyle)