#include <message_editor.h>
Classes | |
struct | TextBox |
Public Member Functions | |
MessageEditor () | |
absl::Status | Initialize () |
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 () |
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) |
Public Member Functions inherited from yaze::editor::Editor | |
Editor ()=default | |
virtual | ~Editor ()=default |
EditorType | type () const |
Public Member Functions inherited from yaze::SharedRom | |
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 Public Attributes inherited from yaze::SharedRom | |
static std::shared_ptr< Rom > | shared_rom_ = nullptr |
Protected Attributes inherited from yaze::editor::Editor | |
EditorType | type_ |
EditorContext | context_ |
Definition at line 35 of file message_editor.h.
|
inline |
Definition at line 37 of file message_editor.h.
References yaze::editor::kMessage, and yaze::editor::Editor::type_.
absl::Status yaze::editor::MessageEditor::Initialize | ( | ) |
Definition at line 47 of file message_editor.cc.
References all_dictionaries_, yaze::editor::BuildDictionaryEntries(), 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(), RETURN_IF_ERROR, yaze::SharedRom::rom(), yaze::gfx::SnesTo8bppSheet(), and width_array.
Referenced by Update().
|
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_, RETURN_IF_ERROR, 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(), and yaze::core::Renderer::UpdateBitmap().
Referenced by Update().
void yaze::editor::MessageEditor::DrawTextCommands | ( | ) |
Definition at line 190 of file message_editor.cc.
Referenced by Update().
void yaze::editor::MessageEditor::DrawDictionary | ( | ) |
Definition at line 204 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 225 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 327 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 549 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 567 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 558 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 576 of file message_editor.cc.
References message_text_box_.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 53 of file message_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 56 of file message_editor.h.
absl::Status yaze::editor::MessageEditor::Save | ( | ) |
Definition at line 588 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 646 of file message_editor.cc.
References message_text_box_.
void yaze::editor::MessageEditor::SelectAll | ( | ) |
Definition at line 654 of file message_editor.cc.
References message_text_box_.
DictionaryEntry yaze::editor::MessageEditor::GetDictionaryFromID | ( | uint8_t | value | ) |
Definition at line 436 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 443 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 481 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 485 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 475 of file message_editor.cc.
References DrawCharacterToPreview().
Referenced by DrawCharacterToPreview().
void yaze::editor::MessageEditor::DrawMessagePreview | ( | ) |
Definition at line 538 of file message_editor.cc.
References current_font_gfx16_data_, current_message_, DrawCharacterToPreview(), 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 633 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 74 of file message_editor.h.
Referenced by DrawCharacterToPreview().
|
private |
Definition at line 75 of file message_editor.h.
Referenced by Update().
|
private |
Definition at line 77 of file message_editor.h.
Referenced by DrawCharacterToPreview(), and DrawMessagePreview().
|
private |
Definition at line 78 of file message_editor.h.
Referenced by DrawCharacterToPreview(), and DrawMessagePreview().
|
private |
Definition at line 79 of file message_editor.h.
Referenced by DrawMessagePreview().
|
private |
Definition at line 81 of file message_editor.h.
|
private |
Definition at line 83 of file message_editor.h.
Referenced by DrawCharacterToPreview(), Initialize(), and Save().
|
private |
Definition at line 84 of file message_editor.h.
Referenced by DrawTileToPreview(), and Initialize().
|
private |
Definition at line 85 of file message_editor.h.
Referenced by DrawMessagePreview(), DrawTileToPreview(), and Initialize().
|
private |
Definition at line 86 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessageList(), and Initialize().
|
private |
Definition at line 87 of file message_editor.h.
Referenced by DrawMessageList(), Initialize(), ReadAllTextData(), ReadAllTextDataV2(), Save(), and Update().
|
private |
Definition at line 88 of file message_editor.h.
Referenced by DrawDictionary(), GetDictionaryFromID(), and Initialize().
|
private |
Definition at line 90 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessageList(), DrawMessagePreview(), and Update().
|
private |
Definition at line 92 of file message_editor.h.
Referenced by DrawCurrentMessage(), and Initialize().
|
private |
Definition at line 93 of file message_editor.h.
Referenced by DrawCurrentMessage(), and Initialize().
|
private |
Definition at line 94 of file message_editor.h.
Referenced by Initialize().
|
private |
Definition at line 96 of file message_editor.h.
Referenced by DrawCurrentMessage().
|
private |
Definition at line 97 of file message_editor.h.
Referenced by DrawCurrentMessage().
|
private |
Definition at line 155 of file message_editor.h.
Referenced by Copy(), Cut(), Delete(), DrawCurrentMessage(), Paste(), SelectAll(), and Undo().