2020-10-25 15:17:26 +01:00
|
|
|
#include "pch.h"
|
|
|
|
#include "pinball.h"
|
2022-08-31 06:58:03 +02:00
|
|
|
#include "translations.h"
|
2020-12-03 15:47:36 +01:00
|
|
|
#include "winmain.h"
|
2020-10-25 15:17:26 +01:00
|
|
|
|
2022-08-31 06:58:03 +02:00
|
|
|
int LoadStringAlt(Msg uID, LPSTR lpBuffer, int cchBufferMax)
|
2021-08-27 12:29:41 +02:00
|
|
|
{
|
2022-08-31 06:58:03 +02:00
|
|
|
const char* text = translations::GetTranslation(uID);
|
2021-08-27 12:29:41 +02:00
|
|
|
|
2022-08-31 06:58:03 +02:00
|
|
|
strncpy(lpBuffer, text, cchBufferMax);
|
2021-08-27 12:29:41 +02:00
|
|
|
return 1;
|
|
|
|
}
|
2020-10-25 15:17:26 +01:00
|
|
|
|
2020-11-01 16:45:29 +01:00
|
|
|
int pinball::quickFlag = 0;
|
2020-11-04 14:22:52 +01:00
|
|
|
TTextBox* pinball::InfoTextBox;
|
|
|
|
TTextBox* pinball::MissTextBox;
|
|
|
|
char pinball::getRcBuffer[6 * 256];
|
|
|
|
int pinball::rc_string_slot = 0;
|
2020-11-06 14:56:32 +01:00
|
|
|
int pinball::LeftShift = -1;
|
|
|
|
int pinball::RightShift = -1;
|
2021-11-21 13:40:56 +01:00
|
|
|
std::string pinball::BasePath;
|
2020-11-04 14:22:52 +01:00
|
|
|
|
2022-08-31 06:58:03 +02:00
|
|
|
char* pinball::get_rc_string(Msg uID)
|
2020-11-04 14:22:52 +01:00
|
|
|
{
|
|
|
|
char* result = &getRcBuffer[256 * rc_string_slot];
|
2021-09-01 10:02:57 +02:00
|
|
|
if (!LoadStringAlt(uID, &getRcBuffer[256 * rc_string_slot], 255))
|
2020-11-04 14:22:52 +01:00
|
|
|
*result = 0;
|
2022-08-31 06:58:03 +02:00
|
|
|
|
2020-11-04 14:22:52 +01:00
|
|
|
if (++rc_string_slot >= 6)
|
|
|
|
rc_string_slot = 0;
|
|
|
|
return result;
|
|
|
|
}
|
2020-11-06 14:56:32 +01:00
|
|
|
|
2022-08-31 06:58:03 +02:00
|
|
|
int pinball::get_rc_int(Msg uID, int* dst)
|
2020-11-06 14:56:32 +01:00
|
|
|
{
|
2020-12-04 16:35:47 +01:00
|
|
|
char buffer[255];
|
2021-09-01 10:02:57 +02:00
|
|
|
int result = LoadStringAlt(uID, buffer, 255);
|
2020-11-06 14:56:32 +01:00
|
|
|
if (!result)
|
|
|
|
return result;
|
|
|
|
*dst = atoi(buffer);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2021-09-14 14:33:18 +02:00
|
|
|
std::string pinball::make_path_name(const std::string& fileName)
|
2020-11-29 16:50:49 +01:00
|
|
|
{
|
2021-11-21 13:40:56 +01:00
|
|
|
return BasePath + fileName;
|
2020-11-29 16:50:49 +01:00
|
|
|
}
|