This commit is contained in:
tildearrow 2023-02-24 04:19:39 -05:00
parent 5261cf97fe
commit 534cc501db
3 changed files with 41 additions and 1 deletions

View file

@ -4695,6 +4695,8 @@ bool FurnaceGUI::loop() {
ImGui::EndPopup();
}
drawTutorial();
ImVec2 newSongMinSize=mobileUI?ImVec2(canvasW-(portrait?0:(60.0*dpiScale)),canvasH-60.0*dpiScale):ImVec2(400.0f*dpiScale,200.0f*dpiScale);
ImVec2 newSongMaxSize=ImVec2(canvasW-((mobileUI && !portrait)?(60.0*dpiScale):0),canvasH-(mobileUI?(60.0*dpiScale):0));
ImGui::SetNextWindowSizeConstraints(newSongMinSize,newSongMaxSize);

View file

@ -1500,10 +1500,12 @@ class FurnaceGUI {
struct Tutorial {
int userComesFrom;
bool introPlayed;
bool protoWelcome;
bool taken[GUI_TUTORIAL_MAX];
Tutorial():
userComesFrom(0),
introPlayed(false) {
introPlayed(false),
protoWelcome(false) {
memset(taken,0,GUI_TUTORIAL_MAX*sizeof(bool));
}
} tutorial;
@ -1934,6 +1936,7 @@ class FurnaceGUI {
void drawFindReplace();
void drawSpoiler();
void drawClock();
void drawTutorial();
void parseKeybinds();
void promptKey(int which);

View file

@ -18,13 +18,48 @@
*/
#include "gui.h"
#include <imgui.h>
void FurnaceGUI::syncTutorial() {
tutorial.userComesFrom=e->getConfInt("tutUserComesFrom",0);
tutorial.introPlayed=e->getConfBool("tutIntroPlayed",false);
tutorial.protoWelcome=e->getConfBool("tutProtoWelcome",false);
}
void FurnaceGUI::commitTutorial() {
e->setConf("tutUserComesFrom",tutorial.userComesFrom);
e->setConf("tutIntroPlayed",tutorial.introPlayed);
e->setConf("tutProtoWelcome",tutorial.protoWelcome);
}
void FurnaceGUI::drawTutorial() {
if (!tutorial.protoWelcome) {
ImGui::OpenPopup("Welcome");
}
if (ImGui::BeginPopupModal("Welcome",NULL,ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoTitleBar)) {
ImGui::PushFont(bigFont);
ImGui::SetCursorPosX((ImGui::GetContentRegionAvail().x-ImGui::CalcTextSize("Welcome!").x)*0.5);
ImGui::Text("Welcome!");
ImGui::PopFont();
ImGui::Text("Hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi");
if (ImGui::Button("Start in Basic Mode")) {
basicMode=true;
tutorial.protoWelcome=true;
commitTutorial();
ImGui::CloseCurrentPopup();
}
if (ImGui::Button("Start in Advanced Mode")) {
basicMode=false;
tutorial.protoWelcome=true;
commitTutorial();
ImGui::CloseCurrentPopup();
}
ImGui::SetWindowPos(ImVec2(
(canvasW-ImGui::GetWindowSize().x)*0.5,
(canvasH-ImGui::GetWindowSize().y)*0.5
));
ImGui::EndPopup();
}
}