2019-05-30 15:24:47 -04:00
|
|
|
#include "common.h"
|
2020-04-17 09:31:11 -04:00
|
|
|
|
2019-06-14 19:34:19 -04:00
|
|
|
#include "Camera.h"
|
|
|
|
#include "DMAudio.h"
|
|
|
|
#include "Clock.h"
|
|
|
|
#include "Darkel.h"
|
2019-05-30 15:24:47 -04:00
|
|
|
#include "Hud.h"
|
2019-06-14 19:34:19 -04:00
|
|
|
#include "Messages.h"
|
|
|
|
#include "Frontend.h"
|
|
|
|
#include "Font.h"
|
|
|
|
#include "Pad.h"
|
|
|
|
#include "Radar.h"
|
|
|
|
#include "Replay.h"
|
2020-03-28 10:47:52 -04:00
|
|
|
#include "Wanted.h"
|
2019-06-14 19:34:19 -04:00
|
|
|
#include "Sprite.h"
|
|
|
|
#include "Sprite2d.h"
|
|
|
|
#include "Text.h"
|
|
|
|
#include "Timer.h"
|
|
|
|
#include "Script.h"
|
|
|
|
#include "TxdStore.h"
|
|
|
|
#include "User.h"
|
|
|
|
#include "World.h"
|
2019-05-30 15:24:47 -04:00
|
|
|
|
2020-05-17 09:33:44 -04:00
|
|
|
// Game has colors inlined in code.
|
|
|
|
// For easier modification we collect them here:
|
|
|
|
CRGBA MONEY_COLOR(89, 115, 150, 255);
|
|
|
|
CRGBA AMMO_COLOR(0, 0, 0, 255);
|
|
|
|
CRGBA HEALTH_COLOR(186, 101, 50, 255);
|
|
|
|
CRGBA ARMOUR_COLOR(124, 140, 95, 255);
|
|
|
|
CRGBA WANTED_COLOR(193, 164, 120, 255);
|
|
|
|
CRGBA ZONE_COLOR(152, 154, 82, 255);
|
|
|
|
CRGBA VEHICLE_COLOR(194, 165, 120, 255);
|
|
|
|
CRGBA CLOCK_COLOR(194, 165, 120, 255);
|
|
|
|
CRGBA TIMER_COLOR(186, 101, 50, 255);
|
|
|
|
CRGBA COUNTER_COLOR(0, 106, 164, 255);
|
|
|
|
CRGBA PAGER_COLOR(32, 162, 66, 205);
|
|
|
|
CRGBA RADARDISC_COLOR(0, 0, 0, 255);
|
|
|
|
CRGBA BIGMESSAGE_COLOR(85, 119, 133, 255);
|
|
|
|
CRGBA WASTEDBUSTED_COLOR(170, 123, 87, 255);
|
|
|
|
CRGBA ODDJOB_COLOR(89, 115, 150, 255);
|
|
|
|
CRGBA ODDJOB2_COLOR(156, 91, 40, 255);
|
|
|
|
CRGBA MISSIONTITLE_COLOR(220, 172, 2, 255);
|
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
int16 CHud::m_ItemToFlash;
|
|
|
|
CSprite2d CHud::Sprites[NUM_HUD_SPRITES];
|
2020-04-17 01:54:14 -04:00
|
|
|
wchar *CHud::m_pZoneName;
|
|
|
|
wchar *CHud::m_pLastZoneName;
|
2019-06-16 20:10:55 -04:00
|
|
|
wchar *CHud::m_ZoneToPrint;
|
2020-04-17 01:54:14 -04:00
|
|
|
wchar CHud::m_Message[256];
|
2020-12-07 13:12:13 -05:00
|
|
|
wchar CHud::m_BigMessage[6][128];
|
|
|
|
wchar LastBigMessage[6][128];
|
2020-04-17 01:54:14 -04:00
|
|
|
wchar CHud::m_PagerMessage[256];
|
2020-12-07 13:12:13 -05:00
|
|
|
uint32 CHud::m_ZoneNameTimer;
|
|
|
|
int32 CHud::m_ZoneFadeTimer;
|
|
|
|
uint32 CHud::m_ZoneState;
|
|
|
|
wchar CHud::m_HelpMessage[HELP_MSG_LENGTH];
|
|
|
|
wchar CHud::m_LastHelpMessage[HELP_MSG_LENGTH];
|
|
|
|
wchar CHud::m_HelpMessageToPrint[HELP_MSG_LENGTH];
|
|
|
|
uint32 CHud::m_HelpMessageTimer;
|
|
|
|
int32 CHud::m_HelpMessageFadeTimer;
|
|
|
|
uint32 CHud::m_HelpMessageState;
|
|
|
|
bool CHud::m_HelpMessageQuick;
|
|
|
|
float CHud::m_HelpMessageDisplayTime;
|
|
|
|
int32 CHud::SpriteBrightness;
|
2020-04-17 01:54:14 -04:00
|
|
|
bool CHud::m_Wants_To_Draw_Hud;
|
|
|
|
bool CHud::m_Wants_To_Draw_3dMarkers;
|
2020-12-07 13:12:13 -05:00
|
|
|
wchar *CHud::m_pVehicleName;
|
|
|
|
wchar *CHud::m_pLastVehicleName;
|
|
|
|
uint32 CHud::m_VehicleNameTimer;
|
|
|
|
int32 CHud::m_VehicleFadeTimer;
|
|
|
|
uint32 CHud::m_VehicleState;
|
|
|
|
wchar *CHud::m_pVehicleNameToPrint;
|
2019-06-28 07:28:42 -04:00
|
|
|
|
|
|
|
// These aren't really in CHud
|
2020-12-07 13:12:13 -05:00
|
|
|
float BigMessageInUse[6];
|
|
|
|
float BigMessageX[6];
|
|
|
|
float BigMessageAlpha[6];
|
|
|
|
int16 PagerOn;
|
|
|
|
int16 PagerTimer;
|
|
|
|
float PagerXOffset;
|
|
|
|
int16 PagerSoundPlayed;
|
|
|
|
int16 OddJob2On;
|
|
|
|
uint16 OddJob2Timer;
|
|
|
|
float OddJob2XOffset;
|
|
|
|
float OddJob2OffTimer;
|
|
|
|
bool CounterOnLastFrame;
|
|
|
|
uint16 CounterFlashTimer;
|
|
|
|
bool TimerOnLastFrame;
|
|
|
|
uint16 TimerFlashTimer;
|
2020-04-10 11:06:49 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
RwTexture *gpSniperSightTex;
|
|
|
|
RwTexture *gpRocketSightTex;
|
2019-10-05 15:26:29 -04:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
const char *mask;
|
|
|
|
} WeaponFilenames[] = {
|
|
|
|
{"fist", "fistm"},
|
|
|
|
{"bat", "batm"},
|
|
|
|
{"pistol", "pistolm" },
|
|
|
|
{"uzi", "uzim"},
|
|
|
|
{"shotgun", "shotgunm"},
|
|
|
|
{"ak47", "ak47m"},
|
|
|
|
{"m16", "m16m"},
|
|
|
|
{"sniper", "sniperm"},
|
|
|
|
{"rocket", "rocketm"},
|
|
|
|
{"flame", "flamem"},
|
|
|
|
{"molotov", "molotovm"},
|
|
|
|
{"grenade", "grenadem"},
|
|
|
|
{"detonator", "detonator_mask"},
|
|
|
|
{"", ""},
|
|
|
|
{"", ""},
|
2020-04-10 11:06:49 -04:00
|
|
|
{"radardisc", "radardisc"},
|
2019-10-05 15:26:29 -04:00
|
|
|
{"pager", "pagerm"},
|
|
|
|
{"", ""},
|
|
|
|
{"", ""},
|
|
|
|
{"bleeder", ""},
|
|
|
|
{"sitesniper", "sitesniperm"},
|
|
|
|
{"siteM16", "siteM16m"},
|
2020-04-10 11:06:49 -04:00
|
|
|
{"siterocket", "siterocket"}
|
2019-06-16 13:06:01 -04:00
|
|
|
};
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
void CHud::Initialise()
|
|
|
|
{
|
|
|
|
m_Wants_To_Draw_Hud = true;
|
|
|
|
m_Wants_To_Draw_3dMarkers = true;
|
|
|
|
|
|
|
|
int HudTXD = CTxdStore::AddTxdSlot("hud");
|
|
|
|
CTxdStore::LoadTxd(HudTXD, "MODELS/HUD.TXD");
|
|
|
|
CTxdStore::AddRef(HudTXD);
|
|
|
|
CTxdStore::PopCurrentTxd();
|
|
|
|
CTxdStore::SetCurrentTxd(HudTXD);
|
|
|
|
|
|
|
|
for (int i = 0; i < NUM_HUD_SPRITES; i++) {
|
|
|
|
Sprites[i].SetTexture(WeaponFilenames[i].name, WeaponFilenames[i].mask);
|
|
|
|
}
|
|
|
|
|
|
|
|
GetRidOfAllHudMessages();
|
|
|
|
|
|
|
|
if (gpSniperSightTex == nil)
|
|
|
|
gpSniperSightTex = RwTextureRead("sitesniper", nil);
|
|
|
|
if (gpRocketSightTex == nil)
|
|
|
|
gpRocketSightTex = RwTextureRead("siterocket", nil);
|
|
|
|
|
|
|
|
CounterOnLastFrame = false;
|
|
|
|
m_ItemToFlash = ITEM_NONE;
|
|
|
|
OddJob2Timer = 0;
|
|
|
|
OddJob2OffTimer = 0.0f;
|
|
|
|
OddJob2On = 0;
|
|
|
|
OddJob2XOffset = 0.0f;
|
|
|
|
CounterFlashTimer = 0;
|
|
|
|
TimerOnLastFrame = false;
|
|
|
|
TimerFlashTimer = 0;
|
|
|
|
SpriteBrightness = 0;
|
|
|
|
PagerOn = 0;
|
|
|
|
PagerTimer = 0;
|
|
|
|
PagerSoundPlayed = 0;
|
|
|
|
PagerXOffset = 150.0f;
|
|
|
|
|
|
|
|
CTxdStore::PopCurrentTxd();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CHud::Shutdown()
|
|
|
|
{
|
|
|
|
for (int i = 0; i < NUM_HUD_SPRITES; ++i) {
|
|
|
|
Sprites[i].Delete();
|
|
|
|
}
|
|
|
|
|
|
|
|
RwTextureDestroy(gpSniperSightTex);
|
|
|
|
gpSniperSightTex = nil;
|
|
|
|
|
|
|
|
RwTextureDestroy(gpRocketSightTex);
|
|
|
|
gpRocketSightTex = nil;
|
|
|
|
|
|
|
|
int HudTXD = CTxdStore::FindTxdSlot("hud");
|
|
|
|
CTxdStore::RemoveTxdSlot(HudTXD);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CHud::ReInitialise() {
|
|
|
|
m_Wants_To_Draw_Hud = true;
|
|
|
|
m_Wants_To_Draw_3dMarkers = true;
|
|
|
|
|
|
|
|
GetRidOfAllHudMessages();
|
|
|
|
|
|
|
|
CounterOnLastFrame = false;
|
|
|
|
m_ItemToFlash = ITEM_NONE;
|
|
|
|
OddJob2Timer = 0;
|
|
|
|
OddJob2OffTimer = 0.0f;
|
|
|
|
OddJob2On = 0;
|
|
|
|
OddJob2XOffset = 0.0f;
|
|
|
|
CounterFlashTimer = 0;
|
|
|
|
TimerOnLastFrame = false;
|
|
|
|
TimerFlashTimer = 0;
|
|
|
|
SpriteBrightness = 0;
|
|
|
|
PagerOn = 0;
|
|
|
|
PagerTimer = 0;
|
|
|
|
PagerSoundPlayed = 0;
|
|
|
|
PagerXOffset = 150.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CHud::GetRidOfAllHudMessages()
|
|
|
|
{
|
|
|
|
m_ZoneState = 0;
|
|
|
|
m_pLastZoneName = nil;
|
|
|
|
m_ZoneNameTimer = 0;
|
|
|
|
m_pZoneName = nil;
|
|
|
|
|
|
|
|
for (int i = 0; i < HELP_MSG_LENGTH; i++) {
|
|
|
|
m_HelpMessage[i] = 0;
|
|
|
|
m_LastHelpMessage[i] = 0;
|
|
|
|
m_HelpMessageToPrint[i] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_HelpMessageTimer = 0;
|
|
|
|
m_HelpMessageFadeTimer = 0;
|
|
|
|
m_HelpMessageState = 0;
|
|
|
|
m_HelpMessageQuick = 0;
|
|
|
|
m_HelpMessageDisplayTime = 1.0f;
|
|
|
|
m_pVehicleName = nil;
|
|
|
|
m_pLastVehicleName = nil;
|
|
|
|
m_pVehicleNameToPrint = nil;
|
|
|
|
m_VehicleNameTimer = 0;
|
|
|
|
m_VehicleFadeTimer = 0;
|
|
|
|
m_VehicleState = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < ARRAY_SIZE(m_Message); i++)
|
|
|
|
m_Message[i] = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < 6; i++) {
|
|
|
|
BigMessageInUse[i] = 0.0f;
|
|
|
|
|
|
|
|
for (int j = 0; j < 128; j++)
|
|
|
|
m_BigMessage[i][j] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CHud::SetZoneName(wchar *name)
|
|
|
|
{
|
|
|
|
m_pZoneName = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CHud::SetHelpMessage(wchar *message, bool quick)
|
|
|
|
{
|
|
|
|
if (!CReplay::IsPlayingBack()) {
|
|
|
|
CMessages::WideStringCopy(m_HelpMessage, message, HELP_MSG_LENGTH);
|
|
|
|
CMessages::InsertPlayerControlKeysInString(m_HelpMessage);
|
|
|
|
|
|
|
|
for (int i = 0; i < HELP_MSG_LENGTH; i++) {
|
|
|
|
m_LastHelpMessage[i] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_HelpMessageState = 0;
|
|
|
|
m_HelpMessageQuick = quick;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CHud::SetVehicleName(wchar *name)
|
|
|
|
{
|
|
|
|
m_pVehicleName = name;
|
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-16 20:10:55 -04:00
|
|
|
void CHud::Draw()
|
|
|
|
{
|
2019-10-07 08:06:30 -04:00
|
|
|
// disable hud via second controller
|
|
|
|
if (CPad::GetPad(1)->GetStartJustDown())
|
|
|
|
m_Wants_To_Draw_Hud = !m_Wants_To_Draw_Hud;
|
2019-07-03 11:26:15 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef GTA_PC
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CReplay::IsPlayingBack())
|
|
|
|
return;
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
|
|
|
|
if (m_Wants_To_Draw_Hud && !TheCamera.m_WideScreenOn) {
|
2020-06-13 06:57:25 -04:00
|
|
|
bool DrawCrossHair = false;
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef GTA_PC
|
2020-06-13 06:57:25 -04:00
|
|
|
bool DrawCrossHairPC = false;
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
|
2020-01-07 09:23:09 -05:00
|
|
|
int32 WeaponType = FindPlayerPed()->m_weapons[FindPlayerPed()->m_currentWeapon].m_eWeaponType;
|
2019-06-29 11:54:09 -04:00
|
|
|
int32 Mode = TheCamera.Cams[TheCamera.ActiveCam].Mode;
|
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
if (Mode == CCam::MODE_SNIPER || Mode == CCam::MODE_ROCKETLAUNCHER || Mode == CCam::MODE_M16_1STPERSON
|
|
|
|
#ifdef GTA_PC
|
|
|
|
|| Mode == CCam::MODE_HELICANNON_1STPERSON
|
|
|
|
#endif
|
|
|
|
)
|
|
|
|
{
|
2020-06-13 06:57:25 -04:00
|
|
|
DrawCrossHair = true;
|
2020-12-07 13:12:13 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef GTA_PC
|
2020-03-26 09:16:06 -04:00
|
|
|
if (Mode == CCam::MODE_M16_1STPERSON_RUNABOUT || Mode == CCam::MODE_ROCKETLAUNCHER_RUNABOUT || Mode == CCam::MODE_SNIPER_RUNABOUT)
|
2020-06-13 06:57:25 -04:00
|
|
|
DrawCrossHairPC = true;
|
2019-06-29 11:54:09 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
Draw Crosshairs
|
|
|
|
*/
|
2020-03-26 09:16:06 -04:00
|
|
|
if (TheCamera.Cams[TheCamera.ActiveCam].Using3rdPersonMouseCam() &&
|
|
|
|
(!CPad::GetPad(0)->GetLookBehindForPed() || TheCamera.m_bPlayerIsInGarage) || Mode == CCam::MODE_1STPERSON_RUNABOUT) {
|
2020-03-07 14:22:43 -05:00
|
|
|
if (FindPlayerPed() && !FindPlayerPed()->EnteringCar()) {
|
|
|
|
if ((WeaponType >= WEAPONTYPE_COLT45 && WeaponType <= WEAPONTYPE_M16) || WeaponType == WEAPONTYPE_FLAMETHROWER)
|
2020-06-13 06:57:25 -04:00
|
|
|
DrawCrossHairPC = true;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
if ( DrawCrossHair
|
|
|
|
#ifdef GTA_PC
|
|
|
|
|| DrawCrossHairPC
|
|
|
|
#endif
|
|
|
|
)
|
|
|
|
{
|
2019-06-29 11:54:09 -04:00
|
|
|
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void *)rwFILTERLINEAR);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-04-19 12:34:08 -04:00
|
|
|
SpriteBrightness = Min(SpriteBrightness+1, 30);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-03-26 09:16:06 -04:00
|
|
|
float fStep = Sin((CTimer::GetTimeInMilliseconds() & 1023)/1024.0f * 6.28f);
|
2020-12-07 13:12:13 -05:00
|
|
|
float fMultBright = SpriteBrightness / 30.0f * (0.25f * fStep + 0.75f);
|
2019-06-29 11:54:09 -04:00
|
|
|
CRect rect;
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef GTA_PC
|
2020-03-26 09:16:06 -04:00
|
|
|
if (DrawCrossHairPC && TheCamera.Cams[TheCamera.ActiveCam].Using3rdPersonMouseCam()) {
|
2019-07-03 11:26:15 -04:00
|
|
|
float f3rdX = SCREEN_WIDTH * TheCamera.m_f3rdPersonCHairMultX;
|
|
|
|
float f3rdY = SCREEN_HEIGHT * TheCamera.m_f3rdPersonCHairMultY;
|
2020-04-15 18:44:02 -04:00
|
|
|
#ifdef ASPECT_RATIO_SCALE
|
|
|
|
f3rdY -= SCREEN_SCALE_Y(2.0f);
|
2019-07-03 11:26:15 -04:00
|
|
|
#endif
|
2020-01-07 09:23:09 -05:00
|
|
|
if (FindPlayerPed() && WeaponType == WEAPONTYPE_M16) {
|
2019-06-29 11:54:09 -04:00
|
|
|
rect.left = f3rdX - SCREEN_SCALE_X(32.0f * 0.6f);
|
|
|
|
rect.top = f3rdY - SCREEN_SCALE_Y(32.0f * 0.6f);
|
|
|
|
rect.right = f3rdX + SCREEN_SCALE_X(32.0f * 0.6f);
|
|
|
|
rect.bottom = f3rdY + SCREEN_SCALE_Y(32.0f * 0.6f);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-08-13 12:14:24 -04:00
|
|
|
Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
|
|
|
|
0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
else {
|
2019-06-29 11:54:09 -04:00
|
|
|
rect.left = f3rdX - SCREEN_SCALE_X(32.0f * 0.4f);
|
|
|
|
rect.top = f3rdY - SCREEN_SCALE_Y(32.0f * 0.4f);
|
|
|
|
rect.right = f3rdX + SCREEN_SCALE_X(32.0f * 0.4f);
|
|
|
|
rect.bottom = f3rdY + SCREEN_SCALE_Y(32.0f * 0.4f);
|
2019-06-28 07:28:42 -04:00
|
|
|
|
2020-08-13 12:14:24 -04:00
|
|
|
Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
|
|
|
|
0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
else
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
if (Mode == CCam::MODE_M16_1STPERSON
|
|
|
|
#ifdef GTA_PC
|
|
|
|
|| Mode == CCam::MODE_M16_1STPERSON_RUNABOUT
|
|
|
|
|| Mode == CCam::MODE_HELICANNON_1STPERSON
|
|
|
|
#endif
|
|
|
|
)
|
|
|
|
{
|
2019-06-29 11:54:09 -04:00
|
|
|
rect.left = (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(32.0f);
|
|
|
|
rect.top = (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(32.0f);
|
|
|
|
rect.right = (SCREEN_WIDTH / 2) + SCREEN_SCALE_X(32.0f);
|
|
|
|
rect.bottom = (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(32.0f);
|
2020-08-13 12:14:24 -04:00
|
|
|
Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
|
|
|
|
0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef GTA_PC
|
2020-03-26 09:16:06 -04:00
|
|
|
else if (Mode == CCam::MODE_1STPERSON_RUNABOUT) {
|
2019-06-29 11:54:09 -04:00
|
|
|
rect.left = (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(32.0f * 0.7f);
|
|
|
|
rect.top = (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(32.0f * 0.7f);
|
|
|
|
rect.right = (SCREEN_WIDTH / 2) + SCREEN_SCALE_X(32.0f * 0.7f);
|
|
|
|
rect.bottom = (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(32.0f * 0.7f);
|
|
|
|
|
2020-08-13 12:14:24 -04:00
|
|
|
Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
|
|
|
|
0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
|
|
|
else if (Mode == CCam::MODE_ROCKETLAUNCHER
|
|
|
|
#ifdef GTA_PC
|
|
|
|
|| Mode == CCam::MODE_ROCKETLAUNCHER_RUNABOUT
|
|
|
|
#endif
|
|
|
|
)
|
|
|
|
{
|
2019-06-29 11:54:09 -04:00
|
|
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE);
|
|
|
|
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDONE);
|
|
|
|
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDONE);
|
|
|
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
|
|
|
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
|
2020-03-26 09:16:06 -04:00
|
|
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpRocketSightTex));
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CSprite::RenderOneXLUSprite(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, 1.0f, 40.0f, 40.0f, (100.0f * fMultBright), (200.0f * fMultBright), (100.0f * fMultBright), 255, 1.0f, 255);
|
|
|
|
#else
|
2019-06-29 11:54:09 -04:00
|
|
|
CSprite::RenderOneXLUSprite(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, 1.0f, SCREEN_SCALE_X(40.0f), SCREEN_SCALE_Y(40.0f), (100.0f * fMultBright), (200.0f * fMultBright), (100.0f * fMultBright), 255, 1.0f, 255);
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
|
|
|
else {
|
2020-03-26 09:16:06 -04:00
|
|
|
// Sniper
|
2020-08-13 12:14:24 -04:00
|
|
|
rect.left = SCREEN_WIDTH/2 - SCREEN_SCALE_X(210.0f);
|
|
|
|
rect.top = SCREEN_HEIGHT/2 - SCREEN_SCALE_Y(210.0f);
|
|
|
|
rect.right = SCREEN_WIDTH/2;
|
|
|
|
rect.bottom = SCREEN_HEIGHT/2;
|
|
|
|
Sprites[HUD_SITESNIPER].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
|
|
|
|
0.01f, 0.01f, 1.0f, 0.0f, 0.01f, 1.0f, 1.0f, 1.0f);
|
|
|
|
|
|
|
|
rect.left = SCREEN_WIDTH/2;
|
|
|
|
rect.top = SCREEN_HEIGHT/2 - SCREEN_SCALE_Y(210.0f);
|
|
|
|
rect.right = SCREEN_WIDTH/2 + SCREEN_SCALE_X(210.0f);
|
|
|
|
rect.bottom = SCREEN_HEIGHT/2;
|
|
|
|
Sprites[HUD_SITESNIPER].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
|
|
|
|
0.99f, 0.0f, 0.01f, 0.01f, 0.99f, 1.0f, 0.01f, 1.0f);
|
|
|
|
|
|
|
|
rect.left = SCREEN_WIDTH/2 - SCREEN_SCALE_X(210.0f);
|
|
|
|
rect.top = SCREEN_HEIGHT/2;
|
|
|
|
rect.right = SCREEN_WIDTH/2;
|
|
|
|
rect.bottom = SCREEN_HEIGHT/2 + SCREEN_SCALE_Y(210.0f);
|
|
|
|
Sprites[HUD_SITESNIPER].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
|
|
|
|
0.01f, 0.99f, 1.0f, 0.99f, 0.01f, 0.01f, 1.0f, 0.01f);
|
|
|
|
|
|
|
|
rect.left = SCREEN_WIDTH/2;
|
|
|
|
rect.top = SCREEN_HEIGHT/2;
|
|
|
|
rect.right = SCREEN_WIDTH/2 + SCREEN_SCALE_X(210.0f);
|
|
|
|
rect.bottom = SCREEN_HEIGHT/2 + SCREEN_SCALE_Y(210.0f);
|
|
|
|
Sprites[HUD_SITESNIPER].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
|
2020-12-07 13:12:13 -05:00
|
|
|
0.99f, 0.99f, 0.01f, 0.99f, 0.99f, 0.01f, 0.01f, 0.01f);
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void *)rwFILTERLINEAR);
|
|
|
|
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDSRCALPHA);
|
|
|
|
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDINVSRCALPHA);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
SpriteBrightness = 0;
|
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawMoneyCounter
|
|
|
|
*/
|
|
|
|
wchar sPrint[16];
|
|
|
|
wchar sPrintIcon[16];
|
|
|
|
char sTemp[16];
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
sprintf(sTemp, "$%08d", CWorld::Players[CWorld::PlayerInFocus].m_nVisibleMoney);
|
|
|
|
AsciiToUnicode(sTemp, sPrint);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetPropOff();
|
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
|
|
|
CFont::SetCentreOff();
|
|
|
|
CFont::SetRightJustifyOn();
|
|
|
|
CFont::SetRightJustifyWrap(0.0f);
|
|
|
|
CFont::SetBackGroundOnlyTextOff();
|
|
|
|
CFont::SetFontStyle(FONT_HEADING);
|
|
|
|
CFont::SetPropOff();
|
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef PS2_HUD
|
|
|
|
#define MONEY_X 100.0f
|
|
|
|
#else
|
|
|
|
#define MONEY_X 110.0f
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MONEY_X) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(43.0f) + SCREEN_SCALE_Y(2.0f), sPrint);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MONEY_X) + 2.0f, SCREEN_SCALE_Y(43.0f) + 2.0f, sPrint);
|
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(MONEY_COLOR);
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MONEY_X), SCREEN_SCALE_Y(43.0f), sPrint);
|
|
|
|
|
|
|
|
#undef MONEY_X
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawAmmo
|
|
|
|
*/
|
2019-07-01 15:46:44 -04:00
|
|
|
uint32 AmmoAmount = CWeaponInfo::GetWeaponInfo(FindPlayerPed()->GetWeapon()->m_eWeaponType)->m_nAmountofAmmunition;
|
2020-01-07 09:23:09 -05:00
|
|
|
uint32 AmmoInClip = FindPlayerPed()->m_weapons[FindPlayerPed()->m_currentWeapon].m_nAmmoInClip;
|
|
|
|
uint32 TotalAmmo = FindPlayerPed()->m_weapons[FindPlayerPed()->m_currentWeapon].m_nAmmoTotal;
|
2019-07-01 15:46:44 -04:00
|
|
|
uint32 Ammo, Clip;
|
2019-06-29 11:54:09 -04:00
|
|
|
|
|
|
|
if (AmmoAmount <= 1 || AmmoAmount >= 1000)
|
|
|
|
sprintf(sTemp, "%d", TotalAmmo);
|
|
|
|
else {
|
|
|
|
if (WeaponType == WEAPONTYPE_FLAMETHROWER) {
|
|
|
|
Clip = AmmoInClip / 10;
|
|
|
|
|
|
|
|
if ((TotalAmmo - AmmoInClip) / 10 <= 9999)
|
|
|
|
Ammo = (TotalAmmo - AmmoInClip) / 10;
|
|
|
|
else
|
|
|
|
Ammo = 9999;
|
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
else {
|
2019-06-29 11:54:09 -04:00
|
|
|
Clip = AmmoInClip;
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-07-11 17:29:59 -04:00
|
|
|
if ((TotalAmmo - AmmoInClip) > 9999)
|
2019-06-29 11:54:09 -04:00
|
|
|
Ammo = 9999;
|
|
|
|
else
|
|
|
|
Ammo = TotalAmmo - AmmoInClip;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
sprintf(sTemp, "%d-%d", Ammo, Clip);
|
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
AsciiToUnicode(sTemp, sPrint);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawWeaponIcon
|
|
|
|
*/
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef PS2_HUD
|
|
|
|
#define WEAPON_X 91.0f
|
|
|
|
#define AMMO_X 59.0f
|
|
|
|
#else
|
|
|
|
#define WEAPON_X 99.0f
|
|
|
|
#define AMMO_X 66.0f
|
|
|
|
#endif
|
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
Sprites[WeaponType].Draw(
|
2020-12-07 13:12:13 -05:00
|
|
|
CRect(
|
|
|
|
SCREEN_WIDTH-SCREEN_SCALE_X(WEAPON_X),
|
|
|
|
SCREEN_SCALE_Y(27.0f),
|
|
|
|
SCREEN_WIDTH-SCREEN_SCALE_X(WEAPON_X)+SCREEN_SCALE_X(64.0f),
|
|
|
|
SCREEN_SCALE_Y(27.0f)+SCREEN_SCALE_Y(64.0f)),
|
2019-06-29 11:54:09 -04:00
|
|
|
CRGBA(255, 255, 255, 255),
|
|
|
|
0.015f,
|
|
|
|
0.015f,
|
|
|
|
1.0f,
|
|
|
|
0.0f,
|
|
|
|
0.015f,
|
|
|
|
1.0f,
|
|
|
|
1.0f,
|
|
|
|
1.0f);
|
2020-12-07 13:12:13 -05:00
|
|
|
|
2019-10-03 17:49:11 -04:00
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.4f), SCREEN_SCALE_Y(0.6f));
|
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetCentreOn();
|
2020-10-25 13:51:27 -04:00
|
|
|
CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH));
|
2019-10-03 17:49:11 -04:00
|
|
|
CFont::SetPropOn();
|
|
|
|
CFont::SetFontStyle(FONT_BANK);
|
|
|
|
|
|
|
|
if (!CDarkel::FrenzyOnGoing() && WeaponType != WEAPONTYPE_UNARMED && WeaponType != WEAPONTYPE_BASEBALLBAT) {
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(AMMO_COLOR);
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(AMMO_X), SCREEN_SCALE_Y(73.0f), sPrint);
|
2019-10-03 17:49:11 -04:00
|
|
|
}
|
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
#undef WEAPON_X
|
|
|
|
#undef AMMO_X
|
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawHealth
|
|
|
|
*/
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
#ifdef PS2_HUD
|
|
|
|
#define HEALTH_X 100.0f
|
|
|
|
#else
|
|
|
|
#define HEALTH_X 110.0f
|
|
|
|
#endif
|
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetCentreOff();
|
|
|
|
CFont::SetRightJustifyWrap(0.0f);
|
|
|
|
CFont::SetRightJustifyOn();
|
|
|
|
CFont::SetPropOff();
|
|
|
|
CFont::SetFontStyle(FONT_HEADING);
|
|
|
|
|
|
|
|
if (m_ItemToFlash == ITEM_HEALTH && CTimer::GetFrameCounter() & 8
|
|
|
|
|| m_ItemToFlash != ITEM_HEALTH
|
2020-01-07 09:23:09 -05:00
|
|
|
|| FindPlayerPed()->m_fHealth < 10
|
2019-06-29 11:54:09 -04:00
|
|
|
&& CTimer::GetFrameCounter() & 8) {
|
2020-01-07 09:23:09 -05:00
|
|
|
if (FindPlayerPed()->m_fHealth >= 10
|
|
|
|
|| FindPlayerPed()->m_fHealth < 10 && CTimer::GetFrameCounter() & 8) {
|
2019-06-29 11:54:09 -04:00
|
|
|
|
|
|
|
AsciiToUnicode("{", sPrintIcon);
|
2020-05-02 16:38:52 -04:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
sprintf(sTemp, "%03d", int32(FindPlayerPed()->m_fHealth + 0.5f));
|
|
|
|
#else
|
2020-01-07 09:23:09 -05:00
|
|
|
sprintf(sTemp, "%03d", (int32)FindPlayerPed()->m_fHealth);
|
2020-05-02 16:38:52 -04:00
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
AsciiToUnicode(sTemp, sPrint);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + SCREEN_SCALE_Y(2.0f), sPrint);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + 2.0f, SCREEN_SCALE_Y(65.0f) + 2.0f, sPrint);
|
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss + 2000 || CTimer::GetFrameCounter() & 4) {
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + SCREEN_SCALE_X(2.0f) - SCREEN_SCALE_X(56.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + SCREEN_SCALE_Y(2.0f), sPrintIcon);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + 2.0f - SCREEN_SCALE_X(56.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + 2.0f, sPrintIcon);
|
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(HEALTH_COLOR);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X), SCREEN_SCALE_Y(65.0f), sPrint);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss + 2000 || CTimer::GetFrameCounter() & 4) {
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + SCREEN_SCALE_X(2.0f) - SCREEN_SCALE_X(56.0f), SCREEN_SCALE_Y(65.0f), sPrintIcon);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(HEALTH_X) + 2.0f - SCREEN_SCALE_X(56.0f), SCREEN_SCALE_Y(65.0f), sPrintIcon);
|
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
#undef HEALTH_X
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawArmour
|
|
|
|
*/
|
|
|
|
if (m_ItemToFlash == ITEM_ARMOUR && CTimer::GetFrameCounter() & 8 || m_ItemToFlash != ITEM_ARMOUR) {
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
2020-01-07 09:23:09 -05:00
|
|
|
if (FindPlayerPed()->m_fArmour > 1.0f) {
|
2019-06-29 11:54:09 -04:00
|
|
|
AsciiToUnicode("[", sPrintIcon);
|
2020-05-02 16:38:52 -04:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
sprintf(sTemp, "%03d", int32(FindPlayerPed()->m_fArmour + 0.5f));
|
|
|
|
#else
|
2020-01-07 09:23:09 -05:00
|
|
|
sprintf(sTemp, "%03d", (int32)FindPlayerPed()->m_fArmour);
|
2020-05-02 16:38:52 -04:00
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
AsciiToUnicode(sTemp, sPrint);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + SCREEN_SCALE_Y(2.0f), sPrint);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f) + 2.0f, SCREEN_SCALE_Y(65.0f) + 2.0f, sPrint);
|
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastArmourLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastArmourLoss + 2000 || CTimer::GetFrameCounter() & 4) {
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f) + SCREEN_SCALE_X(2.0f) - SCREEN_SCALE_X(54.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + SCREEN_SCALE_Y(2.0f), sPrintIcon);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f) + 2.0f - SCREEN_SCALE_X(54.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f) + 2.0f, sPrintIcon);
|
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(ARMOUR_COLOR);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f), SCREEN_SCALE_Y(65.0f), sPrint);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastArmourLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastArmourLoss + 2000 || CTimer::GetFrameCounter() & 1) {
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f) - SCREEN_SCALE_X(54.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(65.0f), sPrintIcon);
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawWantedLevel
|
|
|
|
*/
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
#ifdef PS2_HUD
|
|
|
|
#define STARS_X 49.0f
|
|
|
|
#else
|
|
|
|
#define STARS_X 60.0f
|
|
|
|
#endif
|
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetCentreOff();
|
|
|
|
CFont::SetRightJustifyOff();
|
|
|
|
CFont::SetPropOn();
|
|
|
|
CFont::SetFontStyle(FONT_HEADING);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
AsciiToUnicode("]", sPrintIcon);
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
float fStarsX = SCREEN_SCALE_FROM_RIGHT(STARS_X);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
for (int i = 0; i < 6; i++) {
|
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(fStarsX + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(87.0f) + SCREEN_SCALE_Y(2.0f), sPrintIcon);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(fStarsX + 2.0f, SCREEN_SCALE_Y(87.0f) + 2.0f, sPrintIcon);
|
|
|
|
#endif
|
2020-01-07 09:23:09 -05:00
|
|
|
if (FindPlayerPed()->m_pWanted->m_nWantedLevel > i
|
|
|
|
&& (CTimer::GetTimeInMilliseconds() > FindPlayerPed()->m_pWanted->m_nLastWantedLevelChange
|
2019-06-29 11:54:09 -04:00
|
|
|
+ 2000 || CTimer::GetFrameCounter() & 4)) {
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(WANTED_COLOR);
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::PrintString(fStarsX, SCREEN_SCALE_Y(87.0f), sPrintIcon);
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
fStarsX -= SCREEN_SCALE_X(23.0f);
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
#undef STARS_X
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawZoneName
|
|
|
|
*/
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef PS2_HUD
|
|
|
|
#define ZONE_Y 61.0f
|
|
|
|
#else
|
|
|
|
#define ZONE_Y 30.0f
|
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_pZoneName) {
|
2020-04-10 11:06:49 -04:00
|
|
|
float fZoneAlpha = 255.0f;
|
2019-06-29 11:54:09 -04:00
|
|
|
|
|
|
|
if (m_pZoneName != m_pLastZoneName) {
|
|
|
|
switch (m_ZoneState) {
|
|
|
|
case 0:
|
|
|
|
m_ZoneState = 2;
|
|
|
|
m_ZoneToPrint = m_pZoneName;
|
|
|
|
m_ZoneNameTimer = 0;
|
|
|
|
m_ZoneFadeTimer = 0;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
case 3:
|
|
|
|
case 4:
|
2020-04-10 11:06:49 -04:00
|
|
|
m_ZoneNameTimer = 5;
|
2019-06-29 11:54:09 -04:00
|
|
|
m_ZoneState = 4;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
m_pLastZoneName = m_pZoneName;
|
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_ZoneState) {
|
|
|
|
switch (m_ZoneState) {
|
|
|
|
case 1:
|
2020-04-10 11:06:49 -04:00
|
|
|
m_ZoneFadeTimer = 1000;
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_ZoneNameTimer > 10000) {
|
|
|
|
m_ZoneFadeTimer = 1000;
|
|
|
|
m_ZoneState = 3;
|
|
|
|
}
|
|
|
|
fZoneAlpha = 255.0f;
|
|
|
|
break;
|
|
|
|
case 2:
|
2019-07-07 04:16:16 -04:00
|
|
|
m_ZoneFadeTimer += CTimer::GetTimeStepInMilliseconds();
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_ZoneFadeTimer > 1000) {
|
|
|
|
m_ZoneState = 1;
|
|
|
|
m_ZoneFadeTimer = 1000;
|
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
fZoneAlpha = m_ZoneFadeTimer / 1000.0f * 255.0f;
|
2019-06-29 11:54:09 -04:00
|
|
|
break;
|
|
|
|
case 3:
|
2019-07-07 04:16:16 -04:00
|
|
|
m_ZoneFadeTimer -= CTimer::GetTimeStepInMilliseconds();
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_ZoneFadeTimer < 0) {
|
|
|
|
m_ZoneState = 0;
|
|
|
|
m_ZoneFadeTimer = 0;
|
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
fZoneAlpha = m_ZoneFadeTimer / 1000.0f * 255.0f;
|
2019-06-29 11:54:09 -04:00
|
|
|
break;
|
|
|
|
case 4:
|
2019-07-07 04:16:16 -04:00
|
|
|
m_ZoneFadeTimer -= CTimer::GetTimeStepInMilliseconds();
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_ZoneFadeTimer < 0) {
|
2019-06-28 07:28:42 -04:00
|
|
|
m_ZoneFadeTimer = 0;
|
2019-06-29 11:54:09 -04:00
|
|
|
m_ZoneToPrint = m_pLastZoneName;
|
|
|
|
m_ZoneState = 2;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
fZoneAlpha = m_ZoneFadeTimer / 1000.0f * 255.0f;
|
2019-06-29 11:54:09 -04:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2020-04-18 12:13:47 -04:00
|
|
|
|
|
|
|
#ifndef HUD_ENHANCEMENTS
|
2020-12-07 13:12:13 -05:00
|
|
|
if (!m_Message[0])
|
2020-04-18 12:13:47 -04:00
|
|
|
#else
|
2020-12-07 13:12:13 -05:00
|
|
|
if (!m_Message[0] && !m_BigMessage[2][0]) // Hide zone name if wasted/busted text is displaying
|
2020-04-18 12:13:47 -04:00
|
|
|
#endif
|
2020-12-07 13:12:13 -05:00
|
|
|
{
|
2019-07-07 04:16:16 -04:00
|
|
|
m_ZoneNameTimer += CTimer::GetTimeStepInMilliseconds();
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetPropOn();
|
|
|
|
CFont::SetBackgroundOff();
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-06-27 17:01:51 -04:00
|
|
|
if (FrontEndMenuManager.m_PrefsLanguage == CMenuManager::LANGUAGE_SPANISH)
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.2f * 0.8f), SCREEN_SCALE_Y(1.2f));
|
|
|
|
else
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.2f));
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetRightJustifyOn();
|
|
|
|
CFont::SetRightJustifyWrap(0.0f);
|
|
|
|
CFont::SetBackGroundOnlyTextOff();
|
|
|
|
CFont::SetFontStyle(FONT_BANK);
|
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, fZoneAlpha));
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + SCREEN_SCALE_X(1.0f), SCREEN_SCALE_FROM_BOTTOM(ZONE_Y) + SCREEN_SCALE_Y(1.0f), m_ZoneToPrint);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + 1.0f, SCREEN_SCALE_FROM_BOTTOM(ZONE_Y) + 1.0f, m_ZoneToPrint);
|
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(CRGBA(ZONE_COLOR.r, ZONE_COLOR.g, ZONE_COLOR.b, fZoneAlpha));
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f), SCREEN_SCALE_FROM_BOTTOM(ZONE_Y), m_ZoneToPrint);
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
#undef ZONE_Y
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawVehicleName
|
|
|
|
*/
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
#ifdef PS2_HUD
|
|
|
|
#define VEHICLE_Y 81.0f
|
|
|
|
#else
|
|
|
|
#define VEHICLE_Y 55.0f
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (m_pVehicleName) {
|
2019-06-29 11:54:09 -04:00
|
|
|
float fVehicleAlpha = 0.0f;
|
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
if (m_pVehicleName != m_pLastVehicleName) {
|
2019-06-29 11:54:09 -04:00
|
|
|
switch (m_VehicleState) {
|
|
|
|
case 0:
|
|
|
|
m_VehicleState = 2;
|
2020-12-07 13:12:13 -05:00
|
|
|
m_pVehicleNameToPrint = m_pVehicleName;
|
2019-06-29 11:54:09 -04:00
|
|
|
m_VehicleNameTimer = 0;
|
|
|
|
m_VehicleFadeTimer = 0;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
case 3:
|
|
|
|
case 4:
|
|
|
|
m_VehicleNameTimer = 0;
|
|
|
|
m_VehicleState = 4;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
m_pLastVehicleName = m_pVehicleName;
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_VehicleState) {
|
|
|
|
switch (m_VehicleState) {
|
|
|
|
case 1:
|
|
|
|
if (m_VehicleNameTimer > 10000) {
|
|
|
|
m_VehicleFadeTimer = 1000;
|
|
|
|
m_VehicleState = 3;
|
|
|
|
}
|
|
|
|
fVehicleAlpha = 255.0f;
|
|
|
|
break;
|
|
|
|
case 2:
|
2019-07-07 04:16:16 -04:00
|
|
|
m_VehicleFadeTimer += CTimer::GetTimeStepInMilliseconds();
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_VehicleFadeTimer > 1000) {
|
|
|
|
m_VehicleState = 1;
|
|
|
|
m_VehicleFadeTimer = 1000;
|
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
fVehicleAlpha = m_VehicleFadeTimer / 1000.0f * 255.0f;
|
2019-06-29 11:54:09 -04:00
|
|
|
break;
|
|
|
|
case 3:
|
2019-07-07 04:16:16 -04:00
|
|
|
m_VehicleFadeTimer -= CTimer::GetTimeStepInMilliseconds();
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_VehicleFadeTimer < 0) {
|
|
|
|
m_VehicleState = 0;
|
|
|
|
m_VehicleFadeTimer = 0;
|
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
fVehicleAlpha = m_VehicleFadeTimer / 1000.0f * 255.0f;
|
2019-06-29 11:54:09 -04:00
|
|
|
break;
|
|
|
|
case 4:
|
2019-07-07 04:16:16 -04:00
|
|
|
m_VehicleFadeTimer -= CTimer::GetTimeStepInMilliseconds();
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_VehicleFadeTimer < 0) {
|
2019-06-28 07:28:42 -04:00
|
|
|
m_VehicleFadeTimer = 0;
|
2019-06-29 11:54:09 -04:00
|
|
|
m_pVehicleNameToPrint = m_pLastVehicleName;
|
2019-06-28 07:28:42 -04:00
|
|
|
m_VehicleNameTimer = 0;
|
2019-06-29 11:54:09 -04:00
|
|
|
m_VehicleState = 2;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
fVehicleAlpha = m_VehicleFadeTimer / 1000.0f * 255.0f;
|
2019-06-29 11:54:09 -04:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
|
2020-04-18 12:13:47 -04:00
|
|
|
#ifndef HUD_ENHANCEMENTS
|
2020-12-07 13:12:13 -05:00
|
|
|
if (!m_Message[0])
|
2020-04-18 12:13:47 -04:00
|
|
|
#else
|
2020-12-07 13:12:13 -05:00
|
|
|
if (!m_Message[0] && !m_BigMessage[2][0]) // Hide vehicle name if wasted/busted text is displaying
|
2020-04-18 12:13:47 -04:00
|
|
|
#endif
|
2020-12-07 13:12:13 -05:00
|
|
|
{
|
2019-07-07 04:16:16 -04:00
|
|
|
m_VehicleNameTimer += CTimer::GetTimeStepInMilliseconds();
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetPropOn();
|
|
|
|
CFont::SetBackgroundOff();
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-06-27 17:01:51 -04:00
|
|
|
if (FrontEndMenuManager.m_PrefsLanguage != CMenuManager::LANGUAGE_ITALIAN && FrontEndMenuManager.m_PrefsLanguage != CMenuManager::LANGUAGE_SPANISH)
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.2f));
|
|
|
|
else
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.2f * 0.85f), SCREEN_SCALE_Y(1.2f));
|
2019-06-28 10:56:31 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetRightJustifyOn();
|
|
|
|
CFont::SetRightJustifyWrap(0.0f);
|
|
|
|
CFont::SetBackGroundOnlyTextOff();
|
|
|
|
CFont::SetFontStyle(FONT_BANK);
|
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, fVehicleAlpha));
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + SCREEN_SCALE_X(1.0f), SCREEN_SCALE_FROM_BOTTOM(VEHICLE_Y) + SCREEN_SCALE_Y(1.0f), m_pVehicleNameToPrint);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + 1.0f, SCREEN_SCALE_FROM_BOTTOM(VEHICLE_Y) + 1.0f, m_pVehicleNameToPrint);
|
|
|
|
#endif
|
2019-06-28 10:56:31 -04:00
|
|
|
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(CRGBA(VEHICLE_COLOR.r, VEHICLE_COLOR.g, VEHICLE_COLOR.b, fVehicleAlpha));
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f), SCREEN_SCALE_FROM_BOTTOM(VEHICLE_Y), m_pVehicleNameToPrint);
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2019-06-30 06:53:39 -04:00
|
|
|
m_pLastVehicleName = nil;
|
2019-06-29 11:54:09 -04:00
|
|
|
m_VehicleState = 0;
|
|
|
|
m_VehicleFadeTimer = 0;
|
|
|
|
m_VehicleNameTimer = 0;
|
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
#undef VEHICLE_Y
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-10-06 08:45:53 -04:00
|
|
|
/*
|
|
|
|
DrawClock
|
|
|
|
*/
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef PS2_HUD
|
|
|
|
#define CLOCK_X 101.0f
|
|
|
|
#else
|
|
|
|
#define CLOCK_X 111.0f
|
|
|
|
#endif
|
2020-02-25 14:01:56 -05:00
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetCentreOff();
|
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
|
|
|
CFont::SetBackGroundOnlyTextOff();
|
|
|
|
CFont::SetPropOff();
|
|
|
|
CFont::SetFontStyle(FONT_HEADING);
|
|
|
|
CFont::SetRightJustifyOn();
|
|
|
|
CFont::SetRightJustifyWrap(0.0f);
|
2019-10-06 08:45:53 -04:00
|
|
|
|
|
|
|
sprintf(sTemp, "%02d:%02d", CClock::GetHours(), CClock::GetMinutes());
|
|
|
|
AsciiToUnicode(sTemp, sPrint);
|
|
|
|
|
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(CLOCK_X) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(22.0f) + SCREEN_SCALE_Y(2.0f), sPrint);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(CLOCK_X) + 2.0f, SCREEN_SCALE_Y(22.0f) + 2.0f, sPrint);
|
|
|
|
#endif
|
2019-10-06 08:45:53 -04:00
|
|
|
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(CLOCK_COLOR);
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(CLOCK_X), SCREEN_SCALE_Y(22.0f), sPrint);
|
|
|
|
|
|
|
|
#undef CLOCK_X
|
2019-10-06 08:45:53 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawOnScreenTimer
|
|
|
|
*/
|
2019-10-24 19:25:11 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
wchar sTimer[16];
|
|
|
|
|
|
|
|
if (!CUserDisplay::OnscnTimer.m_sEntries[0].m_bTimerProcessed)
|
2020-04-10 11:06:49 -04:00
|
|
|
TimerOnLastFrame = false;
|
2019-06-29 11:54:09 -04:00
|
|
|
if (!CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterProcessed)
|
2020-04-10 11:06:49 -04:00
|
|
|
CounterOnLastFrame = false;
|
2019-06-29 11:54:09 -04:00
|
|
|
|
2020-01-07 09:23:09 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
#define TIMER_RIGHT_OFFSET 34.0f // Taken from VC frenzy timer
|
|
|
|
#else
|
|
|
|
#define TIMER_RIGHT_OFFSET 27.0f
|
|
|
|
#endif
|
2019-10-06 08:45:53 -04:00
|
|
|
if (CUserDisplay::OnscnTimer.m_bProcessed) {
|
|
|
|
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_bTimerProcessed) {
|
2019-06-29 11:54:09 -04:00
|
|
|
if (!TimerOnLastFrame)
|
|
|
|
TimerFlashTimer = 1;
|
|
|
|
|
2020-04-10 11:06:49 -04:00
|
|
|
TimerOnLastFrame = true;
|
2019-06-29 11:54:09 -04:00
|
|
|
|
|
|
|
if (TimerFlashTimer) {
|
|
|
|
if (++TimerFlashTimer > 50)
|
|
|
|
TimerFlashTimer = 0;
|
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CTimer::GetFrameCounter() & 4 || !TimerFlashTimer) {
|
|
|
|
AsciiToUnicode(CUserDisplay::OnscnTimer.m_sEntries[0].m_bTimerBuffer, sTimer);
|
2019-10-06 08:45:53 -04:00
|
|
|
CFont::SetPropOn();
|
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
|
|
|
CFont::SetRightJustifyOn();
|
|
|
|
CFont::SetRightJustifyWrap(0.0f);
|
2020-04-26 16:49:24 -04:00
|
|
|
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
|
2019-10-06 08:45:53 -04:00
|
|
|
CFont::SetPropOff();
|
|
|
|
CFont::SetBackGroundOnlyTextOn();
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
2020-01-07 09:23:09 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + SCREEN_SCALE_Y(2.0f), sTimer);
|
2020-12-07 13:12:13 -05:00
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + 2.0f, SCREEN_SCALE_Y(110.0f) + 2.0f, sTimer);
|
|
|
|
#endif
|
2019-10-06 08:45:53 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(TIMER_COLOR);
|
2020-01-07 09:23:09 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(110.0f), sTimer);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText[0]) {
|
2019-10-06 08:45:53 -04:00
|
|
|
CFont::SetPropOn();
|
2019-06-14 19:34:19 -04:00
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.8f * 0.8f), SCREEN_SCALE_Y(1.35f));
|
|
|
|
#ifdef FIX_BUGS
|
2020-01-07 09:23:09 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + SCREEN_SCALE_Y(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
|
2020-12-07 13:12:13 -05:00
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + 2.0f, TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
|
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(TIMER_COLOR);
|
2020-01-07 09:23:09 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f), SCREEN_SCALE_Y(110.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2019-10-06 08:45:53 -04:00
|
|
|
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterProcessed) {
|
2019-06-29 11:54:09 -04:00
|
|
|
if (!CounterOnLastFrame)
|
|
|
|
CounterFlashTimer = 1;
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-04-10 11:06:49 -04:00
|
|
|
CounterOnLastFrame = true;
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CounterFlashTimer) {
|
|
|
|
if (++CounterFlashTimer > 50)
|
|
|
|
CounterFlashTimer = 0;
|
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CTimer::GetFrameCounter() & 4 || !CounterFlashTimer) {
|
2020-02-01 11:40:54 -05:00
|
|
|
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_nType == COUNTER_DISPLAY_NUMBER) {
|
2019-06-29 11:54:09 -04:00
|
|
|
AsciiToUnicode(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer, sTimer);
|
2019-10-06 08:45:53 -04:00
|
|
|
CFont::SetPropOn();
|
2020-02-25 14:01:56 -05:00
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
|
|
|
CFont::SetCentreOff();
|
|
|
|
CFont::SetRightJustifyOn();
|
|
|
|
CFont::SetRightJustifyWrap(0.0f);
|
2020-04-26 16:49:24 -04:00
|
|
|
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
|
2020-02-25 14:01:56 -05:00
|
|
|
CFont::SetColor(CRGBA(244, 20, 20, 255));
|
2020-10-25 13:51:27 -04:00
|
|
|
CFont::SetWrapx(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH));
|
2020-02-25 14:01:56 -05:00
|
|
|
CFont::SetPropOff();
|
2019-10-06 08:45:53 -04:00
|
|
|
CFont::SetBackGroundOnlyTextOn();
|
|
|
|
|
2020-02-25 14:01:56 -05:00
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
2020-01-07 09:23:09 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), sTimer);
|
2020-12-07 13:12:13 -05:00
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + 2.0f, SCREEN_SCALE_Y(132.0f) + 2.0f, sTimer);
|
|
|
|
#endif
|
2019-10-06 08:45:53 -04:00
|
|
|
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(COUNTER_COLOR);
|
2020-01-07 09:23:09 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(132.0f), sTimer);
|
2020-02-01 11:40:54 -05:00
|
|
|
} else {
|
|
|
|
int counter = atoi(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer);
|
|
|
|
#ifdef FIX_BUGS
|
2020-04-19 12:34:08 -04:00
|
|
|
counter = Min(counter, 100);
|
2020-02-01 11:40:54 -05:00
|
|
|
#endif
|
2020-12-07 13:12:13 -05:00
|
|
|
CSprite2d::DrawRect
|
|
|
|
(
|
|
|
|
CRect
|
|
|
|
(
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f),
|
|
|
|
#else
|
|
|
|
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + 4.0f,
|
|
|
|
#endif
|
|
|
|
SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f),
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(4.0f),
|
|
|
|
#else
|
|
|
|
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + 4.0f,
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(PS2_HUD) || defined(FIX_BUGS)
|
|
|
|
SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)
|
|
|
|
#else
|
|
|
|
SCREEN_SCALE_Y(132.0f) + 11.0f + SCREEN_SCALE_Y(8.0f)
|
|
|
|
#endif
|
|
|
|
),
|
|
|
|
CRGBA(0, 106, 164, 80)
|
|
|
|
);
|
|
|
|
|
|
|
|
CSprite2d::DrawRect
|
|
|
|
(
|
|
|
|
CRect
|
|
|
|
(
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f),
|
|
|
|
#else
|
|
|
|
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + 4.0f,
|
|
|
|
#endif
|
|
|
|
SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f),
|
|
|
|
|
|
|
|
#if !defined(PS2_HUD) || defined(FIX_BUGS)
|
|
|
|
SCREEN_SCALE_X(counter) / 2.0f +
|
|
|
|
#else
|
|
|
|
(float)(counter) / 2.0f +
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2.0f + SCREEN_SCALE_X(4.0f),
|
|
|
|
#else
|
|
|
|
SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2.0f + 4.0f,
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(PS2_HUD) || defined(FIX_BUGS)
|
|
|
|
SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)
|
|
|
|
#else
|
|
|
|
SCREEN_SCALE_Y(132.0f) + 11.0f + SCREEN_SCALE_Y(8.0f)
|
|
|
|
#endif
|
|
|
|
),
|
|
|
|
CRGBA(0, 106, 164, 255)
|
|
|
|
);
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText[0]) {
|
2020-02-25 14:01:56 -05:00
|
|
|
CFont::SetPropOn();
|
2019-10-06 08:45:53 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(132.0f) + 2.0f, TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
|
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(COUNTER_COLOR);
|
2020-01-07 09:23:09 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f), SCREEN_SCALE_Y(132.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2020-01-07 09:23:09 -05:00
|
|
|
#undef TIMER_RIGHT_OFFSET
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
/////////////////////////////////
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawPager
|
|
|
|
*/
|
2020-04-10 11:06:49 -04:00
|
|
|
if (!m_PagerMessage[0] && PagerOn == 1) {
|
|
|
|
PagerSoundPlayed = false;
|
|
|
|
PagerOn = 2;
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
|
|
|
if (m_PagerMessage[0] || PagerOn == 2) {
|
|
|
|
if (!PagerOn) {
|
|
|
|
PagerOn = 1;
|
|
|
|
PagerXOffset = 150.0f;
|
|
|
|
}
|
|
|
|
if (PagerOn == 1) {
|
|
|
|
if (PagerXOffset > 0.0f) {
|
2020-04-10 11:06:49 -04:00
|
|
|
float fStep = PagerXOffset * 0.1f;
|
2019-06-29 11:54:09 -04:00
|
|
|
if (fStep > 10.0f)
|
|
|
|
fStep = 10.0f;
|
|
|
|
PagerXOffset -= fStep * CTimer::GetTimeStep();
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
if (!PagerSoundPlayed) {
|
2019-10-17 06:21:31 -04:00
|
|
|
DMAudio.PlayFrontEndSound(SOUND_PAGER, 0);
|
2019-06-29 11:54:09 -04:00
|
|
|
PagerSoundPlayed = 1;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
|
|
|
else if (PagerOn == 2) {
|
2020-04-10 11:06:49 -04:00
|
|
|
float fStep = PagerXOffset * 0.1f;
|
2019-06-29 11:54:09 -04:00
|
|
|
if (fStep < 2.0f)
|
|
|
|
fStep = 2.0f;
|
2020-04-10 11:06:49 -04:00
|
|
|
PagerXOffset += fStep;
|
2019-06-29 11:54:09 -04:00
|
|
|
if (PagerXOffset > 150.0f) {
|
2020-02-25 14:01:56 -05:00
|
|
|
PagerXOffset = 150.0f;
|
2019-06-29 11:54:09 -04:00
|
|
|
PagerOn = 0;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
Sprites[HUD_PAGER].Draw(CRect(SCREEN_SCALE_X(26.0f) - SCREEN_SCALE_X(PagerXOffset), SCREEN_SCALE_Y(27.0f), SCREEN_SCALE_X(160.0f) + SCREEN_SCALE_X(26.0f) - SCREEN_SCALE_X(PagerXOffset), SCREEN_SCALE_Y(80.0f) + SCREEN_SCALE_Y(27.0f)), CRGBA(255, 255, 255, 255));
|
|
|
|
#else
|
|
|
|
Sprites[HUD_PAGER].Draw(CRect(SCREEN_SCALE_X(26.0f) - PagerXOffset, SCREEN_SCALE_Y(27.0f), SCREEN_SCALE_X(160.0f) + SCREEN_SCALE_X(26.0f) - PagerXOffset, SCREEN_SCALE_Y(80.0f) + SCREEN_SCALE_Y(27.0f)), CRGBA(255, 255, 255, 255));
|
|
|
|
#endif
|
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.84f), SCREEN_SCALE_Y(1.0f));
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(PAGER_COLOR);
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetRightJustifyOff();
|
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetCentreOff();
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::SetWrapx(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH));
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetPropOff();
|
|
|
|
CFont::SetFontStyle(FONT_PAGER);
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_X(52.0f) - SCREEN_SCALE_X(PagerXOffset), SCREEN_SCALE_Y(54.0f), m_PagerMessage);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_X(52.0f) - PagerXOffset, SCREEN_SCALE_Y(54.0f), m_PagerMessage);
|
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-06-29 11:54:09 -04:00
|
|
|
DrawRadar
|
2019-06-14 19:34:19 -04:00
|
|
|
*/
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_ItemToFlash == ITEM_RADAR && CTimer::GetFrameCounter() & 8 || m_ItemToFlash != ITEM_RADAR) {
|
|
|
|
CRadar::DrawMap();
|
|
|
|
CRect rect(0.0f, 0.0f, SCREEN_SCALE_X(RADAR_WIDTH), SCREEN_SCALE_Y(RADAR_HEIGHT));
|
2020-04-02 02:19:33 -04:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
rect.Translate(SCREEN_SCALE_X(RADAR_LEFT), SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
|
|
|
|
#else
|
2019-07-03 07:13:55 -04:00
|
|
|
rect.Translate(RADAR_LEFT, SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
|
2020-04-02 02:19:33 -04:00
|
|
|
#endif
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
#ifdef PS2_HUD
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
rect.Grow(SCREEN_SCALE_X(2.0f), SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(2.0f), SCREEN_SCALE_Y(4.0f));
|
|
|
|
#else
|
|
|
|
rect.Grow(2.0f, 4.0f);
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
rect.Grow(SCREEN_SCALE_X(4.0f), SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(4.0f), SCREEN_SCALE_Y(4.0f));
|
|
|
|
#else
|
2019-06-29 11:54:09 -04:00
|
|
|
rect.Grow(4.0f);
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
|
|
|
#endif
|
2020-05-17 09:33:44 -04:00
|
|
|
Sprites[HUD_RADARDISC].Draw(rect, RADARDISC_COLOR);
|
2019-06-29 11:54:09 -04:00
|
|
|
CRadar::DrawBlips();
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
Draw3dMarkers
|
|
|
|
*/
|
|
|
|
if (m_Wants_To_Draw_3dMarkers && !TheCamera.m_WideScreenOn && !m_BigMessage[0][0] && !m_BigMessage[2][0]) {
|
|
|
|
CRadar::Draw3dMarkers();
|
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawScriptText
|
|
|
|
*/
|
|
|
|
if (!CTimer::GetIsUserPaused()) {
|
2020-04-10 11:06:49 -04:00
|
|
|
for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroTextLines); i++) {
|
2019-07-07 12:00:02 -04:00
|
|
|
if (CTheScripts::IntroTextLines[i].m_Text[0] && CTheScripts::IntroTextLines[i].m_bTextBeforeFade) {
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::SetScale(CTheScripts::IntroTextLines[i].m_fScaleX, CTheScripts::IntroTextLines[i].m_fScaleY);
|
|
|
|
#else
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(CTheScripts::IntroTextLines[i].m_fScaleX), SCREEN_SCALE_Y(CTheScripts::IntroTextLines[i].m_fScaleY * 0.5f));
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetColor(CTheScripts::IntroTextLines[i].m_sColor);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CTheScripts::IntroTextLines[i].m_bJustify)
|
|
|
|
CFont::SetJustifyOn();
|
|
|
|
else
|
|
|
|
CFont::SetJustifyOff();
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CTheScripts::IntroTextLines[i].m_bRightJustify)
|
|
|
|
CFont::SetRightJustifyOn();
|
|
|
|
else
|
|
|
|
CFont::SetRightJustifyOff();
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CTheScripts::IntroTextLines[i].m_bCentered)
|
|
|
|
CFont::SetCentreOn();
|
|
|
|
else
|
|
|
|
CFont::SetCentreOff();
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::SetWrapx(CTheScripts::IntroTextLines[i].m_fWrapX);
|
|
|
|
#else
|
|
|
|
CFont::SetWrapx(SCALE_AND_CENTER_X(CTheScripts::IntroTextLines[i].m_fWrapX));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::SetCentreSize(CTheScripts::IntroTextLines[i].m_fCenterSize);
|
|
|
|
#else
|
2020-10-25 13:51:27 -04:00
|
|
|
CFont::SetCentreSize(SCREEN_SCALE_X(CTheScripts::IntroTextLines[i].m_fCenterSize));
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CTheScripts::IntroTextLines[i].m_bBackground)
|
|
|
|
CFont::SetBackgroundOn();
|
|
|
|
else
|
|
|
|
CFont::SetBackgroundOff();
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetBackgroundColor(CTheScripts::IntroTextLines[i].m_sBackgroundColor);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CTheScripts::IntroTextLines[i].m_bBackgroundOnly)
|
|
|
|
CFont::SetBackGroundOnlyTextOn();
|
|
|
|
else
|
|
|
|
CFont::SetBackGroundOnlyTextOff();
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CTheScripts::IntroTextLines[i].m_bTextProportional)
|
|
|
|
CFont::SetPropOn();
|
|
|
|
else
|
|
|
|
CFont::SetPropOff();
|
|
|
|
|
2020-04-26 16:49:24 -04:00
|
|
|
CFont::SetFontStyle(FONT_LOCALE(CTheScripts::IntroTextLines[i].m_nFont));
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::PrintString(CTheScripts::IntroTextLines[i].m_fAtX, CTheScripts::IntroTextLines[i].m_fAtY, CTheScripts::IntroTextLines[i].m_Text);
|
|
|
|
#else
|
2020-09-27 12:21:16 -04:00
|
|
|
CFont::PrintString(SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH - CTheScripts::IntroTextLines[i].m_fAtX), SCREEN_SCALE_Y(DEFAULT_SCREEN_HEIGHT - CTheScripts::IntroTextLines[i].m_fAtY), CTheScripts::IntroTextLines[i].m_Text);
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2019-06-16 20:10:55 -04:00
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2020-04-10 11:06:49 -04:00
|
|
|
for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroRectangles); i++) {
|
|
|
|
intro_script_rectangle &IntroRect = CTheScripts::IntroRectangles[i];
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-04-10 11:06:49 -04:00
|
|
|
// Yeah, top and bottom changed place. R* vision
|
|
|
|
if (IntroRect.m_bIsUsed && IntroRect.m_bBeforeFade) {
|
|
|
|
if (IntroRect.m_nTextureId >= 0) {
|
2019-06-29 11:54:09 -04:00
|
|
|
CRect rect = {
|
2020-04-10 11:06:49 -04:00
|
|
|
IntroRect.m_sRect.left,
|
|
|
|
IntroRect.m_sRect.top,
|
|
|
|
IntroRect.m_sRect.right,
|
|
|
|
IntroRect.m_sRect.bottom };
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-04-10 11:06:49 -04:00
|
|
|
CTheScripts::ScriptSprites[IntroRect.m_nTextureId].Draw(rect, IntroRect.m_sColor);
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
CRect rect = {
|
2020-04-10 11:06:49 -04:00
|
|
|
IntroRect.m_sRect.left,
|
|
|
|
IntroRect.m_sRect.top,
|
|
|
|
IntroRect.m_sRect.right,
|
|
|
|
IntroRect.m_sRect.bottom };
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-04-10 11:06:49 -04:00
|
|
|
CSprite2d::DrawRect(rect, IntroRect.m_sColor);
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2019-06-16 20:10:55 -04:00
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawSubtitles
|
|
|
|
*/
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef PS2_HUD
|
|
|
|
#define SUBS_Y 83.0f
|
|
|
|
#else
|
|
|
|
#define SUBS_Y 68.0f
|
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_Message[0] && !m_BigMessage[2][0] && (FrontEndMenuManager.m_PrefsShowSubtitles == 1 || !TheCamera.m_WideScreenOn)) {
|
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetBackgroundColor(CRGBA(0, 0, 0, 128));
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::SetScale(0.48f, 1.12f);
|
|
|
|
#else
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.48f), SCREEN_SCALE_Y(1.12f));
|
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetCentreOn();
|
|
|
|
CFont::SetPropOn();
|
2020-04-26 16:49:24 -04:00
|
|
|
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef XBOX_SUBTITLES
|
|
|
|
float radarBulge = SCREEN_SCALE_X(45.0f) + SCREEN_SCALE_X(16.0f);
|
|
|
|
float rectWidth = SCREEN_WIDTH - SCREEN_SCALE_X(45.0f) - SCREEN_SCALE_X(16.0f) - radarBulge;
|
|
|
|
CFont::SetCentreSize(rectWidth);
|
|
|
|
CFont::SetColor(CRGBA(180, 180, 180, 255));
|
|
|
|
|
|
|
|
CFont::PrintOutlinedString(rectWidth / 2.0f + radarBulge, SCREEN_SCALE_Y(4.0f) + SCREEN_SCALE_FROM_BOTTOM(48.0f) - SCREEN_SCALE_Y(1), m_Message,
|
|
|
|
2.0f, true, CRGBA(0, 0, 0, 255));
|
|
|
|
#else
|
|
|
|
|
|
|
|
float radarBulge = SCREEN_SCALE_X(40.0f) + SCREEN_SCALE_X(8.0f);
|
|
|
|
float rectWidth = SCREEN_SCALE_FROM_RIGHT(50.0f) - SCREEN_SCALE_X(8.0f) - radarBulge;
|
|
|
|
CFont::SetCentreSize(rectWidth);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-10-05 15:26:29 -04:00
|
|
|
const int16 shadow = 1;
|
|
|
|
CFont::SetDropShadowPosition(shadow);
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetDropColor(CRGBA(0, 0, 0, 255));
|
|
|
|
CFont::SetColor(CRGBA(235, 235, 235, 255));
|
2019-10-05 15:26:29 -04:00
|
|
|
|
|
|
|
// I'm not sure shadow substaction was intentional here, might be a leftover if CFont::PrintString was used for a shadow draw call
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(FIX_BUGS)
|
|
|
|
CFont::PrintString(rectWidth / 2.0f + radarBulge - SCREEN_SCALE_X(shadow), SCREEN_SCALE_Y(4.0f) + SCREEN_SCALE_FROM_BOTTOM(SUBS_Y) - SCREEN_SCALE_Y(shadow), m_Message);
|
|
|
|
#elif defined(PS2_HUD)
|
|
|
|
CFont::PrintString(rectWidth / 2.0f + radarBulge - shadow, 4.0f + SCREEN_SCALE_FROM_BOTTOM(SUBS_Y) - shadow, m_Message);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(rectWidth / 2.0f + radarBulge - shadow, SCREEN_SCALE_Y(4.0f) + SCREEN_SCALE_FROM_BOTTOM(SUBS_Y) - shadow, m_Message);
|
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetDropShadowPosition(0);
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif // #ifdef XBOX_SUBTITLES
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
#undef SUBS_Y
|
2019-06-16 20:10:55 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
/*
|
|
|
|
DrawBigMessage
|
|
|
|
*/
|
|
|
|
// MissionCompleteFailedText
|
|
|
|
if (m_BigMessage[0][0]) {
|
|
|
|
if (BigMessageInUse[0] != 0.0f) {
|
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetBackGroundOnlyTextOff();
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
if (CGame::frenchGame || CGame::germanGame)
|
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::SetScale(1.8f, 1.8f);
|
|
|
|
#else
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.8f), SCREEN_SCALE_Y(1.8f));
|
|
|
|
#endif
|
|
|
|
else
|
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::SetScale(1.8f, 1.8f);
|
|
|
|
#else
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.8f), SCREEN_SCALE_Y(1.8f));
|
|
|
|
#endif
|
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetPropOn();
|
|
|
|
CFont::SetCentreOn();
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - 25));
|
|
|
|
CFont::SetColor(CRGBA(255, 255, 0, 255));
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetFontStyle(FONT_HEADING);
|
2019-06-20 09:18:15 -04:00
|
|
|
|
2020-09-27 12:21:16 -04:00
|
|
|
// Appearently sliding text in here was abandoned very early, since this text is centered now.
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
if (BigMessageX[0] >= SCALE_AND_CENTER_X(DEFAULT_SCREEN_HEIGHT-20))
|
|
|
|
#else
|
|
|
|
if (BigMessageX[0] >= SCREEN_WIDTH-20)
|
|
|
|
#endif
|
|
|
|
{
|
2019-10-05 15:26:29 -04:00
|
|
|
BigMessageInUse[0] += CTimer::GetTimeStep();
|
2019-06-16 20:10:55 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (BigMessageInUse[0] >= 120.0f) {
|
2020-02-25 14:01:56 -05:00
|
|
|
BigMessageInUse[0] = 120.0f;
|
2019-10-05 15:26:29 -04:00
|
|
|
BigMessageAlpha[0] -= (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2019-06-16 20:10:55 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (BigMessageAlpha[0] <= 0.0f) {
|
|
|
|
m_BigMessage[0][0] = 0;
|
2020-02-25 14:01:56 -05:00
|
|
|
BigMessageAlpha[0] = 0.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
2020-09-27 12:21:16 -04:00
|
|
|
BigMessageX[0] += SCREEN_SCALE_X((CTimer::GetTimeStepInMilliseconds() * 0.3f));
|
2020-12-07 13:12:13 -05:00
|
|
|
#else
|
|
|
|
BigMessageX[0] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
|
|
|
#endif
|
2019-10-05 15:26:29 -04:00
|
|
|
BigMessageAlpha[0] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
2019-06-29 11:54:09 -04:00
|
|
|
|
2020-04-10 11:06:49 -04:00
|
|
|
if (BigMessageAlpha[0] > 255.0f)
|
2019-06-29 11:54:09 -04:00
|
|
|
BigMessageAlpha[0] = 255.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
|
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[0]));
|
2019-10-05 15:26:29 -04:00
|
|
|
#ifdef FIX_BUGS
|
2020-09-27 12:21:16 -04:00
|
|
|
#define Y_OFFSET 18.0f
|
2019-10-05 15:26:29 -04:00
|
|
|
#else
|
2020-09-27 12:21:16 -04:00
|
|
|
#define Y_OFFSET 20.0f
|
2019-10-05 15:26:29 -04:00
|
|
|
#endif
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
#if defined(FIX_BUGS)
|
2020-09-27 12:21:16 -04:00
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(Y_OFFSET) + SCREEN_SCALE_Y(2.0f), m_BigMessage[0]);
|
2020-12-07 13:12:13 -05:00
|
|
|
#elif defined(PS2_HUD) // yeah, that's right. ps2 uses y=ScaleX(a)
|
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2 + 2.0f, (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(120.0f) + 2.0f, m_BigMessage[0]);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2 + 2.0f, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(Y_OFFSET) + 2.0f, m_BigMessage[0]);
|
|
|
|
#endif
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(CRGBA(BIGMESSAGE_COLOR.r, BIGMESSAGE_COLOR.g, BIGMESSAGE_COLOR.b, BigMessageAlpha[0]));
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS) // same
|
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2, (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(120.0f), m_BigMessage[0]);
|
|
|
|
#else
|
2019-10-05 15:26:29 -04:00
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(18.0f), m_BigMessage[0]);
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2020-09-27 12:21:16 -04:00
|
|
|
|
|
|
|
#undef Y_OFFSET
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
else {
|
2019-06-29 11:54:09 -04:00
|
|
|
BigMessageAlpha[0] = 0.0f;
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
2020-10-25 13:51:27 -04:00
|
|
|
BigMessageX[0] = SCALE_AND_CENTER_X(-60.0f);
|
2020-12-07 13:12:13 -05:00
|
|
|
#else
|
|
|
|
BigMessageX[0] = -60.0f;
|
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
BigMessageInUse[0] = 1.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
BigMessageInUse[0] = 0.0f;
|
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
// WastedBustedText
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef PS2_HUD
|
|
|
|
#define WASTEDBUSTED_Y 122.0f
|
|
|
|
#else
|
|
|
|
#define WASTEDBUSTED_Y 82.0f
|
|
|
|
#endif
|
2019-06-29 11:54:09 -04:00
|
|
|
if (m_BigMessage[2][0]) {
|
|
|
|
if (BigMessageInUse[2] != 0.0f) {
|
2020-09-30 13:02:47 -04:00
|
|
|
BigMessageAlpha[2] += (CTimer::GetTimeStepInMilliseconds() * 0.4f);
|
2019-06-16 20:10:55 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
if (BigMessageAlpha[2] > 255.0f)
|
2020-02-25 14:01:56 -05:00
|
|
|
BigMessageAlpha[2] = 255.0f;
|
2019-06-16 20:10:55 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetBackgroundOff();
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
if (CGame::frenchGame || CGame::germanGame)
|
|
|
|
CFont::SetScale(1.4f, 1.4f);
|
|
|
|
else
|
|
|
|
CFont::SetScale(2.0f, 2.0f);
|
|
|
|
#else
|
2019-06-29 11:54:09 -04:00
|
|
|
if (CGame::frenchGame || CGame::germanGame)
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.4f), SCREEN_SCALE_Y(1.4f));
|
|
|
|
else
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(2.0f));
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-06-29 11:54:09 -04:00
|
|
|
CFont::SetPropOn();
|
|
|
|
CFont::SetRightJustifyOn();
|
|
|
|
CFont::SetFontStyle(FONT_HEADING);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[2]*0.75f));
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_FROM_BOTTOM(WASTEDBUSTED_Y) + SCREEN_SCALE_Y(4.0f), m_BigMessage[2]);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + 4.0f, SCREEN_SCALE_FROM_BOTTOM(WASTEDBUSTED_Y) + SCREEN_SCALE_Y(4.0f), m_BigMessage[2]);
|
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(CRGBA(WASTEDBUSTED_COLOR.r, WASTEDBUSTED_COLOR.g, WASTEDBUSTED_COLOR.b, BigMessageAlpha[2]));
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(WASTEDBUSTED_Y), m_BigMessage[2]);
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
else {
|
2020-02-25 14:01:56 -05:00
|
|
|
BigMessageAlpha[2] = 0.0f;
|
|
|
|
BigMessageInUse[2] = 1.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
}
|
2019-06-29 11:54:09 -04:00
|
|
|
else {
|
2020-02-25 14:01:56 -05:00
|
|
|
BigMessageInUse[2] = 0.0f;
|
2019-06-29 11:54:09 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
#undef WASTEDBUSTED_Y
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
}
|
2019-06-27 03:47:03 -04:00
|
|
|
|
2019-06-16 20:10:55 -04:00
|
|
|
void CHud::DrawAfterFade()
|
|
|
|
{
|
2019-06-22 14:16:29 -04:00
|
|
|
if (CTimer::GetIsUserPaused() || CReplay::IsPlayingBack())
|
2019-06-14 19:34:19 -04:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (m_HelpMessage[0]) {
|
2020-10-18 12:16:37 -04:00
|
|
|
if (!CMessages::WideStringCompare(m_HelpMessage, m_LastHelpMessage, HELP_MSG_LENGTH)) {
|
2019-06-14 19:34:19 -04:00
|
|
|
switch (m_HelpMessageState) {
|
|
|
|
case 0:
|
|
|
|
m_HelpMessageFadeTimer = 0;
|
|
|
|
m_HelpMessageState = 2;
|
|
|
|
m_HelpMessageTimer = 0;
|
2020-10-18 12:16:37 -04:00
|
|
|
CMessages::WideStringCopy(m_HelpMessageToPrint, m_HelpMessage, HELP_MSG_LENGTH);
|
2020-12-07 13:12:13 -05:00
|
|
|
m_HelpMessageDisplayTime = CMessages::GetWideStringLength(m_HelpMessage) / 20.0f + 3.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
|
|
|
|
if (TheCamera.m_ScreenReductionPercentage == 0.0f)
|
2020-06-03 23:03:12 -04:00
|
|
|
DMAudio.PlayFrontEndSound(SOUND_HUD, 0);
|
2019-06-14 19:34:19 -04:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
case 3:
|
|
|
|
case 4:
|
|
|
|
m_HelpMessageTimer = 5;
|
|
|
|
m_HelpMessageState = 4;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2020-10-18 12:16:37 -04:00
|
|
|
CMessages::WideStringCopy(m_LastHelpMessage, m_HelpMessage, HELP_MSG_LENGTH);
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
|
2020-04-10 11:06:49 -04:00
|
|
|
float fAlpha = 225.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-04-10 11:06:49 -04:00
|
|
|
if (m_HelpMessageState != 0) {
|
2019-06-14 19:34:19 -04:00
|
|
|
switch (m_HelpMessageState) {
|
|
|
|
case 1:
|
2020-04-10 11:06:49 -04:00
|
|
|
fAlpha = 225.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
m_HelpMessageFadeTimer = 600;
|
2020-10-18 12:16:37 -04:00
|
|
|
if (m_HelpMessageTimer > m_HelpMessageDisplayTime * 1000.0f || m_HelpMessageQuick && m_HelpMessageTimer > 1500.0f) {
|
2019-06-14 19:34:19 -04:00
|
|
|
m_HelpMessageFadeTimer = 600;
|
|
|
|
m_HelpMessageState = 3;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
2019-07-07 04:16:16 -04:00
|
|
|
m_HelpMessageFadeTimer += 2 * CTimer::GetTimeStepInMilliseconds();
|
2019-06-14 19:34:19 -04:00
|
|
|
if (m_HelpMessageFadeTimer > 0) {
|
|
|
|
m_HelpMessageState = 1;
|
|
|
|
m_HelpMessageFadeTimer = 0;
|
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
fAlpha = m_HelpMessageFadeTimer / 1000.0f * 225.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
break;
|
|
|
|
case 3:
|
2019-07-07 04:16:16 -04:00
|
|
|
m_HelpMessageFadeTimer -= 2 * CTimer::GetTimeStepInMilliseconds();
|
2020-04-10 11:06:49 -04:00
|
|
|
if (m_HelpMessageFadeTimer < 0) {
|
2019-06-14 19:34:19 -04:00
|
|
|
m_HelpMessageState = 0;
|
|
|
|
m_HelpMessageFadeTimer = 0;
|
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
fAlpha = m_HelpMessageFadeTimer / 1000.0f * 225.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
break;
|
|
|
|
case 4:
|
2019-07-07 04:16:16 -04:00
|
|
|
m_HelpMessageFadeTimer -= 2 * CTimer::GetTimeStepInMilliseconds();
|
2020-04-10 11:06:49 -04:00
|
|
|
if (m_HelpMessageFadeTimer < 0) {
|
2019-06-14 19:34:19 -04:00
|
|
|
m_HelpMessageState = 2;
|
|
|
|
m_HelpMessageFadeTimer = 0;
|
2020-10-18 12:16:37 -04:00
|
|
|
CMessages::WideStringCopy(m_HelpMessageToPrint, m_LastHelpMessage, HELP_MSG_LENGTH);
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
fAlpha = m_HelpMessageFadeTimer / 1000.0f * 225.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2019-07-07 04:16:16 -04:00
|
|
|
m_HelpMessageTimer += CTimer::GetTimeStepInMilliseconds();
|
2019-06-14 19:34:19 -04:00
|
|
|
|
|
|
|
CFont::SetAlphaFade(fAlpha);
|
|
|
|
CFont::SetCentreOff();
|
|
|
|
CFont::SetPropOn();
|
|
|
|
|
|
|
|
if (CGame::germanGame)
|
2019-06-19 20:31:03 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.52f * 0.85f), SCREEN_SCALE_Y(1.1f * 0.85f));
|
2020-04-26 16:49:24 -04:00
|
|
|
#ifdef MORE_LANGUAGES
|
|
|
|
else if (CFont::IsJapanese())
|
2020-03-31 01:38:22 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.52f) * 1.35f, SCREEN_SCALE_Y(1.1f) * 1.25f);
|
2020-04-26 16:49:24 -04:00
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
else
|
2019-06-19 20:31:03 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.52f), SCREEN_SCALE_Y(1.1f));
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-04-10 11:06:49 -04:00
|
|
|
CFont::SetColor(CRGBA(175, 175, 175, 255));
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::SetJustifyOff();
|
2020-04-26 16:49:24 -04:00
|
|
|
#ifdef MORE_LANGUAGES
|
|
|
|
if (CFont::IsJapanese())
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::SetWrapx(SCREEN_SCALE_X(229.0f) + SCREEN_SCALE_X(26.0f) - SCREEN_SCALE_X(4.0f));
|
|
|
|
#else
|
|
|
|
CFont::SetWrapx(SCREEN_SCALE_X(229.0f) + SCREEN_SCALE_X(26.0f) - 4.0f);
|
|
|
|
#endif
|
2020-03-31 01:38:22 -04:00
|
|
|
else
|
2020-04-26 16:49:24 -04:00
|
|
|
#endif
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::SetWrapx(SCREEN_SCALE_X(200.0f) + SCREEN_SCALE_X(26.0f) - SCREEN_SCALE_X(4.0f));
|
|
|
|
#else
|
|
|
|
CFont::SetWrapx(SCREEN_SCALE_X(200.0f) + SCREEN_SCALE_X(26.0f) - 4.0f);
|
|
|
|
#endif
|
2020-04-26 16:49:24 -04:00
|
|
|
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
|
2019-06-14 19:34:19 -04:00
|
|
|
CFont::SetBackgroundOn();
|
|
|
|
CFont::SetBackGroundOnlyTextOff();
|
2020-04-10 11:06:49 -04:00
|
|
|
CFont::SetBackgroundColor(CRGBA(0, 0, 0, fAlpha * 0.9f));
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::SetColor(CRGBA(175, 175, 175, 255));
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString(SCREEN_SCALE_X(26.0f), SCREEN_SCALE_Y(28.0f + (150.0f - PagerXOffset) * 0.6f), m_HelpMessageToPrint);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_X(26.0f), SCREEN_SCALE_Y(28.0f) + (150.0f - PagerXOffset) * 0.6f, m_HelpMessageToPrint);
|
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
CFont::SetAlphaFade(255.0f);
|
|
|
|
}
|
|
|
|
}
|
2020-04-10 11:06:49 -04:00
|
|
|
|
|
|
|
for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroTextLines); i++) {
|
|
|
|
intro_text_line &line = CTheScripts::IntroTextLines[i];
|
|
|
|
if (line.m_Text[0] != '\0' && !line.m_bTextBeforeFade) {
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::SetScale(line.m_fScaleX, line.m_fScaleY);
|
|
|
|
#else
|
2020-04-10 11:06:49 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(line.m_fScaleX), SCREEN_SCALE_Y(line.m_fScaleY) / 2);
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2020-04-10 11:06:49 -04:00
|
|
|
CFont::SetColor(line.m_sColor);
|
|
|
|
if (line.m_bJustify)
|
|
|
|
CFont::SetJustifyOn();
|
|
|
|
else
|
|
|
|
CFont::SetJustifyOff();
|
|
|
|
|
|
|
|
if (line.m_bRightJustify)
|
|
|
|
CFont::SetRightJustifyOn();
|
|
|
|
else
|
|
|
|
CFont::SetRightJustifyOff();
|
|
|
|
|
|
|
|
if (line.m_bCentered)
|
|
|
|
CFont::SetCentreOn();
|
|
|
|
else
|
|
|
|
CFont::SetCentreOff();
|
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::SetWrapx(line.m_fWrapX);
|
|
|
|
CFont::SetCentreSize(line.m_fCenterSize);
|
|
|
|
#else
|
|
|
|
CFont::SetWrapx(SCALE_AND_CENTER_X(line.m_fWrapX));
|
2020-10-25 13:51:27 -04:00
|
|
|
CFont::SetCentreSize(SCREEN_SCALE_X(line.m_fCenterSize));
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
|
|
|
|
2020-04-10 11:06:49 -04:00
|
|
|
if (line.m_bBackground)
|
|
|
|
CFont::SetBackgroundOn();
|
|
|
|
else
|
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
|
|
|
|
CFont::SetBackgroundColor(line.m_sBackgroundColor);
|
|
|
|
if (line.m_bBackgroundOnly)
|
|
|
|
CFont::SetBackGroundOnlyTextOn();
|
|
|
|
else
|
|
|
|
CFont::SetBackGroundOnlyTextOff();
|
|
|
|
|
|
|
|
if (line.m_bTextProportional)
|
|
|
|
CFont::SetPropOn();
|
|
|
|
else
|
|
|
|
CFont::SetPropOff();
|
|
|
|
|
|
|
|
CFont::SetFontStyle(line.m_nFont);
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::PrintString(line.m_fAtX, line.m_fAtY, line.m_Text);
|
|
|
|
#else
|
2020-09-27 12:21:16 -04:00
|
|
|
CFont::PrintString(SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH - line.m_fAtX), SCREEN_SCALE_Y(DEFAULT_SCREEN_HEIGHT - line.m_fAtY), line.m_Text);
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2020-04-10 11:06:49 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
for (int i = 0; i < ARRAY_SIZE(CTheScripts::IntroRectangles); i++) {
|
|
|
|
intro_script_rectangle &rectangle = CTheScripts::IntroRectangles[i];
|
|
|
|
if (rectangle.m_bIsUsed && !rectangle.m_bBeforeFade) {
|
|
|
|
|
|
|
|
// Yeah, top and bottom changed place. R* vision
|
|
|
|
if (rectangle.m_nTextureId >= 0) {
|
|
|
|
CTheScripts::ScriptSprites[rectangle.m_nTextureId].Draw(CRect(rectangle.m_sRect.left, rectangle.m_sRect.bottom,
|
|
|
|
rectangle.m_sRect.right, rectangle.m_sRect.top), rectangle.m_sColor);
|
|
|
|
} else {
|
|
|
|
CSprite2d::DrawRect(CRect(rectangle.m_sRect.left, rectangle.m_sRect.bottom,
|
|
|
|
rectangle.m_sRect.right, rectangle.m_sRect.top), rectangle.m_sColor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
DrawBigMessage2
|
|
|
|
*/
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef PS2_HUD
|
|
|
|
#define BIGMESSAGE_Y 80.0f
|
|
|
|
#else
|
|
|
|
#define BIGMESSAGE_Y 84.0f
|
|
|
|
#endif
|
|
|
|
|
2019-06-14 19:34:19 -04:00
|
|
|
// Oddjob
|
2019-10-05 15:26:29 -04:00
|
|
|
if (m_BigMessage[3][0]) {
|
2019-06-14 19:34:19 -04:00
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetBackgroundOff();
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::SetScale(1.2f, 1.5f);
|
|
|
|
#else
|
2019-06-19 20:31:03 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f));
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
CFont::SetCentreOn();
|
|
|
|
CFont::SetPropOn();
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - 40));
|
2020-04-26 16:49:24 -04:00
|
|
|
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
|
2019-06-14 19:34:19 -04:00
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y) + SCREEN_SCALE_Y(2.0f), m_BigMessage[3]);
|
|
|
|
#else
|
|
|
|
CFont::PrintString((SCREEN_WIDTH / 2) + 2.0f, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y) + 2.0f, m_BigMessage[3]);
|
|
|
|
#endif
|
2019-10-05 15:26:29 -04:00
|
|
|
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(ODDJOB_COLOR);
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y), m_BigMessage[3]);
|
2019-10-05 15:26:29 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!m_BigMessage[1][0] && m_BigMessage[4][0]) {
|
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetBackgroundOff();
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::SetScale(1.2f, 1.5f);
|
|
|
|
#else
|
2019-10-05 15:26:29 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.5f));
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2019-10-05 15:26:29 -04:00
|
|
|
CFont::SetCentreOn();
|
|
|
|
CFont::SetPropOn();
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH - 20));
|
2019-10-05 15:26:29 -04:00
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
2020-04-26 16:49:24 -04:00
|
|
|
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
|
2019-10-05 15:26:29 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CFont::PrintString((SCREEN_WIDTH / 2) - SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y) - SCREEN_SCALE_Y(2.0f), m_BigMessage[4]);
|
|
|
|
#else
|
|
|
|
CFont::PrintString((SCREEN_WIDTH / 2) - 2.0f, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y) - 2.0f, m_BigMessage[4]);
|
|
|
|
#endif
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(ODDJOB_COLOR);
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(BIGMESSAGE_Y), m_BigMessage[4]);
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
#undef BIGMESSAGE_Y
|
2019-06-14 19:34:19 -04:00
|
|
|
|
|
|
|
// Oddjob result
|
|
|
|
if (OddJob2OffTimer > 0)
|
2019-10-05 15:26:29 -04:00
|
|
|
OddJob2OffTimer -= CTimer::GetTimeStepInMilliseconds();
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-04-10 11:06:49 -04:00
|
|
|
float fStep;
|
2019-10-05 15:26:29 -04:00
|
|
|
if (m_BigMessage[5][0] && OddJob2OffTimer <= 0.0f) {
|
2020-04-10 11:06:49 -04:00
|
|
|
switch (OddJob2On) {
|
2019-10-05 15:26:29 -04:00
|
|
|
case 0:
|
|
|
|
OddJob2On = 1;
|
|
|
|
OddJob2XOffset = 380.0f;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (OddJob2XOffset <= 2.0f) {
|
|
|
|
OddJob2Timer = 0;
|
|
|
|
OddJob2On = 2;
|
|
|
|
}
|
|
|
|
else {
|
2020-04-19 12:34:08 -04:00
|
|
|
fStep = Min(40.0f, OddJob2XOffset / 6.0f);
|
2019-10-05 15:26:29 -04:00
|
|
|
OddJob2XOffset = OddJob2XOffset - fStep;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
2020-09-30 13:02:47 -04:00
|
|
|
OddJob2Timer += CTimer::GetTimeStepInMilliseconds();
|
2019-10-05 15:26:29 -04:00
|
|
|
if (OddJob2Timer > 1500) {
|
|
|
|
OddJob2On = 3;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
2020-04-19 12:34:08 -04:00
|
|
|
fStep = Max(30.0f, OddJob2XOffset / 5.0f);
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-10-05 15:26:29 -04:00
|
|
|
OddJob2XOffset = OddJob2XOffset - fStep;
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2019-10-05 15:26:29 -04:00
|
|
|
if (OddJob2XOffset < -380.0f) {
|
|
|
|
OddJob2OffTimer = 5000.0f;
|
|
|
|
OddJob2On = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
|
2019-10-05 15:26:29 -04:00
|
|
|
if (!m_BigMessage[1][0]) {
|
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.0f), SCREEN_SCALE_Y(1.2f));
|
|
|
|
CFont::SetCentreOn();
|
|
|
|
CFont::SetPropOn();
|
2020-12-07 13:12:13 -05:00
|
|
|
CFont::SetCentreSize(SCREEN_WIDTH-SCREEN_SCALE_X(20.0f));
|
2019-10-05 15:26:29 -04:00
|
|
|
CFont::SetColor(CRGBA(0, 0, 0, 255));
|
2020-04-26 16:49:24 -04:00
|
|
|
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
|
2019-06-20 09:18:15 -04:00
|
|
|
|
2020-04-20 00:45:17 -04:00
|
|
|
#ifdef BETA_SLIDING_TEXT
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2 + 2.0f - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + 2.0f, m_BigMessage[5]);
|
|
|
|
#else
|
2020-04-20 00:45:17 -04:00
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f) - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[5]);
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(ODDJOB2_COLOR);
|
2020-04-20 00:45:17 -04:00
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2 - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]);
|
|
|
|
#else
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2 + 2.0f, SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + 2.0f, m_BigMessage[5]);
|
|
|
|
#else
|
2019-10-05 15:26:29 -04:00
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[5]);
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(ODDJOB2_COLOR);
|
2019-10-05 15:26:29 -04:00
|
|
|
CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]);
|
2020-04-20 00:45:17 -04:00
|
|
|
#endif
|
2019-10-05 15:26:29 -04:00
|
|
|
}
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
DrawMissionTitle
|
|
|
|
*/
|
|
|
|
if (m_BigMessage[1][0]) {
|
2019-06-20 09:18:15 -04:00
|
|
|
if (BigMessageInUse[1] != 0.0f) {
|
2019-06-14 19:34:19 -04:00
|
|
|
CFont::SetJustifyOff();
|
|
|
|
CFont::SetBackgroundOff();
|
|
|
|
|
2020-06-27 17:01:51 -04:00
|
|
|
if (CGame::frenchGame || FrontEndMenuManager.m_PrefsLanguage == CMenuManager::LANGUAGE_SPANISH)
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::SetScale(0.884f, 1.36f);
|
|
|
|
#else
|
2019-06-19 20:31:03 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(0.884f), SCREEN_SCALE_Y(1.36f));
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
else
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::SetScale(1.04f, 1.6f);
|
|
|
|
#else
|
2019-06-19 20:31:03 -04:00
|
|
|
CFont::SetScale(SCREEN_SCALE_X(1.04f), SCREEN_SCALE_Y(1.6f));
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
|
|
|
|
CFont::SetPropOn();
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
//CFont::SetRightJustifyWrap(SCREEN_SCALE_FROM_RIGHT(DEFAULT_SCREEN_WIDTH + 500.0f));
|
2020-04-10 11:06:49 -04:00
|
|
|
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(-500.0f));
|
2020-12-07 13:12:13 -05:00
|
|
|
#else
|
|
|
|
CFont::SetRightJustifyWrap(-500.0f);
|
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
CFont::SetRightJustifyOn();
|
|
|
|
CFont::SetFontStyle(FONT_HEADING);
|
2020-12-07 13:12:13 -05:00
|
|
|
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
if (BigMessageX[1] >= SCREEN_WIDTH - SCREEN_SCALE_X(20.0f))
|
|
|
|
#else
|
|
|
|
if (BigMessageX[1] >= SCREEN_WIDTH - 20.0f)
|
|
|
|
#endif
|
|
|
|
{
|
2019-10-05 15:26:29 -04:00
|
|
|
BigMessageInUse[1] += CTimer::GetTimeStep();
|
2019-06-16 20:10:55 -04:00
|
|
|
|
2019-06-20 09:18:15 -04:00
|
|
|
if (BigMessageInUse[1] >= 120.0f) {
|
2020-02-25 14:01:56 -05:00
|
|
|
BigMessageInUse[1] = 120.0f;
|
2019-10-05 15:26:29 -04:00
|
|
|
BigMessageAlpha[1] -= (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
2019-06-20 09:18:15 -04:00
|
|
|
}
|
|
|
|
if (BigMessageAlpha[1] <= 0) {
|
|
|
|
m_BigMessage[1][0] = 0;
|
2020-02-25 14:01:56 -05:00
|
|
|
BigMessageAlpha[1] = 0.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2020-04-10 11:06:49 -04:00
|
|
|
} else {
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
2020-09-27 12:21:16 -04:00
|
|
|
BigMessageX[1] += SCREEN_SCALE_X((CTimer::GetTimeStepInMilliseconds() * 0.3f));
|
2020-12-07 13:12:13 -05:00
|
|
|
#else
|
|
|
|
BigMessageX[1] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
|
|
|
#endif
|
2019-10-05 15:26:29 -04:00
|
|
|
BigMessageAlpha[1] += (CTimer::GetTimeStepInMilliseconds() * 0.3f);
|
2019-06-16 20:10:55 -04:00
|
|
|
|
2020-04-10 11:06:49 -04:00
|
|
|
if (BigMessageAlpha[1] > 255.0f)
|
2019-06-16 20:10:55 -04:00
|
|
|
BigMessageAlpha[1] = 255.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
2019-06-20 09:18:15 -04:00
|
|
|
|
2019-06-14 19:34:19 -04:00
|
|
|
CFont::SetColor(CRGBA(40, 40, 40, BigMessageAlpha[1]));
|
2020-09-27 12:21:16 -04:00
|
|
|
#ifdef BETA_SLIDING_TEXT
|
2020-12-07 13:12:13 -05:00
|
|
|
#if defined(PS2_HUD) && !defined(FIX_BUGS)
|
|
|
|
CFont::PrintString(SCREEN_SCALE_X(2.0f) + BigMessageX[1], SCREEN_SCALE_FROM_BOTTOM(120.0f) + 2.0f, m_BigMessage[1]);
|
|
|
|
#else
|
2020-09-27 12:21:16 -04:00
|
|
|
CFont::PrintString(SCREEN_SCALE_X(2.0f) + BigMessageX[1], SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[1]);
|
2020-12-07 13:12:13 -05:00
|
|
|
#endif
|
2020-09-27 12:21:16 -04:00
|
|
|
CFont::SetColor(CRGBA(MISSIONTITLE_COLOR.r, MISSIONTITLE_COLOR.g, MISSIONTITLE_COLOR.b, BigMessageAlpha[1]));
|
|
|
|
CFont::PrintString(BigMessageX[1], SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]);
|
|
|
|
#else
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
2019-10-05 15:26:29 -04:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[1]);
|
2020-12-07 13:12:13 -05:00
|
|
|
#elif defined(PS2_HUD)
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + 2.0f, SCREEN_SCALE_FROM_BOTTOM(120.0f) + 2.0f, m_BigMessage[1]);
|
|
|
|
#else
|
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + 2.0f, SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[1]);
|
|
|
|
#endif
|
2020-05-17 09:33:44 -04:00
|
|
|
CFont::SetColor(CRGBA(MISSIONTITLE_COLOR.r, MISSIONTITLE_COLOR.g, MISSIONTITLE_COLOR.b, BigMessageAlpha[1]));
|
2019-06-19 20:31:03 -04:00
|
|
|
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]);
|
2020-09-27 12:21:16 -04:00
|
|
|
#endif
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
else {
|
2019-06-20 15:34:39 -04:00
|
|
|
BigMessageAlpha[1] = 0.0f;
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifdef FIX_BUGS
|
2020-09-30 13:02:47 -04:00
|
|
|
BigMessageX[1] = SCREEN_SCALE_FROM_RIGHT(DEFAULT_SCREEN_WIDTH + 60.0f);
|
2020-12-07 13:12:13 -05:00
|
|
|
#else
|
|
|
|
BigMessageX[1] = -60.0f;
|
|
|
|
#endif
|
2019-06-20 15:34:39 -04:00
|
|
|
BigMessageInUse[1] = 1.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2019-06-20 15:34:39 -04:00
|
|
|
BigMessageInUse[1] = 0.0f;
|
2019-06-14 19:34:19 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
void CHud::SetMessage(wchar *message)
|
2019-06-27 03:47:03 -04:00
|
|
|
{
|
2020-12-07 13:12:13 -05:00
|
|
|
int i = 0;
|
|
|
|
for (i = 0; i < ARRAY_SIZE(m_Message); i++) {
|
|
|
|
if (message[i] == 0)
|
|
|
|
break;
|
2019-06-27 03:47:03 -04:00
|
|
|
|
2020-12-07 13:12:13 -05:00
|
|
|
m_Message[i] = message[i];
|
2019-06-27 03:47:03 -04:00
|
|
|
}
|
2020-12-07 13:12:13 -05:00
|
|
|
m_Message[i] = 0;
|
2019-06-19 20:31:03 -04:00
|
|
|
}
|
|
|
|
|
2020-10-18 12:16:37 -04:00
|
|
|
void CHud::SetBigMessage(wchar *message, uint16 style)
|
2019-06-27 03:47:03 -04:00
|
|
|
{
|
2019-10-05 15:26:29 -04:00
|
|
|
int i = 0;
|
2019-06-27 03:47:03 -04:00
|
|
|
|
2019-06-28 07:28:42 -04:00
|
|
|
if (style == 5) {
|
|
|
|
for (i = 0; i < 128; i++) {
|
|
|
|
if (message[i] == 0)
|
|
|
|
break;
|
2019-06-27 03:47:03 -04:00
|
|
|
|
2019-06-28 07:28:42 -04:00
|
|
|
if (message[i] != LastBigMessage[5][i]) {
|
|
|
|
OddJob2On = 0;
|
|
|
|
OddJob2OffTimer = 0.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_BigMessage[5][i] = message[i];
|
|
|
|
LastBigMessage[5][i] = message[i];
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (i = 0; i < 128; i++) {
|
|
|
|
if (message[i] == 0)
|
|
|
|
break;
|
|
|
|
m_BigMessage[style][i] = message[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LastBigMessage[style][i] = 0;
|
|
|
|
m_BigMessage[style][i] = 0;
|
2020-12-07 13:12:13 -05:00
|
|
|
#ifndef FIX_BUGS
|
|
|
|
m_BigMessage[style][i] = 0;
|
|
|
|
#endif
|
2019-06-27 03:47:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void CHud::SetPagerMessage(wchar *message)
|
|
|
|
{
|
2019-10-05 15:26:29 -04:00
|
|
|
int i = 0;
|
2020-10-18 12:16:37 -04:00
|
|
|
for (i = 0; i < ARRAY_SIZE(m_PagerMessage); i++) {
|
2019-06-28 07:28:42 -04:00
|
|
|
if (message[i] == 0)
|
2019-06-27 03:47:03 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
m_PagerMessage[i] = message[i];
|
2019-06-28 07:28:42 -04:00
|
|
|
}
|
2019-06-27 03:47:03 -04:00
|
|
|
m_PagerMessage[i] = 0;
|
2020-12-07 13:12:13 -05:00
|
|
|
}
|