v2.3.0: fixed items being assignable to non-visible quickslots
This commit is contained in:
@@ -258,8 +258,10 @@ public class QuickSlotButton extends Button {
|
||||
}
|
||||
};
|
||||
|
||||
public static int lastVisible = instance.length;
|
||||
|
||||
public static void set(Item item){
|
||||
for (int i = 0; i < instance.length; i++) {
|
||||
for (int i = 0; i < lastVisible; i++) {
|
||||
if (select(i) == null || select(i) == item) {
|
||||
set(i, item);
|
||||
return;
|
||||
|
||||
@@ -498,10 +498,12 @@ public class Toolbar extends Component {
|
||||
startingSlot = swappedQuickslots ? 3 : 0;
|
||||
btnSwap.visible = true;
|
||||
btnSwap.active = lastEnabled;
|
||||
QuickSlotButton.lastVisible = 6;
|
||||
} else {
|
||||
startingSlot = 0;
|
||||
btnSwap.visible = btnSwap.active = false;
|
||||
btnSwap.setPos(0, PixelScene.uiCamera.height);
|
||||
QuickSlotButton.lastVisible = quickslotsToShow;
|
||||
}
|
||||
int endingSlot = startingSlot+quickslotsToShow-1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user