Skip to content

Commit

Permalink
#5108: Register icon for game pak files
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Nov 18, 2020
1 parent e509e15 commit 97335c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Binary file added install/bitmaps/package.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions radiantcore/settings/GameManager.cpp
Expand Up @@ -4,6 +4,7 @@
#include "iregistry.h"
#include "iradiant.h"
#include "imessagebus.h"
#include "ifiletypes.h"
#include "icommandsystem.h"
#include "itextstream.h"
#include "ifilesystem.h"
Expand All @@ -24,6 +25,7 @@
#include "messages/GameConfigNeededMessage.h"

#include <sigc++/bind.h>
#include <fmt/format.h>

#include <iostream>

Expand All @@ -34,6 +36,7 @@ namespace
{
const char* const GKEY_PREFAB_FOLDER = "/mapFormat/prefabFolder";
const char* const GKEY_MAPS_FOLDER = "/mapFormat/mapFolder";
const char* const PAK_ICON = "package.png";
}

Manager::Manager()
Expand Down Expand Up @@ -302,6 +305,13 @@ void Manager::initialiseVfs()
vfs::VirtualFileSystem::ExtensionSet extensions;
string::split(extensions, currentGame()->getKeyValue("archivetypes"), " ");

for (const auto& extension : extensions)
{
auto extLower = string::to_lower_copy(extension);
GlobalFiletypes().registerPattern(filetype::TYPE_PAK,
FileTypePattern(fmt::format(_("{0} File"), string::to_upper_copy(extension)), extLower, "*." + extLower, PAK_ICON));
}

if (!_config.modPath.empty())
{
// We have a MOD, register this directory first
Expand Down

0 comments on commit 97335c5

Please sign in to comment.