Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6878 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Jan 31, 2006, 1:49:04 AM (19 years ago)
Author:
patrick
Message:

trunk: now working with element2d only, game always returns to menu in singleplayer

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r6778 r6878  
    148148
    149149// PNode-style:
    150   LoadParam(root, "rel-coor", this, Element2D, setRelCoor2D)
     150  LoadParam(root, "rel-coor-2d", this, Element2D, setRelCoor2D)
    151151      .describe("Sets The relative position of the Node to its parent.");
    152152
    153   LoadParam(root, "abs-coor", this, Element2D, setAbsCoor2D)
     153  LoadParam(root, "abs-coor-2d", this, Element2D, setAbsCoor2D)
    154154      .describe("Sets The absolute Position of the Node.");
    155155
    156   LoadParam(root, "rel-dir", this, Element2D, setRelDir2D)
     156  LoadParam(root, "rel-dir-2d", this, Element2D, setRelDir2D)
    157157      .describe("Sets The relative rotation of the Node to its parent.");
    158158
    159   LoadParam(root, "abs-dir", this, Element2D, setAbsDir2D)
     159  LoadParam(root, "abs-dir-2d", this, Element2D, setAbsDir2D)
    160160      .describe("Sets The absolute rotation of the Node.");
    161161
  • trunk/src/story_entities/game_world.cc

    r6845 r6878  
    115115      .describe("The Filename of this GameWorld (relative from the data-dir)");
    116116
    117 //   LoadParam(root, "soundtrack", this->dataTank, GameWorldData, setSoundTrack);
    118 
    119117  PRINTF(4)("Loaded GameWorld specific stuff\n");
    120118}
  • trunk/src/story_entities/simple_game_menu.cc

    r6874 r6878  
    6464
    6565  this->loadParams(root);
     66
     67  State::setMenuMode(true);
    6668}
    6769
     
    166168    {
    167169      this->menuSelector = dynamic_cast<ImageEntity*>(*entity);
     170      this->menuSelector->setBindNode((const PNode*)NULL);
    168171    }
    169172    else if( !strcmp( "StartGame_Menu", (*entity)->getName()))
    170173    {
    171174      this->menuStartGame = dynamic_cast<ImageEntity*>(*entity);
     175      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);
    172177      this->menuLayer[0]->menuList.push_back(dynamic_cast<ImageEntity*>(*entity));
    173178
     
    176181    {
    177182      this->menuStartMultiplayerGame = dynamic_cast<ImageEntity*>(*entity);
     183      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);
    178185      this->menuLayer[0]->menuList.push_back(dynamic_cast<ImageEntity*>(*entity));
    179186    }
     
    181188    {
    182189      this->menuQuitGame = dynamic_cast<ImageEntity*>(*entity);
     190      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);
    183192      this->menuLayer[0]->menuList.push_back(dynamic_cast<ImageEntity*>(*entity));
    184193    }
    185194  }
     195  this->menuSelected->getNullElement()->update2D(0.0f);
    186196  this->menuSelectedIndex = 0;
    187197  this->menuSelected = this->menuLayer[0]->menuList[this->menuSelectedIndex];
    188   this->menuSelector->setAbsCoor(this->menuSelected->getAbsCoor());
     198  this->menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D());
    189199
    190200
     
    202212      ImageEntity* ie = new ImageEntity();
    203213      ie->setTexture(se->getMenuItemImage());
    204       ie->setRelCoor(0.0f,20.0f - (this->menuLayer[1]->menuList.size() * 10.0f), 0.0f);
    205214      ie->setVisibility(false);
     215      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);
    206217      this->menuLayer[1]->menuList.push_back(ie);
    207218
    208219      // generating screenshoot item
    209 //       ie = new ImageEntity();
    210 //       ie->setTexture(se->getMenuScreenshoot);
    211 //       ie->setRelCoor(.0f, 10.0f, 0.0f);
    212 //       this->menuLayer[1]->screenshootList.push_back(ie);
    213 
     220      ie = new ImageEntity();
     221      ie->setTexture(se->getMenuScreenshoot());
     222      //ie->setRelCoor(10.0f, 10.0f, 0.0f);
     223      ie->setVisibility(false);
     224      ie->setBindNode((const PNode*)NULL);
     225      ie->setRelCoor2D(State::getResX() / 2.0f + 200.0f, State::getResY() / 2.0f, 0.0f);
     226      this->menuLayer[1]->screenshootList.push_back(ie);
    214227    }
    215228  }
     
    345358    {
    346359      this->menuSelected = this->menuLayer[this->layerIndex]->menuList[++this->menuSelectedIndex];
    347       this->menuSelector->setAbsCoor(this->menuSelected->getAbsCoor());
     360      this->menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D());
    348361    }
    349362  }
     
    353366    {
    354367      this->menuSelected = this->menuLayer[this->layerIndex]->menuList[--this->menuSelectedIndex];
    355       this->menuSelector->setAbsCoor(this->menuSelected->getAbsCoor());
     368      this->menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D());
    356369    }
    357370  }
     
    374387  std::vector<ImageEntity*>::iterator it;
    375388  // fade old menu
    376   for( it = this->menuLayer[layer1]->menuList.begin(); it != this->menuLayer[layer1]->menuList.end(); it++ )
     389  for( it = this->menuLayer[layer1]->menuList.begin(); it != this->menuLayer[layer1]->menuList.end(); it++)
     390  {
     391    (*it)->setVisibility(false);
     392  }
     393  //also fade the screenshots if in level choosement mode
     394  for( it = this->menuLayer[layer1]->screenshootList.begin(); it != this->menuLayer[layer1]->screenshootList.end(); it++)
    377395  {
    378396    (*it)->setVisibility(false);
     
    386404    (*it)->setVisibility(true);
    387405  }
     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  }
     411
    388412
    389413  this->layerIndex = layer2;
    390414  this->menuSelected = this->menuLayer[layer2]->menuList[0];
    391   this->menuSelector->setAbsCoor(this->menuSelected->getAbsCoor());
     415  this->menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D());
    392416  this->menuSelectedIndex = 0;
    393417}
  • trunk/src/story_entities/story_entity.cc

    r6853 r6878  
    4242  this->description = NULL;
    4343  this->menuItemImage = NULL;
     44  this->menuScreenshoot = NULL;
    4445  this->nextStoryID = WORLD_ID_GAMEEND;
    4546  this->bMenuEntry = false;
     
    7778      .describe("If this entry is 1, the world is contained in the SimpleGameMenu");
    7879
    79   LoadParam(root, "menu-screenshoot", this, StoryEntity, setMenuScreenshoot)
     80  LoadParam(root, "screenshoot", this, StoryEntity, setMenuScreenshoot)
    8081      .describe("If this entry is 1, the world is contained in the SimpleGameMenu");
    8182
Note: See TracChangeset for help on using the changeset viewer.