v1.2.0: fixed windows from quickslots not appearing over inventory pane
This commit is contained in:
@@ -753,7 +753,7 @@ public class GameScene extends PixelScene {
|
|||||||
toDestroy.clear();
|
toDestroy.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Point lastOffset = null;
|
private static Point lastOffset = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized Gizmo erase (Gizmo g) {
|
public synchronized Gizmo erase (Gizmo g) {
|
||||||
@@ -1137,6 +1137,13 @@ public class GameScene extends PixelScene {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void centerNextWndOnInvPane(){
|
||||||
|
if (scene != null && scene.inventory != null && scene.inventory.visible){
|
||||||
|
lastOffset = new Point((int)scene.inventory.centerX() - uiCamera.width/2,
|
||||||
|
(int)scene.inventory.centerY() - uiCamera.height/2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void updateFog(){
|
public static void updateFog(){
|
||||||
if (scene != null) {
|
if (scene != null) {
|
||||||
scene.fog.updateFog();
|
scene.fog.updateFog();
|
||||||
|
|||||||
@@ -126,8 +126,7 @@ public class InventoryPane extends Component {
|
|||||||
protected void onClick(PointerEvent event) {
|
protected void onClick(PointerEvent event) {
|
||||||
if (selector != null && !bg.overlapsScreenPoint((int)event.current.x, (int)event.current.y)){
|
if (selector != null && !bg.overlapsScreenPoint((int)event.current.x, (int)event.current.y)){
|
||||||
//any windows opened as a consequence of this should be centered on the inventory
|
//any windows opened as a consequence of this should be centered on the inventory
|
||||||
GameScene.lastOffset = new Point((int)InventoryPane.this.centerX() - camera.width/2,
|
GameScene.centerNextWndOnInvPane();
|
||||||
(int)InventoryPane.this.centerY() - camera.height/2);
|
|
||||||
selector.onSelect(null);
|
selector.onSelect(null);
|
||||||
selector = null;
|
selector = null;
|
||||||
updateInventory();
|
updateInventory();
|
||||||
@@ -475,8 +474,7 @@ public class InventoryPane extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//any windows opened as a consequence of this button should be centered on the inventory
|
//any windows opened as a consequence of this button should be centered on the inventory
|
||||||
GameScene.lastOffset = new Point((int)InventoryPane.this.centerX() - camera.width/2,
|
GameScene.centerNextWndOnInvPane();
|
||||||
(int)InventoryPane.this.centerY() - camera.height/2);
|
|
||||||
if (selector != null) {
|
if (selector != null) {
|
||||||
WndBag.ItemSelector activating = selector;
|
WndBag.ItemSelector activating = selector;
|
||||||
selector = null;
|
selector = null;
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ public class QuickSlotButton extends Button {
|
|||||||
} else {
|
} else {
|
||||||
Item item = select(slotNum);
|
Item item = select(slotNum);
|
||||||
if (Dungeon.hero.belongings.contains(item)) {
|
if (Dungeon.hero.belongings.contains(item)) {
|
||||||
|
GameScene.centerNextWndOnInvPane();
|
||||||
item.execute(Dungeon.hero);
|
item.execute(Dungeon.hero);
|
||||||
if (item.usesTargeting) {
|
if (item.usesTargeting) {
|
||||||
useTargeting();
|
useTargeting();
|
||||||
|
|||||||
Reference in New Issue
Block a user