parent
2a9e00d730
commit
21bc12e906
|
@ -2995,7 +2995,7 @@ void inventoryWindowOpenContextMenu(int keyCode, int inventoryWindowType)
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
mouseGetPositionInWindow(gInventoryWindow, &x, &y);
|
mouseGetPosition(&x, &y);
|
||||||
|
|
||||||
int actionMenuItemsLength;
|
int actionMenuItemsLength;
|
||||||
const int* actionMenuItems;
|
const int* actionMenuItems;
|
||||||
|
@ -3043,9 +3043,18 @@ void inventoryWindowOpenContextMenu(int keyCode, int inventoryWindowType)
|
||||||
}
|
}
|
||||||
|
|
||||||
const InventoryWindowDescription* windowDescription = &(gInventoryWindowDescriptions[inventoryWindowType]);
|
const InventoryWindowDescription* windowDescription = &(gInventoryWindowDescriptions[inventoryWindowType]);
|
||||||
|
|
||||||
|
// Maintain original position in original resolution, otherwise center it.
|
||||||
|
int inventoryWindowX = screenGetWidth() != 640
|
||||||
|
? (screenGetWidth() - windowDescription->width) / 2
|
||||||
|
: windowDescription->x;
|
||||||
|
int inventoryWindowY = screenGetHeight() != 480
|
||||||
|
? (screenGetHeight() - windowDescription->height) / 2
|
||||||
|
: windowDescription->y;
|
||||||
|
|
||||||
gameMouseRenderActionMenuItems(x, y, actionMenuItems, actionMenuItemsLength,
|
gameMouseRenderActionMenuItems(x, y, actionMenuItems, actionMenuItemsLength,
|
||||||
windowDescription->width + windowDescription->x,
|
windowDescription->width + inventoryWindowX,
|
||||||
windowDescription->height + windowDescription->y);
|
windowDescription->height + inventoryWindowY);
|
||||||
|
|
||||||
InventoryCursorData* cursorData = &(gInventoryCursorData[INVENTORY_WINDOW_CURSOR_MENU]);
|
InventoryCursorData* cursorData = &(gInventoryCursorData[INVENTORY_WINDOW_CURSOR_MENU]);
|
||||||
|
|
||||||
|
@ -3054,8 +3063,8 @@ void inventoryWindowOpenContextMenu(int keyCode, int inventoryWindowType)
|
||||||
artGetRotationOffsets(cursorData->frm, 0, &offsetX, &offsetY);
|
artGetRotationOffsets(cursorData->frm, 0, &offsetX, &offsetY);
|
||||||
|
|
||||||
Rect rect;
|
Rect rect;
|
||||||
rect.left = x - windowDescription->x - cursorData->width / 2 + offsetX;
|
rect.left = x - inventoryWindowX - cursorData->width / 2 + offsetX;
|
||||||
rect.top = y - windowDescription->y - cursorData->height + 1 + offsetY;
|
rect.top = y - inventoryWindowY - cursorData->height + 1 + offsetY;
|
||||||
rect.right = rect.left + cursorData->width - 1;
|
rect.right = rect.left + cursorData->width - 1;
|
||||||
rect.bottom = rect.top + cursorData->height - 1;
|
rect.bottom = rect.top + cursorData->height - 1;
|
||||||
|
|
||||||
|
@ -3090,7 +3099,7 @@ void inventoryWindowOpenContextMenu(int keyCode, int inventoryWindowType)
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
mouseGetPositionInWindow(gInventoryWindow, &x, &y);
|
mouseGetPosition(&x, &y);
|
||||||
if (y - previousMouseY > 10 || previousMouseY - y > 10) {
|
if (y - previousMouseY > 10 || previousMouseY - y > 10) {
|
||||||
if (y >= previousMouseY || menuItemIndex <= 0) {
|
if (y >= previousMouseY || menuItemIndex <= 0) {
|
||||||
if (previousMouseY < y && menuItemIndex < actionMenuItemsLength - 1) {
|
if (previousMouseY < y && menuItemIndex < actionMenuItemsLength - 1) {
|
||||||
|
|
Loading…
Reference in New Issue