Ignore:
Timestamp:
11/01/07 19:03:46 (6 years ago)
Author:
guyru
Message:

started dice animation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/OpenYahtzee/src/MainFrame.cpp

    r42 r46  
    5252#define SPACE_SIZE 1 
    5353#define DEF_HIGHSCORESIZE 20 
    54 #define OY_VERSION "1.6.0" 
     54#define OY_VERSION "1.7.0" 
    5555 
    5656MainFrame::MainFrame(const wxString& title, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE) 
     
    6666        m_highscoredb = new HighScoreTableDB(); 
    6767 
    68  
    69         if (m_settingsdb->GetKey("highscoresize") == "") { //check if we need to create a newdatabase 
     68        //DATABASE initialization 
     69        if (m_settingsdb->GetKey("highscoresize") == "") { //check if we need to create a new high score table 
    7070                m_highscoredb->SetSize(DEF_HIGHSCORESIZE); 
    7171                sstr<<DEF_HIGHSCORESIZE<<std::flush; 
     
    7676                m_highscoredb->SetSize(highscoresize); 
    7777        } 
     78         
     79        if (m_settingsdb->GetKey("animate") == "Yes") { 
     80                m_animate = true; 
     81        } else if (m_settingsdb->GetKey("animate") == "No") { 
     82                m_animate = false; 
     83        } else { 
     84                m_settingsdb->SetKey("animate", "Yes"); 
     85                m_animate = true; 
     86        } 
     87 
     88        // END Database initialization 
    7889 
    7990        bitmap_dices[0] = new wxBitmap(one_xpm); 
     
    377388         
    378389        data.highscoresize = m_highscoredb->GetSize(); 
     390 
     391        data.animate = (m_settingsdb->GetKey("animate")=="Yes")?true:false; 
    379392         
    380393        dialog->SetData(data); 
     
    389402                                 
    390403                m_highscoredb->SetSize(data.highscoresize); 
     404                 
     405                if (data.animate){ 
     406                        m_settingsdb->SetKey("animate","Yes"); 
     407                         
     408                } else { 
     409                        m_settingsdb->SetKey("animate","No"); 
     410                } 
     411 
    391412        } 
    392413} 
Note: See TracChangeset for help on using the changeset viewer.