#include <message_editor.h>
Classes | |
struct | TextBox |
Public Member Functions | |
MessageEditor () | |
void | Initialize () override |
absl::Status | Load () override |
absl::Status | Update () override |
void | DrawMessageList () |
void | DrawCurrentMessage () |
void | DrawTextCommands () |
void | DrawDictionary () |
void | ReadAllTextDataV2 () |
void | ReadAllTextData () |
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 () |
DictionaryEntry | GetDictionaryFromID (uint8_t value) |
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) |
![]() | |
Editor ()=default | |
virtual | ~Editor ()=default |
EditorType | type () const |
void | set_context (EditorContext *context) |
bool * | active () |
void | set_active (bool active) |
![]() | |
SharedRom ()=default | |
virtual | ~SharedRom ()=default |
std::shared_ptr< Rom > | shared_rom () |
auto | rom () |
Private Attributes | |
bool | skip_next = false |
bool | data_loaded_ = false |
int | text_line_ = 0 |
int | text_position_ = 0 |
int | shown_lines_ = 0 |
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_ |
gfx::Bitmap | font_gfx_bitmap_ |
gfx::Bitmap | current_font_gfx16_bitmap_ |
gfx::SnesPalette | font_preview_colors_ |
gui::Canvas | font_gfx_canvas_ {"##FontGfxCanvas", ImVec2(128, 128)} |
gui::Canvas | current_font_gfx16_canvas_ |
TextBox | message_text_box_ |
Additional Inherited Members | |
![]() | |
static std::shared_ptr< Rom > | shared_rom_ = nullptr |
![]() | |
bool | active_ = false |
EditorType | type_ |
EditorContext * | context_ = nullptr |
Definition at line 36 of file message_editor.h.
|
inline |
Definition at line 38 of file message_editor.h.
References yaze::editor::kMessage, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 47 of file message_editor.cc.
References all_dictionaries_, yaze::editor::BuildDictionaryEntries(), yaze::core::Renderer::CreateAndRenderBitmap(), current_font_gfx16_bitmap_, current_font_gfx16_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(), ReadAllTextDataV2(), yaze::SharedRom::rom(), yaze::gfx::SnesTo8bppSheet(), and width_array.
Referenced by Update().
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 88 of file message_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 90 of file message_editor.cc.
References current_message_, data_loaded_, DrawCurrentMessage(), DrawDictionary(), DrawMessageList(), DrawTextCommands(), Initialize(), yaze::editor::kDictTableFlags, list_of_texts_, and yaze::SharedRom::rom().
void yaze::editor::MessageEditor::DrawMessageList | ( | ) |
Definition at line 123 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_, DrawMessagePreview(), yaze::gui::EndPadding(), font_gfx_bitmap_, font_gfx_canvas_, yaze::editor::Renderer::GetInstance(), message_text_box_, parsed_messages_, yaze::editor::ParseMessageToData(), yaze::SharedRom::rom(), and yaze::core::Renderer::UpdateBitmap().
Referenced by Update().
void yaze::editor::MessageEditor::DrawTextCommands | ( | ) |
Definition at line 193 of file message_editor.cc.
Referenced by Update().
void yaze::editor::MessageEditor::DrawDictionary | ( | ) |
Definition at line 207 of file message_editor.cc.
References all_dictionaries_, yaze::util::HexWord(), and yaze::editor::kDictTableFlags.
Referenced by Update().
void yaze::editor::MessageEditor::ReadAllTextDataV2 | ( | ) |
Definition at line 228 of file message_editor.cc.
References yaze::editor::DICTIONARYTOKEN, yaze::editor::TextElement::Empty(), yaze::editor::FindDictionaryEntry(), yaze::editor::FindMatchingCommand(), yaze::editor::FindMatchingSpecial(), yaze::Get24LocalFromPC(), yaze::editor::TextElement::GetParamToken(), yaze::editor::TextElement::HasArgument, yaze::util::HexByte(), yaze::util::HexWord(), yaze::editor::kBankToken, yaze::editor::kMessageTerminator, yaze::editor::kPointersDictionaries, yaze::editor::kTextData, yaze::editor::kTextData2, list_of_texts_, yaze::editor::ParseTextDataByte(), yaze::SharedRom::rom(), and yaze::editor::TextElement::Token.
Referenced by Initialize().
void yaze::editor::MessageEditor::ReadAllTextData | ( | ) |
Definition at line 330 of file message_editor.cc.
References yaze::editor::DICTIONARYTOKEN, yaze::editor::TextElement::Empty(), yaze::editor::FindDictionaryEntry(), yaze::editor::FindMatchingCommand(), yaze::editor::FindMatchingSpecial(), yaze::Get24LocalFromPC(), yaze::editor::TextElement::GetParamToken(), yaze::editor::TextElement::HasArgument, yaze::util::HexWord(), yaze::editor::kBankToken, yaze::editor::kMessageTerminator, yaze::editor::kPointersDictionaries, yaze::editor::kTextData, yaze::editor::kTextData2, list_of_texts_, yaze::editor::ParseTextDataByte(), yaze::SharedRom::rom(), and yaze::editor::TextElement::Token.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 552 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 570 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 561 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 579 of file message_editor.cc.
References message_text_box_.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 55 of file message_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 58 of file message_editor.h.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 591 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, yaze::SharedRom::rom(), and width_array.
void yaze::editor::MessageEditor::Delete | ( | ) |
Definition at line 648 of file message_editor.cc.
References message_text_box_.
void yaze::editor::MessageEditor::SelectAll | ( | ) |
Definition at line 656 of file message_editor.cc.
References message_text_box_.
DictionaryEntry yaze::editor::MessageEditor::GetDictionaryFromID | ( | uint8_t | value | ) |
Definition at line 439 of file message_editor.cc.
References all_dictionaries_.
Referenced by DrawCharacterToPreview().
void yaze::editor::MessageEditor::DrawTileToPreview | ( | int | x, |
int | y, | ||
int | srcx, | ||
int | srcy, | ||
int | pal, | ||
int | sizex = 1, | ||
int | sizey = 1 ) |
Definition at line 446 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 484 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 488 of file message_editor.cc.
References yaze::editor::DICTOFF, DrawCharacterToPreview(), DrawStringToPreview(), DrawTileToPreview(), GetDictionaryFromID(), 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 478 of file message_editor.cc.
References DrawCharacterToPreview().
Referenced by DrawCharacterToPreview().
void yaze::editor::MessageEditor::DrawMessagePreview | ( | ) |
Definition at line 541 of file message_editor.cc.
References current_font_gfx16_data_, current_message_, DrawCharacterToPreview(), yaze::editor::kFontGfx16Size, shown_lines_, text_line_, and text_position_.
Referenced by DrawCurrentMessage(), DrawMessageList(), and Initialize().
std::string yaze::editor::MessageEditor::DisplayTextOverflowError | ( | int | pos, |
bool | bank ) |
Definition at line 635 of file message_editor.cc.
References yaze::editor::kTextData, yaze::editor::kTextData2, yaze::editor::kTextData2End, and yaze::editor::kTextDataEnd.
Referenced by Save().
|
private |
Definition at line 76 of file message_editor.h.
Referenced by DrawCharacterToPreview().
|
private |
Definition at line 77 of file message_editor.h.
Referenced by Update().
|
private |
Definition at line 79 of file message_editor.h.
Referenced by DrawCharacterToPreview(), and DrawMessagePreview().
|
private |
Definition at line 80 of file message_editor.h.
Referenced by DrawCharacterToPreview(), and DrawMessagePreview().
|
private |
Definition at line 81 of file message_editor.h.
Referenced by DrawMessagePreview().
|
private |
Definition at line 83 of file message_editor.h.
|
private |
Definition at line 85 of file message_editor.h.
Referenced by DrawCharacterToPreview(), Initialize(), and Save().
|
private |
Definition at line 86 of file message_editor.h.
Referenced by DrawTileToPreview(), and Initialize().
|
private |
Definition at line 87 of file message_editor.h.
Referenced by DrawMessagePreview(), DrawTileToPreview(), and Initialize().
|
private |
Definition at line 88 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessageList(), and Initialize().
|
private |
Definition at line 89 of file message_editor.h.
Referenced by DrawMessageList(), Initialize(), ReadAllTextData(), ReadAllTextDataV2(), Save(), and Update().
|
private |
Definition at line 90 of file message_editor.h.
Referenced by DrawDictionary(), GetDictionaryFromID(), and Initialize().
|
private |
Definition at line 92 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessageList(), DrawMessagePreview(), and Update().
|
private |
Definition at line 94 of file message_editor.h.
Referenced by DrawCurrentMessage(), and Initialize().
|
private |
Definition at line 95 of file message_editor.h.
Referenced by DrawCurrentMessage(), and Initialize().
|
private |
Definition at line 96 of file message_editor.h.
Referenced by Initialize().
|
private |
Definition at line 98 of file message_editor.h.
Referenced by DrawCurrentMessage().
|
private |
Definition at line 99 of file message_editor.h.
Referenced by DrawCurrentMessage().
|
private |
Definition at line 157 of file message_editor.h.
Referenced by Copy(), Cut(), Delete(), DrawCurrentMessage(), Paste(), SelectAll(), and Undo().