SecretAreaTrigger::SecretAreaTrigger(const Reader& reader) :
message_timer(),
message_displayed(),
+ message(),
fade_tilemap()
{
reader.get("x", bbox.p1.x);
reader.get("height", h);
bbox.set_size(w, h);
reader.get("fade-tilemap", fade_tilemap);
+ reader.get("message", message);
+ if(message == "") {
+ message = _("You found a secret area!");
+ }
message_displayed = false;
}
context.push_transform();
context.set_translation(Vector(0, 0));
Vector pos = Vector(0, SCREEN_HEIGHT/2 - Resources::normal_font->get_height()/2);
- context.draw_center_text(Resources::normal_font, _("You found a secret area!"), pos, LAYER_HUD, SecretAreaTrigger::text_color);
+ context.draw_center_text(Resources::normal_font, message, pos, LAYER_HUD, SecretAreaTrigger::text_color);
context.pop_transform();
}
if (message_timer.check()) {
Timer message_timer;
bool message_displayed;
std::string fade_tilemap; /**< tilemap to fade away when trigger is activated, or empty if you don't care */
+ std::string message; /**< message to display, default "You found a secret area!" */
};
#endif