mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-09 20:08:57 +03:00
Now copies project icon to trenchbroom game config directoy
This commit is contained in:
@@ -37,8 +37,9 @@ namespace NuakeEditor
|
||||
bool CreateTrenchbroomGameConfig::Execute()
|
||||
{
|
||||
const std::string& cleanProjectName = String::Sanitize(mProject->Name);
|
||||
const std::string& gameConfigPath = mProject->TrenchbroomPath + "/../games/" + cleanProjectName + "/GameConfig.cfg";
|
||||
FileSystem::BeginWriteFile(gameConfigPath, true);
|
||||
const std::string& gameConfigFolderPath = mProject->TrenchbroomPath + "/../games/" + cleanProjectName + "/";
|
||||
const std::string& gameConfigFilePath = gameConfigFolderPath + "GameConfig.cfg";
|
||||
FileSystem::BeginWriteFile(gameConfigFilePath, true);
|
||||
|
||||
std::string templateFile = R"(
|
||||
{
|
||||
@@ -129,6 +130,12 @@ namespace NuakeEditor
|
||||
)";
|
||||
FileSystem::WriteLine(templateFile);
|
||||
FileSystem::EndWriteFile();
|
||||
|
||||
// Copy Icon.png
|
||||
if (FileSystem::FileExists("icon.png"))
|
||||
{
|
||||
std::filesystem::copy_file(FileSystem::RelativeToAbsolute("icon.png"), gameConfigFolderPath + "Icon.png");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user