yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::MessageEditor Class Reference

#include <message_editor.h>

Inheritance diagram for yaze::editor::MessageEditor:

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)
 
Romrom () const
 
- Public Member Functions inherited from yaze::editor::Editor
 Editor ()=default
 
virtual ~Editor ()=default
 
virtual absl::Status Clear ()
 
EditorType type () const
 
void set_context (EditorContext *context)
 
bool * active ()
 
void set_active (bool 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< MessageDatalist_of_texts_
 
std::vector< MessageDataexpanded_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_
 
Romrom_
 
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
 
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_
 
EditorContextcontext_ = nullptr
 

Detailed Description

Definition at line 31 of file message_editor.h.

Constructor & Destructor Documentation

◆ MessageEditor()

yaze::editor::MessageEditor::MessageEditor ( Rom rom = nullptr)
inlineexplicit

Definition at line 33 of file message_editor.h.

References yaze::editor::kMessage, and yaze::editor::Editor::type_.

Member Function Documentation

◆ Initialize()

◆ Load()

absl::Status yaze::editor::MessageEditor::Load ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 140 of file message_editor.cc.

Referenced by yaze::editor::EditorManager::LoadAssets().

◆ Update()

absl::Status yaze::editor::MessageEditor::Update ( )
overridevirtual

◆ DrawMessageList()

◆ DrawCurrentMessage()

◆ DrawFontAtlas()

void yaze::editor::MessageEditor::DrawFontAtlas ( )

Definition at line 278 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().

Here is the call graph for this function:

◆ DrawTextCommands()

void yaze::editor::MessageEditor::DrawTextCommands ( )

Definition at line 320 of file message_editor.cc.

References yaze::gui::InputHexByte(), message_text_box_, and yaze::gui::TextBox::text.

Referenced by Update().

Here is the call graph for this function:

◆ DrawSpecialCharacters()

void yaze::editor::MessageEditor::DrawSpecialCharacters ( )

Definition at line 338 of file message_editor.cc.

References message_text_box_, and yaze::gui::TextBox::text.

Referenced by Update().

◆ DrawExpandedMessageSettings()

◆ DrawDictionary()

void yaze::editor::MessageEditor::DrawDictionary ( )

Definition at line 353 of file message_editor.cc.

References yaze::editor::MessagePreview::all_dictionaries_, yaze::util::HexWord(), yaze::editor::kMessageTableFlags, and message_preview_.

Referenced by Update().

Here is the call graph for this function:

◆ DrawMessagePreview()

◆ Save()

◆ SaveExpandedMessages()

absl::Status yaze::editor::MessageEditor::SaveExpandedMessages ( )

Definition at line 458 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().

Here is the call graph for this function:

◆ Cut()

absl::Status yaze::editor::MessageEditor::Cut ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 471 of file message_editor.cc.

References yaze::gui::TextBox::Cut(), message_text_box_, and yaze::gui::TextBox::text.

Here is the call graph for this function:

◆ Copy()

absl::Status yaze::editor::MessageEditor::Copy ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 489 of file message_editor.cc.

References yaze::gui::TextBox::Copy(), message_text_box_, and yaze::gui::TextBox::selection_length.

Here is the call graph for this function:

◆ Paste()

absl::Status yaze::editor::MessageEditor::Paste ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 480 of file message_editor.cc.

References message_text_box_, and yaze::gui::TextBox::Paste().

Here is the call graph for this function:

◆ Undo()

absl::Status yaze::editor::MessageEditor::Undo ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 498 of file message_editor.cc.

References yaze::gui::TextBox::can_undo, yaze::gui::TextBox::clearUndo(), message_text_box_, and yaze::gui::TextBox::Undo().

Here is the call graph for this function:

◆ Redo()

absl::Status yaze::editor::MessageEditor::Redo ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 510 of file message_editor.cc.

◆ Find()

absl::Status yaze::editor::MessageEditor::Find ( )
overridevirtual
Todo:
Implement replace functionality

Implements yaze::editor::Editor.

Definition at line 535 of file message_editor.cc.

References case_sensitive_, match_whole_word_, and search_text_.

◆ Delete()

void yaze::editor::MessageEditor::Delete ( )

Definition at line 516 of file message_editor.cc.

References yaze::gui::TextBox::clear(), message_text_box_, and yaze::gui::TextBox::selection_length.

Here is the call graph for this function:

◆ SelectAll()

void yaze::editor::MessageEditor::SelectAll ( )

Definition at line 524 of file message_editor.cc.

References yaze::gui::TextBox::Focus(), message_text_box_, yaze::gui::TextBox::SelectAll(), and yaze::gui::TextBox::selection_length.

Here is the call graph for this function:

◆ set_rom()

void yaze::editor::MessageEditor::set_rom ( Rom rom)
inline

Definition at line 62 of file message_editor.h.

References rom(), and rom_.

Here is the call graph for this function:

◆ rom()

Rom * yaze::editor::MessageEditor::rom ( ) const
inline

Definition at line 63 of file message_editor.h.

References rom_.

Referenced by Initialize(), Save(), and set_rom().

Member Data Documentation

◆ case_sensitive_

bool yaze::editor::MessageEditor::case_sensitive_ = false
private

Definition at line 66 of file message_editor.h.

Referenced by Find().

◆ match_whole_word_

bool yaze::editor::MessageEditor::match_whole_word_ = false
private

Definition at line 67 of file message_editor.h.

Referenced by Find().

◆ search_text_

std::string yaze::editor::MessageEditor::search_text_ = ""
private

Definition at line 68 of file message_editor.h.

Referenced by Find().

◆ raw_font_gfx_data_

std::array<uint8_t, 0x4000> yaze::editor::MessageEditor::raw_font_gfx_data_
private

Definition at line 70 of file message_editor.h.

Referenced by Initialize().

◆ parsed_messages_

std::vector<std::string> yaze::editor::MessageEditor::parsed_messages_
private

Definition at line 71 of file message_editor.h.

Referenced by DrawExpandedMessageSettings(), DrawMessageList(), and Initialize().

◆ list_of_texts_

std::vector<MessageData> yaze::editor::MessageEditor::list_of_texts_
private

Definition at line 72 of file message_editor.h.

Referenced by DrawMessageList(), Initialize(), and Save().

◆ expanded_messages_

std::vector<MessageData> yaze::editor::MessageEditor::expanded_messages_
private

◆ current_message_

MessageData yaze::editor::MessageEditor::current_message_
private

◆ message_preview_

MessagePreview yaze::editor::MessageEditor::message_preview_
private

◆ font_gfx_bitmap_

gfx::Bitmap yaze::editor::MessageEditor::font_gfx_bitmap_
private

Definition at line 78 of file message_editor.h.

Referenced by DrawFontAtlas(), and Initialize().

◆ current_font_gfx16_bitmap_

gfx::Bitmap yaze::editor::MessageEditor::current_font_gfx16_bitmap_
private

Definition at line 79 of file message_editor.h.

Referenced by DrawCurrentMessage(), DrawMessagePreview(), and Initialize().

◆ font_preview_colors_

gfx::SnesPalette yaze::editor::MessageEditor::font_preview_colors_
private

Definition at line 80 of file message_editor.h.

Referenced by DrawCurrentMessage(), DrawMessagePreview(), and Initialize().

◆ font_gfx_canvas_

gui::Canvas yaze::editor::MessageEditor::font_gfx_canvas_ {"##FontGfxCanvas", ImVec2(256, 256)}
private

Definition at line 82 of file message_editor.h.

Referenced by DrawCurrentMessage(), and DrawFontAtlas().

◆ current_font_gfx16_canvas_

gui::Canvas yaze::editor::MessageEditor::current_font_gfx16_canvas_
private
Initial value:
{"##CurrentMessageGfx",
ImVec2(172 * 2, 4096)}

Definition at line 83 of file message_editor.h.

Referenced by DrawCurrentMessage().

◆ message_text_box_

gui::TextBox yaze::editor::MessageEditor::message_text_box_
private

◆ rom_

Rom* yaze::editor::MessageEditor::rom_
private

Definition at line 86 of file message_editor.h.

Referenced by rom(), and set_rom().

◆ expanded_message_bin_

Rom yaze::editor::MessageEditor::expanded_message_bin_
private

Definition at line 87 of file message_editor.h.

Referenced by SaveExpandedMessages().

◆ show_message_list_

bool yaze::editor::MessageEditor::show_message_list_ = false
private

Definition at line 90 of file message_editor.h.

Referenced by Initialize().

◆ show_message_editor_

bool yaze::editor::MessageEditor::show_message_editor_ = false
private

Definition at line 91 of file message_editor.h.

Referenced by Initialize().

◆ show_font_atlas_

bool yaze::editor::MessageEditor::show_font_atlas_ = false
private

Definition at line 92 of file message_editor.h.

Referenced by Initialize().

◆ show_dictionary_

bool yaze::editor::MessageEditor::show_dictionary_ = false
private

Definition at line 93 of file message_editor.h.

Referenced by Initialize().


The documentation for this class was generated from the following files: