2019-06-25 00:42:23 +02:00
|
|
|
#pragma once
|
|
|
|
|
2019-07-10 08:06:43 +02:00
|
|
|
#include "Physical.h"
|
2019-07-15 14:11:40 +02:00
|
|
|
|
|
|
|
class CPed;
|
|
|
|
class CAnimBlendAssociation;
|
2019-06-25 00:42:23 +02:00
|
|
|
|
2019-12-02 21:02:32 +01:00
|
|
|
enum PhoneState {
|
2019-07-10 22:07:41 +02:00
|
|
|
PHONE_STATE_FREE,
|
2019-11-25 03:25:10 +01:00
|
|
|
PHONE_STATE_REPORTING_CRIME, // CCivilianPed::ProcessControl sets it but unused
|
2019-07-10 22:07:41 +02:00
|
|
|
PHONE_STATE_2,
|
|
|
|
PHONE_STATE_MESSAGE_REMOVED,
|
|
|
|
PHONE_STATE_ONETIME_MESSAGE_SET,
|
|
|
|
PHONE_STATE_REPEATED_MESSAGE_SET,
|
|
|
|
PHONE_STATE_REPEATED_MESSAGE_SHOWN_ONCE,
|
2019-12-02 21:02:32 +01:00
|
|
|
PHONE_STATE_ONETIME_MESSAGE_STARTED,
|
|
|
|
PHONE_STATE_REPEATED_MESSAGE_STARTED,
|
|
|
|
PHONE_STATE_9 // just rings, picking being handled via script. most of the time game uses this
|
2019-07-10 22:07:41 +02:00
|
|
|
};
|
|
|
|
|
2019-11-25 03:25:10 +01:00
|
|
|
class CPhone
|
2019-07-10 08:06:43 +02:00
|
|
|
{
|
2019-11-25 03:25:10 +01:00
|
|
|
public:
|
2019-07-10 08:06:43 +02:00
|
|
|
CVector m_vecPos;
|
2019-07-15 14:11:40 +02:00
|
|
|
wchar *m_apMessages[6];
|
2019-12-02 21:02:32 +01:00
|
|
|
uint32 m_repeatedMessagePickupStart;
|
2019-11-25 03:25:10 +01:00
|
|
|
CEntity *m_pEntity; // stored as building pool index in save files
|
2019-12-02 21:02:32 +01:00
|
|
|
PhoneState m_nState;
|
|
|
|
bool m_visibleToCam;
|
2019-11-25 03:25:10 +01:00
|
|
|
|
|
|
|
CPhone() { }
|
|
|
|
~CPhone() { }
|
2019-07-10 08:06:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static_assert(sizeof(CPhone) == 0x34, "CPhone: error");
|
|
|
|
|
|
|
|
class CPhoneInfo {
|
2019-07-15 14:11:40 +02:00
|
|
|
public:
|
2020-04-17 07:54:14 +02:00
|
|
|
static bool bDisplayingPhoneMessage;
|
|
|
|
static uint32 PhoneEnableControlsTimer;
|
|
|
|
static CPhone *pPhoneDisplayingMessages;
|
|
|
|
static bool bPickingUpPhone;
|
|
|
|
static CPed *pCallBackPed;
|
2019-07-15 14:11:40 +02:00
|
|
|
|
2019-07-10 08:06:43 +02:00
|
|
|
int32 m_nMax;
|
2019-12-02 21:02:32 +01:00
|
|
|
int32 m_nScriptPhonesMax;
|
2019-11-25 03:25:10 +01:00
|
|
|
CPhone m_aPhones[NUMPHONES];
|
2019-07-10 08:06:43 +02:00
|
|
|
|
|
|
|
CPhoneInfo() { }
|
|
|
|
~CPhoneInfo() { }
|
|
|
|
|
|
|
|
int FindNearestFreePhone(CVector*);
|
|
|
|
bool PhoneAtThisPosition(CVector);
|
2019-07-10 22:07:41 +02:00
|
|
|
bool HasMessageBeenDisplayed(int);
|
|
|
|
bool IsMessageBeingDisplayed(int);
|
2019-10-08 22:07:11 +02:00
|
|
|
void Load(uint8 *buf, uint32 size);
|
|
|
|
void Save(uint8 *buf, uint32 *size);
|
2019-07-15 14:11:40 +02:00
|
|
|
void SetPhoneMessage_JustOnce(int phoneId, wchar *msg1, wchar *msg2, wchar *msg3, wchar *msg4, wchar *msg5, wchar *msg6);
|
|
|
|
void SetPhoneMessage_Repeatedly(int phoneId, wchar *msg1, wchar *msg2, wchar *msg3, wchar *msg4, wchar *msg5, wchar *msg6);
|
|
|
|
int GrabPhone(float, float);
|
|
|
|
void Initialise(void);
|
|
|
|
void Shutdown(void);
|
2019-10-19 00:23:40 +02:00
|
|
|
void Update(void);
|
2019-07-10 08:06:43 +02:00
|
|
|
};
|
|
|
|
|
2020-04-17 07:54:14 +02:00
|
|
|
extern CPhoneInfo gPhoneInfo;
|
2019-07-10 08:06:43 +02:00
|
|
|
|
2019-06-25 00:42:23 +02:00
|
|
|
void PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg);
|
2019-12-02 21:02:32 +01:00
|
|
|
void PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg);
|
|
|
|
|
|
|
|
#ifdef TOGGLEABLE_BETA_FEATURES
|
|
|
|
extern CPed *crimeReporters[NUMPHONES];
|
|
|
|
bool isPhoneAvailable(int);
|
|
|
|
#endif
|