mirror of
https://github.com/tildearrow/furnace.git
synced 2025-01-03 06:01:29 +00:00
GUI: intro is ready for review
This commit is contained in:
parent
3de621796e
commit
61beb8c4df
6 changed files with 224 additions and 117 deletions
|
@ -640,6 +640,7 @@ src/gui/sysConf.cpp
|
|||
src/gui/sysEx.cpp
|
||||
src/gui/sysManager.cpp
|
||||
src/gui/sysPicker.cpp
|
||||
src/gui/tutorial.cpp
|
||||
src/gui/util.cpp
|
||||
src/gui/waveEdit.cpp
|
||||
src/gui/volMeter.cpp
|
||||
|
|
|
@ -542,6 +542,7 @@ void FurnaceGUI::setFileName(String name) {
|
|||
#endif
|
||||
updateWindowTitle();
|
||||
pushRecentFile(curFileName);
|
||||
if (settings.alwaysPlayIntro==2) shortIntro=true;
|
||||
}
|
||||
|
||||
void FurnaceGUI::updateWindowTitle() {
|
||||
|
@ -2927,6 +2928,9 @@ void FurnaceGUI::pointDown(int x, int y, int button) {
|
|||
bindSetTarget=0;
|
||||
bindSetPrevValue=0;
|
||||
}
|
||||
if (introPos<9.0) {
|
||||
introSkipDo=true;
|
||||
}
|
||||
}
|
||||
|
||||
void FurnaceGUI::pointUp(int x, int y, int button) {
|
||||
|
@ -2944,6 +2948,9 @@ void FurnaceGUI::pointUp(int x, int y, int button) {
|
|||
macroDragLastY=-1;
|
||||
macroLoopDragActive=false;
|
||||
waveDragActive=false;
|
||||
if (introPos<9.0 && introSkip<0.5) {
|
||||
introSkipDo=false;
|
||||
}
|
||||
if (sampleDragActive) {
|
||||
logD("stopping sample drag");
|
||||
if (sampleDragMode) {
|
||||
|
@ -5181,9 +5188,14 @@ bool FurnaceGUI::loop() {
|
|||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
if (!tutorial.introPlayed) {
|
||||
if (!tutorial.introPlayed || settings.alwaysPlayIntro!=0) {
|
||||
initialScreenWipe=0;
|
||||
if (settings.alwaysPlayIntro==1) {
|
||||
shortIntro=true;
|
||||
}
|
||||
drawIntro();
|
||||
} else {
|
||||
introPos=10.0;
|
||||
}
|
||||
|
||||
layoutTimeEnd=SDL_GetPerformanceCounter();
|
||||
|
@ -5243,7 +5255,7 @@ bool FurnaceGUI::loop() {
|
|||
initialScreenWipe-=ImGui::GetIO().DeltaTime*5.0f;
|
||||
if (initialScreenWipe>0.0f) {
|
||||
SDL_SetRenderDrawBlendMode(sdlRend,SDL_BLENDMODE_BLEND);
|
||||
SDL_SetRenderDrawColor(sdlRend,0,0,0,255*initialScreenWipe);
|
||||
SDL_SetRenderDrawColor(sdlRend,0,0,0,255*pow(initialScreenWipe,2.0f));
|
||||
SDL_RenderFillRect(sdlRend,NULL);
|
||||
}
|
||||
}
|
||||
|
@ -5399,6 +5411,7 @@ bool FurnaceGUI::init() {
|
|||
chanOscGrad.render();
|
||||
|
||||
syncSettings();
|
||||
syncTutorial();
|
||||
|
||||
if (!settings.persistFadeOut) {
|
||||
exportLoops=settings.exportLoops;
|
||||
|
@ -6239,8 +6252,10 @@ FurnaceGUI::FurnaceGUI():
|
|||
waveGenAmplify(1.0f),
|
||||
waveGenFM(false),
|
||||
introPos(0.0),
|
||||
introSkip(0.0),
|
||||
mustClear(2),
|
||||
initialScreenWipe(1.0f) {
|
||||
initialScreenWipe(1.0f),
|
||||
introSkipDo(false) {
|
||||
// value keys
|
||||
valueKeys[SDLK_0]=0;
|
||||
valueKeys[SDLK_1]=1;
|
||||
|
|
|
@ -1340,6 +1340,7 @@ class FurnaceGUI {
|
|||
float doubleClickTime;
|
||||
int oneDigitEffects;
|
||||
int disableFadeIn;
|
||||
int alwaysPlayIntro;
|
||||
unsigned int maxUndoSteps;
|
||||
String mainFontPath;
|
||||
String patFontPath;
|
||||
|
@ -1478,6 +1479,7 @@ class FurnaceGUI {
|
|||
doubleClickTime(0.3f),
|
||||
oneDigitEffects(0),
|
||||
disableFadeIn(0),
|
||||
alwaysPlayIntro(0),
|
||||
maxUndoSteps(100),
|
||||
mainFontPath(""),
|
||||
patFontPath(""),
|
||||
|
@ -1524,7 +1526,7 @@ class FurnaceGUI {
|
|||
bool subSongsOpen, findOpen, spoilerOpen, patManagerOpen, sysManagerOpen, clockOpen, speedOpen;
|
||||
bool groovesOpen;
|
||||
|
||||
bool basicMode;
|
||||
bool basicMode, shortIntro;
|
||||
|
||||
bool clockShowReal, clockShowRow, clockShowBeat, clockShowMetro, clockShowTime;
|
||||
float clockMetroTick[16];
|
||||
|
@ -1834,8 +1836,10 @@ class FurnaceGUI {
|
|||
|
||||
// intro
|
||||
double introPos;
|
||||
double introSkip;
|
||||
int mustClear;
|
||||
float initialScreenWipe;
|
||||
bool introSkipDo;
|
||||
|
||||
void drawSSGEnv(unsigned char type, const ImVec2& size);
|
||||
void drawWaveform(unsigned char type, bool opz, const ImVec2& size);
|
||||
|
@ -1946,6 +1950,8 @@ class FurnaceGUI {
|
|||
|
||||
void syncSettings();
|
||||
void commitSettings();
|
||||
void syncTutorial();
|
||||
void commitTutorial();
|
||||
void commitState();
|
||||
void processDrags(int dragX, int dragY);
|
||||
void processPoint(SDL_Event& ev);
|
||||
|
|
|
@ -71,7 +71,7 @@ void FurnaceGUI::drawImage(ImDrawList* dl, FurnaceGUIImages image, const ImVec2&
|
|||
}
|
||||
|
||||
void FurnaceGUI::drawIntro() {
|
||||
if (introPos<9.0) {
|
||||
if (introPos<(shortIntro?1.0:9.0)) {
|
||||
WAKE_UP;
|
||||
nextWindow=GUI_WINDOW_NOTHING;
|
||||
ImGui::SetNextWindowPos(ImVec2(0,0));
|
||||
|
@ -82,131 +82,167 @@ void FurnaceGUI::drawIntro() {
|
|||
ImVec2 top=ImVec2(0.0f,0.0f);
|
||||
ImVec2 bottom=ImVec2(canvasW,canvasH);
|
||||
|
||||
// preload textures
|
||||
getTexture(GUI_IMAGE_TALOGO);
|
||||
getTexture(GUI_IMAGE_TACHIP);
|
||||
getTexture(GUI_IMAGE_LOGO);
|
||||
getTexture(GUI_IMAGE_INTROBG,SDL_BLENDMODE_ADD);
|
||||
if (shortIntro) {
|
||||
// background
|
||||
float bgAlpha=CLAMP((1.0-introPos)*4.0,0.0,1.0);
|
||||
bgAlpha=3.0*pow(bgAlpha,2.0)-2.0*pow(bgAlpha,3.0);
|
||||
ImU32 bgColor=ImGui::GetColorU32(ImVec4(0.0f,0.0f,0.0f,bgAlpha));
|
||||
|
||||
// background
|
||||
float bgAlpha=CLAMP(9.0-introPos,0.0,1.0);
|
||||
bgAlpha=3.0*pow(bgAlpha,2.0)-2.0*pow(bgAlpha,3.0);
|
||||
ImU32 bgColor=ImGui::GetColorU32(ImVec4(0.0f,0.0f,0.0f,bgAlpha));
|
||||
dl->AddRectFilled(top,bottom,bgColor);
|
||||
|
||||
dl->AddRectFilled(top,bottom,bgColor);
|
||||
drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.125,0.25-(introPos)*0.05),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.4,0.8,1.0,0.4*CLAMP(introPos*2.0,0.0,1.0)*bgAlpha));
|
||||
drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.4,0.25-(introPos)*0.08),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.1,0.2,1.0,0.2*CLAMP(introPos*3.0,0.0,1.0)*bgAlpha));
|
||||
drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.7,0.25-(introPos)*0.03),ImVec2(20.0,20.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.7,1.0,0.7,0.1*CLAMP(introPos*3.0,0.0,1.0)*bgAlpha));
|
||||
|
||||
// part 1 - talogo
|
||||
if (introPos<2.3) {
|
||||
drawImage(dl,GUI_IMAGE_TALOGO,ImVec2(0.5,0.5),ImVec2(0.7,0.7),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(1.0,1.0,1.0,MAX(0.01,1.0-pow(MAX(0.0,1.0-introPos*2.0),3.0))));
|
||||
drawImage(dl,GUI_IMAGE_LOGO,ImVec2(0.5,0.5+pow(1.0-CLAMP(introPos*2.0,0.0,1.0),4.0)*0.125),ImVec2(0.67,0.67),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(1.0,1.0,1.0,CLAMP(introPos*3.0,0.0,1.0)*bgAlpha));
|
||||
} else {
|
||||
// preload textures
|
||||
getTexture(GUI_IMAGE_TALOGO);
|
||||
getTexture(GUI_IMAGE_TACHIP);
|
||||
getTexture(GUI_IMAGE_LOGO);
|
||||
getTexture(GUI_IMAGE_INTROBG,SDL_BLENDMODE_ADD);
|
||||
|
||||
for (int i=0; i<16; i++) {
|
||||
double chipCenter=0.25+pow(MAX(0.0,1.5-introPos*0.8-((double)i/36.0)),2.0)+pow(sin(-introPos*2.2-(double)i*0.44),24)*0.05;
|
||||
ImVec2 chipPos=ImVec2(
|
||||
0.5+chipCenter*cos(2.0*M_PI*(double)i/16.0-pow(introPos,2.2)),
|
||||
0.5+chipCenter*sin(2.0*M_PI*(double)i/16.0-pow(introPos,2.2))
|
||||
if (introSkip<0.5) {
|
||||
// background
|
||||
float bgAlpha=CLAMP(9.0-introPos,0.0,1.0);
|
||||
bgAlpha=3.0*pow(bgAlpha,2.0)-2.0*pow(bgAlpha,3.0);
|
||||
ImU32 bgColor=ImGui::GetColorU32(ImVec4(0.0f,0.0f,0.0f,bgAlpha));
|
||||
|
||||
dl->AddRectFilled(top,bottom,bgColor);
|
||||
|
||||
// part 1 - talogo
|
||||
if (introPos<2.3) {
|
||||
drawImage(dl,GUI_IMAGE_TALOGO,ImVec2(0.5,0.5),ImVec2(0.7,0.7),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(1.0,1.0,1.0,MAX(0.01,1.0-pow(MAX(0.0,1.0-introPos*2.0),3.0))));
|
||||
|
||||
for (int i=0; i<16; i++) {
|
||||
double chipCenter=0.25+pow(MAX(0.0,1.5-introPos*0.8-((double)i/36.0)),2.0)+pow(sin(-introPos*2.2-(double)i*0.44),24)*0.05;
|
||||
ImVec2 chipPos=ImVec2(
|
||||
0.5+chipCenter*cos(2.0*M_PI*(double)i/16.0-pow(introPos,2.2)),
|
||||
0.5+chipCenter*sin(2.0*M_PI*(double)i/16.0-pow(introPos,2.2))
|
||||
);
|
||||
drawImage(dl,GUI_IMAGE_TACHIP,chipPos,ImVec2(0.25,0.25),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,0.5),ImVec4(1.0,1.0,1.0,1.0));
|
||||
}
|
||||
}
|
||||
|
||||
// background after part 1
|
||||
if (introPos>2.3) {
|
||||
float s1a=CLAMP((introPos-3.2)*1.3,0.0f,1.0f);
|
||||
float s2a=CLAMP((introPos-4.5)*1.0,0.0f,1.0f);
|
||||
float addition=(3*pow(s1a,2)-2*pow(s1a,3)+(3*pow(s2a,2)-2*pow(s2a,3))*1.5)*3.5;
|
||||
drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.125,0.25-(introPos+addition)*0.05),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.4,0.1+0.7*s1a,1.0*s1a,0.5*bgAlpha));
|
||||
drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.4,0.25-(introPos+addition)*0.08),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.5-0.4*s1a,0.8-0.6*s1a,1.0*s1a,0.6*bgAlpha));
|
||||
drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.7,0.25-(introPos+addition)*0.03),ImVec2(20.0,20.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.4+0.3*s1a,1.0,0.7,(0.5-0.4*s1a)*bgAlpha));
|
||||
}
|
||||
|
||||
const double fallPatX[]={
|
||||
0.0,
|
||||
272.0,
|
||||
470.0,
|
||||
742.0,
|
||||
1013.0
|
||||
};
|
||||
|
||||
// part 2 - falling patterns
|
||||
if (introPos>2.3 && introPos<4.5) {
|
||||
for (int i=0; i<48; i++) {
|
||||
ImVec2 uv0=ImVec2(
|
||||
fallPatX[i&3],
|
||||
(double)(i>>2)*36.0
|
||||
);
|
||||
ImVec2 uv1=ImVec2(
|
||||
fallPatX[1+(i&3)]-2.0,
|
||||
uv0.y+36.0
|
||||
);
|
||||
uv0.x/=1024.0;
|
||||
uv0.y/=512.0;
|
||||
uv1.x/=1024.0;
|
||||
uv1.y/=512.0;
|
||||
|
||||
bool left=(i%6)>=3;
|
||||
double t=(introPos-2.5)*(0.77+(cos(i+7)*0.05));
|
||||
double alteration=pow(t,0.4)-(0.55*t)+0.55*pow(t,6.0);
|
||||
|
||||
drawImage(dl,GUI_IMAGE_PAT,ImVec2((left?0:1)+sin(cos(i*3.67))*0.35+((alteration+((introPos-2.3)*(0.08*(double)(1+(i&3)))))*(left?1.0:-1.0)),0.5+sin(i*6.74)*0.3-pow(CLAMP(introPos-3.0,0.0,1.0),4.0)*1.5),ImVec2(1.5,1.5),0.0f,uv0,uv1,ImVec4(1.0,1.0,1.0,1.0));
|
||||
}
|
||||
}
|
||||
|
||||
// transition
|
||||
float transitionPos=CLAMP(introPos*4.0-8,-1.5,3.5);
|
||||
dl->AddQuadFilled(
|
||||
ImVec2(
|
||||
(transitionPos-1.5)*canvasW,
|
||||
0.0
|
||||
),
|
||||
ImVec2(
|
||||
(transitionPos)*canvasW,
|
||||
0.0
|
||||
),
|
||||
ImVec2(
|
||||
(transitionPos-0.2)*canvasW,
|
||||
canvasH
|
||||
),
|
||||
ImVec2(
|
||||
(transitionPos-1.7)*canvasW,
|
||||
canvasH
|
||||
),
|
||||
ImGui::GetColorU32(ImVec4(0.35,0.4,0.5,1.0))
|
||||
);
|
||||
drawImage(dl,GUI_IMAGE_TACHIP,chipPos,ImVec2(0.25,0.25),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,0.5),ImVec4(1.0,1.0,1.0,1.0));
|
||||
|
||||
// part 3 - falling chips
|
||||
if (introPos>3.0 && introPos<6.0) {
|
||||
for (int i=0; i<40; i++) {
|
||||
float blah=(introPos-4.25)*1.3;
|
||||
ImVec2 chipPos=ImVec2(
|
||||
0.5+sin(i)*0.4,
|
||||
0.1-(1.1*pow(blah,2.0)-1.3*pow(blah,2.0)+pow(blah,5.0))+i*0.02+((introPos-3.75)*1.3*(fabs(sin(i*1.3))*0.28))
|
||||
);
|
||||
drawImage(dl,GUI_IMAGE_TACHIP,chipPos,ImVec2(0.33,0.33),0.5*M_PI,ImVec2(0.0,0.0),ImVec2(1.0,0.5),ImVec4(1.0,1.0,1.0,1.0));
|
||||
}
|
||||
}
|
||||
|
||||
// part 4 - logo end
|
||||
if (introPos>5.0) {
|
||||
drawImage(
|
||||
dl,
|
||||
GUI_IMAGE_WORDMARK,
|
||||
ImVec2(0.36+0.3*(1.0-pow(1.0-CLAMP(introPos-6.0,0.0,1.0),6.0)),0.5+pow(1.0-CLAMP(introPos-5.0,0.0,1.0),4.0)),
|
||||
ImVec2(1.0,1.0),
|
||||
0.0f,
|
||||
ImVec2(pow(1.0-CLAMP(introPos-6.0,0.0,1.0),8.0),0.0),
|
||||
ImVec2(1.0,1.0),
|
||||
ImVec4(1.0,1.0,1.0,bgAlpha)
|
||||
);
|
||||
drawImage(dl,GUI_IMAGE_LOGO,ImVec2(0.5-0.25*(1.0-pow(1.0-CLAMP(introPos-6.0,0.0,1.0),6.0)),0.5+pow(1.0-CLAMP(introPos-5.0,0.0,1.0),4.0)),ImVec2(0.67,0.67),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(1.0,1.0,1.0,bgAlpha));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// background after part 1
|
||||
if (introPos>2.3) {
|
||||
float s1a=CLAMP((introPos-3.2)*1.3,0.0f,1.0f);
|
||||
float s2a=CLAMP((introPos-4.5)*1.0,0.0f,1.0f);
|
||||
float addition=(3*pow(s1a,2)-2*pow(s1a,3)+(3*pow(s2a,2)-2*pow(s2a,3))*1.5)*3.5;
|
||||
drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.125,0.25-(introPos+addition)*0.05),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.4,0.1+0.7*s1a,1.0*s1a,0.5*bgAlpha));
|
||||
drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.4,0.25-(introPos+addition)*0.08),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.5-0.4*s1a,0.8-0.6*s1a,1.0*s1a,0.6*bgAlpha));
|
||||
drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.7,0.25-(introPos+addition)*0.03),ImVec2(20.0,20.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.4+0.3*s1a,1.0,0.7,(0.5-0.4*s1a)*bgAlpha));
|
||||
}
|
||||
|
||||
const double fallPatX[]={
|
||||
0.0,
|
||||
272.0,
|
||||
470.0,
|
||||
742.0,
|
||||
1013.0
|
||||
};
|
||||
|
||||
// part 2 - falling patterns
|
||||
if (introPos>2.3 && introPos<4.5) {
|
||||
for (int i=0; i<48; i++) {
|
||||
ImVec2 uv0=ImVec2(
|
||||
fallPatX[i&3],
|
||||
(double)(i>>2)*36.0
|
||||
);
|
||||
ImVec2 uv1=ImVec2(
|
||||
fallPatX[1+(i&3)]-2.0,
|
||||
uv0.y+36.0
|
||||
);
|
||||
uv0.x/=1024.0;
|
||||
uv0.y/=512.0;
|
||||
uv1.x/=1024.0;
|
||||
uv1.y/=512.0;
|
||||
|
||||
bool left=(i%6)>=3;
|
||||
double t=(introPos-2.5)*(0.77+(cos(i+7)*0.05));
|
||||
double alteration=pow(t,0.4)-(0.55*t)+0.55*pow(t,6.0);
|
||||
|
||||
drawImage(dl,GUI_IMAGE_PAT,ImVec2((left?0:1)+sin(cos(i*3.67))*0.35+((alteration+((introPos-2.3)*(0.08*(double)(1+(i&3)))))*(left?1.0:-1.0)),0.5+sin(i*6.74)*0.3-pow(CLAMP(introPos-3.0,0.0,1.0),4.0)*1.5),ImVec2(1.5,1.5),0.0f,uv0,uv1,ImVec4(1.0,1.0,1.0,1.0));
|
||||
// intro skip fade
|
||||
if (introSkipDo) {
|
||||
introSkip+=ImGui::GetIO().DeltaTime;
|
||||
if (introSkip>=0.5) {
|
||||
introPos=0.1;
|
||||
if (introSkip>=0.75) introPos=9.1;
|
||||
}
|
||||
} else {
|
||||
introSkip-=ImGui::GetIO().DeltaTime*4.0f;
|
||||
if (introSkip<0.0) introSkip=0.0;
|
||||
}
|
||||
|
||||
dl->AddRectFilled(top,bottom,ImGui::GetColorU32(ImVec4(0.0,0.0,0.0,CLAMP(introSkip*2.0,0.0,1.0)-CLAMP((introSkip-0.5)*4,0.0,1.0))));
|
||||
if (introSkip<0.5) dl->AddText(ImVec2(8.0*dpiScale,8.0*dpiScale),ImGui::GetColorU32(ImVec4(1.0,1.0,1.0,CLAMP(introSkip*8.0,0.0,1.0))),"hold to skip");
|
||||
}
|
||||
|
||||
|
||||
// transition
|
||||
float transitionPos=CLAMP(introPos*4.0-8,-1.5,3.5);
|
||||
dl->AddQuadFilled(
|
||||
ImVec2(
|
||||
(transitionPos-1.5)*canvasW,
|
||||
0.0
|
||||
),
|
||||
ImVec2(
|
||||
(transitionPos)*canvasW,
|
||||
0.0
|
||||
),
|
||||
ImVec2(
|
||||
(transitionPos-0.2)*canvasW,
|
||||
canvasH
|
||||
),
|
||||
ImVec2(
|
||||
(transitionPos-1.7)*canvasW,
|
||||
canvasH
|
||||
),
|
||||
ImGui::GetColorU32(ImVec4(0.35,0.4,0.5,1.0))
|
||||
);
|
||||
|
||||
// part 3 - falling chips
|
||||
if (introPos>3.0) {
|
||||
for (int i=0; i<40; i++) {
|
||||
float blah=(introPos-4.25)*1.3;
|
||||
ImVec2 chipPos=ImVec2(
|
||||
0.5+sin(i)*0.4,
|
||||
0.1-(1.1*pow(blah,2.0)-1.3*pow(blah,2.0)+pow(blah,5.0))+i*0.02+((introPos-3.75)*1.3*(fabs(sin(i*1.3))*0.28))
|
||||
);
|
||||
drawImage(dl,GUI_IMAGE_TACHIP,chipPos,ImVec2(0.33,0.33),0.5*M_PI,ImVec2(0.0,0.0),ImVec2(1.0,0.5),ImVec4(1.0,1.0,1.0,1.0));
|
||||
}
|
||||
}
|
||||
|
||||
// part 4 - logo end
|
||||
if (introPos>5.0) {
|
||||
drawImage(
|
||||
dl,
|
||||
GUI_IMAGE_WORDMARK,
|
||||
ImVec2(0.36+0.3*(1.0-pow(1.0-CLAMP(introPos-6.0,0.0,1.0),6.0)),0.5+pow(1.0-CLAMP(introPos-5.0,0.0,1.0),4.0)),
|
||||
ImVec2(1.0,1.0),
|
||||
0.0f,
|
||||
ImVec2(pow(1.0-CLAMP(introPos-6.0,0.0,1.0),8.0),0.0),
|
||||
ImVec2(1.0,1.0),
|
||||
ImVec4(1.0,1.0,1.0,bgAlpha)
|
||||
);
|
||||
drawImage(dl,GUI_IMAGE_LOGO,ImVec2(0.5-0.25*(1.0-pow(1.0-CLAMP(introPos-6.0,0.0,1.0),6.0)),0.5+pow(1.0-CLAMP(introPos-5.0,0.0,1.0),4.0)),ImVec2(0.67,0.67),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(1.0,1.0,1.0,bgAlpha));
|
||||
}
|
||||
|
||||
dl->AddText(top,ImGui::GetColorU32(ImVec4(1.0f,1.0f,1.0f,bgAlpha)),"Furnace intro - work in progress");
|
||||
// workaround to texture issue
|
||||
dl->AddText(ImVec2(canvasW-1,canvasH-1),ImGui::ColorConvertFloat4ToU32(ImVec4(0.0,0.0,0.1,0.01)),"A");
|
||||
}
|
||||
ImGui::End();
|
||||
|
||||
if (mustClear<=0) {
|
||||
introPos+=ImGui::GetIO().DeltaTime;
|
||||
if (introPos>=9.0) {
|
||||
tutorial.introPlayed=true;
|
||||
commitTutorial();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -492,6 +492,22 @@ void FurnaceGUI::drawSettings() {
|
|||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::Text("Play intro on start-up:");
|
||||
if (ImGui::RadioButton("No##pis0",settings.alwaysPlayIntro==0)) {
|
||||
settings.alwaysPlayIntro=0;
|
||||
}
|
||||
if (ImGui::RadioButton("Short##pis1",settings.alwaysPlayIntro==1)) {
|
||||
settings.alwaysPlayIntro=1;
|
||||
}
|
||||
if (ImGui::RadioButton("Full (short when loading song)##pis2",settings.alwaysPlayIntro==2)) {
|
||||
settings.alwaysPlayIntro=2;
|
||||
}
|
||||
if (ImGui::RadioButton("Full (always)##pis3",settings.alwaysPlayIntro==3)) {
|
||||
settings.alwaysPlayIntro=3;
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
if (CWSliderFloat("Double-click time (seconds)",&settings.doubleClickTime,0.02,1.0,"%.2f")) {
|
||||
if (settings.doubleClickTime<0.02) settings.doubleClickTime=0.02;
|
||||
if (settings.doubleClickTime>1.0) settings.doubleClickTime=1.0;
|
||||
|
@ -622,7 +638,7 @@ void FurnaceGUI::drawSettings() {
|
|||
settings.saveWindowPos=saveWindowPosB;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("remembers the window's last position on startup.");
|
||||
ImGui::SetTooltip("remembers the window's last position on start-up.");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1681,7 +1697,7 @@ void FurnaceGUI::drawSettings() {
|
|||
}
|
||||
|
||||
bool disableFadeInB=settings.disableFadeIn;
|
||||
if (ImGui::Checkbox("Disable fade-in during startup",&disableFadeInB)) {
|
||||
if (ImGui::Checkbox("Disable fade-in during start-up",&disableFadeInB)) {
|
||||
settings.disableFadeIn=disableFadeInB;
|
||||
}
|
||||
|
||||
|
@ -2592,6 +2608,7 @@ void FurnaceGUI::syncSettings() {
|
|||
settings.doubleClickTime=e->getConfFloat("doubleClickTime",0.3f);
|
||||
settings.oneDigitEffects=e->getConfInt("oneDigitEffects",0);
|
||||
settings.disableFadeIn=e->getConfInt("disableFadeIn",0);
|
||||
settings.alwaysPlayIntro=e->getConfInt("alwaysPlayIntro",0);
|
||||
|
||||
clampSetting(settings.mainFontSize,2,96);
|
||||
clampSetting(settings.patFontSize,2,96);
|
||||
|
@ -2705,6 +2722,7 @@ void FurnaceGUI::syncSettings() {
|
|||
clampSetting(settings.doubleClickTime,0.02,1.0);
|
||||
clampSetting(settings.oneDigitEffects,0,1);
|
||||
clampSetting(settings.disableFadeIn,0,1);
|
||||
clampSetting(settings.alwaysPlayIntro,0,3);
|
||||
|
||||
if (settings.exportLoops<0.0) settings.exportLoops=0.0;
|
||||
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
|
||||
|
@ -2912,6 +2930,7 @@ void FurnaceGUI::commitSettings() {
|
|||
e->setConf("doubleClickTime",settings.doubleClickTime);
|
||||
e->setConf("oneDigitEffects",settings.oneDigitEffects);
|
||||
e->setConf("disableFadeIn",settings.disableFadeIn);
|
||||
e->setConf("alwaysPlayIntro",settings.alwaysPlayIntro);
|
||||
|
||||
// colors
|
||||
for (int i=0; i<GUI_COLOR_MAX; i++) {
|
||||
|
|
30
src/gui/tutorial.cpp
Normal file
30
src/gui/tutorial.cpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* 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"
|
||||
|
||||
void FurnaceGUI::syncTutorial() {
|
||||
tutorial.userComesFrom=e->getConfInt("tutUserComesFrom",0);
|
||||
tutorial.introPlayed=e->getConfBool("tutIntroPlayed",false);
|
||||
}
|
||||
|
||||
void FurnaceGUI::commitTutorial() {
|
||||
e->setConf("tutUserComesFrom",tutorial.userComesFrom);
|
||||
e->setConf("tutIntroPlayed",tutorial.introPlayed);
|
||||
}
|
Loading…
Reference in a new issue