Skip to content

Commit

Permalink
show potential gep cap
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Sep 11, 2024
1 parent 0e756fc commit 90fdbc7
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 5 deletions.
2 changes: 2 additions & 0 deletions HabitRPG/Generated/Assets-Images.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ internal enum Asset {
internal static let gemPurchaseFooterSparkles = ImageAsset(name: "gem_purchase_footer_sparkles")
internal static let gemPurchaseHeader = ImageAsset(name: "gem_purchase_header")
internal static let gemPurchaseHeaderDark = ImageAsset(name: "gem_purchase_header_dark")
internal static let gemcapLeft = ImageAsset(name: "gemcap_left")
internal static let gemcapRight = ImageAsset(name: "gemcap_right")
internal static let giftSubGift = ImageAsset(name: "gift_sub_gift")
internal static let grabIndicator = ImageAsset(name: "grab_indicator")
internal static let gryphon = ImageAsset(name: "gryphon")
Expand Down
1 change: 0 additions & 1 deletion HabitRPG/Generated/Storyboard Segues.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ internal enum StoryboardSegue {
case showWebPromoSegue
case subscriptionSegue
case tasksBoardSegue
case unwindToList
}
internal enum Settings: String, SegueType {
case fixValuesSegue = "FixValuesSegue"
Expand Down
6 changes: 6 additions & 0 deletions HabitRPG/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,8 @@ public enum L10n {
public static var resetStreak: String { return L10n.tr("Mainstrings", "resetStreak") }
/// Resubscribe
public static var resubscribe: String { return L10n.tr("Mainstrings", "resubscribe") }
/// Resubscribe to pick up where you left off!
public static var resubscribeToPickUp: String { return L10n.tr("Mainstrings", "resubscribe_to_pick_up") }
/// Resume Damage
public static var resumeDamage: String { return L10n.tr("Mainstrings", "resume_damage") }
/// Resync
Expand Down Expand Up @@ -1340,6 +1342,10 @@ public enum L10n {
public static func xToY(_ p1: String, _ p2: String) -> String {
return L10n.tr("Mainstrings", "x_to_y", p1, p2)
}
/// %d/%d Gem Cap
public static func xxGemCap(_ p1: Int, _ p2: Int) -> String {
return L10n.tr("Mainstrings", "x_x_gem_cap", p1, p2)
}
/// year
public static var year: String { return L10n.tr("Mainstrings", "year") }
/// Yearly
Expand Down
23 changes: 23 additions & 0 deletions HabitRPG/Images.xcassets/gemcap_left.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "UnionLeft.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions HabitRPG/Images.xcassets/gemcap_right.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Union.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions HabitRPG/Strings/Base.lproj/Mainstrings.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1402,3 +1402,5 @@
"got_it" = "Got it!";
"open_stats" = "Open Stats";
"continue_benefits" = "Continue Benefits";
"x_x_gem_cap" = "%d / %d Gem Cap";
"resubscribe_to_pick_up" = "Resubscribe to pick up where you left off!";
8 changes: 4 additions & 4 deletions HabitRPG/UI/Purchases/SubscriptionDetailViewUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ struct SubscriptionDetailViewUI: View {
HStack(spacing: 4) {
Image(Asset.calendarLarge.name)
Text("\(plan.consecutive?.count ?? 0)")
.font(.system(size: 22, weight: .medium))
.font(.system(size: 22, weight: .bold))
}
Text(L10n.Subscription.monthsSubscribed)
.font(.system(size: 13, weight: .semibold))
Expand All @@ -203,10 +203,10 @@ struct SubscriptionDetailViewUI: View {
HStack(spacing: 4) {
Image(Asset.bigGem.name)
Text("\(plan.gemCapTotal)")
.font(.system(size: 22, weight: .semibold))
.font(.system(size: 22, weight: .bold))
}
Text(L10n.Subscription.monthlyGems)
.font(.system(size: 13, weight: .medium))
.font(.system(size: 13, weight: .semibold))
}
}
}
Expand All @@ -217,7 +217,7 @@ struct SubscriptionDetailViewUI: View {
VStack {
if let date = nextHourglassDate {
Text(date, formatter: monthFormatter)
.font(.system(size: 22, weight: .semibold))
.font(.system(size: 22, weight: .bold))
}
Text(L10n.Subscription.nextHourglassDelivery)
.font(.system(size: 13, weight: .semibold))
Expand Down
32 changes: 32 additions & 0 deletions HabitRPG/UI/Purchases/SubscriptionPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,36 @@ struct SubscriptionPage: View {
.padding(.horizontal, 24)
SubscriptionSeparator()
.padding(.horizontal, 24)
if (viewModel.subscriptionPlan?.consecutive?.gemCapExtra ?? 0) > 0 {
VStack(spacing: 0) {
HStack(spacing: 10) {
Image(Asset.gemcapLeft.name)
Text(L10n.xxGemCap(viewModel.subscriptionPlan?.gemCapTotal ?? 0, 50))
.font(.system(size: 20, weight: .bold))
Image(Asset.gemcapRight.name)
}
Text(L10n.resubscribeToPickUp).font(.system(size: 13))
if #available(iOS 15.0, *) {
GeometryReader { reader in
ZStack(alignment: .leading) {
Rectangle()
.foregroundColor(.purple100)
.fill()
.cornerRadius(4)
.frame(maxWidth: .infinity)
.frame(height: 8)
Rectangle()
.foregroundColor(.green100)
.fill()
.cornerRadius(4)
.frame(width: reader.size.width * (CGFloat(viewModel.subscriptionPlan?.gemCapTotal ?? 0) / 50.0), height: 8)
}
}
.padding(.top, 8)
.padding(.horizontal, 41)
}
}.padding(.bottom, 24)
}
SubscriptionBenefitListView(presentationPoint: viewModel.presentationPoint, mysteryGear: viewModel.mysteryGear)
.padding(.horizontal, 24)
ZStack(alignment: .top) {
Expand All @@ -317,6 +347,8 @@ struct SubscriptionPage: View {
}
}
}
.padding(.horizontal, 24)
.padding(.bottom, 24)
Rectangle()
.frame(height: viewModel.showHourglassPromo && viewModel.selectedSubscription == viewModel.availableSubscriptions.last ? 186 : 126)
.cornerRadius(12)
Expand Down

0 comments on commit 90fdbc7

Please sign in to comment.