initialize labels file in project
This commit is contained in:
@@ -21,10 +21,7 @@ namespace core {
|
|||||||
static constexpr absl::string_view kDefaultTypes[] = {
|
static constexpr absl::string_view kDefaultTypes[] = {
|
||||||
"Dungeon Names", "Dungeon Room Names", "Overworld Map Names"};
|
"Dungeon Names", "Dungeon Room Names", "Overworld Map Names"};
|
||||||
|
|
||||||
class ResourceLabelManager {
|
struct ResourceLabelManager {
|
||||||
public:
|
|
||||||
ResourceLabelManager() = default;
|
|
||||||
|
|
||||||
bool LoadLabels(const std::string& filename);
|
bool LoadLabels(const std::string& filename);
|
||||||
bool SaveLabels();
|
bool SaveLabels();
|
||||||
void DisplayLabels(bool* p_open);
|
void DisplayLabels(bool* p_open);
|
||||||
@@ -38,7 +35,6 @@ class ResourceLabelManager {
|
|||||||
std::string CreateOrGetLabel(const std::string& type, const std::string& key,
|
std::string CreateOrGetLabel(const std::string& type, const std::string& key,
|
||||||
const absl::string_view& defaultValue);
|
const absl::string_view& defaultValue);
|
||||||
|
|
||||||
private:
|
|
||||||
bool labels_loaded_ = false;
|
bool labels_loaded_ = false;
|
||||||
std::string filename_;
|
std::string filename_;
|
||||||
struct ResourceType {
|
struct ResourceType {
|
||||||
|
|||||||
@@ -717,6 +717,9 @@ void MasterEditor::DrawViewMenu() {
|
|||||||
|
|
||||||
if (show_resource_label_manager) {
|
if (show_resource_label_manager) {
|
||||||
rom()->resource_label()->DisplayLabels(&show_resource_label_manager);
|
rom()->resource_label()->DisplayLabels(&show_resource_label_manager);
|
||||||
|
if (current_project_.project_opened_) {
|
||||||
|
current_project_.labels_filename_ = rom()->resource_label()->filename_;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BeginMenu("View")) {
|
if (BeginMenu("View")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user