Move other constants to constants file

This commit is contained in:
Leroy Hopson 2024-02-14 20:00:13 +13:00
parent 0a1ba5abcd
commit 580760ffad
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
2 changed files with 13 additions and 11 deletions

View file

@ -7,6 +7,16 @@
using namespace godot;
const char* Terminal::COLOR_NAMES[18] = {
"ansi_0_color", "ansi_1_color", "ansi_2_color", "ansi_3_color", "ansi_4_color", "ansi_5_color", "ansi_6_color", "ansi_7_color",
"ansi_8_color", "ansi_9_color", "ansi_10_color", "ansi_11_color", "ansi_12_color", "ansi_13_color", "ansi_14_color", "ansi_15_color",
"foreground_color", "background_color",
};
const char* Terminal::FONT_TYPES[4] = {
"normal_font", "bold_font", "italics_font", "bold_italics_font",
};
const Terminal::KeyMap Terminal::KEY_MAP = {
// Godot does not have seperate scancodes for keypad keys when NumLock is
// off. We can check the unicode value to determine whether it is off and

View file

@ -20,15 +20,7 @@ namespace godot
GDCLASS(Terminal, Control)
private:
static constexpr const char *COLOR_NAMES[] = {
"ansi_0_color", "ansi_1_color", "ansi_2_color", "ansi_3_color", "ansi_4_color", "ansi_5_color", "ansi_6_color", "ansi_7_color",
"ansi_8_color", "ansi_9_color", "ansi_10_color", "ansi_11_color", "ansi_12_color", "ansi_13_color", "ansi_14_color", "ansi_15_color",
"foreground_color", "background_color",
};
static constexpr const char *FONT_TYPES[] = {
"normal_font", "bold_font", "italics_font", "bold_italics_font",
};
typedef std::map<std::pair<Key, char32_t>, uint32_t> KeyMap;
enum FontType {
NORMAL,
@ -37,8 +29,8 @@ namespace godot
BOLD_ITALICS,
};
typedef std::map<std::pair<Key, char32_t>, uint32_t> KeyMap;
static const char *COLOR_NAMES[18];
static const char *FONT_TYPES[4];
static const KeyMap KEY_MAP;
public:
enum AttrFlag