DDNet documentation
Loading...
Searching...
No Matches
font_typer.h
Go to the documentation of this file.
1#ifndef GAME_EDITOR_FONT_TYPER_H
2#define GAME_EDITOR_FONT_TYPER_H
3
4#include "component.h"
5
6#include <base/vmath.h>
7
8#include <engine/graphics.h>
9
10#include <game/client/ui.h>
11
12#include <chrono>
13#include <memory>
14#include <optional>
15
16class CLayer;
17class CLayerTiles;
18
20{
21public:
22 class CState
23 {
24 public:
27 // column a newline returns to
28 std::optional<int> m_LineStart;
29 std::shared_ptr<CLayer> m_pLastLayer;
31
32 void Reset();
33 };
34
35 void OnInit(CEditor *pEditor) override;
36 bool OnInput(const IInput::CEvent &Event) override;
37 void Render();
38
39 bool IsActive() const;
40
41private:
42 enum
43 {
46 };
47 std::chrono::nanoseconds m_CursorRenderTime;
50
51 void SetCursor();
52 void TextModeOff();
53 void TextModeOn();
54 void SetTile(ivec2 Pos, unsigned char Index, const std::shared_ptr<CLayerTiles> &pLayer);
55 void PlaceTile(unsigned char Index, const std::shared_ptr<CLayerTiles> &pLayer);
56};
57
58#endif
Definition component.h:13
Definition editor.h:108
Definition font_typer.h:23
int m_TilesPlacedSinceActivate
Definition font_typer.h:30
void Reset()
Definition font_typer.cpp:17
std::optional< int > m_LineStart
Definition font_typer.h:28
ivec2 m_TextIndex
Definition font_typer.h:26
bool m_Active
Definition font_typer.h:25
std::shared_ptr< CLayer > m_pLastLayer
Definition font_typer.h:29
Definition font_typer.h:20
bool IsActive() const
Definition font_typer.cpp:358
void TextModeOff()
Definition font_typer.cpp:283
bool OnInput(const IInput::CEvent &Event) override
Definition font_typer.cpp:71
void OnInit(CEditor *pEditor) override
Definition font_typer.cpp:26
IGraphics::CTextureHandle m_CursorTextTexture
Definition font_typer.h:48
void PlaceTile(unsigned char Index, const std::shared_ptr< CLayerTiles > &pLayer)
Definition font_typer.cpp:45
void TextModeOn()
Definition font_typer.cpp:266
void Render()
Definition font_typer.cpp:299
void SetTile(ivec2 Pos, unsigned char Index, const std::shared_ptr< CLayerTiles > &pLayer)
Definition font_typer.cpp:33
@ NUMBER_OFFSET
Definition font_typer.h:45
@ LETTER_OFFSET
Definition font_typer.h:44
void SetCursor()
Definition font_typer.cpp:292
CUi::SConfirmPopupContext m_ConfirmActivatePopupContext
Definition font_typer.h:49
std::chrono::nanoseconds m_CursorRenderTime
Definition font_typer.h:47
Definition layer_tiles.h:44
Definition layer.h:16
Definition graphics.h:261
Definition input.h:22
Definition ui.h:755
vector2_base< int > ivec2
Definition vmath.h:170