pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src blitter_impl.hxx,1.8,1.9 exit_menu.cx


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src blitter_impl.hxx,1.8,1.9 exit_menu.cxx,1.15,1.16 pingus_main.cxx,1.63,1.64 pingus_main.hxx,1.9,1.10 result_screen.cxx,1.9,1.10 start_screen.cxx,1.8,1.9
Date: 3 Apr 2003 17:03:26 -0000

Update of /var/lib/cvs/Games/Pingus/src
In directory dark:/tmp/cvs-serv30816

Modified Files:
        blitter_impl.hxx exit_menu.cxx pingus_main.cxx pingus_main.hxx 
        result_screen.cxx start_screen.cxx 
Log Message:
- fixed close button
- added some more soundeffects to the GUI
- some more stuff for the result screen

Index: blitter_impl.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/blitter_impl.hxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- blitter_impl.hxx    2 Apr 2003 20:47:45 -0000       1.8
+++ blitter_impl.hxx    3 Apr 2003 17:03:24 -0000       1.9
@@ -179,6 +179,7 @@
 };
 
 template<class TransF>
+inline
 CL_Surface modify(const CL_Surface& sur)
 {
   CL_SurfaceProvider* prov = sur.get_provider ();
@@ -187,7 +188,7 @@
 
   if (prov->is_indexed())
     {
-      std::cout << "Using indexed blitter" << std::endl;
+      //std::cout << "Using indexed blitter" << std::endl;
 
       IndexedCanvas* canvas = new IndexedCanvas(TransF::get_width (pwidth, 
pheight),
                                                 TransF::get_height(pwidth, 
pheight));

Index: exit_menu.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/exit_menu.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- exit_menu.cxx       2 Apr 2003 19:11:27 -0000       1.15
+++ exit_menu.cxx       3 Apr 2003 17:03:24 -0000       1.16
@@ -23,6 +23,7 @@
 #include "pingus_resource.hxx"
 #include "gui/surface_button.hxx"
 #include "gui/gui_manager.hxx"
+#include "sound/sound.hxx"
 
 class ExitMenuYesButton : public GUI::SurfaceButton
 {
@@ -40,13 +41,20 @@
  
   void draw (GraphicContext& gc) {
     SurfaceButton::draw(gc);
-    gc.print_left(Fonts::chalk_large, 250,  325, _(" Yes"));
+    gc.print_left(Fonts::chalk_large, 250,  325, _("Yes"));
   }
 
   void on_click()
   {
+    PingusSound::play_sound ("yipee");
     manager->exit ();
   }
+
+  void on_pointer_enter()
+  {
+    SurfaceButton::on_pointer_enter();
+    PingusSound::play_sound ("tick");
+  }
 };
 
 class ExitMenuNoButton : public GUI::SurfaceButton
@@ -55,7 +63,7 @@
   PingusMenuManager* manager;
 public:
   ExitMenuNoButton (PingusMenuManager* m)
-    : GUI::SurfaceButton(420, 315,
+    : GUI::SurfaceButton(400, 315,
                          ResDescriptor("menu/exit_button_normal", "core"),
                          ResDescriptor("menu/exit_button_pressed", "core"),
                          ResDescriptor("menu/exit_button_hover", "core")),
@@ -69,7 +77,14 @@
   }
 
   void on_click() {
+    PingusSound::play_sound ("yipee");
     manager->pop_menu();
+  }
+
+  void on_pointer_enter()
+  {
+    SurfaceButton::on_pointer_enter();
+    PingusSound::play_sound ("tick");
   }
 };
 

Index: pingus_main.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_main.cxx,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- pingus_main.cxx     2 Apr 2003 10:34:58 -0000       1.63
+++ pingus_main.cxx     3 Apr 2003 17:03:24 -0000       1.64
@@ -869,6 +869,8 @@
 
   CL_SetupDisplay::init();
 
+  on_exit_press_slot = CL_System::sig_quit().connect(this, 
&PingusMain::on_exit_press);
+
   if (verbose) 
     {
       std::cout << "Using resolution: " 
@@ -889,6 +891,13 @@
       glEnable (GL_BLEND);
     }
 #endif
+}
+
+void
+PingusMain::on_exit_press()
+{
+  std::cout << "Exit pressed" << std::endl;
+  ScreenManager::instance()->clear();
 }
 
 void

Index: pingus_main.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_main.hxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- pingus_main.hxx     31 Mar 2003 21:52:03 -0000      1.9
+++ pingus_main.hxx     3 Apr 2003 17:03:24 -0000       1.10
@@ -40,6 +40,7 @@
   CL_Slot on_button_press_slot;
   CL_Slot on_button_release_slot;
 
+  CL_Slot on_exit_press_slot;
 public:
   PingusMain();
   virtual ~PingusMain();
@@ -47,6 +48,7 @@
   virtual int main(int argc, char** argv);
   virtual char* get_title();
 
+  void on_exit_press();
 private:
   /** After all subsystems have been inited, the screen will get
       setup, the game (the menu, the editor or a level, depending on

Index: result_screen.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/result_screen.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- result_screen.cxx   30 Mar 2003 22:09:33 -0000      1.9
+++ result_screen.cxx   3 Apr 2003 17:03:24 -0000       1.10
@@ -60,8 +60,15 @@
   {
   }
 
+  void on_pointer_enter ()
+  {
+    SurfaceButton::on_pointer_enter();
+    PingusSound::play_sound("tick");
+  }
+
   void on_click() {
     parent->close_screen();
+    PingusSound::play_sound("yipee");
   }
 };
 
@@ -80,9 +87,21 @@
   {
   }
 
+  void draw(GraphicContext& gc) {
+    SurfaceButton::draw(gc);
+    gc.print_center(Fonts::chalk_normal, x_pos + 55, y_pos, _("Abort"));
+  }
+
   void on_click() {
     parent->close_screen();
   }
+
+
+  void on_pointer_enter()
+  {
+    SurfaceButton::on_pointer_enter();
+    PingusSound::play_sound ("tick");
+  }
 };
 
 class ResultScreenRetryButton 
@@ -104,6 +123,12 @@
   {
     parent->retry_level();
   }
+
+  void on_pointer_enter()
+  {
+    SurfaceButton::on_pointer_enter();
+    PingusSound::play_sound ("tick");
+  }
 };
 
 ResultScreenComponent::ResultScreenComponent(Result arg_result)
@@ -123,42 +148,77 @@
   gc.draw(background, 0, 0);
 
   if (!result.success())
-    gc.print_left(Fonts::chalk_small, 635, 415, "Retry?");
+    gc.print_left(Fonts::chalk_normal, 635, 410, _("Retry"));
 
-  gc.print_center(Fonts::chalk_large, gc.get_width()/2, 100, 
System::translate(result.plf->get_levelname()));
+  gc.print_center(Fonts::chalk_large, gc.get_width()/2, 100, 
+                  System::translate(result.plf->get_levelname()));
 
   if (result.success())
     {
-      gc.print_left(Fonts::chalk_large, 150, 180, _("Result: Success!"));
-      gc.print_center(Fonts::pingus_small, gc.get_width()/2, 
gc.get_height()-30,
-                      "..:: Press Space to continue ::..");
+      gc.print_center(Fonts::chalk_large, gc.get_width()/2, 160, 
_("Success!"));
+      /*gc.print_center(Fonts::pingus_small, gc.get_width()/2, 
gc.get_height()-30,
+        "..:: Press Space to continue ::..");*/
     }
   else
     {
-      gc.print_left(Fonts::chalk_large, 150, 180, _("Result: Failure! :("));
-      gc.print_center(Fonts::pingus_small, gc.get_width()/2, 
gc.get_height()-30,
-                      "..:: Press Space to retry the level ::..");
+      gc.print_center(Fonts::chalk_large, gc.get_width()/2, 160, 
_("Failure!"));
+      /*gc.print_center(Fonts::pingus_normal, gc.get_width()/2, 
gc.get_height()-30,
+                      "..:: Press Space to retry the level ::..");*/
+    }
+  
+  std::string message;
+  if (result.success())
+    {
+      if (result.killed == 0 && result.saved == result.total)
+        message = _("Perfect! You saved everybody possibly, great!");
+      else if (result.killed == 0)
+        message = _("None got killed, pretty good work");
+      else if (result.saved == result.needed)
+        message = _("You saved just what you needed, you made it, but\n"
+                    "maybe you can do better?");
+      else if (result.killed >= 5)
+        message = _("Not everybody could get saved, but still good work!");
+      else
+        message = _("What can I say, you made it, congratulasions!");
+    }
+  else
+    {
+      if (result.killed == result.total)
+        message = _("You killed everybody, not good.");
+      else if (result.saved == 0)
+        message = _("None got saved, I know you can do better.");
+      else if (result.saved > 0)
+        message = _("You didn't saved enough, but still saved a few, next\n"
+                    "time you might be better.");
+      else if (result.saved + 1 >= result.needed)
+        message = _("Only one more and you would have made it, try again!");
+      else if (result.saved + 5 >= result.needed)
+        message = _("Only a handfull more and you would have made it, try 
again!");
+      else
+        message = _("Better luck next time!");
     }
+  gc.print_center(Fonts::chalk_normal, gc.get_width()/2, 230, message);
 
-  gc.print_left(Fonts::chalk_small, 150, 280, "Saved: ");
+
+#if 0
   for (int i = 0; i < result.saved; ++i)
     {
       gc.draw(chalk_pingus[rand() % chalk_pingus.size()], 230 + i * 15, 210);
     }
-  gc.print_left(Fonts::chalk_small, 650, 280, to_string(result.saved));
-
-  gc.print_left(Fonts::chalk_small, 150, 310, "Killed: ");    
-  gc.print_left(Fonts::chalk_small, 250, 310, to_string(result.killed));
+#endif
+  gc.print_left(Fonts::chalk_normal,  300, 310, _("Saved: "));
+  gc.print_right(Fonts::chalk_normal, 500, 310, to_string(result.saved) 
+                 + "/" + to_string(result.needed));;
 
+  gc.print_left(Fonts::chalk_normal,  300, 340, _("Killed: "));
+  gc.print_right(Fonts::chalk_normal, 500, 340, to_string(result.killed));
 
-  gc.print_left(Fonts::chalk_small, 150, 340, "Needed: ");    
-  gc.print_left(Fonts::chalk_small, 250, 340, to_string(result.needed));
 
-  gc.print_left(Fonts::chalk_small, 150, 370, "Time left: ");    
+  gc.print_left(Fonts::chalk_normal,   300, 370, _("Time left: "));
   if (result.max_time == -1)
-    gc.print_left(Fonts::chalk_small, 250, 370, "-");
+    gc.print_right(Fonts::chalk_normal, 500, 370, "-");
   else
-    gc.print_left(Fonts::chalk_small, 250, 370, to_string(result.max_time - 
result.used_time));
+    gc.print_right(Fonts::chalk_normal, 500, 370, to_string(result.max_time - 
result.used_time));
 }
 
 ResultScreen::ResultScreen(Result arg_result)

Index: start_screen.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/start_screen.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- start_screen.cxx    30 Mar 2003 20:43:52 -0000      1.8
+++ start_screen.cxx    3 Apr 2003 17:03:24 -0000       1.9
@@ -59,11 +59,23 @@
   {
   }
 
+  void draw(GraphicContext& gc) {
+    SurfaceButton::draw(gc);
+    gc.print_center(Fonts::chalk_normal, x_pos + 32, y_pos - 17, _("Ok"));
+  }
+
   void on_click() 
   {
     PingusSound::play_sound("yipee");
     parent->start_game();
   }
+
+
+  void on_pointer_enter()
+  {
+    SurfaceButton::on_pointer_enter();
+    PingusSound::play_sound ("tick");
+  }
 };
 
 
@@ -82,8 +94,19 @@
   {
   }
 
+  void draw(GraphicContext& gc) {
+    SurfaceButton::draw(gc);
+    gc.print_center(Fonts::chalk_normal, x_pos + 55, y_pos, _("Abort"));
+  }
+
   void on_click() {
     parent->cancel_game();
+  }
+
+  void on_pointer_enter()
+  {
+    SurfaceButton::on_pointer_enter();
+    PingusSound::play_sound ("tick");
   }
 };
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]