-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace BlessingToast with elementa version
- Loading branch information
Showing
3 changed files
with
60 additions
and
97 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
55 changes: 55 additions & 0 deletions
55
src/main/kotlin/gg/skytils/skytilsmod/utils/toast/BlessingToast.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,55 @@ | ||
/* | ||
* Skytils - Hypixel Skyblock Quality of Life Mod | ||
* Copyright (C) 2020-2023 Skytils | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published | ||
* by the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package gg.skytils.skytilsmod.utils.toast | ||
|
||
import gg.essential.elementa.components.UIImage | ||
import gg.essential.universal.ChatColor | ||
import net.minecraft.util.EnumChatFormatting | ||
|
||
class BlessingToast(blessingType: String, buffs: List<BlessingBuff>) : | ||
Toast( | ||
title = when (blessingType) { | ||
"life" -> ChatColor.RED | ||
"power" -> ChatColor.LIGHT_PURPLE | ||
"stone" -> ChatColor.GREEN | ||
"wisdom" -> ChatColor.AQUA | ||
"time" -> ChatColor.GOLD | ||
else -> ChatColor.GOLD | ||
} + | ||
"§l${blessingType.uppercase()} BLESSING!" | ||
, UIImage.ofResource("/assets/skytils/toasts/blessings/${blessingType}.png")) | ||
{ | ||
init { | ||
subtextState.set( | ||
buffs.joinToString(separator = " ") { buff -> | ||
val color: String = when (buff.symbol) { | ||
"❤", "❁" -> EnumChatFormatting.RED.toString() | ||
"✎" -> EnumChatFormatting.AQUA.toString() | ||
"❈", "HP" -> EnumChatFormatting.GREEN.toString() | ||
"✦" -> EnumChatFormatting.WHITE.toString() | ||
"☠" -> EnumChatFormatting.BLUE.toString() | ||
else -> EnumChatFormatting.GRAY.toString() | ||
} | ||
"$color${buff.amount}${buff.symbol}" | ||
} | ||
) | ||
} | ||
|
||
class BlessingBuff(val amount: String, val symbol: String) | ||
} |
89 changes: 0 additions & 89 deletions
89
src/main/kotlin/gg/skytils/skytilsmod/utils/toasts/BlessingToast.kt
This file was deleted.
Oops, something went wrong.