[Super-tux-commit] supertux/src button.cpp,1.7,1.8 leveleditor.cpp,1.23,1.24
Brought to you by:
wkendrick
From: Tobias Gl??er <to...@us...> - 2004-03-28 01:42:04
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28916/src Modified Files: button.cpp leveleditor.cpp Log Message: improved the behaviour of the mouse-cursor in the leveleditor Index: button.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/button.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- button.cpp 22 Mar 2004 15:52:35 -0000 1.7 +++ button.cpp 28 Mar 2004 01:30:48 -0000 1.8 @@ -148,6 +148,7 @@ if(pbutton->state != BUTTON_PRESSED && pbutton->state != BUTTON_CLICKED) { pbutton->state = BUTTON_HOVER; + mouse_cursor->set_state(MC_LINK); } } else if(event->type != SDL_KEYDOWN && event->type != SDL_KEYUP) Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- leveleditor.cpp 28 Mar 2004 01:00:16 -0000 1.23 +++ leveleditor.cpp 28 Mar 2004 01:30:48 -0000 1.24 @@ -220,7 +220,7 @@ le_quit(); return 1; } - le_update_buttons(le_current_level->theme.c_str()); + le_update_buttons(le_current_level->theme.c_str()); le_set_defaults(); level_load_gfx(le_current_level); show_menu = true; @@ -239,7 +239,7 @@ switch (i = subset_new_menu->check()) { case 3: - st_subset::create(subset_new_menu->item[2].input); + st_subset::create(subset_new_menu->item[2].input); le_level_subset.load(subset_new_menu->item[2].input); leveleditor_menu->item[3].kind = MN_GOTO; le_level = 1; @@ -251,7 +251,7 @@ le_quit(); return 1; } - le_update_buttons(le_current_level->theme.c_str()); + le_update_buttons(le_current_level->theme.c_str()); le_set_defaults(); level_load_gfx(le_current_level); menu_item_change_input(&subset_new_menu->item[2],""); @@ -275,9 +275,10 @@ break; } } - mouse_cursor->draw(); } + mouse_cursor->draw(); + if(done) { le_quit(); @@ -850,9 +851,11 @@ while(SDL_PollEvent(&event)) { - if(show_menu) - menu_event(event); - + if(show_menu) + menu_event(event); + else + mouse_cursor->set_state(MC_NORMAL); + /* testing SDL_KEYDOWN, SDL_KEYUP and SDL_QUIT events*/ if(event.type == SDL_KEYDOWN || ((event.type == SDL_MOUSEBUTTONDOWN || SDL_MOUSEMOTION) && (event.motion.x > 0 && event.motion.x < screen->w - 64 && event.motion.y > 0 && event.motion.y < screen->h))) @@ -1046,8 +1049,8 @@ break; case SDLK_n: d = 1; - break; - default: + break; + default: break; } break; @@ -1292,8 +1295,8 @@ /* if there is a bad guy over there, remove it */ for(i = 0; i < bad_guys.size(); ++i) - if(xx == bad_guys[i].base.x/32 && yy == bad_guys[i].base.y/32) - bad_guys.erase(static_cast<std::vector<BadGuy>::iterator>(&bad_guys[i])); + if(xx == bad_guys[i].base.x/32 && yy == bad_guys[i].base.y/32) + bad_guys.erase(static_cast<std::vector<BadGuy>::iterator>(&bad_guys[i])); if(c == '0') /* if it's a bad guy */ add_bad_guy(xx*32, yy*32, BAD_BSOD); @@ -1332,9 +1335,9 @@ /* if there is a bad guy over there, remove it */ for(i = 0; i < bad_guys.size(); ++i) - if(bad_guys[i].base.x/32 >= x1 && bad_guys[i].base.x/32 <= x2 - && bad_guys[i].base.y/32 >= y1 && bad_guys[i].base.y/32 <= y2) - bad_guys.erase(static_cast<std::vector<BadGuy>::iterator>(&bad_guys[i])); + if(bad_guys[i].base.x/32 >= x1 && bad_guys[i].base.x/32 <= x2 + && bad_guys[i].base.y/32 >= y1 && bad_guys[i].base.y/32 <= y2) + bad_guys.erase(static_cast<std::vector<BadGuy>::iterator>(&bad_guys[i])); for(xx = x1; xx <= x2; xx++) for(yy = y1; yy <= y2; yy++) @@ -1391,12 +1394,12 @@ "settings of your level, including how long it is or what music it will", "play. When you are ready to give your level a test, click on the little", "running Tux. If you like the changes you have made to your level,", - "press the red save key to keep them.", + "press the red save key to keep them.", "To change which level in your subset you are editing, press the white", "up and down arrow keys at the top of the button box.", - "", + "", "Have fun making levels! If you make some good ones, send them to us on", - "the SuperTux mailing list!", + "the SuperTux mailing list!", "- SuperTux team" }; |