This commit is contained in:
parent
5261cf97fe
commit
534cc501db
|
@ -4695,6 +4695,8 @@ bool FurnaceGUI::loop() {
|
||||||
ImGui::EndPopup();
|
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 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));
|
ImVec2 newSongMaxSize=ImVec2(canvasW-((mobileUI && !portrait)?(60.0*dpiScale):0),canvasH-(mobileUI?(60.0*dpiScale):0));
|
||||||
ImGui::SetNextWindowSizeConstraints(newSongMinSize,newSongMaxSize);
|
ImGui::SetNextWindowSizeConstraints(newSongMinSize,newSongMaxSize);
|
||||||
|
|
|
@ -1500,10 +1500,12 @@ class FurnaceGUI {
|
||||||
struct Tutorial {
|
struct Tutorial {
|
||||||
int userComesFrom;
|
int userComesFrom;
|
||||||
bool introPlayed;
|
bool introPlayed;
|
||||||
|
bool protoWelcome;
|
||||||
bool taken[GUI_TUTORIAL_MAX];
|
bool taken[GUI_TUTORIAL_MAX];
|
||||||
Tutorial():
|
Tutorial():
|
||||||
userComesFrom(0),
|
userComesFrom(0),
|
||||||
introPlayed(false) {
|
introPlayed(false),
|
||||||
|
protoWelcome(false) {
|
||||||
memset(taken,0,GUI_TUTORIAL_MAX*sizeof(bool));
|
memset(taken,0,GUI_TUTORIAL_MAX*sizeof(bool));
|
||||||
}
|
}
|
||||||
} tutorial;
|
} tutorial;
|
||||||
|
@ -1934,6 +1936,7 @@ class FurnaceGUI {
|
||||||
void drawFindReplace();
|
void drawFindReplace();
|
||||||
void drawSpoiler();
|
void drawSpoiler();
|
||||||
void drawClock();
|
void drawClock();
|
||||||
|
void drawTutorial();
|
||||||
|
|
||||||
void parseKeybinds();
|
void parseKeybinds();
|
||||||
void promptKey(int which);
|
void promptKey(int which);
|
||||||
|
|
|
@ -18,13 +18,48 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
|
#include <imgui.h>
|
||||||
|
|
||||||
void FurnaceGUI::syncTutorial() {
|
void FurnaceGUI::syncTutorial() {
|
||||||
tutorial.userComesFrom=e->getConfInt("tutUserComesFrom",0);
|
tutorial.userComesFrom=e->getConfInt("tutUserComesFrom",0);
|
||||||
tutorial.introPlayed=e->getConfBool("tutIntroPlayed",false);
|
tutorial.introPlayed=e->getConfBool("tutIntroPlayed",false);
|
||||||
|
tutorial.protoWelcome=e->getConfBool("tutProtoWelcome",false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FurnaceGUI::commitTutorial() {
|
void FurnaceGUI::commitTutorial() {
|
||||||
e->setConf("tutUserComesFrom",tutorial.userComesFrom);
|
e->setConf("tutUserComesFrom",tutorial.userComesFrom);
|
||||||
e->setConf("tutIntroPlayed",tutorial.introPlayed);
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue