From 57b727f68d41dff5731010952c4308dfadbdfd74 Mon Sep 17 00:00:00 2001 From: auria Date: Thu, 26 Jan 2012 19:12:48 +0000 Subject: [PATCH] Big overhaul of challenges. Bumped challenge XML file format to version 2.0. Now each challenge file speficies 3 difficulty levels. Started adapting unlock manager for these changes. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10727 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- CMakeLists.txt | 2 +- data/challenges/alltracks.challenge | 17 -- data/challenges/atworldsend.challenge | 19 -- data/challenges/city.challenge | 18 ++ data/challenges/crescentcrossing.challenge | 19 -- data/challenges/farm.challenge | 18 ++ data/challenges/followtheleader.challenge | 16 -- data/challenges/fortmagma.challenge | 34 +-- data/challenges/gnu.challenge | 18 -- data/challenges/hacienda.challenge | 33 +-- data/challenges/island.challenge | 17 -- data/challenges/islandtrack.challenge | 19 ++ data/challenges/jungle.challenge | 18 ++ data/challenges/lighthouse.challenge | 34 +-- data/challenges/mines.challenge | 35 ++- data/challenges/minigolf.challenge | 34 +-- data/challenges/olivermath.challenge | 19 ++ data/challenges/sandtrack.challenge | 18 ++ data/challenges/scotland.challenge | 18 ++ data/challenges/skyline.challenge | 18 -- data/challenges/snagdrive.challenge | 17 -- data/challenges/snowmountain.challenge | 18 ++ data/challenges/snowpeak.challenge | 18 ++ data/challenges/startrack.challenge | 18 ++ data/challenges/subsea.challenge | 18 ++ data/challenges/tollway.challenge | 18 -- data/challenges/tothemoonandback.challenge | 19 -- data/challenges/tuxtollway.challenge | 18 ++ data/challenges/xr591.challenge | 32 +-- data/challenges/zengarden.challenge | 18 ++ src/challenges/challenge.cpp | 3 +- src/challenges/challenge_data.cpp | 199 +++++++++-------- src/challenges/challenge_data.hpp | 60 ++---- src/challenges/game_slot.cpp | 29 +-- src/challenges/unlock_manager.cpp | 2 +- .../Xcode/STK_XCode.xcodeproj/project.pbxproj | 6 - src/modes/overworld.cpp | 3 +- src/race/race_manager.hpp | 2 + src/states_screens/challenges.cpp | 204 ------------------ src/states_screens/challenges.hpp | 58 ----- 40 files changed, 483 insertions(+), 701 deletions(-) delete mode 100644 data/challenges/alltracks.challenge delete mode 100644 data/challenges/atworldsend.challenge create mode 100644 data/challenges/city.challenge delete mode 100644 data/challenges/crescentcrossing.challenge create mode 100644 data/challenges/farm.challenge delete mode 100644 data/challenges/followtheleader.challenge delete mode 100644 data/challenges/gnu.challenge delete mode 100644 data/challenges/island.challenge create mode 100644 data/challenges/islandtrack.challenge create mode 100644 data/challenges/jungle.challenge create mode 100644 data/challenges/olivermath.challenge create mode 100644 data/challenges/sandtrack.challenge create mode 100644 data/challenges/scotland.challenge delete mode 100644 data/challenges/skyline.challenge delete mode 100644 data/challenges/snagdrive.challenge create mode 100644 data/challenges/snowmountain.challenge create mode 100644 data/challenges/snowpeak.challenge create mode 100644 data/challenges/startrack.challenge create mode 100644 data/challenges/subsea.challenge delete mode 100644 data/challenges/tollway.challenge delete mode 100644 data/challenges/tothemoonandback.challenge create mode 100644 data/challenges/tuxtollway.challenge create mode 100644 data/challenges/zengarden.challenge delete mode 100644 src/states_screens/challenges.cpp delete mode 100644 src/states_screens/challenges.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 659afade2..a1b305ba4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,7 +193,7 @@ else() message("-- Font tool deactivated, the font tool won't be built (only useful for developers)") endif() -set( SRCS ${SRCS} src/addons/addon.cpp src/addons/addon.hpp src/addons/addons_manager.cpp src/addons/addons_manager.hpp src/addons/dummy_network_http.hpp src/addons/inetwork_http.hpp src/addons/network_http.cpp src/addons/network_http.hpp src/addons/news_manager.cpp src/addons/news_manager.hpp src/addons/request.cpp src/addons/request.hpp src/addons/zip.cpp src/addons/zip.hpp src/animations/animation_base.cpp src/animations/animation_base.hpp src/animations/billboard_animation.cpp src/animations/billboard_animation.hpp src/animations/ipo.cpp src/animations/ipo.hpp src/animations/three_d_animation.cpp src/animations/three_d_animation.hpp src/audio/dummy_sfx.hpp src/audio/music.hpp src/audio/music_dummy.hpp src/audio/music_information.cpp src/audio/music_information.hpp src/audio/music_manager.cpp src/audio/music_manager.hpp src/audio/music_ogg.cpp src/audio/music_ogg.hpp src/audio/sfx_base.hpp src/audio/sfx_buffer.cpp src/audio/sfx_buffer.hpp src/audio/sfx_manager.cpp src/audio/sfx_manager.hpp src/audio/sfx_openal.cpp src/audio/sfx_openal.hpp src/challenges/challenge.cpp src/challenges/challenge.hpp src/challenges/challenge_data.cpp src/challenges/challenge_data.hpp src/challenges/game_slot.cpp src/challenges/game_slot.hpp src/challenges/unlock_manager.cpp src/challenges/unlock_manager.hpp src/config/device_config.cpp src/config/device_config.hpp src/config/player.hpp src/config/stk_config.cpp src/config/stk_config.hpp src/config/user_config.cpp src/config/user_config.hpp src/enet/callbacks.c src/enet/compress.c src/enet/host.c src/enet/include/enet/callbacks.h src/enet/include/enet/enet.h src/enet/include/enet/list.h src/enet/include/enet/protocol.h src/enet/include/enet/time.h src/enet/include/enet/types.h src/enet/include/enet/unix.h src/enet/include/enet/utility.h src/enet/include/enet/win32.h src/enet/list.c src/enet/packet.c src/enet/peer.c src/enet/protocol.c src/enet/unix.c src/enet/win32.c src/graphics/camera.cpp src/graphics/camera.hpp src/graphics/CBatchingMesh.cpp src/graphics/CBatchingMesh.hpp src/graphics/explosion.cpp src/graphics/explosion.hpp src/graphics/hardware_skinning.cpp src/graphics/hardware_skinning.hpp src/graphics/hit_effect.hpp src/graphics/hit_sfx.cpp src/graphics/hit_sfx.hpp src/graphics/irr_driver.cpp src/graphics/irr_driver.hpp src/graphics/lod_node.cpp src/graphics/lod_node.hpp src/graphics/material.cpp src/graphics/material.hpp src/graphics/material_manager.cpp src/graphics/material_manager.hpp src/graphics/mesh_tools.cpp src/graphics/mesh_tools.hpp src/graphics/moving_texture.cpp src/graphics/moving_texture.hpp src/graphics/particle_emitter.cpp src/graphics/particle_emitter.hpp src/graphics/particle_kind.cpp src/graphics/particle_kind.hpp src/graphics/particle_kind_manager.cpp src/graphics/particle_kind_manager.hpp src/graphics/per_camera_node.cpp src/graphics/per_camera_node.hpp src/graphics/post_processing.cpp src/graphics/post_processing.hpp src/graphics/rain.cpp src/graphics/rain.hpp src/graphics/referee.cpp src/graphics/referee.hpp src/graphics/shadow.cpp src/graphics/shadow.hpp src/graphics/skid_marks.cpp src/graphics/skid_marks.hpp src/graphics/slip_stream.cpp src/graphics/slip_stream.hpp src/graphics/stars.cpp src/graphics/stars.hpp src/guiengine/abstract_state_manager.cpp src/guiengine/abstract_state_manager.hpp src/guiengine/abstract_top_level_container.cpp src/guiengine/abstract_top_level_container.hpp src/guiengine/CGUISpriteBank.cpp src/guiengine/CGUISpriteBank.h src/guiengine/engine.cpp src/guiengine/engine.hpp src/guiengine/event_handler.cpp src/guiengine/event_handler.hpp src/guiengine/layout_manager.cpp src/guiengine/layout_manager.hpp src/guiengine/modaldialog.cpp src/guiengine/modaldialog.hpp src/guiengine/scalable_font.cpp src/guiengine/scalable_font.hpp src/guiengine/screen.cpp src/guiengine/screen.hpp src/guiengine/screen_loader.cpp src/guiengine/skin.cpp src/guiengine/skin.hpp src/guiengine/widget.cpp src/guiengine/widget.hpp src/guiengine/widgets/bubble_widget.cpp src/guiengine/widgets/bubble_widget.hpp src/guiengine/widgets/button_widget.cpp src/guiengine/widgets/button_widget.hpp src/guiengine/widgets/CGUIEditBox.cpp src/guiengine/widgets/CGUIEditBox.h src/guiengine/widgets/check_box_widget.cpp src/guiengine/widgets/check_box_widget.hpp src/guiengine/widgets/dynamic_ribbon_widget.cpp src/guiengine/widgets/dynamic_ribbon_widget.hpp src/guiengine/widgets/icon_button_widget.cpp src/guiengine/widgets/icon_button_widget.hpp src/guiengine/widgets/label_widget.cpp src/guiengine/widgets/label_widget.hpp src/guiengine/widgets/list_widget.cpp src/guiengine/widgets/list_widget.hpp src/guiengine/widgets/model_view_widget.cpp src/guiengine/widgets/model_view_widget.hpp src/guiengine/widgets/progress_bar_widget.cpp src/guiengine/widgets/progress_bar_widget.hpp src/guiengine/widgets/ribbon_widget.cpp src/guiengine/widgets/ribbon_widget.hpp src/guiengine/widgets/spinner_widget.cpp src/guiengine/widgets/spinner_widget.hpp src/guiengine/widgets/text_box_widget.cpp src/guiengine/widgets/text_box_widget.hpp src/guiengine/widgets.hpp src/input/binding.cpp src/input/binding.hpp src/input/device_manager.cpp src/input/device_manager.hpp src/input/input.hpp src/input/input_device.cpp src/input/input_device.hpp src/input/input_manager.cpp src/input/input_manager.hpp src/input/wiimote_manager.cpp src/input/wiimote_manager.hpp src/io/file_manager.cpp src/io/file_manager.hpp src/io/xml_node.cpp src/io/xml_node.hpp src/io/xml_writer.cpp src/io/xml_writer.hpp src/items/attachment.cpp src/items/attachment.hpp src/items/attachment_manager.cpp src/items/attachment_manager.hpp src/items/attachment_plugin.hpp src/items/bowling.cpp src/items/bowling.hpp src/items/cake.cpp src/items/cake.hpp src/items/flyable.cpp src/items/flyable.hpp src/items/item.cpp src/items/item.hpp src/items/item_manager.cpp src/items/item_manager.hpp src/items/plunger.cpp src/items/plunger.hpp src/items/powerup.cpp src/items/powerup.hpp src/items/powerup_manager.cpp src/items/powerup_manager.hpp src/items/projectile_manager.cpp src/items/projectile_manager.hpp src/items/rubber_ball.cpp src/items/rubber_ball.hpp src/items/rubber_band.cpp src/items/rubber_band.hpp src/items/swatter.cpp src/items/swatter.hpp src/karts/controller/ai_base_controller.cpp src/karts/controller/ai_base_controller.hpp src/karts/controller/controller.cpp src/karts/controller/controller.hpp src/karts/controller/default_ai_controller.cpp src/karts/controller/default_ai_controller.hpp src/karts/controller/end_controller.cpp src/karts/controller/end_controller.hpp src/karts/controller/kart_control.hpp src/karts/controller/new_ai_controller.cpp src/karts/controller/new_ai_controller.hpp src/karts/controller/player_controller.cpp src/karts/controller/player_controller.hpp src/karts/emergency_animation.cpp src/karts/emergency_animation.hpp src/karts/kart.cpp src/karts/kart.hpp src/karts/kart_model.cpp src/karts/kart_model.hpp src/karts/kart_properties.cpp src/karts/kart_properties.hpp src/karts/kart_properties_manager.cpp src/karts/kart_properties_manager.hpp src/karts/kart_with_stats.cpp src/karts/kart_with_stats.hpp src/karts/max_speed.cpp src/karts/max_speed.hpp src/karts/moveable.cpp src/karts/moveable.hpp src/main.cpp src/main_loop.cpp src/main_loop.hpp src/modes/follow_the_leader.cpp src/modes/follow_the_leader.hpp src/modes/game_tutorial.cpp src/modes/game_tutorial.hpp src/modes/linear_world.cpp src/modes/linear_world.hpp src/modes/overworld.cpp src/modes/overworld.hpp src/modes/profile_world.cpp src/modes/profile_world.hpp src/modes/standard_race.cpp src/modes/standard_race.hpp src/modes/three_strikes_battle.cpp src/modes/three_strikes_battle.hpp src/modes/tutorial_race.cpp src/modes/tutorial_race.hpp src/modes/world.cpp src/modes/world.hpp src/modes/world_status.cpp src/modes/world_status.hpp src/modes/world_with_rank.cpp src/modes/world_with_rank.hpp src/network/character_confirm_message.hpp src/network/character_info_message.hpp src/network/character_selected_message.hpp src/network/connect_message.cpp src/network/connect_message.hpp src/network/flyable_info.hpp src/network/item_info.hpp src/network/kart_control_message.cpp src/network/kart_control_message.hpp src/network/kart_update_message.cpp src/network/kart_update_message.hpp src/network/message.cpp src/network/message.hpp src/network/network_kart.cpp src/network/network_kart.hpp src/network/network_manager.cpp src/network/network_manager.hpp src/network/num_players_message.hpp src/network/race_info_message.cpp src/network/race_info_message.hpp src/network/race_result_ack_message.hpp src/network/race_result_message.cpp src/network/race_result_message.hpp src/network/race_start_message.hpp src/network/race_state.cpp src/network/race_state.hpp src/network/remote_kart_info.hpp src/network/world_loaded_message.hpp src/physics/btKart.cpp src/physics/btKart.hpp src/physics/btKartRaycast.cpp src/physics/btKartRaycast.hpp src/physics/btUprightConstraint.cpp src/physics/btUprightConstraint.hpp src/physics/irr_debug_drawer.cpp src/physics/irr_debug_drawer.hpp src/physics/kart_motion_state.hpp src/physics/physical_object.cpp src/physics/physical_object.hpp src/physics/physics.cpp src/physics/physics.hpp src/physics/stk_dynamics_world.hpp src/physics/triangle_mesh.cpp src/physics/triangle_mesh.hpp src/physics/user_pointer.hpp src/race/grand_prix_data.cpp src/race/grand_prix_data.hpp src/race/grand_prix_manager.cpp src/race/grand_prix_manager.hpp src/race/highscore_manager.cpp src/race/highscore_manager.hpp src/race/highscores.cpp src/race/highscores.hpp src/race/history.cpp src/race/history.hpp src/race/race_manager.cpp src/race/race_manager.hpp src/replay/replay_base.cpp src/replay/replay_base.hpp src/replay/replay_buffer_tpl.hpp src/replay/replay_buffers.cpp src/replay/replay_buffers.hpp src/replay/replay_player.cpp src/replay/replay_player.hpp src/replay/replay_recorder.cpp src/replay/replay_recorder.hpp src/states_screens/addons_screen.cpp src/states_screens/addons_screen.hpp src/states_screens/arenas_screen.cpp src/states_screens/arenas_screen.hpp src/states_screens/challenges.cpp src/states_screens/challenges.hpp src/states_screens/credits.cpp src/states_screens/credits.hpp src/states_screens/dialogs/add_device_dialog.cpp src/states_screens/dialogs/add_device_dialog.hpp src/states_screens/dialogs/addons_loading.cpp src/states_screens/dialogs/addons_loading.hpp src/states_screens/dialogs/confirm_resolution_dialog.cpp src/states_screens/dialogs/confirm_resolution_dialog.hpp src/states_screens/dialogs/custom_video_settings.cpp src/states_screens/dialogs/custom_video_settings.hpp src/states_screens/dialogs/enter_player_name_dialog.cpp src/states_screens/dialogs/enter_player_name_dialog.hpp src/states_screens/dialogs/gp_info_dialog.cpp src/states_screens/dialogs/gp_info_dialog.hpp src/states_screens/dialogs/message_dialog.cpp src/states_screens/dialogs/message_dialog.hpp src/states_screens/dialogs/player_info_dialog.cpp src/states_screens/dialogs/player_info_dialog.hpp src/states_screens/dialogs/press_a_key_dialog.cpp src/states_screens/dialogs/press_a_key_dialog.hpp src/states_screens/dialogs/race_over_dialog.cpp src/states_screens/dialogs/race_over_dialog.hpp src/states_screens/dialogs/race_paused_dialog.cpp src/states_screens/dialogs/race_paused_dialog.hpp src/states_screens/dialogs/story_mode_new.cpp src/states_screens/dialogs/story_mode_new.hpp src/states_screens/dialogs/track_info_dialog.cpp src/states_screens/dialogs/track_info_dialog.hpp src/states_screens/feature_unlocked.cpp src/states_screens/feature_unlocked.hpp src/states_screens/grand_prix_lose.cpp src/states_screens/grand_prix_lose.hpp src/states_screens/grand_prix_win.cpp src/states_screens/grand_prix_win.hpp src/states_screens/help_screen_1.cpp src/states_screens/help_screen_1.hpp src/states_screens/help_screen_2.cpp src/states_screens/help_screen_2.hpp src/states_screens/help_screen_3.cpp src/states_screens/help_screen_3.hpp src/states_screens/help_screen_4.cpp src/states_screens/help_screen_4.hpp src/states_screens/kart_selection.cpp src/states_screens/kart_selection.hpp src/states_screens/main_menu_screen.cpp src/states_screens/main_menu_screen.hpp src/states_screens/minimal_race_gui.cpp src/states_screens/minimal_race_gui.hpp src/states_screens/options_screen_audio.cpp src/states_screens/options_screen_audio.hpp src/states_screens/options_screen_input.cpp src/states_screens/options_screen_input.hpp src/states_screens/options_screen_input2.cpp src/states_screens/options_screen_input2.hpp src/states_screens/options_screen_players.cpp src/states_screens/options_screen_players.hpp src/states_screens/options_screen_ui.cpp src/states_screens/options_screen_ui.hpp src/states_screens/options_screen_video.cpp src/states_screens/options_screen_video.hpp src/states_screens/race_gui.cpp src/states_screens/race_gui.hpp src/states_screens/race_gui_base.cpp src/states_screens/race_gui_base.hpp src/states_screens/race_gui_overworld.cpp src/states_screens/race_gui_overworld.hpp src/states_screens/race_result_gui.cpp src/states_screens/race_result_gui.hpp src/states_screens/race_setup_screen.cpp src/states_screens/race_setup_screen.hpp src/states_screens/state_manager.cpp src/states_screens/state_manager.hpp src/states_screens/story_mode_lobby.cpp src/states_screens/story_mode_lobby.hpp src/states_screens/tracks_screen.cpp src/states_screens/tracks_screen.hpp src/states_screens/tutorial_screen.cpp src/states_screens/tutorial_screen.hpp src/tinygettext/dictionary.cpp src/tinygettext/dictionary.hpp src/tinygettext/dictionary_manager.cpp src/tinygettext/dictionary_manager.hpp src/tinygettext/file_system.hpp src/tinygettext/iconv.cpp src/tinygettext/iconv.hpp src/tinygettext/language.cpp src/tinygettext/language.hpp src/tinygettext/log.cpp src/tinygettext/log.hpp src/tinygettext/log_stream.hpp src/tinygettext/plural_forms.cpp src/tinygettext/plural_forms.hpp src/tinygettext/po_parser.cpp src/tinygettext/po_parser.hpp src/tinygettext/stk_file_system.cpp src/tinygettext/stk_file_system.hpp src/tinygettext/tinygettext.cpp src/tinygettext/tinygettext.hpp src/tracks/ambient_light_sphere.cpp src/tracks/ambient_light_sphere.hpp src/tracks/bezier_curve.cpp src/tracks/bezier_curve.hpp src/tracks/check_lap.cpp src/tracks/check_lap.hpp src/tracks/check_line.cpp src/tracks/check_line.hpp src/tracks/check_manager.cpp src/tracks/check_manager.hpp src/tracks/check_sphere.cpp src/tracks/check_sphere.hpp src/tracks/check_structure.cpp src/tracks/check_structure.hpp src/tracks/graph_node.cpp src/tracks/graph_node.hpp src/tracks/lod_node_loader.cpp src/tracks/lod_node_loader.hpp src/tracks/quad.cpp src/tracks/quad.hpp src/tracks/quad_graph.cpp src/tracks/quad_graph.hpp src/tracks/quad_set.cpp src/tracks/quad_set.hpp src/tracks/terrain_info.cpp src/tracks/terrain_info.hpp src/tracks/track.cpp src/tracks/track.hpp src/tracks/track_manager.cpp src/tracks/track_manager.hpp src/tracks/track_object.cpp src/tracks/track_object.hpp src/tracks/track_object_manager.cpp src/tracks/track_object_manager.hpp src/tracks/track_sector.cpp src/tracks/track_sector.hpp src/tutorial/tutorial.cpp src/tutorial/tutorial.hpp src/tutorial/tutorial_data.cpp src/tutorial/tutorial_data.hpp src/tutorial/tutorial_manager.cpp src/tutorial/tutorial_manager.hpp src/utils/aligned_array.hpp src/utils/constants.cpp src/utils/constants.hpp src/utils/leak_check.cpp src/utils/leak_check.hpp src/utils/no_copy.hpp src/utils/profiler.cpp src/utils/profiler.hpp src/utils/ptr_vector.hpp src/utils/random_generator.cpp src/utils/random_generator.hpp src/utils/string_utils.cpp src/utils/string_utils.hpp src/utils/synchronised.hpp src/utils/time.hpp src/utils/translation.cpp src/utils/translation.hpp src/utils/utf8/checked.h src/utils/utf8/core.h src/utils/utf8/unchecked.h src/utils/utf8.h src/utils/vec3.cpp src/utils/vec3.hpp) +set( SRCS ${SRCS} src/addons/addon.cpp src/addons/addon.hpp src/addons/addons_manager.cpp src/addons/addons_manager.hpp src/addons/dummy_network_http.hpp src/addons/inetwork_http.hpp src/addons/network_http.cpp src/addons/network_http.hpp src/addons/news_manager.cpp src/addons/news_manager.hpp src/addons/request.cpp src/addons/request.hpp src/addons/zip.cpp src/addons/zip.hpp src/animations/animation_base.cpp src/animations/animation_base.hpp src/animations/billboard_animation.cpp src/animations/billboard_animation.hpp src/animations/ipo.cpp src/animations/ipo.hpp src/animations/three_d_animation.cpp src/animations/three_d_animation.hpp src/audio/dummy_sfx.hpp src/audio/music.hpp src/audio/music_dummy.hpp src/audio/music_information.cpp src/audio/music_information.hpp src/audio/music_manager.cpp src/audio/music_manager.hpp src/audio/music_ogg.cpp src/audio/music_ogg.hpp src/audio/sfx_base.hpp src/audio/sfx_buffer.cpp src/audio/sfx_buffer.hpp src/audio/sfx_manager.cpp src/audio/sfx_manager.hpp src/audio/sfx_openal.cpp src/audio/sfx_openal.hpp src/challenges/challenge.cpp src/challenges/challenge.hpp src/challenges/challenge_data.cpp src/challenges/challenge_data.hpp src/challenges/game_slot.cpp src/challenges/game_slot.hpp src/challenges/unlock_manager.cpp src/challenges/unlock_manager.hpp src/config/device_config.cpp src/config/device_config.hpp src/config/player.hpp src/config/stk_config.cpp src/config/stk_config.hpp src/config/user_config.cpp src/config/user_config.hpp src/enet/callbacks.c src/enet/compress.c src/enet/host.c src/enet/include/enet/callbacks.h src/enet/include/enet/enet.h src/enet/include/enet/list.h src/enet/include/enet/protocol.h src/enet/include/enet/time.h src/enet/include/enet/types.h src/enet/include/enet/unix.h src/enet/include/enet/utility.h src/enet/include/enet/win32.h src/enet/list.c src/enet/packet.c src/enet/peer.c src/enet/protocol.c src/enet/unix.c src/enet/win32.c src/graphics/camera.cpp src/graphics/camera.hpp src/graphics/CBatchingMesh.cpp src/graphics/CBatchingMesh.hpp src/graphics/explosion.cpp src/graphics/explosion.hpp src/graphics/hardware_skinning.cpp src/graphics/hardware_skinning.hpp src/graphics/hit_effect.hpp src/graphics/hit_sfx.cpp src/graphics/hit_sfx.hpp src/graphics/irr_driver.cpp src/graphics/irr_driver.hpp src/graphics/lod_node.cpp src/graphics/lod_node.hpp src/graphics/material.cpp src/graphics/material.hpp src/graphics/material_manager.cpp src/graphics/material_manager.hpp src/graphics/mesh_tools.cpp src/graphics/mesh_tools.hpp src/graphics/moving_texture.cpp src/graphics/moving_texture.hpp src/graphics/particle_emitter.cpp src/graphics/particle_emitter.hpp src/graphics/particle_kind.cpp src/graphics/particle_kind.hpp src/graphics/particle_kind_manager.cpp src/graphics/particle_kind_manager.hpp src/graphics/per_camera_node.cpp src/graphics/per_camera_node.hpp src/graphics/post_processing.cpp src/graphics/post_processing.hpp src/graphics/rain.cpp src/graphics/rain.hpp src/graphics/referee.cpp src/graphics/referee.hpp src/graphics/shadow.cpp src/graphics/shadow.hpp src/graphics/skid_marks.cpp src/graphics/skid_marks.hpp src/graphics/slip_stream.cpp src/graphics/slip_stream.hpp src/graphics/stars.cpp src/graphics/stars.hpp src/guiengine/abstract_state_manager.cpp src/guiengine/abstract_state_manager.hpp src/guiengine/abstract_top_level_container.cpp src/guiengine/abstract_top_level_container.hpp src/guiengine/CGUISpriteBank.cpp src/guiengine/CGUISpriteBank.h src/guiengine/engine.cpp src/guiengine/engine.hpp src/guiengine/event_handler.cpp src/guiengine/event_handler.hpp src/guiengine/layout_manager.cpp src/guiengine/layout_manager.hpp src/guiengine/modaldialog.cpp src/guiengine/modaldialog.hpp src/guiengine/scalable_font.cpp src/guiengine/scalable_font.hpp src/guiengine/screen.cpp src/guiengine/screen.hpp src/guiengine/screen_loader.cpp src/guiengine/skin.cpp src/guiengine/skin.hpp src/guiengine/widget.cpp src/guiengine/widget.hpp src/guiengine/widgets/bubble_widget.cpp src/guiengine/widgets/bubble_widget.hpp src/guiengine/widgets/button_widget.cpp src/guiengine/widgets/button_widget.hpp src/guiengine/widgets/CGUIEditBox.cpp src/guiengine/widgets/CGUIEditBox.h src/guiengine/widgets/check_box_widget.cpp src/guiengine/widgets/check_box_widget.hpp src/guiengine/widgets/dynamic_ribbon_widget.cpp src/guiengine/widgets/dynamic_ribbon_widget.hpp src/guiengine/widgets/icon_button_widget.cpp src/guiengine/widgets/icon_button_widget.hpp src/guiengine/widgets/label_widget.cpp src/guiengine/widgets/label_widget.hpp src/guiengine/widgets/list_widget.cpp src/guiengine/widgets/list_widget.hpp src/guiengine/widgets/model_view_widget.cpp src/guiengine/widgets/model_view_widget.hpp src/guiengine/widgets/progress_bar_widget.cpp src/guiengine/widgets/progress_bar_widget.hpp src/guiengine/widgets/ribbon_widget.cpp src/guiengine/widgets/ribbon_widget.hpp src/guiengine/widgets/spinner_widget.cpp src/guiengine/widgets/spinner_widget.hpp src/guiengine/widgets/text_box_widget.cpp src/guiengine/widgets/text_box_widget.hpp src/guiengine/widgets.hpp src/input/binding.cpp src/input/binding.hpp src/input/device_manager.cpp src/input/device_manager.hpp src/input/input.hpp src/input/input_device.cpp src/input/input_device.hpp src/input/input_manager.cpp src/input/input_manager.hpp src/input/wiimote_manager.cpp src/input/wiimote_manager.hpp src/io/file_manager.cpp src/io/file_manager.hpp src/io/xml_node.cpp src/io/xml_node.hpp src/io/xml_writer.cpp src/io/xml_writer.hpp src/items/attachment.cpp src/items/attachment.hpp src/items/attachment_manager.cpp src/items/attachment_manager.hpp src/items/attachment_plugin.hpp src/items/bowling.cpp src/items/bowling.hpp src/items/cake.cpp src/items/cake.hpp src/items/flyable.cpp src/items/flyable.hpp src/items/item.cpp src/items/item.hpp src/items/item_manager.cpp src/items/item_manager.hpp src/items/plunger.cpp src/items/plunger.hpp src/items/powerup.cpp src/items/powerup.hpp src/items/powerup_manager.cpp src/items/powerup_manager.hpp src/items/projectile_manager.cpp src/items/projectile_manager.hpp src/items/rubber_ball.cpp src/items/rubber_ball.hpp src/items/rubber_band.cpp src/items/rubber_band.hpp src/items/swatter.cpp src/items/swatter.hpp src/karts/controller/ai_base_controller.cpp src/karts/controller/ai_base_controller.hpp src/karts/controller/controller.cpp src/karts/controller/controller.hpp src/karts/controller/default_ai_controller.cpp src/karts/controller/default_ai_controller.hpp src/karts/controller/end_controller.cpp src/karts/controller/end_controller.hpp src/karts/controller/kart_control.hpp src/karts/controller/new_ai_controller.cpp src/karts/controller/new_ai_controller.hpp src/karts/controller/player_controller.cpp src/karts/controller/player_controller.hpp src/karts/emergency_animation.cpp src/karts/emergency_animation.hpp src/karts/kart.cpp src/karts/kart.hpp src/karts/kart_model.cpp src/karts/kart_model.hpp src/karts/kart_properties.cpp src/karts/kart_properties.hpp src/karts/kart_properties_manager.cpp src/karts/kart_properties_manager.hpp src/karts/kart_with_stats.cpp src/karts/kart_with_stats.hpp src/karts/max_speed.cpp src/karts/max_speed.hpp src/karts/moveable.cpp src/karts/moveable.hpp src/main.cpp src/main_loop.cpp src/main_loop.hpp src/modes/follow_the_leader.cpp src/modes/follow_the_leader.hpp src/modes/game_tutorial.cpp src/modes/game_tutorial.hpp src/modes/linear_world.cpp src/modes/linear_world.hpp src/modes/overworld.cpp src/modes/overworld.hpp src/modes/profile_world.cpp src/modes/profile_world.hpp src/modes/standard_race.cpp src/modes/standard_race.hpp src/modes/three_strikes_battle.cpp src/modes/three_strikes_battle.hpp src/modes/tutorial_race.cpp src/modes/tutorial_race.hpp src/modes/world.cpp src/modes/world.hpp src/modes/world_status.cpp src/modes/world_status.hpp src/modes/world_with_rank.cpp src/modes/world_with_rank.hpp src/network/character_confirm_message.hpp src/network/character_info_message.hpp src/network/character_selected_message.hpp src/network/connect_message.cpp src/network/connect_message.hpp src/network/flyable_info.hpp src/network/item_info.hpp src/network/kart_control_message.cpp src/network/kart_control_message.hpp src/network/kart_update_message.cpp src/network/kart_update_message.hpp src/network/message.cpp src/network/message.hpp src/network/network_kart.cpp src/network/network_kart.hpp src/network/network_manager.cpp src/network/network_manager.hpp src/network/num_players_message.hpp src/network/race_info_message.cpp src/network/race_info_message.hpp src/network/race_result_ack_message.hpp src/network/race_result_message.cpp src/network/race_result_message.hpp src/network/race_start_message.hpp src/network/race_state.cpp src/network/race_state.hpp src/network/remote_kart_info.hpp src/network/world_loaded_message.hpp src/physics/btKart.cpp src/physics/btKart.hpp src/physics/btKartRaycast.cpp src/physics/btKartRaycast.hpp src/physics/btUprightConstraint.cpp src/physics/btUprightConstraint.hpp src/physics/irr_debug_drawer.cpp src/physics/irr_debug_drawer.hpp src/physics/kart_motion_state.hpp src/physics/physical_object.cpp src/physics/physical_object.hpp src/physics/physics.cpp src/physics/physics.hpp src/physics/stk_dynamics_world.hpp src/physics/triangle_mesh.cpp src/physics/triangle_mesh.hpp src/physics/user_pointer.hpp src/race/grand_prix_data.cpp src/race/grand_prix_data.hpp src/race/grand_prix_manager.cpp src/race/grand_prix_manager.hpp src/race/highscore_manager.cpp src/race/highscore_manager.hpp src/race/highscores.cpp src/race/highscores.hpp src/race/history.cpp src/race/history.hpp src/race/race_manager.cpp src/race/race_manager.hpp src/replay/replay_base.cpp src/replay/replay_base.hpp src/replay/replay_buffer_tpl.hpp src/replay/replay_buffers.cpp src/replay/replay_buffers.hpp src/replay/replay_player.cpp src/replay/replay_player.hpp src/replay/replay_recorder.cpp src/replay/replay_recorder.hpp src/states_screens/addons_screen.cpp src/states_screens/addons_screen.hpp src/states_screens/arenas_screen.cpp src/states_screens/arenas_screen.hpp src/states_screens/credits.cpp src/states_screens/credits.hpp src/states_screens/dialogs/add_device_dialog.cpp src/states_screens/dialogs/add_device_dialog.hpp src/states_screens/dialogs/addons_loading.cpp src/states_screens/dialogs/addons_loading.hpp src/states_screens/dialogs/confirm_resolution_dialog.cpp src/states_screens/dialogs/confirm_resolution_dialog.hpp src/states_screens/dialogs/custom_video_settings.cpp src/states_screens/dialogs/custom_video_settings.hpp src/states_screens/dialogs/enter_player_name_dialog.cpp src/states_screens/dialogs/enter_player_name_dialog.hpp src/states_screens/dialogs/gp_info_dialog.cpp src/states_screens/dialogs/gp_info_dialog.hpp src/states_screens/dialogs/message_dialog.cpp src/states_screens/dialogs/message_dialog.hpp src/states_screens/dialogs/player_info_dialog.cpp src/states_screens/dialogs/player_info_dialog.hpp src/states_screens/dialogs/press_a_key_dialog.cpp src/states_screens/dialogs/press_a_key_dialog.hpp src/states_screens/dialogs/race_over_dialog.cpp src/states_screens/dialogs/race_over_dialog.hpp src/states_screens/dialogs/race_paused_dialog.cpp src/states_screens/dialogs/race_paused_dialog.hpp src/states_screens/dialogs/story_mode_new.cpp src/states_screens/dialogs/story_mode_new.hpp src/states_screens/dialogs/track_info_dialog.cpp src/states_screens/dialogs/track_info_dialog.hpp src/states_screens/feature_unlocked.cpp src/states_screens/feature_unlocked.hpp src/states_screens/grand_prix_lose.cpp src/states_screens/grand_prix_lose.hpp src/states_screens/grand_prix_win.cpp src/states_screens/grand_prix_win.hpp src/states_screens/help_screen_1.cpp src/states_screens/help_screen_1.hpp src/states_screens/help_screen_2.cpp src/states_screens/help_screen_2.hpp src/states_screens/help_screen_3.cpp src/states_screens/help_screen_3.hpp src/states_screens/help_screen_4.cpp src/states_screens/help_screen_4.hpp src/states_screens/kart_selection.cpp src/states_screens/kart_selection.hpp src/states_screens/main_menu_screen.cpp src/states_screens/main_menu_screen.hpp src/states_screens/minimal_race_gui.cpp src/states_screens/minimal_race_gui.hpp src/states_screens/options_screen_audio.cpp src/states_screens/options_screen_audio.hpp src/states_screens/options_screen_input.cpp src/states_screens/options_screen_input.hpp src/states_screens/options_screen_input2.cpp src/states_screens/options_screen_input2.hpp src/states_screens/options_screen_players.cpp src/states_screens/options_screen_players.hpp src/states_screens/options_screen_ui.cpp src/states_screens/options_screen_ui.hpp src/states_screens/options_screen_video.cpp src/states_screens/options_screen_video.hpp src/states_screens/race_gui.cpp src/states_screens/race_gui.hpp src/states_screens/race_gui_base.cpp src/states_screens/race_gui_base.hpp src/states_screens/race_gui_overworld.cpp src/states_screens/race_gui_overworld.hpp src/states_screens/race_result_gui.cpp src/states_screens/race_result_gui.hpp src/states_screens/race_setup_screen.cpp src/states_screens/race_setup_screen.hpp src/states_screens/state_manager.cpp src/states_screens/state_manager.hpp src/states_screens/story_mode_lobby.cpp src/states_screens/story_mode_lobby.hpp src/states_screens/tracks_screen.cpp src/states_screens/tracks_screen.hpp src/states_screens/tutorial_screen.cpp src/states_screens/tutorial_screen.hpp src/tinygettext/dictionary.cpp src/tinygettext/dictionary.hpp src/tinygettext/dictionary_manager.cpp src/tinygettext/dictionary_manager.hpp src/tinygettext/file_system.hpp src/tinygettext/iconv.cpp src/tinygettext/iconv.hpp src/tinygettext/language.cpp src/tinygettext/language.hpp src/tinygettext/log.cpp src/tinygettext/log.hpp src/tinygettext/log_stream.hpp src/tinygettext/plural_forms.cpp src/tinygettext/plural_forms.hpp src/tinygettext/po_parser.cpp src/tinygettext/po_parser.hpp src/tinygettext/stk_file_system.cpp src/tinygettext/stk_file_system.hpp src/tinygettext/tinygettext.cpp src/tinygettext/tinygettext.hpp src/tracks/ambient_light_sphere.cpp src/tracks/ambient_light_sphere.hpp src/tracks/bezier_curve.cpp src/tracks/bezier_curve.hpp src/tracks/check_lap.cpp src/tracks/check_lap.hpp src/tracks/check_line.cpp src/tracks/check_line.hpp src/tracks/check_manager.cpp src/tracks/check_manager.hpp src/tracks/check_sphere.cpp src/tracks/check_sphere.hpp src/tracks/check_structure.cpp src/tracks/check_structure.hpp src/tracks/graph_node.cpp src/tracks/graph_node.hpp src/tracks/lod_node_loader.cpp src/tracks/lod_node_loader.hpp src/tracks/quad.cpp src/tracks/quad.hpp src/tracks/quad_graph.cpp src/tracks/quad_graph.hpp src/tracks/quad_set.cpp src/tracks/quad_set.hpp src/tracks/terrain_info.cpp src/tracks/terrain_info.hpp src/tracks/track.cpp src/tracks/track.hpp src/tracks/track_manager.cpp src/tracks/track_manager.hpp src/tracks/track_object.cpp src/tracks/track_object.hpp src/tracks/track_object_manager.cpp src/tracks/track_object_manager.hpp src/tracks/track_sector.cpp src/tracks/track_sector.hpp src/tutorial/tutorial.cpp src/tutorial/tutorial.hpp src/tutorial/tutorial_data.cpp src/tutorial/tutorial_data.hpp src/tutorial/tutorial_manager.cpp src/tutorial/tutorial_manager.hpp src/utils/aligned_array.hpp src/utils/constants.cpp src/utils/constants.hpp src/utils/leak_check.cpp src/utils/leak_check.hpp src/utils/no_copy.hpp src/utils/profiler.cpp src/utils/profiler.hpp src/utils/ptr_vector.hpp src/utils/random_generator.cpp src/utils/random_generator.hpp src/utils/string_utils.cpp src/utils/string_utils.hpp src/utils/synchronised.hpp src/utils/time.hpp src/utils/translation.cpp src/utils/translation.hpp src/utils/utf8/checked.h src/utils/utf8/core.h src/utils/utf8/unchecked.h src/utils/utf8.h src/utils/vec3.cpp src/utils/vec3.hpp) if (APPLE) # icon files to copy in the bundle diff --git a/data/challenges/alltracks.challenge b/data/challenges/alltracks.challenge deleted file mode 100644 index 46f7ce930..000000000 --- a/data/challenges/alltracks.challenge +++ /dev/null @@ -1,17 +0,0 @@ - - - - diff --git a/data/challenges/atworldsend.challenge b/data/challenges/atworldsend.challenge deleted file mode 100644 index a1359991f..000000000 --- a/data/challenges/atworldsend.challenge +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/data/challenges/city.challenge b/data/challenges/city.challenge new file mode 100644 index 000000000..37348b775 --- /dev/null +++ b/data/challenges/city.challenge @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/data/challenges/crescentcrossing.challenge b/data/challenges/crescentcrossing.challenge deleted file mode 100644 index 1d5ebd8a5..000000000 --- a/data/challenges/crescentcrossing.challenge +++ /dev/null @@ -1,19 +0,0 @@ - - - - diff --git a/data/challenges/farm.challenge b/data/challenges/farm.challenge new file mode 100644 index 000000000..c6120038e --- /dev/null +++ b/data/challenges/farm.challenge @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/data/challenges/followtheleader.challenge b/data/challenges/followtheleader.challenge deleted file mode 100644 index ab93f361a..000000000 --- a/data/challenges/followtheleader.challenge +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/data/challenges/fortmagma.challenge b/data/challenges/fortmagma.challenge index f324e9ccd..238c89ff1 100644 --- a/data/challenges/fortmagma.challenge +++ b/data/challenges/fortmagma.challenge @@ -1,18 +1,18 @@ - - - + + + + + + + + + + + + + + + + + diff --git a/data/challenges/gnu.challenge b/data/challenges/gnu.challenge deleted file mode 100644 index cc8f9096f..000000000 --- a/data/challenges/gnu.challenge +++ /dev/null @@ -1,18 +0,0 @@ - - - - diff --git a/data/challenges/hacienda.challenge b/data/challenges/hacienda.challenge index a73da1442..ab96b6194 100644 --- a/data/challenges/hacienda.challenge +++ b/data/challenges/hacienda.challenge @@ -1,17 +1,18 @@ - - - + + + + + + + + + + + + + + + + + diff --git a/data/challenges/island.challenge b/data/challenges/island.challenge deleted file mode 100644 index 958839f82..000000000 --- a/data/challenges/island.challenge +++ /dev/null @@ -1,17 +0,0 @@ - - - - diff --git a/data/challenges/islandtrack.challenge b/data/challenges/islandtrack.challenge new file mode 100644 index 000000000..d53aa0868 --- /dev/null +++ b/data/challenges/islandtrack.challenge @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/data/challenges/jungle.challenge b/data/challenges/jungle.challenge new file mode 100644 index 000000000..8ec1ebddf --- /dev/null +++ b/data/challenges/jungle.challenge @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/data/challenges/lighthouse.challenge b/data/challenges/lighthouse.challenge index 02877ad0a..7311f2a16 100644 --- a/data/challenges/lighthouse.challenge +++ b/data/challenges/lighthouse.challenge @@ -1,19 +1,19 @@ - - - + + + + + + + + + + + + + + + + + diff --git a/data/challenges/mines.challenge b/data/challenges/mines.challenge index 85dd2f275..6d3dc5ea7 100644 --- a/data/challenges/mines.challenge +++ b/data/challenges/mines.challenge @@ -1,19 +1,18 @@ - - - + + + + + + + + + + + + + + + + + diff --git a/data/challenges/minigolf.challenge b/data/challenges/minigolf.challenge index bf34c2be7..0327aeec0 100644 --- a/data/challenges/minigolf.challenge +++ b/data/challenges/minigolf.challenge @@ -1,18 +1,18 @@ - - - + + + + + + + + + + + + + + + + + diff --git a/data/challenges/olivermath.challenge b/data/challenges/olivermath.challenge new file mode 100644 index 000000000..33e4d289f --- /dev/null +++ b/data/challenges/olivermath.challenge @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/data/challenges/sandtrack.challenge b/data/challenges/sandtrack.challenge new file mode 100644 index 000000000..89c535b6d --- /dev/null +++ b/data/challenges/sandtrack.challenge @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/data/challenges/scotland.challenge b/data/challenges/scotland.challenge new file mode 100644 index 000000000..617cc6225 --- /dev/null +++ b/data/challenges/scotland.challenge @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/data/challenges/skyline.challenge b/data/challenges/skyline.challenge deleted file mode 100644 index a3752a7dc..000000000 --- a/data/challenges/skyline.challenge +++ /dev/null @@ -1,18 +0,0 @@ - - - - diff --git a/data/challenges/snagdrive.challenge b/data/challenges/snagdrive.challenge deleted file mode 100644 index c13223c08..000000000 --- a/data/challenges/snagdrive.challenge +++ /dev/null @@ -1,17 +0,0 @@ - - - - diff --git a/data/challenges/snowmountain.challenge b/data/challenges/snowmountain.challenge new file mode 100644 index 000000000..85ea426e0 --- /dev/null +++ b/data/challenges/snowmountain.challenge @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/data/challenges/snowpeak.challenge b/data/challenges/snowpeak.challenge new file mode 100644 index 000000000..97f20c71e --- /dev/null +++ b/data/challenges/snowpeak.challenge @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/data/challenges/startrack.challenge b/data/challenges/startrack.challenge new file mode 100644 index 000000000..b6e49a1c3 --- /dev/null +++ b/data/challenges/startrack.challenge @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/data/challenges/subsea.challenge b/data/challenges/subsea.challenge new file mode 100644 index 000000000..fe144af8f --- /dev/null +++ b/data/challenges/subsea.challenge @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/data/challenges/tollway.challenge b/data/challenges/tollway.challenge deleted file mode 100644 index e6b9bc3a7..000000000 --- a/data/challenges/tollway.challenge +++ /dev/null @@ -1,18 +0,0 @@ - - - - diff --git a/data/challenges/tothemoonandback.challenge b/data/challenges/tothemoonandback.challenge deleted file mode 100644 index b59240254..000000000 --- a/data/challenges/tothemoonandback.challenge +++ /dev/null @@ -1,19 +0,0 @@ - - - - diff --git a/data/challenges/tuxtollway.challenge b/data/challenges/tuxtollway.challenge new file mode 100644 index 000000000..c31e412f9 --- /dev/null +++ b/data/challenges/tuxtollway.challenge @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/data/challenges/xr591.challenge b/data/challenges/xr591.challenge index ac22152a3..caf8a3c33 100644 --- a/data/challenges/xr591.challenge +++ b/data/challenges/xr591.challenge @@ -1,18 +1,20 @@ + + + + + + + + + + + + + + + + + - diff --git a/data/challenges/zengarden.challenge b/data/challenges/zengarden.challenge new file mode 100644 index 000000000..c99e2e929 --- /dev/null +++ b/data/challenges/zengarden.challenge @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/challenges/challenge.cpp b/src/challenges/challenge.cpp index b425a2ee4..6b932232b 100644 --- a/src/challenges/challenge.cpp +++ b/src/challenges/challenge.cpp @@ -40,7 +40,8 @@ void Challenge::load(const XMLNode* challengesNode) const XMLNode* node = challengesNode->getNode( m_data->getId() ); if(node == NULL) { - fprintf(stderr, "[Challenge] WARNING: Couldn't find node <%s> in XML file\n", + fprintf(stderr, "[Challenge] Couldn't find node <%s> in challenge list." + "(If this is the first time you play this is normal)\n", m_data->getId().c_str()); return; } diff --git a/src/challenges/challenge_data.cpp b/src/challenges/challenge_data.cpp index 739b6f6df..f7015cfd5 100644 --- a/src/challenges/challenge_data.cpp +++ b/src/challenges/challenge_data.cpp @@ -38,16 +38,19 @@ ChallengeData::ChallengeData(const std::string& filename) m_filename = filename; m_major = RaceManager::MAJOR_MODE_SINGLE; m_minor = RaceManager::MINOR_MODE_NORMAL_RACE; - m_difficulty = RaceManager::RD_EASY; m_num_laps = -1; - m_num_karts = -1; - m_position = -1; - m_time = -1.0f; - m_track_id = ""; + m_track_id = ""; m_gp_id = ""; - m_energy = -1; m_version = 0; + for (int d=0; dgetName()!="challenge") { @@ -57,21 +60,50 @@ ChallengeData::ChallengeData(const std::string& filename) throw std::runtime_error(msg.str()); } - std::string s; - if(!root->get("id", &s) ) error("id"); - setId(s); + setId(StringUtils::removeExtension(StringUtils::getBasename(filename))); root->get("version", &m_version); // No need to get the rest of the data if this challenge // is not supported anyway (id is needed for warning message) if(!unlock_manager->isSupportedVersion(*this)) { + fprintf(stderr, "[ChallengeData] WARNING: challenge <%s> is older " + "or newer than this version of STK, will be ignored.\n", filename.c_str()); delete root; return; } - + + const XMLNode* track_node = root->getNode("track"); + + // TODO: add GP support + if (track_node == NULL) + { + throw std::runtime_error("Challenge file " + filename + " has no node!"); + } + + + if (!track_node->get("id", &m_track_id )) + { + error("track"); + } + if (track_manager->getTrack(m_track_id) == NULL) + { + error("track"); + } + + if (!track_node->get("laps", &m_num_laps) && m_minor != RaceManager::MINOR_MODE_FOLLOW_LEADER) + { + error("laps"); + } + + const XMLNode* mode_node = root->getNode("mode"); + if (mode_node == NULL) + { + throw std::runtime_error("Challenge file " + filename + " has no node!"); + } + std::string mode; - root->get("major", &mode); + mode_node->get("major", &mode); if(mode=="grandprix") m_major = RaceManager::MAJOR_MODE_GRAND_PRIX; @@ -80,7 +112,7 @@ ChallengeData::ChallengeData(const std::string& filename) else error("major"); - root->get("minor", &mode); + mode_node->get("minor", &mode); if(mode=="timetrial") m_minor = RaceManager::MINOR_MODE_TIME_TRIAL; else if(mode=="quickrace") @@ -90,87 +122,78 @@ ChallengeData::ChallengeData(const std::string& filename) else error("minor"); - if(!root->get("name", &s) ) error("name"); - //std::cout << " // Challenge name = <" << s.c_str() << ">\n"; - setName( s.c_str() ); + const XMLNode* difficulties[RaceManager::DIFFICULTY_COUNT]; + difficulties[0] = root->getNode("easy"); + difficulties[1] = root->getNode("medium"); + difficulties[2] = root->getNode("hard"); - //if(!root->get("description", &s) ) error("description"); - //setChallengeDescription( s.c_str() ); - //std::cout << " // Challenge description = <" << s.c_str() << ">\n"; - - - - if(!root->get("karts", &m_num_karts) ) error("karts"); - - // Position is optional except in GP and FTL - if(!root->get("position", &m_position) && - //RaceManager::getWorld()->areKartsOrdered() ) // FIXME - order and optional are not the same thing - (m_minor==RaceManager::MINOR_MODE_FOLLOW_LEADER || - m_major==RaceManager::MAJOR_MODE_GRAND_PRIX)) - error("position"); - root->get("difficulty", &s); - if(s=="easy") - m_difficulty = RaceManager::RD_EASY; - else if(s=="medium") - m_difficulty = RaceManager::RD_MEDIUM; - else if(s=="hard") - m_difficulty = RaceManager::RD_HARD; - else - error("difficulty"); - - root->get("time", &m_time ); // one of time/position - - root->get("position", &m_position ); // must be set - if(m_time<0 && m_position<0) error("position/time"); - - root->get("energy", &m_energy ); // This is optional - if(m_major==RaceManager::MAJOR_MODE_SINGLE) + if (difficulties[0] == NULL || difficulties[1] == NULL || + difficulties[2] == NULL) { - if (!root->get("track", &m_track_id )) + error(" or or "); + } + + for (int d=0; dgetNode("karts"); + if (karts_node == NULL) error(""); + + int num_karts = -1; + if (!karts_node->get("number", &num_karts)) error("karts"); + m_num_karts[d] = num_karts; + + const XMLNode* requirements_node = difficulties[d]->getNode("requirements"); + if (requirements_node == NULL) error(""); + + int position = -1; + if (!requirements_node->get("position", &position) && + (m_minor==RaceManager::MINOR_MODE_FOLLOW_LEADER || + m_major==RaceManager::MAJOR_MODE_GRAND_PRIX)) { - error("track"); + error("position"); } - if (track_manager->getTrack(m_track_id) == NULL) + else { - error("track"); + m_position[d] = position; } - if (!root->get("laps", &m_num_laps ) && m_minor!=RaceManager::MINOR_MODE_FOLLOW_LEADER) - { - error("laps"); - } + int time = -1; + if (requirements_node->get("time", &time)) m_time[d] = time; + + if (m_time[d] < 0 && m_position[d] < 0) error("position/time"); + + // This is optional + int energy = -1; + if (requirements_node->get("energy", &energy)) m_energy[d] = energy; + } + + // TODO: add gp support +/* else // GP { if (!root->get("gp", &m_gp_id )) error("gp"); if (grand_prix_manager->getGrandPrix(m_gp_id) == NULL) error("gp"); } - - getUnlocks(root, "unlock-track", ChallengeData::UNLOCK_TRACK); - getUnlocks(root, "unlock-gp", ChallengeData::UNLOCK_GP ); - getUnlocks(root, "unlock-mode", ChallengeData::UNLOCK_MODE ); - getUnlocks(root, "unlock-difficulty", ChallengeData::UNLOCK_DIFFICULTY); - getUnlocks(root, "unlock-kart", ChallengeData::UNLOCK_KART); - - if (getFeatures().size() == 0) - { - error("features to unlock"); - } +*/ - std::vector< std::string > deps; - root->get("depend-on", &deps); - for (unsigned int i=0; igetNode("unlock"); + if (unlock_node != NULL) { - if (deps[i].size() > 0) addDependency(deps[i]); + getUnlocks(root, "unlock-track", ChallengeData::UNLOCK_TRACK); + getUnlocks(root, "unlock-gp", ChallengeData::UNLOCK_GP ); + getUnlocks(root, "unlock-mode", ChallengeData::UNLOCK_MODE ); + getUnlocks(root, "unlock-difficulty", ChallengeData::UNLOCK_DIFFICULTY); + getUnlocks(root, "unlock-kart", ChallengeData::UNLOCK_KART); } - delete root; - - core::stringw description; //I18N: number of laps to race in a challenge description += _("Laps : %i", m_num_laps); description += core::stringw(L"\n"); + + // TODO: add this info in the difficulties dialog perhaps? + /* //I18N: number of AI karts in a challenge description += _("AI Karts : %i", m_num_karts - 1); if (m_position > 0) @@ -191,6 +214,7 @@ ChallengeData::ChallengeData(const std::string& filename) //I18N: nitro points needed to win a challenge description += _("Collect %i points of nitro", m_energy); } + */ m_challenge_description = description; } // ChallengeData @@ -294,26 +318,26 @@ void ChallengeData::getUnlocks(const XMLNode *root, const std:: string &type, } // switch } // getUnlocks // ---------------------------------------------------------------------------- -void ChallengeData::setRace() const +void ChallengeData::setRace(RaceManager::Difficulty d) const { race_manager->setMajorMode(m_major); if(m_major==RaceManager::MAJOR_MODE_SINGLE) { race_manager->setMinorMode(m_minor); race_manager->setTrack(m_track_id); - race_manager->setDifficulty(m_difficulty); race_manager->setNumLaps(m_num_laps); - race_manager->setNumKarts(m_num_karts); + race_manager->setNumKarts(m_num_karts[d]); race_manager->setNumLocalPlayers(1); - race_manager->setCoinTarget(m_energy); + race_manager->setCoinTarget(m_energy[d]); + race_manager->setDifficulty(d); } else // GP { race_manager->setMinorMode(m_minor); const GrandPrixData *gp = grand_prix_manager->getGrandPrix(m_gp_id); race_manager->setGrandPrix(*gp); - race_manager->setDifficulty(m_difficulty); - race_manager->setNumKarts(m_num_karts); + race_manager->setDifficulty(d); + race_manager->setNumKarts(m_num_karts[d]); race_manager->setNumLocalPlayers(1); } } // setRace @@ -328,12 +352,14 @@ bool ChallengeData::raceFinished() // ------------ World *world = World::getWorld(); std::string track_name = world->getTrack()->getIdent(); - if(track_name!=m_track_id ) return false; - if((int)world->getNumKarts()getDifficulty(); + + if (track_name != m_track_id ) return false; + if ((int)world->getNumKarts() < m_num_karts[d] ) return false; Kart* kart = world->getPlayerKart(0); - if(m_energy>0 && kart->getEnergy() < m_energy ) return false; - if(m_position>0 && kart->getPosition()> m_position ) return false; - if(race_manager->getDifficulty() < m_difficulty) return false; + if (m_energy[d] > 0 && kart->getEnergy() < m_energy[d] ) return false; + if (m_position[d] > 0 && kart->getPosition() > m_position[d]) return false; // Follow the leader // ----------------- @@ -351,20 +377,21 @@ bool ChallengeData::raceFinished() { if(lworld->getLapForKart( kart->getWorldKartId() ) != m_num_laps) return false; // wrong number of laps } - if(m_time>0.0f && kart->getFinishTime()>m_time) return false; // too slow + if (m_time[d] > 0.0f && kart->getFinishTime() > m_time[d]) return false; // too slow return true; } // raceFinished // ---------------------------------------------------------------------------- bool ChallengeData::grandPrixFinished() { + int d = race_manager->getDifficulty(); + // Note that we have to call race_manager->getNumKarts, since there // is no world objects to query at this stage. if (race_manager->getMajorMode() != RaceManager::MAJOR_MODE_GRAND_PRIX || race_manager->getMinorMode() != m_minor || race_manager->getGrandPrix()->getId() != m_gp_id || - race_manager->getDifficulty() < m_difficulty || - race_manager->getNumberOfKarts() < (unsigned int)m_num_karts || + race_manager->getNumberOfKarts() < (unsigned int)m_num_karts[d] || race_manager->getNumPlayers() > 1) return false; // check if the player came first. diff --git a/src/challenges/challenge_data.hpp b/src/challenges/challenge_data.hpp index 57b338b9c..36bfcb164 100644 --- a/src/challenges/challenge_data.hpp +++ b/src/challenges/challenge_data.hpp @@ -55,14 +55,13 @@ public: private: RaceManager::MajorRaceModeType m_major; RaceManager::MinorRaceModeType m_minor; - RaceManager::Difficulty m_difficulty; int m_num_laps; - int m_position; - int m_num_karts; - float m_time; + int m_position[RaceManager::DIFFICULTY_COUNT]; + int m_num_karts[RaceManager::DIFFICULTY_COUNT]; + float m_time[RaceManager::DIFFICULTY_COUNT]; + int m_energy[RaceManager::DIFFICULTY_COUNT]; std::string m_gp_id; std::string m_track_id; - int m_energy; std::string m_filename; /** Version number of the challenge. */ int m_version; @@ -73,15 +72,11 @@ private: /** Short, internal name for this challenge. */ std::string m_id; - /** Name used in menu for this challenge. */ - irr::core::stringw m_name; - /** Message the user gets when the feature is not yet unlocked. */ - irr::core::stringw m_challenge_description; + /** Features to unlock. */ std::vector m_feature; - /** What needs to be done before accessing this challenge. */ - std::vector m_prerequisites; + irr::core::stringw m_challenge_description; public: #ifdef WIN32 @@ -93,7 +88,7 @@ public: virtual ~ChallengeData() {} /** sets the right parameters in RaceManager to try this challenge */ - void setRace() const; + void setRace(RaceManager::Difficulty d) const; virtual void check() const; virtual bool raceFinished(); @@ -103,32 +98,18 @@ public: const std::vector& - getFeatures() const { return m_feature; } - - const irr::core::stringw getChallengeDescription() const - {return _(m_challenge_description.c_str()); } - - void addDependency(const std::string id) {m_prerequisites.push_back(id);} - - const std::vector& - getPrerequisites() const { return m_prerequisites; } + getFeatures() const { return m_feature; } /** Returns the id of the challenge. */ - const std::string &getId() const { return m_id; } - - /** Returns the name of the challenge. */ - const irr::core::stringw getName() const - { return irr::core::stringw(_(m_name.c_str())); } - - /** Sets the name of the challenge. */ - void setName(const irr::core::stringw & s) { m_name = s; } + const std::string &getId() const { return m_id; } /** Sets the id of this challenge. */ - void setId(const std::string& s) { m_id = s; } + void setId(const std::string& s) { m_id = s; } - const std::string& getTrackId() const { return m_track_id; } + const std::string& getTrackId() const { return m_track_id; } + + int getNumLaps() const { return m_num_laps; } - void addUnlockTrackReward(const std::string &track_name); void addUnlockModeReward(const std::string &internal_mode_name, const irr::core::stringw &user_mode_name); @@ -141,13 +122,14 @@ public: RaceManager::MajorRaceModeType getMajorMode() const { return m_major; } RaceManager::MinorRaceModeType getMinorMode() const { return m_minor; } - RaceManager::Difficulty getDifficulty() const { return m_difficulty; } - int getNumLaps() const { return m_num_laps; } - int getPosition() const { return m_position; } - int getNumKarts() const { return m_num_karts; } - float getTime() const { return m_time; } - int getEnergy() const { return m_energy; } + + const irr::core::stringw& getChallengeDescription() const { return m_challenge_description; } -}; // ChallengeData + int getPosition(RaceManager::Difficulty difficulty) const { return m_position[difficulty]; } + int getNumKarts(RaceManager::Difficulty difficulty) const { return m_num_karts[difficulty]; } + float getTime (RaceManager::Difficulty difficulty) const { return m_time[difficulty]; } + int getEnergy (RaceManager::Difficulty difficulty) const { return m_energy[difficulty]; } + +}; // Ch #endif // HEADER_CHALLENGE_DATA_HPP diff --git a/src/challenges/game_slot.cpp b/src/challenges/game_slot.cpp index e7c1db328..940367273 100644 --- a/src/challenges/game_slot.cpp +++ b/src/challenges/game_slot.cpp @@ -81,33 +81,10 @@ void GameSlot::computeActive() continue; } - // Otherwise lock the feature, and check if the challenge is active - // ---------------------------------------------------------------- + // Otherwise lock the feature + // -------------------------- lockFeature(i->second); - std::vector pre_req=(i->second)->getData()->getPrerequisites(); - bool allSolved=true; - for(std::vector::iterator pre =pre_req.begin(); - pre!=pre_req.end(); pre++) - { - const Challenge* p = m_challenges_state[*pre]; - if(!p) - { - fprintf(stderr,"Challenge prerequisite '%s' of '%s' not found - ignored\n", - pre->c_str(), i->first.c_str()); - //continue; - allSolved=false; - break; - } - else if(!p->isSolved()) - { - allSolved=false; - break; - } - } // for all pre in pre_req - if(allSolved) - { - i->second->setActive(); - } // if solved + i->second->setActive(); } // for i clearUnlocked(); } // computeActive diff --git a/src/challenges/unlock_manager.cpp b/src/challenges/unlock_manager.cpp index c78d80441..c43bc3924 100644 --- a/src/challenges/unlock_manager.cpp +++ b/src/challenges/unlock_manager.cpp @@ -326,7 +326,7 @@ bool UnlockManager::isSupportedVersion(const ChallengeData &challenge) { // Test if challenge version number is in between minimum // and maximum supported version. - return (challenge.getVersion()>=1 && challenge.getVersion()<=1); + return (challenge.getVersion()>=2 && challenge.getVersion()<=2); } // isSupportedVersion diff --git a/src/ide/Xcode/STK_XCode.xcodeproj/project.pbxproj b/src/ide/Xcode/STK_XCode.xcodeproj/project.pbxproj index c035e067f..2aa5d4f46 100644 --- a/src/ide/Xcode/STK_XCode.xcodeproj/project.pbxproj +++ b/src/ide/Xcode/STK_XCode.xcodeproj/project.pbxproj @@ -16,7 +16,6 @@ 950D45D1118E040E006CFC41 /* options_screen_input2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 950D45CF118E040E006CFC41 /* options_screen_input2.cpp */; }; 9516B07E12629C4E005F9493 /* sfx_buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9516B07C12629C4E005F9493 /* sfx_buffer.cpp */; }; 951B50AE12C9698B004F6993 /* xml_writer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 951B50AD12C9698B004F6993 /* xml_writer.cpp */; }; - 951B7D19108E52C900BC03AE /* challenges.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 951B7D18108E52C900BC03AE /* challenges.cpp */; }; 951BC65E0FFAF290006B5FF1 /* ipo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 951BC65C0FFAF290006B5FF1 /* ipo.cpp */; }; 9522F125107948AD0067ECF5 /* main_menu_screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9522F124107948AD0067ECF5 /* main_menu_screen.cpp */; }; 9522F15B107949780067ECF5 /* race_setup_screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9522F15A107949780067ECF5 /* race_setup_screen.cpp */; }; @@ -411,8 +410,6 @@ 9516B07D12629C4E005F9493 /* sfx_buffer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = sfx_buffer.hpp; path = ../../audio/sfx_buffer.hpp; sourceTree = SOURCE_ROOT; }; 951B50AD12C9698B004F6993 /* xml_writer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xml_writer.cpp; path = ../../io/xml_writer.cpp; sourceTree = SOURCE_ROOT; }; 951B50AF12C96A13004F6993 /* xml_writer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = xml_writer.hpp; path = ../../io/xml_writer.hpp; sourceTree = SOURCE_ROOT; }; - 951B7D17108E52C900BC03AE /* challenges.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = challenges.hpp; path = ../../states_screens/challenges.hpp; sourceTree = SOURCE_ROOT; }; - 951B7D18108E52C900BC03AE /* challenges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = challenges.cpp; path = ../../states_screens/challenges.cpp; sourceTree = SOURCE_ROOT; }; 951BC65C0FFAF290006B5FF1 /* ipo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ipo.cpp; path = ../../animations/ipo.cpp; sourceTree = SOURCE_ROOT; }; 951BC65D0FFAF290006B5FF1 /* ipo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ipo.hpp; path = ../../animations/ipo.hpp; sourceTree = SOURCE_ROOT; }; 951C357D0FC05BF400A48379 /* quad_set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = quad_set.hpp; path = ../../tracks/quad_set.hpp; sourceTree = SOURCE_ROOT; }; @@ -2231,8 +2228,6 @@ 9551B26E11DC0D4D002DD140 /* addons_screen.hpp */, 956541B910DD5F0A00C83E99 /* arenas_screen.cpp */, 956541BA10DD5F0A00C83E99 /* arenas_screen.hpp */, - 951B7D18108E52C900BC03AE /* challenges.cpp */, - 951B7D17108E52C900BC03AE /* challenges.hpp */, 958330C210122B4A00C5137E /* credits.cpp */, 958330C310122B4A00C5137E /* credits.hpp */, 95D2343E1078227A00625256 /* feature_unlocked.cpp */, @@ -3011,7 +3006,6 @@ 9522F1E610795EFF0067ECF5 /* help_screen_3.cpp in Sources */, 9522F1F0107961560067ECF5 /* options_screen_input.cpp in Sources */, 9522F1F1107961560067ECF5 /* options_screen_players.cpp in Sources */, - 951B7D19108E52C900BC03AE /* challenges.cpp in Sources */, 956541BB10DD5F0A00C83E99 /* arenas_screen.cpp in Sources */, 956541E110DD628C00C83E99 /* add_device_dialog.cpp in Sources */, 95C9C97210E93456005A418D /* stars.cpp in Sources */, diff --git a/src/modes/overworld.cpp b/src/modes/overworld.cpp index e129512c2..2e833d642 100644 --- a/src/modes/overworld.cpp +++ b/src/modes/overworld.cpp @@ -130,8 +130,9 @@ void OverWorld::onFirePressed(Controller* who) // network_manager else call race_manager). network_manager->initCharacterDataStructures(); + // TODO: allow user to select difficulty // Launch challenge - challenge->setRace(); + challenge->setRace(RaceManager::RD_HARD); // Sets up kart info, including random list of kart for AI network_manager->setupPlayerKartInfo(); diff --git a/src/race/race_manager.hpp b/src/race/race_manager.hpp index 6cb4b1029..e41a14b5e 100644 --- a/src/race/race_manager.hpp +++ b/src/race/race_manager.hpp @@ -192,6 +192,8 @@ public: /** Game difficulty. */ enum Difficulty { RD_EASY, RD_MEDIUM, RD_HARD }; + static const int DIFFICULTY_COUNT = 3; + /** Different kart types: A local player, a player connected via network, * an AI kart, the leader kart (currently not used), a ghost kart * (currently not used). */ diff --git a/src/states_screens/challenges.cpp b/src/states_screens/challenges.cpp deleted file mode 100644 index 1ff0ab7b4..000000000 --- a/src/states_screens/challenges.cpp +++ /dev/null @@ -1,204 +0,0 @@ -// SuperTuxKart - a fun racing game with go-kart -// Copyright (C) 2009 Marianne Gagnon -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 3 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -#include "states_screens/challenges.hpp" - - -#include "challenges/unlock_manager.hpp" -#include "config/user_config.hpp" -#include "guiengine/engine.hpp" -#include "guiengine/widgets/dynamic_ribbon_widget.hpp" -#include "input/device_manager.hpp" -#include "input/input_manager.hpp" -#include "io/file_manager.hpp" -#include "karts/kart_properties_manager.hpp" -#include "network/network_manager.hpp" -#include "race/race_manager.hpp" -#include "states_screens/state_manager.hpp" -#include "utils/translation.hpp" - -#include -#include - -#include "irrString.h" -using irr::core::stringw; -using irr::core::stringc; - -using namespace GUIEngine; - -DEFINE_SCREEN_SINGLETON( ChallengesScreen ); - -// ------------------------------------------------------------------------------------------------------ - -ChallengesScreen::ChallengesScreen() : Screen("challenges.stkgui") -{ - -} - -// ------------------------------------------------------------------------------------------------------ - -void ChallengesScreen::loadedFromFile() -{ -} - -// ------------------------------------------------------------------------------------------------------ - -void ChallengesScreen::onUpdate(float elapsed_time, irr::video::IVideoDriver*) -{ -} - -// ------------------------------------------------------------------------------------------------------ - -void ChallengesScreen::beforeAddingWidget() -{ - DynamicRibbonWidget* w = this->getWidget("challenges"); - assert( w != NULL ); - - GameSlot* slot = unlock_manager->getCurrentSlot(); - - const std::vector& activeChallenges = slot->getActiveChallenges(); - const std::vector& solvedChallenges = slot->getUnlockedFeatures(); - const std::vector& lockedChallenges = slot->getLockedChallenges(); - - const int activeChallengeAmount = activeChallenges.size(); - const int solvedChallengeAmount = solvedChallenges.size(); - const int lockedChallengeAmount = lockedChallenges.size(); - - - w->setItemCountHint(activeChallengeAmount + solvedChallengeAmount + lockedChallengeAmount); -} - -// ------------------------------------------------------------------------------------------------------ - -void ChallengesScreen::init() -{ - Screen::init(); - DynamicRibbonWidget* w = this->getWidget("challenges"); - assert( w != NULL ); - - // Re-build track list everytime (accounts for locking changes, etc.) - w->clearItems(); - - GameSlot* slot = unlock_manager->getCurrentSlot(); - - const std::vector& activeChallenges = slot->getActiveChallenges(); - const std::vector& solvedChallenges = slot->getUnlockedFeatures(); - const std::vector& lockedChallenges = slot->getLockedChallenges(); - - const int activeChallengeAmount = activeChallenges.size(); - const int solvedChallengeAmount = solvedChallenges.size(); - const int lockedChallengeAmount = lockedChallenges.size(); - - for (int n=0; naddItem(activeChallenges[n]->getName() + L"\n" + activeChallenges[n]->getChallengeDescription(), - activeChallenges[n]->getId(), "/gui/challenge.png"); - } - for (int n=0; naddItem(solvedChallenges[n]->getName() + L"\n" + solvedChallenges[n]->getChallengeDescription(), - solvedChallenges[n]->getId(), "/textures/cup_gold.png"); - } - for (int n=0; naddItem( _("Locked : solve active challenges to gain access to more!"), "locked", - "/gui/challenge.png", LOCKED_BADGE); - } - - - w->updateItemDisplay(); - - if (w->getItems().empty()) - { - fprintf(stderr, "Error, no challenge!\n"); - return; - } - w->setSelection(0 /* whatever is first */, PLAYER_ID_GAME_MASTER, true /* focus it */); -} - -// ------------------------------------------------------------------------------------------------------ - -void ChallengesScreen::eventCallback(GUIEngine::Widget* widget, const std::string& name, const int playerID) -{ - if (name == "back") - { - StateManager::get()->escapePressed(); - } - else if (name == "challenges") - { - DynamicRibbonWidget* w = this->getWidget("challenges"); - assert( w != NULL ); - - // only player 0 can start a challenge (i.e. we have no multiplayer challenges) - std::string selection = w->getSelectionIDString( PLAYER_ID_GAME_MASTER ); - - if (selection == "locked") - { - unlock_manager->playLockSound(); - } - else if (!selection.empty() && selection != RibbonWidget::NO_ITEM_ID) - { - //FIXME: simplify and centralize race start sequence!! - - // Verify the kart in the config exists - if (kart_properties_manager->getKart(UserConfigParams::m_default_kart) == NULL) - { - UserConfigParams::m_default_kart.revertToDefaults(); - } - - const ChallengeData* c = unlock_manager->getChallenge(selection); - if (c == NULL) - { - std::cerr << "[ChallengesScreen] ERROR: cannot find challenge '" << selection.c_str() << "'!\n"; - return; - } - - // Use latest used device - InputDevice* device = input_manager->getDeviceList()->getLatestUsedDevice(); - - int id = StateManager::get()->createActivePlayer( unlock_manager->getCurrentPlayer(), device ); - input_manager->getDeviceList()->setSinglePlayer( StateManager::get()->getActivePlayer(id) ); - - // Set up race manager appropriately - race_manager->setNumLocalPlayers(1); - race_manager->setLocalKartInfo(0, UserConfigParams::m_default_kart); - - // ASSIGN should make sure that only input from assigned devices is read. - input_manager->getDeviceList()->setAssignMode(ASSIGN); - - // Go straight to the race - StateManager::get()->enterGameState(); - - // Initialise global data - necessary even in local games to avoid - // many if tests in other places (e.g. if network_game call - // network_manager else call race_manager). - network_manager->initCharacterDataStructures(); - - // Launch challenge - c->setRace(); - - // Sets up kart info, including random list of kart for AI - network_manager->setupPlayerKartInfo(); - race_manager->startNew(); - } - } -} - -// ------------------------------------------------------------------------------------------------------ - diff --git a/src/states_screens/challenges.hpp b/src/states_screens/challenges.hpp deleted file mode 100644 index 28466ee1d..000000000 --- a/src/states_screens/challenges.hpp +++ /dev/null @@ -1,58 +0,0 @@ -// SuperTuxKart - a fun racing game with go-kart -// Copyright (C) 2009 Marianne Gagnon -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 3 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -#ifndef HEADER_CHALLENGES_HPP -#define HEADER_CHALLENGES_HPP - -#include "guiengine/screen.hpp" -#include "utils/ptr_vector.hpp" - -namespace irr -{ - namespace video { class IVideoDriver; } -} - - -/** - * \brief Handles the screen where the player is shown active and solved challenges - * \ingroup states_screens - */ -class ChallengesScreen : public GUIEngine::Screen, public GUIEngine::ScreenSingleton -{ - friend class GUIEngine::ScreenSingleton; - ChallengesScreen(); - -public: - - /** \brief implement callback from parent class GUIEngine::Screen */ - virtual void loadedFromFile(); - - /** \brief implement optional callback from parent class GUIEngine::Screen */ - virtual void onUpdate(float dt, irr::video::IVideoDriver*); - - /** \brief implement callback from parent class GUIEngine::Screen */ - virtual void beforeAddingWidget(); - - /** \brief implement callback from parent class GUIEngine::Screen */ - virtual void init(); - - /** \brief implement callback from parent class GUIEngine::Screen */ - virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name, const int playerID); -}; - -#endif