Added Halloween mode, with the worst temporary icon ever - happens in October

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/christmas@12271 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
funto66
2012-12-12 01:03:44 +00:00
parent 047d075a45
commit 6edcfb1a00
4 changed files with 16 additions and 4 deletions

View File

@@ -97,11 +97,13 @@ KartModel::KartModel(bool is_master)
* does not actually load the models (see load()).
* \param node XML object of configuration file.
*/
void KartModel::loadInfo(const XMLNode &node, bool xmas_mode)
void KartModel::loadInfo(const XMLNode &node, bool xmas_mode, bool halloween_mode)
{
node.get("model-file", &m_model_filename);
if(xmas_mode)
node.get("xmas-model-file", &m_model_filename);
if(halloween_mode)
node.get("halloween-model-file", &m_model_filename);
if(const XMLNode *animation_node=node.getNode("animations"))
{
animation_node->get("left", &m_animation_frame[AF_LEFT] );

View File

@@ -142,7 +142,7 @@ public:
~KartModel();
KartModel* makeCopy();
void reset();
void loadInfo(const XMLNode &node, bool xmas_mode);
void loadInfo(const XMLNode &node, bool xmas_mode, bool halloween_mode);
bool loadModels(const KartProperties &kart_properties);
void update(float rotation_dt, float steer,
const float suspension[4]);

View File

@@ -60,7 +60,8 @@ KartProperties::KartProperties(const std::string &filename)
struct tm* timeinfo;
std::time(&rawtime);
timeinfo = std::localtime(&rawtime);
m_xmas_mode = (timeinfo->tm_mon == 11); // Xmas mode happens in December
m_xmas_mode = (timeinfo->tm_mon == 12-1); // Xmas mode happens in December
m_halloween_mode = (timeinfo->tm_mon == 10-1); // Halloween mode appears in October
m_groups.clear();
m_custom_sfx_id.resize(SFXManager::NUM_CUSTOMS);
@@ -288,6 +289,14 @@ void KartProperties::getAllData(const XMLNode * root)
root->get("xmas-icon-file", &m_icon_file);
root->get("xmas-minimap-icon-file", &m_minimap_icon_file);
}
// Override file paths on Halloween
root->get("force-halloween-mode", &m_halloween_mode);
if(m_halloween_mode)
{
root->get("halloween-icon-file", &m_icon_file);
root->get("halloween-minimap-icon-file", &m_minimap_icon_file);
}
root->get("shadow-file", &m_shadow_file );
Vec3 c;
@@ -575,7 +584,7 @@ void KartProperties::getAllData(const XMLNode * root)
} // if sounds-node exist
if(m_kart_model)
m_kart_model->loadInfo(*root, m_xmas_mode);
m_kart_model->loadInfo(*root, m_xmas_mode, m_halloween_mode);
} // getAllData
// ----------------------------------------------------------------------------

View File

@@ -85,6 +85,7 @@ private:
mutable KartModel *m_kart_model;
bool m_xmas_mode;
bool m_halloween_mode;
/** List of all groups the kart belongs to. */
std::vector<std::string> m_groups;