Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unique items InfoBox in stash in 800x600 and lower resolutions #6983

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1784,10 +1784,31 @@ void PrintItemOil(char iDidx)
}
}

void DrawUniqueInfoWindow(const Surface &out)
{
ClxDraw(out, GetPanelPosition(UiPanels::Inventory, { 24 - SidePanelSize.width, 327 }), (*pSTextBoxCels)[0]);
DrawHalfTransparentRectTo(out, GetRightPanel().position.x - SidePanelSize.width + 27, GetRightPanel().position.y + 28, 265, 297);
Point DrawUniqueInfoWindow(const Surface &out)
{
const bool isInStash = IsStashOpen && GetLeftPanel().contains(MousePosition);
int panelX, panelY;
if (isInStash) {
ClxDraw(out, GetPanelPosition(UiPanels::Stash, { 24 + SidePanelSize.width, 327 }), (*pSTextBoxCels)[0]);
panelX = GetLeftPanel().position.x + SidePanelSize.width + 27;
panelY = GetLeftPanel().position.y + 28;
} else {
ClxDraw(out, GetPanelPosition(UiPanels::Inventory, { 24 - SidePanelSize.width, 327 }), (*pSTextBoxCels)[0]);
panelX = GetRightPanel().position.x - SidePanelSize.width + 27;
panelY = GetRightPanel().position.y + 28;
}

const Point rightInfoPos = GetRightPanel().position - Displacement { SidePanelSize.width, 0 };
const Point leftInfoPos = GetLeftPanel().position + Displacement { SidePanelSize.width, 0 };

const bool isInfoOverlapping = IsLeftPanelOpen() && IsRightPanelOpen() && GetLeftPanel().contains(rightInfoPos);
int fadeLevel = isInfoOverlapping ? 3 : 1;

for (int i = 0; i < fadeLevel; ++i) {
DrawHalfTransparentRectTo(out, panelX, panelY, 265, 297);
}

return isInStash ? leftInfoPos : rightInfoPos;
}

void printItemMiscKBM(const Item &item, const bool isOil, const bool isCastOnTarget)
Expand Down Expand Up @@ -3878,12 +3899,7 @@ bool DoOil(Player &player, int cii)

void DrawUniqueInfo(const Surface &out)
{
const Point position = GetRightPanel().position - Displacement { SidePanelSize.width, 0 };
if (IsLeftPanelOpen() && GetLeftPanel().contains(position)) {
return;
}

DrawUniqueInfoWindow(out);
const Point position = DrawUniqueInfoWindow(out);

Rectangle rect { position + Displacement { 32, 56 }, { 257, 0 } };
const UniqueItem &uitem = UniqueItems[curruitem._iUid];
Expand Down
Loading