yaze 0.2.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 DrawTextCommands ()
 
void DrawSpecialCharacters ()
 
void DrawDictionary ()
 
void DrawImportExport ()
 
void DrawMessageSettings ()
 
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 ()
 
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)
 
absl::Status ImportMessagesFromFile (const std::string &filename)
 
absl::Status ExportMessagesToFile (const std::string &filename)
 
void SetMessageFont (int font_index)
 
void SetMessageColor (int color_index)
 
void SetMessageSpeed (int speed)
 
void SetMessageWindow (int window_type)
 
void SetMessagePosition (int x, int y)
 
void set_rom (Rom *rom)
 
Romrom () const
 
- Public Member Functions inherited from yaze::editor::Editor
 Editor ()=default
 
virtual ~Editor ()=default
 
virtual absl::Status Clear ()
 
virtual void CleanupUnusedTextures (uint64_t current_time, uint64_t timeout)
 
EditorType type () const
 
void set_context (EditorContext *context)
 
bool * active ()
 
void set_active (bool active)
 

Private Attributes

Romrom_
 
bool skip_next = false
 
bool data_loaded_ = false
 
bool case_sensitive_ = false
 
bool match_whole_word_ = false
 
bool export_expanded_messages_ = false
 
int text_line_ = 0
 
int text_position_ = 0
 
int shown_lines_ = 0
 
std::string search_text_ = ""
 
std::string import_filename_ = ""
 
std::string export_filename_ = ""
 
std::array< uint8_t, kWidthArraySizewidth_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< MessageDatalist_of_texts_
 
std::vector< DictionaryEntryall_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_
 
gui::Canvas tile_editor_canvas_ {"##TileEditorCanvas", ImVec2(256, 256)}
 
gui::Canvas tile_preview_canvas_ {"##TilePreviewCanvas", ImVec2(64, 64)}
 
gui::TextBox message_text_box_
 
absl::Status status_
 

Additional Inherited Members

- Protected Attributes inherited from yaze::editor::Editor
bool active_ = false
 
EditorType type_
 
EditorContextcontext_ = nullptr
 

Detailed Description

Definition at line 32 of file message_editor.h.

Constructor & Destructor Documentation

◆ MessageEditor()

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

Definition at line 34 of file message_editor.h.

References yaze::editor::kMessage, rom(), rom_, and yaze::editor::Editor::type_.

Here is the call graph for this function:

Member Function Documentation

◆ Initialize()

◆ Load()

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

Implements yaze::editor::Editor.

Definition at line 87 of file message_editor.cc.

◆ Update()

◆ DrawMessageList()

void yaze::editor::MessageEditor::DrawMessageList ( )

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

Here is the call graph for this function:

◆ DrawCurrentMessage()

◆ DrawTextCommands()

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

Definition at line 204 of file message_editor.cc.

References message_text_box_.

Referenced by Update().

◆ DrawSpecialCharacters()

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

Definition at line 219 of file message_editor.cc.

References message_text_box_.

Referenced by Update().

◆ DrawDictionary()

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

Definition at line 232 of file message_editor.cc.

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

Referenced by Update().

Here is the call graph for this function:

◆ DrawImportExport()

void yaze::editor::MessageEditor::DrawImportExport ( )

Definition at line 255 of file message_editor.cc.

References ExportMessagesToFile(), ImportMessagesFromFile(), and status_.

Referenced by Update().

Here is the call graph for this function:

◆ DrawMessageSettings()

void yaze::editor::MessageEditor::DrawMessageSettings ( )

◆ Cut()

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

Implements yaze::editor::Editor.

Definition at line 451 of file message_editor.cc.

References message_text_box_.

◆ Copy()

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

Implements yaze::editor::Editor.

Definition at line 469 of file message_editor.cc.

References message_text_box_.

◆ Paste()

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

Implements yaze::editor::Editor.

Definition at line 460 of file message_editor.cc.

References message_text_box_.

◆ Undo()

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

Implements yaze::editor::Editor.

Definition at line 478 of file message_editor.cc.

References message_text_box_.

◆ Redo()

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

Implements yaze::editor::Editor.

Definition at line 490 of file message_editor.cc.

◆ Find()

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

Implements yaze::editor::Editor.

Definition at line 515 of file message_editor.cc.

References case_sensitive_, match_whole_word_, and search_text_.

◆ Save()

◆ Delete()

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

Definition at line 496 of file message_editor.cc.

References message_text_box_.

◆ SelectAll()

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

Definition at line 504 of file message_editor.cc.

References message_text_box_.

◆ DrawTileToPreview()

void yaze::editor::MessageEditor::DrawTileToPreview ( int x,
int y,
int srcx,
int srcy,
int pal,
int sizex = 1,
int sizey = 1 )

Definition at line 279 of file message_editor.cc.

References current_font_gfx16_data_, and font_gfx16_data_.

Referenced by DrawCharacterToPreview().

◆ DrawCharacterToPreview() [1/2]

void yaze::editor::MessageEditor::DrawCharacterToPreview ( char c)

Definition at line 317 of file message_editor.cc.

References DrawCharacterToPreview(), and yaze::editor::FindMatchingCharacter().

Referenced by DrawCharacterToPreview(), DrawCharacterToPreview(), DrawMessagePreview(), and DrawStringToPreview().

Here is the call graph for this function:

◆ DrawCharacterToPreview() [2/2]

void yaze::editor::MessageEditor::DrawCharacterToPreview ( const std::vector< uint8_t > & text)

◆ DrawStringToPreview()

void yaze::editor::MessageEditor::DrawStringToPreview ( std::string str)

Definition at line 311 of file message_editor.cc.

References DrawCharacterToPreview().

Referenced by DrawCharacterToPreview().

Here is the call graph for this function:

◆ DrawMessagePreview()

◆ DisplayTextOverflowError()

std::string yaze::editor::MessageEditor::DisplayTextOverflowError ( int pos,
bool bank )

◆ ImportMessagesFromFile()

absl::Status yaze::editor::MessageEditor::ImportMessagesFromFile ( const std::string & filename)

Definition at line 543 of file message_editor.cc.

References list_of_texts_, and yaze::editor::ParseMessageToData().

Referenced by DrawImportExport().

Here is the call graph for this function:

◆ ExportMessagesToFile()

absl::Status yaze::editor::MessageEditor::ExportMessagesToFile ( const std::string & filename)

Definition at line 593 of file message_editor.cc.

References list_of_texts_.

Referenced by DrawImportExport().

◆ SetMessageFont()

void yaze::editor::MessageEditor::SetMessageFont ( int font_index)

◆ SetMessageColor()

void yaze::editor::MessageEditor::SetMessageColor ( int color_index)

◆ SetMessageSpeed()

void yaze::editor::MessageEditor::SetMessageSpeed ( int speed)

◆ SetMessageWindow()

void yaze::editor::MessageEditor::SetMessageWindow ( int window_type)

◆ SetMessagePosition()

void yaze::editor::MessageEditor::SetMessagePosition ( int x,
int y )

◆ set_rom()

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

Definition at line 77 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 78 of file message_editor.h.

References rom_.

Referenced by DrawCurrentMessage(), Initialize(), MessageEditor(), Save(), set_rom(), and Update().

Member Data Documentation

◆ rom_

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

Definition at line 81 of file message_editor.h.

Referenced by MessageEditor(), rom(), and set_rom().

◆ skip_next

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

Definition at line 82 of file message_editor.h.

Referenced by DrawCharacterToPreview().

◆ data_loaded_

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

Definition at line 83 of file message_editor.h.

Referenced by Update().

◆ case_sensitive_

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

Definition at line 84 of file message_editor.h.

Referenced by Find().

◆ match_whole_word_

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

Definition at line 85 of file message_editor.h.

Referenced by Find().

◆ export_expanded_messages_

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

Definition at line 86 of file message_editor.h.

◆ text_line_

int yaze::editor::MessageEditor::text_line_ = 0
private

Definition at line 88 of file message_editor.h.

Referenced by DrawCharacterToPreview(), and DrawMessagePreview().

◆ text_position_

int yaze::editor::MessageEditor::text_position_ = 0
private

Definition at line 89 of file message_editor.h.

Referenced by DrawCharacterToPreview(), and DrawMessagePreview().

◆ shown_lines_

int yaze::editor::MessageEditor::shown_lines_ = 0
private

Definition at line 90 of file message_editor.h.

Referenced by DrawMessagePreview().

◆ search_text_

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

Definition at line 92 of file message_editor.h.

Referenced by Find().

◆ import_filename_

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

Definition at line 93 of file message_editor.h.

◆ export_filename_

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

Definition at line 94 of file message_editor.h.

◆ width_array

std::array<uint8_t, kWidthArraySize> yaze::editor::MessageEditor::width_array = {0}
private

Definition at line 96 of file message_editor.h.

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

◆ font_gfx16_data_

std::vector<uint8_t> yaze::editor::MessageEditor::font_gfx16_data_
private

Definition at line 97 of file message_editor.h.

Referenced by DrawTileToPreview(), and Initialize().

◆ current_font_gfx16_data_

std::vector<uint8_t> yaze::editor::MessageEditor::current_font_gfx16_data_
private

Definition at line 98 of file message_editor.h.

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

◆ parsed_messages_

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

Definition at line 99 of file message_editor.h.

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

◆ list_of_texts_

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

◆ all_dictionaries_

std::vector<DictionaryEntry> yaze::editor::MessageEditor::all_dictionaries_
private

Definition at line 101 of file message_editor.h.

Referenced by DrawCharacterToPreview(), DrawDictionary(), and Initialize().

◆ current_message_

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

Definition at line 103 of file message_editor.h.

Referenced by DrawCurrentMessage(), DrawMessageList(), DrawMessagePreview(), and Update().

◆ font_gfx_bitmap_

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

Definition at line 105 of file message_editor.h.

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

◆ current_font_gfx16_bitmap_

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

Definition at line 106 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 107 of file message_editor.h.

Referenced by DrawCurrentMessage(), and Initialize().

◆ font_gfx_canvas_

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

Definition at line 109 of file message_editor.h.

Referenced by DrawCurrentMessage().

◆ current_font_gfx16_canvas_

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

Definition at line 110 of file message_editor.h.

Referenced by DrawCurrentMessage().

◆ tile_editor_canvas_

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

Definition at line 112 of file message_editor.h.

◆ tile_preview_canvas_

gui::Canvas yaze::editor::MessageEditor::tile_preview_canvas_ {"##TilePreviewCanvas", ImVec2(64, 64)}
private

Definition at line 113 of file message_editor.h.

◆ message_text_box_

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

◆ status_

absl::Status yaze::editor::MessageEditor::status_
private

Definition at line 117 of file message_editor.h.

Referenced by DrawCurrentMessage(), DrawImportExport(), and Update().


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