2019-06-24 22:42:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-07-10 06:06:43 +00:00
|
|
|
#include "Physical.h"
|
2019-07-15 12:11:40 +00:00
|
|
|
|
|
|
|
class CPed;
|
|
|
|
class CAnimBlendAssociation;
|
2019-06-24 22:42:23 +00:00
|
|
|
|
2019-07-10 20:07:41 +00:00
|
|
|
enum {
|
|
|
|
PHONE_STATE_FREE,
|
|
|
|
PHONE_STATE_1,
|
|
|
|
PHONE_STATE_2,
|
|
|
|
PHONE_STATE_MESSAGE_REMOVED,
|
|
|
|
PHONE_STATE_ONETIME_MESSAGE_SET,
|
|
|
|
PHONE_STATE_REPEATED_MESSAGE_SET,
|
|
|
|
PHONE_STATE_REPEATED_MESSAGE_SHOWN_ONCE,
|
|
|
|
PHONE_STATE_ONETIME_MESSAGE_SHOWN,
|
|
|
|
PHONE_STATE_REPEATED_MESSAGE_SHOWN,
|
|
|
|
PHONE_STATE_9
|
|
|
|
};
|
|
|
|
|
2019-07-10 06:06:43 +00:00
|
|
|
struct CPhone
|
|
|
|
{
|
|
|
|
CVector m_vecPos;
|
2019-07-15 12:11:40 +00:00
|
|
|
wchar *m_apMessages[6];
|
2019-07-10 20:07:41 +00:00
|
|
|
uint32 m_lastTimeRepeatedMsgShown;
|
|
|
|
CEntity *m_pEntity; // it's building pool index in save files
|
2019-07-10 06:06:43 +00:00
|
|
|
int32 m_nState;
|
|
|
|
uint8 field_30;
|
|
|
|
};
|
|
|
|
|
|
|
|
static_assert(sizeof(CPhone) == 0x34, "CPhone: error");
|
|
|
|
|
|
|
|
class CPhoneInfo {
|
2019-07-15 12:11:40 +00:00
|
|
|
public:
|
2019-07-10 20:07:41 +00:00
|
|
|
static bool &isPhonePickedUp;
|
2019-07-15 12:11:40 +00:00
|
|
|
static uint32 &phoneMessagesTimer;
|
2019-07-10 20:07:41 +00:00
|
|
|
static CPhone *&pickedUpPhone;
|
2019-07-15 12:11:40 +00:00
|
|
|
static bool &isPhoneBeingPickedUp;
|
|
|
|
static CPed *&pedWhoPickingUpPhone;
|
|
|
|
|
2019-07-10 06:06:43 +00:00
|
|
|
int32 m_nMax;
|
|
|
|
int32 m_nNum;
|
|
|
|
CPhone m_aPhones[50];
|
|
|
|
|
|
|
|
CPhoneInfo() { }
|
|
|
|
~CPhoneInfo() { }
|
|
|
|
|
|
|
|
int FindNearestFreePhone(CVector*);
|
|
|
|
bool PhoneAtThisPosition(CVector);
|
2019-07-10 20:07:41 +00:00
|
|
|
bool HasMessageBeenDisplayed(int);
|
|
|
|
bool IsMessageBeingDisplayed(int);
|
2019-10-08 20:07:11 +00:00
|
|
|
void Load(uint8 *buf, uint32 size);
|
|
|
|
void Save(uint8 *buf, uint32 *size);
|
2019-07-15 12:11:40 +00: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-18 22:23:40 +00:00
|
|
|
void Update(void);
|
2019-07-10 06:06:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern CPhoneInfo &gPhoneInfo;
|
|
|
|
|
2019-06-24 22:42:23 +00:00
|
|
|
void PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg);
|
|
|
|
void PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg);
|