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

Text editor for modifying assembly code. More...

#include <assembly_editor.h>

Inheritance diagram for yaze::editor::AssemblyEditor:

Public Member Functions

 AssemblyEditor (Rom *rom=nullptr)
 
void ChangeActiveFile (const std::string_view &filename)
 
void Initialize () override
 
absl::Status Load () override
 
void Update (bool &is_loaded)
 
void InlineUpdate ()
 
void UpdateCodeView ()
 
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 Update () override
 
absl::Status Save () override
 
void OpenFolder (const std::string &folder_path)
 
absl::Status ValidateCurrentFile ()
 
absl::Status ApplyPatchToRom ()
 
void UpdateErrorMarkers (const core::AsarPatchResult &result)
 
void ClearErrorMarkers ()
 
void SetRom (Rom *rom)
 
Romrom () const
 
bool is_asar_initialized () const
 
const std::map< std::string, core::AsarSymbol > & symbols () const
 
core::AsarWrapperasar_wrapper ()
 
- Public Member Functions inherited from yaze::editor::Editor
 Editor ()=default
 
virtual ~Editor ()=default
 
void SetDependencies (const EditorDependencies &deps)
 
virtual void SetGameData (zelda3::GameData *game_data)
 
virtual absl::Status Clear ()
 
EditorType type () const
 
bool * active ()
 
void set_active (bool active)
 
void toggle_active ()
 
virtual bool IsRomLoaded () const
 
virtual std::string GetRomStatus () const
 
Romrom () const
 
zelda3::GameDatagame_data () const
 
EditorContext context () const
 
bool HasContext () const
 

Private Member Functions

void DrawCodeEditor ()
 
void DrawFileBrowser ()
 
void DrawSymbolsContent ()
 
void DrawBuildOutput ()
 
void DrawToolbarContent ()
 
void DrawFileMenu ()
 
void DrawEditMenu ()
 
void DrawAssembleMenu ()
 
void DrawCurrentFolder ()
 
void DrawFileTabView ()
 
void DrawToolset ()
 
void DrawSymbolPanel ()
 

Private Attributes

bool file_is_loaded_ = false
 
int current_file_id_ = 0
 
int active_file_id_ = -1
 
std::vector< std::string > files_
 
std::vector< TextEditoropen_files_
 
ImVector< int > active_files_
 
std::string current_file_
 
FolderItem current_folder_
 
TextEditor text_editor_
 
Romrom_
 
core::AsarWrapper asar_
 
bool asar_initialized_ = false
 
bool show_symbol_panel_ = false
 
std::map< std::string, core::AsarSymbolsymbols_
 
std::vector< std::string > last_errors_
 
std::vector< std::string > last_warnings_
 

Additional Inherited Members

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

Detailed Description

Text editor for modifying assembly code.

Definition at line 29 of file assembly_editor.h.

Constructor & Destructor Documentation

◆ AssemblyEditor()

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

Member Function Documentation

◆ ChangeActiveFile()

void yaze::editor::AssemblyEditor::ChangeActiveFile ( const std::string_view & filename)

◆ Initialize()

◆ Load()

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

Implements yaze::editor::Editor.

Definition at line 210 of file assembly_editor.cc.

◆ Update() [1/2]

void yaze::editor::AssemblyEditor::Update ( bool & is_loaded)

Definition at line 463 of file assembly_editor.cc.

References DrawCodeEditor(), and DrawSymbolPanel().

Here is the call graph for this function:

◆ InlineUpdate()

◆ UpdateCodeView()

void yaze::editor::AssemblyEditor::UpdateCodeView ( )

Definition at line 486 of file assembly_editor.cc.

References DrawFileBrowser(), and DrawToolbarContent().

Here is the call graph for this function:

◆ Cut()

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

Implements yaze::editor::Editor.

Definition at line 642 of file assembly_editor.cc.

References TextEditor::Cut(), and text_editor_.

Here is the call graph for this function:

◆ Copy()

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

Implements yaze::editor::Editor.

Definition at line 647 of file assembly_editor.cc.

References TextEditor::Copy(), and text_editor_.

Here is the call graph for this function:

◆ Paste()

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

Implements yaze::editor::Editor.

Definition at line 652 of file assembly_editor.cc.

References TextEditor::Paste(), and text_editor_.

Here is the call graph for this function:

◆ Undo()

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

Implements yaze::editor::Editor.

Definition at line 657 of file assembly_editor.cc.

References text_editor_, and TextEditor::Undo().

Here is the call graph for this function:

◆ Redo()

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

Implements yaze::editor::Editor.

Definition at line 662 of file assembly_editor.cc.

References TextEditor::Redo(), and text_editor_.

Here is the call graph for this function:

◆ Find()

absl::Status yaze::editor::AssemblyEditor::Find ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 51 of file assembly_editor.h.

◆ Update() [2/2]

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

Implements yaze::editor::Editor.

Definition at line 667 of file assembly_editor.cc.

◆ Save()

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

Implements yaze::editor::Editor.

Definition at line 494 of file assembly_editor.cc.

References active_file_id_, files_, open_files_, and yaze::util::SaveFile().

Referenced by DrawToolbarContent(), and DrawToolset().

Here is the call graph for this function:

◆ OpenFolder()

void yaze::editor::AssemblyEditor::OpenFolder ( const std::string & folder_path)

Definition at line 215 of file assembly_editor.cc.

References current_folder_.

Referenced by DrawCurrentFolder(), and DrawFileBrowser().

◆ ValidateCurrentFile()

absl::Status yaze::editor::AssemblyEditor::ValidateCurrentFile ( )

◆ ApplyPatchToRom()

◆ UpdateErrorMarkers()

void yaze::editor::AssemblyEditor::UpdateErrorMarkers ( const core::AsarPatchResult & result)

◆ ClearErrorMarkers()

void yaze::editor::AssemblyEditor::ClearErrorMarkers ( )

Definition at line 815 of file assembly_editor.cc.

References active_file_id_, last_errors_, and open_files_.

Referenced by ApplyPatchToRom(), and ValidateCurrentFile().

◆ SetRom()

void yaze::editor::AssemblyEditor::SetRom ( Rom * rom)
inline

Definition at line 65 of file assembly_editor.h.

References rom(), and rom_.

Here is the call graph for this function:

◆ rom()

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

Definition at line 66 of file assembly_editor.h.

References rom_.

Referenced by SetRom().

◆ is_asar_initialized()

bool yaze::editor::AssemblyEditor::is_asar_initialized ( ) const
inline

Definition at line 69 of file assembly_editor.h.

References asar_initialized_.

◆ symbols()

const std::map< std::string, core::AsarSymbol > & yaze::editor::AssemblyEditor::symbols ( ) const
inline

Definition at line 70 of file assembly_editor.h.

References symbols_.

◆ asar_wrapper()

core::AsarWrapper * yaze::editor::AssemblyEditor::asar_wrapper ( )
inline

Definition at line 73 of file assembly_editor.h.

References asar_.

◆ DrawCodeEditor()

◆ DrawFileBrowser()

◆ DrawSymbolsContent()

void yaze::editor::AssemblyEditor::DrawSymbolsContent ( )
private

Definition at line 276 of file assembly_editor.cc.

References ICON_MD_SEARCH, and symbols_.

Referenced by Initialize().

◆ DrawBuildOutput()

◆ DrawToolbarContent()

◆ DrawFileMenu()

void yaze::editor::AssemblyEditor::DrawFileMenu ( )
private
Todo
Implement this

Definition at line 571 of file assembly_editor.cc.

References ChangeActiveFile(), ICON_MD_FILE_OPEN, ICON_MD_SAVE, and yaze::util::FileDialogWrapper::ShowOpenFileDialog().

Referenced by DrawCodeEditor().

Here is the call graph for this function:

◆ DrawEditMenu()

void yaze::editor::AssemblyEditor::DrawEditMenu ( )
private

◆ DrawAssembleMenu()

◆ DrawCurrentFolder()

◆ DrawFileTabView()

void yaze::editor::AssemblyEditor::DrawFileTabView ( )
private

Definition at line 411 of file assembly_editor.cc.

References active_file_id_, active_files_, files_, open_files_, and text_editor_.

Referenced by DrawCodeEditor().

◆ DrawToolset()

◆ DrawSymbolPanel()

void yaze::editor::AssemblyEditor::DrawSymbolPanel ( )
private

Definition at line 926 of file assembly_editor.cc.

References show_symbol_panel_, and symbols_.

Referenced by Update().

Member Data Documentation

◆ file_is_loaded_

bool yaze::editor::AssemblyEditor::file_is_loaded_ = false
private

Definition at line 94 of file assembly_editor.h.

◆ current_file_id_

int yaze::editor::AssemblyEditor::current_file_id_ = 0
private

Definition at line 95 of file assembly_editor.h.

◆ active_file_id_

int yaze::editor::AssemblyEditor::active_file_id_ = -1
private

◆ files_

std::vector<std::string> yaze::editor::AssemblyEditor::files_
private

◆ open_files_

◆ active_files_

ImVector<int> yaze::editor::AssemblyEditor::active_files_
private

Definition at line 100 of file assembly_editor.h.

Referenced by ChangeActiveFile(), and DrawFileTabView().

◆ current_file_

std::string yaze::editor::AssemblyEditor::current_file_
private

Definition at line 102 of file assembly_editor.h.

Referenced by DrawCodeEditor(), and InlineUpdate().

◆ current_folder_

FolderItem yaze::editor::AssemblyEditor::current_folder_
private

◆ text_editor_

TextEditor yaze::editor::AssemblyEditor::text_editor_
private

◆ rom_

Rom* yaze::editor::AssemblyEditor::rom_
private

◆ asar_

core::AsarWrapper yaze::editor::AssemblyEditor::asar_
private

◆ asar_initialized_

bool yaze::editor::AssemblyEditor::asar_initialized_ = false
private

Definition at line 110 of file assembly_editor.h.

Referenced by ApplyPatchToRom(), is_asar_initialized(), and ValidateCurrentFile().

◆ show_symbol_panel_

bool yaze::editor::AssemblyEditor::show_symbol_panel_ = false
private

Definition at line 111 of file assembly_editor.h.

Referenced by DrawAssembleMenu(), and DrawSymbolPanel().

◆ symbols_

std::map<std::string, core::AsarSymbol> yaze::editor::AssemblyEditor::symbols_
private

◆ last_errors_

std::vector<std::string> yaze::editor::AssemblyEditor::last_errors_
private

◆ last_warnings_

std::vector<std::string> yaze::editor::AssemblyEditor::last_warnings_
private

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