2020-11-01 16:45:29 +01:00
|
|
|
#pragma once
|
|
|
|
#include "TPinballComponent.h"
|
2021-01-01 14:14:11 +01:00
|
|
|
|
2021-01-29 14:42:05 +01:00
|
|
|
struct TLight_player_backup
|
2021-01-01 14:14:11 +01:00
|
|
|
{
|
|
|
|
int MessageField;
|
2022-08-24 12:32:35 +02:00
|
|
|
bool LightOnFlag;
|
|
|
|
int LightOnBmpIndex;
|
|
|
|
bool FlasherOnFlag;
|
2021-01-01 14:14:11 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-11-01 16:45:29 +01:00
|
|
|
class TLight :
|
2022-09-06 15:57:56 +02:00
|
|
|
public TPinballComponent
|
2020-11-01 16:45:29 +01:00
|
|
|
{
|
|
|
|
public:
|
2021-01-01 14:14:11 +01:00
|
|
|
TLight(TPinballTable* table, int groupIndex);
|
2022-09-06 15:57:56 +02:00
|
|
|
int Message(MessageCode code, float value) override;
|
2021-01-01 14:14:11 +01:00
|
|
|
void Reset();
|
|
|
|
void schedule_timeout(float time);
|
2022-08-24 12:32:35 +02:00
|
|
|
void flasher_stop(int bmpIndex);
|
|
|
|
void flasher_start(bool bmpIndex);
|
2022-09-22 16:46:00 +02:00
|
|
|
void SetSpriteBmp(int index);
|
2022-09-08 09:51:33 +02:00
|
|
|
bool light_on() const;
|
2021-01-01 14:14:11 +01:00
|
|
|
|
|
|
|
static void TimerExpired(int timerId, void* caller);
|
|
|
|
static void flasher_callback(int timerId, void* caller);
|
2022-08-24 12:32:35 +02:00
|
|
|
static void UndoTmpOverride(int timerId, void* caller);
|
2020-11-01 16:45:29 +01:00
|
|
|
|
2022-09-22 16:46:00 +02:00
|
|
|
int BmpArr[2]{-1};
|
|
|
|
float FlashDelay[2]{};
|
2022-08-24 12:32:35 +02:00
|
|
|
int FlashTimer;
|
2022-09-22 16:46:00 +02:00
|
|
|
bool FlashLightOnFlag{};
|
2022-08-24 12:32:35 +02:00
|
|
|
bool LightOnFlag{};
|
|
|
|
bool FlasherOnFlag;
|
|
|
|
bool ToggledOffFlag{};
|
|
|
|
bool ToggledOnFlag{};
|
|
|
|
bool TurnOffAfterFlashingFg{};
|
|
|
|
int LightOnBmpIndex{};
|
|
|
|
float SourceDelay[2]{};
|
|
|
|
int TimeoutTimer;
|
|
|
|
int UndoOverrideTimer;
|
|
|
|
bool TemporaryOverrideFlag{};
|
2022-09-22 16:46:00 +02:00
|
|
|
int PreviousBitmap = -1;
|
2021-10-02 17:58:54 +02:00
|
|
|
TLight_player_backup PlayerData[4]{};
|
2021-01-01 14:14:11 +01:00
|
|
|
};
|