Revision bfb59352
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java | ||
---|---|---|
248 | 248 |
return view.getRenderer(); |
249 | 249 |
} |
250 | 250 |
|
251 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
252 |
|
|
253 |
public boolean objectDoesntExist(String name) |
|
254 |
{ |
|
255 |
return mScreen.objectDoesntExist(name); |
|
256 |
} |
|
257 |
|
|
251 | 258 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
252 | 259 |
|
253 | 260 |
public void addObject(String name) |
254 | 261 |
{ |
255 |
if( mScreen.objectDoesntExist(name) ) |
|
256 |
{ |
|
257 |
mScreen.addObject(this,name); |
|
258 |
} |
|
262 |
mScreen.addObject(this,name); |
|
259 | 263 |
} |
260 | 264 |
|
261 | 265 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
270 | 274 |
|
271 | 275 |
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); |
272 | 276 |
SharedPreferences.Editor editor = preferences.edit(); |
273 |
String objName = name+" ";
|
|
277 |
String objName = name+"_";
|
|
274 | 278 |
for(int i=0; i<numCubits; i++) editor.remove(objName+i); |
275 | 279 |
editor.apply(); |
276 | 280 |
} |
src/main/java/org/distorted/bandaged/BandagedCreatorRenderer.java | ||
---|---|---|
382 | 382 |
|
383 | 383 |
TwistyBandagedGeneric.setPositions(pos); |
384 | 384 |
TwistyObject obj = new TwistyBandagedGeneric( new Static4D(0,0,0,1), 1.0f, TwistyObject.MODE_NORM); |
385 |
String name = obj.getShortName(); |
|
385 | 386 |
BandagedCreatorActivity act = (BandagedCreatorActivity) mView.getContext(); |
386 | 387 |
|
387 |
boolean success = createObjectJson(obj,act); |
|
388 |
setupIconCreation(act); |
|
389 |
|
|
390 |
if( success ) |
|
388 |
if( act.objectDoesntExist(name) && createObjectJson(obj,act) ) |
|
391 | 389 |
{ |
390 |
setupIconCreation(act); |
|
392 | 391 |
act.addObject(obj.getShortName()); |
393 | 392 |
} |
394 | 393 |
} |
Also available in: Unified diff
Bugfix