--- a/easy3d/easy3d_universe.cpp Wed Jun 11 18:33:06 2008 +0200
+++ b/easy3d/easy3d_universe.cpp Tue Jun 17 12:00:36 2008 +0200
@@ -366,30 +366,55 @@ void SceneUniverse::ManageClick()
Galaxy *galaxy = LoadUniverse::instance()->galaxyVector[mSelectedGalaxy];
- dest[0] *= ratio;
-
- if (galaxy->color)
- {
- mCubeDiffuseDestination = osg::Vec4(*galaxy->color);
- }
+ if (galaxy->planetVector.size() == 1)
+ {
+ EASY3D_ASSERT(mSelectedGalaxy >= 0 && mSelectedGalaxy < (int)LoadUniverse::instance()->galaxyVector.size());
+ Planet* plt = LoadUniverse::instance()->galaxyVector[mSelectedGalaxy]->planetVector[0];
+
+ if (plt->satelliteVector.size() == 1)
+ {
+ // Selected galaxy has only one planet which has only one satellite
+ if (plt->satelliteVector[0]->isGoto())
+ {
+ // Do nothing for the moment
+ }
+ else
+ {
+ // Launch the satellite command
+ AppLaunch::instance()->registerToLaunch(plt->satelliteVector[0]->command_type, plt->satelliteVector[0]->command);
+ pushUserEvent(CUSTOM_EVENT_APPLICATION_START);
+ pushUserEvent(CUSTOM_EVENT_FADEBLACK_IN);
+ }
+ }
+ }
else
- {
- mCubeDiffuseDestination = osg::Vec4(1,1,1,1);
- VarsEditor::instance()->get("galaxy_cube_diffuse_" + galaxy->id, mCubeDiffuseDestination);
- }
-
- osg::Vec3 currentPos = mItems[focus].getRootTransform()->getMatrix().getTrans();
-
- dest = dest-currentPos;
- mItems[focus].setTransitionOutPositionDestination(dest);
-
- // sent events
- Easy3dEvents::pushEventBackgroundFadeTo(galaxy->bg_filename, galaxy->name);
-
- float idle1, idle2;
- idle1 = idle2 = 0;
- mItems[mSelectedGalaxy].getTimeOfIdleAnimation(idle1, idle2);
- Easy3dEvents::pushEventUniverseExitWanted(idle1, idle2, getSelectedGalaxy());
+ {
+
+ dest[0] *= ratio;
+
+ if (galaxy->color)
+ {
+ mCubeDiffuseDestination = osg::Vec4(*galaxy->color);
+ }
+ else
+ {
+ mCubeDiffuseDestination = osg::Vec4(1,1,1,1);
+ VarsEditor::instance()->get("galaxy_cube_diffuse_" + galaxy->id, mCubeDiffuseDestination);
+ }
+
+ osg::Vec3 currentPos = mItems[focus].getRootTransform()->getMatrix().getTrans();
+
+ dest = dest-currentPos;
+ mItems[focus].setTransitionOutPositionDestination(dest);
+
+ // sent events
+ Easy3dEvents::pushEventBackgroundFadeTo(galaxy->bg_filename, galaxy->name);
+
+ float idle1, idle2;
+ idle1 = idle2 = 0;
+ mItems[mSelectedGalaxy].getTimeOfIdleAnimation(idle1, idle2);
+ Easy3dEvents::pushEventUniverseExitWanted(idle1, idle2, getSelectedGalaxy());
+ }
}
void SceneUniverse::handleEvent(std::vector<SDL_Event>& _events)