Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Quiver Display #1190

Merged
merged 51 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
cea67a7
use quiver item for quiverapi
ItsEmpa Mar 15, 2024
9cc2852
added quiver display and removed unnecessary imports
ItsEmpa Mar 16, 2024
8cd9257
merge beta
ItsEmpa Mar 16, 2024
e49951a
formatting
ItsEmpa Mar 16, 2024
c728f5c
fixed rendering while in inventory
ItsEmpa Mar 16, 2024
db0e889
added/edited some patterns
ItsEmpa Mar 16, 2024
7ade58a
quiver update event, only show type of arrow when wearing skeleton ma…
ItsEmpa Mar 16, 2024
63b35d8
Merge branch 'beta' into quiver-api
ItsEmpa Mar 16, 2024
fddc845
remove sound distance and cleanup
ItsEmpa Mar 16, 2024
937dedb
updated regex and added new config option
ItsEmpa Mar 17, 2024
8857ba8
only check bow in inventory every 2s
ItsEmpa Mar 17, 2024
ea14fc2
formatting issue when no arrow selected
ItsEmpa Mar 17, 2024
ee87832
alert when low arrors at end of dungeon
ItsEmpa Mar 17, 2024
8c5f8dd
innit
ItsEmpa Mar 18, 2024
835123e
Merge branch 'kuudraapi' into quiver-api
ItsEmpa Mar 18, 2024
8ac0f5b
fix not compiling
ItsEmpa Mar 18, 2024
4652eae
oops
ItsEmpa Mar 18, 2024
b3a4747
Merge branch 'kuudraapi' into quiver-api
ItsEmpa Mar 18, 2024
ee14078
fix display not getting updated on profile join
ItsEmpa Mar 18, 2024
84374c6
refactored quiver notification into quiver display and added config m…
ItsEmpa Mar 18, 2024
e82d49d
removed todo thing
ItsEmpa Mar 18, 2024
988a2b1
Merge branch 'beta' into quiver-api
ItsEmpa Mar 21, 2024
176eae0
Merge branch 'beta' into quiver-api
ItsEmpa Mar 23, 2024
0a1a0f4
couple fixes and new config name/descriptions
ItsEmpa Mar 23, 2024
30ce110
switch from floats to ints
ItsEmpa Mar 23, 2024
d038e0c
cleanup
ItsEmpa Mar 24, 2024
871ea81
Merge branch 'kuudraapi' into quiver-api
ItsEmpa Mar 24, 2024
77c64f3
remove other empty line and fit rest of code
CalMWolfs Mar 24, 2024
a8fb6ae
Merge branch 'kuudraapi' into quiver-api
ItsEmpa Mar 24, 2024
6987e98
Merge branch 'beta' into quiver-api
ItsEmpa Mar 26, 2024
0d76bd5
Merge branch 'beta' into quiver-api
ItsEmpa Mar 26, 2024
e28c5d3
changed show only with bow to only show when holding a bow
ItsEmpa Mar 27, 2024
16c47c7
accidentally removed that
ItsEmpa Mar 27, 2024
c9cf790
Merge branch 'beta' into quiver-api
ItsEmpa Mar 28, 2024
65d25c4
moved configs to gui
ItsEmpa Mar 28, 2024
f4ce1dc
Merge branch 'beta' into fork/quiver-api
hannibal002 Mar 30, 2024
3cd82af
changed config to dropdown
ItsEmpa Mar 30, 2024
8ced364
moved quiver display to gui
ItsEmpa Apr 2, 2024
595241a
Merge branch 'beta' into quiver-api
ItsEmpa Apr 3, 2024
b3602fd
Merge branch 'beta' into quiver-api
ItsEmpa Apr 3, 2024
5f01737
Merge branch 'beta' into fork/quiver-api
hannibal002 Apr 4, 2024
f30b54f
move
hannibal002 Apr 4, 2024
1bc5614
Merge branch 'beta' into fork/quiver-api
hannibal002 Apr 7, 2024
bccdde1
fix merge conflicts
hannibal002 Apr 7, 2024
78ca972
hanni's changes
ItsEmpa Apr 7, 2024
0ee1841
changed config
ItsEmpa Apr 8, 2024
3368625
use rarity in reminder after run
ItsEmpa Apr 8, 2024
0edce25
Merge branch 'beta' into fork/quiver-api
hannibal002 Apr 10, 2024
52da225
fix
hannibal002 Apr 10, 2024
627353f
code cleanup
hannibal002 Apr 10, 2024
f214bcb
fix item size and config migration
ItsEmpa Apr 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix item size and config migration
  • Loading branch information
ItsEmpa committed Apr 10, 2024
commit f214bcb6c723a1317479cee09a90adadc704c308
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.google.gson.JsonPrimitive
object ConfigUpdaterMigrator {

val logger = LorenzLogger("ConfigMigration")
const val CONFIG_VERSION = 34
const val CONFIG_VERSION = 35
fun JsonElement.at(chain: List<String>, init: Boolean): JsonElement? {
if (chain.isEmpty()) return this
if (this !is JsonObject) return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarityOrNull
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems
import at.hannibal2.skyhanni.utils.RenderUtils
import at.hannibal2.skyhanni.utils.RenderUtils.renderRenderables
import at.hannibal2.skyhanni.utils.StringUtils
import at.hannibal2.skyhanni.utils.renderables.Renderable
import net.minecraft.init.Items
Expand Down Expand Up @@ -51,10 +52,10 @@ class QuiverDisplay {
if (hideAmount || arrow == NONE_ARROW_TYPE) arrow.arrow else StringUtils.pluralize(amount, arrow.arrow)

if (config.showIcon.get()) {
add(Renderable.itemStack(itemStack, 1.68))
add(Renderable.itemStack(itemStack, 1.0))
}
if (!hideAmount) {
add(Renderable.string(" §b${amount.addSeparators()}x"))
add(Renderable.string("§b${amount.addSeparators()}x"))
}
add(Renderable.string(" $rarity$arrowDisplayName"))
}
Expand All @@ -77,7 +78,9 @@ class QuiverDisplay {
whenToShow == ShowWhen.ONLY_BOW_INVENTORY && QuiverAPI.hasBowInInventory() ||
whenToShow == ShowWhen.ONLY_BOW_HAND && QuiverAPI.isHoldingBow()
) {
config.quiverDisplayPos.renderStringsAndItems(listOf(display), posLabel = "Quiver Display")
val content =
Renderable.horizontalContainer(display, 1, verticalAlign = RenderUtils.VerticalAlignment.CENTER)
config.quiverDisplayPos.renderRenderables(listOf(content), posLabel = "Quiver Display")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import at.hannibal2.skyhanni.events.QuiverUpdateEvent
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarityOrNull
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.NEUItems.getItemStackOrNull
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.SimpleTimeMark
Expand Down Expand Up @@ -92,7 +91,7 @@ class QuiverWarning {
private fun lowQuiverAlert() {
if (lastLowQuiverReminder.passedSince() < 30.seconds) return
lastLowQuiverReminder = SimpleTimeMark.now()
val itemStack = NEUItems.getItemStackOrNull(arrow?.internalName?.asString() ?: return) ?: return
val itemStack = getItemStackOrNull(arrow?.internalName?.asString() ?: return) ?: return
val rarity = itemStack.getItemRarityOrNull()?.chatColorCode ?: "§f"
TitleManager.sendTitle("§cLow on $rarity${arrow?.arrow}!", 5.seconds, 3.6, 7f)
ChatUtils.chat("Low on $rarity${arrow?.arrow} §e(${amount.addSeparators()} left)")
Expand All @@ -114,6 +113,6 @@ class QuiverWarning {

@SubscribeEvent
fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
event.move(31, "inventory.quiverAlert", "combat.quiverConfig.lowQuiverNotification")
event.move(35, "inventory.quiverAlert", "combat.quiverConfig.lowQuiverNotification")
}
}
Loading