@@ -66,11 +66,11 @@ struct OverlayList
66
66
const auto kPopupFlags = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;
67
67
68
68
const float kBackgroundAlpha = 0 .65f ;
69
- void LatteOverlay_renderOverlay (ImVec2& position, ImVec2& pivot, sint32 direction)
69
+ void LatteOverlay_renderOverlay (ImVec2& position, ImVec2& pivot, sint32 direction, float fontSize, bool pad )
70
70
{
71
71
auto & config = GetConfig ();
72
-
73
- const auto font = ImGui_GetFont (14 . 0f * ( float )config. overlay . text_scale / 100 . 0f );
72
+
73
+ const auto font = ImGui_GetFont (fontSize );
74
74
ImGui::PushFont (font);
75
75
76
76
const ImVec4 color = ImGui::ColorConvertU32ToFloat4 (config.overlay .text_color );
@@ -80,7 +80,7 @@ void LatteOverlay_renderOverlay(ImVec2& position, ImVec2& pivot, sint32 directio
80
80
{
81
81
ImGui::SetNextWindowPos (position, ImGuiCond_Always, pivot);
82
82
ImGui::SetNextWindowBgAlpha (kBackgroundAlpha );
83
- if (ImGui::Begin (" Stats overlay" , nullptr , kPopupFlags ))
83
+ if (ImGui_BeginPadDistinct (" Stats overlay" , nullptr , kPopupFlags , pad ))
84
84
{
85
85
if (config.overlay .fps )
86
86
ImGui::Text (" FPS: %.2lf" , g_state.fps );
@@ -117,11 +117,11 @@ void LatteOverlay_renderOverlay(ImVec2& position, ImVec2& pivot, sint32 directio
117
117
ImGui::PopFont ();
118
118
}
119
119
120
- void LatteOverlay_RenderNotifications (ImVec2& position, ImVec2& pivot, sint32 direction)
120
+ void LatteOverlay_RenderNotifications (ImVec2& position, ImVec2& pivot, sint32 direction, float fontSize, bool pad )
121
121
{
122
122
auto & config = GetConfig ();
123
123
124
- const auto font = ImGui_GetFont (14 . 0f * ( float )config. notification . text_scale / 100 . 0f );
124
+ const auto font = ImGui_GetFont (fontSize );
125
125
ImGui::PushFont (font);
126
126
127
127
const ImVec4 color = ImGui::ColorConvertU32ToFloat4 (config.notification .text_color );
@@ -141,7 +141,7 @@ void LatteOverlay_RenderNotifications(ImVec2& position, ImVec2& pivot, sint32 di
141
141
// active account
142
142
ImGui::SetNextWindowPos (position, ImGuiCond_Always, pivot);
143
143
ImGui::SetNextWindowBgAlpha (kBackgroundAlpha );
144
- if (ImGui::Begin (" Active account" , nullptr , kPopupFlags ))
144
+ if (ImGui_BeginPadDistinct (" Active account" , nullptr , kPopupFlags , pad ))
145
145
{
146
146
ImGui::TextUnformatted ((const char *)ICON_FA_USER);
147
147
ImGui::SameLine ();
@@ -179,7 +179,7 @@ void LatteOverlay_RenderNotifications(ImVec2& position, ImVec2& pivot, sint32 di
179
179
{
180
180
ImGui::SetNextWindowPos (position, ImGuiCond_Always, pivot);
181
181
ImGui::SetNextWindowBgAlpha (kBackgroundAlpha );
182
- if (ImGui::Begin (" Controller profile names" , nullptr , kPopupFlags ))
182
+ if (ImGui_BeginPadDistinct (" Controller profile names" , nullptr , kPopupFlags , pad ))
183
183
{
184
184
auto it = profiles.cbegin ();
185
185
ImGui::TextUnformatted ((const char *)ICON_FA_GAMEPAD);
@@ -227,7 +227,7 @@ void LatteOverlay_RenderNotifications(ImVec2& position, ImVec2& pivot, sint32 di
227
227
{
228
228
ImGui::SetNextWindowPos (position, ImGuiCond_Always, pivot);
229
229
ImGui::SetNextWindowBgAlpha (kBackgroundAlpha );
230
- if (ImGui::Begin (" Friends overlay" , nullptr , kPopupFlags ))
230
+ if (ImGui_BeginPadDistinct (" Friends overlay" , nullptr , kPopupFlags , pad ))
231
231
{
232
232
const auto tick = tick_cached ();
233
233
for (auto it = s_friend_list.cbegin (); it != s_friend_list.cend ();)
@@ -274,7 +274,7 @@ void LatteOverlay_RenderNotifications(ImVec2& position, ImVec2& pivot, sint32 di
274
274
275
275
ImGui::SetNextWindowPos (position, ImGuiCond_Always, pivot);
276
276
ImGui::SetNextWindowBgAlpha (kBackgroundAlpha );
277
- if (ImGui::Begin (" Low battery overlay" , nullptr , kPopupFlags ))
277
+ if (ImGui_BeginPadDistinct (" Low battery overlay" , nullptr , kPopupFlags , pad ))
278
278
{
279
279
auto it = batteries.cbegin ();
280
280
ImGui::TextUnformatted ((const char *)(s_blink_state ? ICON_FA_BATTERY_EMPTY : ICON_FA_BATTERY_QUARTER));
@@ -322,7 +322,7 @@ void LatteOverlay_RenderNotifications(ImVec2& position, ImVec2& pivot, sint32 di
322
322
{
323
323
ImGui::SetNextWindowPos (position, ImGuiCond_Always, pivot);
324
324
ImGui::SetNextWindowBgAlpha (kBackgroundAlpha );
325
- if (ImGui::Begin (" Compiling shaders overlay" , nullptr , kPopupFlags ))
325
+ if (ImGui_BeginPadDistinct (" Compiling shaders overlay" , nullptr , kPopupFlags , pad ))
326
326
{
327
327
ImRotateStart ();
328
328
ImGui::TextUnformatted ((const char *)ICON_FA_SPINNER);
@@ -377,7 +377,7 @@ void LatteOverlay_RenderNotifications(ImVec2& position, ImVec2& pivot, sint32 di
377
377
{
378
378
ImGui::SetNextWindowPos (position, ImGuiCond_Always, pivot);
379
379
ImGui::SetNextWindowBgAlpha (kBackgroundAlpha );
380
- if (ImGui::Begin (" Compiling pipeline overlay" , nullptr , kPopupFlags ))
380
+ if (ImGui_BeginPadDistinct (" Compiling pipeline overlay" , nullptr , kPopupFlags , pad ))
381
381
{
382
382
ImRotateStart ();
383
383
ImGui::TextUnformatted ((const char *)ICON_FA_SPINNER);
@@ -446,7 +446,7 @@ void LatteOverlay_RenderNotifications(ImVec2& position, ImVec2& pivot, sint32 di
446
446
{
447
447
ImGui::SetNextWindowPos (position, ImGuiCond_Always, pivot);
448
448
ImGui::SetNextWindowBgAlpha (kBackgroundAlpha );
449
- if (ImGui::Begin (" Misc notifications" , nullptr , kPopupFlags ))
449
+ if (ImGui_BeginPadDistinct (" Misc notifications" , nullptr , kPopupFlags , pad ))
450
450
{
451
451
const auto tick = tick_cached ();
452
452
for (auto it = s_misc_notifications.cbegin (); it != s_misc_notifications.cend ();)
@@ -521,12 +521,18 @@ void LatteOverlay_render(bool pad_view)
521
521
return ;
522
522
523
523
const Vector2f window_size{ (float )w,(float )h };
524
-
524
+
525
+ float fontDPIScale = !pad_view ? gui_getWindowDPIScale () : gui_getPadDPIScale ();
526
+
527
+ float overlayFontSize = 14 .0f * (float )config.overlay .text_scale / 100 .0f * fontDPIScale;
528
+
525
529
// test if fonts are already precached
526
- if (!ImGui_GetFont (14 . 0f * ( float )config. overlay . text_scale / 100 . 0f ))
530
+ if (!ImGui_GetFont (overlayFontSize ))
527
531
return ;
532
+
533
+ float notificationsFontSize = 14 .0f * (float )config.notification .text_scale / 100 .0f * fontDPIScale;
528
534
529
- if (!ImGui_GetFont (14 . 0f * ( float )config. notification . text_scale / 100 . 0f ))
535
+ if (!ImGui_GetFont (notificationsFontSize ))
530
536
return ;
531
537
532
538
ImVec2 position{}, pivot{};
@@ -535,7 +541,7 @@ void LatteOverlay_render(bool pad_view)
535
541
if (config.overlay .position != ScreenPosition::kDisabled )
536
542
{
537
543
LatteOverlay_translateScreenPosition (config.overlay .position , window_size, position, pivot, direction);
538
- LatteOverlay_renderOverlay (position, pivot, direction);
544
+ LatteOverlay_renderOverlay (position, pivot, direction, overlayFontSize, pad_view );
539
545
}
540
546
541
547
@@ -544,7 +550,7 @@ void LatteOverlay_render(bool pad_view)
544
550
if (config.overlay .position != config.notification .position )
545
551
LatteOverlay_translateScreenPosition (config.notification .position , window_size, position, pivot, direction);
546
552
547
- LatteOverlay_RenderNotifications (position, pivot, direction);
553
+ LatteOverlay_RenderNotifications (position, pivot, direction, notificationsFontSize, pad_view );
548
554
}
549
555
}
550
556
0 commit comments