Skip to content

Commit

Permalink
sub screen tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Aug 27, 2024
1 parent f764fbd commit 5d84ac5
Show file tree
Hide file tree
Showing 30 changed files with 130 additions and 144 deletions.
18 changes: 10 additions & 8 deletions HabitRPG/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,8 @@ public enum L10n {
public static var manualSyncDescription: String { return L10n.tr("Mainstrings", "manual_sync_description") }
/// Manual Sync & Force Restart
public static var manualSyncTitle: String { return L10n.tr("Mainstrings", "manual_sync_title") }
/// Max Gem Cap
public static var maxGemCap: String { return L10n.tr("Mainstrings", "max_gem_cap") }
/// Member of a Group Plan
public static var memberGroupPlan: String { return L10n.tr("Mainstrings", "member_group_plan") }
/// Menu
Expand Down Expand Up @@ -1058,7 +1060,7 @@ public enum L10n {
public static var subscriberCurrency: String { return L10n.tr("Mainstrings", "subscriber_currency") }
/// Subscription
public static var subscription: String { return L10n.tr("Mainstrings", "subscription") }
/// Become a subscriber and you’ll get these useful benefits
/// Stay motivated with even more rewards when you subscribe
public static var subscriptionBenefitsTitle: String { return L10n.tr("Mainstrings", "subscription_benefits_title") }
/// You get these benefits for being a Subscriber
public static var subscriptionBenefitsTitleSubscribed: String { return L10n.tr("Mainstrings", "subscription_benefits_title_subscribed") }
Expand All @@ -1080,11 +1082,11 @@ public enum L10n {
public static var subscriptionInfo2Title: String { return L10n.tr("Mainstrings", "subscription_info_2_title") }
/// Subscribe now to get an exclusive set now and receive new items every month!
public static var subscriptionInfo3Description: String { return L10n.tr("Mainstrings", "subscription_info_3_description") }
/// Subscribe now to get this %@ set now and receive new items every month!
public static func subscriptionInfo3DescriptionNew(_ p1: String) -> String {
/// Stay decked out in the latest exclusive gear. Subscribe now to get %s!
public static func subscriptionInfo3DescriptionNew(_ p1: UnsafePointer<CChar>) -> String {
return L10n.tr("Mainstrings", "subscription_info_3_description_new", p1)
}
/// Monthly Mystery Items
/// Limited Monthly Gear Sets
public static var subscriptionInfo3Title: String { return L10n.tr("Mainstrings", "subscription_info_3_title") }
/// Get a Royal Purple Jackalope plus double the Eggs, Hatching Potions, and Food each day to grow your Pet collection!
public static var subscriptionInfo5Description: String { return L10n.tr("Mainstrings", "subscription_info_5_description") }
Expand Down Expand Up @@ -2739,13 +2741,13 @@ public enum L10n {
public static var gemForGoldHeader: String { return L10n.tr("Mainstrings", "subscription.gem_for_gold_header") }
/// Subscribers get Mystic Hourglasses to buy items in the Time Travelers Shop and these other exclusive benefits!
public static var hourglassesHeader: String { return L10n.tr("Mainstrings", "subscription.hourglasses_header") }
/// Get two chances at new equipment from the Armoire for the price of one
/// Get two chances to score new equipment each time you open the Enchanted Armoire!
public static var infoArmoireDescription: String { return L10n.tr("Mainstrings", "subscription.info_armoire_description") }
/// Extra Armoire chances
/// Double Armoire Rewards
public static var infoArmoireTitle: String { return L10n.tr("Mainstrings", "subscription.info_armoire_title") }
/// Have the option of hanging on with 1HP when you run out of health once a day
/// Avoid losing your progress with an instant heal when you run out of HP once a day!
public static var infoFaintDescription: String { return L10n.tr("Mainstrings", "subscription.info_faint_description") }
/// Second chance at life
/// Get a Second Chance
public static var infoFaintTitle: String { return L10n.tr("Mainstrings", "subscription.info_faint_title") }
}

Expand Down
2 changes: 1 addition & 1 deletion HabitRPG/Habitica-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>993</string>
<string>995</string>
<key>CustomDomain</key>
<string>${CUSTOM_DOMAIN}</string>
<key>DisableSSL</key>
Expand Down
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.
12 changes: 6 additions & 6 deletions HabitRPG/Images.xcassets/flag_flap.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"images" : [
{
"filename" : "Background Copy 96.png",
"idiom" : "universal",
"filename" : "flag_flap.png",
"scale" : "1x"
},
{
"filename" : "Background Copy [email protected]",
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"filename" : "Background Copy [email protected]",
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"images" : [
{
"filename" : "sub_bene_pet.png",
"idiom" : "universal",
"filename" : "sub_benefits_drops.png",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 8 additions & 7 deletions HabitRPG/Strings/Base.lproj/Mainstrings.strings
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@
"gift_gems_prompt" = "Want to bestow a shiny haul of Gems to someone else?";
"gem_cap" = "Unlocks %d Gold-purchasable Gems per month";
"two_gems_per_month" = "+2 Gems each month";
"max_gem_cap" = "Max Gem Cap";
"hourglass_count" = "+%d Mystic Hourglass";
"intro.welcome_prompt" = "What should we call you?";
"intro.welcome_speechbubble" = "Oh, you must be new here. I’m Justin, your guide to Habitica.\n\nFirst, what should we call you? Feel free to change what I picked. When you’re all set, let’s create your avatar!";
Expand Down Expand Up @@ -938,16 +939,16 @@
"subscription_info_1_description" = "Get up to 50 Gems in the Market to buy Quests, Customizations, Pets, and more!";
"subscription_info_2_title" = "Monthly Mystic Hourglasses";
"subscription_info_2_description" = "Never miss an item with 1 Mystic Hourglass a month to use in the Time Travelers Shop!";
"subscription_info_3_title" = "Monthly Mystery Items";
"subscription_info_3_title" = "Limited Monthly Gear Sets";
"subscription_info_3_description" = "Subscribe now to get an exclusive set now and receive new items every month!";
"subscription_info_3_description_new" = "Subscribe now to get this %@ set now and receive new items every month!";
"subscription_info_3_description_new" = "Stay decked out in the latest exclusive gear. Subscribe now to get %s!";
"subscription_info_5_title" = "Special Pet & More Drops";
"subscription_info_5_description" = "Get a Royal Purple Jackalope plus double the Eggs, Hatching Potions, and Food each day to grow your Pet collection!";
"subscription.info_armoire_title" = "Extra Armoire chances";
"subscription.info_armoire_description" = "Get two chances at new equipment from the Armoire for the price of one";
"subscription.info_faint_title" = "Second chance at life";
"subscription.info_faint_description" = "Have the option of hanging on with 1HP when you run out of health once a day";
"subscription_benefits_title" = "Become a subscriber and you’ll get these useful benefits";
"subscription.info_armoire_title" = "Double Armoire Rewards";
"subscription.info_armoire_description" = "Get two chances to score new equipment each time you open the Enchanted Armoire!";
"subscription.info_faint_title" = "Get a Second Chance";
"subscription.info_faint_description" = "Avoid losing your progress with an instant heal when you run out of HP once a day!";
"subscription_benefits_title" = "Stay motivated with even more rewards when you subscribe";
"subscription_benefits_title_subscribed" = "You get these benefits for being a Subscriber";
"subscription_options_title" = "Choose the Subscription length that works for you";
"subscription_gift_explanation" = "Want to give the benefits of a subscription to someone else?";
Expand Down
18 changes: 12 additions & 6 deletions HabitRPG/TableviewCells/SubscriptionDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,20 @@ class SubscriptionDetailView: UITableViewCell {
gemCapPill.text = String(plan.gemCapTotal)
var months = DateComponents()
months.month = plan.monthsUntilNextHourglass
if plan.isActive && !plan.isGifted && plan.dateTerminated == nil, let nextDate = Calendar.current.date(byAdding: months, to: Date()) {
let formatter = DateFormatter()
if Calendar.current.compare(nextDate, to: Date(), toGranularity: .year) != .orderedSame {
formatter.dateFormat = "MMMM YYYY"
var firstDay = DateComponents()
firstDay.day = 1
if let startOfMonth = Calendar.current.nextDate(after: Date(), matching: firstDay, matchingPolicy: .nextTime, direction: .backward), let nextDate = Calendar.current.date(byAdding: months, to: startOfMonth), plan.isActive {
if let dateTerminated = plan.dateTerminated, dateTerminated < nextDate {
hourGlassCountPill.text = "--"
} else {
formatter.dateFormat = "MMMM"
let formatter = DateFormatter()
if Calendar.current.compare(nextDate, to: Date(), toGranularity: .year) != .orderedSame {
formatter.dateFormat = "d MMMM YYYY"
} else {
formatter.dateFormat = "d MMMM"
}
hourGlassCountPill.text = formatter.string(from: nextDate)
}
hourGlassCountPill.text = formatter.string(from: nextDate)
} else {
hourGlassCountPill.text = "--"
}
Expand Down
4 changes: 2 additions & 2 deletions HabitRPG/TableviewCells/SubscriptionOptionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class SubscriptionOptionView: UITableViewCell {
showGemsPerMonth(true)
case 12:
setGemCap(50)
showGemsPerMonth(false)
showGemsPerMonth(true, text: L10n.maxGemCap)
default:
break
}
Expand All @@ -103,7 +103,7 @@ class SubscriptionOptionView: UITableViewCell {
gemCapLabel.text = L10n.gemCap(count)
}

private func showGemsPerMonth(_ show: Bool) {
private func showGemsPerMonth(_ show: Bool, text: String = L10n.twoGemsPerMonth) {
if show {
mysticHourglassLabel.isHidden = false
mysticHourglassLabel.text = L10n.twoGemsPerMonth
Expand Down
Loading

0 comments on commit 5d84ac5

Please sign in to comment.