#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 | 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 |
![]() | |
Editor ()=default | |
virtual | ~Editor ()=default |
virtual absl::Status | Clear () |
EditorType | type () const |
void | set_context (EditorContext *context) |
bool * | active () |
void | set_active (bool active) |
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_ |
Additional Inherited Members | |
![]() | |
bool | active_ = false |
EditorType | type_ |
EditorContext * | context_ = nullptr |
Definition at line 30 of file message_editor.h.
|
inlineexplicit |
Definition at line 32 of file message_editor.h.
References yaze::editor::kMessage, rom(), rom_, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 61 of file message_editor.cc.
References yaze::editor::BuildDictionaryEntries(), yaze::core::Renderer::CreateAndRenderBitmap(), current_font_gfx16_bitmap_, current_message_, yaze::Rom::data(), DrawMessagePreview(), font_gfx_bitmap_, font_preview_colors_, yaze::editor::Renderer::Get(), yaze::editor::kCharactersWidth, yaze::editor::kFontGfxMessageDepth, yaze::editor::kFontGfxMessageSize, yaze::editor::kGfxFont, yaze::editor::kWidthArraySize, list_of_texts_, yaze::LoadFontGraphics(), message_preview_, message_text_box_, yaze::Rom::palette_group(), parsed_messages_, yaze::editor::ParseMessageData(), raw_font_gfx_data_, yaze::editor::ReadAllTextData(), rom(), and yaze::gfx::SnesTo8bppSheet().
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 93 of file message_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 95 of file message_editor.cc.
References DrawCurrentMessage(), DrawDictionary(), DrawExpandedMessageSettings(), DrawFontAtlas(), DrawMessageList(), DrawSpecialCharacters(), DrawTextCommands(), and yaze::editor::kMessageTableFlags.
void yaze::editor::MessageEditor::DrawMessageList | ( | ) |
Definition at line 123 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_, and parsed_messages_.
Referenced by Update().
void yaze::editor::MessageEditor::DrawCurrentMessage | ( | ) |
Definition at line 172 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_canvas_, font_preview_colors_, yaze::gui::MemoryEditorPopup(), message_preview_, message_text_box_, and yaze::editor::ParseMessageToData().
Referenced by Update().
void yaze::editor::MessageEditor::DrawFontAtlas | ( | ) |
Definition at line 228 of file message_editor.cc.
References yaze::gui::BeginCanvas(), yaze::gui::EndCanvas(), font_gfx_bitmap_, and font_gfx_canvas_.
Referenced by Update().
void yaze::editor::MessageEditor::DrawTextCommands | ( | ) |
Definition at line 279 of file message_editor.cc.
References yaze::gui::InputHexByte(), and message_text_box_.
Referenced by Update().
void yaze::editor::MessageEditor::DrawSpecialCharacters | ( | ) |
Definition at line 297 of file message_editor.cc.
References message_text_box_.
Referenced by Update().
void yaze::editor::MessageEditor::DrawExpandedMessageSettings | ( | ) |
Definition at line 235 of file message_editor.cc.
References yaze::editor::MessageData::Address, yaze::editor::Editor::context_, expanded_messages_, yaze::editor::MessageData::ID, yaze::Rom::LoadFromFile(), message_preview_, yaze::Rom::mutable_data(), parsed_messages_, yaze::editor::ParseMessageData(), PRINT_IF_ERROR, yaze::editor::ReadAllTextData(), SaveExpandedMessages(), and yaze::core::FileDialogWrapper::ShowOpenFileDialog().
Referenced by Update().
void yaze::editor::MessageEditor::DrawDictionary | ( | ) |
Definition at line 312 of file message_editor.cc.
References yaze::util::HexWord(), yaze::editor::kMessageTableFlags, and message_preview_.
Referenced by Update().
void yaze::editor::MessageEditor::DrawMessagePreview | ( | ) |
Definition at line 332 of file message_editor.cc.
References yaze::core::Renderer::CreateAndRenderBitmap(), current_font_gfx16_bitmap_, current_message_, font_preview_colors_, yaze::editor::Renderer::Get(), yaze::editor::kCurrentMessageHeight, yaze::editor::kCurrentMessageWidth, message_preview_, and yaze::core::Renderer::UpdateBitmap().
Referenced by DrawCurrentMessage(), DrawMessageList(), and Initialize().
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 346 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(), and yaze::Rom::vector().
absl::Status yaze::editor::MessageEditor::SaveExpandedMessages | ( | ) |
Definition at line 391 of file message_editor.cc.
References expanded_message_bin_, expanded_messages_, and RETURN_IF_ERROR.
Referenced by DrawExpandedMessageSettings().
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 404 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 422 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 413 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 431 of file message_editor.cc.
References message_text_box_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 443 of file message_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 468 of file message_editor.cc.
References case_sensitive_, match_whole_word_, and search_text_.
void yaze::editor::MessageEditor::Delete | ( | ) |
Definition at line 449 of file message_editor.cc.
References message_text_box_.
void yaze::editor::MessageEditor::SelectAll | ( | ) |
Definition at line 457 of file message_editor.cc.
References message_text_box_.
|
inline |
|
inline |
Definition at line 62 of file message_editor.h.
References rom_.
Referenced by Initialize(), MessageEditor(), Save(), and set_rom().
|
private |
Definition at line 65 of file message_editor.h.
Referenced by Find().
|
private |
Definition at line 66 of file message_editor.h.
Referenced by Find().
|
private |
Definition at line 67 of file message_editor.h.
Referenced by Find().
|
private |
Definition at line 69 of file message_editor.h.
Referenced by Initialize().
|
private |
Definition at line 70 of file message_editor.h.
Referenced by DrawExpandedMessageSettings(), DrawMessageList(), and Initialize().
|
private |
Definition at line 71 of file message_editor.h.
Referenced by DrawMessageList(), Initialize(), and Save().
|
private |
Definition at line 72 of file message_editor.h.
Referenced by DrawExpandedMessageSettings(), DrawMessageList(), and SaveExpandedMessages().
|
private |
Definition at line 74 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessageList(), DrawMessagePreview(), and Initialize().
|
private |
Definition at line 75 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawDictionary(), DrawExpandedMessageSettings(), DrawMessagePreview(), Initialize(), and Save().
|
private |
Definition at line 77 of file message_editor.h.
Referenced by DrawFontAtlas(), and Initialize().
|
private |
Definition at line 78 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessagePreview(), and Initialize().
|
private |
Definition at line 79 of file message_editor.h.
Referenced by DrawCurrentMessage(), DrawMessagePreview(), and Initialize().
|
private |
Definition at line 81 of file message_editor.h.
Referenced by DrawCurrentMessage(), and DrawFontAtlas().
|
private |
Definition at line 82 of file message_editor.h.
Referenced by DrawCurrentMessage().
|
private |
Definition at line 84 of file message_editor.h.
Referenced by Copy(), Cut(), Delete(), DrawCurrentMessage(), DrawMessageList(), DrawSpecialCharacters(), DrawTextCommands(), Initialize(), Paste(), SelectAll(), and Undo().
|
private |
Definition at line 85 of file message_editor.h.
Referenced by MessageEditor(), rom(), and set_rom().
|
private |
Definition at line 86 of file message_editor.h.
Referenced by SaveExpandedMessages().