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

#include <message_editor.h>

Inheritance diagram for yaze::app::editor::MessageEditor:
Collaboration diagram for yaze::app::editor::MessageEditor:

Classes

struct  TextBox
 

Public Member Functions

 MessageEditor ()
 
absl::Status Initialize ()
 
absl::Status Update () override
 
void DrawMessageList ()
 
void DrawCurrentMessage ()
 
void DrawTextCommands ()
 
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::app::editor::Editor
 Editor ()=default
 
virtual ~Editor ()=default
 
EditorType type () const
 
- Public Member Functions inherited from yaze::app::SharedRom
 SharedRom ()=default
 
virtual ~SharedRom ()=default
 
std::shared_ptr< Romshared_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
 
uint8_t width_array [kWidthArraySize]
 
std::string search_text_ = ""
 
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_
 
TextBox message_text_box_
 

Additional Inherited Members

- Static Public Attributes inherited from yaze::app::SharedRom
static std::shared_ptr< Romshared_rom_ = nullptr
 
- Protected Attributes inherited from yaze::app::editor::Editor
EditorType type_
 

Detailed Description

Definition at line 38 of file message_editor.h.

Constructor & Destructor Documentation

◆ MessageEditor()

yaze::app::editor::MessageEditor::MessageEditor ( )
inline

Member Function Documentation

◆ Initialize()

◆ Update()

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

◆ DrawMessageList()

void yaze::app::editor::MessageEditor::DrawMessageList ( )
Todo
ImGui style text filtering

Definition at line 174 of file message_editor.cc.

References current_message_, DrawMessagePreview(), list_of_texts_, parsed_messages_, search_text_, yaze::app::core::UppercaseHexLong(), and yaze::app::core::UppercaseHexWord().

Referenced by Update().

Here is the call graph for this function:

◆ DrawCurrentMessage()

◆ DrawTextCommands()

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

Definition at line 248 of file message_editor.cc.

Referenced by Update().

◆ ReadAllTextDataV2()

◆ ReadAllTextData()

◆ Cut()

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

Implements yaze::app::editor::Editor.

Definition at line 580 of file message_editor.cc.

References yaze::app::editor::MessageEditor::TextBox::Cut(), message_text_box_, and yaze::app::editor::MessageEditor::TextBox::text.

Here is the call graph for this function:

◆ Copy()

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

◆ Paste()

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

Implements yaze::app::editor::Editor.

Definition at line 589 of file message_editor.cc.

References message_text_box_, and yaze::app::editor::MessageEditor::TextBox::Paste().

Here is the call graph for this function:

◆ Undo()

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

◆ Redo()

absl::Status yaze::app::editor::MessageEditor::Redo ( )
inlineoverridevirtual

Implements yaze::app::editor::Editor.

Definition at line 55 of file message_editor.h.

◆ Find()

absl::Status yaze::app::editor::MessageEditor::Find ( )
inlineoverridevirtual

Implements yaze::app::editor::Editor.

Definition at line 58 of file message_editor.h.

◆ Save()

◆ Delete()

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

◆ SelectAll()

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

◆ GetDictionaryFromID()

DictionaryEntry yaze::app::editor::MessageEditor::GetDictionaryFromID ( uint8_t value)

Definition at line 470 of file message_editor.cc.

References all_dictionaries_.

Referenced by DrawCharacterToPreview(), and Initialize().

◆ DrawTileToPreview()

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

Definition at line 477 of file message_editor.cc.

References current_font_gfx16_data_, and font_gfx16_data_.

Referenced by DrawCharacterToPreview().

◆ DrawCharacterToPreview() [1/2]

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

Definition at line 512 of file message_editor.cc.

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

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

Here is the call graph for this function:

◆ DrawCharacterToPreview() [2/2]

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

◆ DrawStringToPreview()

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

Definition at line 506 of file message_editor.cc.

References DrawCharacterToPreview().

Referenced by DrawCharacterToPreview().

Here is the call graph for this function:

◆ DrawMessagePreview()

void yaze::app::editor::MessageEditor::DrawMessagePreview ( )

◆ DisplayTextOverflowError()

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

Member Data Documentation

◆ skip_next

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

Definition at line 76 of file message_editor.h.

Referenced by DrawCharacterToPreview().

◆ data_loaded_

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

Definition at line 77 of file message_editor.h.

Referenced by Update().

◆ text_line_

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

Definition at line 79 of file message_editor.h.

Referenced by DrawCharacterToPreview(), and DrawMessagePreview().

◆ text_position_

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

Definition at line 80 of file message_editor.h.

Referenced by DrawCharacterToPreview(), and DrawMessagePreview().

◆ shown_lines_

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

Definition at line 81 of file message_editor.h.

Referenced by DrawMessagePreview().

◆ width_array

uint8_t yaze::app::editor::MessageEditor::width_array[kWidthArraySize]
private

Definition at line 83 of file message_editor.h.

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

◆ search_text_

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

Definition at line 85 of file message_editor.h.

Referenced by DrawMessageList().

◆ font_gfx16_data_

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

Definition at line 87 of file message_editor.h.

Referenced by DrawTileToPreview(), and Initialize().

◆ current_font_gfx16_data_

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

Definition at line 88 of file message_editor.h.

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

◆ parsed_messages_

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

Definition at line 89 of file message_editor.h.

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

◆ list_of_texts_

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

◆ all_dictionaries_

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

Definition at line 93 of file message_editor.h.

Referenced by GetDictionaryFromID(), Initialize(), and Update().

◆ current_message_

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

Definition at line 95 of file message_editor.h.

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

◆ font_gfx_bitmap_

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

Definition at line 97 of file message_editor.h.

Referenced by DrawCurrentMessage(), and Initialize().

◆ current_font_gfx16_bitmap_

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

Definition at line 98 of file message_editor.h.

Referenced by DrawCurrentMessage(), and Initialize().

◆ font_preview_colors_

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

Definition at line 99 of file message_editor.h.

Referenced by Initialize().

◆ font_gfx_canvas_

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

Definition at line 101 of file message_editor.h.

Referenced by DrawCurrentMessage().

◆ current_font_gfx16_canvas_

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

Definition at line 102 of file message_editor.h.

Referenced by DrawCurrentMessage().

◆ message_text_box_

TextBox yaze::app::editor::MessageEditor::message_text_box_
private

Definition at line 160 of file message_editor.h.

Referenced by Copy(), Cut(), Delete(), DrawCurrentMessage(), Paste(), SelectAll(), and Undo().


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