mirror of
https://github.com/cmclark00/mintris.git
synced 2025-05-18 21:05:21 +01:00
Update progression screen to use minimalist black/white/theme color scheme
This commit is contained in:
parent
4166fe2b7a
commit
5c10c6d051
4 changed files with 83 additions and 21 deletions
|
@ -286,8 +286,8 @@ class PlayerProgressionManager(context: Context) {
|
|||
private const val KEY_UNLOCKED_BADGES = "unlocked_badges"
|
||||
|
||||
// XP curve parameters
|
||||
private const val BASE_XP = 1000.0 // Base XP for level 1
|
||||
private const val XP_CURVE_FACTOR = 1.5 // Exponential factor for XP curve
|
||||
private const val BASE_XP = 2500.0 // Base XP for level 1 (increased from 1000)
|
||||
private const val XP_CURVE_FACTOR = 2.0 // Exponential factor for XP curve (increased from 1.5)
|
||||
|
||||
// XP calculation constants
|
||||
private const val LEVEL_MULTIPLIER = 0.1 // 10% bonus per level
|
||||
|
@ -296,7 +296,7 @@ class PlayerProgressionManager(context: Context) {
|
|||
private const val PERFECT_CLEAR_XP_BONUS = 200L
|
||||
private const val TIME_XP_PER_MINUTE = 5L
|
||||
|
||||
// Theme IDs
|
||||
// Theme IDs with required levels
|
||||
const val THEME_CLASSIC = "theme_classic"
|
||||
const val THEME_NEON = "theme_neon"
|
||||
const val THEME_MONOCHROME = "theme_monochrome"
|
||||
|
@ -304,10 +304,42 @@ class PlayerProgressionManager(context: Context) {
|
|||
const val THEME_MINIMALIST = "theme_minimalist"
|
||||
const val THEME_GALAXY = "theme_galaxy"
|
||||
|
||||
// Map of themes to required levels
|
||||
val THEME_REQUIRED_LEVELS = mapOf(
|
||||
THEME_CLASSIC to 1,
|
||||
THEME_NEON to 5,
|
||||
THEME_MONOCHROME to 10,
|
||||
THEME_RETRO to 15,
|
||||
THEME_MINIMALIST to 20,
|
||||
THEME_GALAXY to 25
|
||||
)
|
||||
|
||||
// Power IDs
|
||||
const val POWER_FREEZE_TIME = "power_freeze_time"
|
||||
const val POWER_BLOCK_SWAP = "power_block_swap"
|
||||
const val POWER_SAFE_LANDING = "power_safe_landing"
|
||||
const val POWER_PERFECT_CLEAR = "power_perfect_clear"
|
||||
|
||||
// Map of powers to required levels
|
||||
val POWER_REQUIRED_LEVELS = mapOf(
|
||||
POWER_FREEZE_TIME to 8,
|
||||
POWER_BLOCK_SWAP to 12,
|
||||
POWER_SAFE_LANDING to 18,
|
||||
POWER_PERFECT_CLEAR to 30
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the required level for a specific theme
|
||||
*/
|
||||
fun getRequiredLevelForTheme(themeId: String): Int {
|
||||
return THEME_REQUIRED_LEVELS[themeId] ?: 1
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the required level for a specific power
|
||||
*/
|
||||
fun getRequiredLevelForPower(powerId: String): Int {
|
||||
return POWER_REQUIRED_LEVELS[powerId] ?: 1
|
||||
}
|
||||
}
|
|
@ -130,25 +130,25 @@ class ProgressionScreen @JvmOverloads constructor(
|
|||
*/
|
||||
private fun createRewardCard(rewardText: String): CardView {
|
||||
val card = CardView(context).apply {
|
||||
radius = 16f
|
||||
cardElevation = 8f
|
||||
radius = 0f
|
||||
cardElevation = 0f
|
||||
useCompatPadding = true
|
||||
setCardBackgroundColor(Color.parseColor("#FFD700")) // Gold background
|
||||
setCardBackgroundColor(Color.TRANSPARENT)
|
||||
|
||||
layoutParams = LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
).apply {
|
||||
setMargins(16, 16, 16, 16)
|
||||
setMargins(16, 8, 16, 8)
|
||||
}
|
||||
}
|
||||
|
||||
// Add reward text
|
||||
val textView = TextView(context).apply {
|
||||
text = rewardText
|
||||
setTextColor(Color.BLACK)
|
||||
setTextColor(Color.WHITE)
|
||||
textSize = 18f
|
||||
setPadding(32, 24, 32, 24)
|
||||
setPadding(16, 12, 16, 12)
|
||||
textAlignment = View.TEXT_ALIGNMENT_CENTER
|
||||
}
|
||||
|
||||
|
|
|
@ -105,6 +105,14 @@ class ThemeSelector @JvmOverloads constructor(
|
|||
}
|
||||
}
|
||||
|
||||
// Create theme content container
|
||||
val container = FrameLayout(context).apply {
|
||||
layoutParams = FrameLayout.LayoutParams(
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
FrameLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
}
|
||||
|
||||
// Create the theme preview
|
||||
val themePreview = View(context).apply {
|
||||
layoutParams = FrameLayout.LayoutParams(
|
||||
|
@ -133,6 +141,23 @@ class ThemeSelector @JvmOverloads constructor(
|
|||
}
|
||||
}
|
||||
|
||||
// Add level requirement for locked themes
|
||||
val levelRequirement = TextView(context).apply {
|
||||
text = "Level ${themeInfo.unlockLevel}"
|
||||
setTextColor(Color.WHITE)
|
||||
textSize = 12f
|
||||
textAlignment = View.TEXT_ALIGNMENT_CENTER
|
||||
visibility = if (isUnlocked) View.GONE else View.VISIBLE
|
||||
|
||||
// Position at the center of the card
|
||||
layoutParams = FrameLayout.LayoutParams(
|
||||
FrameLayout.LayoutParams.WRAP_CONTENT,
|
||||
FrameLayout.LayoutParams.WRAP_CONTENT
|
||||
).apply {
|
||||
gravity = android.view.Gravity.CENTER
|
||||
}
|
||||
}
|
||||
|
||||
// Add a lock icon if the theme is locked
|
||||
val lockOverlay = View(context).apply {
|
||||
layoutParams = FrameLayout.LayoutParams(
|
||||
|
@ -145,10 +170,14 @@ class ThemeSelector @JvmOverloads constructor(
|
|||
visibility = if (isUnlocked) View.GONE else View.VISIBLE
|
||||
}
|
||||
|
||||
// Add all elements to the card
|
||||
card.addView(themePreview)
|
||||
card.addView(themeLabel)
|
||||
card.addView(lockOverlay)
|
||||
// Add all elements to container
|
||||
container.addView(themePreview)
|
||||
container.addView(themeLabel)
|
||||
container.addView(lockOverlay)
|
||||
container.addView(levelRequirement)
|
||||
|
||||
// Add container to card
|
||||
card.addView(container)
|
||||
|
||||
// Set up click listener only for unlocked themes
|
||||
if (isUnlocked) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
android:background="#1F1F1F">
|
||||
android:background="@color/black">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/progression_title"
|
||||
|
@ -13,7 +13,7 @@
|
|||
android:text="LEVEL PROGRESS"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
@ -24,7 +24,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:text="Player Level: 1"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="24dp" />
|
||||
|
||||
|
@ -56,7 +56,8 @@
|
|||
android:textColor="#FFD700"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="16dp" />
|
||||
android:layout_marginBottom="16dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -73,14 +74,14 @@
|
|||
|
||||
<Button
|
||||
android:id="@+id/continue_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="CONTINUE"
|
||||
android:textSize="18sp"
|
||||
android:padding="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="@drawable/rounded_button"
|
||||
android:textColor="#FFFFFF" />
|
||||
android:background="@color/transparent"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
</LinearLayout>
|
Loading…
Add table
Add a link
Reference in a new issue