mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2025-01-13 10:53:57 +08:00
fix default notification height + a potential crash when creating notification table during exit
This commit is contained in:
parent
99d689118e
commit
d3c4026447
@ -54,7 +54,7 @@ enum notification_type
|
||||
struct Notification
|
||||
{
|
||||
static constexpr float width_percent = 0.25f; // percentage from total width
|
||||
static constexpr float height = 5.0f;
|
||||
static constexpr float height = 6.5f;
|
||||
static constexpr std::chrono::milliseconds fade_in = std::chrono::milliseconds(2000);
|
||||
static constexpr std::chrono::milliseconds fade_out = std::chrono::milliseconds(2000);
|
||||
static constexpr std::chrono::milliseconds show_time = std::chrono::milliseconds(6000) + fade_in + fade_out;
|
||||
|
@ -931,14 +931,13 @@ void Steam_Overlay::BuildNotifications(int width, int height)
|
||||
|
||||
switch (it->type) {
|
||||
case notification_type_achievement: {
|
||||
if (!it->icon.expired()) {
|
||||
ImGui::BeginTable("imgui_table", 2);
|
||||
if (!it->icon.expired() && ImGui::BeginTable("imgui_table", 2)) {
|
||||
ImGui::TableSetupColumn("imgui_table_image", ImGuiTableColumnFlags_WidthFixed, settings->overlay_appearance.icon_size);
|
||||
ImGui::TableSetupColumn("imgui_table_text");
|
||||
ImGui::TableNextRow(ImGuiTableRowFlags_None, settings->overlay_appearance.icon_size);
|
||||
|
||||
ImGui::TableSetColumnIndex(0);
|
||||
ImGui::Image((ImU64)*it->icon.lock().get(), ImVec2(settings->overlay_appearance.icon_size, settings->overlay_appearance.icon_size));
|
||||
ImGui::Image((ImTextureID)*it->icon.lock().get(), ImVec2(settings->overlay_appearance.icon_size, settings->overlay_appearance.icon_size));
|
||||
|
||||
ImGui::TableSetColumnIndex(1);
|
||||
ImGui::TextWrapped("%s", it->message.c_str());
|
||||
|
Loading…
x
Reference in New Issue
Block a user