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:
@@ -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] );
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user