Merge branch 'Eknous-P/welcomescr'

This commit is contained in:
tildearrow 2024-10-10 02:21:57 -05:00
commit 39e049145a
4 changed files with 48 additions and 3 deletions

View file

@ -31,6 +31,24 @@
#include <dirent.h>
#endif
#ifndef IS_MOBILE
#define CLICK_TO_OPEN(t) ImGui::TextColored(uiColors[GUI_COLOR_ACCENT_PRIMARY],t);\
if (ImGui::IsItemHovered()) {\
ImGui::SetTooltip("click to open");\
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);\
}\
if (ImGui::IsItemClicked()) SDL_OpenURL(t); \
ImGui::SameLine();\
ImGui::Text(ICON_FA_CLIPBOARD);\
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort)) ImGui::SetTooltip("click to copy");\
if (ImGui::IsItemClicked()) {\
ImGui::SetClipboardText(t);\
tutorial.popupTimer=0;\
}
#else
#define CLICK_TO_OPEN(t) ImGui::TextColored(uiColors[GUI_COLOR_ACCENT_PRIMARY],t); if (ImGui::IsItemClicked()) SDL_OpenURL(t);
#endif
enum FurnaceCVObjectTypes {
CV_NULL=0,
CV_PLAYER,
@ -684,15 +702,23 @@ void FurnaceGUI::drawTutorial() {
"- click on the Orders matrix to change the patterns of a channel (left click increases; right click decreases)"
));
ImGui::Separator();
ImGui::TextWrapped(_(
"if you are new to trackers, you may check the quick start guide:"
));
CLICK_TO_OPEN("https://github.com/tildearrow/furnace/blob/master/doc/1-intro/quickstart.md")
ImGui::TextWrapped(_(
"if you need help, you may:\n"
"- read the manual (a file called manual.pdf)\n"
"- ask for help in Discussions (https://github.com/tildearrow/furnace/discussions)"
"- ask for help in Discussions"
));
CLICK_TO_OPEN("https://github.com/tildearrow/furnace/discussions")
ImGui::Separator();
ImGui::TextWrapped(_("if you find any issues, be sure to report them! the issue tracker is here: https://github.com/tildearrow/furnace/issues"));
ImGui::TextWrapped(_("if you find any issues, be sure to report them! the issue tracker is here:"));
CLICK_TO_OPEN("https://github.com/tildearrow/furnace/issues")
if (ImGui::Button(_("OK"))) {
tutorial.protoWelcome=true;
@ -704,6 +730,18 @@ void FurnaceGUI::drawTutorial() {
(canvasW-ImGui::GetWindowSize().x)*0.5,
(canvasH-ImGui::GetWindowSize().y)*0.5
));
if (tutorial.popupTimer<2.0f) {
ImDrawList* dl=ImGui::GetForegroundDrawList();
const ImVec2 winPos=ImGui::GetWindowPos();
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_TOGGLE_ON]),"copied!");
tutorial.popupTimer+=ImGui::GetIO().DeltaTime;
}
ImGui::EndPopup();
}