Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8011 in orxonox.OLD for branches/gui


Ignore:
Timestamp:
May 31, 2006, 2:12:33 AM (18 years ago)
Author:
bensch
Message:

gui: nicer, better ImageViewer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/story_entities/simple_game_menu.cc

    r8010 r8011  
    119119
    120120    image = new OrxGui::GLGuiImage();
    121     image->show();
    122     image->loadImageFromFile( "death_screen.png" );
    123121    image->setWidgetSize(200, 200);
    124122    image->setAbsCoor2D(300, 300);
     
    130128    OrxGui::GLGuiSlider* slider = new OrxGui::GLGuiSlider();
    131129    slider->connect(SIGNAL(slider, valueChanged), this, SLOT(SimpleGameMenu, setImage));
    132 
     130    slider->setWidgetSize(200, 30);
    133131    slider->setRange(0, 100);
    134     slider->setStep(50);
     132    slider->setStep(1);
    135133    slider->setValue(slider->min());
    136134    imageSelector->pack(slider);
     
    149147  const std::list<BaseObject*>* textures = ClassList::getList(CL_TEXTURE);
    150148
    151   if(textures && textures->size() > i)
     149  if(textures)
    152150  {
    153151    std::list<BaseObject*>::const_iterator test = textures->begin();
    154     while (--i > 0)
    155     {
     152    std::list<BaseObject*>::const_iterator lastOK = textures->begin();
     153    while (true)
     154    {
     155      if (--i == 0 || test == textures->end())
     156        break;
     157      if (dynamic_cast<Texture*>(*test)->getTexture() != 0)
     158        lastOK = test;
    156159      test++;
    157160    }
    158     this->image->loadImageFromTexture(*dynamic_cast<Texture*>(*test));
    159     this->imageName->setText((*test)->getName());
     161    this->image->loadImageFromTexture(*dynamic_cast<Texture*>(*lastOK));
     162    this->imageName->setText((*lastOK)->getName());
    160163  }
    161164}
Note: See TracChangeset for help on using the changeset viewer.