mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-09 02:43:38 +08:00
fix(GUI): Notifications freezing menu
This commit is contained in:
parent
eb71752b5b
commit
f18dde584f
@ -80,20 +80,12 @@ namespace big
|
||||
|
||||
void gui::dx_on_tick()
|
||||
{
|
||||
TRY_CLAUSE
|
||||
{
|
||||
view::root();
|
||||
}
|
||||
EXCEPT_CLAUSE
|
||||
view::root();
|
||||
}
|
||||
|
||||
void gui::always_draw()
|
||||
{
|
||||
TRY_CLAUSE
|
||||
{
|
||||
view::always();
|
||||
}
|
||||
EXCEPT_CLAUSE
|
||||
view::always();
|
||||
}
|
||||
|
||||
void gui::script_init()
|
||||
|
@ -79,11 +79,13 @@ namespace big
|
||||
ImGui_ImplWin32_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
g_gui.always_draw();
|
||||
|
||||
if (g_gui.m_opened)
|
||||
{
|
||||
g_gui.dx_on_tick();
|
||||
}
|
||||
g_gui.always_draw();
|
||||
|
||||
|
||||
ImGui::Render();
|
||||
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
|
||||
|
@ -7,7 +7,7 @@ namespace big
|
||||
{
|
||||
ImGui::SetNextWindowSize({ (float)g->window.x * 0.2f, (float)g->window.y });
|
||||
ImGui::SetNextWindowPos({ (float)g->window.x - (float)g->window.x * 0.2f, 0 });
|
||||
if (ImGui::Begin("notifications", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoBackground))
|
||||
if (ImGui::Begin("notifications", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBringToFrontOnFocus))
|
||||
{
|
||||
std::vector<notification> notifications = g_notification_service->get();
|
||||
|
||||
@ -18,14 +18,14 @@ namespace big
|
||||
ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.10f, 0.09f, 0.12f, 1.00f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.10f, 0.09f, 0.12f, 1.00f));
|
||||
ImGui::SetNextWindowBgAlpha(n.alpha);
|
||||
ImGui::BeginChild(i, ImVec2(0, 75.f + (float)(20 * (int)(n.message.size() / 28) + 20 * (float)std::count(n.message.begin(), n.message.end(), '\n'))), true, ImGuiWindowFlags_NoScrollbar);
|
||||
ImGui::BeginChildFrame(i, ImVec2(0, 75.f + (float)(20 * (int)(n.message.size() / 28) + 20 * (float)std::count(n.message.begin(), n.message.end(), '\n'))), ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoInputs);
|
||||
ImGui::Text(n.title.c_str());
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, g_notification_service->notification_colors.at(n.type));
|
||||
ImGui::TextWrapped(n.message.c_str());
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::EndChild();
|
||||
ImGui::PopStyleVar();
|
||||
ImGui::EndChildFrame();
|
||||
ImGui::PopStyleColor(2);
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user