Add statuses, status messages

This commit is contained in:
Lion Kortlepel
2021-12-06 13:17:54 +01:00
parent 0f74eca2ee
commit a1335e8c7d
13 changed files with 126 additions and 24 deletions

View File

@@ -6,6 +6,7 @@
namespace fs = std::filesystem;
TResourceManager::TResourceManager() {
Application::SetSubsystemStatus("ResourceManager", Application::Status::Starting);
std::string Path = Application::Settings.Resource + "/Client";
if (!fs::exists(Path))
fs::create_directories(Path);
@@ -13,11 +14,11 @@ TResourceManager::TResourceManager() {
std::string File(entry.path().string());
if (auto pos = File.find(".zip"); pos != std::string::npos) {
if (File.length() - pos == 4) {
std::replace(File.begin(), File.end(),'\\','/');
std::replace(File.begin(), File.end(), '\\', '/');
mFileList += File + ';';
if(auto i = File.find_last_of('/'); i != std::string::npos){
if (auto i = File.find_last_of('/'); i != std::string::npos) {
++i;
File = File.substr(i,pos-i);
File = File.substr(i, pos - i);
}
mTrimmedList += "/" + fs::path(File).filename().string() + ';';
mFileSizes += std::to_string(size_t(fs::file_size(entry.path()))) + ';';
@@ -29,4 +30,6 @@ TResourceManager::TResourceManager() {
if (mModsLoaded)
beammp_info("Loaded " + std::to_string(mModsLoaded) + " Mods");
Application::SetSubsystemStatus("ResourceManager", Application::Status::Good);
}