Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Jan 17, 2024
1 parent 0fad2fd commit 494147d
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 31 deletions.
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>940</string>
<string>942</string>
<key>CustomDomain</key>
<string>${CUSTOM_DOMAIN}</string>
<key>DisableSSL</key>
Expand Down
2 changes: 1 addition & 1 deletion HabitRPG/UI/Settings/FixCharacterViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class FixCharacterViewController: BaseTableViewController {

@IBAction func savePressed(_ sender: Any) {
for stat in stats {
stats[stat.key] = max(10000.0, (stat.value as? Double) ?? 0)
stats[stat.key] = min(10000.0, (stat.value as? Double) ?? 0)
}
userRepository.updateUser(stats).observeCompleted {[weak self] in
self?.dismiss(animated: true, completion: nil)
Expand Down
15 changes: 15 additions & 0 deletions HabitRPG/Views/PetHatchingDialog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import FirebaseAnalytics

class PetHatchingAlertController: HabiticaAlertController {
private let inventoryRepository = InventoryRepository()
private let userRepository = UserRepository()

private let stackView: UIStackView = {
let view = UIStackView()
Expand Down Expand Up @@ -83,6 +84,8 @@ class PetHatchingAlertController: HabiticaAlertController {
return label
}()

private var gemCount = 0

// swiftlint:disable:next function_body_length
convenience init(item: PetStableItem, ownedEggs: OwnedItemProtocol?, ownedPotions: OwnedItemProtocol?) {
self.init()
Expand All @@ -95,6 +98,9 @@ class PetHatchingAlertController: HabiticaAlertController {
eggView.setImagewith(name: "Pet_Egg_\(item.pet?.egg ?? "")")
potionView.setImagewith(name: "Pet_HatchingPotion_\(item.pet?.potion ?? "")")
petTitleLabel.text = item.pet?.text
userRepository.getUser().take(first: 1).on(value: { user in
self.gemCount = user.gemCount
}).start()
if item.canRaise || item.pet?.type == "special" {
title = L10n.hatchPet
petView.setImagewith(name: "stable_Pet-\(item.pet?.key ?? "")-outline")
Expand Down Expand Up @@ -158,6 +164,10 @@ class PetHatchingAlertController: HabiticaAlertController {
attributedText.replaceCharacters(in: range, with: addedString)
}
let button = self.addAction(title: L10n.hatch, isMainAction: false) { _ in
if hatchValue > self.gemCount {
HRPGBuyItemModalViewController.displayInsufficientGemsModal(reason: "hatching", delayDisplay: false)
self.dismiss()
}
var signal = SignalProducer<UserProtocol?, Never> { (observable, _) in
observable.send(Signal.Event.value(nil))
observable.sendCompleted()
Expand Down Expand Up @@ -233,6 +243,11 @@ class PetHatchingAlertController: HabiticaAlertController {
view.setNeedsLayout()
}

override func show() {
super.show()
HabiticaAnalytics.shared.logNavigationEvent("pet suggestion modal")
}

override func applyTheme(theme: Theme) {
super.applyTheme(theme: theme)
petView.tintColor = theme.dimmedColor
Expand Down
2 changes: 1 addition & 1 deletion Habitica Intents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>940</string>
<string>942</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand Down
2 changes: 1 addition & 1 deletion Habitica IntentsUI/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>940</string>
<string>942</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand Down
2 changes: 1 addition & 1 deletion Habitica Snapshots/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>940</string>
<string>942</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Habitica Widgets/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>940</string>
<string>942</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
48 changes: 24 additions & 24 deletions Habitica.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3969,7 +3969,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -4000,7 +4000,7 @@
CODE_SIGN_ENTITLEMENTS = Habitica.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO;
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -4152,7 +4152,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4193,7 +4193,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4236,7 +4236,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4274,7 +4274,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4326,7 +4326,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -4357,7 +4357,7 @@
CODE_SIGN_ENTITLEMENTS = Habitica.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO;
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -4509,7 +4509,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4550,7 +4550,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4593,7 +4593,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4631,7 +4631,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4661,7 +4661,7 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4694,7 +4694,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4730,7 +4730,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4776,7 +4776,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4816,7 +4816,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4858,7 +4858,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4898,7 +4898,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -4942,7 +4942,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -5151,7 +5151,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -5209,7 +5209,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -5240,7 +5240,7 @@
CODE_SIGN_ENTITLEMENTS = Habitica.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO;
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -5314,7 +5314,7 @@
CODE_SIGN_ENTITLEMENTS = Habitica.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 940;
CURRENT_PROJECT_VERSION = 942;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO;
DEVELOPMENT_TEAM = 9Q9SMRMCNN;
ENABLE_BITCODE = NO;
Expand Down
2 changes: 1 addition & 1 deletion HabiticaTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>940</string>
<string>942</string>
</dict>
</plist>

0 comments on commit 494147d

Please sign in to comment.