message_window: only accept mouse click if option is selected

This commit is contained in:
Hyper 2024-12-04 01:18:35 +00:00
parent 82fdf2ed1b
commit 56153cb60a

View file

@ -241,6 +241,8 @@ void MessageWindow::Draw()
auto clipRectMin = drawList->GetClipRectMin();
auto clipRectMax = drawList->GetClipRectMax();
g_selectedRowIndex = -1;
for (int i = 0; i < rowCount; i++)
{
ImVec2 itemMin = { clipRectMin.x + windowMarginX, clipRectMin.y + windowMarginY + itemHeight * i };
@ -251,7 +253,7 @@ void MessageWindow::Draw()
}
}
if (isAccepted)
if (g_selectedRowIndex != -1 && isAccepted)
{
g_result = g_selectedRowIndex;