v0.3.1b: fixed a bug with centered toolbar and less than 4 quickslots
This commit is contained in:
@@ -207,8 +207,11 @@ public class Toolbar extends Component {
|
|||||||
|
|
||||||
//center = group but.. well.. centered, so all we need to do is pre-emptively set the right side further in.
|
//center = group but.. well.. centered, so all we need to do is pre-emptively set the right side further in.
|
||||||
case CENTER:
|
case CENTER:
|
||||||
right = width - (width - btnWait.width() - btnSearch.width() - btnInventory.width() -
|
float toolbarWidth = btnWait.width() + btnSearch.width() + btnInventory.width();
|
||||||
btnQuick[0].width() - btnQuick[1].width() - btnQuick[2].width() - btnQuick[3].width())/2;
|
for(Button slot : btnQuick){
|
||||||
|
if (slot.visible) toolbarWidth += slot.width();
|
||||||
|
}
|
||||||
|
right = (width + toolbarWidth)/2;
|
||||||
|
|
||||||
case GROUP:
|
case GROUP:
|
||||||
btnWait.setPos(right - btnWait.width(), y);
|
btnWait.setPos(right - btnWait.width(), y);
|
||||||
|
|||||||
Reference in New Issue
Block a user