yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
project_file_editor.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_CODE_PROJECT_FILE_EDITOR_H_
2#define YAZE_APP_EDITOR_CODE_PROJECT_FILE_EDITOR_H_
3
4#include <string>
5
6#include "absl/status/status.h"
8#include "core/project.h"
9
10namespace yaze {
11namespace editor {
12
13class ToastManager;
14
26 public:
28
29 void Draw();
30
34 absl::Status LoadFile(const std::string& filepath);
35
39 absl::Status SaveFile();
40
44 absl::Status SaveFileAs(const std::string& filepath);
45
49 bool IsModified() const { return text_editor_.IsTextChanged() || modified_; }
50
54 const std::string& filepath() const { return filepath_; }
55
59 void set_active(bool active) { active_ = active; }
60
64 bool* active() { return &active_; }
65
69 void SetToastManager(ToastManager* toast_manager) {
70 toast_manager_ = toast_manager;
71 }
72
76 void NewFile();
77
81 void SetProject(project::YazeProject* project) { project_ = project; }
82
83 private:
87 absl::Status ImportLabelsFromZScream();
88
90 void ValidateContent();
92
94 std::string filepath_;
95 bool active_ = false;
96 bool modified_ = false;
97 bool show_validation_ = true;
98 std::vector<std::string> validation_errors_;
101};
102
103} // namespace editor
104} // namespace yaze
105
106#endif // YAZE_APP_EDITOR_CODE_PROJECT_FILE_EDITOR_H_
bool IsTextChanged() const
Editor for .yaze project files with syntax highlighting and validation.
bool * active()
Get pointer to active state for ImGui.
absl::Status SaveFileAs(const std::string &filepath)
Save to a new file path.
absl::Status LoadFile(const std::string &filepath)
Load a project file into the editor.
void SetProject(project::YazeProject *project)
Set the project pointer for label import operations.
void NewFile()
Create a new empty project file.
bool IsModified() const
Get whether the file has unsaved changes.
void set_active(bool active)
Set whether the editor window is active.
std::vector< std::string > validation_errors_
absl::Status SaveFile()
Save the current editor contents to disk.
absl::Status ImportLabelsFromZScream()
Import labels from a ZScream DefaultNames.txt file.
void SetToastManager(ToastManager *toast_manager)
Set toast manager for notifications.
const std::string & filepath() const
Get the current filepath.
Modern project structure with comprehensive settings consolidation.
Definition project.h:84