diff --git a/src/gui/gui.h b/src/gui/gui.h index 40da2c782..bb7a57e9c 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2277,7 +2277,7 @@ class FurnaceGUI { struct Tutorial { bool introPlayed; bool protoWelcome; - unsigned short popupTimer; + double popupTimer; Tutorial(): #ifdef SUPPORT_XP introPlayed(true), @@ -2285,7 +2285,7 @@ class FurnaceGUI { introPlayed(false), #endif protoWelcome(false), - popupTimer(65535) { + popupTimer(1.0f) { } } tutorial; diff --git a/src/gui/tutorial.cpp b/src/gui/tutorial.cpp index 69e8adc1a..2c5c2ef50 100644 --- a/src/gui/tutorial.cpp +++ b/src/gui/tutorial.cpp @@ -716,16 +716,16 @@ void FurnaceGUI::drawTutorial() { (canvasH-ImGui::GetWindowSize().y)*0.5 )); - if (tutorial.popupTimer<40) { + if (tutorial.popupTimer<0.6f) { ImDrawList* dl=ImGui::GetForegroundDrawList(); const ImVec2 winPos=ImGui::GetWindowPos(); - const ImVec2 winSize=ImGui::GetWindowSize(); const ImVec2 txtSize=ImGui::CalcTextSize("copied!"); + const ImVec2 winSize=ImGui::GetWindowSize(); dl->AddText(ImVec2( winPos.x+(winSize.x-txtSize.x)/2, winPos.y+(winSize.y-txtSize.y*2) - ),ImGui::ColorConvertFloat4ToU32(uiColors[GUI_COLOR_ACCENT_SECONDARY]),"copied!"); - tutorial.popupTimer++; + ),ImGui::ColorConvertFloat4ToU32(uiColors[GUI_COLOR_TOGGLE_ON]),"copied!"); + tutorial.popupTimer+=ImGui::GetIO().DeltaTime; } ImGui::EndPopup(); }