From d7d1ef6c9b2b4fc587928ff7e601f2fc7a2534cf Mon Sep 17 00:00:00 2001 From: vatsalkul Date: Sat, 29 Feb 2020 19:21:34 +0530 Subject: [PATCH] optimising strings in project Made enums in order to access strings --- Powerup/CompletedViewController.swift | 4 +- Powerup/CustomizeAvatarViewController.swift | 4 +- Powerup/EndViewController.swift | 4 +- Powerup/MapViewController.swift | 8 +- Powerup/MinesweeperGameScene.swift | 8 +- Powerup/ResultsViewController.swift | 20 ++--- Powerup/ScenarioViewController.swift | 18 ++--- Powerup/ShopViewController.swift | 36 ++++----- Powerup/StartViewController.swift | 14 ++-- Powerup/Strings.swift | 90 +++++++++++++-------- 10 files changed, 113 insertions(+), 93 deletions(-) diff --git a/Powerup/CompletedViewController.swift b/Powerup/CompletedViewController.swift index 769b6eec..a86497c0 100644 --- a/Powerup/CompletedViewController.swift +++ b/Powerup/CompletedViewController.swift @@ -35,8 +35,8 @@ class CompletedViewController: UIViewController, SegueHandler { karmaPointsLabel.text = String(score.karmaPoints) } catch _ { // If the saving failed, show an alert dialogue. - let alert = UIAlertController(title: warningTitleMessage, message: errorLoadingKarmaPoints, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: okText, style: .default)) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.loadingKarmaPoints, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: CustomText.ok, style: .default)) self.present(alert, animated: true, completion: nil) return diff --git a/Powerup/CustomizeAvatarViewController.swift b/Powerup/CustomizeAvatarViewController.swift index e5d6abdd..b5d11b83 100755 --- a/Powerup/CustomizeAvatarViewController.swift +++ b/Powerup/CustomizeAvatarViewController.swift @@ -103,10 +103,10 @@ class CustomizeAvatarViewController: UIViewController,SegueHandler { try dataSource.boughtAccessory(accessory: avatar.hair) try dataSource.boughtAccessory(accessory: avatar.clothes) } catch _ { - let alert = UIAlertController(title: warningTitleMessage, message: failedtoSaveAvatarMessage, preferredStyle: .alert) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.failedtoSaveAvatarMessage, preferredStyle: .alert) // Unwind to Start View when Ok Button is pressed. - let okButton = UIAlertAction(title: okText, style: .cancel, handler: {action in + let okButton = UIAlertAction(title: CustomText.ok, style: .cancel, handler: {action in self.performSegueWithIdentifier(.unwindToStartView, sender: self) }) alert.addAction(okButton) diff --git a/Powerup/EndViewController.swift b/Powerup/EndViewController.swift index 3b0366ce..a141f26c 100644 --- a/Powerup/EndViewController.swift +++ b/Powerup/EndViewController.swift @@ -17,8 +17,8 @@ class EndViewController: UIViewController { karmaPointsLabel.text = String(score.karmaPoints) } catch _ { // If the saving failed, show an alert dialogue. - let alert = UIAlertController(title: warningTitleMessage, message: errorLoadingKarmaPoints, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: okText, style: .default)) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.loadingKarmaPoints, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: CustomText.ok, style: .default)) self.present(alert, animated: true, completion: nil) return diff --git a/Powerup/MapViewController.swift b/Powerup/MapViewController.swift index bba5fcf5..5ac515c4 100644 --- a/Powerup/MapViewController.swift +++ b/Powerup/MapViewController.swift @@ -48,8 +48,8 @@ class MapViewController: UIViewController, SegueHandler { do { currScenario = try dataSource.getScenario(of: scenarioID) } catch _ { - let alert = UIAlertController(title: warningTitleMessage, message: errorLoadingScenarioMessage, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: okText, style: .default)) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.loadingScenarioMessage, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: CustomText.ok, style: .default)) self.present(alert, animated: true, completion: nil) return @@ -74,8 +74,8 @@ class MapViewController: UIViewController, SegueHandler { do { selectedScenario = try dataSource.getScenario(of: sender.tag) } catch _ { - let alert = UIAlertController(title: warningTitleMessage, message: errorLoadingScenarioMessage, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: okText, style: .default)) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.loadingScenarioMessage, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: CustomText.ok, style: .default)) self.present(alert, animated: true, completion: nil) return diff --git a/Powerup/MinesweeperGameScene.swift b/Powerup/MinesweeperGameScene.swift index dab4647c..c492574b 100644 --- a/Powerup/MinesweeperGameScene.swift +++ b/Powerup/MinesweeperGameScene.swift @@ -452,8 +452,8 @@ class MinesweeperGameScene: SKScene { currBox = guessingBox // Perform animation. - guessingBox.removeAction(forKey: boxShrinkingKey) - guessingBox.run(SKAction.scale(to: boxEnlargingScale, duration: boxEnlargingDuration), withKey: boxEnlargingKey) + guessingBox.removeAction(forKey: CustomText.boxShrinkingKey) + guessingBox.run(SKAction.scale(to: boxEnlargingScale, duration: boxEnlargingDuration), withKey: CustomText.boxEnlargingKey) } } @@ -473,8 +473,8 @@ class MinesweeperGameScene: SKScene { } else if let box = currBox { // Animate (shrink) back the card. - box.removeAction(forKey: boxEnlargingKey) - box.run(SKAction.scale(to: 1.0, duration: boxEnlargingDuration), withKey: boxEnlargingKey) + box.removeAction(forKey: CustomText.boxEnlargingKey) + box.run(SKAction.scale(to: 1.0, duration: boxEnlargingDuration), withKey: CustomText.boxEnlargingKey) currBox = nil } diff --git a/Powerup/ResultsViewController.swift b/Powerup/ResultsViewController.swift index 9aaddd40..4af734c4 100644 --- a/Powerup/ResultsViewController.swift +++ b/Powerup/ResultsViewController.swift @@ -54,8 +54,8 @@ class ResultsViewController: UIViewController, SegueHandler { karmaPointsLabel.text = String(score.karmaPoints) } catch _ { // If the saving failed, show an alert dialogue. - let alert = UIAlertController(title: warningTitleMessage, message: errorLoadingKarmaPoints, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: okText, style: .default)) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.loadingKarmaPoints, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: CustomText.ok, style: .default)) self.present(alert, animated: true, completion: nil) return @@ -67,14 +67,14 @@ class ResultsViewController: UIViewController, SegueHandler { if !(try dataSource.getScenario(of: completedScenarioID)).completed { // Notify the players of the karma gain with a pop-up. - let notification = UIAlertController(title: hoorayTitleMesssage, message: "You gained \(karmaGain) Karma points!", preferredStyle: .alert) - notification.addAction(UIAlertAction(title: okText, style: .default, handler: { action in self.gainKarmaPoints() })) + let notification = UIAlertController(title: CustomMessage.hoorayTitle, message: "You gained \(karmaGain) Karma points!", preferredStyle: .alert) + notification.addAction(UIAlertAction(title: CustomText.ok, style: .default, handler: { action in self.gainKarmaPoints() })) self.present(notification, animated: true, completion: nil) } } catch _ { - let alert = UIAlertController(title: warningTitleMessage, message: errorFetchingScenarioMessage, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: okText, style: .default)) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.fetchingScenarioMessage, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: CustomText.ok, style: .default)) self.present(alert, animated: true, completion: nil) return @@ -92,8 +92,8 @@ class ResultsViewController: UIViewController, SegueHandler { try dataSource.saveScore(score: newScore) } catch _ { // If the saving failed, show an alert dialogue. - let alert = UIAlertController(title: warningTitleMessage, message: errorSavingKarmaPointsMessage, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: okText, style: .default)) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.savingKarmaPointsMessage, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: CustomText.ok, style: .default)) self.present(alert, animated: true, completion: nil) return @@ -123,8 +123,8 @@ class ResultsViewController: UIViewController, SegueHandler { try dataSource.saveScenario(nextScenario) } catch _ { - let alert = UIAlertController(title: warningTitleMessage, message: errorSavingScenarioCompletionMessage, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: okText, style: .default)) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.savingScenarioCompletionMessage, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: CustomText.ok, style: .default)) self.present(alert, animated: true, completion: nil) return diff --git a/Powerup/ScenarioViewController.swift b/Powerup/ScenarioViewController.swift index 06dcc65e..4e4619d6 100755 --- a/Powerup/ScenarioViewController.swift +++ b/Powerup/ScenarioViewController.swift @@ -59,8 +59,8 @@ class ScenarioViewController: UIViewController, UITableViewDelegate, UITableView } catch _ { // Unwind back to map view if cound't fetch choices from database. - let alert = UIAlertController(title: warningTitleMessage, message: errorLoadingChoicesMessage, preferredStyle: .alert) - let okButton = UIAlertAction(title: okText, style: .default, handler: { action in self.performSegueWithIdentifier(.unwindToMapView, sender: self) }) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.loadingChoicesMessage, preferredStyle: .alert) + let okButton = UIAlertAction(title: CustomText.ok, style: .default, handler: { action in self.performSegueWithIdentifier(.unwindToMapView, sender: self) }) alert.addAction(okButton) @@ -88,8 +88,8 @@ class ScenarioViewController: UIViewController, UITableViewDelegate, UITableView } catch _ { // Unwind back to map view if cound't fetch avatar from database. - let alert = UIAlertController(title: warningTitleMessage, message: errorLoadingAvatarMessage, preferredStyle: .alert) - let okButton = UIAlertAction(title: okText, style: .default, handler: { action in self.performSegueWithIdentifier(.unwindToMapView, sender: self) }) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.loadingAvatarMessage, preferredStyle: .alert) + let okButton = UIAlertAction(title: CustomText.ok, style: .default, handler: { action in self.performSegueWithIdentifier(.unwindToMapView, sender: self) }) alert.addAction(okButton) @@ -143,8 +143,8 @@ class ScenarioViewController: UIViewController, UITableViewDelegate, UITableView } catch _ { // Unwind back to map view if cound't fetch questions from database. - let alert = UIAlertController(title: warningTitleMessage, message: errorLoadingScenarioMessage, preferredStyle: .alert) - let okButton = UIAlertAction(title: okText, style: .default, handler: { action in self.performSegueWithIdentifier(.unwindToMapView, sender: self) }) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.loadingScenarioMessage, preferredStyle: .alert) + let okButton = UIAlertAction(title: CustomText.ok, style: .default, handler: { action in self.performSegueWithIdentifier(.unwindToMapView, sender: self) }) alert.addAction(okButton) @@ -360,9 +360,9 @@ class ScenarioViewController: UIViewController, UITableViewDelegate, UITableView // Alert the user about possibly losing karma points upon migrating back to the map. @IBAction func homeButtonPressed(_ sender: Any) { - let alert = UIAlertController(title: confirmationTitleMessage, message: mapMigrationAlertMessage, preferredStyle: .alert) - let okButton = UIAlertAction(title: okText, style: .default, handler: { action in self.performSegueWithIdentifier(.unwindToMapView, sender: self) }) - let cancelButton = UIAlertAction(title: cancelText, style: .cancel, handler: { action in self.dismiss(animated: true, completion: nil) }) + let alert = UIAlertController(title: CustomMessage.confirmationTitle, message: CustomWarning.mapMigrationAlert, preferredStyle: .alert) + let okButton = UIAlertAction(title: CustomText.ok, style: .default, handler: { action in self.performSegueWithIdentifier(.unwindToMapView, sender: self) }) + let cancelButton = UIAlertAction(title: CustomText.cancel, style: .cancel, handler: { action in self.dismiss(animated: true, completion: nil) }) alert.addAction(okButton) alert.addAction(cancelButton) diff --git a/Powerup/ShopViewController.swift b/Powerup/ShopViewController.swift index f8a7e090..c98c32f1 100755 --- a/Powerup/ShopViewController.swift +++ b/Powerup/ShopViewController.swift @@ -66,10 +66,10 @@ class ShopViewController: UIViewController { score = try dataSource.getScore() avatar = try dataSource.getAvatar() } catch _ { - let alert = UIAlertController(title: warningTitleMessage, message: errorFetchingAvatarMessage, preferredStyle: .alert) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.fetchingAvatarMessage, preferredStyle: .alert) // Exit shop when ok button is pressed. - let okButton = UIAlertAction(title: okText, style: .default, handler: {action in self.dismiss(animated: true, completion: nil)}) + let okButton = UIAlertAction(title: CustomText.ok, style: .default, handler: {action in self.dismiss(animated: true, completion: nil)}) alert.addAction(okButton) self.present(alert, animated: true, completion: nil) @@ -150,10 +150,10 @@ class ShopViewController: UIViewController { // If the item isn't bought and it is unaffordable, grey out the box. if !currItem.purchased && currItem.points > score.karmaPoints { - displayBoxes[boxIndex].image = UIImage(named: greyOutBoxImageName) + displayBoxes[boxIndex].image = UIImage(named: CustomImage.greyOutBox) buttonTexts[boxIndex].text = "" } else { - displayBoxes[boxIndex].image = UIImage(named: boxImageName) + displayBoxes[boxIndex].image = UIImage(named: CustomImage.box) } } } @@ -175,8 +175,8 @@ class ShopViewController: UIViewController { // Show alert dialog if players are trying to buy items they can't afford. if score.karmaPoints < accessoryPrice { - let alertDialog = UIAlertController(title: oopsTitleMessage, message: notEnoughPointsMessage, preferredStyle: .alert) - alertDialog.addAction(UIAlertAction(title: okText, style: .default)) + let alertDialog = UIAlertController(title: CustomMessage.oopsTitle, message: CustomWarning.notEnoughPoints, preferredStyle: .alert) + alertDialog.addAction(UIAlertAction(title: CustomText.ok, style: .default)) self.present(alertDialog, animated: true, completion: nil) return false @@ -186,8 +186,8 @@ class ShopViewController: UIViewController { } func presentBuyingErrorDiaologue() { - let alert = UIAlertController(title: warningTitleMessage, message: errorPurchasingMessage, preferredStyle: .alert) - let okButton = UIAlertAction(title: okText, style: .default) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.purchasingMessage, preferredStyle: .alert) + let okButton = UIAlertAction(title: CustomText.ok, style: .default) alert.addAction(okButton) self.present(alert, animated: true, completion: nil) } @@ -242,13 +242,13 @@ class ShopViewController: UIViewController { self.updateAvatarImageView() // Set the preview label's text to "Preview". - previewLabel.text = previewLabelText + previewLabel.text = CustomText.previewLabel // If have enough points, buy the item. // Alert the player that the purchase couldn't be reverted. - let cannotRevertAlert = UIAlertController(title: confirmationTitleMessage, message: "You will be spending \(itemChosen.points) Karma Points!", preferredStyle: .alert) - let cancelButton = UIAlertAction(title: cancelText, style: .cancel, handler: {action in + let cannotRevertAlert = UIAlertController(title: CustomMessage.confirmationTitle, message: "You will be spending \(itemChosen.points) Karma Points!", preferredStyle: .alert) + let cancelButton = UIAlertAction(title: CustomText.cancel, style: .cancel, handler: {action in // Revert to whatever accessory the user had before. self.avatar.setAccessoryByType(itemChosen.type, accessory: currentItem) self.updateAvatarImageView() @@ -256,7 +256,7 @@ class ShopViewController: UIViewController { // Get rid of the preview text. self.previewLabel.text = "" }) - let purchaseButton = UIAlertAction(title: purchaseButtonText, style: .default, handler: {action in + let purchaseButton = UIAlertAction(title: CustomText.purchaseButton, style: .default, handler: {action in // Save the purchased data into the database. do { @@ -267,8 +267,8 @@ class ShopViewController: UIViewController { self.score.karmaPoints -= itemChosen.points try self.dataSource.saveScore(score: self.score) } catch _ { - let failedAlert = UIAlertController(title: oopsTitleMessage, message: errorSavingPurchaseMessage, preferredStyle: .alert) - failedAlert.addAction(UIAlertAction(title: okText, style: .default)) + let failedAlert = UIAlertController(title: CustomMessage.oopsTitle, message: CustomError.savingPurchaseMessage, preferredStyle: .alert) + failedAlert.addAction(UIAlertAction(title: CustomText.ok, style: .default)) self.present(failedAlert, animated: true, completion: nil) return @@ -288,8 +288,8 @@ class ShopViewController: UIViewController { self.updateAvatarImageView() // Show purchase successful dialogue. - let successfulDiologue = UIAlertController(title: yayTitleMessage, message: successFullPurchaseMessage, preferredStyle: .alert) - let confirmButton = UIAlertAction(title: okText, style: .default) + let successfulDiologue = UIAlertController(title: CustomMessage.yayTitle, message: CustomMessage.successFullPurchase, preferredStyle: .alert) + let confirmButton = UIAlertAction(title: CustomText.ok, style: .default) successfulDiologue.addAction(confirmButton) self.present(successfulDiologue, animated: true, completion: nil) @@ -333,8 +333,8 @@ class ShopViewController: UIViewController { // Save the avatar. try self.dataSource.saveAvatar(self.avatar) } catch _ { - let failedAlert = UIAlertController(title: oopsTitleMessage, message: errorFetchingAvatarMessage, preferredStyle: .alert) - failedAlert.addAction(UIAlertAction(title: okText, style: .default)) + let failedAlert = UIAlertController(title: CustomMessage.oopsTitle, message: CustomError.fetchingAvatarMessage, preferredStyle: .alert) + failedAlert.addAction(UIAlertAction(title: CustomText.ok, style: .default)) self.present(failedAlert, animated: true, completion: nil) return diff --git a/Powerup/StartViewController.swift b/Powerup/StartViewController.swift index de4cabf4..bea12ad7 100755 --- a/Powerup/StartViewController.swift +++ b/Powerup/StartViewController.swift @@ -22,10 +22,10 @@ class StartViewController: UIViewController, SegueHandler { do { try dataSource.initializeDatabase() } catch _ { - let alert = UIAlertController(title: warningTitleMessage, message: errorRestartAppMessage, preferredStyle: .alert) + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomError.restartAppMessage, preferredStyle: .alert) // Quit app when ok button is clicked. - let okButton = UIAlertAction(title: okText, style: .destructive, handler: { action in exit(1) }) + let okButton = UIAlertAction(title: CustomText.ok, style: .destructive, handler: { action in exit(1) }) alert.addAction(okButton) self.present(alert, animated: true) @@ -42,8 +42,8 @@ class StartViewController: UIViewController, SegueHandler { } else { // Remind players to create an avatar first. - let alert = UIAlertController(title: warningTitleMessage, message: createAvatarMessage, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: okText, style: .default, handler: { action in + let alert = UIAlertController(title: CustomMessage.warningTitle, message: CustomMessage.createAvatar, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: CustomText.ok, style: .default, handler: { action in self.performSegueWithIdentifier(.toNewAvatarView, sender: self) })) @@ -54,9 +54,9 @@ class StartViewController: UIViewController, SegueHandler { @IBAction func newAvatarButtonTouched(_ sender: UIButton) { // If previous avatar exists, warns the player that previous data will be lost. if dataSource.avatarExists() { - let alert = UIAlertController(title: confirmationTitleMessage, message: startNewGameMessage, preferredStyle: .alert) - let okButton = UIAlertAction(title: newAvatarTitleMessage, style: .destructive, handler: { (action) -> Void in self.performSegueWithIdentifier(.toNewAvatarView, sender: self) }) - let cancelButton = UIAlertAction(title: cancelText, style: .cancel) + let alert = UIAlertController(title: CustomMessage.confirmationTitle, message: CustomWarning.startNewGame, preferredStyle: .alert) + let okButton = UIAlertAction(title: CustomMessage.newAvatarTitle, style: .destructive, handler: { (action) -> Void in self.performSegueWithIdentifier(.toNewAvatarView, sender: self) }) + let cancelButton = UIAlertAction(title: CustomText.cancel, style: .cancel) alert.addAction(okButton) alert.addAction(cancelButton) self.present(alert, animated: true, completion: nil) diff --git a/Powerup/Strings.swift b/Powerup/Strings.swift index bb0057ad..94c51320 100644 --- a/Powerup/Strings.swift +++ b/Powerup/Strings.swift @@ -1,37 +1,57 @@ import Foundation // Strings -let endSceneTitleLabelText = "Game Over" -let scoreLabelPrefix = "Score: " -let boxEnlargingKey = "enlarge" -let boxShrinkingKey = "shrink" -let warningTitleMessage = "Warning" -let errorRestartAppMessage = "Error initializing user data, please restart the app." -let okText = "OK" -let createAvatarMessage = "Create your avatar to start the game!" -let confirmationTitleMessage = "Are you sure?" -let startNewGameMessage = "If you start a new game, previous data and all Karma points will be lost!" -let newAvatarTitleMessage = "Create New Avatar" -let cancelText = "Cancel" -let greyOutBoxImageName = "shop_unavailable_box" -let boxImageName = "shop_available_box" -let errorFetchingAvatarMessage = "Error fetching avatar and score data, please retry this action. If that doesn't help, try restarting or reinstalling the app." -let oopsTitleMessage = "Oops!" -let notEnoughPointsMessage = "You don't have enough points to buy that!" -let errorPurchasingMessage = "Error purchasing item, please retry this action. If that doesn't help, try restarting or reinstalling the app." -let errorSavingPurchaseMessage = "Error saving your purchase, please retry this action. If that doesn't help, try restarting or reinstalling the app." -let yayTitleMessage = "Yay!" -let successFullPurchaseMessage = "The purchase is successful!" -let previewLabelText = "Preview" -let cancelButtonText = "Maybe not" -let purchaseButtonText = "Purchase" -let errorSavingAvatarMessage = "Error saving the avatar, please retry this action. If that doesn't help, try restarting or reinstalling the app." -let failedtoSaveAvatarMessage = "Failed to save avatar, please retry this action. If that doesn't help, try restaring or reinstalling the app." -let errorLoadingScenarioMessage = "Error loading scenarios, please and try again, if this error still occurs, try restarting the app." -let errorLoadingChoicesMessage = "Error loading the choices. Please try again!" -let errorLoadingAvatarMessage = "Error loading the avatar. Please try again!" -let errorLoadingKarmaPoints = "Error loading Karma points." -let hoorayTitleMesssage = "Hooray!" -let errorFetchingScenarioMessage = "Error fetching scenario data from database." -let errorSavingKarmaPointsMessage = "Error saving Karma points." -let errorSavingScenarioCompletionMessage = "Error saving scenario completion." -let mapMigrationAlertMessage = "If you migrate to map, current scene karma points will be lost" + +enum CustomText { + static let endSceneTitleLabel = "Game Over" + static let scoreLabelPrefix = "Score: " + static let boxEnlargingKey = "enlarge" + static let boxShrinkingKey = "shrink" + + static let ok = "OK" + static let cancel = "Cancel" + static let previewLabel = "Preview" + static let cancelButton = "Maybe not" + static let purchaseButton = "Purchase" + +} + +enum CustomMessage { + static let warningTitle = "Warning" + static let createAvatar = "Create your avatar to start the game!" + static let confirmationTitle = "Are you sure?" + static let oopsTitle = "Oops!" + static let newAvatarTitle = "Create New Avatar" + static let yayTitle = "Yay!" + static let successFullPurchase = "The purchase is successful!" + static let hoorayTitle = "Hooray!" +} + +enum CustomImage { + static let box = "shop_available_box" + static let greyOutBox = "shop_unavailable_box" +} + +enum CustomWarning { + static let mapMigrationAlert = "If you migrate to map, current scene karma points will be lost" + static let notEnoughPoints = "You don't have enough points to buy that!" + static let startNewGame = "If you start a new game, previous data and all Karma points will be lost!" +} + +enum CustomError { + static let savingScenarioCompletionMessage = "Error saving scenario completion." + static let savingKarmaPointsMessage = "Error saving Karma points." + static let fetchingScenarioMessage = "Error fetching scenario data from database." + static let loadingKarmaPoints = "Error loading Karma points." + static let loadingAvatarMessage = "Error loading the avatar. Please try again!" + static let loadingChoicesMessage = "Error loading the choices. Please try again!" + static let loadingScenarioMessage = "Error loading scenarios, please and try again, if this error still occurs, try restarting the app." + static let restartAppMessage = "Error initializing user data, please restart the app." + + static let savingPurchaseMessage = "Error saving your purchase, please retry this action. If that doesn't help, try restarting or reinstalling the app." + static let fetchingAvatarMessage = "Error fetching avatar and score data, please retry this action. If that doesn't help, try restarting or reinstalling the app." + static let savingAvatarMessage = "Error saving the avatar, please retry this action. If that doesn't help, try restarting or reinstalling the app." + + static let failedtoSaveAvatarMessage = "Failed to save avatar, please retry this action. If that doesn't help, try restaring or reinstalling the app." + static let purchasingMessage = "Error purchasing item, please retry this action. If that doesn't help, try restarting or reinstalling the app." + +}