mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
When user is below level 10, update locked class gear message
Over level 10: This item is only available to a specific class. You can change your class from Settings. Below level 10: This item is only available to a specific class. You can select a class after level 10.
This commit is contained in:
parent
c9726049d1
commit
cadbcd17bd
2 changed files with 7 additions and 1 deletions
|
|
@ -632,6 +632,7 @@
|
|||
<string name="equipment_empty">You already have all equipment! More will be released during the Grand Galas, near the solstices and equinoxes.</string>
|
||||
<string name="classless">Classless</string>
|
||||
<string name="class_equipment_shop_dialog">This item is only available to a specific class.\nYou can change your class from Settings.</string>
|
||||
<string name="insufficient_level_equipment_dialog">This item is only available to a specific class.\nYou can select a class after level 10.</string>
|
||||
<string name="class_gear_disclaimer">You can only purchase gear for your current class</string>
|
||||
<string name="tavern_description">Welcome to the Inn! Pull up a chair to chat.</string>
|
||||
<string name="check_into_inn">Check into Inn</string>
|
||||
|
|
|
|||
|
|
@ -173,8 +173,13 @@ class PurchaseDialog(context: Context, private val userRepository : UserReposito
|
|||
|
||||
private fun setLimitedTextView() {
|
||||
if (user == null) return
|
||||
val userLvl = user?.stats?.lvl ?: 0
|
||||
if (shopItem.habitClass != null && shopItem.habitClass != "special" && shopItem.habitClass != "armoire" && user?.stats?.habitClass != shopItem.habitClass) {
|
||||
limitedTextView.text = context.getString(R.string.class_equipment_shop_dialog)
|
||||
limitedTextView.text = if (userLvl >= 10) {
|
||||
context.getString(R.string.class_equipment_shop_dialog)
|
||||
} else {
|
||||
context.getString(R.string.insufficient_level_equipment_dialog)
|
||||
}
|
||||
limitedTextView.visibility = View.VISIBLE
|
||||
limitedTextView.setBackgroundColor(ContextCompat.getColor(context, R.color.inverted_background))
|
||||
} else if (shopItem.event?.end != null) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue