complete milestone 1
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// D:\Dev\Mosis\MosisService\designer\src\desktop_file_interface.cpp
|
||||
#include "desktop_file_interface.h"
|
||||
#include <cstdio>
|
||||
#include <cctype>
|
||||
#include <filesystem>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
@@ -16,12 +17,20 @@ void DesktopFileInterface::SetAssetsPath(const std::string& path) {
|
||||
}
|
||||
|
||||
std::string DesktopFileInterface::ResolvePath(const std::string& path) const {
|
||||
std::string resolved = path;
|
||||
|
||||
// Handle URL-encoded Windows drive letters (D| -> D:)
|
||||
// RmlUi sometimes encodes the colon in Windows paths
|
||||
if (resolved.size() >= 2 && std::isalpha(resolved[0]) && resolved[1] == '|') {
|
||||
resolved[1] = ':';
|
||||
}
|
||||
|
||||
// If path is absolute, use it directly
|
||||
if (fs::path(path).is_absolute()) {
|
||||
return path;
|
||||
if (fs::path(resolved).is_absolute()) {
|
||||
return resolved;
|
||||
}
|
||||
// Otherwise, prepend assets path
|
||||
return m_assets_path + path;
|
||||
return m_assets_path + resolved;
|
||||
}
|
||||
|
||||
Rml::FileHandle DesktopFileInterface::Open(const Rml::String& path) {
|
||||
|
||||
Reference in New Issue
Block a user