This repository has been archived by the owner on Dec 24, 2023. It is now read-only.
forked from EnderWiggin/hafen-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added option to hide trees, plants, houses and fences (CTRL+V)
- Loading branch information
Showing
5 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package haven; | ||
|
||
public class ViewFilter extends Window { | ||
public static ConfigSettingBoolean trees = new ConfigSettingBoolean("filter-tress", "Trees", true); | ||
public static ConfigSettingBoolean plants = new ConfigSettingBoolean("filter-plants", "Plants", true); | ||
public static ConfigSettingBoolean fences = new ConfigSettingBoolean("filter-fences", "Fences", true); | ||
public static ConfigSettingBoolean houses = new ConfigSettingBoolean("filter-houses", "Houses", true); | ||
|
||
public ViewFilter() { | ||
super(Coord.z, "View", true); | ||
int y = 0; | ||
|
||
add(trees.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(); | ||
} | ||
|
||
@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/plants/")) | ||
return plants.isEnabled(); | ||
|
||
if (res.name.startsWith("gfx/terobjs/arch/palisade") || res.name.startsWith("gfx/terobjs/arch/pole")) | ||
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") | ||
) | ||
return houses.isEnabled(); | ||
|
||
|
||
return true; | ||
} | ||
} |