~ubuntu-branches/ubuntu/saucy/enigma/saucy

« back to all changes in this revision

Viewing changes to src/gui/LevelPackMenu.cc

  • Committer: Package Import Robot
  • Author(s): Erich Schubert
  • Date: 2012-06-19 21:47:22 UTC
  • mfrom: (5.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20120619214722-o8v3jobogn60iw68
Tags: 1.10~~pre-alpha+r2236-1
* New upstream checkout. No release on the horizon, but well playable.
* Acknowledge NMUs. Thank you!
* Drop suggest on enigma-level-previews which are not available for 1.10
* Update policy version, no changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
        0
51
51
    };
52
52
    
53
 
    LevelPackMenu::LevelPackMenu() : packsHList (NULL), groupsVList (NULL),
54
 
            scrollLeft (NULL), scrollRight (NULL), scrollUp (NULL),
55
 
            scrollDown (NULL), isLevelMenuSubmenu (false) {
 
53
    LevelPackMenu::LevelPackMenu() : packsHList (NULL), scrollLeft (NULL), 
 
54
            scrollRight (NULL), scrollUp (NULL), scrollDown (NULL), 
 
55
            groupsVList (NULL), isLevelMenuSubmenu (false) {
56
56
        const video::VMInfo &vminfo = *video::GetInfo();
57
57
        const int vshrink = vminfo.width < 640 ? 1 : 0;
58
58
        vm = vminfo.videomode;
247
247
            }
248
248
        }
249
249
        
250
 
        bool needRightScroll = packCount > nextPack + param[vtt].rows * param[vtt].packcolumns;
251
 
        bool needLeftScroll = nextPack > 0;
 
250
        bool needRightScroll = ((int)packCount > nextPack + param[vtt].rows * param[vtt].packcolumns);
 
251
        bool needLeftScroll = (nextPack > 0);
252
252
 
253
253
        lev::Index::setGroupSelectedColumn(curGroupName, colCurrentIndex);
254
254
        groupLastSelectedIndex[curGroupName] = lev::Index::getCurrentIndex()->getName();
366
366
            invalidate_all();
367
367
        } else if (w == but_level) {
368
368
            LevelMenu m;
369
 
            if (!m.manage() && isLevelMenuSubmenu || m.isMainQuit()) {
 
369
            if ((!m.manage() && isLevelMenuSubmenu) || m.isMainQuit()) {
370
370
                // ESC in LevelMenu in case we are a submenu of LevelMenu or
371
371
                // Main button has been pressed in LevelMenu 
372
372
                Menu::quit();
380
380
            if (ml.isSearchQuit()) {
381
381
                // show search result levelpack
382
382
                LevelMenu ml;
383
 
                if (!ml.manage() && isLevelMenuSubmenu || ml.isMainQuit()) {
 
383
                if ((!ml.manage() && isLevelMenuSubmenu) || ml.isMainQuit()) {
384
384
                    // ESC in LevelMenu in cade we are a submenu of LevelMenu or
385
385
                    // Main button has been pressed in LevelMenu
386
386
                    Menu::quit();
425
425
                m.manage();
426
426
            } else {
427
427
                LevelMenu m;
428
 
                if (!m.manage() && isLevelMenuSubmenu || m.isMainQuit()) {
 
428
                if ((!m.manage() && isLevelMenuSubmenu) || m.isMainQuit()) {
429
429
                    // ESC in LevelMenu in case we are a submenu of LevelMenu or
430
430
                    // Main button has been pressed in LevelMenu
431
431
                    Menu::quit();
456
456
    }
457
457
    
458
458
    void LevelPackMenu::updateHighlight() {
459
 
        for (int i = 0; i < packButtons.size(); i++) {
 
459
        for (unsigned i = 0; i < packButtons.size(); i++) {
460
460
            TextButton * button = packButtons[i];
461
461
            if (button->get_text() == lev::Index::getCurrentIndex()->getName())
462
462
                button->setHighlight(true);
463
463
            else
464
464
                button->setHighlight(false);      
465
465
        }
466
 
        for (int i = 0; i < groupButtons.size(); i++) {
 
466
        for (unsigned i = 0; i < groupButtons.size(); i++) {
467
467
            TextButton * button = groupButtons[i];
468
468
            if (button->get_text() == lev::Index::getCurrentGroup())
469
469
                button->setHighlight(true);