Refactor and add default values to various structs

- Removed `FindMatchingCharacter` declaration from `message_data.h`
- Added default values to `DictionaryEntry` and `MessageData` members
- Marked several methods in `DictionaryEntry`, `MessageData`, and `TextElement` as `const`
- Updated `TextElement` constructor to take `const std::string&`
- Added string constants for text descriptions in `TextElement`
- Updated `TextCommands` vector to use new string constants
- Declared new function `FindMatchingCommand`
- Included `<array>` header in `message_editor.h`
- Changed `width_array` in `MessageEditor` to `std::array` with default initialization
- Removed `list_of_texts_` and `all_dictionaries_` vectors from `MessageEditor`
- Added default values to `GameEntity` members
- Initialized `sheets` array in `PseudoVram`
- Initialized `map_parent_` and `all_tiles_types_` arrays in `Overworld`
This commit is contained in:
Justin Scofield
2025-01-04 20:05:46 -05:00
parent fe0dbd3642
commit 2d9f4be91d
5 changed files with 71 additions and 49 deletions

View File

@@ -1,6 +1,7 @@
#ifndef YAZE_APP_EDITOR_MESSAGE_EDITOR_H
#define YAZE_APP_EDITOR_MESSAGE_EDITOR_H
#include <array>
#include <string>
#include <vector>
@@ -81,16 +82,13 @@ class MessageEditor : public Editor, public SharedRom {
int text_position_ = 0;
int shown_lines_ = 0;
uint8_t width_array[kWidthArraySize];
std::string search_text_ = "";
std::array<uint8_t, kWidthArraySize> width_array = {0};
std::vector<uint8_t> font_gfx16_data_;
std::vector<uint8_t> current_font_gfx16_data_;
std::vector<std::string> parsed_messages_;
std::vector<MessageData> list_of_texts_;
std::vector<DictionaryEntry> all_dictionaries_;
MessageData current_message_;