This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
-
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.
highlight completed commissions in commissions menu - fix #34
- Loading branch information
Showing
13 changed files
with
83 additions
and
14 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
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
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 was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
src/main/kotlin/dev/nyon/skylper/skyblock/mining/Mining.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,11 @@ | ||
package dev.nyon.skylper.skyblock.mining | ||
|
||
import dev.nyon.skylper.skyblock.mining.hollows.HollowsModule | ||
import dev.nyon.skylper.skyblock.mining.menu.CommissionHighlighter | ||
|
||
object Mining { | ||
fun init() { | ||
HollowsModule.init() | ||
CommissionHighlighter | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/dev/nyon/skylper/skyblock/mining/menu/CommissionHighlighter.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,21 @@ | ||
package dev.nyon.skylper.skyblock.mining.menu | ||
|
||
import dev.nyon.skylper.config.config | ||
import dev.nyon.skylper.extensions.event.EventHandler.listenEvent | ||
import dev.nyon.skylper.extensions.event.RenderItemBackgroundEvent | ||
import dev.nyon.skylper.extensions.rawLore | ||
import dev.nyon.skylper.extensions.regex | ||
|
||
object CommissionHighlighter { | ||
private val commissionsTitleRegex = regex("menu.commissions.title") | ||
private val commissionCompletedRegex = regex("menu.commissions.completed") | ||
|
||
@Suppress("unused") | ||
val renderBackgroundEvent = listenEvent<RenderItemBackgroundEvent, Int?> { | ||
if (!config.mining.highlightCompletedCommissions) return@listenEvent null | ||
if (!commissionsTitleRegex.matches(rawTitle)) return@listenEvent null | ||
val item = slot.item | ||
if (item.rawLore.none { commissionCompletedRegex.matches(it) }) return@listenEvent null | ||
return@listenEvent config.mining.completedCommissionsHighlightColor.rgb | ||
} | ||
} |
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