mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-25 02:00:54 +00:00
Changed: Use all existing icons for Ryzom
This commit is contained in:
parent
312fc3eb74
commit
a634acc541
1 changed files with 22 additions and 10 deletions
|
@ -921,20 +921,32 @@ void prelogInit()
|
||||||
Driver->setWindowTitle(CI18N::get("TheSagaOfRyzom"));
|
Driver->setWindowTitle(CI18N::get("TheSagaOfRyzom"));
|
||||||
|
|
||||||
#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC)
|
#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC)
|
||||||
vector<CBitmap> bitmaps;
|
// add all existing icons
|
||||||
|
vector<string> filenames;
|
||||||
string fileName = "/usr/share/pixmaps/ryzom.png";
|
filenames.push_back("/usr/share/icons/hicolor/128x128/apps/ryzom.png");
|
||||||
|
filenames.push_back("/usr/share/icons/hicolor/48x48/apps/ryzom.png");
|
||||||
|
filenames.push_back("/usr/share/icons/hicolor/32x32/apps/ryzom.png");
|
||||||
|
filenames.push_back("/usr/share/icons/hicolor/24x24/apps/ryzom.png");
|
||||||
|
filenames.push_back("/usr/share/icons/hicolor/22x22/apps/ryzom.png");
|
||||||
|
filenames.push_back("/usr/share/icons/hicolor/16x16/apps/ryzom.png");
|
||||||
|
filenames.push_back("/usr/share/pixmaps/ryzom.png");
|
||||||
|
|
||||||
|
// check if an icon is present in registered paths
|
||||||
if(CPath::exists("ryzom.png"))
|
if(CPath::exists("ryzom.png"))
|
||||||
fileName = CPath::lookup("ryzom.png");
|
filenames.push_back(CPath::lookup("ryzom.png"));
|
||||||
|
|
||||||
CIFile file;
|
vector<CBitmap> bitmaps;
|
||||||
|
|
||||||
if (file.open(fileName))
|
for(size_t i = 0; i < filenames.size(); ++i)
|
||||||
{
|
{
|
||||||
CBitmap bitmap;
|
CIFile file;
|
||||||
if (bitmap.load(file))
|
|
||||||
bitmaps.push_back(bitmap);
|
if (CFile::fileExists(filenames[i]) && file.open(filenames[i]))
|
||||||
|
{
|
||||||
|
CBitmap bitmap;
|
||||||
|
if (bitmap.load(file))
|
||||||
|
bitmaps.push_back(bitmap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Driver->setWindowIcon(bitmaps);
|
Driver->setWindowIcon(bitmaps);
|
||||||
|
|
Loading…
Reference in a new issue