Add mosaic transitions from overworld to stages. Fix up Visual Novel placeholder text for player name. Release Build 7690.

mac-build
sigonasr2 9 months ago
parent e205fe9806
commit 3e9817060e
  1. 5
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 1
      Adventures in Lestoria/AdventuresInLestoria.h
  3. 3
      Adventures in Lestoria/GameState.cpp
  4. 2
      Adventures in Lestoria/GameState.h
  5. 4
      Adventures in Lestoria/State_OverworldMap.cpp
  6. 2
      Adventures in Lestoria/TODO.txt
  7. 2
      Adventures in Lestoria/Version.h
  8. 39
      Adventures in Lestoria/VisualNovel.cpp
  9. 2
      Adventures in Lestoria/assets/config/story/Chapter 1.txt
  10. BIN
      x64/Release/Adventures in Lestoria.exe

@ -3326,9 +3326,12 @@ void AiL::RenderFadeout(){
if(fadeOutDuration>0){
fadeOutDuration=std::max(0.f,fadeOutDuration-GetElapsedTime());
if(fadeOutDuration==0){
SetMosaicEffect(1U);
GameState::_ChangeState(transitionState);
}else{
SetMosaicEffect(util::lerp(1U,mosaicEffectTransition,1-(fadeOutDuration/fadeOutTotalTime)));
alpha=uint8_t(util::lerp(0,255,1-(fadeOutDuration/fadeOutTotalTime)));
}
alpha=uint8_t(util::lerp(0,255,1-(fadeOutDuration/fadeOutTotalTime)));
}else
if(fadeInDuration>0){
if(!disableFadeIn){

@ -172,6 +172,7 @@ private:
bool paused=false;
bool gameInitialized=false;
ResourcePack gamepack;
uint8_t mosaicEffectTransition=1U;
void ValidateGameStatus();
void _PrepareLevel(MapName map,MusicChange changeMusic);

@ -70,9 +70,10 @@ void GameState::_ChangeState(States::State newState){
STATE->OnStateChange(prevState);
}
void GameState::ChangeState(States::State newState,float fadeOutDuration){
void GameState::ChangeState(States::State newState,float fadeOutDuration,uint8_t mosaicEffect){
if(fadeOutDuration>0){
game->fadeOutDuration=game->fadeOutTotalTime=game->fadeInDuration=fadeOutDuration;
game->mosaicEffectTransition=mosaicEffect;
game->transitionState=newState;
}else{
_ChangeState(newState);

@ -73,6 +73,6 @@ public:
virtual void GetAnyKeyRelease(Key k);
virtual void GetAnyMousePress(int32_t mouseButton);
virtual void GetAnyMouseRelease(int32_t mouseButton);
static void ChangeState(States::State newState,float fadeOutDuration=0);
static void ChangeState(States::State newState,float fadeOutDuration=0,uint8_t mosaicEffect=1U);
virtual void OnLevelLoad()=0;
};

@ -235,9 +235,9 @@ void State_OverworldMap::StartLevel(){
VisualNovel::LoadVisualNovel(State_OverworldMap::GetCurrentConnectionPoint().map);
}else
if(State_OverworldMap::GetCurrentConnectionPoint().type.starts_with("HUB")){
GameState::ChangeState(States::GAME_HUB,0.3f);
GameState::ChangeState(States::GAME_HUB,0.3f,10U);
}else{
GameState::ChangeState(States::GAME_RUN,0.3f);
GameState::ChangeState(States::GAME_RUN,0.3f,10U);
}
}

@ -2,8 +2,6 @@ February 28th -> Begin Internal Game Playtesting
March 6th -> Discord/Friend Playtesting
March 30th -> Public Demo Release
- Mosaic transition on level load
Add Bonus XP when completing a stage
- Hide mouse cursor during controller play. Reveal it again during mouse play.

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 7674
#define VERSION_BUILD 7690
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -43,6 +43,7 @@ All rights reserved.
#include "Unlock.h"
#include "Menu.h"
#include "util.h"
#include "SaveFile.h"
INCLUDE_game
INCLUDE_GFX
@ -180,7 +181,7 @@ void VisualNovel::LoadVisualNovel(std::string storyLevelName){
for(std::unique_ptr<Command>&command:storyLevelData.at(storyLevelName)){
novel.commands.push_back(command.get());
}
GameState::ChangeState(States::STORY,0.5f);
GameState::ChangeState(States::STORY,0.5f,10U);
novel.ExecuteNextCommand();
novel.prevTheme=Menu::GetCurrentTheme().GetThemeName();
Menu::themeSelection="Purple";
@ -247,18 +248,29 @@ void VisualNovel::Draw(){
vf2d nameDisplayPos={24.f,game->GetScreenSize().y-60.f};
vf2d nameDisplayWindowSize={48.f,-12.f};
if(speakerDisplayName.length()>0){
if(std::find_if(rightCharacters.begin(),rightCharacters.end(),[&](std::string&rightCharacter){
return rightCharacter==std::string(speakerDisplayName.begin(),speakerDisplayName.end());
})!=rightCharacters.end()){ //Found the character on the right side, so the box should also be drawn on the right side.
nameDisplayPos={game->ScreenWidth()-24.f-nameDisplayWindowSize.x,game->GetScreenSize().y-60.f};
}
Menu::DrawThemedWindow(nameDisplayPos,nameDisplayWindowSize);
}
std::u32string displayedName=speakerDisplayName;
std::u32string saveFileName;
saveFileName.assign(SaveFile::GetSaveFileName().begin(),SaveFile::GetSaveFileName().end());
if(displayedName==U"You"){
displayedName=saveFileName;
}
vf2d dialogDisplayPos={24.f,game->GetScreenSize().y-48.f};
vf2d dialogDisplaySize={game->GetScreenSize().x-48.f,20.f};
Menu::DrawThemedWindow(dialogDisplayPos,dialogDisplaySize);
FontRect dialogTextSize=font.GetStringBounds(activeText);
FontRect speakerTextSize=font.GetStringBounds(speakerDisplayName);
if(speakerDisplayName.length()>0){
game->DrawShadowStringDecal(font,nameDisplayPos-vf2d{10,7}+(nameDisplayWindowSize+vf2d{24,0})/2-speakerTextSize.size/2+speakerTextSize.offset/2,speakerDisplayName);
FontRect speakerTextSize=font.GetStringBounds(displayedName);
if(displayedName.length()>0){
game->DrawShadowStringDecal(font,nameDisplayPos-vf2d{10,7}+(nameDisplayWindowSize+vf2d{24,0})/2-speakerTextSize.size/2+speakerTextSize.offset/2,displayedName);
game->DrawShadowStringDecal(font,dialogDisplayPos-vf2d{10,6}+dialogTextSize.offset,activeText);
}else{
game->DrawDropShadowStringDecal(narratorFont,dialogDisplayPos-vf2d{10,6}+dialogTextSize.offset,activeText);
game->DrawDropShadowStringDecal(narratorFont,dialogDisplayPos-vf2d{10,6}+dialogTextSize.offset,activeText,{190,190,220});
}
float yOffset=util::lerp(dialogDisplaySize.y+12,-8,textScrollTime/maxTextScrollTime);
game->DrawPolygonDecal(
@ -317,6 +329,9 @@ RightCommand::RightCommand(std::vector<std::string>characters)
CommandType::CommandType RightCommand::GetType(){return CommandType::RIGHT;}
void SpeakerCommand::Execute(VisualNovel&vn){
if(displayedName=="You"){
vn.speakerDisplayName.assign(SaveFile::GetSaveFileName().begin(),SaveFile::GetSaveFileName().end());
}
vn.speakerDisplayName.assign(displayedName.begin(),displayedName.end());
vn.actualSpeakerName.assign(actualSpeakerName.begin(),actualSpeakerName.end());
vn.ExecuteNextCommand();
@ -329,11 +344,23 @@ CommandType::CommandType SpeakerCommand::GetType(){return CommandType::SPEAKER;}
void DialogCommand::Execute(VisualNovel&vn){
if(dialog.size()<=0)return;
#pragma region Process "[You]" in Dialog.
std::u32string _dialog;
_dialog.assign(dialog.begin(),dialog.end());
std::u32string processedDialog=_dialog;
size_t playerNameReplacePos=processedDialog.find(U"[You]");
while(playerNameReplacePos!=std::u32string::npos){
std::u32string saveFileName;
saveFileName.assign(SaveFile::GetSaveFileName().begin(),SaveFile::GetSaveFileName().end());
processedDialog=processedDialog.replace(playerNameReplacePos,U"[You]"s.length(),saveFileName);
playerNameReplacePos=processedDialog.find(U"[You]");
}
#pragma endregion
vn.textScrollTime=VisualNovel::maxTextScrollTime;
bool mustDisplay=vn.activeText.length()==0;
Font*displayFont=&VisualNovel::font;
if(vn.actualSpeakerName.length()==0)displayFont=&VisualNovel::narratorFont;
std::u32string newText=util::WrapText(game,vn.activeText+(vn.activeText.length()>0?U" ":U"")+std::u32string(dialog.begin(),dialog.end()),game->GetScreenSize().x-24,*displayFont,{1,1});
std::u32string newText=util::WrapText(game,vn.activeText+(vn.activeText.length()>0?U" ":U"")+std::u32string(processedDialog.begin(),processedDialog.end()),game->GetScreenSize().x-24,*displayFont,{1,1});
if(VisualNovel::font.GetStringBounds(newText).size.y>48){//Hit the maximum of 3 lines.
if(!mustDisplay){
vn.commandIndex--;

@ -80,7 +80,7 @@ Sherman's response surprises you a bit. You did not expect anyone from the Scien
[You]
I'm [Player Name]. Adventurer and Hunter.
I'm [You]. Adventurer and Hunter.
[]

Loading…
Cancel
Save