Skip to content

Commit

Permalink
Revert "Revert "Fix ItemMover to work for any resolution.""
Browse files Browse the repository at this point in the history
This reverts commit e4ab900.
  • Loading branch information
planqi committed Jan 12, 2018
1 parent e4ab900 commit fceedca
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions BH/Modules/ItemMover/ItemMover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,31 @@ void ItemMover::Init() {
lodStashLayout = InventoryLayoutMap["Big Bank Page 1"];
inventoryLayout = InventoryLayoutMap["Amazon"]; // all character types have the same layout
cubeLayout = InventoryLayoutMap["Transmogrify Box Page 1"];

INVENTORY_LEFT = ((inventoryLayout->Left - 320) + (*p_D2CLIENT_ScreenSizeX / 2));
INVENTORY_TOP = ((*p_D2CLIENT_ScreenSizeY / 2) - 240) + inventoryLayout->Top;
STASH_LEFT = ((*p_D2CLIENT_ScreenSizeX / 2) - 320) + lodStashLayout->Left;
LOD_STASH_TOP = ((*p_D2CLIENT_ScreenSizeY / 2) - 240) + lodStashLayout->Top;
CLASSIC_STASH_TOP = ((*p_D2CLIENT_ScreenSizeY / 2) - 240) + classicStashLayout->Top;
CUBE_LEFT = ((*p_D2CLIENT_ScreenSizeX / 2) - 320) + cubeLayout->Left;
CUBE_TOP = ((*p_D2CLIENT_ScreenSizeY / 2) - 240) + cubeLayout->Top;
} else {
// Currently we don't support non-standard screen sizes; default to 800x600
classicStashLayout = InventoryLayoutMap["Bank Page2"];
lodStashLayout = InventoryLayoutMap["Big Bank Page2"];
inventoryLayout = InventoryLayoutMap["Amazon2"]; // all character types have the same layout
cubeLayout = InventoryLayoutMap["Transmogrify Box2"];

INVENTORY_LEFT = inventoryLayout->Left;
INVENTORY_TOP = inventoryLayout->Top;
STASH_LEFT = lodStashLayout->Left;
LOD_STASH_TOP = lodStashLayout->Top;
CLASSIC_STASH_TOP = classicStashLayout->Top;
CUBE_LEFT = cubeLayout->Left;
CUBE_TOP = cubeLayout->Top;
}

CELL_SIZE = inventoryLayout->SlotPixelHeight;

INVENTORY_WIDTH = inventoryLayout->SlotWidth;
INVENTORY_HEIGHT = inventoryLayout->SlotHeight;
STASH_WIDTH = lodStashLayout->SlotWidth;
Expand All @@ -71,15 +88,6 @@ void ItemMover::Init() {
CUBE_WIDTH = cubeLayout->SlotWidth;
CUBE_HEIGHT = cubeLayout->SlotHeight;

INVENTORY_LEFT = inventoryLayout->Left;
INVENTORY_TOP = inventoryLayout->Top;
STASH_LEFT = lodStashLayout->Left;
LOD_STASH_TOP = lodStashLayout->Top;
CLASSIC_STASH_TOP = classicStashLayout->Top;
CUBE_LEFT = cubeLayout->Left;
CUBE_TOP = cubeLayout->Top;
CELL_SIZE = inventoryLayout->SlotPixelHeight;

if (!InventoryItemIds) {
InventoryItemIds = new int[INVENTORY_WIDTH * INVENTORY_HEIGHT];
}
Expand Down

0 comments on commit fceedca

Please sign in to comment.