Add mosaic transitions from overworld to stages. Fix up Visual Novel placeholder text for player name. Release Build 7690.
This commit is contained in:
parent
3faff12015
commit
3261ddf6f5
@ -3326,9 +3326,12 @@ void AiL::RenderFadeout(){
|
|||||||
if(fadeOutDuration>0){
|
if(fadeOutDuration>0){
|
||||||
fadeOutDuration=std::max(0.f,fadeOutDuration-GetElapsedTime());
|
fadeOutDuration=std::max(0.f,fadeOutDuration-GetElapsedTime());
|
||||||
if(fadeOutDuration==0){
|
if(fadeOutDuration==0){
|
||||||
|
SetMosaicEffect(1U);
|
||||||
GameState::_ChangeState(transitionState);
|
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
|
}else
|
||||||
if(fadeInDuration>0){
|
if(fadeInDuration>0){
|
||||||
if(!disableFadeIn){
|
if(!disableFadeIn){
|
||||||
|
@ -172,6 +172,7 @@ private:
|
|||||||
bool paused=false;
|
bool paused=false;
|
||||||
bool gameInitialized=false;
|
bool gameInitialized=false;
|
||||||
ResourcePack gamepack;
|
ResourcePack gamepack;
|
||||||
|
uint8_t mosaicEffectTransition=1U;
|
||||||
|
|
||||||
void ValidateGameStatus();
|
void ValidateGameStatus();
|
||||||
void _PrepareLevel(MapName map,MusicChange changeMusic);
|
void _PrepareLevel(MapName map,MusicChange changeMusic);
|
||||||
|
@ -70,9 +70,10 @@ void GameState::_ChangeState(States::State newState){
|
|||||||
STATE->OnStateChange(prevState);
|
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){
|
if(fadeOutDuration>0){
|
||||||
game->fadeOutDuration=game->fadeOutTotalTime=game->fadeInDuration=fadeOutDuration;
|
game->fadeOutDuration=game->fadeOutTotalTime=game->fadeInDuration=fadeOutDuration;
|
||||||
|
game->mosaicEffectTransition=mosaicEffect;
|
||||||
game->transitionState=newState;
|
game->transitionState=newState;
|
||||||
}else{
|
}else{
|
||||||
_ChangeState(newState);
|
_ChangeState(newState);
|
||||||
|
@ -73,6 +73,6 @@ public:
|
|||||||
virtual void GetAnyKeyRelease(Key k);
|
virtual void GetAnyKeyRelease(Key k);
|
||||||
virtual void GetAnyMousePress(int32_t mouseButton);
|
virtual void GetAnyMousePress(int32_t mouseButton);
|
||||||
virtual void GetAnyMouseRelease(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;
|
virtual void OnLevelLoad()=0;
|
||||||
};
|
};
|
@ -235,9 +235,9 @@ void State_OverworldMap::StartLevel(){
|
|||||||
VisualNovel::LoadVisualNovel(State_OverworldMap::GetCurrentConnectionPoint().map);
|
VisualNovel::LoadVisualNovel(State_OverworldMap::GetCurrentConnectionPoint().map);
|
||||||
}else
|
}else
|
||||||
if(State_OverworldMap::GetCurrentConnectionPoint().type.starts_with("HUB")){
|
if(State_OverworldMap::GetCurrentConnectionPoint().type.starts_with("HUB")){
|
||||||
GameState::ChangeState(States::GAME_HUB,0.3f);
|
GameState::ChangeState(States::GAME_HUB,0.3f,10U);
|
||||||
}else{
|
}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 6th -> Discord/Friend Playtesting
|
||||||
March 30th -> Public Demo Release
|
March 30th -> Public Demo Release
|
||||||
|
|
||||||
- Mosaic transition on level load
|
|
||||||
|
|
||||||
Add Bonus XP when completing a stage
|
Add Bonus XP when completing a stage
|
||||||
|
|
||||||
- Hide mouse cursor during controller play. Reveal it again during mouse play.
|
- 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_MAJOR 0
|
||||||
#define VERSION_MINOR 3
|
#define VERSION_MINOR 3
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 7674
|
#define VERSION_BUILD 7690
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
@ -43,6 +43,7 @@ All rights reserved.
|
|||||||
#include "Unlock.h"
|
#include "Unlock.h"
|
||||||
#include "Menu.h"
|
#include "Menu.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "SaveFile.h"
|
||||||
|
|
||||||
INCLUDE_game
|
INCLUDE_game
|
||||||
INCLUDE_GFX
|
INCLUDE_GFX
|
||||||
@ -180,7 +181,7 @@ void VisualNovel::LoadVisualNovel(std::string storyLevelName){
|
|||||||
for(std::unique_ptr<Command>&command:storyLevelData.at(storyLevelName)){
|
for(std::unique_ptr<Command>&command:storyLevelData.at(storyLevelName)){
|
||||||
novel.commands.push_back(command.get());
|
novel.commands.push_back(command.get());
|
||||||
}
|
}
|
||||||
GameState::ChangeState(States::STORY,0.5f);
|
GameState::ChangeState(States::STORY,0.5f,10U);
|
||||||
novel.ExecuteNextCommand();
|
novel.ExecuteNextCommand();
|
||||||
novel.prevTheme=Menu::GetCurrentTheme().GetThemeName();
|
novel.prevTheme=Menu::GetCurrentTheme().GetThemeName();
|
||||||
Menu::themeSelection="Purple";
|
Menu::themeSelection="Purple";
|
||||||
@ -247,18 +248,29 @@ void VisualNovel::Draw(){
|
|||||||
vf2d nameDisplayPos={24.f,game->GetScreenSize().y-60.f};
|
vf2d nameDisplayPos={24.f,game->GetScreenSize().y-60.f};
|
||||||
vf2d nameDisplayWindowSize={48.f,-12.f};
|
vf2d nameDisplayWindowSize={48.f,-12.f};
|
||||||
if(speakerDisplayName.length()>0){
|
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);
|
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 dialogDisplayPos={24.f,game->GetScreenSize().y-48.f};
|
||||||
vf2d dialogDisplaySize={game->GetScreenSize().x-48.f,20.f};
|
vf2d dialogDisplaySize={game->GetScreenSize().x-48.f,20.f};
|
||||||
Menu::DrawThemedWindow(dialogDisplayPos,dialogDisplaySize);
|
Menu::DrawThemedWindow(dialogDisplayPos,dialogDisplaySize);
|
||||||
FontRect dialogTextSize=font.GetStringBounds(activeText);
|
FontRect dialogTextSize=font.GetStringBounds(activeText);
|
||||||
FontRect speakerTextSize=font.GetStringBounds(speakerDisplayName);
|
FontRect speakerTextSize=font.GetStringBounds(displayedName);
|
||||||
if(speakerDisplayName.length()>0){
|
if(displayedName.length()>0){
|
||||||
game->DrawShadowStringDecal(font,nameDisplayPos-vf2d{10,7}+(nameDisplayWindowSize+vf2d{24,0})/2-speakerTextSize.size/2+speakerTextSize.offset/2,speakerDisplayName);
|
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);
|
game->DrawShadowStringDecal(font,dialogDisplayPos-vf2d{10,6}+dialogTextSize.offset,activeText);
|
||||||
}else{
|
}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);
|
float yOffset=util::lerp(dialogDisplaySize.y+12,-8,textScrollTime/maxTextScrollTime);
|
||||||
game->DrawPolygonDecal(
|
game->DrawPolygonDecal(
|
||||||
@ -317,6 +329,9 @@ RightCommand::RightCommand(std::vector<std::string>characters)
|
|||||||
CommandType::CommandType RightCommand::GetType(){return CommandType::RIGHT;}
|
CommandType::CommandType RightCommand::GetType(){return CommandType::RIGHT;}
|
||||||
|
|
||||||
void SpeakerCommand::Execute(VisualNovel&vn){
|
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.speakerDisplayName.assign(displayedName.begin(),displayedName.end());
|
||||||
vn.actualSpeakerName.assign(actualSpeakerName.begin(),actualSpeakerName.end());
|
vn.actualSpeakerName.assign(actualSpeakerName.begin(),actualSpeakerName.end());
|
||||||
vn.ExecuteNextCommand();
|
vn.ExecuteNextCommand();
|
||||||
@ -329,11 +344,23 @@ CommandType::CommandType SpeakerCommand::GetType(){return CommandType::SPEAKER;}
|
|||||||
|
|
||||||
void DialogCommand::Execute(VisualNovel&vn){
|
void DialogCommand::Execute(VisualNovel&vn){
|
||||||
if(dialog.size()<=0)return;
|
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;
|
vn.textScrollTime=VisualNovel::maxTextScrollTime;
|
||||||
bool mustDisplay=vn.activeText.length()==0;
|
bool mustDisplay=vn.activeText.length()==0;
|
||||||
Font*displayFont=&VisualNovel::font;
|
Font*displayFont=&VisualNovel::font;
|
||||||
if(vn.actualSpeakerName.length()==0)displayFont=&VisualNovel::narratorFont;
|
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(VisualNovel::font.GetStringBounds(newText).size.y>48){//Hit the maximum of 3 lines.
|
||||||
if(!mustDisplay){
|
if(!mustDisplay){
|
||||||
vn.commandIndex--;
|
vn.commandIndex--;
|
||||||
|
@ -80,7 +80,7 @@ Sherman's response surprises you a bit. You did not expect anyone from the Scien
|
|||||||
|
|
||||||
[You]
|
[You]
|
||||||
|
|
||||||
I'm [Player Name]. Adventurer and Hunter.
|
I'm [You]. Adventurer and Hunter.
|
||||||
|
|
||||||
[]
|
[]
|
||||||
|
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user