mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-25 23:26:01 +00:00
Add balance to HabitRPGUser model + use it to set gem text on header
This commit is contained in:
parent
9bfe1ff7c5
commit
ee8fee9802
2 changed files with 10 additions and 2 deletions
|
|
@ -109,7 +109,7 @@ public class AvatarWithBarsViewModel {
|
|||
|
||||
goldText.setText(gp+"");
|
||||
silverText.setText(sp+"");
|
||||
gemsText.setText("?");
|
||||
gemsText.setText(user.getBalance()*4+"");
|
||||
}
|
||||
|
||||
public static void setHpBarData(ValueBarBinding valueBar, Stats stats, Context ctx)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public class HabitRPGUser extends BaseModel {
|
|||
List<Task> rewards;
|
||||
List<Task> habits;
|
||||
List<Tag> tags;
|
||||
|
||||
private int balance;
|
||||
@Column
|
||||
@ForeignKey(references = {@ForeignKeyReference(columnName = "stats_id",
|
||||
columnType = Long.class,
|
||||
|
|
@ -132,6 +132,14 @@ public class HabitRPGUser extends BaseModel {
|
|||
this.items = items;
|
||||
}
|
||||
|
||||
public void setBalance(int balance) {
|
||||
this.balance=balance;
|
||||
}
|
||||
|
||||
public int getBalance() {
|
||||
return this.balance;
|
||||
}
|
||||
|
||||
@OneToMany(methods = {OneToMany.Method.SAVE, OneToMany.Method.DELETE}, variableName = "habits")
|
||||
public List<Task> getHabits() {
|
||||
if(habits == null) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue