v1.4.0: adjusted radial menus to block the whole screen
This commit is contained in:
@@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CircleArc;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.watabou.input.ControllerHandler;
|
import com.watabou.input.ControllerHandler;
|
||||||
import com.watabou.noosa.ColorBlock;
|
import com.watabou.noosa.ColorBlock;
|
||||||
|
import com.watabou.noosa.Game;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.noosa.ui.Cursor;
|
import com.watabou.noosa.ui.Cursor;
|
||||||
import com.watabou.utils.PointF;
|
import com.watabou.utils.PointF;
|
||||||
@@ -51,10 +52,10 @@ public class RadialMenu extends Window {
|
|||||||
remove(shadow);
|
remove(shadow);
|
||||||
|
|
||||||
int size = SPDSettings.interfaceSize() == 0 ? 140 : 200;
|
int size = SPDSettings.interfaceSize() == 0 ? 140 : 200;
|
||||||
resize(size, size);
|
resize(Game.width, Game.height);
|
||||||
|
|
||||||
slots = optionTexts.length;
|
slots = optionTexts.length;
|
||||||
center = new PointF(size/2, size/2);
|
center = new PointF(width/2, height/2);
|
||||||
int length = SPDSettings.interfaceSize() == 0 ? 57 : 80;
|
int length = SPDSettings.interfaceSize() == 0 ? 57 : 80;
|
||||||
|
|
||||||
selectionArc = new CircleArc(120/slots, size/2 - 1);
|
selectionArc = new CircleArc(120/slots, size/2 - 1);
|
||||||
@@ -66,6 +67,9 @@ public class RadialMenu extends Window {
|
|||||||
add(selectionArc);
|
add(selectionArc);
|
||||||
|
|
||||||
Image outerBG = getBGTexture(size, false);
|
Image outerBG = getBGTexture(size, false);
|
||||||
|
outerBG.x = (width - outerBG.width) / 2;
|
||||||
|
outerBG.y = (height - outerBG.height) / 2;
|
||||||
|
PixelScene.align(outerBG);
|
||||||
add(outerBG);
|
add(outerBG);
|
||||||
|
|
||||||
texts = optionTexts;
|
texts = optionTexts;
|
||||||
@@ -92,6 +96,7 @@ public class RadialMenu extends Window {
|
|||||||
Image innerBG = getBGTexture(size, true);
|
Image innerBG = getBGTexture(size, true);
|
||||||
innerBG.x = (width - innerBG.width) / 2;
|
innerBG.x = (width - innerBG.width) / 2;
|
||||||
innerBG.y = (height - innerBG.height) / 2;
|
innerBG.y = (height - innerBG.height) / 2;
|
||||||
|
PixelScene.align(innerBG);
|
||||||
add(innerBG);
|
add(innerBG);
|
||||||
|
|
||||||
descTxt = PixelScene.renderTextBlock(desc, 6);
|
descTxt = PixelScene.renderTextBlock(desc, 6);
|
||||||
@@ -136,7 +141,7 @@ public class RadialMenu extends Window {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
selector.setRect(0, 0, size, size);
|
selector.setRect(0, 0, width, height);
|
||||||
add(selector);
|
add(selector);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ public class Toolbar extends Component {
|
|||||||
info += KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(GameAction.BACK, false)) + ": " + Messages.get(Toolbar.class, "quickslot_cancel");
|
info += KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(GameAction.BACK, false)) + ": " + Messages.get(Toolbar.class, "quickslot_cancel");
|
||||||
}
|
}
|
||||||
|
|
||||||
GameScene.show(new RadialMenu(Messages.get(Toolbar.class, "quickslot_prompt"), info, slotNames, slotIcons) {
|
Game.scene().addToFront(new RadialMenu(Messages.get(Toolbar.class, "quickslot_prompt"), info, slotNames, slotIcons) {
|
||||||
@Override
|
@Override
|
||||||
public void onSelect(int idx, boolean alt) {
|
public void onSelect(int idx, boolean alt) {
|
||||||
Item item = Dungeon.quickslot.getItem(idx);
|
Item item = Dungeon.quickslot.getItem(idx);
|
||||||
@@ -390,7 +390,7 @@ public class Toolbar extends Component {
|
|||||||
info += KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(GameAction.BACK, false)) + ": " + Messages.get(Toolbar.class, "container_cancel");
|
info += KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(GameAction.BACK, false)) + ": " + Messages.get(Toolbar.class, "container_cancel");
|
||||||
}
|
}
|
||||||
|
|
||||||
GameScene.show(new RadialMenu(Messages.get(Toolbar.class, "container_prompt"), info, names, images){
|
Game.scene().addToFront(new RadialMenu(Messages.get(Toolbar.class, "container_prompt"), info, names, images){
|
||||||
@Override
|
@Override
|
||||||
public void onSelect(int idx, boolean alt) {
|
public void onSelect(int idx, boolean alt) {
|
||||||
super.onSelect(idx, alt);
|
super.onSelect(idx, alt);
|
||||||
@@ -427,14 +427,14 @@ public class Toolbar extends Component {
|
|||||||
if (ControllerHandler.controllerActive){
|
if (ControllerHandler.controllerActive){
|
||||||
info += KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(GameAction.LEFT_CLICK, true)) + ": " + Messages.get(Toolbar.class, "item_select") + "\n";
|
info += KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(GameAction.LEFT_CLICK, true)) + ": " + Messages.get(Toolbar.class, "item_select") + "\n";
|
||||||
info += KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(GameAction.RIGHT_CLICK, true)) + ": " + Messages.get(Toolbar.class, "item_use") + "\n";
|
info += KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(GameAction.RIGHT_CLICK, true)) + ": " + Messages.get(Toolbar.class, "item_use") + "\n";
|
||||||
info += KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(GameAction.BACK, false)) + ": " + Messages.get(Toolbar.class, "item_cancel");
|
info += KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(GameAction.BACK, true)) + ": " + Messages.get(Toolbar.class, "item_cancel");
|
||||||
} else {
|
} else {
|
||||||
info += Messages.get(WndKeyBindings.class, SPDAction.LEFT_CLICK.name()) + ": " + Messages.get(Toolbar.class, "item_select") + "\n";
|
info += Messages.get(WndKeyBindings.class, SPDAction.LEFT_CLICK.name()) + ": " + Messages.get(Toolbar.class, "item_select") + "\n";
|
||||||
info += Messages.get(WndKeyBindings.class, SPDAction.RIGHT_CLICK.name()) + ": " + Messages.get(Toolbar.class, "item_use") + "\n";
|
info += Messages.get(WndKeyBindings.class, SPDAction.RIGHT_CLICK.name()) + ": " + Messages.get(Toolbar.class, "item_use") + "\n";
|
||||||
info += KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(GameAction.BACK, false)) + ": " + Messages.get(Toolbar.class, "item_cancel");
|
info += KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(GameAction.BACK, false)) + ": " + Messages.get(Toolbar.class, "item_cancel");
|
||||||
}
|
}
|
||||||
|
|
||||||
GameScene.show(new RadialMenu(Messages.get(Toolbar.class, "item_prompt"), info, itemNames, itemIcons){
|
Game.scene().addToFront(new RadialMenu(Messages.get(Toolbar.class, "item_prompt"), info, itemNames, itemIcons){
|
||||||
@Override
|
@Override
|
||||||
public void onSelect(int idx, boolean alt) {
|
public void onSelect(int idx, boolean alt) {
|
||||||
super.onSelect(idx, alt);
|
super.onSelect(idx, alt);
|
||||||
|
|||||||
Reference in New Issue
Block a user