v0.2.3e: refactored quick slot button, should now support multiple instances of itself tied to different quickslots, needs testing
This commit is contained in:
@@ -3,6 +3,7 @@ package com.shatteredpixel.shatteredpixeldungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.watabou.utils.Bundlable;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -77,6 +78,16 @@ public class QuickSlot {
|
||||
setSlot( i , placeholder );
|
||||
}
|
||||
|
||||
public Item randomNonePlaceholder(){
|
||||
|
||||
ArrayList<Item> result = new ArrayList<Item>();
|
||||
for (int i = 0; i < slots.size(); i ++)
|
||||
if (slots.get(i) != null && !isPlaceholder(i))
|
||||
result.add(slots.get(i));
|
||||
|
||||
return Random.element(result);
|
||||
}
|
||||
|
||||
private final String PLACEHOLDERS = "placeholders";
|
||||
private final String PLACEMENTS = "placements";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user