Added clear logs button + showing exception in status bar

This commit is contained in:
Antoine Pilote
2024-08-14 20:29:50 -04:00
parent 6032d40aa2
commit 1eb81041fb
4 changed files with 26 additions and 38 deletions

View File

@@ -2044,6 +2044,13 @@ namespace Nuake {
{
if (ImGui::Begin("Logger"))
{
if (ImGui::Button("Clear Logs"))
{
Logger::ClearLogs();
SetStatusMessage("Logs cleared.");
}
ImGui::SameLine();
ImGui::Checkbox("Errors", &LogErrors);
ImGui::SameLine();
ImGui::Checkbox("Warning", &LogWarnings);
@@ -2104,7 +2111,7 @@ namespace Nuake {
std::string displayMessage = l.message;
if (l.count > 0)
{
displayMessage + "(" + std::to_string(l.count) + ")";
displayMessage += "(" + std::to_string(l.count) + ")";
}
ImGui::TextWrapped(displayMessage.c_str());
@@ -2546,6 +2553,14 @@ namespace Nuake {
DrawMenuBar();
DrawMenuBars();
int i = 0;
if (Logger::GetLogCount() > 0 && Logger::GetLogs()[Logger::GetLogCount() - 1].type == COMPILATION)
{
SetStatusMessage(std::string(ICON_FA_EXCLAMATION_TRIANGLE) + " An unhandled exception occured in your script. See logs for more details.", Color(1.0f, 0.1f, 0.1f, 1.0f));
}
DrawStatusBar();
pInterface.DrawEntitySettings();