diff options
Diffstat (limited to 'src')
3 files changed, 52 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt index 627467f03..c4d5d311e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt @@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.features.nether.reputationhelper.miniboss.DailyMini import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems +import at.hannibal2.skyhanni.utils.TabListUtils import com.google.gson.JsonObject import net.minecraftforge.client.event.RenderGameOverlayEvent import net.minecraftforge.fml.common.eventhandler.EventPriority @@ -24,9 +25,11 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { val kuudraBossHelper = DailyKuudraBossHelper(this) var repoData: JsonObject = JsonObject() + var factionType = FactionType.NONE private val display = mutableListOf<List<Any>>() private var dirty = true + private var tick = 0 init { skyHanniMod.loadModule(questHelper) @@ -53,16 +56,35 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { dirty = false updateRender() } + + tick++ + if (tick % 60 == 0) { + TabListUtils.getTabList() + .filter { it.contains("Reputation:") } + .forEach { + factionType = if (it.contains("Mage")) { + FactionType.MAGE + } else if (it.contains("Barbarian")) { + FactionType.BARBARIAN + } else { + FactionType.NONE + } + } + } } private fun updateRender() { display.clear() + //TODO test + if (factionType == FactionType.NONE) return + display.add(Collections.singletonList("Reputation Helper:")) questHelper.render(display) miniBossHelper.render(display) - //TODO check if mage - kuudraBossHelper.render(display) + if (factionType == FactionType.MAGE) { + kuudraBossHelper.render(display) + } } @SubscribeEvent(priority = EventPriority.LOWEST) diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/FactionType.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/FactionType.kt new file mode 100644 index 000000000..389f1ccc0 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/FactionType.kt @@ -0,0 +1,8 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper + +enum class FactionType { + BARBARIAN, + MAGE, + + NONE +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt index 949963414..5d051b5d2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.ProfileApiDataLoadedEvent import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper +import at.hannibal2.skyhanni.features.nether.reputationhelper.FactionType import at.hannibal2.skyhanni.features.nether.reputationhelper.dailykuudra.KuudraTier import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest.* import at.hannibal2.skyhanni.features.nether.reputationhelper.miniboss.CrimsonMiniBoss @@ -16,6 +17,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import at.hannibal2.skyhanni.utils.RenderUtils.highlight @@ -29,9 +31,11 @@ import java.util.* class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { + private val townBoardMage = LorenzVec(-138, 92, -754) + private val townBoardBarbarian = LorenzVec(-572, 100, -687) + private var tick = 0 private val loader = QuestLoader(this) - val quests = mutableListOf<Quest>() private val sacksCache = mutableMapOf<String, Long>() private var latestTrophyFishInInventory = 0 @@ -221,6 +225,21 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { event.drawWaypointFilled(location, LorenzColor.WHITE.toColor()) event.drawDynamicText(location, quest.displayName, 1.5) } + + renderTownBoard(event) + } + + private fun renderTownBoard(event: RenderWorldLastEvent) { + if (quests.any { it.state == QuestState.READY_TO_COLLECT || it.state == QuestState.NOT_ACCEPTED }) { + val location = when (reputationHelper.factionType) { + FactionType.BARBARIAN -> townBoardBarbarian + FactionType.MAGE -> townBoardMage + + FactionType.NONE -> return + } + event.drawWaypointFilled(location, LorenzColor.WHITE.toColor()) + event.drawDynamicText(location, "Town Board", 1.5) + } } fun render(display: MutableList<List<Any>>) { |