git repos / blockattack-game

commit 599a0479

sago007 · 2016-01-26 17:17
599a0479626a423e7888cf2688a49314f81101db patch · browse files
parent 012af19d5efb8ec8f9dd03f0162fc114624c4c2c

Now uses nfont's box function to make it easier to translate. The translater does not need to know the line width.

Changed files

M source/code/main.cpp before
diff --git a/source/code/main.cpp b/source/code/main.cpp index f183203..92f667d 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp
@@ -1386,29 +1386,30 @@ void DrawEverything(int xsize, int ysize,BlockGameSdl* theGame, BlockGameSdl* th
//Blank player2's board:
DrawIMG(backBoard,screen,theGame2->GetTopX(),theGame2->GetTopY());
//Write a description:
+ string infostring;
if (theGame->isTimeTrial()) {
NFont_Write(screen, theGame2->GetTopX()+7,theGame2->GetTopY()+10,"Time Trial");
NFont_Write(screen, theGame2->GetTopX()+7,theGame2->GetTopY()+160,"Objective:");
- string infostring = _("Score as much as \npossible in 2 minutes");
- NFont_Write(screen, theGame2->GetTopX()+7,theGame2->GetTopY()+160+32,infostring);
+ infostring = _("Score as much as possible in 2 minutes");
+
}
else if (theGame->isStageClear()) {
NFont_Write(screen, theGame2->GetTopX()+7,theGame2->GetTopY()+10,"Stage Clear");
NFont_Write(screen, theGame2->GetTopX()+7,theGame2->GetTopY()+160,"Objective:");
- string infostring = _("You must clear a \nnumber of lines.\nSpeed is rapidly \nincreased.");
- NFont_Write(screen, theGame2->GetTopX()+7,theGame2->GetTopY()+160+32,infostring);
+ infostring = _("You must clear a number of lines. Speed is rapidly increased.");
}
else if (theGame->isPuzzleMode()) {
NFont_Write(screen, theGame2->GetTopX()+7,theGame2->GetTopY()+10,"Puzzle");
NFont_Write(screen, theGame2->GetTopX()+7,theGame2->GetTopY()+160,"Objective:");
- string infostring = _("Clear the entire board \nwith a limited number \nof moves.");
- NFont_Write(screen, theGame2->GetTopX()+7,theGame2->GetTopY()+160+32,infostring);
+ infostring = _("Clear the entire board with a limited number of moves.");
}
else {
NFont_Write(screen, theGame2->GetTopX()+7,theGame2->GetTopY()+10,"Endless");
NFont_Write(screen, theGame2->GetTopX()+7,theGame2->GetTopY()+160,"Objective:");
- string infostring = _("Score as much as \npossible. No time limit.");
- NFont_Write(screen, theGame2->GetTopX()+7,theGame2->GetTopY()+160+32,infostring);
+ infostring = _("Score as much as possible. No time limit.");
+ }
+ if (infostring.length() > 0) {
+ nf_standard_blue_font.drawBox(screen, { static_cast<float>(theGame2->GetTopX()+7),static_cast<float>(theGame2->GetTopY()+160+32), 280, 200}, "%s", infostring.c_str());
}
//Write the keys that are in use