diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 44e8f2546..34efe78f6 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -4811,8 +4811,6 @@ bool FurnaceGUI::loop() { if (keyHit1[i]<0.0f) keyHit1[i]=0.0f; } - activateTutorial(GUI_TUTORIAL_OVERVIEW); - if (inspectorOpen) ImGui::ShowMetricsWindow(&inspectorOpen); if (firstFrame) { @@ -6806,7 +6804,6 @@ bool FurnaceGUI::init() { } initSystemPresets(); - initTutorial(); e->setAutoNotePoly(noteInputPoly); diff --git a/src/gui/gui.h b/src/gui/gui.h index ee8a56166..7ac213c85 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -890,12 +890,6 @@ enum FurnaceGUIChanOscRef { GUI_OSCREF_MAX }; -enum FurnaceGUITutorials { - GUI_TUTORIAL_OVERVIEW=0, - - GUI_TUTORIAL_MAX -}; - enum PasteMode { GUI_PASTE_MODE_NORMAL=0, GUI_PASTE_MODE_MIX_FG, @@ -1266,31 +1260,6 @@ struct FurnaceGUISysCategory { description(NULL) {} }; -typedef std::function TutorialFunc; - -struct FurnaceGUITutorialStep { - const char* text; - int waitForTrigger; - TutorialFunc run; - TutorialFunc runBefore; - TutorialFunc runAfter; - - FurnaceGUITutorialStep(const char* t, int trigger=-1, TutorialFunc activeFunc=NULL, TutorialFunc beginFunc=NULL, TutorialFunc endFunc=NULL): - text(t), - waitForTrigger(trigger), - run(activeFunc), - runBefore(beginFunc), - runAfter(endFunc) {} -}; - -struct FurnaceGUITutorialDef { - const char* name; - std::vector steps; - FurnaceGUITutorialDef(): - name("Help!") {} - FurnaceGUITutorialDef(const char* n, std::initializer_list step); -}; - struct FurnaceGUIMacroDesc { DivInstrumentMacro* macro; int min, max; @@ -2052,15 +2021,11 @@ class FurnaceGUI { } settings; struct Tutorial { - int userComesFrom; bool introPlayed; bool protoWelcome; - bool taken[GUI_TUTORIAL_MAX]; Tutorial(): - userComesFrom(0), introPlayed(false), protoWelcome(false) { - memset(taken,0,GUI_TUTORIAL_MAX*sizeof(bool)); } } tutorial; @@ -2184,7 +2149,6 @@ class FurnaceGUI { std::vector> pendingIns; std::vector sysCategories; - FurnaceGUITutorialDef tutorials[GUI_TUTORIAL_MAX]; bool wavePreviewOn; SDL_Scancode wavePreviewKey; @@ -2733,8 +2697,6 @@ class FurnaceGUI { void applyUISettings(bool updateFonts=true); void initSystemPresets(); - void initTutorial(); - void activateTutorial(FurnaceGUITutorials which); void initRandomDemoSong(); bool loadRandomDemoSong(); diff --git a/src/gui/tutorial.cpp b/src/gui/tutorial.cpp index cc5994954..816f71192 100644 --- a/src/gui/tutorial.cpp +++ b/src/gui/tutorial.cpp @@ -24,8 +24,6 @@ #include "gif_load.h" -#define TS FurnaceGUITutorialStep - #ifdef _WIN32 #include #include "../utfutils.h" @@ -555,224 +553,16 @@ static const char* cvText[]={ (const char*)1 }; -void FurnaceGUI::initTutorial() { - tutorials[GUI_TUTORIAL_OVERVIEW]=FurnaceGUITutorialDef("Overview",{ - TS( - "hello! this is the Furnace tutorial!\n" - "I will teach you how to use Furnace.\n" - "if you wish to skip these tutorials, click on one of the Skip buttons. otherwise, click the " ICON_FA_CHEVRON_RIGHT " icon to continue." - ), - TS( - "Furnace is a chiptune tracker!\n" - "in a tracker, the song is written down in patterns, which are lists of notes, instruments and effects to play.\n" - "a playhead scrolls down through these patterns, and plays the notes that are written in them as it moves.\n" - "think of it as a piano roll, but replace the dots in the position of notes with note names (e.g. A-4)." - ), - TS( - "these are called \"patterns\" because they may appear more than once in the song.\n" - "this is useful for (in example) percussion, avoiding duplication.\n" - "the order in which these patterns appear is determined by an order list which also scrolls down as the playhead moves between patterns." - ), - TS( - "this is the Pattern window. it displays a pattern (which contains the notes and stuff).", - -1, - [this]() { - highlightWindow("Pattern"); - }, - [this]() { - nextWindow=GUI_WINDOW_PATTERN; - } - ), - TS( - "this is the Orders window. it displays which patterns are going to play.", - -1, - [this]() { - highlightWindow("Orders"); - }, - [this]() { - nextWindow=GUI_WINDOW_ORDERS; - } - ), - TS( - "this is the Instruments window. it shows a list of instruments (sounds) in the song.", - -1, - [this]() { - highlightWindow("Instruments"); - }, - [this]() { - nextWindow=GUI_WINDOW_INS_LIST; - } - ), - TS( - "this is the Song Information window, which allows you to change some song properties.", - -1, - [this]() { - highlightWindow("Song Info##Song Information"); - }, - [this]() { - nextWindow=GUI_WINDOW_SONG_INFO; - } - ), - TS( - "this is the Speed window, which contains speed parameters.", - -1, - [this]() { - highlightWindow("Speed"); - }, - [this]() { - nextWindow=GUI_WINDOW_SPEED; - } - ), - TS( - "and here are the Play Controls. you can use these to play the song and do some other things.\n" - "now that I am done explaining the interface, let's make a song!", - -1, - [this]() { - highlightWindow("Play Controls"); - }, - [this]() { - nextWindow=GUI_WINDOW_EDIT_CONTROLS; - } - ), - TS( - "we'll start by creating an instrument.\n" - "while it's possible to work without instruments, we would be stuck with the default sound!\n" - "so let's create one... for that you click on the " ICON_FA_PLUS " button in the Instruments window." - ), - TS( - "" - ), - TS( - "now let's type in some notes!\n" - "first, enable Edit Mode with the Space key.\n" - "after that, click on the pattern editor to focus it (the first empty column to be specific).\n" - ), - TS( - "the keyboard layout for inserting notes resembles that of a piano:\n" - "- Z-M: low octave\n" - "- Q-U: mid octave\n" - "- I-P and beyond: high octave\n" - "the keys one row above the mentioned octaves are the upper keys of a piano.\n" - "let's press some of these keys to insert notes!" - ), - TS( - "" - ), - TS( - "and now, let's play the song! hit Enter to play it (and press it while playing to stop)." - ), - TS( - "" - ), - TS( - "great!\n" - "by the way, you can move around the pattern view using the arrow keys or by clicking in the pattern." - ), - TS( - "now let me teach you about these columns in the pattern editor.\n" - "each big column represents a channel.\n" - "a channel consists of five (or more) smaller columns:\n" - "- the first column contains notes.\n" - "- the second one represents the instruments to play (these will be filled in automatically when you have an instrument selected).\n" - "- the third one has volume changes (will explain these later).\n" - "- the last two ones are effects and effect values (you can have multiple effect columns, but that's something I will be covering later as well.)\n" - "the instrument, volume and effect columns are continuous. this means that if nothing is specified, the last value will be used." - ), - TS( - "let's add some volume changes to show you what I mean." - ), - TS( - "" - ), - TS( - "as you can hear, volume changes affects all notes which are placed next to, or after it.\n" - "let's place some bass notes." - ), - TS( - "" - ), - TS( - "oh wait! the keyboard layout only contains 2 octaves!\n" - "however, we can change the octave range by using the Octave setting in the play/edit controls." - ), - TS( - "" - ), - TS( - "now let's type in the notes..." - ), - TS( - "" - ), - TS( - "...and play this?" - ), - TS( - "" - ), - TS( - "cool, huh? but we're running out of space here.\n" - "let's expand the song." - ), - TS( - "for that we go in the Orders window, which contains the order these patterns will appear in.\n" - "the first column is position while the other columns contain pattern numbers of every channel." - ), - TS( - "clicking on the " ICON_FA_PLUS " button adds one row to the orders..." - ), - TS( - "" - ), - TS( - "and then clicking on a cell of the first column takes us there." - ), - TS( - "" - ), - TS( - "now let's add more to the song." - ), - TS( - "" - ), - TS( - "and after that, let's hear it!\n" - "note that playing the song by pressing Enter will play from the current position in the Orders view - that is, order 1!\n" - "we want to play from order 0 (the first order), so we go back to it first and then hit Enter." - ), - TS( - "" - ), - TS( - "congratulations! you made it\n" - "what else?" - ) - }); -} - void FurnaceGUI::syncTutorial() { -// tutorial.userComesFrom=e->getConfInt("tutUserComesFrom",0); tutorial.introPlayed=e->getConfBool("tutIntroPlayed",false); tutorial.protoWelcome=e->getConfBool("tutProtoWelcome2",false); } void FurnaceGUI::commitTutorial() { -// e->setConf("tutUserComesFrom",tutorial.userComesFrom); e->setConf("tutIntroPlayed",tutorial.introPlayed); e->setConf("tutProtoWelcome2",tutorial.protoWelcome); } -void FurnaceGUI::activateTutorial(FurnaceGUITutorials which) { - /* - if (tutorial.protoWelcome && !tutorial.taken[which] && !ImGui::IsPopupOpen((const char*)NULL,ImGuiPopupFlags_AnyPopupId|ImGuiPopupFlags_AnyPopupLevel) && curTutorial==-1 && introPos>=10.0) { - logV("activating tutorial %d.",which); - curTutorial=which; - curTutorialStep=0; - } - */ -} - void FurnaceGUI::initRandomDemoSong() { std::vector subDirs; #if !defined(IS_MOBILE) && defined(FURNACE_DATADIR) && defined(SHOW_OPEN_ASSETS_MENU_ENTRY) @@ -960,72 +750,6 @@ void FurnaceGUI::drawTutorial() { ImGui::EndPopup(); } - // tutorial - if (curTutorial>=0 && curTutorialAddRectFilled( - ImVec2(0,0), - ImVec2(canvasW,canvasH), - col - ); - } - if (step.text[0]) { - ImVec2 avail=ImGui::GetContentRegionAvail(); - ImVec2 textSize=ImGui::CalcTextSize(step.text,NULL,false,avail.x); - textSize.x+=ImGui::GetStyle().WindowPadding.y*2.0f; - textSize.y+=ImGui::GetStyle().WindowPadding.y*2.0f+ImGui::GetFrameHeightWithSpacing(); - if (textSize.x>avail.x) textSize.x=avail.x; - if (textSize.y>avail.y) textSize.y=avail.y; - - ImGui::SetCursorPos(ImVec2( - (canvasW-textSize.x)*0.5, - (canvasH-textSize.y)*0.5 - )); - - dl->AddRectFilled( - ImGui::GetCursorPos(), - ImVec2( - ImGui::GetCursorPos().x+textSize.x, - ImGui::GetCursorPos().y+textSize.y - ), - ImGui::GetColorU32(ImGuiCol_PopupBg) - ); - - if (ImGui::BeginChild("TutText",textSize,true,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse)) { - ImGui::TextWrapped("%s",step.text); - - if (ImGui::Button("Skip")) { - tutorial.taken[curTutorial]=true; - curTutorial=-1; - curTutorialStep=0; - } - ImGui::SameLine(); - if (ImGui::Button(ICON_FA_CHEVRON_RIGHT)) { - curTutorialStep++; - if (step.runAfter!=NULL) step.runAfter(); - if (curTutorialStep>=(int)tutorials[curTutorial].steps.size()) { - tutorial.taken[curTutorial]=true; - curTutorial=-1; - curTutorialStep=0; - } else { - if (tutorials[curTutorial].steps[curTutorialStep].runBefore) tutorials[curTutorial].steps[curTutorialStep].runBefore(); - } - } - } - ImGui::EndChild(); - } - } - ImGui::End(); - } - if (cvOpen) { ImGui::SetNextWindowPos(ImVec2(0,0)); ImGui::SetNextWindowSize(ImVec2(canvasW,canvasH)); @@ -1271,11 +995,6 @@ void FurnaceGUI::highlightWindow(const char* winName) { } } -FurnaceGUITutorialDef::FurnaceGUITutorialDef(const char* n, std::initializer_list step): - name(n) { - steps=step; -} - // CV // 320x224