Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6883 in orxonox.OLD for trunk/src/story_entities


Ignore:
Timestamp:
Jan 31, 2006, 2:44:16 AM (19 years ago)
Author:
patrick
Message:

trunk: the menu now works perfectlu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/story_entities/simple_game_menu.cc

    r6878 r6883  
    174174      this->menuStartGame = dynamic_cast<ImageEntity*>(*entity);
    175175      this->menuStartGame->setBindNode((const PNode*)NULL);
    176       this->menuStartGame->setRelCoor2D(State::getResX() / 2.0f, State::getResY() / 2.0f + (this->menuLayer[0]->menuList.size() * 50.0f), 0.0f);
     176      this->menuStartGame->setRelCoor2D(State::getResX() / 2.0f,
     177                                        State::getResY() / 2.0f - 60.0f,
     178                                        0.0f);
    177179      this->menuLayer[0]->menuList.push_back(dynamic_cast<ImageEntity*>(*entity));
    178180
     
    182184      this->menuStartMultiplayerGame = dynamic_cast<ImageEntity*>(*entity);
    183185      this->menuStartMultiplayerGame->setBindNode((const PNode*)NULL);
    184       this->menuStartMultiplayerGame->setRelCoor2D(State::getResX() / 2.0f, State::getResY() / 2.0f + (this->menuLayer[0]->menuList.size() * 50.0f), 0.0f);
     186      this->menuStartMultiplayerGame->setRelCoor2D(State::getResX() / 2.0f,
     187                                                   State::getResY() / 2.0f + ((this->menuLayer[0]->menuList.size() -1 ) * 60.0f),
     188                                                   0.0f);
    185189      this->menuLayer[0]->menuList.push_back(dynamic_cast<ImageEntity*>(*entity));
    186190    }
     
    189193      this->menuQuitGame = dynamic_cast<ImageEntity*>(*entity);
    190194      this->menuQuitGame->setBindNode((const PNode*)NULL);
    191       this->menuQuitGame->setRelCoor2D(State::getResX() / 2.0f, State::getResY() / 2.0f + (this->menuLayer[0]->menuList.size() * 50.0f), 0.0f);
     195      this->menuQuitGame->setRelCoor2D(State::getResX() / 2.0f,
     196                                       State::getResY() / 2.0f + ((this->menuLayer[0]->menuList.size() -1 )* 60.0f),
     197                                       0.0f);
    192198      this->menuLayer[0]->menuList.push_back(dynamic_cast<ImageEntity*>(*entity));
    193199    }
     
    214220      ie->setVisibility(false);
    215221      ie->setBindNode((const PNode*)NULL);
    216       ie->setRelCoor2D(State::getResX() / 2.0f, State::getResY() / 2.0f + (this->menuLayer[1]->menuList.size() * 50.0f), 0.0f);
     222      ie->setRelCoor2D(State::getResX() / 2.0f - 200.0f, State::getResY() / 2.0f + ((this->menuLayer[1]->menuList.size() - 2.0f) * 60.0f), 0.0f);
     223      ie->setSize2D(100.0f, 50.0f);
    217224      this->menuLayer[1]->menuList.push_back(ie);
    218225
     
    220227      ie = new ImageEntity();
    221228      ie->setTexture(se->getMenuScreenshoot());
    222       //ie->setRelCoor(10.0f, 10.0f, 0.0f);
    223229      ie->setVisibility(false);
    224230      ie->setBindNode((const PNode*)NULL);
    225       ie->setRelCoor2D(State::getResX() / 2.0f + 200.0f, State::getResY() / 2.0f, 0.0f);
     231      ie->setRelCoor2D(State::getResX() / 2.0f + 250.0f, State::getResY() / 2.0f, 0.0f);
     232      ie->setSize2D(100.0f, 75.0f);
    226233      this->menuLayer[1]->screenshootList.push_back(ie);
    227234    }
     
    359366      this->menuSelected = this->menuLayer[this->layerIndex]->menuList[++this->menuSelectedIndex];
    360367      this->menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D());
     368
     369      if( this->layerIndex == 1)
     370      {
     371        this->menuLayer[1]->screenshootList[this->menuSelectedIndex]->setVisibility(true);
     372        this->menuLayer[1]->screenshootList[this->menuSelectedIndex-1]->setVisibility(false);
     373      }
    361374    }
    362375  }
     
    367380      this->menuSelected = this->menuLayer[this->layerIndex]->menuList[--this->menuSelectedIndex];
    368381      this->menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D());
     382
     383      if( this->layerIndex == 1)
     384      {
     385        this->menuLayer[1]->screenshootList[this->menuSelectedIndex]->setVisibility(true);
     386        this->menuLayer[1]->screenshootList[this->menuSelectedIndex+1]->setVisibility(false);
     387      }
    369388    }
    370389  }
     
    404423    (*it)->setVisibility(true);
    405424  }
    406     //also fade the screenshots if in level choosement mode
    407   for( it = this->menuLayer[layer1]->screenshootList.begin(); it != this->menuLayer[layer1]->screenshootList.end(); it++)
    408   {
    409     (*it)->setVisibility(true);
    410   }
    411425
    412426
     
    415429  this->menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D());
    416430  this->menuSelectedIndex = 0;
     431
     432  if( layer2 == 1)
     433    this->menuLayer[layer2]->screenshootList[0]->setVisibility(true);
    417434}
    418435
Note: See TracChangeset for help on using the changeset viewer.