mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-02 17:27:25 +00:00
change copied timer to deltatime
This commit is contained in:
parent
8dc8bc285d
commit
07b41e03c8
2 changed files with 6 additions and 6 deletions
|
@ -2277,7 +2277,7 @@ class FurnaceGUI {
|
||||||
struct Tutorial {
|
struct Tutorial {
|
||||||
bool introPlayed;
|
bool introPlayed;
|
||||||
bool protoWelcome;
|
bool protoWelcome;
|
||||||
unsigned short popupTimer;
|
double popupTimer;
|
||||||
Tutorial():
|
Tutorial():
|
||||||
#ifdef SUPPORT_XP
|
#ifdef SUPPORT_XP
|
||||||
introPlayed(true),
|
introPlayed(true),
|
||||||
|
@ -2285,7 +2285,7 @@ class FurnaceGUI {
|
||||||
introPlayed(false),
|
introPlayed(false),
|
||||||
#endif
|
#endif
|
||||||
protoWelcome(false),
|
protoWelcome(false),
|
||||||
popupTimer(65535) {
|
popupTimer(1.0f) {
|
||||||
}
|
}
|
||||||
} tutorial;
|
} tutorial;
|
||||||
|
|
||||||
|
|
|
@ -716,16 +716,16 @@ void FurnaceGUI::drawTutorial() {
|
||||||
(canvasH-ImGui::GetWindowSize().y)*0.5
|
(canvasH-ImGui::GetWindowSize().y)*0.5
|
||||||
));
|
));
|
||||||
|
|
||||||
if (tutorial.popupTimer<40) {
|
if (tutorial.popupTimer<0.6f) {
|
||||||
ImDrawList* dl=ImGui::GetForegroundDrawList();
|
ImDrawList* dl=ImGui::GetForegroundDrawList();
|
||||||
const ImVec2 winPos=ImGui::GetWindowPos();
|
const ImVec2 winPos=ImGui::GetWindowPos();
|
||||||
const ImVec2 winSize=ImGui::GetWindowSize();
|
|
||||||
const ImVec2 txtSize=ImGui::CalcTextSize("copied!");
|
const ImVec2 txtSize=ImGui::CalcTextSize("copied!");
|
||||||
|
const ImVec2 winSize=ImGui::GetWindowSize();
|
||||||
dl->AddText(ImVec2(
|
dl->AddText(ImVec2(
|
||||||
winPos.x+(winSize.x-txtSize.x)/2,
|
winPos.x+(winSize.x-txtSize.x)/2,
|
||||||
winPos.y+(winSize.y-txtSize.y*2)
|
winPos.y+(winSize.y-txtSize.y*2)
|
||||||
),ImGui::ColorConvertFloat4ToU32(uiColors[GUI_COLOR_ACCENT_SECONDARY]),"copied!");
|
),ImGui::ColorConvertFloat4ToU32(uiColors[GUI_COLOR_TOGGLE_ON]),"copied!");
|
||||||
tutorial.popupTimer++;
|
tutorial.popupTimer+=ImGui::GetIO().DeltaTime;
|
||||||
}
|
}
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue