#include <message_editor.h>
Public Member Functions | |
MessageEditor (Rom *rom=nullptr) | |
void | Initialize () override |
absl::Status | Load () override |
absl::Status | Update () override |
void | DrawMessageList () |
void | DrawCurrentMessage () |
void | DrawTextCommands () |
void | DrawSpecialCharacters () |
void | DrawDictionary () |
void | DrawImportExport () |
void | DrawMessageSettings () |
absl::Status | Cut () override |
absl::Status | Copy () override |
absl::Status | Paste () override |
absl::Status | Undo () override |
absl::Status | Redo () override |
absl::Status | Find () override |
absl::Status | Save () override |
void | Delete () |
void | SelectAll () |
void | DrawTileToPreview (int x, int y, int srcx, int srcy, int pal, int sizex=1, int sizey=1) |
void | DrawCharacterToPreview (char c) |
void | DrawCharacterToPreview (const std::vector< uint8_t > &text) |
void | DrawStringToPreview (std::string str) |
void | DrawMessagePreview () |
std::string | DisplayTextOverflowError (int pos, bool bank) |
absl::Status | ImportMessagesFromFile (const std::string &filename) |
absl::Status | ExportMessagesToFile (const std::string &filename) |
void | SetMessageFont (int font_index) |
void | SetMessageColor (int color_index) |
void | SetMessageSpeed (int speed) |
void | SetMessageWindow (int window_type) |
void | SetMessagePosition (int x, int y) |
void | set_rom (Rom *rom) |
Rom * | rom () const |
![]() | |
Editor ()=default | |
virtual | ~Editor ()=default |
virtual absl::Status | Clear () |
virtual void | CleanupUnusedTextures (uint64_t current_time, uint64_t timeout) |
EditorType | type () const |
void | set_context (EditorContext *context) |
bool * | active () |
void | set_active (bool active) |
Additional Inherited Members | |
![]() | |
bool | active_ = false |
EditorType | type_ |
EditorContext * | context_ = nullptr |
Definition at line 32 of file message_editor.h.
|
inlineexplicit |
Definition at line 34 of file message_editor.h.
References yaze::editor::kMessage, rom(), rom_, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 45 of file message_editor.cc.
References all_dictionaries_, yaze::editor::BuildDictionaryEntries(), yaze::core::Renderer::CreateAndRenderBitmap(), current_font_gfx16_bitmap_, current_font_gfx16_data_, yaze::Rom::data(), DrawMessagePreview(), font_gfx16_data_, font_gfx_bitmap_, font_preview_colors_, yaze::editor::Renderer::GetInstance(), yaze::editor::kCharactersWidth, yaze::editor::kCurrentMessageHeight, yaze::editor::kCurrentMessageWidth, yaze::editor::kFontGfxMessageDepth, yaze::editor::kFontGfxMessageSize, yaze::editor::kGfxFont, yaze::editor::kWidthArraySize, list_of_texts_, parsed_messages_, yaze::editor::ParseMessageData(), yaze::editor::ReadAllTextData(), rom(), yaze::gfx::SnesTo8bppSheet(), and width_array.
Referenced by Update().
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 87 of file message_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 89 of file message_editor.cc.
References CLEAR_AND_RETURN_STATUS, current_message_, data_loaded_, DrawCurrentMessage(), DrawDictionary(), DrawImportExport(), DrawMessageList(), DrawSpecialCharacters(), DrawTextCommands(), Initialize(), yaze::editor::kMessageTableFlags, list_of_texts_, rom(), and status_.
void yaze::editor::MessageEditor::DrawMessageList | ( | ) |
Definition at line 124 of file message_editor.cc.
References current_message_, DrawMessagePreview(), yaze::util::HexLong(), yaze::util::HexWord(), yaze::editor::kMessageTableFlags, list_of_texts_, and parsed_messages_.
Referenced by Update().
void yaze::editor::MessageEditor::DrawCurrentMessage | ( | ) |
Definition at line 152 of file message_editor.cc.
References yaze::gui::BeginPadding(), current_font_gfx16_bitmap_, current_font_gfx16_canvas_, current_message_, yaze::gui::DisplayPalette(), DrawMessagePreview(), yaze::gui::EndPadding(), font_gfx_bitmap_, font_gfx_canvas_, font_preview_colors_, yaze::editor::Renderer::GetInstance(), message_text_box_, parsed_messages_, yaze::editor::ParseMessageToData(), rom(), status_, and yaze::core::Renderer::UpdateBitmap().
Referenced by Update().
void yaze::editor::MessageEditor::DrawTextCommands | ( | ) |
Definition at line 204 of file message_editor.cc.
References message_text_box_.
Referenced by Update().
void yaze::editor::MessageEditor::DrawSpecialCharacters | ( | ) |
Definition at line 219 of file message_editor.cc.
References message_text_box_.
Referenced by Update().
void yaze::editor::MessageEditor::DrawDictionary | ( | ) |
Definition at line 232 of file message_editor.cc.
References all_dictionaries_, yaze::util::HexWord(), and yaze::editor::kMessageTableFlags.
Referenced by Update().
void yaze::editor::MessageEditor::DrawImportExport | ( | ) |
Definition at line 255 of file message_editor.cc.
References ExportMessagesToFile(), ImportMessagesFromFile(), and status_.
Referenced by Update().
void yaze::editor::MessageEditor::DrawMessageSettings | ( | ) |
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 451 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 469 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 460 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 478 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 490 of file message_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 515 of file message_editor.cc.
References case_sensitive_, match_whole_word_, and search_text_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 394 of file message_editor.cc.
References DisplayTextOverflowError(), yaze::editor::kBlockTerminator, yaze::editor::kCharactersWidth, yaze::editor::kMessageTerminator, yaze::editor::kTextData, yaze::editor::kTextData2, yaze::editor::kTextData2End, yaze::editor::kTextDataEnd, yaze::editor::kWidthArraySize, list_of_texts_, RETURN_IF_ERROR, rom(), yaze::Rom::vector(), and width_array.
void yaze::editor::MessageEditor::Delete | ( | ) |
Definition at line 496 of file message_editor.cc.
References message_text_box_.
void yaze::editor::MessageEditor::SelectAll | ( | ) |
Definition at line 504 of file message_editor.cc.
References message_text_box_.
void yaze::editor::MessageEditor::DrawTileToPreview | ( | int | x, |
int | y, | ||
int | srcx, | ||
int | srcy, | ||
int | pal, | ||
int | sizex = 1, | ||
int | sizey = 1 ) |
Definition at line 279 of file message_editor.cc.
References current_font_gfx16_data_, and font_gfx16_data_.
Referenced by DrawCharacterToPreview().
void yaze::editor::MessageEditor::DrawCharacterToPreview | ( | char | c | ) |
Definition at line 317 of file message_editor.cc.
References DrawCharacterToPreview(), and yaze::editor::FindMatchingCharacter().
Referenced by DrawCharacterToPreview(), DrawCharacterToPreview(), DrawMessagePreview(), and DrawStringToPreview().
void yaze::editor::MessageEditor::DrawCharacterToPreview | ( | const std::vector< uint8_t > & | text | ) |
Definition at line 321 of file message_editor.cc.
References all_dictionaries_, yaze::editor::DICTOFF, DrawCharacterToPreview(), DrawStringToPreview(), DrawTileToPreview(), yaze::editor::kLine1, yaze::editor::kLine2, yaze::editor::kLine3, yaze::editor::kScrollVertical, skip_next, text_line_, text_position_, and width_array.
void yaze::editor::MessageEditor::DrawStringToPreview | ( | std::string | str | ) |
Definition at line 311 of file message_editor.cc.
References DrawCharacterToPreview().
Referenced by DrawCharacterToPreview().
void yaze::editor::MessageEditor::DrawMessagePreview | ( | ) |
Definition at line 380 of file message_editor.cc.
References current_font_gfx16_bitmap_, current_font_gfx16_data_, current_message_, DrawCharacterToPreview(), font_gfx_bitmap_, yaze::editor::Renderer::GetInstance(), yaze::editor::kFontGfx16Size, yaze::core::Renderer::RenderBitmap(), shown_lines_, text_line_, text_position_, and yaze::core::Renderer::UpdateBitmap().
Referenced by DrawCurrentMessage(), DrawMessageList(), and Initialize().
std::string yaze::editor::MessageEditor::DisplayTextOverflowError | ( | int | pos, |
bool | bank ) |
Definition at line 438 of file message_editor.cc.
References yaze::editor::kTextData, yaze::editor::kTextData2, yaze::editor::kTextData2End, and yaze::editor::kTextDataEnd.
Referenced by Save().
absl::Status yaze::editor::MessageEditor::ImportMessagesFromFile | ( | const std::string & | filename | ) |
Definition at line 543 of file message_editor.cc.
References list_of_texts_, and yaze::editor::ParseMessageToData().
Referenced by DrawImportExport().
absl::Status yaze::editor::MessageEditor::ExportMessagesToFile | ( | const std::string & | filename | ) |
Definition at line 593 of file message_editor.cc.
References list_of_texts_.
Referenced by DrawImportExport().
void yaze::editor::MessageEditor::SetMessageFont | ( | int | font_index | ) |
void yaze::editor::MessageEditor::SetMessageColor | ( | int | color_index | ) |
void yaze::editor::MessageEditor::SetMessageSpeed | ( | int | speed | ) |
void yaze::editor::MessageEditor::SetMessageWindow | ( | int | window_type | ) |
void yaze::editor::MessageEditor::SetMessagePosition | ( | int | x, |
int | y ) |
|
inline |
|
inline |
Definition at line 78 of file message_editor.h.
References rom_.
Referenced by DrawCurrentMessage(), Initialize(), MessageEditor(), Save(), set_rom(), and Update().
|
private |
Definition at line 81 of file message_editor.h.
Referenced by MessageEditor(), rom(), and set_rom().
|
private |
Definition at line 82 of file message_editor.h.
Referenced by DrawCharacterToPreview().
|
private |
Definition at line 83 of file message_editor.h.
Referenced by Update().
|
private |
Definition at line 84 of file message_editor.h.
Referenced by Find().
|
private |
Definition at line 85 of file message_editor.h.
Referenced by Find().
|
private |
Definition at line 86 of file message_editor.h.
|
private |
Definition at line 88 of file message_editor.h.
Referenced by DrawCharacterToPreview(), and DrawMessagePreview().
|
private |
Definition at line 89 of file message_editor.h.
Referenced by DrawCharacterToPreview(), and DrawMessagePreview().
|
private |
Definition at line 90 of file message_editor.h.
Referenced by DrawMessagePreview().
|
private |
Definition at line 92 of file message_editor.h.
Referenced by Find().
|
private |
Definition at line 93 of file message_editor.h.
|
private |
Definition at line 94 of file message_editor.h.
|
private |
Definition at line 96 of file message_editor.h.
Referenced by DrawCharacterToPreview(), Initialize(), and Save().
|
private |
Definition at line 97 of file message_editor.h.
Referenced by DrawTileToPreview(), and Initialize().
|
private |
Definition at line 98 of file message_editor.h.
Referenced by DrawMessagePreview(), DrawTileToPreview(), and Initialize().
|
private |
Definition at line 99 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessageList(), and Initialize().
|
private |
Definition at line 100 of file message_editor.h.
Referenced by DrawMessageList(), ExportMessagesToFile(), ImportMessagesFromFile(), Initialize(), Save(), and Update().
|
private |
Definition at line 101 of file message_editor.h.
Referenced by DrawCharacterToPreview(), DrawDictionary(), and Initialize().
|
private |
Definition at line 103 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessageList(), DrawMessagePreview(), and Update().
|
private |
Definition at line 105 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessagePreview(), and Initialize().
|
private |
Definition at line 106 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessagePreview(), and Initialize().
|
private |
Definition at line 107 of file message_editor.h.
Referenced by DrawCurrentMessage(), and Initialize().
|
private |
Definition at line 109 of file message_editor.h.
Referenced by DrawCurrentMessage().
|
private |
Definition at line 110 of file message_editor.h.
Referenced by DrawCurrentMessage().
|
private |
Definition at line 112 of file message_editor.h.
|
private |
Definition at line 113 of file message_editor.h.
|
private |
Definition at line 115 of file message_editor.h.
Referenced by Copy(), Cut(), Delete(), DrawCurrentMessage(), DrawSpecialCharacters(), DrawTextCommands(), Paste(), SelectAll(), and Undo().
|
private |
Definition at line 117 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawImportExport(), and Update().