Compare commits

...

3 Commits

Author SHA1 Message Date
Muzychenko Andrey 1c1fbcb811 TTextBox: fixed DrawText texts getting overwritten by full redraw.
This bug is from the original 3DPB.
2021-10-30 18:25:49 +03:00
Muzychenko Andrey c0ec8ec932 Added Finnish translation. 2021-10-30 16:50:49 +03:00
Muzychenko Andrey 71e25fd7fa Merge from master: control bugfix, no delay FT THole. 2021-10-30 16:21:01 +03:00
10 changed files with 29 additions and 9 deletions

View File

@ -82,7 +82,11 @@ void THole::Collision(TBall* ball, vector_type* nextPosition, vector_type* direc
ball->Position.X = Circle.Center.X;
ball->Position.Y = Circle.Center.Y;
ball->Acceleration.Z = 0.0;
Timer = timer::set(0.5f, this, TimerExpired);
// Ramp hole has no delay in FT.
auto captureTime = pb::FullTiltMode ? 0 : 0.5f;
Timer = timer::set(captureTime, this, TimerExpired);
if (!PinballTable->TiltLockFlag)
{
loader::play_sound(HardHitSoundId);

View File

@ -153,7 +153,7 @@ void TTextBox::Display(const wchar_t* text, float time)
}
}
void TTextBox::Draw()
void TTextBox::Draw(bool redraw)
{
auto bmp = BgBmp;
if (bmp)
@ -172,6 +172,12 @@ void TTextBox::Draw()
bool display = false;
while (Message1)
{
if (redraw)
{
display = true;
break;
}
if (Message1->Time == -1.0f)
{
if (!Message1->NextMessage)
@ -183,6 +189,8 @@ void TTextBox::Draw()
}
else if (Message1->TimeLeft() >= -2.0f)
{
if (Timer > 0)
timer::kill(Timer);
Timer = timer::set(max(Message1->TimeLeft(), 0.25f), this, TimerExpired);
display = true;
break;

View File

@ -22,7 +22,7 @@ public:
int Message(int code, float value) override;
void Clear();
void Display(const wchar_t* text, float time);
void Draw();
void Draw(bool redraw = false);
static void TimerExpired(int timerId, void* tb);
};

View File

@ -2916,7 +2916,7 @@ void control::GameoverController(int code, TPinballComponent* caller)
if (missionMsg & 0x200)
{
int highscoreId = missionMsg % 4;
int highscoreId = missionMsg % 5;
int highScore = pb::highscore_table[highscoreId].Score;
auto nextHidhscoreId = highscoreId + 1;
if (highScore > 0)

View File

@ -377,7 +377,7 @@ void fullscrn::paint()
fillRect(WindowRect1.right, menuHeight + WindowRect1.bottom, 0, 0);
}
}
render::paint();
pb::paint();
fullscrn_flag1 = 0;
}

View File

@ -81,8 +81,9 @@ LanguageMenuEntry options::LanguageMenu[]
{L"Italiano", Languages::Italian},
{L"Magyar", Languages::Hungarian},
{L"Portugues do Brasil", Languages::BrazilianPortuguese},
{L"Čeština" , Languages::Czech},
{L"Dansk" , Languages::Danish},
{L"Čeština", Languages::Czech},
{L"Dansk", Languages::Danish},
{L"Suomi", Languages::Finnish},
};
void options::ReadOptions()

View File

@ -5,7 +5,7 @@
enum class Languages
{
English = MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
Russian = MAKELANGID(LANG_RUSSIAN, SUBLANG_DEFAULT),
Russian = MAKELANGID(LANG_RUSSIAN, SUBLANG_RUSSIAN_RUSSIA),
TraditionalChinese = MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL),
SimplifiedChinese = MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED),
Polish = MAKELANGID(LANG_POLISH, SUBLANG_POLISH_POLAND),
@ -17,6 +17,7 @@ enum class Languages
BrazilianPortuguese = MAKELANGID(LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN),
Czech = MAKELANGID(LANG_CZECH, SUBLANG_CZECH_CZECH_REPUBLIC),
Danish = MAKELANGID(LANG_DANISH, SUBLANG_DANISH_DENMARK),
Finnish = MAKELANGID(LANG_FINNISH, SUBLANG_FINNISH_FINLAND),
};
struct LanguageMenuEntry

View File

@ -135,6 +135,12 @@ void pb::firsttime_setup()
void pb::paint()
{
render::paint();
if (score::msg_fontp == nullptr)
{
// DrawText writes to screen directly, text gets overwritten by full vScreen blit.
pinball::InfoTextBox->Draw(true);
pinball::MissTextBox->Draw(true);
}
}
void pb::mode_change(int mode)

View File

@ -242,7 +242,7 @@
#define DLG_HIGHSCORES_EditName5 605
#define Menu1_AlternativeRender 601
#define Menu1_Language 700
#define Menu1_LanguageMax 713
#define Menu1_LanguageMax 714
// Next default values for new objects
//