GUI: experiments

This commit is contained in:
tildearrow 2023-02-15 16:25:35 -05:00
parent 10e4c2106a
commit 7d191b3db9
4 changed files with 55 additions and 3 deletions

View file

@ -604,6 +604,7 @@ src/gui/findReplace.cpp
src/gui/gradient.cpp
src/gui/grooves.cpp
src/gui/insEdit.cpp
src/gui/intro.cpp
src/gui/log.cpp
src/gui/mixer.cpp
src/gui/midiMap.cpp
@ -645,7 +646,7 @@ if (APPLE)
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_cocoa.mm)
endif()
if (NOT WIN32 AND NOT APPLE)
if (NOT APPLE)
list(APPEND GUI_SOURCES src/gui/icon.c)
CHECK_INCLUDE_FILE(sys/io.h SYS_IO_FOUND)

View file

@ -5182,6 +5182,10 @@ bool FurnaceGUI::loop() {
ImGui::EndPopup();
}
if (!tutorial.introPlayed) {
drawIntro();
}
layoutTimeEnd=SDL_GetPerformanceCounter();
// backup trigger
@ -6214,7 +6218,8 @@ FurnaceGUI::FurnaceGUI():
waveGenOffsetY(0),
waveGenSmooth(1),
waveGenAmplify(1.0f),
waveGenFM(false) {
waveGenFM(false),
introPos(0.0) {
// value keys
valueKeys[SDLK_0]=0;
valueKeys[SDLK_1]=1;

View file

@ -1473,7 +1473,7 @@ class FurnaceGUI {
bool taken[GUI_TUTORIAL_MAX];
Tutorial():
userComesFrom(0),
introPlayed(0) {
introPlayed(false) {
memset(taken,0,GUI_TUTORIAL_MAX*sizeof(bool));
}
} tutorial;
@ -1803,6 +1803,9 @@ class FurnaceGUI {
bool waveGenFMCon4[5];
bool waveGenFM;
// intro
double introPos;
void drawSSGEnv(unsigned char type, const ImVec2& size);
void drawWaveform(unsigned char type, bool opz, const ImVec2& size);
void drawAlgorithm(unsigned char alg, FurnaceGUIFMAlgs algType, const ImVec2& size);
@ -1879,6 +1882,7 @@ class FurnaceGUI {
void drawSysManager();
void drawRegView();
void drawAbout();
void drawIntro();
void drawSettings();
void drawDebug();
void drawNewSong();

42
src/gui/intro.cpp Normal file
View file

@ -0,0 +1,42 @@
/**
* Furnace Tracker - multi-system chiptune tracker
* Copyright (C) 2021-2023 tildearrow and contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "gui.h"
#include "imgui_internal.h"
void FurnaceGUI::drawIntro() {
if (introPos<7.0) {
WAKE_UP;
nextWindow=GUI_WINDOW_NOTHING;
introPos+=ImGui::GetIO().DeltaTime;
ImGui::SetNextWindowPos(ImVec2(0,0));
ImGui::SetNextWindowSize(ImVec2(canvasW,canvasH));
if (ImGui::Begin("Intro",NULL,ImGuiWindowFlags_Modal)) {
ImDrawList* dl=ImGui::GetForegroundDrawList();
ImVec2 top=ImVec2(0.0f,0.0f);
ImVec2 bottom=ImVec2(canvasW,canvasH);
ImU32 bgColor=ImGui::GetColorU32(ImVec4(0.0f,0.0f,0.0f,1.0f));
dl->AddRectFilled(top,bottom,bgColor);
dl->AddText(top,0xffffffff,"Furnace intro");
}
ImGui::End();
}
}