[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r3260 - in trunk/pingus: . src/editor
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r3260 - in trunk/pingus: . src/editor |
Date: |
Sat, 29 Sep 2007 18:17:41 +0200 |
Author: grumbel
Date: 2007-09-29 18:17:40 +0200 (Sat, 29 Sep 2007)
New Revision: 3260
Modified:
trunk/pingus/TODO
trunk/pingus/src/editor/object_properties.cpp
trunk/pingus/src/editor/object_properties.hpp
trunk/pingus/src/editor/panel.cpp
Log:
- moved flip/rotate to ObjectProperties
Modified: trunk/pingus/TODO
===================================================================
--- trunk/pingus/TODO 2007-09-29 14:56:19 UTC (rev 3259)
+++ trunk/pingus/TODO 2007-09-29 16:17:40 UTC (rev 3260)
@@ -93,10 +93,6 @@
Important:
==========
-- add something like FileReader::must_read_int() for cases where a
- value isn't optional, something that can figure out values that
- havn't be used would be nice as well
-
- Regenerate Courier fonts for latin-1/2/9
### Loading font file: system://data/images/fonts/courier_small-iso-8859-9.font
@@ -196,6 +192,10 @@
Less Important:
===============
+- add something like FileReader::must_read_int() for cases where a
+ value isn't optional, something that can figure out values that
+ havn't be used would be nice as well
+
- fix verdana11 for latin2 and latin9 or go UTF-8
- Liquids/water is 32, others are 64, this is causing trouble with the
Modified: trunk/pingus/src/editor/object_properties.cpp
===================================================================
--- trunk/pingus/src/editor/object_properties.cpp 2007-09-29 14:56:19 UTC
(rev 3259)
+++ trunk/pingus/src/editor/object_properties.cpp 2007-09-29 16:17:40 UTC
(rev 3260)
@@ -143,7 +143,19 @@
add(repeat_label = new Label(label_rect, _("Repeat:")), true);
add(repeat_inputbox = new Inputbox(box_rect), true);
repeat_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_repeat_change,
this, _1));
+ // ___________________________________________________________________
+ //
+ add(flip_horizontal_button = new Button(Rect(Vector2i(15+40*0-3, 0),
Size(34, 34)), "|"), true);
+ add(flip_vertical_button = new Button(Rect(Vector2i(15+40*1-3, 0),
Size(34, 34)), "--"), true);
+ add(rotate_270_button = new Button(Rect(Vector2i(15+40*2-3 + 20, 0),
Size(34, 34)), "<-."), true);
+ add(rotate_90_button = new Button(Rect(Vector2i(15+40*3-3 + 20, 0),
Size(34, 34)), ".->"), true);
+
flip_vertical_button->on_click.connect(boost::bind(&ObjectProperties::on_flip_vertical,
this));
+
flip_horizontal_button->on_click.connect(boost::bind(&ObjectProperties::on_flip_horizontal,
this));
+
rotate_90_button->on_click.connect(boost::bind(&ObjectProperties::on_rotate_90,
this));
+
rotate_270_button->on_click.connect(boost::bind(&ObjectProperties::on_rotate_270,
this));
+ // ___________________________________________________________________
+ //
set_object(0);
}
@@ -245,6 +257,11 @@
repeat_label->hide();
repeat_inputbox->hide();
+
+ flip_horizontal_button->hide();
+ flip_vertical_button->hide();
+ rotate_90_button->hide();
+ rotate_270_button->hide();
}
void
@@ -361,6 +378,17 @@
pos_z_inputbox->set_text(StringUtil::to_string(obj->get_pos_z()));
place(pos_z_label, pos_z_inputbox);
}
+
+
+ if (attr & CAN_ROTATE)
+ {
+ y_pos += 4;
+ place(flip_horizontal_button);
+ place(flip_vertical_button);
+ place(rotate_90_button);
+ place(rotate_270_button);
+ y_pos += 36;
+ }
}
else
{
@@ -576,6 +604,34 @@
}
void
+ObjectProperties::on_flip_horizontal()
+{
+ for(Objects::iterator i = objects.begin(); i != objects.end(); ++i)
+
(*i)->set_modifier(ResourceModifierNS::horizontal_flip((*i)->get_modifier()));
+}
+
+void
+ObjectProperties::on_flip_vertical()
+{
+ for(Objects::iterator i = objects.begin(); i != objects.end(); ++i)
+
(*i)->set_modifier(ResourceModifierNS::vertical_flip((*i)->get_modifier()));
+}
+
+void
+ObjectProperties::on_rotate_90()
+{
+ for(Objects::iterator i = objects.begin(); i != objects.end(); ++i)
+ (*i)->set_modifier(ResourceModifierNS::rotate_90((*i)->get_modifier()));
+}
+
+void
+ObjectProperties::on_rotate_270()
+{
+ for(Objects::iterator i = objects.begin(); i != objects.end(); ++i)
+ (*i)->set_modifier(ResourceModifierNS::rotate_270((*i)->get_modifier()));
+}
+
+void
ObjectProperties::update_layout()
{
GroupComponent::update_layout();
Modified: trunk/pingus/src/editor/object_properties.hpp
===================================================================
--- trunk/pingus/src/editor/object_properties.hpp 2007-09-29 14:56:19 UTC
(rev 3259)
+++ trunk/pingus/src/editor/object_properties.hpp 2007-09-29 16:17:40 UTC
(rev 3260)
@@ -92,6 +92,11 @@
Label* repeat_label;
Inputbox* repeat_inputbox;
+ Button* flip_horizontal_button;
+ Button* flip_vertical_button;
+ Button* rotate_90_button;
+ Button* rotate_270_button;
+
int y_pos;
public:
@@ -133,6 +138,11 @@
void on_large_stars_change(const std::string& str);
void on_repeat_change(const std::string& str);
+
+ void on_flip_horizontal();
+ void on_flip_vertical();
+ void on_rotate_90();
+ void on_rotate_270();
};
Modified: trunk/pingus/src/editor/panel.cpp
===================================================================
--- trunk/pingus/src/editor/panel.cpp 2007-09-29 14:56:19 UTC (rev 3259)
+++ trunk/pingus/src/editor/panel.cpp 2007-09-29 16:17:40 UTC (rev 3260)
@@ -186,16 +186,21 @@
&EditorScreen::objects_lower);
add_button("core/editor/object-bottom", _("Lower object to bottom") + "
(Shift+[)",
&EditorScreen::objects_lower_to_bottom);
- add_separator();
- add_button("core/editor/object-flip-horizontal", _("Flip object
horizontally") + " (F)",
- &EditorScreen::objects_flip_horizontal);
- add_button("core/editor/object-flip-vertical", _("Flip object vertically") +
" (Shift+F)",
- &EditorScreen::objects_flip_vertical);
- add_separator();
- add_button("core/editor/object-rotate-left", _("Rotate object -90 degree")
+ " (Shift+R)",
- &EditorScreen::objects_rotate_left);
- add_button("core/editor/object-rotate-right", _("Rotate object 90 degree") +
" (R)",
- &EditorScreen::objects_rotate_right);
+
+ if (0)
+ { // rotate and flip are now in the object properties
+ add_separator();
+ add_button("core/editor/object-flip-horizontal", _("Flip object
horizontally") + " (F)",
+ &EditorScreen::objects_flip_horizontal);
+ add_button("core/editor/object-flip-vertical", _("Flip object
vertically") + " (Shift+F)",
+ &EditorScreen::objects_flip_vertical);
+ add_separator();
+ add_button("core/editor/object-rotate-left", _("Rotate object -90
degree") + " (Shift+R)",
+ &EditorScreen::objects_rotate_left);
+ add_button("core/editor/object-rotate-right", _("Rotate object 90
degree") + " (R)",
+ &EditorScreen::objects_rotate_right);
+ }
+
// add_separator();
//add_button("core/editor/snap-grid", "Snap objects to grid",
// &EditorScreen::toggle_grid_snap);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r3260 - in trunk/pingus: . src/editor,
grumbel at BerliOS <=