2020-11-01 16:45:29 +01:00
|
|
|
#pragma once
|
2020-12-03 15:47:36 +01:00
|
|
|
#include "score.h"
|
2020-11-01 16:45:29 +01:00
|
|
|
#include "TPinballComponent.h"
|
2020-12-03 15:47:36 +01:00
|
|
|
#include "TTextBoxMessage.h"
|
2020-11-07 16:41:14 +01:00
|
|
|
|
2020-11-01 16:45:29 +01:00
|
|
|
class TTextBox :
|
2022-09-06 15:57:56 +02:00
|
|
|
public TPinballComponent
|
2020-11-01 16:45:29 +01:00
|
|
|
{
|
|
|
|
public:
|
2020-12-03 15:47:36 +01:00
|
|
|
int OffsetX;
|
|
|
|
int OffsetY;
|
|
|
|
int Width;
|
|
|
|
int Height;
|
|
|
|
int Timer;
|
|
|
|
gdrv_bitmap8* BgBmp;
|
|
|
|
score_msg_font_type* Font;
|
2022-09-06 10:58:35 +02:00
|
|
|
TTextBoxMessage* CurrentMessage;
|
|
|
|
TTextBoxMessage* PreviousMessage;
|
2020-11-01 16:45:29 +01:00
|
|
|
|
2020-12-03 15:47:36 +01:00
|
|
|
TTextBox(TPinballTable* table, int groupIndex);
|
|
|
|
~TTextBox() override;
|
2022-09-06 15:57:56 +02:00
|
|
|
int Message(MessageCode code, float value) override;
|
2023-03-17 14:38:08 +01:00
|
|
|
void Clear(bool lowPriorityOnly = false);
|
|
|
|
void Display(const char* text, float time, bool lowPriority = false);
|
2022-08-31 06:58:03 +02:00
|
|
|
void DrawImGui();
|
2020-12-03 15:47:36 +01:00
|
|
|
|
2021-11-20 17:03:22 +01:00
|
|
|
private:
|
|
|
|
struct LayoutResult
|
|
|
|
{
|
|
|
|
char *Start, *End;
|
|
|
|
int Width;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void TimerExpired(int timerId, void* caller);
|
|
|
|
|
|
|
|
void Draw();
|
|
|
|
LayoutResult LayoutTextLine(char* textStart) const;
|
2020-11-07 16:41:14 +01:00
|
|
|
};
|