mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 03:36:30 +00:00
Apply avatar transformations (if items available) / update gradle
This commit is contained in:
parent
cde5cdb6ef
commit
15ea308a42
23 changed files with 345 additions and 61 deletions
|
|
@ -65,6 +65,11 @@
|
|||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait">
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.activities.SkillMemberActivity"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait">
|
||||
</activity>
|
||||
|
||||
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
|
||||
|
||||
|
|
|
|||
1
Habitica/assets/migrations/Habitica/28.sql
Normal file
1
Habitica/assets/migrations/Habitica/28.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE Items ADD COLUMN 'special_id' INTEGER;
|
||||
|
|
@ -12,7 +12,7 @@ buildscript {
|
|||
dependencies {
|
||||
classpath 'io.fabric.tools:gradle:1.21.5'
|
||||
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
|
||||
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.4.4'
|
||||
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.1'
|
||||
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
|
||||
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
|
||||
}
|
||||
|
|
@ -171,8 +171,6 @@ android {
|
|||
debuggable true
|
||||
// Disable fabric build ID generation for debug builds
|
||||
ext.enableCrashlytics = false
|
||||
multiDexEnabled true
|
||||
|
||||
resValue "string", "content_provider", "com.habitrpg.android.habitica.debug.fileprovider"
|
||||
resValue "string", "app_name", "Habitica Debug"
|
||||
}
|
||||
|
|
|
|||
18
Habitica/res/layout/activity_skill_members.xml
Normal file
18
Habitica/res/layout/activity_skill_members.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbarSize="3dp"
|
||||
android:scrollbarThumbVertical="@color/md_grey_500"
|
||||
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -1,34 +1,35 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/CardView.Default"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/CardView.Default">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
style="@style/CardContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
style="@style/CardContent">
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/skill_image"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:id="@+id/skill_image"
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="center_vertical">
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/skill_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:id="@+id/skill_text" />
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/skill_notes"
|
||||
|
|
@ -37,13 +38,18 @@
|
|||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/price_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/price_button"
|
||||
android:background="@color/brand_100"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="8dp" />
|
||||
android:background="@color/brand_100"
|
||||
android:drawableLeft="@drawable/ic_header_magic"
|
||||
android:drawableStart="@drawable/ic_header_magic"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingRight="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:textColor="@android:color/white" />
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
|
@ -133,6 +133,7 @@
|
|||
|
||||
<string name="mana_price_button" formatted="false">%d MP</string>
|
||||
<string name="used_skill" formatted="false">You used %1$s for %2$d mana.</string>
|
||||
<string name="used_skill_without_mana" formatted="false">You used %1$s.</string>
|
||||
<string name="new_checklist_item">new checklist item</string>
|
||||
<string name="add_checklist_item">Add</string>
|
||||
|
||||
|
|
@ -413,5 +414,6 @@ To start, which parts of your life do you want to improve?</string>
|
|||
<string name="widget_habit_button">Habitica Do Habit</string>
|
||||
<string name="widget_dailies">Habitica Dailies</string>
|
||||
<string name="widget_add_task">Habitica Add Task</string>
|
||||
<string name="skill_transformation_use">use</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ public class HabitDatabase {
|
|||
|
||||
public static final String NAME = "Habitica";
|
||||
|
||||
public static final int VERSION = 27;
|
||||
public static final int VERSION = 28;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import com.habitrpg.android.habitica.ui.activities.MaintenanceActivity;
|
|||
import com.habitrpg.android.habitica.ui.activities.PartyInviteActivity;
|
||||
import com.habitrpg.android.habitica.ui.activities.PrefsActivity;
|
||||
import com.habitrpg.android.habitica.ui.activities.SetupActivity;
|
||||
import com.habitrpg.android.habitica.ui.activities.SkillMemberActivity;
|
||||
import com.habitrpg.android.habitica.ui.activities.SkillTasksActivity;
|
||||
import com.habitrpg.android.habitica.ui.activities.TaskFormActivity;
|
||||
import com.habitrpg.android.habitica.ui.fragments.GemsPurchaseFragment;
|
||||
|
|
@ -90,6 +91,8 @@ public interface AppComponent {
|
|||
|
||||
void inject(SkillTasksActivity skillTasksActivity);
|
||||
|
||||
void inject(SkillMemberActivity skillMembersActivity);
|
||||
|
||||
void inject(TaskFormActivity taskFormActivity);
|
||||
|
||||
void inject(TasksFragment tasksFragment);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
package com.habitrpg.android.habitica.events.commands;
|
||||
|
||||
public class SelectMemberCommand {
|
||||
public String MemberId;
|
||||
|
||||
public SelectMemberCommand(String memberId){
|
||||
MemberId = memberId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package com.habitrpg.android.habitica.ui.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
|
||||
import com.habitrpg.android.habitica.APIHelper;
|
||||
import com.habitrpg.android.habitica.R;
|
||||
import com.habitrpg.android.habitica.components.AppComponent;
|
||||
import com.habitrpg.android.habitica.events.commands.SelectMemberCommand;
|
||||
import com.habitrpg.android.habitica.ui.adapter.social.PartyMemberRecyclerViewAdapter;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import butterknife.BindView;
|
||||
|
||||
public class SkillMemberActivity extends BaseActivity {
|
||||
|
||||
private PartyMemberRecyclerViewAdapter viewAdapter;
|
||||
|
||||
@BindView(R.id.recyclerView)
|
||||
RecyclerView recyclerView;
|
||||
|
||||
@Inject
|
||||
public APIHelper apiHelper;
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.activity_skill_members;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void injectActivity(AppComponent component) {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
EventBus.getDefault().register(this);
|
||||
|
||||
loadMemberList();
|
||||
}
|
||||
|
||||
private void loadMemberList() {
|
||||
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
viewAdapter = new PartyMemberRecyclerViewAdapter();
|
||||
viewAdapter.context = this;
|
||||
recyclerView.setAdapter(viewAdapter);
|
||||
|
||||
apiHelper.apiService.getGroup("party")
|
||||
.compose(this.apiHelper.configureApiCallObserver())
|
||||
.subscribe(group -> {
|
||||
if (group == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
apiHelper.apiService.getGroupMembers(group.id, true)
|
||||
.compose(apiHelper.configureApiCallObserver())
|
||||
.subscribe(members -> {
|
||||
viewAdapter.setMemberList(members, true);
|
||||
},
|
||||
throwable -> {
|
||||
});
|
||||
},
|
||||
throwable -> {
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(SelectMemberCommand evt){
|
||||
Intent resultIntent = new Intent();
|
||||
resultIntent.putExtra("member_id", evt.MemberId);
|
||||
setResult(Activity.RESULT_OK, resultIntent);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
|
@ -89,7 +89,15 @@ public class SkillsRecyclerViewAdapter extends RecyclerView.Adapter<SkillsRecycl
|
|||
this.skill = skill;
|
||||
skillNameTextView.setText(skill.text);
|
||||
skillNotesTextView.setText(skill.notes);
|
||||
priceButton.setText(String.format(context.getResources().getString(R.string.mana_price_button), skill.mana));
|
||||
|
||||
if(skill.isSpecialItem){
|
||||
priceButton.setText(R.string.skill_transformation_use);
|
||||
|
||||
priceButton.setCompoundDrawables(null, null,null,null);
|
||||
} else {
|
||||
priceButton.setText(skill.mana+"");
|
||||
priceButton.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_header_magic, 0,0,0);
|
||||
}
|
||||
DataBindingUtils.loadImage(skillImageView, "shop_" + skill.key);
|
||||
|
||||
if (skill.mana > mana) {
|
||||
|
|
|
|||
|
|
@ -3,14 +3,13 @@ package com.habitrpg.android.habitica.ui.adapter.social;
|
|||
import com.habitrpg.android.habitica.R;
|
||||
import com.habitrpg.android.habitica.databinding.ValueBarBinding;
|
||||
import com.habitrpg.android.habitica.events.commands.OpenFullProfileCommand;
|
||||
import com.habitrpg.android.habitica.events.commands.SelectMemberCommand;
|
||||
import com.habitrpg.android.habitica.ui.AvatarView;
|
||||
import com.habitrpg.android.habitica.ui.AvatarWithBarsViewModel;
|
||||
import com.habitrpg.android.habitica.ui.activities.SetupActivity;
|
||||
import com.habitrpg.android.habitica.ui.helpers.ViewHelper;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.HabitRPGUser;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.databinding.DataBindingUtil;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
|
|
@ -32,9 +31,11 @@ public class PartyMemberRecyclerViewAdapter extends RecyclerView.Adapter<PartyMe
|
|||
|
||||
public Context context;
|
||||
private List<HabitRPGUser> memberList;
|
||||
private boolean isMemberSelection;
|
||||
|
||||
public void setMemberList(List<HabitRPGUser> memberList) {
|
||||
public void setMemberList(List<HabitRPGUser> memberList, boolean isMemberSelection) {
|
||||
this.memberList = memberList;
|
||||
this.isMemberSelection = isMemberSelection;
|
||||
this.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
|
@ -129,9 +130,15 @@ public class PartyMemberRecyclerViewAdapter extends RecyclerView.Adapter<PartyMe
|
|||
|
||||
itemView.setClickable(true);
|
||||
itemView.setOnClickListener(view -> {
|
||||
OpenFullProfileCommand cmd = new OpenFullProfileCommand(user.getId());
|
||||
if (isMemberSelection) {
|
||||
SelectMemberCommand cmd = new SelectMemberCommand(user.getId());
|
||||
|
||||
EventBus.getDefault().post(cmd);
|
||||
EventBus.getDefault().post(cmd);
|
||||
} else {
|
||||
OpenFullProfileCommand cmd = new OpenFullProfileCommand(user.getId());
|
||||
|
||||
EventBus.getDefault().post(cmd);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,14 @@ import com.habitrpg.android.habitica.callbacks.SkillCallback;
|
|||
import com.habitrpg.android.habitica.components.AppComponent;
|
||||
import com.habitrpg.android.habitica.events.SkillUsedEvent;
|
||||
import com.habitrpg.android.habitica.events.commands.UseSkillCommand;
|
||||
import com.habitrpg.android.habitica.ui.activities.SkillMemberActivity;
|
||||
import com.habitrpg.android.habitica.ui.activities.SkillTasksActivity;
|
||||
import com.habitrpg.android.habitica.ui.adapter.SkillsRecyclerViewAdapter;
|
||||
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment;
|
||||
import com.habitrpg.android.habitica.ui.helpers.UiUtils;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.HabitRPGUser;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.Skill;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.SpecialItems;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.responses.SkillResponse;
|
||||
import com.raizlabs.android.dbflow.sql.builder.Condition;
|
||||
import com.raizlabs.android.dbflow.sql.language.Select;
|
||||
|
|
@ -37,6 +39,8 @@ import rx.Observable;
|
|||
public class SkillsFragment extends BaseMainFragment {
|
||||
|
||||
private final int TASK_SELECTION_ACTIVITY = 10;
|
||||
private final int MEMBER_SELECTION_ACTIVITY = 11;
|
||||
|
||||
@BindView(R.id.recyclerView)
|
||||
RecyclerView mRecyclerView;
|
||||
SkillsRecyclerViewAdapter adapter;
|
||||
|
|
@ -86,6 +90,42 @@ public class SkillsFragment extends BaseMainFragment {
|
|||
.and(Condition.column("lvl").lessThanOrEq(user.getStats().getLvl()))
|
||||
.queryList();
|
||||
adapter.setSkillList(skills);
|
||||
|
||||
|
||||
SpecialItems specialItems = this.user.getItems().getSpecial();
|
||||
if (specialItems != null) {
|
||||
Condition.In specialsWhere = Condition.column("key").in("");
|
||||
|
||||
if (specialItems.getSnowball() > 1) {
|
||||
specialsWhere.and("snowball");
|
||||
}
|
||||
|
||||
if (specialItems.getShinySeed() > 1) {
|
||||
specialsWhere.and("shinySeed");
|
||||
}
|
||||
|
||||
if (specialItems.getSeafoam() > 1) {
|
||||
specialsWhere.and("seafoam");
|
||||
}
|
||||
|
||||
if (specialItems.getSpookySparkles() > 1) {
|
||||
specialsWhere.and("spookySparkles");
|
||||
}
|
||||
|
||||
List<Skill> specials = new Select()
|
||||
.from(Skill.class)
|
||||
.where(specialsWhere)
|
||||
.queryList();
|
||||
|
||||
for (Skill item : specials) {
|
||||
item.isSpecialItem = true;
|
||||
item.target = "party";
|
||||
|
||||
skills.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
adapter.setSkillList(skills);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -98,7 +138,12 @@ public class SkillsFragment extends BaseMainFragment {
|
|||
@Subscribe
|
||||
public void onEvent(UseSkillCommand command) {
|
||||
Skill skill = command.skill;
|
||||
if (skill.target.equals("task")) {
|
||||
|
||||
if (skill.isSpecialItem) {
|
||||
selectedSkill = skill;
|
||||
Intent intent = new Intent(activity, SkillMemberActivity.class);
|
||||
startActivityForResult(intent, MEMBER_SELECTION_ACTIVITY);
|
||||
} else if (skill.target.equals("task")) {
|
||||
selectedSkill = skill;
|
||||
Intent intent = new Intent(activity, SkillTasksActivity.class);
|
||||
startActivityForResult(intent, TASK_SELECTION_ACTIVITY);
|
||||
|
|
@ -113,7 +158,12 @@ public class SkillsFragment extends BaseMainFragment {
|
|||
Skill skill = event.usedSkill;
|
||||
adapter.setMana(event.newMana);
|
||||
StringBuilder message = new StringBuilder();
|
||||
message.append(activity.getString(R.string.used_skill, skill.text, skill.mana));
|
||||
if (skill.isSpecialItem) {
|
||||
message.append(activity.getString(R.string.used_skill_without_mana));
|
||||
} else {
|
||||
message.append(activity.getString(R.string.used_skill, skill.text, skill.mana));
|
||||
}
|
||||
|
||||
if (event.xp != 0) {
|
||||
message.append(" + ").append(round(event.xp, 2)).append(" XP");
|
||||
}
|
||||
|
|
@ -140,6 +190,12 @@ public class SkillsFragment extends BaseMainFragment {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case (MEMBER_SELECTION_ACTIVITY): {
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
useSkill(selectedSkill, data.getStringExtra("member_id"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class PartyMemberListFragment extends BaseFragment {
|
|||
|
||||
public void setMemberList(List<HabitRPGUser> members) {
|
||||
this.members = members;
|
||||
viewAdapter.setMemberList(members);
|
||||
viewAdapter.setMemberList(members, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,5 +81,8 @@ public class Buffs extends BasicStats {
|
|||
super.merge(stats);
|
||||
this.snowball = stats.snowball != null ? stats.snowball : this.snowball;
|
||||
this.streaks = stats.streaks != null ? stats.streaks : this.streaks;
|
||||
this.seafoam = stats.seafoam != null ? stats.seafoam : this.seafoam;
|
||||
this.shinySeed = stats.shinySeed != null ? stats.shinySeed : this.shinySeed;
|
||||
this.spookySparkles = stats.spookySparkles != null ? stats.spookySparkles : this.spookySparkles;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,12 @@ public class Items extends BaseModel {
|
|||
foreignColumnName = "user_id")})
|
||||
private Gear gear;
|
||||
|
||||
@Column
|
||||
@ForeignKey(references = {@ForeignKeyReference(columnName = "special_id",
|
||||
columnType = String.class,
|
||||
foreignColumnName = "user_id")})
|
||||
private SpecialItems special;
|
||||
|
||||
public Items(String currentMount, String currentPet, int lastDrop_count, Date lastDrop_date) {
|
||||
this.currentMount = currentMount;
|
||||
this.currentPet = currentPet;
|
||||
|
|
@ -93,6 +99,14 @@ public class Items extends BaseModel {
|
|||
this.gear = gear;
|
||||
}
|
||||
|
||||
public SpecialItems getSpecial() {
|
||||
return special;
|
||||
}
|
||||
|
||||
public void setSpecial(SpecialItems specialItems) {
|
||||
this.special = specialItems;
|
||||
}
|
||||
|
||||
public String getUser_id() {
|
||||
return user_id;
|
||||
}
|
||||
|
|
@ -152,6 +166,8 @@ public class Items extends BaseModel {
|
|||
@Override
|
||||
public void save() {
|
||||
gear.user_id = user_id;
|
||||
special.user_id = user_id;
|
||||
|
||||
super.save();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import com.raizlabs.android.dbflow.annotation.Table;
|
|||
import com.raizlabs.android.dbflow.structure.BaseModel;
|
||||
|
||||
|
||||
@Table(databaseName = HabitDatabase.NAME, allFields = true)
|
||||
@Table(databaseName = HabitDatabase.NAME)
|
||||
public class Skill extends BaseModel {
|
||||
|
||||
@Column
|
||||
|
|
@ -20,5 +20,5 @@ public class Skill extends BaseModel {
|
|||
@Column
|
||||
public Integer mana, lvl;
|
||||
|
||||
|
||||
public boolean isSpecialItem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
package com.magicmicky.habitrpgwrapper.lib.models;
|
||||
|
||||
|
||||
import com.habitrpg.android.habitica.HabitDatabase;
|
||||
import com.raizlabs.android.dbflow.annotation.Column;
|
||||
import com.raizlabs.android.dbflow.annotation.NotNull;
|
||||
import com.raizlabs.android.dbflow.annotation.PrimaryKey;
|
||||
import com.raizlabs.android.dbflow.annotation.Table;
|
||||
import com.raizlabs.android.dbflow.structure.BaseModel;
|
||||
|
||||
@Table(databaseName = HabitDatabase.NAME)
|
||||
public class SpecialItems extends BaseModel {
|
||||
@Column
|
||||
@PrimaryKey
|
||||
@NotNull
|
||||
String user_id;
|
||||
|
||||
@Column
|
||||
@NotNull
|
||||
int seafoam, shinySeed, snowball, spookySparkles;
|
||||
|
||||
public String getUser_id() {
|
||||
return user_id;
|
||||
}
|
||||
|
||||
public void setUser_id(String user_id) {
|
||||
this.user_id = user_id;
|
||||
}
|
||||
|
||||
public int getSeafoam() {
|
||||
return seafoam;
|
||||
}
|
||||
|
||||
public void setSeafoam(int seafoam) {
|
||||
this.seafoam = seafoam;
|
||||
}
|
||||
|
||||
public int getShinySeed() {
|
||||
return shinySeed;
|
||||
}
|
||||
|
||||
public void setShinySeed(int shinySeed) {
|
||||
this.shinySeed = shinySeed;
|
||||
}
|
||||
|
||||
public int getSnowball() {
|
||||
return snowball;
|
||||
}
|
||||
|
||||
public void setSnowball(int snowball) {
|
||||
this.snowball = snowball;
|
||||
}
|
||||
|
||||
public int getSpookySparkles() {
|
||||
return spookySparkles;
|
||||
}
|
||||
|
||||
public void setSpookySparkles(int spookySparkles) {
|
||||
this.spookySparkles = spookySparkles;
|
||||
}
|
||||
}
|
||||
|
|
@ -28,9 +28,7 @@ public class SkillDeserializer
|
|||
for (Map.Entry<String, JsonElement> classEntry : object.entrySet()) {
|
||||
String classname = classEntry.getKey();
|
||||
JsonObject classObject = classEntry.getValue().getAsJsonObject();
|
||||
if (classname.equals("special")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (Map.Entry<String, JsonElement> skillEntry : classObject.entrySet()) {
|
||||
JsonObject skillObject = skillEntry.getValue().getAsJsonObject();
|
||||
Skill skill = new Skill();
|
||||
|
|
@ -41,7 +39,14 @@ public class SkillDeserializer
|
|||
skill.target = skillObject.get("target").getAsString();
|
||||
skill.habitClass = classname;
|
||||
skill.mana = skillObject.get("mana").getAsInt();
|
||||
skill.lvl = skillObject.get("lvl").getAsInt();
|
||||
|
||||
JsonElement lvlElement = skillObject.get("lvl");
|
||||
|
||||
if(lvlElement != null)
|
||||
{
|
||||
skill.lvl = lvlElement.getAsInt();
|
||||
}
|
||||
|
||||
skills.add(skill);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
5
gradle/wrapper/gradle-wrapper.properties
vendored
5
gradle/wrapper/gradle-wrapper.properties
vendored
|
|
@ -1,7 +1,6 @@
|
|||
#Mon Sep 12 12:48:06 CEST 2016
|
||||
#Thu Sep 29 20:11:45 CEST 2016
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
org.gradle.jvmargs=-Xmx3072M
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip
|
||||
|
|
|
|||
46
gradlew
vendored
46
gradlew
vendored
|
|
@ -6,12 +6,30 @@
|
|||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
|
|
@ -30,6 +48,7 @@ die ( ) {
|
|||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
|
|
@ -40,26 +59,11 @@ case "`uname`" in
|
|||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
|
|
@ -85,7 +89,7 @@ location of your Java installation."
|
|||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
|
|
|
|||
8
gradlew.bat
vendored
8
gradlew.bat
vendored
|
|
@ -8,14 +8,14 @@
|
|||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ echo location of your Java installation.
|
|||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
|
|
|||
Loading…
Reference in a new issue