Exemplo n.º 1
0
  @SuppressWarnings("SimplifiableIfStatement")
  public static boolean shouldShowGob(Gob gob) {
    Resource res = gob.getres();
    if (res == null) return true;

    if (res.name.startsWith("gfx/terobjs/trees/")) return trees.isEnabled();

    if (res.name.startsWith("gfx/terobjs/bushes/")) return bushes.isEnabled();

    if (res.name.startsWith("gfx/terobjs/plants/") && !res.basename().equals("trellis"))
      return plants.isEnabled();

    if (res.name.startsWith("gfx/terobjs/arch/palisade")
        || res.name.startsWith("gfx/terobjs/arch/pole")
        || res.name.startsWith("gfx/terobjs/arch/brickwall")) return fences.isEnabled();

    if (res.name.startsWith("gfx/terobjs/arch/logcabin")
        || res.name.startsWith("gfx/terobjs/arch/stonemansion")
        || res.name.startsWith("gfx/terobjs/arch/timberhouse")
        || res.name.startsWith("gfx/terobjs/arch/logcabin")
        || res.name.startsWith("gfx/terobjs/arch/stonestead")
        || res.name.startsWith("gfx/terobjs/arch/greathall")
        || res.name.startsWith("gfx/terobjs/arch/stonetower")) return houses.isEnabled();

    return true;
  }
Exemplo n.º 2
0
  public ViewFilter() {
    super(Coord.z, "View", true);
    int y = 0;

    add(trees.makeCheckBox(), new Coord(0, y));

    y += 25;
    add(bushes.makeCheckBox(), new Coord(0, y));

    y += 25;
    add(plants.makeCheckBox(), new Coord(0, y));

    y += 25;
    add(fences.makeCheckBox(), new Coord(0, y));

    y += 25;
    add(houses.makeCheckBox(), new Coord(0, y));

    pack();
  }