diff --git a/Habitica/Habitica.iml b/Habitica/Habitica.iml index b9fba91ad..91349e54a 100644 --- a/Habitica/Habitica.iml +++ b/Habitica/Habitica.iml @@ -82,8 +82,8 @@ - - + + @@ -109,58 +109,58 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + + - - - - - + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Habitica/res/layout/activity_main.xml b/Habitica/res/layout/activity_main.xml index c754549b3..eb5d84514 100644 --- a/Habitica/res/layout/activity_main.xml +++ b/Habitica/res/layout/activity_main.xml @@ -14,7 +14,7 @@ app:viewpager_logoMarginTop="70dp" app:viewpager_pagerTitleStrip="@layout/material_view_pager_pagertitlestrip_standard" app:viewpager_color="@color/brand" - app:viewpager_headerHeight="220dp" + app:viewpager_headerHeight="250dp" app:viewpager_headerAlpha="1" app:viewpager_logo="@layout/avatar_with_bars" app:viewpager_hideLogoWithFade="true" diff --git a/Habitica/res/values-land/dimens.xml b/Habitica/res/values-land/dimens.xml index 07a2377d1..10d607e5f 100644 --- a/Habitica/res/values-land/dimens.xml +++ b/Habitica/res/values-land/dimens.xml @@ -3,6 +3,4 @@ -10dp 38dp 50dp - 90dp - 70dp \ No newline at end of file diff --git a/Habitica/res/values/dimens.xml b/Habitica/res/values/dimens.xml index d7c8c6be7..5e5a197b8 100644 --- a/Habitica/res/values/dimens.xml +++ b/Habitica/res/values/dimens.xml @@ -14,8 +14,8 @@ 29dp 25dp 5dp - 90dp - 70dp + 140dp + 147dp 70dp 48dp diff --git a/Habitica/src/com/habitrpg/android/habitica/ui/AvatarWithBarsViewModel.java b/Habitica/src/com/habitrpg/android/habitica/ui/AvatarWithBarsViewModel.java index e2984bc87..b2edb026a 100644 --- a/Habitica/src/com/habitrpg/android/habitica/ui/AvatarWithBarsViewModel.java +++ b/Habitica/src/com/habitrpg/android/habitica/ui/AvatarWithBarsViewModel.java @@ -25,6 +25,7 @@ public class AvatarWithBarsViewModel { ValueBarBinding mpBar; ImageView image; + UserPicture userPicture; android.content.res.Resources res; @@ -46,7 +47,6 @@ public class AvatarWithBarsViewModel { View hpBarView = v.findViewById(R.id.hpBar); image = (ImageView) v.findViewById(R.id.IMG_ProfilePicture); - hpBar = DataBindingUtil.bind(hpBarView); xpBar = DataBindingUtil.bind(v.findViewById(R.id.xpBar)); mpBar = DataBindingUtil.bind(v.findViewById(R.id.mpBar)); @@ -58,7 +58,6 @@ public class AvatarWithBarsViewModel { res.getColor(R.color.xpColor), res.getColor(R.color.xpColorBackground), res.getColor(R.color.xpColorForeground)); SetValueBar(mpBar, 100, 100, context.getString(R.string.MP_default), res.getColor(R.color.mpColor), res.getColor(R.color.mpColorBackground),res.getColor(R.color.mpColorForeground)); - } public void UpdateData(HabitRPGUser user) @@ -72,7 +71,7 @@ public class AvatarWithBarsViewModel { SetValueBar(mpBar, stats.getMp().floatValue(), stats.getMaxMP(), context.getString(R.string.MP_default), res.getColor(R.color.mpColor), res.getColor(R.color.mpColorBackground),res.getColor(R.color.mpColorForeground)); - image.setImageBitmap(new UserPicture(user, context).draw()); + new UserPicture(user, this.context).setPictureOn(image); } // Layout_Weight don't accepts 0.7/0.3 to have 70% filled instead it shows the 30% , so I had to switch the values diff --git a/Habitica/src/com/habitrpg/android/habitica/userpicture/UserObject.java b/Habitica/src/com/habitrpg/android/habitica/userpicture/UserObject.java deleted file mode 100644 index 03b3da92b..000000000 --- a/Habitica/src/com/habitrpg/android/habitica/userpicture/UserObject.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.habitrpg.android.habitica.userpicture; - -public class UserObject { - private String image; - private int x; - private int y; - private int width; - private int height; - - /*public UserObject(String imageUrl, String position, String str_width, String str_height) { - String [] x_y=position.replace("px", "").split("\\s+"); - String image = imageUrl.replace("url(", "").replace(")", ""); - int x = Integer.parseInt(x_y[0]); - int y =Integer.parseInt(x_y[1]); - int width = Integer.parseInt(str_width.replace("px", "")); - int height = Integer.parseInt(str_height.replace("px", "")); - //this(image,x,y,width,height); - }*/ - public UserObject(String image, int x, int y, int width, int height) { - this.setImage(image); - this.setX(x); - this.setY(y); - this.setWidth(width); - this.setHeight(height); - } - - /** - * @return the image - */ - public String getImage() { - return image; - } - - /** - * @param image the image to set - */ - public void setImage(String image) { - this.image = image; - } - - /** - * @return the x - */ - public int getX() { - return x; - } - - /** - * @param x the x to set - */ - public void setX(int x) { - this.x = x; - } - - /** - * @return the y - */ - public int getY() { - return y; - } - - /** - * @param y the y to set - */ - public void setY(int y) { - this.y = y; - } - - /** - * @return the width - */ - public int getWidth() { - return width; - } - - /** - * @param width the width to set - */ - public void setWidth(int width) { - this.width = width; - } - - /** - * @return the height - */ - public int getHeight() { - return height; - } - - /** - * @param height the height to set - */ - public void setHeight(int height) { - this.height = height; - } -} diff --git a/Habitica/src/com/habitrpg/android/habitica/userpicture/UserPicture.java b/Habitica/src/com/habitrpg/android/habitica/userpicture/UserPicture.java index b26ad8bd5..b09b19d80 100644 --- a/Habitica/src/com/habitrpg/android/habitica/userpicture/UserPicture.java +++ b/Habitica/src/com/habitrpg/android/habitica/userpicture/UserPicture.java @@ -3,6 +3,8 @@ package com.habitrpg.android.habitica.userpicture; import com.habitrpg.android.habitica.R; import com.magicmicky.habitrpgwrapper.lib.models.HabitRPGUser; import com.magicmicky.habitrpgwrapper.lib.models.Items; +import com.squareup.picasso.Picasso; +import com.squareup.picasso.Target; import android.content.Context; import android.graphics.Bitmap; @@ -11,126 +13,138 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; +import android.graphics.drawable.Drawable; +import android.media.Image; import android.util.Log; +import android.widget.ImageView; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; public class UserPicture { - - private Context mContext; - private Items items; + + static Integer width = 140; + static Integer height = 147; + private HabitRPGUser user; - public UserPicture(HabitRPGUser user, Context context) { - this.user = user; - this.mContext= context; - } - - - public Bitmap draw() { + private ImageView imageView; + private Context context; + public int numOfTasks = 0; - BitmapFactory.Options o = new BitmapFactory.Options(); - o.inScaled = false; - Bitmap imgSprites = BitmapFactory.decodeResource(mContext.getResources(), getSprites(),o); + private boolean hasBackground, hasMount, hasPet; - Bitmap res = Bitmap.createBitmap(114, 90, Bitmap.Config.ARGB_8888);//114 is the maximum width of the gears. - Canvas myCanvas = new Canvas(res); - if(user !=null) - drawAvatar(user, imgSprites, myCanvas); - return res; - } + List layers = new ArrayList(); - private void drawAvatar(HabitRPGUser user, Bitmap imgSprites, Canvas cv) { - drawSprite(UserSprite.getSkin(user.getPreferences().getSkin()), imgSprites, cv); + public UserPicture(HabitRPGUser user, Context context) { + this.user = user; + this.context = context; + } - com.magicmicky.habitrpgwrapper.lib.models.Preferences.Hair hair = user.getPreferences().getHair(); + public void allTasksComplete(){ - if(hair != null) { - Log.d("Avatar", "drawing head"); - drawSprite(UserSprite.gethair_bangs(hair.getBangs(), hair.getColor()), imgSprites, cv); - drawSprite(UserSprite.gethair_mustache(hair.getMustache(), hair.getColor()), imgSprites, cv); - drawSprite(UserSprite.gethair_base(hair.getBase(), hair.getColor()), imgSprites, cv); - drawSprite(UserSprite.gethair_beard(hair.getBeard(), hair.getColor()), imgSprites, cv); + if(this.numOfTasks == 0){ + BitmapFactory.Options o = new BitmapFactory.Options(); + o.inScaled = false; + + Bitmap res = Bitmap.createBitmap(140, 147, Bitmap.Config.ARGB_8888); + Canvas myCanvas = new Canvas(res); + Integer layerNumber = 0; + for (Object layer : this.layers) { + if (layer.getClass() == Bitmap.class) { + Bitmap layerBitmap = (Bitmap) layer; + this.modifyCanvas(layerBitmap, myCanvas, layerNumber); + } + layerNumber++; + } + this.imageView.setImageBitmap(res); } - if(user.getPreferences().getSleep()) - drawSprite(UserSprite.zzz, imgSprites, cv); -// -// UserLook.UserItems items = user.getPreferences().isCostume() ? user.getItems().getGear() : user.getItems(); -// drawSprite(UserSprite.getArmor(items.getArmor(), user.getSize(), user.getPreferences().getShirt()), imgSprites, cv); -// drawSprite(UserSprite.getWeapon(items.getWeapon()),imgSprites,cv); -// drawSprite(UserSprite.getShield(items.getShield()),imgSprites,cv); -// drawSprite(UserSprite.getHead(items.getHead()),imgSprites,cv); } - private void drawSprite(UserObject obj, Bitmap img, Canvas cv) { - if(obj!=null) - modifyCanvas(img,(-1)*obj.getX(),(-1)*obj.getY(),obj.getWidth(), obj.getHeight(),cv); - else - Log.e("Avatar", "obj draw sprite = null"); + public void setPictureOn(ImageView imageView) { + this.imageView = imageView; + List layerNames = this.user.getAvatarLayerNames(); + + if (this.user.getItems().getCurrentMount() != null) { + layerNames.add(0, "Mount_Body_" + this.user.getItems().getCurrentMount()); + layerNames.add("Mount_Head_" + this.user.getItems().getCurrentMount()); + this.hasMount = true; + } + + if (this.user.getItems().getCurrentPet() != null) { + layerNames.add("Pet-" + this.user.getItems().getCurrentPet()); + this.hasPet = true; + } + + if (this.user.getPreferences().getBackground() != null) { + layerNames.add(0, "background_" + this.user.getPreferences().getBackground()); + this.hasBackground = true; + } + + Integer layerNumber = 0; + this.numOfTasks = layerNames.size(); + for (String layer : layerNames) { + layers.add(0); + SpriteTarget target = new SpriteTarget(layerNumber); + Picasso.with(this.context).load("https://habitica-assets.s3.amazonaws.com/mobileApp/images/"+ layer +".png").into(target); + layerNumber = layerNumber + 1; + } } - private int getSprites() { - return R.drawable.spritesmith; - } - - private void modifyCanvas(Bitmap img, int start_x, int start_y,int width, int height, Canvas canvas) { - Rect source = new Rect(start_x,start_y, start_x+width, start_y +height); - Rect dest = new Rect(0,0,width, height); + private void modifyCanvas(Bitmap img, Canvas canvas, Integer layerNumber) { Paint paint = new Paint(); paint.setFilterBitmap(false); - canvas.drawBitmap(img, source, dest, paint); + Integer xOffset = 25; + Integer yOffset = 18; + + if (this.hasBackground && layerNumber == 0) { + xOffset = 0; + yOffset = 0; + } + + if (this.hasMount && !((this.hasBackground && layerNumber == 1) || + (!this.hasBackground && layerNumber == 0) || + (this.hasPet && layerNumber == this.layers.size()-2) || + (!this.hasPet && layerNumber == this.layers.size()-1) + )) { + yOffset = 0; + } + + if (this.hasPet && layerNumber == this.layers.size()-1) { + xOffset = 0; + yOffset = 43; + } + + canvas.drawBitmap(img, new Rect(0, 0, img.getWidth(), img.getHeight()), + new Rect(xOffset, yOffset, img.getWidth()+xOffset, img.getHeight()+yOffset), paint); } - /** - * From StackOverflow - * find the rect value to scale the image (delete the transparent side) - * @param image the image to search in - * @return the x1,x2,y1,y2 to form the new Rect(res[0],res[2],res[1],res[3]) - */ - private int[] findRectValues(Bitmap image) - { - int[] res = {0,0,0,0};//x1,x2,y1,y2 + private class SpriteTarget implements Target { - for(int x = 0; x < image.getWidth(); x++){ - for(int y = 0; y < image.getHeight(); y++){ - if(image.getPixel(x, y) != Color.TRANSPARENT){ - res[0] = x; - break; - } - } - if(res[0] != 0) - break; - } - for(int x = image.getWidth()-1; x > 0; x--) { - for(int y = 0; y < image.getHeight(); y++){ - if(image.getPixel(x, y) != Color.TRANSPARENT){ - res[1] = x; - break; - } - } - if(res[1] != 0) - break; - } - for(int y = 0; y < image.getHeight(); y++){ - for(int x = 0; x < image.getWidth(); x++){ - if(image.getPixel(x, y) != Color.TRANSPARENT){ - res[2] = y; - break; - } - } - if(res[2] != 0) - break; - } - for(int y = image.getHeight()-1; y > 0; y--){ - for(int x = 0; x < image.getWidth(); x++){ - if(image.getPixel(x, y) != Color.TRANSPARENT){ - res[3] = y; - break; - } - } - if(res[3] != 0) - break; - } - return res; - } + private Integer layerNumber; + + public SpriteTarget(Integer layerNumber) { + this.layerNumber = layerNumber; + } + + @Override + public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { + layers.set(this.layerNumber, bitmap); + numOfTasks--; + allTasksComplete(); + } + + @Override + public void onBitmapFailed(Drawable errorDrawable) { + numOfTasks--; + allTasksComplete(); + } + + @Override + public void onPrepareLoad(Drawable placeHolderDrawable) { + } + } } \ No newline at end of file diff --git a/Habitica/src/com/habitrpg/android/habitica/userpicture/UserSprite.java b/Habitica/src/com/habitrpg/android/habitica/userpicture/UserSprite.java deleted file mode 100644 index 476a2c48e..000000000 --- a/Habitica/src/com/habitrpg/android/habitica/userpicture/UserSprite.java +++ /dev/null @@ -1,535 +0,0 @@ -package com.habitrpg.android.habitica.userpicture; - -import java.lang.reflect.Field; - - -public class UserSprite{ - public static UserObject broad_armor_healer_1= new UserObject("spritesmith.png", -735, -1521, 90, 90); - public static UserObject broad_armor_healer_2= new UserObject("spritesmith.png", -825, -1521, 90, 90); - public static UserObject broad_armor_healer_3= new UserObject("spritesmith.png", -915, -1521, 90, 90); - public static UserObject broad_armor_healer_4= new UserObject("spritesmith.png", -1005, -1521, 90, 90); - public static UserObject broad_armor_healer_5= new UserObject("spritesmith.png", -1095, -1521, 90, 90); - public static UserObject broad_armor_rogue_1= new UserObject("spritesmith.png", -1275, -1521, 90, 90); - public static UserObject broad_armor_rogue_2= new UserObject("spritesmith.png", -1365, -1521, 90, 90); - public static UserObject broad_armor_rogue_3= new UserObject("spritesmith.png", -1455, -1521, 90, 90); - public static UserObject broad_armor_rogue_4= new UserObject("spritesmith.png", -1626, 0, 90, 90); - public static UserObject broad_armor_rogue_5= new UserObject("spritesmith.png", -1626, -90, 90, 90); - public static UserObject broad_armor_special_2= new UserObject("spritesmith.png", -1626, -180, 90, 90); - public static UserObject broad_armor_special_tarutaru= new UserObject("spritesmith.png", -1626, -360, 90, 90); - public static UserObject broad_armor_warrior_1= new UserObject("spritesmith.png", -1626, -450, 90, 90); - public static UserObject broad_armor_warrior_2= new UserObject("spritesmith.png", -1626, -540, 90, 90); - public static UserObject broad_armor_warrior_3= new UserObject("spritesmith.png", -1626, -630, 90, 90); - public static UserObject broad_armor_warrior_4= new UserObject("spritesmith.png", -1626, -720, 90, 90); - public static UserObject broad_armor_warrior_5= new UserObject("spritesmith.png", -1626, -810, 90, 90); - public static UserObject broad_armor_wizard_1= new UserObject("spritesmith.png", -1626, -900, 90, 90); - public static UserObject broad_armor_wizard_2= new UserObject("spritesmith.png", -1626, -990, 90, 90); - public static UserObject broad_armor_wizard_3= new UserObject("spritesmith.png", -1626, -1080, 90, 90); - public static UserObject broad_armor_wizard_4= new UserObject("spritesmith.png", -1626, -1170, 90, 90); - public static UserObject broad_armor_wizard_5= new UserObject("spritesmith.png", -1626, -1260, 90, 90); - public static UserObject slim_armor_healer_1= new UserObject("spritesmith.png", -1626, -1350, 90, 90); - public static UserObject slim_armor_healer_2= new UserObject("spritesmith.png", -1626, -1440, 90, 90); - public static UserObject slim_armor_healer_3= new UserObject("spritesmith.png", 0, -1611, 90, 90); - public static UserObject slim_armor_healer_4= new UserObject("spritesmith.png", -90, -1611, 90, 90); - public static UserObject slim_armor_healer_5= new UserObject("spritesmith.png", -180, -1611, 90, 90); - public static UserObject slim_armor_rogue_1= new UserObject("spritesmith.png", -270, -1611, 90, 90); - public static UserObject slim_armor_rogue_2= new UserObject("spritesmith.png", -360, -1611, 90, 90); - public static UserObject slim_armor_rogue_3= new UserObject("spritesmith.png", -450, -1611, 90, 90); - public static UserObject slim_armor_rogue_4= new UserObject("spritesmith.png", -540, -1611, 90, 90); - public static UserObject slim_armor_rogue_5= new UserObject("spritesmith.png", -630, -1611, 90, 90); - public static UserObject slim_armor_special_2= new UserObject("spritesmith.png", -720, -1611, 90, 90); - public static UserObject slim_armor_warrior_1= new UserObject("spritesmith.png", -810, -1611, 90, 90); - public static UserObject slim_armor_warrior_2= new UserObject("spritesmith.png", -900, -1611, 90, 90); - public static UserObject slim_armor_warrior_3= new UserObject("spritesmith.png", -990, -1611, 90, 90); - public static UserObject slim_armor_warrior_4= new UserObject("spritesmith.png", -1080, -1611, 90, 90); - public static UserObject slim_armor_warrior_5= new UserObject("spritesmith.png", -1170, -1611, 90, 90); - public static UserObject slim_armor_wizard_1= new UserObject("spritesmith.png", -1260, -1611, 90, 90); - public static UserObject slim_armor_wizard_2= new UserObject("spritesmith.png", -1350, -1611, 90, 90); - public static UserObject slim_armor_wizard_3= new UserObject("spritesmith.png", -1440, -1611, 90, 90); - public static UserObject slim_armor_wizard_4= new UserObject("spritesmith.png", -1530, -1611, 90, 90); - public static UserObject slim_armor_wizard_5= new UserObject("spritesmith.png", -1620, -1611, 90, 90); - public static UserObject beard_= new UserObject("spritesmith.png", -1716, 0, 90, 90); - public static UserObject hair_beard_1_black= new UserObject("spritesmith.png", -1716, -90, 90, 90); - public static UserObject hair_beard_1_blond= new UserObject("spritesmith.png", -1716, -180, 90, 90); - public static UserObject hair_beard_1_brown= new UserObject("spritesmith.png", -1716, -270, 90, 90); - public static UserObject hair_beard_1_candycane= new UserObject("spritesmith.png", -1716, -360, 90, 90); - public static UserObject hair_beard_1_frost= new UserObject("spritesmith.png", -1716, -450, 90, 90); - public static UserObject hair_beard_1_holly= new UserObject("spritesmith.png", -1716, -540, 90, 90); - public static UserObject hair_beard_1_red= new UserObject("spritesmith.png", -1716, -630, 90, 90); - public static UserObject hair_beard_1_white= new UserObject("spritesmith.png", -1716, -720, 90, 90); - public static UserObject hair_beard_1_winternight= new UserObject("spritesmith.png", -1716, -810, 90, 90); - public static UserObject hair_beard_2_black= new UserObject("spritesmith.png", -1716, -900, 90, 90); - public static UserObject hair_beard_2_blond= new UserObject("spritesmith.png", -1716, -990, 90, 90); - public static UserObject hair_beard_2_brown= new UserObject("spritesmith.png", -1716, -1080, 90, 90); - public static UserObject hair_beard_2_candycane= new UserObject("spritesmith.png", -1716, -1170, 90, 90); - public static UserObject hair_beard_2_frost= new UserObject("spritesmith.png", -1716, -1260, 90, 90); - public static UserObject hair_beard_2_holly= new UserObject("spritesmith.png", -1716, -1350, 90, 90); - public static UserObject hair_beard_2_red= new UserObject("spritesmith.png", -1716, -1440, 90, 90); - public static UserObject hair_beard_2_white= new UserObject("spritesmith.png", -1716, -1530, 90, 90); - public static UserObject hair_beard_2_winternight= new UserObject("spritesmith.png", 0, -1701, 90, 90); - public static UserObject hair_beard_3_black= new UserObject("spritesmith.png", -90, -1701, 90, 90); - public static UserObject hair_beard_3_blond= new UserObject("spritesmith.png", -180, -1701, 90, 90); - public static UserObject hair_beard_3_brown= new UserObject("spritesmith.png", -270, -1701, 90, 90); - public static UserObject hair_beard_3_candycane= new UserObject("spritesmith.png", -360, -1701, 90, 90); - public static UserObject hair_beard_3_frost= new UserObject("spritesmith.png", -450, -1701, 90, 90); - public static UserObject hair_beard_3_holly= new UserObject("spritesmith.png", -540, -1701, 90, 90); - public static UserObject hair_beard_3_red= new UserObject("spritesmith.png", -630, -1701, 90, 90); - public static UserObject hair_beard_3_white= new UserObject("spritesmith.png", -720, -1701, 90, 90); - public static UserObject hair_beard_3_winternight= new UserObject("spritesmith.png", -810, -1701, 90, 90); - public static UserObject hair_mustache_1_black= new UserObject("spritesmith.png", -900, -1701, 90, 90); - public static UserObject hair_mustache_1_blond= new UserObject("spritesmith.png", -990, -1701, 90, 90); - public static UserObject hair_mustache_1_brown= new UserObject("spritesmith.png", -1080, -1701, 90, 90); - public static UserObject hair_mustache_1_candycane= new UserObject("spritesmith.png", -1170, -1701, 90, 90); - public static UserObject hair_mustache_1_frost= new UserObject("spritesmith.png", -1260, -1701, 90, 90); - public static UserObject hair_mustache_1_holly= new UserObject("spritesmith.png", -1350, -1701, 90, 90); - public static UserObject hair_mustache_1_red= new UserObject("spritesmith.png", -1440, -1701, 90, 90); - public static UserObject hair_mustache_1_white= new UserObject("spritesmith.png", -486, -882, 90, 90); - public static UserObject hair_mustache_1_winternight= new UserObject("spritesmith.png", -576, -882, 90, 90); - public static UserObject hair_mustache_2_black= new UserObject("spritesmith.png", -666, -882, 90, 90); - public static UserObject hair_mustache_2_blond= new UserObject("spritesmith.png", -756, -882, 90, 90); - public static UserObject hair_mustache_2_brown= new UserObject("spritesmith.png", -846, -882, 90, 90); - public static UserObject hair_mustache_2_candycane= new UserObject("spritesmith.png", -996, 0, 90, 90); - public static UserObject hair_mustache_2_frost= new UserObject("spritesmith.png", -996, -90, 90, 90); - public static UserObject hair_mustache_2_holly= new UserObject("spritesmith.png", -996, -180, 90, 90); - public static UserObject hair_mustache_2_red= new UserObject("spritesmith.png", -996, -270, 90, 90); - public static UserObject hair_mustache_2_white= new UserObject("spritesmith.png", -996, -360, 90, 90); - public static UserObject hair_mustache_2_winternight= new UserObject("spritesmith.png", -996, -450, 90, 90); - public static UserObject hair_bangs_1_black= new UserObject("spritesmith.png", -996, -540, 90, 90); - public static UserObject hair_bangs_1_blond= new UserObject("spritesmith.png", -996, -630, 90, 90); - public static UserObject hair_bangs_1_brown= new UserObject("spritesmith.png", -996, -720, 90, 90); - public static UserObject hair_bangs_1_candycane= new UserObject("spritesmith.png", -996, -810, 90, 90); - public static UserObject hair_bangs_1_frost= new UserObject("spritesmith.png", 0, -981, 90, 90); - public static UserObject hair_bangs_1_holly= new UserObject("spritesmith.png", -90, -981, 90, 90); - public static UserObject hair_bangs_1_red= new UserObject("spritesmith.png", -180, -981, 90, 90); - public static UserObject hair_bangs_1_white= new UserObject("spritesmith.png", -270, -981, 90, 90); - public static UserObject hair_bangs_1_winternight= new UserObject("spritesmith.png", -360, -981, 90, 90); - public static UserObject hair_bangs_2_black= new UserObject("spritesmith.png", -450, -981, 90, 90); - public static UserObject hair_bangs_2_blond= new UserObject("spritesmith.png", -540, -981, 90, 90); - public static UserObject hair_bangs_2_brown= new UserObject("spritesmith.png", -630, -981, 90, 90); - public static UserObject hair_bangs_2_candycane= new UserObject("spritesmith.png", -720, -981, 90, 90); - public static UserObject hair_bangs_2_frost= new UserObject("spritesmith.png", -810, -981, 90, 90); - public static UserObject hair_bangs_2_holly= new UserObject("spritesmith.png", -900, -981, 90, 90); - public static UserObject hair_bangs_2_red= new UserObject("spritesmith.png", -990, -981, 90, 90); - public static UserObject hair_bangs_2_white= new UserObject("spritesmith.png", -1086, 0, 90, 90); - public static UserObject hair_bangs_2_winternight= new UserObject("spritesmith.png", -1086, -90, 90, 90); - public static UserObject hair_bangs_3_black= new UserObject("spritesmith.png", -1086, -180, 90, 90); - public static UserObject hair_bangs_3_blond= new UserObject("spritesmith.png", -1086, -270, 90, 90); - public static UserObject hair_bangs_3_brown= new UserObject("spritesmith.png", -1086, -360, 90, 90); - public static UserObject hair_bangs_3_candycane= new UserObject("spritesmith.png", -1086, -450, 90, 90); - public static UserObject hair_bangs_3_frost= new UserObject("spritesmith.png", -1086, -540, 90, 90); - public static UserObject hair_bangs_3_holly= new UserObject("spritesmith.png", -1086, -630, 90, 90); - public static UserObject hair_bangs_3_red= new UserObject("spritesmith.png", -1086, -720, 90, 90); - public static UserObject hair_bangs_3_white= new UserObject("spritesmith.png", -1086, -810, 90, 90); - public static UserObject hair_bangs_3_winternight= new UserObject("spritesmith.png", -1086, -900, 90, 90); - public static UserObject hair_base_1_black= new UserObject("spritesmith.png", 0, -1071, 90, 90); - public static UserObject hair_base_1_blond= new UserObject("spritesmith.png", -90, -1071, 90, 90); - public static UserObject hair_base_1_brown= new UserObject("spritesmith.png", -180, -1071, 90, 90); - public static UserObject hair_base_1_candycane= new UserObject("spritesmith.png", -270, -1071, 90, 90); - public static UserObject hair_base_1_frost= new UserObject("spritesmith.png", -360, -1071, 90, 90); - public static UserObject hair_base_1_holly= new UserObject("spritesmith.png", -450, -1071, 90, 90); - public static UserObject hair_base_1_red= new UserObject("spritesmith.png", -540, -1071, 90, 90); - public static UserObject hair_base_1_white= new UserObject("spritesmith.png", -630, -1071, 90, 90); - public static UserObject hair_base_1_winternight= new UserObject("spritesmith.png", -720, -1071, 90, 90); - public static UserObject hair_base_2_black= new UserObject("spritesmith.png", -810, -1071, 90, 90); - public static UserObject hair_base_2_blond= new UserObject("spritesmith.png", -900, -1071, 90, 90); - public static UserObject hair_base_2_brown= new UserObject("spritesmith.png", -990, -1071, 90, 90); - public static UserObject hair_base_2_candycane= new UserObject("spritesmith.png", -1080, -1071, 90, 90); - public static UserObject hair_base_2_frost= new UserObject("spritesmith.png", -1176, 0, 90, 90); - public static UserObject hair_base_2_holly= new UserObject("spritesmith.png", -1176, -90, 90, 90); - public static UserObject hair_base_2_red= new UserObject("spritesmith.png", -1176, -180, 90, 90); - public static UserObject hair_base_2_white= new UserObject("spritesmith.png", -1176, -270, 90, 90); - public static UserObject hair_base_2_winternight= new UserObject("spritesmith.png", -1176, -360, 90, 90); - public static UserObject hair_base_3_black= new UserObject("spritesmith.png", -1176, -450, 90, 90); - public static UserObject hair_base_3_blond= new UserObject("spritesmith.png", -1176, -540, 90, 90); - public static UserObject hair_base_3_brown= new UserObject("spritesmith.png", -1176, -630, 90, 90); - public static UserObject hair_base_3_candycane= new UserObject("spritesmith.png", -1176, -720, 90, 90); - public static UserObject hair_base_3_frost= new UserObject("spritesmith.png", -1176, -810, 90, 90); - public static UserObject hair_base_3_holly= new UserObject("spritesmith.png", -1176, -900, 90, 90); - public static UserObject hair_base_3_red= new UserObject("spritesmith.png", -1176, -990, 90, 90); - public static UserObject hair_base_3_white= new UserObject("spritesmith.png", 0, -1161, 90, 90); - public static UserObject hair_base_3_winternight= new UserObject("spritesmith.png", -90, -1161, 90, 90); - public static UserObject hair_base_4_black= new UserObject("spritesmith.png", -180, -1161, 90, 90); - public static UserObject hair_base_4_blond= new UserObject("spritesmith.png", -270, -1161, 90, 90); - public static UserObject hair_base_4_brown= new UserObject("spritesmith.png", -360, -1161, 90, 90); - public static UserObject hair_base_4_candycane= new UserObject("spritesmith.png", -450, -1161, 90, 90); - public static UserObject hair_base_4_frost= new UserObject("spritesmith.png", -540, -1161, 90, 90); - public static UserObject hair_base_4_holly= new UserObject("spritesmith.png", -630, -1161, 90, 90); - public static UserObject hair_base_4_red= new UserObject("spritesmith.png", -720, -1161, 90, 90); - public static UserObject hair_base_4_white= new UserObject("spritesmith.png", -810, -1161, 90, 90); - public static UserObject hair_base_4_winternight= new UserObject("spritesmith.png", -900, -1161, 90, 90); - public static UserObject hair_base_5_black= new UserObject("spritesmith.png", -990, -1161, 90, 90); - public static UserObject hair_base_5_blond= new UserObject("spritesmith.png", -1080, -1161, 90, 90); - public static UserObject hair_base_5_brown= new UserObject("spritesmith.png", -1170, -1161, 90, 90); - public static UserObject hair_base_5_candycane= new UserObject("spritesmith.png", -1266, 0, 90, 90); - public static UserObject hair_base_5_frost= new UserObject("spritesmith.png", -1266, -90, 90, 90); - public static UserObject hair_base_5_holly= new UserObject("spritesmith.png", -1266, -180, 90, 90); - public static UserObject hair_base_5_red= new UserObject("spritesmith.png", -1266, -270, 90, 90); - public static UserObject hair_base_5_white= new UserObject("spritesmith.png", -1266, -360, 90, 90); - public static UserObject hair_base_5_winternight= new UserObject("spritesmith.png", -1266, -450, 90, 90); - public static UserObject hair_base_6_black= new UserObject("spritesmith.png", -1266, -540, 90, 90); - public static UserObject hair_base_6_blond= new UserObject("spritesmith.png", -1266, -630, 90, 90); - public static UserObject hair_base_6_brown= new UserObject("spritesmith.png", -1266, -720, 90, 90); - public static UserObject hair_base_6_candycane= new UserObject("spritesmith.png", -1266, -810, 90, 90); - public static UserObject hair_base_6_frost= new UserObject("spritesmith.png", -1266, -900, 90, 90); - public static UserObject hair_base_6_holly= new UserObject("spritesmith.png", -1266, -990, 90, 90); - public static UserObject hair_base_6_red= new UserObject("spritesmith.png", -1266, -1080, 90, 90); - public static UserObject hair_base_6_white= new UserObject("spritesmith.png", 0, -1251, 90, 90); - public static UserObject hair_base_6_winternight= new UserObject("spritesmith.png", -90, -1251, 90, 90); - public static UserObject hair_base_7_black= new UserObject("spritesmith.png", -180, -1251, 90, 90); - public static UserObject hair_base_7_blond= new UserObject("spritesmith.png", -270, -1251, 90, 90); - public static UserObject hair_base_7_brown= new UserObject("spritesmith.png", -360, -1251, 90, 90); - public static UserObject hair_base_7_candycane= new UserObject("spritesmith.png", -450, -1251, 90, 90); - public static UserObject hair_base_7_frost= new UserObject("spritesmith.png", -540, -1251, 90, 90); - public static UserObject hair_base_7_holly= new UserObject("spritesmith.png", -630, -1251, 90, 90); - public static UserObject hair_base_7_red= new UserObject("spritesmith.png", -720, -1251, 90, 90); - public static UserObject hair_base_7_white= new UserObject("spritesmith.png", -810, -1251, 90, 90); - public static UserObject hair_base_7_winternight= new UserObject("spritesmith.png", -900, -1251, 90, 90); - public static UserObject hair_base_8_black= new UserObject("spritesmith.png", -990, -1251, 90, 90); - public static UserObject hair_base_8_blond= new UserObject("spritesmith.png", -1080, -1251, 90, 90); - public static UserObject hair_base_8_brown= new UserObject("spritesmith.png", -1170, -1251, 90, 90); - public static UserObject hair_base_8_candycane= new UserObject("spritesmith.png", -1260, -1251, 90, 90); - public static UserObject hair_base_8_frost= new UserObject("spritesmith.png", -1356, 0, 90, 90); - public static UserObject hair_base_8_holly= new UserObject("spritesmith.png", -1356, -90, 90, 90); - public static UserObject hair_base_8_red= new UserObject("spritesmith.png", -1356, -180, 90, 90); - public static UserObject hair_base_8_white= new UserObject("spritesmith.png", -1356, -270, 90, 90); - public static UserObject hair_base_8_winternight= new UserObject("spritesmith.png", -1356, -360, 90, 90); - public static UserObject head_0= new UserObject("spritesmith.png", -1356, -450, 90, 90); - public static UserObject head_healer_1= new UserObject("spritesmith.png", -1356, -540, 90, 90); - public static UserObject head_healer_2= new UserObject("spritesmith.png", -1356, -630, 90, 90); - public static UserObject head_healer_3= new UserObject("spritesmith.png", -1356, -720, 90, 90); - public static UserObject head_healer_4= new UserObject("spritesmith.png", -1356, -810, 90, 90); - public static UserObject head_healer_5= new UserObject("spritesmith.png", -1356, -900, 90, 90); - public static UserObject head_rogue_1= new UserObject("spritesmith.png", -1356, -990, 90, 90); - public static UserObject head_rogue_2= new UserObject("spritesmith.png", -1356, -1080, 90, 90); - public static UserObject head_rogue_3= new UserObject("spritesmith.png", -1356, -1170, 90, 90); - public static UserObject head_rogue_4= new UserObject("spritesmith.png", 0, -1341, 90, 90); - public static UserObject head_rogue_5= new UserObject("spritesmith.png", -90, -1341, 90, 90); - public static UserObject head_special_2= new UserObject("spritesmith.png", -180, -1341, 90, 90); - public static UserObject head_special_candycane= new UserObject("spritesmith.png", -270, -1341, 90, 90); - public static UserObject head_warrior_1= new UserObject("spritesmith.png", -360, -1341, 90, 90); - public static UserObject head_warrior_2= new UserObject("spritesmith.png", -450, -1341, 90, 90); - public static UserObject head_warrior_3= new UserObject("spritesmith.png", -540, -1341, 90, 90); - public static UserObject head_warrior_4= new UserObject("spritesmith.png", -630, -1341, 90, 90); - public static UserObject head_warrior_5= new UserObject("spritesmith.png", -720, -1341, 90, 90); - public static UserObject head_wizard_1= new UserObject("spritesmith.png", -810, -1341, 90, 90); - public static UserObject head_wizard_2= new UserObject("spritesmith.png", -900, -1341, 90, 90); - public static UserObject head_wizard_3= new UserObject("spritesmith.png", -990, -1341, 90, 90); - public static UserObject head_wizard_4= new UserObject("spritesmith.png", -1080, -1341, 90, 90); - public static UserObject head_wizard_5= new UserObject("spritesmith.png", -1170, -1341, 90, 90); - public static UserObject Pet_Currency_Gem= new UserObject("spritesmith.png", -1896, -1842, 45, 39); - public static UserObject Pet_Currency_Gem1x= new UserObject("spritesmith.png", -1953, -502, 15, 13); - public static UserObject Pet_Currency_Gem2x= new UserObject("spritesmith.png", -1947, -1383, 30, 26); - public static UserObject Pet_Egg_BearCub= new UserObject("spritesmith.png", -1896, -771, 48, 51); - public static UserObject Pet_Egg_Cactus= new UserObject("spritesmith.png", -1896, -822, 48, 51); - public static UserObject Pet_Egg_Dragon= new UserObject("spritesmith.png", -1896, -873, 48, 51); - public static UserObject Pet_Egg_FlyingPig= new UserObject("spritesmith.png", -1896, -924, 48, 51); - public static UserObject Pet_Egg_Fox= new UserObject("spritesmith.png", -1896, -975, 48, 51); - public static UserObject Pet_Egg_LionCub= new UserObject("spritesmith.png", -1896, -618, 48, 51); - public static UserObject Pet_Egg_PandaCub= new UserObject("spritesmith.png", -1086, -990, 48, 51); - public static UserObject Pet_Egg_PolarBear= new UserObject("spritesmith.png", -1176, -1080, 48, 51); - public static UserObject Pet_Egg_TigerCub= new UserObject("spritesmith.png", -1266, -1170, 48, 51); - public static UserObject Pet_Egg_Wolf= new UserObject("spritesmith.png", -1356, -1260, 48, 51); - public static UserObject Pet_Food_Chocolate= new UserObject("spritesmith.png", -1446, -1350, 48, 51); - public static UserObject Pet_Food_CottonCandyBlue= new UserObject("spritesmith.png", -1536, -1440, 48, 51); - public static UserObject Pet_Food_CottonCandyPink= new UserObject("spritesmith.png", -1626, -1530, 48, 51); - public static UserObject Pet_Food_Fish= new UserObject("spritesmith.png", -1716, -1620, 48, 51); - public static UserObject Pet_Food_Honey= new UserObject("spritesmith.png", -1806, -1710, 48, 51); - public static UserObject Pet_Food_Meat= new UserObject("spritesmith.png", -1896, -1791, 48, 51); - public static UserObject Pet_Food_Milk= new UserObject("spritesmith.png", -1896, -1740, 48, 51); - public static UserObject Pet_Food_Potatoe= new UserObject("spritesmith.png", -1896, -1689, 48, 51); - public static UserObject Pet_Food_RottenMeat= new UserObject("spritesmith.png", -1896, -1638, 48, 51); - public static UserObject Pet_Food_Saddle= new UserObject("spritesmith.png", -1896, -1587, 48, 51); - public static UserObject Pet_Food_Strawberry= new UserObject("spritesmith.png", -1896, -1536, 48, 51); - public static UserObject Pet_HatchingPotion_Base= new UserObject("spritesmith.png", -1896, -1485, 48, 51); - public static UserObject Pet_HatchingPotion_CottonCandyBlue= new UserObject("spritesmith.png", -1896, -1434, 48, 51); - public static UserObject Pet_HatchingPotion_CottonCandyPink= new UserObject("spritesmith.png", -996, -900, 48, 51); - public static UserObject Pet_HatchingPotion_Desert= new UserObject("spritesmith.png", -1896, -1332, 48, 51); - public static UserObject Pet_HatchingPotion_Golden= new UserObject("spritesmith.png", -1896, -1281, 48, 51); - public static UserObject Pet_HatchingPotion_Red= new UserObject("spritesmith.png", -1896, -1230, 48, 51); - public static UserObject Pet_HatchingPotion_Shade= new UserObject("spritesmith.png", -1896, -1179, 48, 51); - public static UserObject Pet_HatchingPotion_Skeleton= new UserObject("spritesmith.png", -1896, -1128, 48, 51); - public static UserObject Pet_HatchingPotion_White= new UserObject("spritesmith.png", -1896, -1077, 48, 51); - public static UserObject Pet_HatchingPotion_Zombie= new UserObject("spritesmith.png", -1896, -1026, 48, 51); - public static UserObject GrimReaper= new UserObject("spritesmith.png", -1896, -450, 57, 66); - public static UserObject PixelPaw002= new UserObject("spritesmith.png", -1896, -1383, 51, 51); - public static UserObject snowman= new UserObject("spritesmith.png", -1536, -360, 90, 90); - public static UserObject npc_alex= new UserObject("spritesmith.png", 0, -150, 162, 138); - public static UserObject npc_bailey= new UserObject("spritesmith.png", 0, 0, 150, 150); - public static UserObject npc_daniel= new UserObject("spritesmith.png", -162, -150, 135, 123); - public static UserObject npc_justin= new UserObject("spritesmith.png", -345, 0, 84, 120); - public static UserObject npc_matt= new UserObject("spritesmith.png", -150, 0, 195, 138); - public static UserObject shield_healer_1= new UserObject("spritesmith.png", -1530, -1701, 90, 90); - public static UserObject shield_healer_2= new UserObject("spritesmith.png", -1620, -1701, 90, 90); - public static UserObject shield_healer_3= new UserObject("spritesmith.png", -1710, -1701, 90, 90); - public static UserObject shield_healer_4= new UserObject("spritesmith.png", -1806, 0, 90, 90); - public static UserObject shield_healer_5= new UserObject("spritesmith.png", -1806, -90, 90, 90); - public static UserObject shield_rogue_0= new UserObject("spritesmith.png", -1806, -180, 90, 90); - public static UserObject shield_rogue_1= new UserObject("spritesmith.png", 0, -1791, 103, 90); - public static UserObject shield_rogue_2= new UserObject("spritesmith.png", -103, -1791, 103, 90); - public static UserObject shield_rogue_3= new UserObject("spritesmith.png", -206, -1791, 114, 90); - public static UserObject shield_rogue_4= new UserObject("spritesmith.png", -320, -1791, 100, 90); - public static UserObject shield_rogue_5= new UserObject("spritesmith.png", -420, -1791, 114, 90); - public static UserObject shield_rogue_6= new UserObject("spritesmith.png", -534, -1791, 114, 90); - public static UserObject shield_special_1= new UserObject("spritesmith.png", -1806, -270, 90, 90); - public static UserObject shield_warrior_1= new UserObject("spritesmith.png", -1806, -360, 90, 90); - public static UserObject shield_warrior_2= new UserObject("spritesmith.png", -1806, -450, 90, 90); - public static UserObject shield_warrior_3= new UserObject("spritesmith.png", -1806, -540, 90, 90); - public static UserObject shield_warrior_4= new UserObject("spritesmith.png", -1806, -630, 90, 90); - public static UserObject shield_warrior_5= new UserObject("spritesmith.png", -1806, -720, 90, 90); - public static UserObject broad_shirt_black= new UserObject("spritesmith.png", -1806, -810, 90, 90); - public static UserObject broad_shirt_blue= new UserObject("spritesmith.png", -1806, -900, 90, 90); - public static UserObject broad_shirt_convict= new UserObject("spritesmith.png", -1806, -990, 90, 90); - public static UserObject broad_shirt_cross= new UserObject("spritesmith.png", -1806, -1080, 90, 90); - public static UserObject broad_shirt_fire= new UserObject("spritesmith.png", -1806, -1170, 90, 90); - public static UserObject broad_shirt_green= new UserObject("spritesmith.png", -1806, -1260, 90, 90); - public static UserObject broad_shirt_horizon= new UserObject("spritesmith.png", -1806, -1350, 90, 90); - public static UserObject broad_shirt_ocean= new UserObject("spritesmith.png", -1806, -1440, 90, 90); - public static UserObject broad_shirt_pink= new UserObject("spritesmith.png", -1806, -1530, 90, 90); - public static UserObject broad_shirt_purple= new UserObject("spritesmith.png", -1806, -1620, 90, 90); - public static UserObject broad_shirt_rainbow= new UserObject("spritesmith.png", -648, -1791, 90, 90); - public static UserObject broad_shirt_redblue= new UserObject("spritesmith.png", -738, -1791, 90, 90); - public static UserObject broad_shirt_thunder= new UserObject("spritesmith.png", -828, -1791, 90, 90); - public static UserObject broad_shirt_tropical= new UserObject("spritesmith.png", -918, -1791, 90, 90); - public static UserObject broad_shirt_white= new UserObject("spritesmith.png", -1008, -1791, 90, 90); - public static UserObject broad_shirt_yellow= new UserObject("spritesmith.png", -1098, -1791, 90, 90); - public static UserObject broad_shirt_zombie= new UserObject("spritesmith.png", -1188, -1791, 90, 90); - public static UserObject slim_shirt_black= new UserObject("spritesmith.png", -1278, -1791, 90, 90); - public static UserObject slim_shirt_blue= new UserObject("spritesmith.png", -1368, -1791, 90, 90); - public static UserObject slim_shirt_convict= new UserObject("spritesmith.png", -1458, -1791, 90, 90); - public static UserObject slim_shirt_cross= new UserObject("spritesmith.png", -1548, -1791, 90, 90); - public static UserObject slim_shirt_fire= new UserObject("spritesmith.png", -1638, -1791, 90, 90); - public static UserObject slim_shirt_green= new UserObject("spritesmith.png", -1728, -1791, 90, 90); - public static UserObject slim_shirt_horizon= new UserObject("spritesmith.png", -1896, 0, 90, 90); - public static UserObject slim_shirt_ocean= new UserObject("spritesmith.png", -1896, -90, 90, 90); - public static UserObject slim_shirt_pink= new UserObject("spritesmith.png", -1896, -180, 90, 90); - public static UserObject slim_shirt_purple= new UserObject("spritesmith.png", -1896, -270, 90, 90); - public static UserObject slim_shirt_rainbow= new UserObject("spritesmith.png", -1896, -360, 90, 90); - public static UserObject slim_shirt_redblue= new UserObject("spritesmith.png", -1626, -270, 90, 90); - public static UserObject slim_shirt_thunder= new UserObject("spritesmith.png", -1185, -1521, 90, 90); - public static UserObject slim_shirt_tropical= new UserObject("spritesmith.png", -1536, -270, 90, 90); - public static UserObject slim_shirt_white= new UserObject("spritesmith.png", -1536, -180, 90, 90); - public static UserObject slim_shirt_yellow= new UserObject("spritesmith.png", -1536, -90, 90, 90); - public static UserObject slim_shirt_zombie= new UserObject("spritesmith.png", -1536, 0, 90, 90); - public static UserObject inventory_special_fortify= new UserObject("spritesmith.png", -1896, -669, 48, 51); - public static UserObject inventory_special_snowball= new UserObject("spritesmith.png", -1896, -720, 48, 51); - public static UserObject shop_armor_base_0= new UserObject("spritesmith.png", -1314, -1881, 40, 40); - public static UserObject shop_armor_healer_1= new UserObject("spritesmith.png", -672, -495, 40, 40); - public static UserObject shop_armor_healer_2= new UserObject("spritesmith.png", -712, -495, 40, 40); - public static UserObject shop_armor_healer_3= new UserObject("spritesmith.png", -712, -535, 40, 40); - public static UserObject shop_armor_healer_4= new UserObject("spritesmith.png", -434, -1881, 40, 40); - public static UserObject shop_armor_healer_5= new UserObject("spritesmith.png", -474, -1881, 40, 40); - public static UserObject shop_armor_rogue_1= new UserObject("spritesmith.png", -514, -1881, 40, 40); - public static UserObject shop_armor_rogue_2= new UserObject("spritesmith.png", -554, -1881, 40, 40); - public static UserObject shop_armor_rogue_3= new UserObject("spritesmith.png", -594, -1881, 40, 40); - public static UserObject shop_armor_rogue_4= new UserObject("spritesmith.png", -634, -1881, 40, 40); - public static UserObject shop_armor_rogue_5= new UserObject("spritesmith.png", -674, -1881, 40, 40); - public static UserObject shop_armor_special_0= new UserObject("spritesmith.png", -714, -1881, 40, 40); - public static UserObject shop_armor_special_1= new UserObject("spritesmith.png", -754, -1881, 40, 40); - public static UserObject shop_armor_special_2= new UserObject("spritesmith.png", -794, -1881, 40, 40); - public static UserObject shop_armor_warrior_1= new UserObject("spritesmith.png", -834, -1881, 40, 40); - public static UserObject shop_armor_warrior_2= new UserObject("spritesmith.png", -874, -1881, 40, 40); - public static UserObject shop_armor_warrior_3= new UserObject("spritesmith.png", -914, -1881, 40, 40); - public static UserObject shop_armor_warrior_4= new UserObject("spritesmith.png", -954, -1881, 40, 40); - public static UserObject shop_armor_warrior_5= new UserObject("spritesmith.png", -994, -1881, 40, 40); - public static UserObject shop_armor_wizard_1= new UserObject("spritesmith.png", -1034, -1881, 40, 40); - public static UserObject shop_armor_wizard_2= new UserObject("spritesmith.png", -1074, -1881, 40, 40); - public static UserObject shop_armor_wizard_3= new UserObject("spritesmith.png", -1114, -1881, 40, 40); - public static UserObject shop_armor_wizard_4= new UserObject("spritesmith.png", -1154, -1881, 40, 40); - public static UserObject shop_armor_wizard_5= new UserObject("spritesmith.png", -1194, -1881, 40, 40); - public static UserObject shop_copper= new UserObject("spritesmith.png", -1947, -593, 32, 22); - public static UserObject shop_eyes= new UserObject("spritesmith.png", -1274, -1881, 40, 40); - public static UserObject shop_gold= new UserObject("spritesmith.png", -1947, -1409, 32, 22); - public static UserObject shop_head_base_0= new UserObject("spritesmith.png", -1354, -1881, 40, 40); - public static UserObject shop_head_healer_= new UserObject("spritesmith.png", -1394, -1881, 40, 40); - public static UserObject shop_head_healer_1= new UserObject("spritesmith.png", -1434, -1881, 40, 40); - public static UserObject shop_head_healer_2= new UserObject("spritesmith.png", -1944, -618, 40, 40); - public static UserObject shop_head_healer_3= new UserObject("spritesmith.png", -1944, -669, 40, 40); - public static UserObject shop_head_healer_4= new UserObject("spritesmith.png", -1944, -720, 40, 40); - public static UserObject shop_head_healer_5= new UserObject("spritesmith.png", -1944, -771, 40, 40); - public static UserObject shop_head_rogue_1= new UserObject("spritesmith.png", -1944, -822, 40, 40); - public static UserObject shop_head_rogue_2= new UserObject("spritesmith.png", -1944, -873, 40, 40); - public static UserObject shop_head_rogue_3= new UserObject("spritesmith.png", -1944, -924, 40, 40); - public static UserObject shop_head_rogue_4= new UserObject("spritesmith.png", -1944, -975, 40, 40); - public static UserObject shop_head_rogue_5= new UserObject("spritesmith.png", -1944, -1026, 40, 40); - public static UserObject shop_head_special_0= new UserObject("spritesmith.png", -1944, -1077, 40, 40); - public static UserObject shop_head_special_1= new UserObject("spritesmith.png", -1944, -1128, 40, 40); - public static UserObject shop_head_special_2= new UserObject("spritesmith.png", -1944, -1179, 40, 40); - public static UserObject shop_head_special_candycane= new UserObject("spritesmith.png", -1944, -1230, 40, 40); - public static UserObject shop_head_warrior_1= new UserObject("spritesmith.png", -1944, -1281, 40, 40); - public static UserObject shop_head_warrior_2= new UserObject("spritesmith.png", -1944, -1332, 40, 40); - public static UserObject shop_head_warrior_3= new UserObject("spritesmith.png", -1944, -1434, 40, 40); - public static UserObject shop_head_warrior_4= new UserObject("spritesmith.png", -1944, -1485, 40, 40); - public static UserObject shop_head_warrior_5= new UserObject("spritesmith.png", -1944, -1536, 40, 40); - public static UserObject shop_head_wizard_1= new UserObject("spritesmith.png", -1944, -1587, 40, 40); - public static UserObject shop_head_wizard_2= new UserObject("spritesmith.png", -1944, -1638, 40, 40); - public static UserObject shop_head_wizard_3= new UserObject("spritesmith.png", -1944, -1689, 40, 40); - public static UserObject shop_head_wizard_4= new UserObject("spritesmith.png", -1944, -1740, 40, 40); - public static UserObject shop_head_wizard_5= new UserObject("spritesmith.png", -1944, -1791, 40, 40); - public static UserObject shop_potion= new UserObject("spritesmith.png", -1854, -1710, 40, 40); - public static UserObject shop_reroll= new UserObject("spritesmith.png", -1764, -1620, 40, 40); - public static UserObject shop_shield_base_0= new UserObject("spritesmith.png", -1674, -1530, 40, 40); - public static UserObject shop_shield_healer_1= new UserObject("spritesmith.png", -1584, -1440, 40, 40); - public static UserObject shop_shield_healer_2= new UserObject("spritesmith.png", -1494, -1350, 40, 40); - public static UserObject shop_shield_healer_3= new UserObject("spritesmith.png", -1404, -1260, 40, 40); - public static UserObject shop_shield_healer_4= new UserObject("spritesmith.png", -1314, -1170, 40, 40); - public static UserObject shop_shield_healer_5= new UserObject("spritesmith.png", -1224, -1080, 40, 40); - public static UserObject shop_shield_rogue_0= new UserObject("spritesmith.png", -1134, -990, 40, 40); - public static UserObject shop_shield_rogue_1= new UserObject("spritesmith.png", -1044, -900, 40, 40); - public static UserObject shop_shield_rogue_2= new UserObject("spritesmith.png", -915, -792, 40, 40); - public static UserObject shop_shield_rogue_3= new UserObject("spritesmith.png", -955, -792, 40, 40); - public static UserObject shop_shield_rogue_4= new UserObject("spritesmith.png", -915, -832, 40, 40); - public static UserObject shop_shield_rogue_5= new UserObject("spritesmith.png", -955, -832, 40, 40); - public static UserObject shop_shield_rogue_6= new UserObject("spritesmith.png", -834, -693, 40, 40); - public static UserObject shop_shield_special_0= new UserObject("spritesmith.png", -874, -693, 40, 40); - public static UserObject shop_shield_special_1= new UserObject("spritesmith.png", -834, -733, 40, 40); - public static UserObject shop_shield_warrior_1= new UserObject("spritesmith.png", -874, -733, 40, 40); - public static UserObject shop_shield_warrior_2= new UserObject("spritesmith.png", -753, -594, 40, 40); - public static UserObject shop_shield_warrior_3= new UserObject("spritesmith.png", -793, -594, 40, 40); - public static UserObject shop_shield_warrior_4= new UserObject("spritesmith.png", -753, -634, 40, 40); - public static UserObject shop_shield_warrior_5= new UserObject("spritesmith.png", -793, -634, 40, 40); - public static UserObject shop_silver= new UserObject("spritesmith.png", -1356, -1311, 32, 22); - public static UserObject shop_snowball= new UserObject("spritesmith.png", -1947, -542, 32, 22); - public static UserObject shop_weapon_base_0= new UserObject("spritesmith.png", -672, -535, 40, 40); - public static UserObject shop_weapon_healer_0= new UserObject("spritesmith.png", -1234, -1881, 40, 40); - public static UserObject shop_weapon_healer_1= new UserObject("spritesmith.png", -591, -495, 40, 40); - public static UserObject shop_weapon_healer_2= new UserObject("spritesmith.png", -631, -495, 40, 40); - public static UserObject shop_weapon_healer_3= new UserObject("spritesmith.png", -591, -535, 40, 40); - public static UserObject shop_weapon_healer_4= new UserObject("spritesmith.png", -631, -535, 40, 40); - public static UserObject shop_weapon_healer_5= new UserObject("spritesmith.png", -510, -396, 40, 40); - public static UserObject shop_weapon_healer_6= new UserObject("spritesmith.png", -550, -396, 40, 40); - public static UserObject shop_weapon_rogue_0= new UserObject("spritesmith.png", -510, -436, 40, 40); - public static UserObject shop_weapon_rogue_1= new UserObject("spritesmith.png", -550, -436, 40, 40); - public static UserObject shop_weapon_rogue_2= new UserObject("spritesmith.png", -429, -297, 40, 40); - public static UserObject shop_weapon_rogue_3= new UserObject("spritesmith.png", -469, -297, 40, 40); - public static UserObject shop_weapon_rogue_4= new UserObject("spritesmith.png", -429, -337, 40, 40); - public static UserObject shop_weapon_rogue_5= new UserObject("spritesmith.png", -469, -337, 40, 40); - public static UserObject shop_weapon_rogue_6= new UserObject("spritesmith.png", -345, -219, 40, 40); - public static UserObject shop_weapon_special_0= new UserObject("spritesmith.png", -385, -219, 40, 40); - public static UserObject shop_weapon_special_1= new UserObject("spritesmith.png", -297, -150, 40, 40); - public static UserObject shop_weapon_special_2= new UserObject("spritesmith.png", -297, -190, 40, 40); - public static UserObject shop_weapon_special_3= new UserObject("spritesmith.png", -297, -230, 40, 40); - public static UserObject shop_weapon_warrior_0= new UserObject("spritesmith.png", -936, -882, 40, 40); - public static UserObject shop_weapon_warrior_1= new UserObject("spritesmith.png", -936, -922, 40, 40); - public static UserObject shop_weapon_warrior_2= new UserObject("spritesmith.png", -1545, -1521, 40, 40); - public static UserObject shop_weapon_warrior_3= new UserObject("spritesmith.png", -1585, -1521, 40, 40); - public static UserObject shop_weapon_warrior_4= new UserObject("spritesmith.png", -1545, -1561, 40, 40); - public static UserObject shop_weapon_warrior_5= new UserObject("spritesmith.png", -1585, -1561, 40, 40); - public static UserObject shop_weapon_warrior_6= new UserObject("spritesmith.png", -1818, -1791, 40, 40); - public static UserObject shop_weapon_wizard_0= new UserObject("spritesmith.png", -1818, -1831, 40, 40); - public static UserObject shop_weapon_wizard_1= new UserObject("spritesmith.png", -114, -1881, 40, 40); - public static UserObject shop_weapon_wizard_2= new UserObject("spritesmith.png", -154, -1881, 40, 40); - public static UserObject shop_weapon_wizard_3= new UserObject("spritesmith.png", -194, -1881, 40, 40); - public static UserObject shop_weapon_wizard_4= new UserObject("spritesmith.png", -234, -1881, 40, 40); - public static UserObject shop_weapon_wizard_5= new UserObject("spritesmith.png", -274, -1881, 40, 40); - public static UserObject shop_weapon_wizard_6= new UserObject("spritesmith.png", -314, -1881, 40, 40); - public static UserObject zzz= new UserObject("spritesmith.png", -354, -1881, 40, 40); - public static UserObject zzz_light= new UserObject("spritesmith.png", -394, -1881, 40, 40); - public static UserObject skin_0ff591= new UserObject("spritesmith.png", -1440, -1431, 90, 90); - public static UserObject skin_2b43f6= new UserObject("spritesmith.png", -1350, -1431, 90, 90); - public static UserObject skin_6bd049= new UserObject("spritesmith.png", -1260, -1431, 90, 90); - public static UserObject skin_800ed0= new UserObject("spritesmith.png", -1170, -1431, 90, 90); - public static UserObject skin_915533= new UserObject("spritesmith.png", -1080, -1431, 90, 90); - public static UserObject skin_98461a= new UserObject("spritesmith.png", -990, -1431, 90, 90); - public static UserObject skin_c06534= new UserObject("spritesmith.png", -900, -1431, 90, 90); - public static UserObject skin_c3e1dc= new UserObject("spritesmith.png", -810, -1431, 90, 90); - public static UserObject skin_d7a9f7= new UserObject("spritesmith.png", -720, -1431, 90, 90); - public static UserObject skin_ddc994= new UserObject("spritesmith.png", -630, -1431, 90, 90); - public static UserObject skin_ea8349= new UserObject("spritesmith.png", -540, -1431, 90, 90); - public static UserObject skin_eb052b= new UserObject("spritesmith.png", -450, -1431, 90, 90); - public static UserObject skin_f5a76e= new UserObject("spritesmith.png", -360, -1431, 90, 90); - public static UserObject skin_f5d70f= new UserObject("spritesmith.png", -270, -1431, 90, 90); - public static UserObject skin_f69922= new UserObject("spritesmith.png", -180, -1431, 90, 90); - public static UserObject skin_ghost= new UserObject("spritesmith.png", -90, -1431, 90, 90); - public static UserObject skin_monster= new UserObject("spritesmith.png", 0, -1431, 90, 90); - public static UserObject skin_pumpkin= new UserObject("spritesmith.png", -1446, -1260, 90, 90); - public static UserObject skin_rainbow= new UserObject("spritesmith.png", -1446, -1170, 90, 90); - public static UserObject skin_shadow= new UserObject("spritesmith.png", -1446, -1080, 90, 90); - public static UserObject skin_skeleton= new UserObject("spritesmith.png", -1446, -990, 90, 90); - public static UserObject skin_zombie= new UserObject("spritesmith.png", -1446, -900, 90, 90); - public static UserObject weapon_healer_0= new UserObject("spritesmith.png", -1446, -810, 90, 90); - public static UserObject weapon_healer_1= new UserObject("spritesmith.png", -1446, -720, 90, 90); - public static UserObject weapon_healer_2= new UserObject("spritesmith.png", -1446, -630, 90, 90); - public static UserObject weapon_healer_3= new UserObject("spritesmith.png", -1446, -540, 90, 90); - public static UserObject weapon_healer_4= new UserObject("spritesmith.png", -1446, -450, 90, 90); - public static UserObject weapon_healer_5= new UserObject("spritesmith.png", -1446, -360, 90, 90); - public static UserObject weapon_healer_6= new UserObject("spritesmith.png", -1446, -270, 90, 90); - public static UserObject weapon_rogue_0= new UserObject("spritesmith.png", -1446, -180, 90, 90); - public static UserObject weapon_rogue_1= new UserObject("spritesmith.png", -1446, -90, 90, 90); - public static UserObject weapon_rogue_2= new UserObject("spritesmith.png", -1446, 0, 90, 90); - public static UserObject weapon_rogue_3= new UserObject("spritesmith.png", -1350, -1341, 90, 90); - public static UserObject weapon_rogue_4= new UserObject("spritesmith.png", -1260, -1341, 90, 90); - public static UserObject weapon_rogue_5= new UserObject("spritesmith.png", -645, -1521, 90, 90); - public static UserObject weapon_rogue_6= new UserObject("spritesmith.png", -555, -1521, 90, 90); - public static UserObject weapon_special_1= new UserObject("spritesmith.png", -450, -1521, 105, 90); - public static UserObject weapon_special_2= new UserObject("spritesmith.png", -360, -1521, 90, 90); - public static UserObject weapon_special_3= new UserObject("spritesmith.png", -270, -1521, 90, 90); - public static UserObject weapon_warrior_0= new UserObject("spritesmith.png", -180, -1521, 90, 90); - public static UserObject weapon_warrior_1= new UserObject("spritesmith.png", -90, -1521, 90, 90); - public static UserObject weapon_warrior_2= new UserObject("spritesmith.png", 0, -1521, 90, 90); - public static UserObject weapon_warrior_3= new UserObject("spritesmith.png", -1536, -1350, 90, 90); - public static UserObject weapon_warrior_4= new UserObject("spritesmith.png", -1536, -1260, 90, 90); - public static UserObject weapon_warrior_5= new UserObject("spritesmith.png", -1536, -1170, 90, 90); - public static UserObject weapon_warrior_6= new UserObject("spritesmith.png", -1536, -1080, 90, 90); - public static UserObject weapon_wizard_0= new UserObject("spritesmith.png", -1536, -990, 90, 90); - public static UserObject weapon_wizard_1= new UserObject("spritesmith.png", -1536, -900, 90, 90); - public static UserObject weapon_wizard_2= new UserObject("spritesmith.png", -1536, -810, 90, 90); - public static UserObject weapon_wizard_3= new UserObject("spritesmith.png", -1536, -720, 90, 90); - public static UserObject weapon_wizard_4= new UserObject("spritesmith.png", -1536, -630, 90, 90); - public static UserObject weapon_wizard_5= new UserObject("spritesmith.png", -1536, -540, 90, 90); - public static UserObject weapon_wizard_6= new UserObject("spritesmith.png", -1536, -450, 90, 90); - - - public static UserObject getWeapon(String weapon) { - return getSprite(weapon, null); - } - - public static UserObject getShield(String shield) { - return getSprite(shield,null); - } - public static UserObject getArmor(String armor, String size, String shirtColor) { - if(armor.equals("armor_base_0")) { - armor = "shirt_" + shirtColor; - } - return getSprite(size + "_" + armor,broad_shirt_white); - } - - public static UserObject getHead(String head) { - return getSprite(head, head_0); - } - - public static UserObject getSkin(String skin) { - return getSprite("skin_" + skin, skin_0ff591); - } - public static UserObject gethair_mustache(int mustache, String color) { - return getSprite("hair_mustache_" + mustache + "_" + color, null); - } - public static UserObject gethair_beard(int beard, String color) { - return getSprite("hair_beard_" + beard + "_" + color, null); - } - public static UserObject gethair_bangs(int bangs, String color) { - return getSprite("hair_bangs_" + bangs + "_" + color, null); - } - public static UserObject gethair_base(int base, String color) { - return getSprite("hair_base_" + base + "_" + color, null); - } - - private static UserObject getSprite(String obj, UserObject def) { - Field field = null; - try { - field = UserSprite.class.getField(obj); - return (UserObject) field.get(null); - } catch (NoSuchFieldException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (SecurityException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalArgumentException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return def; - } -} diff --git a/Habitica/src/com/habitrpg/android/habitica/widget/UpdateWidgetService.java b/Habitica/src/com/habitrpg/android/habitica/widget/UpdateWidgetService.java index 468a01d3b..1ba6bbfc1 100644 --- a/Habitica/src/com/habitrpg/android/habitica/widget/UpdateWidgetService.java +++ b/Habitica/src/com/habitrpg/android/habitica/widget/UpdateWidgetService.java @@ -87,7 +87,7 @@ public class UpdateWidgetService extends Service implements HabitRPGUserCallback RemoteViews remoteViews = new RemoteViews(this.getPackageName(),R.layout.simple_widget); remoteViews.setTextViewText(R.id.TV_HP, "" + user.getStats().getHp().intValue() + "/" + (int) user.getStats().getMaxHealth() + " " + this.getString(R.string.HP_default)); remoteViews.setTextViewText(R.id.TV_XP, "" + user.getStats().getExp().intValue() + "/" + (int) user.getStats().getToNextLevel() + " " + this.getString(R.string.XP_default)); - remoteViews.setImageViewBitmap(R.id.IMG_ProfilePicture, dealWithUserPicture(user,this)); + //remoteViews.setImageViewBitmap(R.id.IMG_ProfilePicture, dealWithUserPicture(user,this)); remoteViews.setProgressBar(R.id.V_HPBar,(int)user.getStats().getMaxHealth(), user.getStats().getHp().intValue(), false); remoteViews.setProgressBar(R.id.V_XPBar,(int)user.getStats().getToNextLevel(),user.getStats().getExp().intValue(), false); @@ -129,14 +129,16 @@ public class UpdateWidgetService extends Service implements HabitRPGUserCallback //TODO } + /* private Bitmap dealWithUserPicture(HabitRPGUser look, Context c) { - UserPicture up = new UserPicture(look, this); + UserPicture up = new UserPicture(look); Resources r = getResources(); int w = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, r.getDimension(R.dimen.avatar_width), r.getDisplayMetrics()); int h = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, r.getDimension(R.dimen.avatar_height), r.getDisplayMetrics()); - Bitmap img = up.draw(); + Bitmap img = up.getPicture(); return Bitmap.createScaledBitmap(img, w,h,false); } + */ // // // @Override public void onNewUser(String s, String s2) {} diff --git a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Gear.java b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Gear.java new file mode 100644 index 000000000..8ee9a67a7 --- /dev/null +++ b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Gear.java @@ -0,0 +1,51 @@ +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.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; +import com.raizlabs.android.dbflow.annotation.PrimaryKey; +import com.raizlabs.android.dbflow.annotation.Table; +import com.raizlabs.android.dbflow.structure.BaseModel; + +/** + * Created by viirus on 20/07/15. + */ + +@Table(databaseName = HabitDatabase.NAME) +public class Gear extends BaseModel { + + @Column + @PrimaryKey(autoincrement = true) + long id; + + @Column + @ForeignKey(references = {@ForeignKeyReference(columnName = "equipped_id", + columnType = Long.class, + foreignColumnName = "id")}) + private Outfit equipped; + + @Column + @ForeignKey(references = {@ForeignKeyReference(columnName = "costume_id", + columnType = Long.class, + foreignColumnName = "id")}) + private Outfit costume; + + public Outfit getCostume() { + return costume; + } + + public void setCostume(Outfit costume) { + this.costume = costume; + } + + public Outfit getEquipped() { + return equipped; + } + + public void setEquipped(Outfit equipped) { + this.equipped = equipped; + } + + +} diff --git a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/HabitRPGUser.java b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/HabitRPGUser.java index 474c4db65..adc22c022 100644 --- a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/HabitRPGUser.java +++ b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/HabitRPGUser.java @@ -17,6 +17,9 @@ import com.raizlabs.android.dbflow.runtime.transaction.process.SaveModelTransact import com.raizlabs.android.dbflow.sql.language.Select; import com.raizlabs.android.dbflow.structure.BaseModel; +import org.apache.commons.lang3.ObjectUtils; + +import java.util.ArrayList; import java.util.List; /** @@ -50,8 +53,8 @@ public class HabitRPGUser extends BaseModel { @Column @ForeignKey(references = {@ForeignKeyReference(columnName = "profile_id", - columnType = Long.class, - foreignColumnName = "id")}) + columnType = Long.class, + foreignColumnName = "id")}) private Profile profile; @@ -186,4 +189,52 @@ public class HabitRPGUser extends BaseModel { return tags; } + + public List getAvatarLayerNames() { + List layerNames = new ArrayList(); + + Preferences prefs = this.getPreferences(); + + if (prefs.getSleep()) { + layerNames.add("skin_" + prefs.getSkin() + "_sleep"); + } else { + layerNames.add("skin_" + prefs.getSkin()); + } + layerNames.add(prefs.getSize() + "_shirt_" + prefs.getShirt()); + layerNames.add("head_0"); + + Outfit outfit; + if (prefs.getCostume()) { + outfit = this.getItems().getGear().getCostume(); + } else { + outfit = this.getItems().getGear().getEquipped(); + } + if (outfit != null) { + layerNames.add(outfit.getBack()); + layerNames.add(outfit.getEyeWear()); + layerNames.add(prefs.getSize() + "_armor_" + outfit.getArmor()); + layerNames.add(outfit.getBody()); + } + + Preferences.Hair hair = prefs.getHair(); + if (hair != null) { + layerNames.add("hair_base_"+hair.getBase() + hair.getColor()); + layerNames.add("hair_bangs_"+hair.getBangs() + hair.getColor()); + layerNames.add("hair_mustache_"+hair.getMustache() + hair.getColor()); + layerNames.add("hair_beard_"+hair.getBeard() + hair.getColor()); + } + + if (outfit != null) { + layerNames.add(outfit.getHead()); + layerNames.add(outfit.getHeadAccessory()); + layerNames.add(outfit.getShield()); + layerNames.add(outfit.getWeapon()); + } + + if (prefs.getSleep()) { + layerNames.add("zzz"); + } + + return layerNames; + } } diff --git a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Items.java b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Items.java index dd9950efc..98f134a00 100644 --- a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Items.java +++ b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Items.java @@ -2,6 +2,8 @@ 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.ForeignKey; +import com.raizlabs.android.dbflow.annotation.ForeignKeyReference; import com.raizlabs.android.dbflow.annotation.PrimaryKey; import com.raizlabs.android.dbflow.annotation.Table; import com.raizlabs.android.dbflow.structure.BaseModel; @@ -30,6 +32,11 @@ public class Items extends BaseModel { //private Quest quest; + @Column + @ForeignKey(references = {@ForeignKeyReference(columnName = "gear_id", + columnType = Long.class, + foreignColumnName = "id")}) + private Gear gear; public Items(String currentMount, String currentPet, int lastDrop_count, Date lastDrop_date) { this.currentMount = currentMount; @@ -70,5 +77,13 @@ public class Items extends BaseModel { this.lastDrop_date = lastDrop_date; } + public Gear getGear() { + return gear; + } + + public void setGear(Gear gear) { + this.gear = gear; + } + public Items() {} } diff --git a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Outfit.java b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Outfit.java new file mode 100644 index 000000000..886398a53 --- /dev/null +++ b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Outfit.java @@ -0,0 +1,48 @@ +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.PrimaryKey; +import com.raizlabs.android.dbflow.annotation.Table; +import com.raizlabs.android.dbflow.structure.BaseModel; + +/** + * Created by viirus on 20/07/15. + */ +@Table(databaseName = HabitDatabase.NAME) +public class Outfit extends BaseModel { + + + @Column + @PrimaryKey(autoincrement = true) + long id; + + @Column + String armor, back, body, eyeWear, head, headAccessory, shield, weapon; + + + public String getArmor() {return armor;} + public void setArmor(String armor) {this.armor = armor;} + + public String getBack() {return back;} + public void setBack(String back) {this.back = back;} + + public String getBody() {return body;} + public void setBody(String body) {this.body = body;} + + public String getEyeWear() {return eyeWear;} + public void setEyeWear(String eyeWear) {this.eyeWear = eyeWear;} + + public String getHead() {return head;} + public void setHead(String head) {this.head = head;} + + public String getHeadAccessory() {return headAccessory;} + public void setHeadAccessory(String headAccessory) {this.headAccessory = headAccessory;} + + public String getShield() {return shield;} + public void setShield(String shield) {this.shield = shield;} + + public String getWeapon() {return weapon;} + public void setWeapon(String weapon) {this.weapon = weapon;} + +} diff --git a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Preferences.java b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Preferences.java index d0a1a41ae..b86269778 100644 --- a/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Preferences.java +++ b/Habitica/src/com/magicmicky/habitrpgwrapper/lib/models/Preferences.java @@ -21,7 +21,7 @@ public class Preferences extends BaseModel { private boolean costume, toolbarCollapsed, advancedCollapsed, tagsCollapsed, newTaskEdit, disableClasses, stickyHeader, sleep, hideHeader; @Column - private String allocationMode, shirt, skin, size; + private String allocationMode, shirt, skin, size, background; @Column private int dayStart, timezoneOffset; @@ -47,6 +47,12 @@ public class Preferences extends BaseModel { this.timezoneOffset = timezoneOffset; } + public String getBackground() { + return background; + } + + public void setBackground(String background) {this.background = background;} + public int getDayStart() { return dayStart; }