1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2025-09-01 06:20:15 +02:00

Simplified get_rc_string, merged pinball and pb.

This commit is contained in:
Muzychenko Andrey 2022-08-31 15:18:22 +03:00
parent 88f835d068
commit 42226a14c9
15 changed files with 278 additions and 333 deletions

View file

@ -6,7 +6,6 @@
#include "loader.h"
#include "midi.h"
#include "pb.h"
#include "pinball.h"
#include "render.h"
#include "TBall.h"
#include "TBlocker.h"
@ -186,8 +185,8 @@ TPinballTable::TPinballTable(): TPinballComponent(nullptr, -1, false)
}
render::build_occlude_list();
pinball::InfoTextBox = dynamic_cast<TTextBox*>(find_component("info_text_box"));
pinball::MissTextBox = dynamic_cast<TTextBox*>(find_component("mission_text_box"));
pb::InfoTextBox = dynamic_cast<TTextBox*>(find_component("info_text_box"));
pb::MissTextBox = dynamic_cast<TTextBox*>(find_component("mission_text_box"));
control::make_links(this);
}
@ -215,7 +214,7 @@ TPinballTable::~TPinballTable()
delete ComponentList[0];
}
control::ClearLinks();
pinball::InfoTextBox = pinball::MissTextBox = nullptr;
pb::InfoTextBox = pb::MissTextBox = nullptr;
}
TPinballComponent* TPinballTable::find_component(LPCSTR componentName)
@ -290,9 +289,9 @@ void TPinballTable::tilt(float time)
{
if (!TiltLockFlag && !BallInDrainFlag)
{
pinball::InfoTextBox->Clear();
pinball::MissTextBox->Clear();
pinball::InfoTextBox->Display(pinball::get_rc_string(Msg::STRING136), -1.0);
pb::InfoTextBox->Clear();
pb::MissTextBox->Clear();
pb::InfoTextBox->Display(pb::get_rc_string(Msg::STRING136), -1.0);
loader::play_sound(SoundIndex3, nullptr, "TPinballTable1");
TiltTimeoutTimer = timer::set(30.0, this, tilt_timeout);
@ -371,10 +370,10 @@ int TPinballTable::Message(int code, float value)
LightGroup->Message(20, 0.0);
Plunger->Message(1016, 0.0);
if (Demo && Demo->ActiveFlag)
rc_text = pinball::get_rc_string(Msg::STRING131);
rc_text = pb::get_rc_string(Msg::STRING131);
else
rc_text = pinball::get_rc_string(Msg::STRING127);
pinball::InfoTextBox->Display(rc_text, -1.0);
rc_text = pb::get_rc_string(Msg::STRING127);
pb::InfoTextBox->Display(rc_text, -1.0);
if (Demo)
Demo->Message(1014, 0.0);
break;
@ -444,8 +443,8 @@ int TPinballTable::Message(int code, float value)
ScoreSpecial3Flag = 0;
ScoreSpecial2Flag = 0;
UnknownP71 = 0;
pinball::InfoTextBox->Clear();
pinball::MissTextBox->Clear();
pb::InfoTextBox->Clear();
pb::MissTextBox->Clear();
LightGroup->Message(28, 0.2f);
auto time = loader::play_sound(SoundIndex1, nullptr, "TPinballTable2");
if (time < 0)
@ -470,10 +469,10 @@ int TPinballTable::Message(int code, float value)
{
const char* textboxText;
if (Demo->ActiveFlag)
textboxText = pinball::get_rc_string(Msg::STRING131);
textboxText = pb::get_rc_string(Msg::STRING131);
else
textboxText = pinball::get_rc_string(Msg::STRING127);
pinball::InfoTextBox->Display(textboxText, -1.0);
textboxText = pb::get_rc_string(Msg::STRING127);
pb::InfoTextBox->Display(textboxText, -1.0);
break;
}
@ -514,34 +513,34 @@ int TPinballTable::Message(int code, float value)
{
case 0:
if (Demo->ActiveFlag)
textboxText = pinball::get_rc_string(Msg::STRING131);
textboxText = pb::get_rc_string(Msg::STRING131);
else
textboxText = pinball::get_rc_string(Msg::STRING127);
textboxText = pb::get_rc_string(Msg::STRING127);
break;
case 1:
if (Demo->ActiveFlag)
textboxText = pinball::get_rc_string(Msg::STRING132);
textboxText = pb::get_rc_string(Msg::STRING132);
else
textboxText = pinball::get_rc_string(Msg::STRING128);
textboxText = pb::get_rc_string(Msg::STRING128);
break;
case 2:
if (Demo->ActiveFlag)
textboxText = pinball::get_rc_string(Msg::STRING133);
textboxText = pb::get_rc_string(Msg::STRING133);
else
textboxText = pinball::get_rc_string(Msg::STRING129);
textboxText = pb::get_rc_string(Msg::STRING129);
break;
case 3:
if (Demo->ActiveFlag)
textboxText = pinball::get_rc_string(Msg::STRING134);
textboxText = pb::get_rc_string(Msg::STRING134);
else
textboxText = pinball::get_rc_string(Msg::STRING130);
textboxText = pb::get_rc_string(Msg::STRING130);
break;
default:
break;
}
if (textboxText != nullptr)
pinball::InfoTextBox->Display(textboxText, -1);
pb::InfoTextBox->Display(textboxText, -1);
ScoreSpecial3Flag = 0;
ScoreSpecial2Flag = 0;
UnknownP71 = 0;
@ -550,8 +549,8 @@ int TPinballTable::Message(int code, float value)
break;
case 1022:
loader::play_sound(SoundIndex2, nullptr, "TPinballTable3");
pinball::MissTextBox->Clear();
pinball::InfoTextBox->Display(pinball::get_rc_string(Msg::STRING135), -1.0);
pb::MissTextBox->Clear();
pb::InfoTextBox->Display(pb::get_rc_string(Msg::STRING135), -1.0);
EndGameTimeoutTimer = timer::set(3.0, this, EndGame_timeout);
break;
case 1024:
@ -662,8 +661,8 @@ void TPinballTable::EndGame_timeout(int timerId, void* caller)
}
if (table->Demo)
table->Demo->Message(1022, 0.0);
control::handler(67, pinball::MissTextBox);
pinball::InfoTextBox->Display(pinball::get_rc_string(Msg::STRING125), -1.0);
control::handler(67, pb::MissTextBox);
pb::InfoTextBox->Display(pb::get_rc_string(Msg::STRING125), -1.0);
}
void TPinballTable::LightShow_timeout(int timerId, void* caller)