mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-19 20:29:02 +00:00
Fix canAfford function for gems. Fixes #886
This commit is contained in:
parent
7d2162f92c
commit
3cd66b7caf
2 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in a new issue