[Super-tux-commit] supertux/src worldmap.cpp,1.68.2.9,1.68.2.10 worldmap.h,1.28.2.7,1.28.2.8
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-07-30 10:55:07
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14207/src Modified Files: Tag: supertux_0_1_1_branch worldmap.cpp worldmap.h Log Message: Let map messages being disabled when the player is coming from a specific direction. For instance, to not show a message when the player comes from left, do: (apply-action-left #f) . It is also possible to have more than one for different directions. Also, you can have to different (level, so that in one it shows a message and from another direction another. Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.68.2.9 retrieving revision 1.68.2.10 diff -u -d -r1.68.2.9 -r1.68.2.10 --- worldmap.cpp 28 Jul 2004 20:40:27 -0000 1.68.2.9 +++ worldmap.cpp 30 Jul 2004 10:54:53 -0000 1.68.2.10 @@ -284,9 +284,16 @@ WorldMap::Level* level = worldmap->at_level(); if(level && level->name.empty() && !level->display_map_message.empty()) - { - worldmap->passive_message = level->display_map_message; - worldmap->passive_message_timer.start(DISPLAY_MAP_MESSAGE_TIME); + { // direction and the apply_action_ are opposites, since they "see" + // directions in a different way + if((direction == D_NORTH && level->apply_action_south) || + (direction == D_SOUTH && level->apply_action_north) || + (direction == D_WEST && level->apply_action_east) || + (direction == D_EAST && level->apply_action_west)) + { + worldmap->passive_message = level->display_map_message; + worldmap->passive_message_timer.start(DISPLAY_MAP_MESSAGE_TIME); + } } if (worldmap->at(tile_pos)->stop || (level && !level->name.empty())) @@ -448,6 +455,13 @@ level.auto_path = true; reader.read_bool("auto-path", &level.auto_path); + level.apply_action_north = level.apply_action_south = + level.apply_action_east = level.apply_action_west = true; + reader.read_bool("apply-action-up", &level.apply_action_north); + reader.read_bool("apply-action-down", &level.apply_action_south); + reader.read_bool("apply-action-left", &level.apply_action_west); + reader.read_bool("apply-action-right", &level.apply_action_east); + if(!level.name.empty()) get_level_title(&level); // get level's title Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.28.2.7 retrieving revision 1.28.2.8 diff -u -d -r1.28.2.7 -r1.28.2.8 --- worldmap.h 28 Jul 2004 20:40:27 -0000 1.28.2.7 +++ worldmap.h 30 Jul 2004 10:54:53 -0000 1.28.2.8 @@ -166,6 +166,12 @@ /** If false, disables the auto walking after finishing a level */ bool auto_path; + /** Only applies actions (ie. map messages) when going to that direction */ + bool apply_action_north; + bool apply_action_east; + bool apply_action_south; + bool apply_action_west; + // Directions which are walkable from this level bool north; bool east; |