pingus-cvs
[Top][All Lists]
Advanced

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

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


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3198 - in trunk/pingus: . src src/editor
Date: Fri, 21 Sep 2007 15:43:47 +0200

Author: grumbel
Date: 2007-09-21 15:43:46 +0200 (Fri, 21 Sep 2007)
New Revision: 3198

Modified:
   trunk/pingus/TODO
   trunk/pingus/src/editor/editor_level.cpp
   trunk/pingus/src/editor/editor_level.hpp
   trunk/pingus/src/editor/editor_screen.cpp
   trunk/pingus/src/editor/level_properties.cpp
   trunk/pingus/src/editor/level_properties.hpp
   trunk/pingus/src/editor/object_properties.cpp
   trunk/pingus/src/pingus_main.cpp
Log:
- added music property

Modified: trunk/pingus/TODO
===================================================================
--- trunk/pingus/TODO   2007-09-21 13:28:45 UTC (rev 3197)
+++ trunk/pingus/TODO   2007-09-21 13:43:46 UTC (rev 3198)
@@ -180,16 +180,8 @@
 Important:
 ==========
 
-- music property missing
-
 - add object duplication
 
-- ObjectSelector need to support more object types, missing types:
-
-   all kinds of traps, weather, special objects
-
-- add real object remove
-
 - keyboard shortcuts need to be implemented (use input framework, but
   how without support for keymaps?)
 
@@ -210,6 +202,9 @@
 Less Important:
 ===============
 
+- ObjectSelector need to support more object types, missing types:
+  all kinds of traps, weather, special objects
+
 - add yes/no question when creating a new level
 
 - add type conversion (important to convert groundpieces in hotspots and visa 
verse)

Modified: trunk/pingus/src/editor/editor_level.cpp
===================================================================
--- trunk/pingus/src/editor/editor_level.cpp    2007-09-21 13:28:45 UTC (rev 
3197)
+++ trunk/pingus/src/editor/editor_level.cpp    2007-09-21 13:43:46 UTC (rev 
3198)
@@ -388,6 +388,12 @@
   return impl->comment;
 }
 
+std::string
+EditorLevel::get_music() const
+{
+  return impl->music;
+}
+
 int
 EditorLevel::get_time() const
 {
@@ -413,6 +419,12 @@
 }
 
 void
+EditorLevel::set_music(const std::string& str)
+{
+  impl->music = str;
+}
+
+void
 EditorLevel::set_size(const Size& s)
 {
   impl->size = s;

Modified: trunk/pingus/src/editor/editor_level.hpp
===================================================================
--- trunk/pingus/src/editor/editor_level.hpp    2007-09-21 13:28:45 UTC (rev 
3197)
+++ trunk/pingus/src/editor/editor_level.hpp    2007-09-21 13:43:46 UTC (rev 
3198)
@@ -78,10 +78,12 @@
   int get_time() const;
   int get_difficulty() const;
   std::string get_comment() const;
+  std::string get_music() const;
 
   void set_time(int);
   void set_difficulty(int);
   void set_comment(const std::string&);
+  void set_music(const std::string&);
 
   void set_action(const std::string& actionname, int count); 
   std::map<std::string, int> get_actions() const;

Modified: trunk/pingus/src/editor/editor_screen.cpp
===================================================================
--- trunk/pingus/src/editor/editor_screen.cpp   2007-09-21 13:28:45 UTC (rev 
3197)
+++ trunk/pingus/src/editor/editor_screen.cpp   2007-09-21 13:43:46 UTC (rev 
3198)
@@ -96,7 +96,7 @@
   action_properties->hide();
   gui_manager->add(action_properties, true);
 
-  level_properties = new LevelProperties(this, Rect(Vector2i(0,38), 
Size(Display::get_width()-244,280)));
+  level_properties = new LevelProperties(this, Rect(Vector2i(0,38), 
Size(Display::get_width()-244,302)));
   level_properties->hide();
   level_properties->set_level(plf);
   action_properties->set_level(plf);

Modified: trunk/pingus/src/editor/level_properties.cpp
===================================================================
--- trunk/pingus/src/editor/level_properties.cpp        2007-09-21 13:28:45 UTC 
(rev 3197)
+++ trunk/pingus/src/editor/level_properties.cpp        2007-09-21 13:43:46 UTC 
(rev 3198)
@@ -67,6 +67,8 @@
   add(difficulty = new Inputbox(Rect(Vector2i(110, y+110), Size(  w, 20))), 
true);
   add(new Label   (Rect(Vector2i( 10, y+132), Size( 80, 20)), "Comment:"), 
true);
   add(comment = new Inputbox(Rect(Vector2i(110, y+132), Size(  w, 20))), true);
+  add(new Label   (Rect(Vector2i( 10, y+154), Size( 80, 20)), "Music:"), true);
+  add(music = new Inputbox(Rect(Vector2i(110, y+154), Size(  w, 20))), true);
 
   author->on_change.connect(boost::bind(&LevelProperties::on_author_change, 
this, _1));
   
levelname->on_change.connect(boost::bind(&LevelProperties::on_levelname_change, 
this, _1));
@@ -80,6 +82,7 @@
   time->on_change.connect(boost::bind(&LevelProperties::on_time_change, this, 
_1));
   
difficulty->on_change.connect(boost::bind(&LevelProperties::on_difficulty_change,
 this, _1));
   comment->on_change.connect(boost::bind(&LevelProperties::on_comment_change, 
this, _1));
+  music->on_change.connect(boost::bind(&LevelProperties::on_music_change, 
this, _1));
 }
 
 LevelProperties::~LevelProperties()
@@ -112,7 +115,8 @@
   width->set_text(StringUtil::to_string(level->get_size().width));
   height->set_text(StringUtil::to_string(level->get_size().height));
   difficulty->set_text(StringUtil::to_string(level->get_difficulty()));
-  comment->set_text("");
+  comment->set_text(level->get_comment());
+  music->set_text(level->get_music());
 }
 
 void
@@ -193,6 +197,12 @@
 {
   level->set_comment(str);
 }
+
+void
+LevelProperties::on_music_change(const std::string& str)
+{ 
+  level->set_music(str);
+}
 
 } // namespace Editor
 

Modified: trunk/pingus/src/editor/level_properties.hpp
===================================================================
--- trunk/pingus/src/editor/level_properties.hpp        2007-09-21 13:28:45 UTC 
(rev 3197)
+++ trunk/pingus/src/editor/level_properties.hpp        2007-09-21 13:43:46 UTC 
(rev 3198)
@@ -47,6 +47,7 @@
   Inputbox* height;
   Inputbox* difficulty;
   Inputbox* comment;
+  Inputbox* music;
 
 public:
   LevelProperties(EditorScreen* editor, const Rect& rect);
@@ -69,6 +70,7 @@
   void on_height_change(const std::string& str);
   void on_difficulty_change(const std::string& str);
   void on_comment_change(const std::string& str);
+  void on_music_change(const std::string& str);
 
 private:
   LevelProperties (const LevelProperties&);

Modified: trunk/pingus/src/editor/object_properties.cpp
===================================================================
--- trunk/pingus/src/editor/object_properties.cpp       2007-09-21 13:28:45 UTC 
(rev 3197)
+++ trunk/pingus/src/editor/object_properties.cpp       2007-09-21 13:43:46 UTC 
(rev 3198)
@@ -565,10 +565,13 @@
 void
 ObjectProperties::on_repeat_change(const std::string& str)
 {
+  int r = StringUtil::to<int>(str);
+  if (r <= 0)
+    r = 1;
   for(Objects::iterator i = objects.begin(); i != objects.end(); ++i)
     {
-      (*i)->set_repeat(StringUtil::to<int>(str));
-    }   
+      (*i)->set_repeat(r);
+    }
 }
 
 } // namespace Editor

Modified: trunk/pingus/src/pingus_main.cpp
===================================================================
--- trunk/pingus/src/pingus_main.cpp    2007-09-21 13:28:45 UTC (rev 3197)
+++ trunk/pingus/src/pingus_main.cpp    2007-09-21 13:43:46 UTC (rev 3198)
@@ -854,7 +854,7 @@
   }
   atexit(SDL_Quit); 
   Display::set_video_mode(screen_width, screen_height);
-  SDL_WM_SetCaption("Pingus - SDL Edition", 0 /* icon */);
+  SDL_WM_SetCaption("Pingus " VERSION " - SDL Edition", 0 /* icon */);
   SDL_EnableUNICODE(1);
 }
 





reply via email to

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