Added character portrait displays and discussion-context coloring.

pull/28/head
sigonasr2 1 year ago
parent b437202e13
commit 16e0fe4042
  1. 2
      Crawler/Version.h
  2. 25
      Crawler/VisualNovel.cpp
  3. 1
      Crawler/VisualNovel.h
  4. BIN
      Crawler/assets/characters/greg.png
  5. BIN
      Crawler/assets/characters/player_f.png
  6. BIN
      Crawler/assets/characters/player_m.png
  7. BIN
      Crawler/assets/characters/sherman.png
  8. 4
      Crawler/assets/config/story/Chapter 1.txt

@ -35,7 +35,7 @@ SUCH DAMAGE.
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 1
#define VERSION_BUILD 3226
#define VERSION_BUILD 3232
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -201,12 +201,27 @@ void VisualNovel::Draw(){
alpha=util::lerp(0,1,1-(transitionTime/maxTransitionTime));
}
if(prevBackgroundFilename!=""){
game->DrawDecal({0,0},GFX["backgrounds/"+prevBackgroundFilename].Decal());
game->DrawDecal({0,0},GFX["story_background_image_location"_S+prevBackgroundFilename].Decal());
}
game->DrawDecal({0,0},GFX["backgrounds/"+backgroundFilename].Decal(),{1,1},{255,255,255,uint8_t(255*alpha)});
game->DrawDecal({0,0},GFX["story_background_image_location"_S+backgroundFilename].Decal(),{1,1},{255,255,255,uint8_t(255*alpha)});
}else{
game->FillRectDecal({0,0},game->GetScreenSize());
}
for(int i=leftCharacters.size()-1;i>=0;i--){
//Start 72 from the bottom.
std::string character=leftCharacters[i];
Pixel fadeColor=WHITE;
if(character!=actualSpeakerName)fadeColor={128,128,128,255};
game->DrawDecal(vi2d{0,game->GetScreenSize().y}-vi2d{-i*64,72+168},GFX[GetCharacterImage(character)].Decal(),{1,1},fadeColor);
}
for(int i=rightCharacters.size()-1;i>=0;i--){
//Start 72 from the bottom.
std::string character=rightCharacters[i];
Pixel fadeColor=WHITE;
if(character!=actualSpeakerName)fadeColor={128,128,128,255};
float spriteWidth=GFX[GetCharacterImage(character)].Sprite()->width;
game->DrawRotatedDecal(game->GetScreenSize()-vi2d{i*64+int(spriteWidth)/2,72+168},GFX[GetCharacterImage(character)].Decal(),0,vf2d{spriteWidth/2,0.f},{-1,1},fadeColor);
}
if(locationDisplayTime>0){
vi2d textSize=game->GetTextSizeProp(locationDisplayText)*2;
game->FillRectDecal(game->GetScreenSize()/2-textSize/2-vi2d{4,4},textSize+vi2d{8,8},BLACK);
@ -226,6 +241,12 @@ void VisualNovel::Draw(){
game->DrawShadowStringPropDecal(dialogDisplayPos-vf2d{10,10},activeText);
}
}
std::string VisualNovel::GetCharacterImage(std::string name){
if(name=="You"){ //Assume we are using female player avatar for now!
return "character_image_location"_S+"Player_F.png";
}
return "character_image_location"_S+name+".png";
}
VisualNovel::VisualNovel(){}

@ -157,4 +157,5 @@ public:
void ExecuteNextCommand();
void Update();
void Draw();
std::string GetCharacterImage(std::string name);
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 813 B

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 813 B

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 814 B

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 812 B

After

Width:  |  Height:  |  Size: 4.5 KiB

@ -53,7 +53,7 @@ after around half an hour of letting the health potion work the man finally seem
How are you feeling.
[?]
[?,Sherman]
Better, i guess.
@ -61,7 +61,7 @@ Better, i guess.
Can you tell me what happened here?
[?]
[?,Sherman]
I... We... No, it happened way to fast.

Loading…
Cancel
Save