|
|
@ -183,6 +183,7 @@ void VisualNovel::Update(){ |
|
|
|
} |
|
|
|
} |
|
|
|
locationDisplayTime=std::max(0.f,locationDisplayTime-game->GetElapsedTime()); |
|
|
|
locationDisplayTime=std::max(0.f,locationDisplayTime-game->GetElapsedTime()); |
|
|
|
transitionTime=std::max(0.f,transitionTime-game->GetElapsedTime()); |
|
|
|
transitionTime=std::max(0.f,transitionTime-game->GetElapsedTime()); |
|
|
|
|
|
|
|
textScrollTime=std::max(0.f,textScrollTime-game->GetElapsedTime()); |
|
|
|
} |
|
|
|
} |
|
|
|
void VisualNovel::ExecuteNextCommand(){ |
|
|
|
void VisualNovel::ExecuteNextCommand(){ |
|
|
|
if(commandIndex<commands.size()){ |
|
|
|
if(commandIndex<commands.size()){ |
|
|
@ -235,10 +236,17 @@ void VisualNovel::Draw(){ |
|
|
|
Menu::DrawThemedWindow(nameDisplayPos,nameDisplayWindowSize); |
|
|
|
Menu::DrawThemedWindow(nameDisplayPos,nameDisplayWindowSize); |
|
|
|
} |
|
|
|
} |
|
|
|
vf2d dialogDisplayPos={24.f,game->GetScreenSize().y-48.f}; |
|
|
|
vf2d dialogDisplayPos={24.f,game->GetScreenSize().y-48.f}; |
|
|
|
Menu::DrawThemedWindow(dialogDisplayPos,{game->GetScreenSize().x-48.f,20.f}); |
|
|
|
vf2d dialogDisplaySize={game->GetScreenSize().x-48.f,20.f}; |
|
|
|
|
|
|
|
Menu::DrawThemedWindow(dialogDisplayPos,dialogDisplaySize); |
|
|
|
vf2d speakerTextSize=game->GetTextSizeProp(speakerDisplayName); |
|
|
|
vf2d speakerTextSize=game->GetTextSizeProp(speakerDisplayName); |
|
|
|
game->DrawShadowStringPropDecal(nameDisplayPos-vf2d{10,8}+(nameDisplayWindowSize+vf2d{24,0})/2-speakerTextSize/2,speakerDisplayName); |
|
|
|
game->DrawShadowStringPropDecal(nameDisplayPos-vf2d{10,8}+(nameDisplayWindowSize+vf2d{24,0})/2-speakerTextSize/2,speakerDisplayName); |
|
|
|
game->DrawShadowStringPropDecal(dialogDisplayPos-vf2d{10,10},activeText); |
|
|
|
game->DrawShadowStringPropDecal(dialogDisplayPos-vf2d{10,10},activeText); |
|
|
|
|
|
|
|
float yOffset=util::lerp(dialogDisplaySize.y+12,-8,textScrollTime/maxTextScrollTime); |
|
|
|
|
|
|
|
game->DrawPolygonDecal( |
|
|
|
|
|
|
|
Menu::GetPatchPart(1,1).Decal(), |
|
|
|
|
|
|
|
{dialogDisplayPos-vf2d{12,-yOffset},dialogDisplayPos+vf2d{-12,dialogDisplaySize.y+12},dialogDisplayPos+dialogDisplaySize+vf2d{12,12},dialogDisplayPos+vf2d{dialogDisplaySize.x+12,yOffset}}, |
|
|
|
|
|
|
|
{{0,0},{0,1},{1,1},{1,0}}, |
|
|
|
|
|
|
|
{{255,255,255,240},{255,255,255,255},{255,255,255,255},{255,255,255,240}}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
std::string VisualNovel::GetCharacterImage(std::string name){ |
|
|
|
std::string VisualNovel::GetCharacterImage(std::string name){ |
|
|
@ -299,6 +307,7 @@ SpeakerCommand::SpeakerCommand(std::string displayedName,std::string speaker) |
|
|
|
CommandType::CommandType SpeakerCommand::GetType(){return CommandType::SPEAKER;} |
|
|
|
CommandType::CommandType SpeakerCommand::GetType(){return CommandType::SPEAKER;} |
|
|
|
|
|
|
|
|
|
|
|
void DialogCommand::Execute(VisualNovel&vn){ |
|
|
|
void DialogCommand::Execute(VisualNovel&vn){ |
|
|
|
|
|
|
|
vn.textScrollTime=VisualNovel::maxTextScrollTime; |
|
|
|
bool mustDisplay=vn.activeText.length()==0; |
|
|
|
bool mustDisplay=vn.activeText.length()==0; |
|
|
|
std::string newText=util::WrapText(game,vn.activeText+(vn.activeText.length()>0?" ":"")+dialog,game->GetScreenSize().x-48,true,{1,1}); |
|
|
|
std::string newText=util::WrapText(game,vn.activeText+(vn.activeText.length()>0?" ":"")+dialog,game->GetScreenSize().x-48,true,{1,1}); |
|
|
|
if(game->GetTextSizeProp(newText).y>40){//Hit the maximum of 3 lines.
|
|
|
|
if(game->GetTextSizeProp(newText).y>40){//Hit the maximum of 3 lines.
|
|
|
|