Fix canAfford function for gems. Fixes #886

This commit is contained in:
Phillip Thelen 2017-11-16 18:33:36 +01:00
parent 7d2162f92c
commit 3cd66b7caf
2 changed files with 3 additions and 3 deletions

View file

@ -56,7 +56,7 @@ open class ShopItem : RealmObject() {
fun canAfford(user: User?): Boolean = when(currency) {
"gold" -> value <= user?.stats?.getGp() ?: 0.0
"gems" -> value <= user?.balance ?: 0.0 * 4
"gems" -> value <= user?.gemCount ?: 0
"hourglasses" -> value <= user?.purchased?.plan?.consecutive?.trinkets ?: 0
else -> false
}

View file

@ -789,11 +789,11 @@ public class MainActivity extends BaseActivity implements TutorialView.OnTutoria
private void displayTutorialStep(TutorialStep step, String text, boolean canBeDeferred) {
TutorialView view = new TutorialView(this, step, this);
this.activeTutorialView = view;
view.setTutorialText(text);
view.onReaction = this;
view.setCanBeDeferred(canBeDeferred);
this.overlayLayout.addView(view);
this.activeTutorialView = view;
Map<String, Object> additionalData = new HashMap<>();
additionalData.put("eventLabel", step.getIdentifier() + "-android");
@ -804,11 +804,11 @@ public class MainActivity extends BaseActivity implements TutorialView.OnTutoria
private void displayTutorialStep(TutorialStep step, List<String> texts, boolean canBeDeferred) {
TutorialView view = new TutorialView(this, step, this);
this.activeTutorialView = view;
view.setTutorialTexts(texts);
view.onReaction = this;
view.setCanBeDeferred(canBeDeferred);
this.overlayLayout.addView(view);
this.activeTutorialView = view;
Map<String, Object> additionalData = new HashMap<>();
additionalData.put("eventLabel", step.getIdentifier() + "-android");