[client] imgui: darken background when rendering overlays

This replaces the alert that says whether the overlay is enabled or not.

Also, we now always display the help menu in overlay mode.
This commit is contained in:
Quantum 2021-07-29 04:44:55 -04:00 committed by Geoffrey McRae
parent a980cd9406
commit ea2651e39b
3 changed files with 8 additions and 7 deletions

View File

@ -671,6 +671,13 @@ int app_renderOverlay(struct Rect * rects, int maxRects)
igNewFrame(); igNewFrame();
if (g_state.overlayInput)
{
totalDamage = true;
ImDrawList_AddRectFilled(igGetBackgroundDrawListNil(), (ImVec2) { 0.0f , 0.0f },
g_state.io->DisplaySize, 0xCC000000, 0, 0);
}
// render the overlays // render the overlays
for (ll_reset(g_state.overlays); for (ll_reset(g_state.overlays);
ll_walk(g_state.overlays, (void **)&overlay); ) ll_walk(g_state.overlays, (void **)&overlay); )

View File

@ -137,15 +137,9 @@ static void bind_toggleOverlay(int sc, void * opaque)
{ {
g_state.overlayInput ^= true; g_state.overlayInput ^= true;
if (g_state.overlayInput) if (g_state.overlayInput)
{
g_state.io->ConfigFlags &= ~ImGuiConfigFlags_NoMouse; g_state.io->ConfigFlags &= ~ImGuiConfigFlags_NoMouse;
app_alert(LG_ALERT_INFO, "Overlay input enabled");
}
else else
{
g_state.io->ConfigFlags |= ImGuiConfigFlags_NoMouse; g_state.io->ConfigFlags |= ImGuiConfigFlags_NoMouse;
app_alert(LG_ALERT_INFO, "Overlay input disabled");
}
} }
void keybind_register(void) void keybind_register(void)

View File

@ -39,7 +39,7 @@ static void help_free(void * udata)
static int help_render(void * udata, bool interactive, struct Rect * windowRects, static int help_render(void * udata, bool interactive, struct Rect * windowRects,
int maxRects) int maxRects)
{ {
if (!g_state.escapeHelp) if (!g_state.escapeHelp && !g_state.overlayInput)
return 0; return 0;
ImVec2 * screen = overlayGetScreenSize(); ImVec2 * screen = overlayGetScreenSize();