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:

Classes

struct  DirtyState
 
struct  ExpandedDraftSnapshot
 
struct  MessageRow
 
struct  MessageSourcePublishButtons
 
struct  PlannedWrite
 
struct  SavePlan
 

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 SetGameData (zelda3::GameData *game_data) override
 
void DrawMessageList ()
 
void DrawCurrentMessage ()
 
void DrawFontAtlas ()
 
void DrawTextCommands ()
 
void DrawSpecialCharacters ()
 
void DrawExpandedMessageSettings ()
 
void DrawDictionary ()
 
void DrawMessageTools ()
 
void DrawMessagePreview ()
 
void UpdateCurrentMessageFromText (const std::string &text)
 
void ContributeStatus (StatusBar *status_bar) override
 
bool OpenMessageById (int display_id)
 
absl::Status Save () override
 
absl::Status BeginSaveTransaction () override
 
void RollbackSaveTransaction () override
 
void CommitSaveTransaction () override
 
absl::Status SaveExpandedMessages ()
 
absl::Status LoadExpandedMessagesFromRom ()
 
absl::Status LoadCanonicalExpandedSource ()
 
int CalculateExpandedBankUsage () const
 
absl::Status Cut () override
 
absl::Status Copy () override
 
absl::Status Paste () override
 
absl::Status Undo () override
 
absl::Status Redo () override
 
absl::Status Find () override
 
bool CanUndo () const override
 
bool CanFind () const 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
 
virtual void SetDependencies (const EditorDependencies &deps)
 
virtual void PrepareForSessionTeardown ()
 
virtual std::string GetUndoDescription () const
 
virtual std::string GetRedoDescription () const
 
const UndoManager & undo_manager () const
 
virtual absl::Status Clear ()
 
virtual bool CanRedo () const
 
virtual bool CanCut () const
 
virtual bool CanCopy () const
 
virtual bool CanPaste () const
 
virtual EditorContextSnapshot BuildContextSnapshot () const
 
EditorType type () const
 
bool * active ()
 
void set_active (bool active)
 
void toggle_active ()
 
virtual bool IsRomLoaded () const
 
virtual std::string GetRomStatus () const
 
Rom * rom () const
 
zelda3::GameData * game_data () const
 
project::YazeProject * project () const
 
core::VersionManager * version_manager () const
 
EditorContext context () const
 
bool HasContext () const
 

Private Types

enum class  SaveDomain { kFontWidths , kVanillaMessages , kExpandedMessages }
 

Private Member Functions

absl::StatusOr< SavePlan > BuildSavePlan (bool include_font_widths, bool include_vanilla_messages, bool include_expanded_messages) const
 
absl::Status ValidateSavePlan (const SavePlan &plan) const
 
absl::Status ApplySavePlan (const SavePlan &plan)
 
absl::Status SaveDirtyDomains (bool include_font_widths, bool include_vanilla_messages, bool include_expanded_messages)
 
void MarkDomainDirty (SaveDomain domain)
 
void RecordSavedDomains (const SavePlan &plan)
 
void ClearSavedDomains (const DirtyState &saved)
 
void SyncCurrentExpandedMessageAddress ()
 
std::vector< MessageRow > CollectMessageRows (bool apply_filter) const
 
int CurrentDisplayId () const
 
std::string_view ContentsForDisplayId (int display_id) const
 
void DrawFindBar ()
 
void DrawMessageHeader ()
 
void DrawMessageStructure ()
 
void DrawTokenInserter (const std::vector< TextElement > &elements, std::string &filter, bool use_parameter)
 
void InsertTokenAtCursor (const std::string &token)
 
void SelectAdjacentMessage (int delta)
 
void NoteLoadedMessages ()
 
void AcceptCurrentAsReference ()
 
std::string CurrentReferenceText () const
 
void DrawDialogueTextPane (float height)
 
bool HasMessageSourceLayout () const
 
bool ExpandedEditsAreSourceOwned () const
 
std::pair< int, int > ExpandedInspectionRange () const
 
std::string MessageSourceIncomingPath () const
 
void InvalidateSourcePreview ()
 
absl::StatusOr< std::filesystem::path > ResolveCanonicalBundlePath () const
 
absl::StatusOr< std::string > HashFileSha256 (const std::filesystem::path &path) const
 
bool IsCanonicalBundlePath (const std::string &path) const
 
ExpandedDraftSnapshot CaptureExpandedDraft () const
 
void RestoreExpandedDraft (const ExpandedDraftSnapshot &snapshot)
 
absl::Status LoadExpandedMessagesFromBin (const std::string &path)
 
void PreviewMessageSource ()
 
void PublishMessageSource ()
 
MessageSourcePublishButtons DrawMessageSourcePublishButtons ()
 
void DrawMessageSourceSync ()
 
bool AdvanceFind (bool forward)
 
bool ActivateFindMatch (const MessageRow &row, size_t offset, bool wrapped)
 
void OptimizeCurrentMessage ()
 
void HandleMessageShortcuts ()
 
int ReplaceCurrentMatch ()
 
int ReplaceAllMatches ()
 
void PushUndoSnapshot ()
 
void FinalizePendingUndo ()
 
void ApplySnapshot (const MessageSnapshot &snapshot)
 
void ResolveFontPalette ()
 
gfx::SnesPalette BuildFallbackFontPalette () const
 
void LoadFontGraphics ()
 
void RefreshFontAtlasBitmap (const std::vector< uint8_t > &font_data)
 
void ApplyFontPalette ()
 
void EnsureFontTexturesReady ()
 
void ImportMessageBundleFromFile (const std::string &path)
 
int ResolveExpandedMessageBaseId () const
 

Private Attributes

bool case_sensitive_ = false
 
bool match_whole_word_ = false
 
std::string search_text_
 
std::string replace_text_
 
std::string replace_status_
 
bool replace_status_error_ = false
 
std::string list_filter_
 
std::string command_filter_
 
std::string symbol_filter_
 
std::string dictionary_filter_
 
std::vector< std::string > baseline_messages_
 
std::string reference_view_text_
 
bool show_reference_ = true
 
bool project_source_load_attempted_ = false
 
bool source_sync_ready_ = false
 
bool source_sync_changed_ = false
 
std::string source_sync_sha_before_
 
std::string source_sync_draft_sha_
 
std::string source_loaded_canonical_sha_
 
std::string source_sync_summary_
 
std::string source_sync_status_
 
bool source_sync_status_error_ = false
 
int list_bank_filter_ = 0
 
bool find_panel_open_ = false
 
bool find_focus_search_ = false
 
bool find_has_match_ = false
 
size_t find_match_start_ = 0
 
bool scroll_list_to_selection_ = false
 
int editor_cursor_ = 0
 
int pending_selection_start_ = -1
 
int pending_selection_end_ = -1
 
float editor_pane_height_ = 180.0f
 
uint8_t command_parameter_ = 0
 
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_
 
std::string expanded_message_path_
 
int expanded_message_base_id_ = 0
 
int current_message_index_ = 0
 
bool current_message_is_expanded_ = false
 
DirtyState dirty_state_
 
DirtyState transaction_dirty_snapshot_
 
DirtyState transaction_saved_domains_
 
std::vector< int > transaction_expanded_address_snapshot_
 
bool save_transaction_active_ = false
 
std::optional< MessageSnapshot > pending_undo_before_
 
bool show_message_list_ = false
 
bool show_message_editor_ = false
 
bool show_font_atlas_ = false
 
bool show_dictionary_ = false
 
bool font_graphics_loaded_ = false
 
std::string message_bundle_status_
 
bool message_bundle_status_error_ = false
 
std::vector< std::string > current_parse_errors_
 
std::vector< std::string > current_parse_warnings_
 

Friends

class AuthoringSaveWorkflowTestPeer
 
class MessageEditorTestPeer
 
class MessageEditorSaveTestPeer
 
class MessageEditorPublishGuardTestPeer
 
class MessageEditorListPanelTestPeer
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::Editor
std::string MakePanelTitle (const std::string &base_title) const
 
std::string MakeWindowId (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_
 
UndoManager undo_manager_
 

Detailed Description

Definition at line 46 of file message_editor.h.

Member Enumeration Documentation

◆ SaveDomain

enum class yaze::editor::MessageEditor::SaveDomain
strongprivate
Enumerator
kFontWidths 
kVanillaMessages 
kExpandedMessages 

Definition at line 111 of file message_editor.h.

Constructor & Destructor Documentation

◆ MessageEditor() [1/2]

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

Definition at line 48 of file message_editor.h.

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

◆ MessageEditor() [2/2]

yaze::editor::MessageEditor::MessageEditor ( Rom * rom,
const EditorDependencies & deps )
inlineexplicit

Definition at line 52 of file message_editor.h.

References yaze::editor::Editor::dependencies_.

Member Function Documentation

◆ Initialize()

◆ Load()

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

◆ Update()

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

Implements yaze::editor::Editor.

Definition at line 294 of file message_editor.cc.

References HandleMessageShortcuts().

Here is the call graph for this function:

◆ SetGameData()

void yaze::editor::MessageEditor::SetGameData ( zelda3::GameData * game_data)
overridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 301 of file message_editor.cc.

References ApplyFontPalette(), yaze::editor::Editor::game_data(), and yaze::editor::Editor::SetGameData().

Here is the call graph for this function:

◆ DrawMessageList()

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

Definition at line 1267 of file message_editor.cc.

References yaze::gui::EmptyStateOptions::action_label, yaze::editor::MessageEditor::MessageRow::address, yaze::gui::LayoutHelpers::BeginToolbar(), CollectMessageRows(), yaze::gui::EmptyStateOptions::compact, ContentsForDisplayId(), yaze::gui::CopyToClipboardItem(), current_message_is_expanded_, current_parse_errors_, CurrentDisplayId(), yaze::gui::EmptyStateOptions::detail, yaze::editor::MessageEditor::MessageRow::display_id, yaze::gui::DrawEmptyState(), yaze::gui::LayoutHelpers::EndToolbar(), yaze::editor::MessageEditor::MessageRow::expanded, expanded_messages_, yaze::editor::ExportMessageBundleToJson(), FinalizePendingUndo(), find_panel_open_, yaze::gui::GetErrorColor(), yaze::gui::GetSuccessColor(), yaze::util::HexLong(), yaze::util::HexWord(), yaze::gui::EmptyStateOptions::icon, ICON_MD_ARROW_FORWARD, ICON_MD_CHAT, ICON_MD_DOWNLOAD, ICON_MD_SEARCH, ICON_MD_UPLOAD, ImportMessageBundleFromFile(), yaze::gui::Info, yaze::gui::ItemContextMenu(), list_bank_filter_, list_filter_, list_of_texts_, message_bundle_status_, message_bundle_status_error_, yaze::editor::MessageListPreview(), yaze::gui::EmptyStateOptions::on_action, OpenMessageById(), parsed_messages_, replace_status_, replace_status_error_, scroll_list_to_selection_, yaze::util::FileDialogWrapper::ShowOpenFileDialog(), yaze::util::FileDialogWrapper::ShowSaveFileDialog(), yaze::gui::StatusBadge(), yaze::gui::EmptyStateOptions::title, yaze::gui::LayoutHelpers::ToolbarButton(), and yaze::gui::Warning.

Referenced by Initialize().

◆ DrawCurrentMessage()

◆ DrawFontAtlas()

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

◆ DrawTextCommands()

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

Definition at line 1784 of file message_editor.cc.

References yaze::gui::InputHexByte().

Here is the call graph for this function:

◆ DrawSpecialCharacters()

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

Definition at line 1792 of file message_editor.cc.

◆ DrawExpandedMessageSettings()

◆ DrawDictionary()

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

Definition at line 1796 of file message_editor.cc.

References yaze::editor::kMessageTableFlags.

◆ DrawMessageTools()

void yaze::editor::MessageEditor::DrawMessageTools ( )

Definition at line 1850 of file message_editor.cc.

Referenced by Initialize().

◆ DrawMessagePreview()

◆ UpdateCurrentMessageFromText()

void yaze::editor::MessageEditor::UpdateCurrentMessageFromText ( const std::string & text)

Definition at line 1868 of file message_editor.cc.

References yaze::editor::ParseMessageToDataWithDiagnostics().

Referenced by DrawDialogueTextPane(), InsertTokenAtCursor(), and OptimizeCurrentMessage().

Here is the call graph for this function:

◆ ContributeStatus()

◆ OpenMessageById()

◆ Save()

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

Implements yaze::editor::Editor.

Definition at line 2154 of file message_editor.cc.

◆ BeginSaveTransaction()

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

Reimplemented from yaze::editor::Editor.

Definition at line 2362 of file message_editor.cc.

◆ RollbackSaveTransaction()

void yaze::editor::MessageEditor::RollbackSaveTransaction ( )
overridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 2378 of file message_editor.cc.

◆ CommitSaveTransaction()

void yaze::editor::MessageEditor::CommitSaveTransaction ( )
overridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 2396 of file message_editor.cc.

◆ SaveExpandedMessages()

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

Definition at line 2356 of file message_editor.cc.

◆ LoadExpandedMessagesFromRom()

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

Definition at line 2541 of file message_editor.cc.

References yaze::editor::ParseMessageData(), and yaze::editor::ReadExpandedTextData().

Referenced by OpenMessageById().

Here is the call graph for this function:

◆ LoadCanonicalExpandedSource()

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

Definition at line 2469 of file message_editor.cc.

References yaze::editor::LoadMessageSource().

Referenced by Load().

Here is the call graph for this function:

◆ CalculateExpandedBankUsage()

int yaze::editor::MessageEditor::CalculateExpandedBankUsage ( ) const

Definition at line 2580 of file message_editor.cc.

◆ Cut()

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

Implements yaze::editor::Editor.

Definition at line 2591 of file message_editor.cc.

◆ Copy()

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

Implements yaze::editor::Editor.

Definition at line 2609 of file message_editor.cc.

◆ Paste()

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

Implements yaze::editor::Editor.

Definition at line 2600 of file message_editor.cc.

◆ Undo()

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

Implements yaze::editor::Editor.

Definition at line 2724 of file message_editor.cc.

◆ Redo()

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

Implements yaze::editor::Editor.

Definition at line 2729 of file message_editor.cc.

◆ Find()

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

Implements yaze::editor::Editor.

Definition at line 2752 of file message_editor.cc.

◆ CanUndo()

bool yaze::editor::MessageEditor::CanUndo ( ) const
inlineoverridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 94 of file message_editor.h.

References yaze::editor::UndoManager::CanUndo(), pending_undo_before_, and yaze::editor::Editor::undo_manager_.

Here is the call graph for this function:

◆ CanFind()

bool yaze::editor::MessageEditor::CanFind ( ) const
inlineoverridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 97 of file message_editor.h.

◆ Delete()

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

Definition at line 2733 of file message_editor.cc.

◆ SelectAll()

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

Definition at line 2741 of file message_editor.cc.

◆ set_rom()

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

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

References rom_.

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

◆ BuildSavePlan()

◆ ValidateSavePlan()

absl::Status yaze::editor::MessageEditor::ValidateSavePlan ( const SavePlan & plan) const
private

◆ ApplySavePlan()

◆ SaveDirtyDomains()

absl::Status yaze::editor::MessageEditor::SaveDirtyDomains ( bool include_font_widths,
bool include_vanilla_messages,
bool include_expanded_messages )
private

Definition at line 2344 of file message_editor.cc.

References ASSIGN_OR_RETURN, and RETURN_IF_ERROR.

◆ MarkDomainDirty()

void yaze::editor::MessageEditor::MarkDomainDirty ( SaveDomain domain)
private

Definition at line 2407 of file message_editor.cc.

◆ RecordSavedDomains()

◆ ClearSavedDomains()

◆ SyncCurrentExpandedMessageAddress()

void yaze::editor::MessageEditor::SyncCurrentExpandedMessageAddress ( )
private

Definition at line 2461 of file message_editor.cc.

◆ CollectMessageRows()

std::vector< MessageEditor::MessageRow > yaze::editor::MessageEditor::CollectMessageRows ( bool apply_filter) const
private

◆ CurrentDisplayId()

◆ ContentsForDisplayId()

std::string_view yaze::editor::MessageEditor::ContentsForDisplayId ( int display_id) const
private

Definition at line 406 of file message_editor.cc.

References parsed_messages_.

Referenced by AdvanceFind(), CollectMessageRows(), and DrawMessageList().

◆ DrawFindBar()

◆ DrawMessageHeader()

◆ DrawMessageStructure()

void yaze::editor::MessageEditor::DrawMessageStructure ( )
private

◆ DrawTokenInserter()

void yaze::editor::MessageEditor::DrawTokenInserter ( const std::vector< TextElement > & elements,
std::string & filter,
bool use_parameter )
private

Definition at line 1748 of file message_editor.cc.

References yaze::editor::kMessageTableFlags.

◆ InsertTokenAtCursor()

void yaze::editor::MessageEditor::InsertTokenAtCursor ( const std::string & token)
private

◆ SelectAdjacentMessage()

void yaze::editor::MessageEditor::SelectAdjacentMessage ( int delta)
private

◆ NoteLoadedMessages()

void yaze::editor::MessageEditor::NoteLoadedMessages ( )
private

Definition at line 700 of file message_editor.cc.

References baseline_messages_, and parsed_messages_.

Referenced by Initialize().

◆ AcceptCurrentAsReference()

void yaze::editor::MessageEditor::AcceptCurrentAsReference ( )
private

Definition at line 720 of file message_editor.cc.

References baseline_messages_, current_parse_errors_, CurrentDisplayId(), message_text_box_, reference_view_text_, and yaze::gui::TextBox::text.

Referenced by DrawMessageHeader().

Here is the call graph for this function:

◆ CurrentReferenceText()

std::string yaze::editor::MessageEditor::CurrentReferenceText ( ) const
private

Definition at line 711 of file message_editor.cc.

References baseline_messages_, and CurrentDisplayId().

Referenced by DrawDialogueTextPane(), and DrawMessageHeader().

Here is the call graph for this function:

◆ DrawDialogueTextPane()

void yaze::editor::MessageEditor::DrawDialogueTextPane ( float height)
private

◆ HasMessageSourceLayout()

◆ ExpandedEditsAreSourceOwned()

bool yaze::editor::MessageEditor::ExpandedEditsAreSourceOwned ( ) const
private

Definition at line 799 of file message_editor.cc.

References HasMessageSourceLayout().

Here is the call graph for this function:

◆ ExpandedInspectionRange()

◆ MessageSourceIncomingPath()

std::string yaze::editor::MessageEditor::MessageSourceIncomingPath ( ) const
private

◆ InvalidateSourcePreview()

void yaze::editor::MessageEditor::InvalidateSourcePreview ( )
private

◆ ResolveCanonicalBundlePath()

absl::StatusOr< std::filesystem::path > yaze::editor::MessageEditor::ResolveCanonicalBundlePath ( ) const
private

◆ HashFileSha256()

absl::StatusOr< std::string > yaze::editor::MessageEditor::HashFileSha256 ( const std::filesystem::path & path) const
private

Definition at line 872 of file message_editor.cc.

References yaze::editor::ComputeMessageSourceSha256().

Referenced by PreviewMessageSource(), and PublishMessageSource().

Here is the call graph for this function:

◆ IsCanonicalBundlePath()

bool yaze::editor::MessageEditor::IsCanonicalBundlePath ( const std::string & path) const
private

Definition at line 888 of file message_editor.cc.

References ResolveCanonicalBundlePath().

Here is the call graph for this function:

◆ CaptureExpandedDraft()

MessageEditor::ExpandedDraftSnapshot yaze::editor::MessageEditor::CaptureExpandedDraft ( ) const
private

Definition at line 903 of file message_editor.cc.

References yaze::editor::MessageEditor::ExpandedDraftSnapshot::base_id, dirty_state_, yaze::editor::MessageEditor::ExpandedDraftSnapshot::expanded_dirty, expanded_message_base_id_, expanded_message_path_, yaze::editor::MessageEditor::DirtyState::expanded_messages, expanded_messages_, list_of_texts_, yaze::editor::MessageEditor::ExpandedDraftSnapshot::loaded_canonical_sha, yaze::editor::MessageEditor::ExpandedDraftSnapshot::messages, yaze::editor::MessageEditor::ExpandedDraftSnapshot::parsed_messages, parsed_messages_, yaze::editor::MessageEditor::ExpandedDraftSnapshot::path, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_changed, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_draft_sha, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_ready, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_sha_before, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_status, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_status_error, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_summary, source_loaded_canonical_sha_, source_sync_changed_, source_sync_draft_sha_, source_sync_ready_, source_sync_sha_before_, source_sync_status_, source_sync_status_error_, source_sync_summary_, yaze::editor::MessageEditor::ExpandedDraftSnapshot::vanilla_dirty, yaze::editor::MessageEditor::DirtyState::vanilla_messages, and yaze::editor::MessageEditor::ExpandedDraftSnapshot::vanilla_messages.

◆ RestoreExpandedDraft()

void yaze::editor::MessageEditor::RestoreExpandedDraft ( const ExpandedDraftSnapshot & snapshot)
private

Definition at line 924 of file message_editor.cc.

References yaze::editor::MessageEditor::ExpandedDraftSnapshot::base_id, dirty_state_, yaze::editor::MessageEditor::ExpandedDraftSnapshot::expanded_dirty, expanded_message_base_id_, expanded_message_path_, yaze::editor::MessageEditor::DirtyState::expanded_messages, expanded_messages_, list_of_texts_, yaze::editor::MessageEditor::ExpandedDraftSnapshot::loaded_canonical_sha, yaze::editor::MessageEditor::ExpandedDraftSnapshot::messages, yaze::editor::MessageEditor::ExpandedDraftSnapshot::parsed_messages, parsed_messages_, yaze::editor::MessageEditor::ExpandedDraftSnapshot::path, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_changed, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_draft_sha, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_ready, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_sha_before, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_status, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_status_error, yaze::editor::MessageEditor::ExpandedDraftSnapshot::preview_summary, source_loaded_canonical_sha_, source_sync_changed_, source_sync_draft_sha_, source_sync_ready_, source_sync_sha_before_, source_sync_status_, source_sync_status_error_, source_sync_summary_, yaze::editor::MessageEditor::ExpandedDraftSnapshot::vanilla_dirty, yaze::editor::MessageEditor::DirtyState::vanilla_messages, and yaze::editor::MessageEditor::ExpandedDraftSnapshot::vanilla_messages.

◆ LoadExpandedMessagesFromBin()

absl::Status yaze::editor::MessageEditor::LoadExpandedMessagesFromBin ( const std::string & path)
private

Definition at line 2509 of file message_editor.cc.

References yaze::editor::LoadExpandedMessages().

Here is the call graph for this function:

◆ PreviewMessageSource()

◆ PublishMessageSource()

◆ DrawMessageSourcePublishButtons()

◆ DrawMessageSourceSync()

◆ AdvanceFind()

◆ ActivateFindMatch()

◆ OptimizeCurrentMessage()

◆ HandleMessageShortcuts()

void yaze::editor::MessageEditor::HandleMessageShortcuts ( )
private

Definition at line 349 of file message_editor.cc.

References AdvanceFind(), find_focus_search_, find_panel_open_, and SelectAdjacentMessage().

Referenced by Update().

Here is the call graph for this function:

◆ ReplaceCurrentMatch()

int yaze::editor::MessageEditor::ReplaceCurrentMatch ( )
private

Definition at line 2764 of file message_editor.cc.

References yaze::editor::FindNextTextMatch().

Referenced by DrawFindBar().

Here is the call graph for this function:

◆ ReplaceAllMatches()

int yaze::editor::MessageEditor::ReplaceAllMatches ( )
private

Definition at line 2795 of file message_editor.cc.

References yaze::editor::ParseMessageToDataWithDiagnostics().

Referenced by DrawFindBar().

Here is the call graph for this function:

◆ PushUndoSnapshot()

void yaze::editor::MessageEditor::PushUndoSnapshot ( )
private

Definition at line 2618 of file message_editor.cc.

◆ FinalizePendingUndo()

void yaze::editor::MessageEditor::FinalizePendingUndo ( )
private

◆ ApplySnapshot()

◆ ResolveFontPalette()

void yaze::editor::MessageEditor::ResolveFontPalette ( )
private

◆ BuildFallbackFontPalette()

gfx::SnesPalette yaze::editor::MessageEditor::BuildFallbackFontPalette ( ) const
private

Definition at line 25 of file message_editor_font.cc.

Referenced by ResolveFontPalette().

◆ LoadFontGraphics()

◆ RefreshFontAtlasBitmap()

◆ ApplyFontPalette()

◆ EnsureFontTexturesReady()

◆ ImportMessageBundleFromFile()

void yaze::editor::MessageEditor::ImportMessageBundleFromFile ( const std::string & path)
private

◆ ResolveExpandedMessageBaseId()

int yaze::editor::MessageEditor::ResolveExpandedMessageBaseId ( ) const
private

Friends And Related Symbol Documentation

◆ AuthoringSaveWorkflowTestPeer

friend class AuthoringSaveWorkflowTestPeer
friend

Definition at line 105 of file message_editor.h.

◆ MessageEditorTestPeer

friend class MessageEditorTestPeer
friend

Definition at line 106 of file message_editor.h.

◆ MessageEditorSaveTestPeer

friend class MessageEditorSaveTestPeer
friend

Definition at line 107 of file message_editor.h.

◆ MessageEditorPublishGuardTestPeer

friend class MessageEditorPublishGuardTestPeer
friend

Definition at line 108 of file message_editor.h.

◆ MessageEditorListPanelTestPeer

friend class MessageEditorListPanelTestPeer
friend

Definition at line 109 of file message_editor.h.

Member Data Documentation

◆ case_sensitive_

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

Definition at line 152 of file message_editor.h.

Referenced by AdvanceFind(), and DrawFindBar().

◆ match_whole_word_

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

Definition at line 153 of file message_editor.h.

Referenced by AdvanceFind(), and DrawFindBar().

◆ search_text_

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

Definition at line 154 of file message_editor.h.

Referenced by ActivateFindMatch(), AdvanceFind(), and DrawFindBar().

◆ replace_text_

std::string yaze::editor::MessageEditor::replace_text_
private

Definition at line 155 of file message_editor.h.

Referenced by DrawFindBar().

◆ replace_status_

std::string yaze::editor::MessageEditor::replace_status_
private

◆ replace_status_error_

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

◆ list_filter_

std::string yaze::editor::MessageEditor::list_filter_
private

◆ command_filter_

std::string yaze::editor::MessageEditor::command_filter_
private

Definition at line 159 of file message_editor.h.

◆ symbol_filter_

std::string yaze::editor::MessageEditor::symbol_filter_
private

Definition at line 160 of file message_editor.h.

◆ dictionary_filter_

std::string yaze::editor::MessageEditor::dictionary_filter_
private

Definition at line 161 of file message_editor.h.

◆ baseline_messages_

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

◆ reference_view_text_

std::string yaze::editor::MessageEditor::reference_view_text_
private

Definition at line 163 of file message_editor.h.

Referenced by AcceptCurrentAsReference(), and DrawDialogueTextPane().

◆ show_reference_

bool yaze::editor::MessageEditor::show_reference_ = true
private

Definition at line 164 of file message_editor.h.

Referenced by DrawDialogueTextPane(), and DrawMessageHeader().

◆ project_source_load_attempted_

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

Definition at line 165 of file message_editor.h.

Referenced by Initialize(), and Load().

◆ source_sync_ready_

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

◆ source_sync_changed_

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

◆ source_sync_sha_before_

std::string yaze::editor::MessageEditor::source_sync_sha_before_
private

◆ source_sync_draft_sha_

std::string yaze::editor::MessageEditor::source_sync_draft_sha_
private

◆ source_loaded_canonical_sha_

std::string yaze::editor::MessageEditor::source_loaded_canonical_sha_
private

◆ source_sync_summary_

std::string yaze::editor::MessageEditor::source_sync_summary_
private

◆ source_sync_status_

std::string yaze::editor::MessageEditor::source_sync_status_
private

◆ source_sync_status_error_

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

◆ list_bank_filter_

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

◆ find_panel_open_

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

◆ find_focus_search_

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

Definition at line 176 of file message_editor.h.

Referenced by DrawFindBar(), DrawMessageHeader(), and HandleMessageShortcuts().

◆ find_has_match_

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

Definition at line 177 of file message_editor.h.

Referenced by ActivateFindMatch(), AdvanceFind(), DrawFindBar(), and OpenMessageById().

◆ find_match_start_

size_t yaze::editor::MessageEditor::find_match_start_ = 0
private

Definition at line 178 of file message_editor.h.

Referenced by ActivateFindMatch(), and AdvanceFind().

◆ scroll_list_to_selection_

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

Definition at line 179 of file message_editor.h.

Referenced by ActivateFindMatch(), DrawFindBar(), DrawMessageList(), and OpenMessageById().

◆ editor_cursor_

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

◆ pending_selection_start_

int yaze::editor::MessageEditor::pending_selection_start_ = -1
private

◆ pending_selection_end_

int yaze::editor::MessageEditor::pending_selection_end_ = -1
private

◆ editor_pane_height_

float yaze::editor::MessageEditor::editor_pane_height_ = 180.0f
private

Definition at line 183 of file message_editor.h.

◆ command_parameter_

uint8_t yaze::editor::MessageEditor::command_parameter_ = 0
private

Definition at line 184 of file message_editor.h.

◆ raw_font_gfx_data_

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

Definition at line 252 of file message_editor.h.

Referenced by LoadFontGraphics().

◆ parsed_messages_

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

◆ list_of_texts_

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

◆ expanded_messages_

◆ 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

◆ current_font_gfx16_bitmap_

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

Definition at line 261 of file message_editor.h.

Referenced by ApplyFontPalette(), EnsureFontTexturesReady(), and Initialize().

◆ font_preview_colors_

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

◆ font_gfx_canvas_

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

Definition at line 264 of file message_editor.h.

◆ current_font_gfx16_canvas_

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

Definition at line 265 of file message_editor.h.

◆ message_text_box_

◆ rom_

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

Definition at line 268 of file message_editor.h.

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

◆ expanded_message_bin_

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

Definition at line 269 of file message_editor.h.

◆ expanded_message_path_

std::string yaze::editor::MessageEditor::expanded_message_path_
private

Definition at line 270 of file message_editor.h.

Referenced by CaptureExpandedDraft(), and RestoreExpandedDraft().

◆ expanded_message_base_id_

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

◆ current_message_index_

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

Definition at line 272 of file message_editor.h.

Referenced by CurrentDisplayId(), Initialize(), and OpenMessageById().

◆ current_message_is_expanded_

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

◆ dirty_state_

DirtyState yaze::editor::MessageEditor::dirty_state_
private

◆ transaction_dirty_snapshot_

DirtyState yaze::editor::MessageEditor::transaction_dirty_snapshot_
private

Definition at line 275 of file message_editor.h.

Referenced by Initialize().

◆ transaction_saved_domains_

DirtyState yaze::editor::MessageEditor::transaction_saved_domains_
private

Definition at line 276 of file message_editor.h.

Referenced by Initialize().

◆ transaction_expanded_address_snapshot_

std::vector<int> yaze::editor::MessageEditor::transaction_expanded_address_snapshot_
private

Definition at line 277 of file message_editor.h.

Referenced by Initialize().

◆ save_transaction_active_

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

Definition at line 278 of file message_editor.h.

Referenced by Initialize().

◆ pending_undo_before_

std::optional<MessageSnapshot> yaze::editor::MessageEditor::pending_undo_before_
private

Definition at line 281 of file message_editor.h.

Referenced by CanUndo().

◆ show_message_list_

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

Definition at line 287 of file message_editor.h.

◆ show_message_editor_

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

Definition at line 288 of file message_editor.h.

◆ show_font_atlas_

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

Definition at line 289 of file message_editor.h.

◆ show_dictionary_

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

Definition at line 290 of file message_editor.h.

◆ font_graphics_loaded_

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

Definition at line 301 of file message_editor.h.

Referenced by EnsureFontTexturesReady(), Initialize(), and LoadFontGraphics().

◆ message_bundle_status_

std::string yaze::editor::MessageEditor::message_bundle_status_
private

Definition at line 302 of file message_editor.h.

Referenced by DrawMessageList(), and Load().

◆ message_bundle_status_error_

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

Definition at line 303 of file message_editor.h.

Referenced by DrawMessageList(), and Load().

◆ current_parse_errors_

◆ current_parse_warnings_

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

Definition at line 305 of file message_editor.h.

Referenced by Initialize(), and OpenMessageById().


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