1#ifndef YAZE_APP_EDITOR_MESSAGE_EDITOR_H
2#define YAZE_APP_EDITOR_MESSAGE_EDITOR_H
13#include "absl/status/status.h"
14#include "absl/status/statusor.h"
29class AuthoringSaveWorkflowTestPeer;
30class MessageEditorTestPeer;
31class MessageEditorSaveTestPeer;
32class MessageEditorPublishGuardTestPeer;
33class MessageEditorListPanelTestPeer;
58 absl::Status
Load()
override;
59 absl::Status
Update()
override;
78 absl::Status
Save()
override;
87 absl::Status
Cut()
override;
88 absl::Status
Copy()
override;
89 absl::Status
Paste()
override;
90 absl::Status
Undo()
override;
91 absl::Status
Redo()
override;
92 absl::Status
Find()
override;
97 bool CanFind()
const override {
return true; }
122 uint32_t
end()
const {
return start +
static_cast<uint32_t
>(
bytes.size()); }
139 absl::StatusOr<SavePlan>
BuildSavePlan(
bool include_font_widths,
140 bool include_vanilla_messages,
141 bool include_expanded_messages)
const;
145 bool include_vanilla_messages,
146 bool include_expanded_messages);
199 std::string& filter,
bool use_parameter);
213 const std::filesystem::path& path)
const;
266 ImVec2(172 * 2, 4096)};
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Interface for editor classes.
UndoManager undo_manager_
zelda3::GameData * game_data() const
EditorDependencies dependencies_
void DrawMessageSourceSync()
DirtyState transaction_dirty_snapshot_
MessageSourcePublishButtons DrawMessageSourcePublishButtons()
std::vector< std::string > baseline_messages_
bool source_sync_changed_
void RestoreExpandedDraft(const ExpandedDraftSnapshot &snapshot)
std::vector< std::string > parsed_messages_
absl::Status Copy() override
std::string reference_view_text_
bool current_message_is_expanded_
bool replace_status_error_
std::string source_loaded_canonical_sha_
void CommitSaveTransaction() override
std::vector< MessageData > expanded_messages_
int CalculateExpandedBankUsage() const
void DrawMessageStructure()
void ContributeStatus(StatusBar *status_bar) override
absl::Status Find() override
void ResolveFontPalette()
uint8_t command_parameter_
void DrawTokenInserter(const std::vector< TextElement > &elements, std::string &filter, bool use_parameter)
void EnsureFontTexturesReady()
absl::Status SaveExpandedMessages()
DirtyState transaction_saved_domains_
bool scroll_list_to_selection_
void RollbackSaveTransaction() override
int pending_selection_start_
bool font_graphics_loaded_
bool ExpandedEditsAreSourceOwned() const
absl::Status Update() override
void ClearSavedDomains(const DirtyState &saved)
bool IsCanonicalBundlePath(const std::string &path) const
void FinalizePendingUndo()
absl::Status LoadExpandedMessagesFromRom()
friend class MessageEditorTestPeer
void RecordSavedDomains(const SavePlan &plan)
void DrawDialogueTextPane(float height)
void DrawExpandedMessageSettings()
int pending_selection_end_
void UpdateCurrentMessageFromText(const std::string &text)
absl::Status Paste() override
void ApplySnapshot(const MessageSnapshot &snapshot)
bool save_transaction_active_
absl::StatusOr< SavePlan > BuildSavePlan(bool include_font_widths, bool include_vanilla_messages, bool include_expanded_messages) const
std::vector< int > transaction_expanded_address_snapshot_
void SyncCurrentExpandedMessageAddress()
std::string dictionary_filter_
bool AdvanceFind(bool forward)
ExpandedDraftSnapshot CaptureExpandedDraft() const
std::string command_filter_
void MarkDomainDirty(SaveDomain domain)
void OptimizeCurrentMessage()
gui::Canvas current_font_gfx16_canvas_
gui::Canvas font_gfx_canvas_
std::string source_sync_draft_sha_
void RefreshFontAtlasBitmap(const std::vector< uint8_t > &font_data)
bool HasMessageSourceLayout() const
absl::StatusOr< std::filesystem::path > ResolveCanonicalBundlePath() const
std::vector< std::string > current_parse_errors_
absl::Status Undo() override
absl::Status Load() override
std::string MessageSourceIncomingPath() const
std::string replace_status_
absl::Status LoadExpandedMessagesFromBin(const std::string &path)
bool show_message_editor_
absl::StatusOr< std::string > HashFileSha256(const std::filesystem::path &path) const
friend class MessageEditorSaveTestPeer
void HandleMessageShortcuts()
float editor_pane_height_
std::vector< std::string > current_parse_warnings_
std::string message_bundle_status_
std::array< uint8_t, 0x4000 > raw_font_gfx_data_
gfx::SnesPalette BuildFallbackFontPalette() const
std::pair< int, int > ExpandedInspectionRange() const
bool CanUndo() const override
void Initialize() override
std::string replace_text_
void NoteLoadedMessages()
bool CanFind() const override
friend class MessageEditorPublishGuardTestPeer
MessageEditor(Rom *rom=nullptr)
absl::Status SaveDirtyDomains(bool include_font_widths, bool include_vanilla_messages, bool include_expanded_messages)
absl::Status Cut() override
absl::Status LoadCanonicalExpandedSource()
void InsertTokenAtCursor(const std::string &token)
int CurrentDisplayId() const
void DrawMessagePreview()
std::string source_sync_summary_
std::vector< MessageRow > CollectMessageRows(bool apply_filter) const
Rom expanded_message_bin_
MessageEditor(Rom *rom, const EditorDependencies &deps)
bool ActivateFindMatch(const MessageRow &row, size_t offset, bool wrapped)
int expanded_message_base_id_
void PublishMessageSource()
bool message_bundle_status_error_
std::optional< MessageSnapshot > pending_undo_before_
absl::Status BeginSaveTransaction() override
std::string_view ContentsForDisplayId(int display_id) const
void InvalidateSourcePreview()
std::vector< MessageData > list_of_texts_
std::string CurrentReferenceText() const
friend class AuthoringSaveWorkflowTestPeer
friend class MessageEditorListPanelTestPeer
std::string source_sync_status_
bool OpenMessageById(int display_id)
gfx::SnesPalette font_preview_colors_
MessageData current_message_
void AcceptCurrentAsReference()
std::string symbol_filter_
MessagePreview message_preview_
std::string source_sync_sha_before_
gui::TextBox message_text_box_
void DrawCurrentMessage()
void DrawSpecialCharacters()
absl::Status Redo() override
bool project_source_load_attempted_
void SelectAdjacentMessage(int delta)
bool source_sync_status_error_
int ResolveExpandedMessageBaseId() const
void ImportMessageBundleFromFile(const std::string &path)
gfx::Bitmap current_font_gfx16_bitmap_
absl::Status ValidateSavePlan(const SavePlan &plan) const
int ReplaceCurrentMatch()
void PreviewMessageSource()
int current_message_index_
absl::Status ApplySavePlan(const SavePlan &plan)
gfx::Bitmap font_gfx_bitmap_
std::string expanded_message_path_
absl::Status Save() override
void SetGameData(zelda3::GameData *game_data) override
A session-aware status bar displayed at the bottom of the application.
Represents a bitmap image optimized for SNES ROM hacking.
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
Modern, robust canvas for drawing and manipulating graphics.
constexpr int kCharactersWidth
constexpr int kFontGfx16Size
constexpr uint8_t kBlockTerminator
constexpr int kFontGfxMessageSize
constexpr int kFontGfxMessageDepth
constexpr uint8_t kMessageBankChangeId
constexpr int kNumMessages
Unified dependency container for all editor types.
std::string loaded_canonical_sha
std::vector< MessageData > messages
std::vector< std::string > parsed_messages
std::string preview_summary
bool preview_status_error
std::string preview_draft_sha
std::string preview_status
std::vector< MessageData > vanilla_messages
std::string preview_sha_before
std::vector< uint8_t > bytes
std::vector< int > expanded_message_addresses
bool saves_vanilla_messages
bool saves_expanded_messages
std::vector< PlannedWrite > writes