* Add translations from v1 * Add font configuration (to be able to use non-latin languages) * translations: remove includes that are already in pch.h * translations: rename enums and avoid macros * Fix crash when the font file doesn't exist * translations: avoid u8 to avoid reencoding by MSVC MSVC will read the file as ASCII and reconvert characters as UTF-8, this will corrupt characters as the file is in fact already in UTF-8. * translations: remove NUMBER in enums * translations: handle non existing translations gracefuly (don't crash) Fallback to english if available, else return empty string * Testing pull collaboration. * Rollback: remove NUMBER in enums. * Get rid of namespace, use header instead. * Collapsed translated text struct and array. * Fixed build errors and warnings. * Simplified language list. * All new types, locals and globals should use CamelCase. * Removed unnecessary ImGui patch. * Rearranged TTextBox immediate mode draw. * Final touches: removed unused declaration in gdrv. Removed unused Msg entries and added new check. * Remove placeholder english texts from missing translations Co-authored-by: Muzychenko Andrey <33288308+k4zmu2a@users.noreply.github.com>
39 lines
713 B
C++
39 lines
713 B
C++
#pragma once
|
|
#include "score.h"
|
|
#include "TPinballComponent.h"
|
|
#include "TTextBoxMessage.h"
|
|
|
|
class TTextBox :
|
|
public TPinballComponent
|
|
{
|
|
public:
|
|
int OffsetX;
|
|
int OffsetY;
|
|
int Width;
|
|
int Height;
|
|
int Timer;
|
|
gdrv_bitmap8* BgBmp;
|
|
score_msg_font_type* Font;
|
|
TTextBoxMessage* Message1;
|
|
TTextBoxMessage* Message2;
|
|
|
|
TTextBox(TPinballTable* table, int groupIndex);
|
|
~TTextBox() override;
|
|
int Message(int code, float value) override;
|
|
void Clear();
|
|
void Display(const char* text, float time);
|
|
void DrawImGui();
|
|
|
|
private:
|
|
struct LayoutResult
|
|
{
|
|
char *Start, *End;
|
|
int Width;
|
|
};
|
|
|
|
static void TimerExpired(int timerId, void* caller);
|
|
|
|
void Draw();
|
|
LayoutResult LayoutTextLine(char* textStart) const;
|
|
};
|