pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3267 - in trunk/pingus: . src


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3267 - in trunk/pingus: . src
Date: Mon, 1 Oct 2007 02:19:35 +0200

Author: grumbel
Date: 2007-10-01 02:19:33 +0200 (Mon, 01 Oct 2007)
New Revision: 3267

Modified:
   trunk/pingus/SConstruct
   trunk/pingus/TODO
   trunk/pingus/src/global_event.cpp
   trunk/pingus/src/option_menu.cpp
   trunk/pingus/src/option_menu.hpp
Log:
- some OptionMenu look&feel testing

Modified: trunk/pingus/SConstruct
===================================================================
--- trunk/pingus/SConstruct     2007-09-30 16:26:18 UTC (rev 3266)
+++ trunk/pingus/SConstruct     2007-10-01 00:19:33 UTC (rev 3267)
@@ -130,18 +130,17 @@
 'src/gui/component.cpp',
 'src/gui/checkbox.cpp',
 'src/gui/combobox.cpp', 
-'src/gui/cursor.cpp',
+# 'gui/input_debug_screen.cpp', 
+'src/display/cursor.cpp',
+'src/display/display.cpp', 
 'src/gui/group_component.cpp', 
-'src/gui/display.cpp', 
 'src/gui/gui_manager.cpp', 
-'src/gui/gui_screen.cpp', 
 'src/gui/input_box.cpp', 
-# 'gui/input_debug_screen.cpp', 
-'src/gui/root_gui_manager.cpp', 
-'src/gui/screen.cpp', 
-'src/gui/screen_manager.cpp', 
-'src/gui/screen_ptr.cpp', 
 'src/gui/surface_button.cpp',
+'src/screen/gui_screen.cpp', 
+'src/screen/screen.cpp', 
+'src/screen/screen_manager.cpp', 
+'src/screen/screen_ptr.cpp', 
 
 'src/line_iterator.cpp',
 

Modified: trunk/pingus/TODO
===================================================================
--- trunk/pingus/TODO   2007-09-30 16:26:18 UTC (rev 3266)
+++ trunk/pingus/TODO   2007-10-01 00:19:33 UTC (rev 3267)
@@ -120,26 +120,6 @@
 
 - remove verbose
 
-- option menu:
-
-  ----------------------------------
-  Language:                 [German]
-  ----------------------------------
-  Fast-Mode:                  Yes/No
-  Fullscreen:                 Yes/No
-  Allow Window Resize:        Yes/No
-  Resolution:              [800x600]
-  Frame Skip:              [Integer]
-  Software Cursor:          [Yes/No] (could add different styled ones)
-  ----------------------------------
-  Master Volume:       [#######    ]
-  Music Volume:        [####       ]
-  Sound FX Volume:     [########## ]
-  ----------------------------------
-  Scroll Mode: [DragDrop/Rubberband]
-  Enable Autoscrolling: [always, only in fullscreen, never]
-  ----------------------------------
-
 - add dynamic resize for the game
 
 - resource system needs a review/rewrite
@@ -252,6 +232,9 @@
 Less Important:
 ===============
 
+- make inputbox handle text longer then the rect size as well as
+  multiline text
+
 - keyboard shortcuts need to be implemented with input framework, but
   how without support for keymaps?
 

Modified: trunk/pingus/src/global_event.cpp
===================================================================
--- trunk/pingus/src/global_event.cpp   2007-09-30 16:26:18 UTC (rev 3266)
+++ trunk/pingus/src/global_event.cpp   2007-10-01 00:19:33 UTC (rev 3267)
@@ -63,7 +63,7 @@
 
       case SDLK_F5:
         //if 
(!dynamic_cast<OptionMenu*>(&(ScreenManager::instance()->get_current_screen())))
-        //  ScreenManager::instance()->push_screen(new OptionMenu(), true);
+        ScreenManager::instance()->push_screen(new OptionMenu(), true);
         break;
 
       case SDLK_F12:

Modified: trunk/pingus/src/option_menu.cpp
===================================================================
--- trunk/pingus/src/option_menu.cpp    2007-09-30 16:26:18 UTC (rev 3266)
+++ trunk/pingus/src/option_menu.cpp    2007-10-01 00:19:33 UTC (rev 3267)
@@ -17,12 +17,39 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "resource.hpp"
 #include "screen/screen_manager.hpp"
+#include "fonts.hpp"
 #include "display/drawing_context.hpp"
 #include "option_menu.hpp"
 
+/*
+  - option menu:
+
+  ----------------------------------
+  Language:                 [German]
+  ----------------------------------
+  Fast-Mode:                  Yes/No
+  Fullscreen:                 Yes/No
+  Allow Window Resize:        Yes/No
+  Resolution:              [800x600]
+  Frame Skip:              [Integer]
+  Software Cursor:          [Yes/No] (could add different styled ones)
+  ----------------------------------
+  Master Volume:       [#######    ]
+  Music Volume:        [####       ]
+  Sound FX Volume:     [########## ]
+  ----------------------------------
+  Scroll Mode: [DragDrop/Rubberband]
+  Enable Autoscrolling: [always, only in fullscreen, never]
+  ----------------------------------
+
+  [reset to defaults]
+*/
+
 OptionMenu::OptionMenu()
 {
+  background = Resource::load_sprite("core/menu/filedialog");
 }
 
 OptionMenu::~OptionMenu()
@@ -32,7 +59,38 @@
 void
 OptionMenu::draw_background(DrawingContext& gc)
 {
-  gc.draw_fillrect(Rect(100, 100, 400, 400), Color(255, 0, 0));
+  // gc.draw_fillrect(Rect(100, 100, 400, 400), Color(255, 0, 0));
+  gc.draw(background, gc.get_width()/2 - background.get_width()/2, 
gc.get_height()/2 - background.get_height()/2);
+
+  gc.print_center(Fonts::chalk_large, gc.get_width()/2, 90, "Option Menu");
+  
+  std::vector<std::string> strs;
+  strs.push_back("Resolution:");
+  strs.push_back("Fullscreen:");
+  strs.push_back("Allow Resize:");
+  strs.push_back("Fast Mode:");
+  strs.push_back("Master Volume:");
+  strs.push_back("Sound Volume:");
+  strs.push_back("Music Volume:");
+
+  int y = 130;
+  for(std::vector<std::string>::iterator i = strs.begin(); i != strs.end(); 
++i)
+    {
+      gc.print_left(Fonts::chalk_normal,  120, y += 32, *i);
+      gc.print_right(Fonts::chalk_normal, gc.get_width()/2 - 32, y, "[X]");
+    }
+
+  std::vector<std::string> strs2;
+  strs2.push_back("Software Cursor:");
+  strs2.push_back("Scroll Mode:");
+  strs2.push_back("Frame Skip:");
+
+  y = 130;
+  for(std::vector<std::string>::iterator i = strs2.begin(); i != strs2.end(); 
++i)
+    {
+      gc.print_left(Fonts::chalk_normal,  gc.get_width()/2 + 32, y += 32, *i);
+      gc.print_right(Fonts::chalk_normal, gc.get_width()/2 + 280, y, "[X]");
+    }
 }
 
 void

Modified: trunk/pingus/src/option_menu.hpp
===================================================================
--- trunk/pingus/src/option_menu.hpp    2007-09-30 16:26:18 UTC (rev 3266)
+++ trunk/pingus/src/option_menu.hpp    2007-10-01 00:19:33 UTC (rev 3267)
@@ -20,12 +20,15 @@
 #ifndef HEADER_OPTION_MENU_HPP
 #define HEADER_OPTION_MENU_HPP
 
+#include "sprite.hpp"
 #include "screen/gui_screen.hpp"
 
 /** */
 class OptionMenu : public GUIScreen
 {
 private:
+  Sprite background;
+
 public:
   OptionMenu();
   ~OptionMenu();





reply via email to

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