Jeck - Added theme substyles, which are chosen dynamically based on the player's deck composition. Also added lazy unit test for booster packs, though there should be a better way to framework this.

This commit is contained in:
wagic.jeck
2010-08-28 10:51:38 +00:00
parent 3ad28096b1
commit 8114944db9
46 changed files with 415 additions and 26 deletions

View File

@@ -9,6 +9,7 @@
#include <JFileSystem.h>
#include <assert.h>
#include "../include/WResourceManager.h"
#include "../include/StyleManager.h"
#if defined (WIN32)
#include <sys/types.h>
#include <sys/stat.h>
@@ -515,6 +516,16 @@ string WResourceManager::graphicsFile(const string filename){
//Check the theme folder.
string theme = options[Options::ACTIVE_THEME].str;
//Check for a theme style renaming:
if(filename != "style.txt"){
WStyle * ws = options.getStyle();
if(ws){
sprintf(buf,"themes/%s/%s",theme.c_str(),ws->stylized(filename).c_str());
if(fileOK(buf,true))
return buf;
}
}
if(theme != "" && theme != "Default"){
sprintf(buf,"themes/%s/%s",theme.c_str(),filename.c_str());
if(fileOK(buf,true))