X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/4675818d2893c57a409498cd39dba6f9c18b6fe9..6983220ff84632481c1628720fe15b8f3ac1c9cb:/Constructor/drain.cpp
diff --git a/Constructor/drain.cpp b/Constructor/drain.cpp
index cd4ee57..3625677 100644
--- a/Constructor/drain.cpp
+++ b/Constructor/drain.cpp
@@ -83,6 +83,8 @@ void Drain::on_menu_popup_propiedades()
void Drain::save(FILE *archivo)
{
char c_id[50], c_x[50], c_y[50], c_img[50];
+ Glib::ustring con0;
+ con0 = "\t\t\t"+get_other_name(connect_vec[0].id_dest)+"\n";
sprintf(c_x,"\t\t%d\n",x);
sprintf(c_y,"\t\t%d\n",y);
sprintf(c_id,"%d",ID);
@@ -91,6 +93,7 @@ void Drain::save(FILE *archivo)
dato = "\t\n";
+ dato += "\t\t\n"+con0+"\t\t\n";
dato += c_img;
dato += c_x;
dato += c_y;
@@ -100,21 +103,27 @@ void Drain::save(FILE *archivo)
bool Drain::check_connection()
{
+ CItem *_item0;
ConnectorType temp;
switch (get_img_actual()) {
case 0:
- temp = is_other_connection_area( get_position_x()+16 , get_position_y() -5);
+ temp = is_other_connection_area( get_position_x()+16 , get_position_y() -5,& _item0);
break;
case 1:
- temp = is_other_connection_area( get_position_x()+image->get_width() + 5, get_position_y()+16);
+ temp = is_other_connection_area( get_position_x()+image->get_width() + 5, get_position_y()+16,& _item0);
break;
case 2:
- temp = is_other_connection_area( get_position_x()+16, get_position_y()+image->get_height()+5);
+ temp = is_other_connection_area( get_position_x()+16, get_position_y()+image->get_height()+5, &_item0);
break;
case 3:
- temp = is_other_connection_area( get_position_x()-5, get_position_y()+16);
+ temp = is_other_connection_area( get_position_x()-5, get_position_y()+16,& _item0);
}
- return ( is_connected = (temp == OUT) );
+ if ( is_connected = (temp == OUT) ) {
+ connect_vec[0].id_dest = _item0->get_id();
+ return is_connected;
+ }
+ std::cout<<"conector dest ="<