pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3259 - in trunk/pingus: . data/data src/editor src/input


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3259 - in trunk/pingus: . data/data src/editor src/input
Date: Sat, 29 Sep 2007 16:56:20 +0200

Author: grumbel
Date: 2007-09-29 16:56:19 +0200 (Sat, 29 Sep 2007)
New Revision: 3259

Modified:
   trunk/pingus/TODO
   trunk/pingus/data/data/core.res
   trunk/pingus/src/editor/editor_screen.cpp
   trunk/pingus/src/editor/editor_screen.hpp
   trunk/pingus/src/editor/file_dialog.cpp
   trunk/pingus/src/editor/panel.cpp
   trunk/pingus/src/input/evdev_device.cpp
Log:
- added minimap toggle button and fixed a few more resize bugs

Modified: trunk/pingus/TODO
===================================================================
--- trunk/pingus/TODO   2007-09-29 14:26:55 UTC (rev 3258)
+++ trunk/pingus/TODO   2007-09-29 14:56:19 UTC (rev 3259)
@@ -241,7 +241,7 @@
 
 - add pixel perfect object selection
 
-- implement a minimap (just rects when surfaces are to tricky)
+- move object rotate buttons to ObjectProperties
 
 - add icons to filedialog
 
@@ -249,6 +249,8 @@
 
 - show an error message if save fails
 
+- shrinking the editor window to much causes a crash
+
 Less Important:
 ===============
 

Modified: trunk/pingus/data/data/core.res
===================================================================
--- trunk/pingus/data/data/core.res     2007-09-29 14:26:55 UTC (rev 3258)
+++ trunk/pingus/data/data/core.res     2007-09-29 14:56:19 UTC (rev 3259)
@@ -150,6 +150,10 @@
                     (image-file "../images/core/editor/objects.png"))
 
                    (sprite
+                    (name "minimap")
+                    (image-file "../images/core/editor/minimap.png"))
+
+                   (sprite
                     (name "object-properties")
                     (image-file "../images/core/editor/object-properties.png"))
 

Modified: trunk/pingus/src/editor/editor_screen.cpp
===================================================================
--- trunk/pingus/src/editor/editor_screen.cpp   2007-09-29 14:26:55 UTC (rev 
3258)
+++ trunk/pingus/src/editor/editor_screen.cpp   2007-09-29 14:56:19 UTC (rev 
3259)
@@ -69,15 +69,13 @@
   //rect(Vector2i(Display::get_width() - 244 + 2,  38 + 3 + 62),
   //      Size(240, Display::get_height() - (600 - 495))),
 
-  object_selector   = new ObjectSelector(this, Rect(Display::get_width()-244, 
38,
-                                                    Display::get_width(), 
Display::get_height() - 183));
+  object_selector = new ObjectSelector(this, Rect());
   gui_manager->add(object_selector, true);
 
-  minimap = new Minimap(this, Rect(Vector2i(Display::get_width()-244, 
Display::get_height()-183),
-                                   Size(244, 183)));
+  minimap = new Minimap(this, Rect());
   gui_manager->add(minimap, true);
 
-  object_properties = new ObjectProperties(this, 
Rect(Vector2i(0,Display::get_height()-150), Size(200, 150)));
+  object_properties = new ObjectProperties(this, Rect(Vector2i(), Size(200, 
150)));
   gui_manager->add(object_properties, true);
 
   file_load_dialog = new FileDialog(this, Rect(Vector2i(50, 50), 
@@ -98,17 +96,18 @@
 
   
viewport->selection_changed.connect(boost::bind(&ObjectProperties::set_objects, 
object_properties, _1));
 
-  action_properties = new ActionProperties(this, Rect(Vector2i(0, 38), 
Size(150, 240)));
+  action_properties = new ActionProperties(this, Rect());
   action_properties->hide();
   gui_manager->add(action_properties, true);
 
-  level_properties = new LevelProperties(this, Rect(Vector2i(0,38), 
Size(Display::get_width()-244,302)));
+  level_properties = new LevelProperties(this, Rect());
   level_properties->hide();
   level_properties->set_level(plf);
   action_properties->set_level(plf);
   gui_manager->add(level_properties, true);
 
   viewport->refresh();
+  update_layout();
 }
 
 // Destructor
@@ -408,21 +407,27 @@
 {
   std::cout << "Function at '" << __FILE__ << ":" << __LINE__ << "' is 
unimplemented" << std::endl; 
 }
+ 
+void
+EditorScreen::toggle_minimap()
+{
+  if (minimap->is_visible())
+    minimap->hide();
+  else
+    minimap->show();
 
+  update_layout();
+}
+
 void 
 EditorScreen::toggle_object_selector()
 {
-  // need trigger a relayout
   if (object_selector->is_visible())
-    {
-      object_selector->hide();
-      viewport->set_rect(Rect(0, 38, Display::get_width(), 
Display::get_height()));
-    }
+    object_selector->hide();
   else
-    {
-      object_selector->show();
-      viewport->set_rect(Rect(0, 38, Display::get_width() - 244, 
Display::get_height()));
-    }
+    object_selector->show();
+  
+  update_layout();
 }
 
 void 
@@ -488,15 +493,24 @@
     object_selector->set_rect(Rect(size.width-244, 38, size.width, 
size.height));
 
   if (object_selector->is_visible())
-    viewport->set_rect(Rect(0, 38, size.width - 244, size.height));
+    {
+      viewport->set_rect(Rect(0, 38, size.width - 244, size.height));
+      level_properties->set_rect(Rect(Vector2i(0,38), Size(size.width-244, 
302))); 
+    }
   else
-    viewport->set_rect(Rect(0, 38, size.width, size.height));
+    {
+      viewport->set_rect(Rect(0, 38, size.width, size.height));
+      level_properties->set_rect(Rect(Vector2i(0,38), Size(size.width, 302))); 
+    }
 
   object_properties->set_rect(Rect(Vector2i(0, size.height - 
object_properties->get_rect().get_height()), 
                                    
Size(object_properties->get_rect().get_width(),
                                         
object_properties->get_rect().get_height())));
-
-  level_properties->set_rect(Rect(Vector2i(0,38), Size(size.width-244,302))); 
+  
+  file_load_dialog->set_rect(Rect(Vector2i(50, 50), Size(size.width  - 100, 
+                                                         size.height - 100)));
+  file_save_dialog->set_rect(Rect(Vector2i(50, 50), Size(size.width  - 100, 
+                                                         size.height - 100)));
 }
 
 void

Modified: trunk/pingus/src/editor/editor_screen.hpp
===================================================================
--- trunk/pingus/src/editor/editor_screen.hpp   2007-09-29 14:26:55 UTC (rev 
3258)
+++ trunk/pingus/src/editor/editor_screen.hpp   2007-09-29 14:56:19 UTC (rev 
3259)
@@ -135,6 +135,7 @@
   void toggle_object_properties();
   void toggle_action_properties();
   void toggle_level_properties();
+  void toggle_minimap();
 
   void toggle_help();
 

Modified: trunk/pingus/src/editor/file_dialog.cpp
===================================================================
--- trunk/pingus/src/editor/file_dialog.cpp     2007-09-29 14:26:55 UTC (rev 
3258)
+++ trunk/pingus/src/editor/file_dialog.cpp     2007-09-29 14:56:19 UTC (rev 
3259)
@@ -192,6 +192,12 @@
   
   cancel_button->set_rect(Rect(Vector2i(rect.get_width() - 104 - 104, 
rect.get_height() - 4 - 30),
                                Size(100, 30)));
+
+  filename_inputbox->set_rect(Rect(4 + 60, 4+30, rect.get_width()-4, 26+30));
+  pathname_inputbox->set_rect(Rect(4 + 60, 4+60, rect.get_width()-4, 26+60));
+
+  datadir_button->set_rect(Rect(Vector2i(4, rect.get_height() - 4 - 30), 
Size(100, 30)));
+  userdir_button->set_rect(Rect(Vector2i(4 + 110, rect.get_height() - 4 - 30), 
Size(100, 30)));
 }
 
 void

Modified: trunk/pingus/src/editor/panel.cpp
===================================================================
--- trunk/pingus/src/editor/panel.cpp   2007-09-29 14:26:55 UTC (rev 3258)
+++ trunk/pingus/src/editor/panel.cpp   2007-09-29 14:56:19 UTC (rev 3259)
@@ -170,6 +170,8 @@
              &EditorScreen::toggle_object_properties);
   add_button("core/editor/objects", _("Show object insertion window"), 
              &EditorScreen::toggle_object_selector);
+  add_button("core/editor/minimap", _("Show minimap"), 
+             &EditorScreen::toggle_minimap);
   add_separator();
   add_button("core/editor/copy", _("Duplicate the selected objects") + " (D)", 
 
              &EditorScreen::objects_duplicate);

Modified: trunk/pingus/src/input/evdev_device.cpp
===================================================================
--- trunk/pingus/src/input/evdev_device.cpp     2007-09-29 14:26:55 UTC (rev 
3258)
+++ trunk/pingus/src/input/evdev_device.cpp     2007-09-29 14:56:19 UTC (rev 
3259)
@@ -151,20 +151,6 @@
       else if (relatives[idx].binding_axis == 1)
         (*i)->set_delta(Vector2f(0, -ev.value * 0.125f));
     }
-
-#if 0
-  CL_InputEvent e; 
-                               
-  e.device       = CL_InputDevice(this);
-  e.type         = CL_InputEvent::relative_moved;
-  e.id           = relative_index;
-  e.mouse_pos.x  = ev.value;
-  e.mouse_pos.y  = 0;
-  e.axis_pos     = 0;
-  e.repeat_count = 0;
-
-  sig_relative_move(e);
-#endif
 }
 
 void





reply via email to

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