GUI: fix intro tune

smaller and fit animation to it
This commit is contained in:
tildearrow 2023-02-24 02:03:43 -05:00
parent 7525a07936
commit c164185601
4 changed files with 12177 additions and 38105 deletions

Binary file not shown.

View File

@ -1201,7 +1201,7 @@ void FurnaceGUI::valueInput(int num, bool direct, int target) {
} }
void FurnaceGUI::keyDown(SDL_Event& ev) { void FurnaceGUI::keyDown(SDL_Event& ev) {
if (introPos<9.0 && !shortIntro) return; if (introPos<11.0 && !shortIntro) return;
if (ImGuiFileDialog::Instance()->IsOpened()) return; if (ImGuiFileDialog::Instance()->IsOpened()) return;
if (aboutOpen) return; if (aboutOpen) return;
@ -2718,7 +2718,7 @@ int _processEvent(void* instance, SDL_Event* event) {
} }
int FurnaceGUI::processEvent(SDL_Event* ev) { int FurnaceGUI::processEvent(SDL_Event* ev) {
if (introPos<9.0 && !shortIntro) return 1; if (introPos<11.0 && !shortIntro) return 1;
#ifdef IS_MOBILE #ifdef IS_MOBILE
if (ev->type==SDL_APP_TERMINATING) { if (ev->type==SDL_APP_TERMINATING) {
// TODO: save last song state here // TODO: save last song state here
@ -2931,7 +2931,7 @@ void FurnaceGUI::pointDown(int x, int y, int button) {
bindSetTarget=0; bindSetTarget=0;
bindSetPrevValue=0; bindSetPrevValue=0;
} }
if (introPos<9.0 && !shortIntro) { if (introPos<11.0 && !shortIntro) {
introSkipDo=true; introSkipDo=true;
} }
} }
@ -2951,7 +2951,7 @@ void FurnaceGUI::pointUp(int x, int y, int button) {
macroDragLastY=-1; macroDragLastY=-1;
macroLoopDragActive=false; macroLoopDragActive=false;
waveDragActive=false; waveDragActive=false;
if (introPos<9.0 && introSkip<0.5 && !shortIntro) { if (introPos<11.0 && introSkip<0.5 && !shortIntro) {
introSkipDo=false; introSkipDo=false;
} }
if (sampleDragActive) { if (sampleDragActive) {
@ -4639,12 +4639,12 @@ bool FurnaceGUI::loop() {
} }
} }
if (warnQuit && introPos>=9.0) { if (warnQuit && introPos>=11.0) {
warnQuit=false; warnQuit=false;
ImGui::OpenPopup("Warning"); ImGui::OpenPopup("Warning");
} }
if (displayError && introPos>=9.0) { if (displayError && introPos>=11.0) {
displayError=false; displayError=false;
ImGui::OpenPopup("Error"); ImGui::OpenPopup("Error");
} }
@ -5217,7 +5217,7 @@ bool FurnaceGUI::loop() {
} }
drawIntro(introPos); drawIntro(introPos);
} else { } else {
introPos=10.0; introPos=12.0;
} }
layoutTimeEnd=SDL_GetPerformanceCounter(); layoutTimeEnd=SDL_GetPerformanceCounter();
@ -5678,7 +5678,7 @@ bool FurnaceGUI::init() {
// TODO: MIDI mapping time! // TODO: MIDI mapping time!
e->setMidiCallback([this](const TAMidiMessage& msg) -> int { e->setMidiCallback([this](const TAMidiMessage& msg) -> int {
if (introPos<9.0) return -2; if (introPos<11.0) return -2;
midiLock.lock(); midiLock.lock();
midiQueue.push(msg); midiQueue.push(msg);
midiLock.unlock(); midiLock.unlock();

View File

@ -100,11 +100,11 @@ void FurnaceGUI::endIntroTune() {
void FurnaceGUI::drawIntro(double introTime, bool monitor) { void FurnaceGUI::drawIntro(double introTime, bool monitor) {
if (monitor) { if (monitor) {
if (introTime<0.0) introTime=0.0; if (introTime<0.0) introTime=0.0;
if (introTime>9.0) introTime=9.0; if (introTime>11.0) introTime=11.0;
if (!introMonOpen) return; if (!introMonOpen) return;
if (introPos<(shortIntro?1.0:9.0)) return; if (introPos<(shortIntro?1.0:11.0)) return;
} }
if (introPos<(shortIntro?1.0:9.0) || monitor) { if (introPos<(shortIntro?1.0:11.0) || monitor) {
if (!monitor) { if (!monitor) {
WAKE_UP; WAKE_UP;
nextWindow=GUI_WINDOW_NOTHING; nextWindow=GUI_WINDOW_NOTHING;
@ -125,10 +125,10 @@ void FurnaceGUI::drawIntro(double introTime, bool monitor) {
play(); play();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextColored(ImVec4(1.0,introTime<8.0?1.0:0.0,introTime<8.0?1.0:0.0,1.0),"%.2f",introTime); ImGui::TextColored(ImVec4(1.0,introTime<10.0?1.0:0.0,introTime<10.0?1.0:0.0,1.0),"%.2f",introTime);
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
ImGui::ProgressBar(introTime/9.0,ImVec2(-FLT_MIN,0),"##IntroP"); ImGui::ProgressBar(introTime/11.0,ImVec2(-FLT_MIN,0),"##IntroP");
} }
ImDrawList* dl=monitor?ImGui::GetWindowDrawList():ImGui::GetForegroundDrawList(); ImDrawList* dl=monitor?ImGui::GetWindowDrawList():ImGui::GetForegroundDrawList();
@ -173,7 +173,7 @@ void FurnaceGUI::drawIntro(double introTime, bool monitor) {
if (introSkip<0.5 || monitor) { if (introSkip<0.5 || monitor) {
// background // background
float bgAlpha=CLAMP(9.0-introTime,0.0,1.0); float bgAlpha=CLAMP(11.0-introTime,0.0,1.0);
bgAlpha=3.0*pow(bgAlpha,2.0)-2.0*pow(bgAlpha,3.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)); ImU32 bgColor=ImGui::GetColorU32(ImVec4(0.0f,0.0f,0.0f,bgAlpha));
@ -292,7 +292,7 @@ void FurnaceGUI::drawIntro(double introTime, bool monitor) {
if (introSkip>=0.5) { if (introSkip>=0.5) {
if (e->isPlaying()) endIntroTune(); if (e->isPlaying()) endIntroTune();
introPos=0.1; introPos=0.1;
if (introSkip>=0.75) introPos=9.1; if (introSkip>=0.75) introPos=12.0;
} }
} else { } else {
introSkip-=ImGui::GetIO().DeltaTime*4.0f; introSkip-=ImGui::GetIO().DeltaTime*4.0f;
@ -317,10 +317,10 @@ void FurnaceGUI::drawIntro(double introTime, bool monitor) {
e->setRepeatPattern(false); e->setRepeatPattern(false);
play(); play();
} }
if (e->isPlaying() && introPos>=8.0 && !shortIntro) endIntroTune(); if (e->isPlaying() && introPos>=10.0 && !shortIntro) endIntroTune();
introPos+=ImGui::GetIO().DeltaTime; introPos+=ImGui::GetIO().DeltaTime;
if (introPos>=(shortIntro?1.0:9.0)) { if (introPos>=(shortIntro?1.0:11.0)) {
introPos=10.0; introPos=12.0;
tutorial.introPlayed=true; tutorial.introPlayed=true;
commitTutorial(); commitTutorial();
} }

File diff suppressed because it is too large Load Diff