]> git.tdb.fi Git - r2c2.git/blobdiff - source/designer/designer.cpp
Be more consistent with the use of name and description
[r2c2.git] / source / designer / designer.cpp
index 4ad5274e1cce7754c9742890b4b26607449f9ef6..744f975799f32c0834457df1104dd4b012e52b24 100644 (file)
@@ -591,7 +591,7 @@ string Designer::tooltip(int x, int y)
        if(Object *obj = pick_object(Vector(x*2.0f/rgeom.w-1.0f, y*2.0f/rgeom.h-1.0f, 0)))
        {
                const ObjectType &otype = obj->get_type();
-               string info = format("%d %s", otype.get_article_number(), otype.get_description());
+               string info = format("%d %s", otype.get_article_number(), otype.get_name());
                if(Track *track = dynamic_cast<Track *>(obj))
                {
                        if(mode!=CATALOGUE && abs(track->get_tilt()).radians()>1e-4)
@@ -601,6 +601,15 @@ string Designer::tooltip(int x, int y)
                        else if(track->get_sensor_address())
                                info += format(" (sensor %d)", track->get_sensor_address());
                }
+               if(mode==CATALOGUE)
+               {
+                       const string &descr = otype.get_description();
+                       if(!descr.empty())
+                       {
+                               info += '\n';
+                               info += otype.get_description();
+                       }
+               }
                return info;
        }