change some LAYER_GUI to LAYER_HUD, update tinygettext, fix a warning in miniswig
[supertux.git] / src / trigger / climbable.cpp
index 2045d76..b06f177 100644 (file)
@@ -17,7 +17,7 @@
 #include "trigger/climbable.hpp"
 
 #include "object/player.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
 #include "supertux/object_factory.hpp"
 #include "util/gettext.hpp"
 #include "util/reader.hpp"
@@ -30,8 +30,9 @@ const float POSITION_FIX_AX = 50; // x-wise acceleration applied to player when
 const float POSITION_FIX_AY = 50; // y-wise acceleration applied to player when trying to align player and Climbable
 }
 
-Climbable::Climbable(const Reader& reader)
-  : climbed_by(0)
+Climbable::Climbable(const Reader& reader) :
+  climbed_by(0),
+  activate_try_timer()
 {
   reader.get("x", bbox.p1.x);
   reader.get("y", bbox.p1.y);
@@ -41,8 +42,9 @@ Climbable::Climbable(const Reader& reader)
   bbox.set_size(w, h);
 }
 
-Climbable::Climbable(const Rect& area)
-  : climbed_by(0)
+Climbable::Climbable(const Rectf& area) :
+  climbed_by(0),
+  activate_try_timer()
 {
   bbox = area;
 }
@@ -72,8 +74,8 @@ Climbable::draw(DrawingContext& context)
   if (climbed_by) {
     context.push_transform();
     context.set_translation(Vector(0, 0));
-    Vector pos = Vector(0, SCREEN_HEIGHT/2 - normal_font->get_height()/2);
-    context.draw_center_text(normal_font, _("Up we go..."), pos, LAYER_GUI, Climbable::text_color);
+    Vector pos = Vector(0, SCREEN_HEIGHT/2 - Resources::normal_font->get_height()/2);
+    context.draw_center_text(Resources::normal_font, _("Up we go..."), pos, LAYER_HUD, Climbable::text_color);
     context.pop_transform();
   }
 }
@@ -112,6 +114,4 @@ Climbable::may_climb(Player& player)
   return true;
 }
 
-IMPLEMENT_FACTORY(Climbable, "climbable");
-
 /* EOF */