Skip to content

Commit

Permalink
make labels not permanent, will this cause lag/issues if there are mu…
Browse files Browse the repository at this point in the history
…ltiple on the map?
  • Loading branch information
JasonP01 committed Dec 25, 2024
1 parent bdfe97a commit 694ddba
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,24 @@ class EventListener(instances: InstanceManager) : ImperiumApplication.Listener {
}
}

// @TaskHandler(interval = 1L, unit = MindustryTimeUnit.SECONDS)
@TaskHandler(interval = 1L, unit = MindustryTimeUnit.SECONDS)
fun crateRarityLabel() {
// TODO: Markers
crates.forEach {
val (x, y, rarity) = it
val rarityText = when (rarity) {
1 -> "Common"
2 -> "Uncommon"
3 -> "Rare"
4 -> "Epic"
5 -> "Legendary"
6 -> "Mythic"
else -> "Unknown, this shouldnt happen"
}
Call.label("Event Vault\nRarity: $rarityText", 1, (x * 8).toFloat(), (y * 8).toFloat())
}
}

// TODO: should this stay during the event?
@ImperiumCommand(["crate"], Rank.ADMIN)
@Scope(MindustryGamemode.EVENT)
@ClientSide
Expand Down Expand Up @@ -151,8 +164,6 @@ class EventListener(instances: InstanceManager) : ImperiumApplication.Listener {

tile.setNet(Blocks.vault)
crates.add(Triple(x, y, newRarity))
// TODO: Make this a marker/effect for rarity (outline)
Call.label("Event Vault\nRarity: $rarity", Float.MAX_VALUE, (x * 8).toFloat(), (y * 8).toFloat())
}

@EventHandler
Expand Down

0 comments on commit 694ddba

Please sign in to comment.