Add definitions for shop

This commit is contained in:
Phillip Thelen 2024-04-02 16:56:43 +02:00
parent fe659619bb
commit 99b0d1d9fe
7 changed files with 31 additions and 1 deletions

View file

@ -467,6 +467,13 @@
<deepLink app:uri="habitica.com/inventory/time" />
<deepLink app:uri="habitica.com/shops/time" />
</fragment>
<fragment
android:id="@+id/customizationsShopFragment"
android:name="com.habitrpg.android.habitica.ui.fragments.inventory.shops.CuostimzationsShopFragment"
android:label="@string/customizations">
<deepLink app:uri="habitica.com/inventory/customizations" />
<deepLink app:uri="habitica.com/shops/customizations" />
</fragment>
<fragment
android:id="@+id/supportMainFragment"
android:name="com.habitrpg.android.habitica.ui.fragments.support.SupportMainFragment"

View file

@ -664,7 +664,7 @@
<string name="strike_description_title">Whats a Rage Strike?</string>
<string name="strike_active_title">The %s was Attacked!</string>
<string name="strike_active_description">Our beloved %s was devastated when the %s shattered the %s. Quickly, tackle your tasks to defeat the monster and help rebuild!!</string>
<string name="questShop">Quest Shop</string>
<string name="questShop">Quests</string>
<string name="market_owner_long">Alex the Merchant</string>
<string name="tavern_owner_long">Daniel the inn keeper</string>
<string name="stable_owner_long">Matt the beast master</string>
@ -1479,6 +1479,8 @@
<string name="error_loading_member_body">There was an error when loading this player\'s data. Please make sure you typed their @username correctly.</string>
<string name="preference_email_content_release">Content releases + Events</string>
<string name="report_challenge">Report Challenge</string>
<string name="customizations_owner">Felicitus</string>
<string name="customizations">Customizations</string>
<plurals name="you_x_others">

View file

@ -141,5 +141,9 @@
<key>reviewCheckingMinCount</key>
<value>2</value>
</entry>
<entry>
<key>enableCustomizationShop</key>
<value>true</value>
</entry>
</defaultsMap>
<!-- END xml_defaults -->

View file

@ -181,4 +181,8 @@ class AppConfigManager(contentRepository: ContentRepository?) : com.habitrpg.com
val events = ((worldState?.events as? List<WorldStateEvent>) ?: listOf(worldState?.currentEvent))
return events.firstOrNull { it?.eventKey == "birthday10" && it.end?.after(Date()) == true }
}
fun enableCustomizationShop(): Boolean {
return remoteConfig.getBoolean("enableCustomizationShop")
}
}

View file

@ -17,6 +17,7 @@ class Shop {
QUEST_SHOP -> R.string.questShop_owner
SEASONAL_SHOP -> R.string.seasonalShop_owner
TIME_TRAVELERS_SHOP -> R.string.timetravelers_owner
CUSTOMIZATIONS -> R.string.customizations_owner
else -> R.string.market_owner
}
@ -27,5 +28,6 @@ class Shop {
const val QUEST_SHOP = "questShop"
const val TIME_TRAVELERS_SHOP = "timeTravelersShop"
const val SEASONAL_SHOP = "seasonalShop"
const val CUSTOMIZATIONS = "customizations"
}
}

View file

@ -416,6 +416,15 @@ class NavigationDrawerFragment : DialogFragment() {
context.getString(R.string.questShop)
)
)
if (configManager.enableCustomizationShop()) {
items.add(
HabiticaDrawerItem(
R.id.customizationsShopFragment,
SIDEBAR_SHOPS_CUSTOMIZATIONS,
context.getString(R.string.customizations)
)
)
}
val seasonalShopEntry = HabiticaDrawerItem(
R.id.seasonalShopFragment,
SIDEBAR_SHOPS_SEASONAL,
@ -791,6 +800,7 @@ class NavigationDrawerFragment : DialogFragment() {
const val SIDEBAR_INVENTORY = "inventory"
const val SIDEBAR_SHOPS_MARKET = "market"
const val SIDEBAR_SHOPS_QUEST = "questShop"
const val SIDEBAR_SHOPS_CUSTOMIZATIONS = "customizationsShop"
const val SIDEBAR_SHOPS_SEASONAL = "seasonalShop"
const val SIDEBAR_SHOPS_TIMETRAVEL = "timeTravelersShop"
const val SIDEBAR_AVATAR = "avatar"

View file

@ -304,6 +304,7 @@ open class ShopFragment : BaseMainFragment<FragmentRefreshRecyclerviewBinding>()
Shop.QUEST_SHOP -> "quests"
Shop.TIME_TRAVELERS_SHOP -> "time-travelers"
Shop.SEASONAL_SHOP -> "seasonal"
Shop.CUSTOMIZATIONS -> "customizations"
else -> ""
}
lifecycleScope.launchCatching({