Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
Add kitty coin icon for old name formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cyb3rko committed Dec 8, 2021
1 parent ebfbeb3 commit c1ad0a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/src/main/java/com/cyb3rko/cavedroid/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ object Utils {

internal fun loadItemIcon(context: Context, imageView: ImageView, item: String, missingIcons: MutableSet<String>) {
imageView.setImageResource(0)
if (item.contains("Player Head")) {
if (item.contains("Player Head") && item != "Player Head <Cavetale>") {
if (item == "Player Head" || item == "Player Head <>") {
imageView.setImageResource(R.drawable._ic_no_image)
return
Expand Down Expand Up @@ -190,7 +190,12 @@ object Utils {
imageView.setImageResource(avatarResId)
return
}
val itemName = item.replace(" ", "_").replace("'", "").toLowerCase()
val itemName = item
.replace(" ", "_")
.replace("'", "")
.replace("<", "")
.replace(">", "")
.toLowerCase()
val formattedName = itemName.split(",")[0]
val avatarResId = context.resources.getIdentifier("_item_$formattedName", "drawable", context.packageName)
if (avatarResId != 0) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c1ad0a0

Please sign in to comment.