Merge pull request '#19: Fixed massive font size on the threshhold warning.' (#24) from show-own-threshold into 1.11.6
Reviewed-on: #24
This commit was merged in pull request #24.
This commit is contained in:
@@ -426,32 +426,32 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
var uidTextSize = ImGui.CalcTextSize(uidText);
|
var uidTextSize = ImGui.CalcTextSize(uidText);
|
||||||
ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X) / 2 - (uidTextSize.X / 2));
|
ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X) / 2 - (uidTextSize.X / 2));
|
||||||
ImGui.TextColored(GetUidColor(), uidText);
|
ImGui.TextColored(GetUidColor(), uidText);
|
||||||
|
}
|
||||||
|
|
||||||
if (groupedfiles != null)
|
if (groupedfiles != null)
|
||||||
|
{
|
||||||
|
//Checking of VRAM threshhold
|
||||||
|
var actualVramUsage = groupedfiles.SingleOrDefault(v => string.Equals(v.Key, "tex", StringComparison.Ordinal)).Sum(f => f.OriginalSize);
|
||||||
|
var isOverVRAMUsage = _playerPerformanceConfig.Current.VRAMSizeWarningThresholdMiB * 1024 * 1024 < actualVramUsage;
|
||||||
|
|
||||||
|
if (isOverTriHold || isOverVRAMUsage)
|
||||||
{
|
{
|
||||||
//Checking of VRAM threshhold
|
ImGui.SameLine();
|
||||||
var actualVramUsage = groupedfiles.SingleOrDefault(v => string.Equals(v.Key, "tex", StringComparison.Ordinal)).Sum(f => f.OriginalSize);
|
_uiSharedService.IconText(FontAwesomeIcon.ExclamationTriangle, UIColors.Get("LightlessYellow"));
|
||||||
var isOverVRAMUsage = _playerPerformanceConfig.Current.VRAMSizeWarningThresholdMiB * 1024 * 1024 < actualVramUsage;
|
string warningMessage = "";
|
||||||
|
if (isOverTriHold)
|
||||||
if (isOverTriHold || isOverVRAMUsage)
|
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
warningMessage += $"You exceed your own triangles threshold by " +
|
||||||
_uiSharedService.IconText(FontAwesomeIcon.ExclamationTriangle, UIColors.Get("LightlessYellow"));
|
$"{actualTriCount - _playerPerformanceConfig.Current.TrisWarningThresholdThousands * 1000} triangles.";
|
||||||
string warningMessage = "";
|
warningMessage += Environment.NewLine;
|
||||||
if (isOverTriHold)
|
|
||||||
{
|
|
||||||
warningMessage += $"You exceed your own triangles threshold by " +
|
|
||||||
$"{actualTriCount - _playerPerformanceConfig.Current.TrisWarningThresholdThousands * 1000} triangles.";
|
|
||||||
warningMessage += Environment.NewLine;
|
|
||||||
|
|
||||||
}
|
|
||||||
if (isOverVRAMUsage)
|
|
||||||
{
|
|
||||||
warningMessage += $"You exceed your own VRAM threshold by " +
|
|
||||||
$"{UiSharedService.ByteToString(actualVramUsage - (_playerPerformanceConfig.Current.VRAMSizeWarningThresholdMiB * 1024 * 1024))}.";
|
|
||||||
}
|
|
||||||
UiSharedService.AttachToolTip(warningMessage);
|
|
||||||
}
|
}
|
||||||
|
if (isOverVRAMUsage)
|
||||||
|
{
|
||||||
|
warningMessage += $"You exceed your own VRAM threshold by " +
|
||||||
|
$"{UiSharedService.ByteToString(actualVramUsage - (_playerPerformanceConfig.Current.VRAMSizeWarningThresholdMiB * 1024 * 1024))}.";
|
||||||
|
}
|
||||||
|
UiSharedService.AttachToolTip(warningMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user