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

Blood: Deselect actively edited menu items on menu change #745

Merged
merged 1 commit into from
Aug 14, 2023
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
8 changes: 6 additions & 2 deletions source/blood/src/gamemenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ CGameMenuMgr gGameMenuMgr;

extern CGameMenuItemPicCycle itemSorryPicCycle;
extern CGameMenuItemQAV itemBloodQAV;
static CGameMenuItemZEdit *pGameMenuItemZEdit = NULL;

CMenuTextMgr::CMenuTextMgr()
{
Expand Down Expand Up @@ -122,6 +123,8 @@ bool CGameMenuMgr::Push(CGameMenu *pMenu, int nItem)
InitializeMenu();
m_menuchange_watchpoint = 1;
m_mousecaught = 1;
if (pGameMenuItemZEdit) // deselect last actively edited item
pGameMenuItemZEdit->at30 = 0, pGameMenuItemZEdit = NULL;
return true;
}

Expand All @@ -137,6 +140,8 @@ void CGameMenuMgr::Pop(void)
pActiveMenu = pMenuStack[nMenuPointer-1];

m_menuchange_watchpoint = 1;
if (pGameMenuItemZEdit) // deselect last actively edited item
pGameMenuItemZEdit->at30 = 0, pGameMenuItemZEdit = NULL;
}
m_mousecaught = 1;
}
Expand Down Expand Up @@ -1906,7 +1911,6 @@ void CGameMenuItemZEdit::Draw(void)
bool CGameMenuItemZEdit::Event(CGameMenuEvent &event)
{
static char buffer[256];
static CGameMenuItemZEdit *pGameMenuItemZEdit = NULL;
// Hack
if (event.at2 == sc_kpad_2 || event.at2 == sc_kpad_4 || event.at2 == sc_kpad_6 || event.at2 == sc_kpad_8)
event.at0 = kMenuEventKey;
Expand Down Expand Up @@ -1936,7 +1940,7 @@ bool CGameMenuItemZEdit::Event(CGameMenuEvent &event)
at30 = 0;
return false;
}
else // unselect previously edited item
else // deselect last actively edited item
{
if (!pGameMenuItemZEdit)
pGameMenuItemZEdit = this;
Expand Down