Project

General

Profile

« Previous | Next » 

Revision ade99032

Added by Leszek Koltunski 2 months ago

Objects can support or not changing colors of their stickers.

View differences:

src/main/java/org/distorted/objectlib/json/JsonReader.java
62 62
  private int mMovementType, mMovementSplit;
63 63
  private int[][][] mEnabled;
64 64
  private float[] mDist3D;
65
  private int mNumCubitFaces, mNumFaces, mNumFaceColors;
65
  private int mNumCubitFaces, mNumFaces;
66 66
  private float[][] mPositions;
67 67
  private ObjectShape[] mShapes;
68 68
  private ObjectFaceShape[] mFaceShapes;
......
93 93
  private ObjectStickerOverride[] mStickerOverrides;
94 94
  private float mPillowCoeff;
95 95
  private int[][] mMinimalCubitsInRow;
96
  private boolean mSupportsAdjustableColors;
96 97

  
97 98
///////////////////////////////////////////////////////////////////////////////////////////////////
98 99

  
......
184 185

  
185 186
    if( free ) mPrice = 0;
186 187
    else mPrice = metadata.optInt("price", ListObjects.DEFAULT_PRICE_OF_OLD_OBJECTS );
188

  
189
    mSupportsAdjustableColors = metadata.optBoolean("adj_colors", true);
187 190
    }
188 191

  
189 192
///////////////////////////////////////////////////////////////////////////////////////////////////
......
846 849

  
847 850
  private void parseColors(JSONArray object) throws JSONException
848 851
    {
849
    mNumFaceColors = object.length()-1;
850

  
851
    mColorTable = new int[mNumFaceColors];
852
    for(int i=0; i<mNumFaceColors; i++) mColorTable[i] = object.getInt(i);
853

  
854
    mInternalColor = object.getInt(mNumFaceColors);
852
    int num = object.length()-1;
853
    mColorTable = new int[num];
854
    for(int i=0; i<num; i++) mColorTable[i] = object.getInt(i);
855
    mInternalColor = object.getInt(num);
855 856
    }
856 857

  
857 858
///////////////////////////////////////////////////////////////////////////////////////////////////
......
1211 1212
    return mPrice;
1212 1213
    }
1213 1214

  
1215
///////////////////////////////////////////////////////////////////////////////////////////////////
1216

  
1217
  public boolean getAdjustableColors()
1218
    {
1219
    return mSupportsAdjustableColors;
1220
    }
1221

  
1214 1222
///////////////////////////////////////////////////////////////////////////////////////////////////
1215 1223

  
1216 1224
  public ObjectSticker retSticker(int sticker)

Also available in: Unified diff