-
-
Notifications
You must be signed in to change notification settings - Fork 189
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 Cheap Items in Slayer, Fishing and Diana Item Pr…
…ofit Trackers.
- Loading branch information
1 parent
060d521
commit 1279308
Showing
5 changed files
with
82 additions
and
2 deletions.
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
37 changes: 37 additions & 0 deletions
37
src/main/java/at/hannibal2/skyhanni/data/TrackerManager.kt
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,37 @@ | ||
package at.hannibal2.skyhanni.data | ||
|
||
import at.hannibal2.skyhanni.SkyHanniMod | ||
import at.hannibal2.skyhanni.events.ConfigLoadEvent | ||
import at.hannibal2.skyhanni.events.GuiRenderEvent | ||
import at.hannibal2.skyhanni.utils.LorenzUtils | ||
import net.minecraftforge.fml.common.eventhandler.EventPriority | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent | ||
|
||
object TrackerManager { | ||
|
||
private var hasChanged = false | ||
var dirty = false | ||
|
||
@SubscribeEvent | ||
fun onConfigLoad(event: ConfigLoadEvent) { | ||
val config = SkyHanniMod.feature.misc.tracker.hideCheapItems | ||
LorenzUtils.onToggle(config.alwaysShowBest, config.minPrice, config.enabled) { | ||
hasChanged = true | ||
} | ||
} | ||
|
||
@SubscribeEvent(priority = EventPriority.HIGHEST) | ||
fun onRenderOverlayFirst(event: GuiRenderEvent) { | ||
if (hasChanged) { | ||
dirty = true | ||
} | ||
} | ||
|
||
@SubscribeEvent(priority = EventPriority.LOWEST) | ||
fun onRenderOverlayLast(event: GuiRenderEvent) { | ||
if (hasChanged) { | ||
dirty = false | ||
hasChanged = false | ||
} | ||
} | ||
} |
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