diff --git a/core/src/main/assets/interfaces/toolbar.png b/core/src/main/assets/interfaces/toolbar.png index 683e37733..0f5d79e92 100644 Binary files a/core/src/main/assets/interfaces/toolbar.png and b/core/src/main/assets/interfaces/toolbar.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java index bb2c890f8..2af3340e9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java @@ -228,6 +228,7 @@ public class Toolbar extends Component { return true; } }); + btnWait.icon( 176, 0, 16, 16 ); //hidden button for rest keybind add(new Button(){ @@ -314,6 +315,7 @@ public class Toolbar extends Component { return true; } }); + btnSearch.icon( 192, 0, 16, 16 ); add(btnInventory = new Tool(0, 0, 24, 26) { private CurrencyIndicator ind; @@ -376,7 +378,16 @@ public class Toolbar extends Component { arrow.y = bottom()-arrow.height-1; arrow.angle = bottom() == camera().height ? 0 : 180; } + + @Override + public void enable(boolean value) { + if (value != active){ + arrow.alpha( value ? 1f : 0.4f ); + } + super.enable(value); + } }); + btnInventory.icon( 160, 0, 16, 16 ); //hidden button for inventory selector keybind add(new Button(){ @@ -681,6 +692,7 @@ public class Toolbar extends Component { private static final int BGCOLOR = 0x7B8073; private Image base; + private Image icon; public Tool( int x, int y, int width, int height ) { super(); @@ -695,6 +707,13 @@ public class Toolbar extends Component { this.width = width; this.height = height; } + + public void icon( int x, int y, int width, int height){ + if (icon == null) icon = new Image( Assets.Interfaces.TOOLBAR ); + add(icon); + + icon.frame( x, y, width, height); + } @Override protected void createChildren() { @@ -710,10 +729,16 @@ public class Toolbar extends Component { base.x = x; base.y = y; + + if (icon != null){ + icon.x = x + (width()- icon.width())/2f; + icon.y = y + (height()- icon.height())/2f; + } } public void alpha( float value ){ base.alpha(value); + if (icon != null) icon.alpha(value); } @Override @@ -732,11 +757,7 @@ public class Toolbar extends Component { public void enable( boolean value ) { if (value != active) { - if (value) { - base.resetColor(); - } else { - base.tint( BGCOLOR, 0.7f ); - } + if (icon != null) icon.alpha( value ? 1f : 0.4f); active = value; } }