v0.6.1: adjusted the layouts for quickslots and item slots
This commit is contained in:
parent
7126fb45d3
commit
d24f52f361
|
@ -122,6 +122,12 @@ public class ItemSlot extends Button {
|
||||||
PixelScene.align(icon);
|
PixelScene.align(icon);
|
||||||
|
|
||||||
if (topLeft != null) {
|
if (topLeft != null) {
|
||||||
|
topLeft.measure();
|
||||||
|
if (topLeft.width > width){
|
||||||
|
topLeft.scale.set(PixelScene.align(0.8f));
|
||||||
|
} else {
|
||||||
|
topLeft.scale.set(1f);
|
||||||
|
}
|
||||||
topLeft.x = x;
|
topLeft.x = x;
|
||||||
topLeft.y = y;
|
topLeft.y = y;
|
||||||
PixelScene.align(topLeft);
|
PixelScene.align(topLeft);
|
||||||
|
|
|
@ -23,13 +23,13 @@ package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndCatalogs;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndCatalogs;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
|
@ -162,8 +162,8 @@ public class Toolbar extends Component {
|
||||||
for(int i = 0; i <= 3; i++) {
|
for(int i = 0; i <= 3; i++) {
|
||||||
btnQuick[i].visible = btnQuick[i].active = slots > i;
|
btnQuick[i].visible = btnQuick[i].active = slots > i;
|
||||||
//decides on quickslot layout, depending on available screen size.
|
//decides on quickslot layout, depending on available screen size.
|
||||||
if (slots == 4 && width < 150){
|
if (slots == 4 && width < 152){
|
||||||
if (width < 139){
|
if (width < 138){
|
||||||
if ((ShatteredPixelDungeon.flipToolbar() && i == 3) ||
|
if ((ShatteredPixelDungeon.flipToolbar() && i == 3) ||
|
||||||
(!ShatteredPixelDungeon.flipToolbar() && i == 0)) {
|
(!ShatteredPixelDungeon.flipToolbar() && i == 0)) {
|
||||||
btnQuick[i].border(0, 0);
|
btnQuick[i].border(0, 0);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user