#include <message_editor.h>

Public Member Functions | |
| MessageEditor (Rom *rom=nullptr) | |
| MessageEditor (Rom *rom, const EditorDependencies &deps) | |
| void | Initialize () override |
| absl::Status | Load () override |
| absl::Status | Update () override |
| void | DrawMessageList () |
| void | DrawCurrentMessage () |
| void | DrawFontAtlas () |
| void | DrawTextCommands () |
| void | DrawSpecialCharacters () |
| void | DrawExpandedMessageSettings () |
| void | DrawDictionary () |
| void | DrawMessagePreview () |
| absl::Status | Save () override |
| absl::Status | SaveExpandedMessages () |
| absl::Status | Cut () override |
| absl::Status | Copy () override |
| absl::Status | Paste () override |
| absl::Status | Undo () override |
| absl::Status | Redo () override |
| absl::Status | Find () override |
| void | Delete () |
| void | SelectAll () |
| void | set_rom (Rom *rom) |
| Rom * | rom () const |
Public Member Functions inherited from yaze::editor::Editor | |
| Editor ()=default | |
| virtual | ~Editor ()=default |
| void | SetDependencies (const EditorDependencies &deps) |
| virtual absl::Status | Clear () |
| EditorType | type () const |
| bool * | active () |
| void | set_active (bool active) |
| void | toggle_active () |
| virtual bool | IsRomLoaded () const |
| virtual std::string | GetRomStatus () const |
Private Attributes | |
| bool | case_sensitive_ = false |
| bool | match_whole_word_ = false |
| std::string | search_text_ = "" |
| std::array< uint8_t, 0x4000 > | raw_font_gfx_data_ |
| std::vector< std::string > | parsed_messages_ |
| std::vector< MessageData > | list_of_texts_ |
| std::vector< MessageData > | expanded_messages_ |
| MessageData | current_message_ |
| MessagePreview | message_preview_ |
| gfx::Bitmap | font_gfx_bitmap_ |
| gfx::Bitmap | current_font_gfx16_bitmap_ |
| gfx::SnesPalette | font_preview_colors_ |
| gui::Canvas | font_gfx_canvas_ {"##FontGfxCanvas", ImVec2(256, 256)} |
| gui::Canvas | current_font_gfx16_canvas_ |
| gui::TextBox | message_text_box_ |
| Rom * | rom_ |
| Rom | expanded_message_bin_ |
| bool | show_message_list_ = false |
| bool | show_message_editor_ = false |
| bool | show_font_atlas_ = false |
| bool | show_dictionary_ = false |
Additional Inherited Members | |
Protected Member Functions inherited from yaze::editor::Editor | |
| std::string | MakeCardTitle (const std::string &base_title) const |
| std::string | MakeCardId (const std::string &base_id) const |
| template<typename T > | |
| absl::StatusOr< T > | SafeRomAccess (std::function< T()> accessor, const std::string &operation="") const |
Protected Attributes inherited from yaze::editor::Editor | |
| bool | active_ = false |
| EditorType | type_ |
| EditorDependencies | dependencies_ |
Definition at line 31 of file message_editor.h.
|
inlineexplicit |
Definition at line 33 of file message_editor.h.
References yaze::editor::kMessage, and yaze::editor::Editor::type_.
|
inlineexplicit |
Definition at line 37 of file message_editor.h.
References yaze::editor::Editor::dependencies_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 65 of file message_editor.cc.
References yaze::editor::MessagePreview::all_dictionaries_, yaze::editor::BuildDictionaryEntries(), yaze::editor::EditorDependencies::card_registry, yaze::gfx::Bitmap::Create(), yaze::gfx::Arena::CREATE, current_font_gfx16_bitmap_, current_message_, yaze::Rom::data(), yaze::editor::Editor::dependencies_, DrawMessagePreview(), yaze::editor::MessagePreview::font_gfx16_data_, yaze::editor::MessagePreview::font_gfx16_data_2_, font_gfx_bitmap_, font_preview_colors_, yaze::gfx::Arena::Get(), ICON_MD_BOOK, ICON_MD_EDIT, ICON_MD_FONT_DOWNLOAD, ICON_MD_LIST, yaze::editor::MessageData::ID, yaze::editor::kCharactersWidth, yaze::editor::kFontGfxMessageDepth, yaze::editor::kFontGfxMessageSize, yaze::editor::kGfxFont, yaze::editor::kWidthArraySize, list_of_texts_, yaze::LoadFontGraphics(), LOG_INFO, yaze::editor::Editor::MakeCardId(), message_preview_, message_text_box_, yaze::gfx::Bitmap::mutable_palette(), yaze::Rom::palette_group(), parsed_messages_, yaze::editor::ParseMessageData(), yaze::gfx::Arena::QueueTextureCommand(), raw_font_gfx_data_, yaze::editor::ReadAllTextData(), yaze::editor::EditorCardRegistry::RegisterCard(), rom(), yaze::gfx::Bitmap::SetPalette(), yaze::gfx::SnesTo8bppSheet(), yaze::gui::TextBox::text, and yaze::editor::MessagePreview::width_array.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 143 of file message_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 148 of file message_editor.cc.
References yaze::gui::EditorCard::Begin(), yaze::editor::EditorDependencies::card_registry, yaze::editor::Editor::dependencies_, DrawCurrentMessage(), DrawDictionary(), DrawExpandedMessageSettings(), DrawFontAtlas(), DrawMessageList(), DrawSpecialCharacters(), DrawTextCommands(), yaze::gui::EditorCard::End(), yaze::editor::EditorCardRegistry::GetVisibilityFlag(), ICON_MD_BOOK, ICON_MD_EDIT, ICON_MD_FONT_DOWNLOAD, ICON_MD_LIST, yaze::editor::Editor::MakeCardId(), and yaze::gui::EditorCard::SetDefaultSize().
| void yaze::editor::MessageEditor::DrawMessageList | ( | ) |
Definition at line 203 of file message_editor.cc.
References yaze::gui::BeginNoPadding(), current_message_, DrawMessagePreview(), yaze::gui::EndNoPadding(), expanded_messages_, yaze::util::HexLong(), yaze::util::HexWord(), yaze::editor::kMessageTableFlags, list_of_texts_, message_text_box_, parsed_messages_, and yaze::gui::TextBox::text.
Referenced by Update().
| void yaze::editor::MessageEditor::DrawCurrentMessage | ( | ) |
Definition at line 252 of file message_editor.cc.
References yaze::gui::BeginPadding(), yaze::gui::Canvas::canvas_size(), current_font_gfx16_bitmap_, current_font_gfx16_canvas_, current_message_, yaze::editor::MessageData::Data, yaze::gui::DisplayPalette(), yaze::gui::Canvas::DrawBackground(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::Canvas::DrawContextMenu(), yaze::gui::Canvas::DrawGrid(), DrawMessagePreview(), yaze::gui::Canvas::DrawOverlay(), yaze::gui::EndPadding(), font_gfx_canvas_, font_preview_colors_, yaze::editor::MessageData::ID, yaze::gui::MemoryEditorPopup(), message_preview_, message_text_box_, yaze::editor::ParseMessageToData(), yaze::editor::MessagePreview::shown_lines, yaze::gui::TextBox::text, and yaze::editor::MessagePreview::text_line.
Referenced by Update().
| void yaze::editor::MessageEditor::DrawFontAtlas | ( | ) |
Definition at line 308 of file message_editor.cc.
References yaze::gui::BeginCanvas(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::Canvas::DrawTileSelector(), yaze::gui::EndCanvas(), font_gfx_bitmap_, and font_gfx_canvas_.
Referenced by Update().

| void yaze::editor::MessageEditor::DrawTextCommands | ( | ) |
Definition at line 352 of file message_editor.cc.
References yaze::gui::InputHexByte(), message_text_box_, and yaze::gui::TextBox::text.
Referenced by Update().

| void yaze::editor::MessageEditor::DrawSpecialCharacters | ( | ) |
Definition at line 370 of file message_editor.cc.
References message_text_box_, and yaze::gui::TextBox::text.
Referenced by Update().
| void yaze::editor::MessageEditor::DrawExpandedMessageSettings | ( | ) |
Definition at line 315 of file message_editor.cc.
References yaze::editor::MessageData::Address, yaze::editor::MessagePreview::all_dictionaries_, yaze::editor::Editor::dependencies_, expanded_messages_, yaze::editor::MessageData::ID, yaze::editor::LoadExpandedMessages(), message_preview_, parsed_messages_, yaze::editor::EditorDependencies::popup_manager, PRINT_IF_ERROR, SaveExpandedMessages(), and yaze::util::FileDialogWrapper::ShowOpenFileDialog().
Referenced by Update().

| void yaze::editor::MessageEditor::DrawDictionary | ( | ) |
Definition at line 385 of file message_editor.cc.
References yaze::editor::MessagePreview::all_dictionaries_, yaze::util::HexWord(), yaze::editor::kMessageTableFlags, and message_preview_.
Referenced by Update().

| void yaze::editor::MessageEditor::DrawMessagePreview | ( | ) |
Definition at line 405 of file message_editor.cc.
References yaze::gfx::Bitmap::Create(), yaze::gfx::Arena::CREATE, current_font_gfx16_bitmap_, current_message_, yaze::editor::MessagePreview::current_preview_data_, yaze::editor::MessagePreview::DrawMessagePreview(), font_preview_colors_, yaze::gfx::Arena::Get(), yaze::gfx::Bitmap::is_active(), yaze::editor::kCurrentMessageHeight, yaze::editor::kCurrentMessageWidth, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARN, message_preview_, yaze::gfx::Arena::QueueTextureCommand(), yaze::gfx::Bitmap::set_data(), yaze::gfx::Bitmap::SetPalette(), yaze::gfx::Bitmap::surface(), and yaze::gfx::Arena::UPDATE.
Referenced by DrawCurrentMessage(), DrawMessageList(), and Initialize().
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 445 of file message_editor.cc.
References 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_, message_preview_, RETURN_IF_ERROR, rom(), yaze::Rom::vector(), and yaze::editor::MessagePreview::width_array.

| absl::Status yaze::editor::MessageEditor::SaveExpandedMessages | ( | ) |
Definition at line 490 of file message_editor.cc.
References expanded_message_bin_, expanded_messages_, yaze::Rom::mutable_data(), RETURN_IF_ERROR, yaze::Rom::SaveToFile(), and yaze::Rom::WriteByte().
Referenced by DrawExpandedMessageSettings().

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 503 of file message_editor.cc.
References yaze::gui::TextBox::Cut(), message_text_box_, and yaze::gui::TextBox::text.

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 521 of file message_editor.cc.
References yaze::gui::TextBox::Copy(), message_text_box_, and yaze::gui::TextBox::selection_length.

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 512 of file message_editor.cc.
References message_text_box_, and yaze::gui::TextBox::Paste().

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 530 of file message_editor.cc.
References yaze::gui::TextBox::can_undo, yaze::gui::TextBox::clearUndo(), message_text_box_, and yaze::gui::TextBox::Undo().

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 542 of file message_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 567 of file message_editor.cc.
References case_sensitive_, match_whole_word_, and search_text_.
| void yaze::editor::MessageEditor::Delete | ( | ) |
Definition at line 548 of file message_editor.cc.
References yaze::gui::TextBox::clear(), message_text_box_, and yaze::gui::TextBox::selection_length.

| void yaze::editor::MessageEditor::SelectAll | ( | ) |
Definition at line 556 of file message_editor.cc.
References yaze::gui::TextBox::Focus(), message_text_box_, yaze::gui::TextBox::SelectAll(), and yaze::gui::TextBox::selection_length.

|
inline |
|
inline |
Definition at line 68 of file message_editor.h.
References rom_.
Referenced by Initialize(), Save(), and set_rom().
|
private |
Definition at line 71 of file message_editor.h.
Referenced by Find().
|
private |
Definition at line 72 of file message_editor.h.
Referenced by Find().
|
private |
Definition at line 73 of file message_editor.h.
Referenced by Find().
|
private |
Definition at line 75 of file message_editor.h.
Referenced by Initialize().
|
private |
Definition at line 76 of file message_editor.h.
Referenced by DrawExpandedMessageSettings(), DrawMessageList(), and Initialize().
|
private |
Definition at line 77 of file message_editor.h.
Referenced by DrawMessageList(), Initialize(), and Save().
|
private |
Definition at line 78 of file message_editor.h.
Referenced by DrawExpandedMessageSettings(), DrawMessageList(), and SaveExpandedMessages().
|
private |
Definition at line 80 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessageList(), DrawMessagePreview(), and Initialize().
|
private |
Definition at line 81 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawDictionary(), DrawExpandedMessageSettings(), DrawMessagePreview(), Initialize(), and Save().
|
private |
Definition at line 83 of file message_editor.h.
Referenced by DrawFontAtlas(), and Initialize().
|
private |
Definition at line 84 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessagePreview(), and Initialize().
|
private |
Definition at line 85 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessagePreview(), and Initialize().
|
private |
Definition at line 87 of file message_editor.h.
Referenced by DrawCurrentMessage(), and DrawFontAtlas().
|
private |
Definition at line 88 of file message_editor.h.
Referenced by DrawCurrentMessage().
|
private |
Definition at line 90 of file message_editor.h.
Referenced by Copy(), Cut(), Delete(), DrawCurrentMessage(), DrawMessageList(), DrawSpecialCharacters(), DrawTextCommands(), Initialize(), Paste(), SelectAll(), and Undo().
|
private |
Definition at line 91 of file message_editor.h.
|
private |
Definition at line 92 of file message_editor.h.
Referenced by SaveExpandedMessages().
|
private |
Definition at line 95 of file message_editor.h.
|
private |
Definition at line 96 of file message_editor.h.
|
private |
Definition at line 97 of file message_editor.h.
|
private |
Definition at line 98 of file message_editor.h.