refactor: Update Doxyfile and resource paths for improved organization
- Changed the paths for project logo and icon in Doxyfile to point to the new assets directory. - Updated CMake configurations to reflect the new locations of resource files, enhancing clarity and maintainability. - Replaced instances of core utility functions with util functions across various files for consistency in file handling. - Added new resource files for Windows platform support and removed obsolete resource files, streamlining the build process.
This commit is contained in:
4
Doxyfile
4
Doxyfile
@@ -61,13 +61,13 @@ PROJECT_BRIEF = Link to the Past ROM Editor
|
||||
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
|
||||
# the logo to the output directory.
|
||||
|
||||
PROJECT_LOGO = "src/win32/yaze.ico"
|
||||
PROJECT_LOGO = "assets/yaze.ico"
|
||||
|
||||
# With the PROJECT_ICON tag one can specify an icon that is included in the tabs
|
||||
# when the HTML document is shown. Doxygen will copy the logo to the output
|
||||
# directory.
|
||||
|
||||
PROJECT_ICON = "src/win32/yaze.ico"
|
||||
PROJECT_ICON = "assets/yaze.ico"
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
||||
# into which the generated documentation will be written. If a relative path is
|
||||
|
||||
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
@@ -456,8 +456,8 @@ else()
|
||||
# Only use resource file for x64 Windows builds
|
||||
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# Generate yaze.res from yaze.rc and yaze.ico for Windows x64 builds
|
||||
set(YAZE_RC_FILE "${CMAKE_CURRENT_SOURCE_DIR}/win32/yaze.rc")
|
||||
set(YAZE_ICO_FILE "${CMAKE_CURRENT_SOURCE_DIR}/win32/yaze.ico")
|
||||
set(YAZE_RC_FILE "${CMAKE_CURRENT_SOURCE_DIR}/app/platform/win32/yaze.rc")
|
||||
set(YAZE_ICO_FILE "${CMAKE_SOURCE_DIR}/assets/yaze.ico")
|
||||
set(YAZE_RES_FILE "${CMAKE_CURRENT_BINARY_DIR}/yaze.res")
|
||||
|
||||
# Add a custom command to generate the .res file from the .rc and .ico
|
||||
@@ -1076,9 +1076,7 @@ source_group("API\\Python" FILES
|
||||
|
||||
# Platform-specific Resources
|
||||
source_group("Platform\\Windows" FILES
|
||||
win32/yaze.ico
|
||||
win32/yaze.rc
|
||||
win32/yaze.res
|
||||
app/platform/win32/yaze.rc
|
||||
)
|
||||
|
||||
source_group("Platform\\iOS" FILES
|
||||
|
||||
@@ -1649,7 +1649,7 @@ void AgentChatWidget::RenderSystemPromptEditor() {
|
||||
// Toolbar
|
||||
if (ImGui::Button(ICON_MD_FOLDER_OPEN " Load V1")) {
|
||||
// Load embedded system_prompt.txt (v1)
|
||||
std::string prompt_v1 = core::LoadFile("assets/agent/system_prompt.txt");
|
||||
std::string prompt_v1 = util::LoadFile("assets/agent/system_prompt.txt");
|
||||
if (!prompt_v1.empty()) {
|
||||
// Find or create system prompt tab
|
||||
bool found = false;
|
||||
@@ -1685,7 +1685,7 @@ void AgentChatWidget::RenderSystemPromptEditor() {
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_MD_FOLDER_OPEN " Load V2")) {
|
||||
// Load embedded system_prompt_v2.txt
|
||||
std::string prompt_v2 = core::LoadFile("assets/agent/system_prompt_v2.txt");
|
||||
std::string prompt_v2 = util::LoadFile("assets/agent/system_prompt_v2.txt");
|
||||
if (!prompt_v2.empty()) {
|
||||
// Find or create system prompt tab
|
||||
bool found = false;
|
||||
@@ -1730,7 +1730,7 @@ void AgentChatWidget::RenderSystemPromptEditor() {
|
||||
if (file.is_open()) {
|
||||
file << tab.editor.GetText();
|
||||
tab.filepath = save_path;
|
||||
tab.filename = core::GetFileName(save_path);
|
||||
tab.filename = util::GetFileName(save_path);
|
||||
tab.modified = false;
|
||||
if (toast_manager_) {
|
||||
toast_manager_->Show(absl::StrFormat("System prompt saved to %s", save_path),
|
||||
@@ -1771,7 +1771,7 @@ void AgentChatWidget::RenderSystemPromptEditor() {
|
||||
buffer << file.rdbuf();
|
||||
tab.editor.SetText(buffer.str());
|
||||
tab.filepath = filepath;
|
||||
tab.filename = core::GetFileName(filepath);
|
||||
tab.filename = util::GetFileName(filepath);
|
||||
tab.modified = false;
|
||||
found = true;
|
||||
break;
|
||||
@@ -1780,7 +1780,7 @@ void AgentChatWidget::RenderSystemPromptEditor() {
|
||||
|
||||
if (!found) {
|
||||
FileEditorTab tab;
|
||||
tab.filename = core::GetFileName(filepath);
|
||||
tab.filename = util::GetFileName(filepath);
|
||||
tab.filepath = filepath;
|
||||
tab.is_system_prompt = true;
|
||||
tab.editor.SetLanguageDefinition(TextEditor::LanguageDefinition::CPlusPlus());
|
||||
@@ -2042,7 +2042,7 @@ void AgentChatWidget::LoadAgentSettingsFromProject(const core::YazeProject& proj
|
||||
buffer << file.rdbuf();
|
||||
tab.editor.SetText(buffer.str());
|
||||
tab.filepath = prompt_path;
|
||||
tab.filename = core::GetFileName(prompt_path);
|
||||
tab.filename = util::GetFileName(prompt_path);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@@ -2050,7 +2050,7 @@ void AgentChatWidget::LoadAgentSettingsFromProject(const core::YazeProject& proj
|
||||
|
||||
if (!found) {
|
||||
FileEditorTab tab;
|
||||
tab.filename = core::GetFileName(prompt_path);
|
||||
tab.filename = util::GetFileName(prompt_path);
|
||||
tab.filepath = prompt_path;
|
||||
tab.is_system_prompt = true;
|
||||
tab.editor.SetLanguageDefinition(TextEditor::LanguageDefinition::CPlusPlus());
|
||||
|
||||
@@ -76,7 +76,7 @@ std::string GetEditorName(EditorType type) {
|
||||
// Settings + preset helpers
|
||||
void EditorManager::LoadUserSettings() {
|
||||
try {
|
||||
auto data = core::LoadConfigFile(settings_filename_);
|
||||
auto data = util::LoadConfigFile(settings_filename_);
|
||||
if (!data.empty()) {
|
||||
std::istringstream ss(data);
|
||||
std::string line;
|
||||
@@ -103,7 +103,7 @@ void EditorManager::SaveUserSettings() {
|
||||
ss << "font_global_scale=" << font_global_scale_ << "\n";
|
||||
ss << "autosave_enabled=" << (autosave_enabled_ ? 1 : 0) << "\n";
|
||||
ss << "autosave_interval_secs=" << autosave_interval_secs_ << "\n";
|
||||
core::SaveFile(settings_filename_, ss.str());
|
||||
util::SaveFile(settings_filename_, ss.str());
|
||||
}
|
||||
|
||||
void EditorManager::RefreshWorkspacePresets() {
|
||||
@@ -114,7 +114,7 @@ void EditorManager::RefreshWorkspacePresets() {
|
||||
|
||||
// Try to read a simple index file of presets
|
||||
try {
|
||||
auto data = core::LoadConfigFile("workspace_presets.txt");
|
||||
auto data = util::LoadConfigFile("workspace_presets.txt");
|
||||
if (!data.empty()) {
|
||||
std::istringstream ss(data);
|
||||
std::string name;
|
||||
@@ -164,7 +164,7 @@ void EditorManager::SaveWorkspacePreset(const std::string& name) {
|
||||
std::ostringstream ss;
|
||||
for (const auto& n : workspace_presets_)
|
||||
ss << n << "\n";
|
||||
core::SaveFile("workspace_presets.txt", ss.str());
|
||||
util::SaveFile("workspace_presets.txt", ss.str());
|
||||
} catch (const std::exception& e) {
|
||||
LOG_WARN("EditorManager", "Failed to save workspace presets: %s", e.what());
|
||||
}
|
||||
@@ -1454,7 +1454,7 @@ void EditorManager::DrawMenuBar() {
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", core::GetFileName(file).c_str());
|
||||
ImGui::Text("%s", util::GetFileName(file).c_str());
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
std::string ext = core::GetFileExtension(file);
|
||||
|
||||
@@ -263,7 +263,7 @@ absl::Status ThemeManager::LoadThemeFromFile(const std::string& filepath) {
|
||||
filepath, // Absolute path
|
||||
"assets/themes/" + filepath, // Relative from build dir
|
||||
"../assets/themes/" + filepath, // Relative from bin dir
|
||||
core::GetResourcePath("assets/themes/" + filepath), // Platform-specific resource path
|
||||
util::GetResourcePath("assets/themes/" + filepath), // Platform-specific resource path
|
||||
};
|
||||
|
||||
std::ifstream file;
|
||||
@@ -1898,13 +1898,13 @@ std::vector<std::string> ThemeManager::GetThemeSearchPaths() const {
|
||||
// Platform-specific resource paths
|
||||
#ifdef __APPLE__
|
||||
// macOS bundle resource path (this should be the primary path for bundled apps)
|
||||
std::string bundle_themes = core::GetResourcePath("assets/themes/");
|
||||
std::string bundle_themes = util::GetResourcePath("assets/themes/");
|
||||
if (!bundle_themes.empty()) {
|
||||
search_paths.push_back(bundle_themes);
|
||||
}
|
||||
|
||||
// Alternative bundle locations
|
||||
std::string bundle_root = core::GetBundleResourcePath();
|
||||
std::string bundle_root = util::GetBundleResourcePath();
|
||||
|
||||
search_paths.push_back(bundle_root + "Contents/Resources/themes/");
|
||||
search_paths.push_back(bundle_root + "Contents/Resources/assets/themes/");
|
||||
@@ -1917,7 +1917,7 @@ std::vector<std::string> ThemeManager::GetThemeSearchPaths() const {
|
||||
#endif
|
||||
|
||||
// User config directory
|
||||
std::string config_themes = core::GetConfigDirectory() + "/themes/";
|
||||
std::string config_themes = util::GetConfigDirectory() + "/themes/";
|
||||
search_paths.push_back(config_themes);
|
||||
|
||||
return search_paths;
|
||||
|
||||
@@ -52,7 +52,7 @@ absl::Status ProjectBuild::Run(const std::vector<std::string>& arg_vec) {
|
||||
for (unsigned int i = 0; i < glob_result.gl_pathc; ++i) {
|
||||
std::string patch_file = glob_result.gl_pathv[i];
|
||||
std::vector<uint8_t> patch_data;
|
||||
auto patch_contents = core::LoadFile(patch_file);
|
||||
auto patch_contents = util::LoadFile(patch_file);
|
||||
std::copy(patch_contents.begin(), patch_contents.end(),
|
||||
std::back_inserter(patch_data));
|
||||
std::vector<uint8_t> patched_rom;
|
||||
|
||||
@@ -64,11 +64,11 @@ void ApplyBpsPatchComponent(ftxui::ScreenInteractive &screen) {
|
||||
// Button to apply the patch.
|
||||
auto apply_button = Button("Apply Patch", [&] {
|
||||
std::vector<uint8_t> source = app_context.rom.vector();
|
||||
// auto source_contents = core::LoadFile(base_file);
|
||||
// auto source_contents = util::LoadFile(base_file);
|
||||
// std::copy(source_contents.begin(), source_contents.end(),
|
||||
// std::back_inserter(source));
|
||||
std::vector<uint8_t> patch;
|
||||
auto patch_contents = core::LoadFile(patch_file);
|
||||
auto patch_contents = util::LoadFile(patch_file);
|
||||
std::copy(patch_contents.begin(), patch_contents.end(),
|
||||
std::back_inserter(patch));
|
||||
std::vector<uint8_t> patched;
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user