From 19232cd9e6dc589a0eb029eb813c8ed3ef6a124c Mon Sep 17 00:00:00 2001 From: gyboth Date: Fri, 2 May 2008 13:00:05 +0000 Subject: [PATCH] Star player balking. --- src/interface.c | 485 ++++++++++++++++---------------- src/training.c | 415 ++++++++++++++------------- src/training_callbacks.c | 239 ++++++++-------- src/training_callbacks.h | 4 + src/training_interface.c | 18 +- src/training_struct.h | 4 - src/window.c | 5 +- support_files/bygfoot_constants | 5 + 8 files changed, 596 insertions(+), 579 deletions(-) diff --git a/src/interface.c b/src/interface.c index 703b82a3..5b5e3351 100644 --- a/src/interface.c +++ b/src/interface.c @@ -38,7 +38,7 @@ create_main_window (void) GtkWidget *menu_new; GtkWidget *menu_open; GtkWidget *menu_load_last_save; - GtkWidget *image2520; + GtkWidget *image2561; GtkWidget *menu_save; GtkWidget *menu_save_as; GtkWidget *trennlinie1; @@ -46,35 +46,35 @@ create_main_window (void) GtkWidget *menu_options; GtkWidget *menu_options_menu; GtkWidget *menu_preferences; - GtkWidget *image2521; + GtkWidget *image2562; GtkWidget *trennlinie7; GtkWidget *menu_job_offers; GtkWidget *menu_live_game; GtkWidget *menu_overwrite; GtkWidget *trennlinie14; GtkWidget *menu_save_window_geometry; - GtkWidget *image2522; + GtkWidget *image2563; GtkWidget *menu_figures; GtkWidget *menu_figures_menu; GtkWidget *menu_fixtures_week; - GtkWidget *image2523; + GtkWidget *image2564; GtkWidget *menu_fixtures; - GtkWidget *image2524; + GtkWidget *image2565; GtkWidget *menu_tables; - GtkWidget *image2525; + GtkWidget *image2566; GtkWidget *menu_my_league_results; - GtkWidget *image2526; + GtkWidget *image2567; GtkWidget *menu_season_results; - GtkWidget *image2527; + GtkWidget *image2568; GtkWidget *trennlinie13; GtkWidget *menu_league_stats; - GtkWidget *image2528; + GtkWidget *image2569; GtkWidget *menu_season_history; - GtkWidget *image2529; + GtkWidget *image2570; GtkWidget *menu_team; GtkWidget *menu_team_menu; GtkWidget *menu_playing_style; - GtkWidget *image2530; + GtkWidget *image2571; GtkWidget *menu_playing_style_menu; GSList *menu_all_out_defend_group = NULL; GtkWidget *menu_all_out_defend; @@ -83,7 +83,7 @@ create_main_window (void) GtkWidget *menu_attack; GtkWidget *menu_all_out_attack; GtkWidget *menu_scout; - GtkWidget *image2531; + GtkWidget *image2572; GtkWidget *menu_scout_menu; GSList *menu_scout_best_group = NULL; GtkWidget *menu_scout_best; @@ -91,7 +91,7 @@ create_main_window (void) GtkWidget *menu_scout_average; GtkWidget *menu_scout_bad; GtkWidget *menu_physio; - GtkWidget *image2532; + GtkWidget *image2573; GtkWidget *menu_physio_menu; GSList *menu_physio_best_group = NULL; GtkWidget *menu_physio_best; @@ -99,7 +99,7 @@ create_main_window (void) GtkWidget *menu_physio_average; GtkWidget *menu_physio_bad; GtkWidget *menu_youth_academy; - GtkWidget *image2533; + GtkWidget *image2574; GtkWidget *menu_youth_academy_menu; GtkWidget *menu_show_youth_academy; GtkWidget *youth_coach1; @@ -119,7 +119,7 @@ create_main_window (void) GtkWidget *menu_recruit4; GtkWidget *menu_set_investment; GtkWidget *menu_boost; - GtkWidget *image2534; + GtkWidget *image2575; GtkWidget *menu_boost_menu; GSList *menu_boost_on_group = NULL; GtkWidget *menu_boost_on; @@ -129,76 +129,76 @@ create_main_window (void) GtkWidget *menu_training_camp; GtkWidget *trennlinie18; GtkWidget *menu_reset_players; - GtkWidget *image2535; + GtkWidget *image2576; GtkWidget *menu_custom_structure; - GtkWidget *image2536; + GtkWidget *image2577; GtkWidget *menu_rearrange_team; - GtkWidget *image2537; + GtkWidget *image2578; GtkWidget *trennlinie8; GtkWidget *menu_browse_teams; - GtkWidget *image2538; + GtkWidget *image2579; GtkWidget *trennlinie16; GtkWidget *menu_show_job_exchange; GtkWidget *menu_player; GtkWidget *menu_player_menu; GtkWidget *menu_show_info; - GtkWidget *image2539; + GtkWidget *image2580; GtkWidget *menu_put_on_transfer_list; - GtkWidget *image2540; + GtkWidget *image2581; GtkWidget *menu_remove_from_transfer_list; - GtkWidget *image2541; + GtkWidget *image2582; GtkWidget *menu_offer_new_contract; - GtkWidget *image2542; + GtkWidget *image2583; GtkWidget *menu_fire; - GtkWidget *image2543; + GtkWidget *image2584; GtkWidget *menu_shoots_penalties; - GtkWidget *image2544; + GtkWidget *image2585; GtkWidget *menu_move_to_youth_academy; - GtkWidget *image2545; + GtkWidget *image2586; GtkWidget *trennlinie10; GtkWidget *menu_browse_players; - GtkWidget *image2546; + GtkWidget *image2587; GtkWidget *menu_user; GtkWidget *menu_user_menu; GtkWidget *menu_user_show_last_match; - GtkWidget *image2547; + GtkWidget *image2588; GtkWidget *menu_user_show_last_stats; - GtkWidget *image2548; + GtkWidget *image2589; GtkWidget *menu_user_show_coming_matches; - GtkWidget *image2549; + GtkWidget *image2590; GtkWidget *memorable_matches; - GtkWidget *image2550; + GtkWidget *image2591; GtkWidget *memorable_matches_menu; GtkWidget *mm_add_last_match; - GtkWidget *image2551; + GtkWidget *image2592; GtkWidget *mm_manage_matches; - GtkWidget *image2552; + GtkWidget *image2593; GtkWidget *trennlinie12; GtkWidget *menu_user_show_history; - GtkWidget *image2553; + GtkWidget *image2594; GtkWidget *trennlinie9; GtkWidget *menu_next_user; - GtkWidget *image2554; + GtkWidget *image2595; GtkWidget *menu_previous_user; - GtkWidget *image2555; + GtkWidget *image2596; GtkWidget *menu_manage_users; - GtkWidget *image2556; + GtkWidget *image2597; GtkWidget *menu_finances_stadium; GtkWidget *menu_finances_stadium_menu; GtkWidget *menu_show_finances; - GtkWidget *image2557; + GtkWidget *image2598; GtkWidget *menu_show_stadium; - GtkWidget *image2558; + GtkWidget *image2599; GtkWidget *trennlinie15; GtkWidget *menu_betting; GtkWidget *menu_help1; GtkWidget *menu_help1_menu; GtkWidget *menu_about; - GtkWidget *image2559; + GtkWidget *image2600; GtkWidget *menu_contributors; - GtkWidget *image2560; + GtkWidget *image2601; GtkWidget *menu_help; - GtkWidget *image2561; + GtkWidget *image2602; GtkWidget *hbox1; GtkWidget *button_load; GtkWidget *image11; @@ -316,12 +316,12 @@ create_main_window (void) gtk_widget_show (menu_load_last_save); gtk_container_add (GTK_CONTAINER (menu_file_menu), menu_load_last_save); gtk_widget_add_accelerator (menu_load_last_save, "activate", accel_group, - GDK_l, GDK_CONTROL_MASK | GDK_SHIFT_MASK, + GDK_l, (GdkModifierType) GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_ACCEL_VISIBLE); - image2520 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2520); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_load_last_save), image2520); + image2561 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2561); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_load_last_save), image2561); menu_save = gtk_image_menu_item_new_from_stock ("gtk-save", accel_group); gtk_widget_show (menu_save); @@ -351,12 +351,12 @@ create_main_window (void) gtk_widget_show (menu_preferences); gtk_container_add (GTK_CONTAINER (menu_options_menu), menu_preferences); gtk_widget_add_accelerator (menu_preferences, "activate", accel_group, - GDK_p, GDK_CONTROL_MASK, + GDK_p, (GdkModifierType) GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - image2521 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2521); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_preferences), image2521); + image2562 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2562); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_preferences), image2562); trennlinie7 = gtk_separator_menu_item_new (); gtk_widget_show (trennlinie7); @@ -387,9 +387,9 @@ create_main_window (void) gtk_container_add (GTK_CONTAINER (menu_options_menu), menu_save_window_geometry); gtk_tooltips_set_tip (tooltips, menu_save_window_geometry, _("Save window size, position and vertical divider"), NULL); - image2522 = create_pixmap (main_window, "menu_save_geometry.png"); - gtk_widget_show (image2522); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_window_geometry), image2522); + image2563 = create_pixmap (main_window, "menu_save_geometry.png"); + gtk_widget_show (image2563); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_window_geometry), image2563); menu_figures = gtk_menu_item_new_with_mnemonic (_("F_igures")); gtk_widget_show (menu_figures); @@ -402,56 +402,56 @@ create_main_window (void) gtk_widget_show (menu_fixtures_week); gtk_container_add (GTK_CONTAINER (menu_figures_menu), menu_fixtures_week); gtk_widget_add_accelerator (menu_fixtures_week, "activate", accel_group, - GDK_F3, 0, + GDK_F3, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); - image2523 = create_pixmap (main_window, "menu_fixtures.png"); - gtk_widget_show (image2523); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_fixtures_week), image2523); + image2564 = create_pixmap (main_window, "menu_fixtures.png"); + gtk_widget_show (image2564); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_fixtures_week), image2564); menu_fixtures = gtk_image_menu_item_new_with_mnemonic (_("Fixtures (competitions)")); gtk_widget_show (menu_fixtures); gtk_container_add (GTK_CONTAINER (menu_figures_menu), menu_fixtures); gtk_widget_add_accelerator (menu_fixtures, "activate", accel_group, - GDK_F4, 0, + GDK_F4, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); - image2524 = create_pixmap (main_window, "menu_fixtures_comp.png"); - gtk_widget_show (image2524); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_fixtures), image2524); + image2565 = create_pixmap (main_window, "menu_fixtures_comp.png"); + gtk_widget_show (image2565); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_fixtures), image2565); menu_tables = gtk_image_menu_item_new_with_mnemonic (_("Tables")); gtk_widget_show (menu_tables); gtk_container_add (GTK_CONTAINER (menu_figures_menu), menu_tables); gtk_widget_add_accelerator (menu_tables, "activate", accel_group, - GDK_F5, 0, + GDK_F5, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); - image2525 = create_pixmap (main_window, "menu_table.png"); - gtk_widget_show (image2525); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_tables), image2525); + image2566 = create_pixmap (main_window, "menu_table.png"); + gtk_widget_show (image2566); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_tables), image2566); menu_my_league_results = gtk_image_menu_item_new_with_mnemonic (_("My league results")); gtk_widget_show (menu_my_league_results); gtk_container_add (GTK_CONTAINER (menu_figures_menu), menu_my_league_results); gtk_widget_add_accelerator (menu_my_league_results, "activate", accel_group, - GDK_F6, 0, + GDK_F6, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); - image2526 = create_pixmap (main_window, "menu_league_results.png"); - gtk_widget_show (image2526); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_my_league_results), image2526); + image2567 = create_pixmap (main_window, "menu_league_results.png"); + gtk_widget_show (image2567); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_my_league_results), image2567); menu_season_results = gtk_image_menu_item_new_with_mnemonic (_("Season results")); gtk_widget_show (menu_season_results); gtk_container_add (GTK_CONTAINER (menu_figures_menu), menu_season_results); gtk_widget_add_accelerator (menu_season_results, "activate", accel_group, - GDK_s, GDK_SHIFT_MASK, + GDK_s, (GdkModifierType) GDK_SHIFT_MASK, GTK_ACCEL_VISIBLE); - image2527 = create_pixmap (main_window, "menu_season_res.png"); - gtk_widget_show (image2527); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_season_results), image2527); + image2568 = create_pixmap (main_window, "menu_season_res.png"); + gtk_widget_show (image2568); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_season_results), image2568); trennlinie13 = gtk_separator_menu_item_new (); gtk_widget_show (trennlinie13); @@ -462,23 +462,23 @@ create_main_window (void) gtk_widget_show (menu_league_stats); gtk_container_add (GTK_CONTAINER (menu_figures_menu), menu_league_stats); gtk_widget_add_accelerator (menu_league_stats, "activate", accel_group, - GDK_s, 0, + GDK_s, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); - image2528 = create_pixmap (main_window, "menu_league_stats.png"); - gtk_widget_show (image2528); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_league_stats), image2528); + image2569 = create_pixmap (main_window, "menu_league_stats.png"); + gtk_widget_show (image2569); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_league_stats), image2569); menu_season_history = gtk_image_menu_item_new_with_mnemonic (_("Season history")); gtk_widget_show (menu_season_history); gtk_container_add (GTK_CONTAINER (menu_figures_menu), menu_season_history); gtk_widget_add_accelerator (menu_season_history, "activate", accel_group, - GDK_h, 0, + GDK_h, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); - image2529 = create_pixmap (main_window, "menu_history.png"); - gtk_widget_show (image2529); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_season_history), image2529); + image2570 = create_pixmap (main_window, "menu_history.png"); + gtk_widget_show (image2570); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_season_history), image2570); menu_team = gtk_menu_item_new_with_mnemonic (_("_Team")); gtk_widget_show (menu_team); @@ -491,9 +491,9 @@ create_main_window (void) gtk_widget_show (menu_playing_style); gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_playing_style); - image2530 = create_pixmap (main_window, "menu_style.png"); - gtk_widget_show (image2530); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_playing_style), image2530); + image2571 = create_pixmap (main_window, "menu_style.png"); + gtk_widget_show (image2571); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_playing_style), image2571); menu_playing_style_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_playing_style), menu_playing_style_menu); @@ -532,9 +532,9 @@ create_main_window (void) gtk_widget_show (menu_scout); gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_scout); - image2531 = create_pixmap (main_window, "menu_scout.png"); - gtk_widget_show (image2531); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_scout), image2531); + image2572 = create_pixmap (main_window, "menu_scout.png"); + gtk_widget_show (image2572); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_scout), image2572); menu_scout_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_scout), menu_scout_menu); @@ -567,9 +567,9 @@ create_main_window (void) gtk_widget_show (menu_physio); gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_physio); - image2532 = create_pixmap (main_window, "menu_physio.png"); - gtk_widget_show (image2532); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_physio), image2532); + image2573 = create_pixmap (main_window, "menu_physio.png"); + gtk_widget_show (image2573); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_physio), image2573); menu_physio_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_physio), menu_physio_menu); @@ -602,9 +602,9 @@ create_main_window (void) gtk_widget_show (menu_youth_academy); gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_youth_academy); - image2533 = create_pixmap (main_window, "menu_youth_academy.png"); - gtk_widget_show (image2533); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_youth_academy), image2533); + image2574 = create_pixmap (main_window, "menu_youth_academy.png"); + gtk_widget_show (image2574); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_youth_academy), image2574); menu_youth_academy_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_youth_academy), menu_youth_academy_menu); @@ -613,7 +613,7 @@ create_main_window (void) gtk_widget_show (menu_show_youth_academy); gtk_container_add (GTK_CONTAINER (menu_youth_academy_menu), menu_show_youth_academy); gtk_widget_add_accelerator (menu_show_youth_academy, "activate", accel_group, - GDK_y, 0, + GDK_y, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); youth_coach1 = gtk_menu_item_new_with_mnemonic (_("Youth coach")); @@ -693,9 +693,9 @@ create_main_window (void) gtk_widget_show (menu_boost); gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_boost); - image2534 = create_pixmap (main_window, "menu_boost.png"); - gtk_widget_show (image2534); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_boost), image2534); + image2575 = create_pixmap (main_window, "menu_boost.png"); + gtk_widget_show (image2575); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_boost), image2575); menu_boost_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_boost), menu_boost_menu); @@ -726,6 +726,9 @@ create_main_window (void) menu_training_camp = gtk_menu_item_new_with_mnemonic (_("Training camp")); gtk_widget_show (menu_training_camp); gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_training_camp); + gtk_widget_add_accelerator (menu_training_camp, "activate", accel_group, + GDK_t, (GdkModifierType) GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE); trennlinie18 = gtk_separator_menu_item_new (); gtk_widget_show (trennlinie18); @@ -736,29 +739,29 @@ create_main_window (void) gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_reset_players); gtk_tooltips_set_tip (tooltips, menu_reset_players, _("Reset player list to the formation at the beginning of the live game pause (right click on player list)"), NULL); - image2535 = gtk_image_new_from_stock ("gtk-undo", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2535); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reset_players), image2535); + image2576 = gtk_image_new_from_stock ("gtk-undo", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2576); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reset_players), image2576); menu_custom_structure = gtk_image_menu_item_new_with_mnemonic (_("Enter custom structure")); gtk_widget_show (menu_custom_structure); gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_custom_structure); - image2536 = create_pixmap (main_window, "menu_structure.png"); - gtk_widget_show (image2536); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_custom_structure), image2536); + image2577 = create_pixmap (main_window, "menu_structure.png"); + gtk_widget_show (image2577); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_custom_structure), image2577); menu_rearrange_team = gtk_image_menu_item_new_with_mnemonic (_("Rearrange team")); gtk_widget_show (menu_rearrange_team); gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_rearrange_team); gtk_tooltips_set_tip (tooltips, menu_rearrange_team, _("Try to put the startup players onto their favoured positions and sort the substitutes (Ctrl-R or middle click)"), NULL); gtk_widget_add_accelerator (menu_rearrange_team, "activate", accel_group, - GDK_r, GDK_CONTROL_MASK, + GDK_r, (GdkModifierType) GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - image2537 = create_pixmap (main_window, "menu_rearrange.png"); - gtk_widget_show (image2537); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_rearrange_team), image2537); + image2578 = create_pixmap (main_window, "menu_rearrange.png"); + gtk_widget_show (image2578); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_rearrange_team), image2578); trennlinie8 = gtk_separator_menu_item_new (); gtk_widget_show (trennlinie8); @@ -769,9 +772,9 @@ create_main_window (void) gtk_widget_show (menu_browse_teams); gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_browse_teams); - image2538 = create_pixmap (main_window, "menu_browse_tms.png"); - gtk_widget_show (image2538); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_browse_teams), image2538); + image2579 = create_pixmap (main_window, "menu_browse_tms.png"); + gtk_widget_show (image2579); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_browse_teams), image2579); trennlinie16 = gtk_separator_menu_item_new (); gtk_widget_show (trennlinie16); @@ -783,7 +786,7 @@ create_main_window (void) gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_show_job_exchange); gtk_tooltips_set_tip (tooltips, menu_show_job_exchange, _("Show the list of available manager jobs"), NULL); gtk_widget_add_accelerator (menu_show_job_exchange, "activate", accel_group, - GDK_j, 0, + GDK_j, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); menu_player = gtk_menu_item_new_with_mnemonic (_("_Player")); @@ -797,57 +800,57 @@ create_main_window (void) gtk_widget_show (menu_show_info); gtk_container_add (GTK_CONTAINER (menu_player_menu), menu_show_info); - image2539 = create_pixmap (main_window, "menu_player_info.png"); - gtk_widget_show (image2539); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_show_info), image2539); + image2580 = create_pixmap (main_window, "menu_player_info.png"); + gtk_widget_show (image2580); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_show_info), image2580); menu_put_on_transfer_list = gtk_image_menu_item_new_with_mnemonic (_("Put on transfer list")); gtk_widget_show (menu_put_on_transfer_list); gtk_container_add (GTK_CONTAINER (menu_player_menu), menu_put_on_transfer_list); - image2540 = create_pixmap (main_window, "menu_player_put_transfer.png"); - gtk_widget_show (image2540); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_put_on_transfer_list), image2540); + image2581 = create_pixmap (main_window, "menu_player_put_transfer.png"); + gtk_widget_show (image2581); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_put_on_transfer_list), image2581); menu_remove_from_transfer_list = gtk_image_menu_item_new_with_mnemonic (_("Remove from transfer list")); gtk_widget_show (menu_remove_from_transfer_list); gtk_container_add (GTK_CONTAINER (menu_player_menu), menu_remove_from_transfer_list); - image2541 = create_pixmap (main_window, "menu_player_remove_transfer.png"); - gtk_widget_show (image2541); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_remove_from_transfer_list), image2541); + image2582 = create_pixmap (main_window, "menu_player_remove_transfer.png"); + gtk_widget_show (image2582); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_remove_from_transfer_list), image2582); menu_offer_new_contract = gtk_image_menu_item_new_with_mnemonic (_("Offer new contract")); gtk_widget_show (menu_offer_new_contract); gtk_container_add (GTK_CONTAINER (menu_player_menu), menu_offer_new_contract); - image2542 = create_pixmap (main_window, "menu_player_contract.png"); - gtk_widget_show (image2542); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_offer_new_contract), image2542); + image2583 = create_pixmap (main_window, "menu_player_contract.png"); + gtk_widget_show (image2583); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_offer_new_contract), image2583); menu_fire = gtk_image_menu_item_new_with_mnemonic (_("Fire")); gtk_widget_show (menu_fire); gtk_container_add (GTK_CONTAINER (menu_player_menu), menu_fire); - image2543 = create_pixmap (main_window, "menu_player_fire.png"); - gtk_widget_show (image2543); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_fire), image2543); + image2584 = create_pixmap (main_window, "menu_player_fire.png"); + gtk_widget_show (image2584); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_fire), image2584); menu_shoots_penalties = gtk_image_menu_item_new_with_mnemonic (_("Shoots penalties")); gtk_widget_show (menu_shoots_penalties); gtk_container_add (GTK_CONTAINER (menu_player_menu), menu_shoots_penalties); - image2544 = create_pixmap (main_window, "menu_player_shoots.png"); - gtk_widget_show (image2544); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_shoots_penalties), image2544); + image2585 = create_pixmap (main_window, "menu_player_shoots.png"); + gtk_widget_show (image2585); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_shoots_penalties), image2585); menu_move_to_youth_academy = gtk_image_menu_item_new_with_mnemonic (_("Move to youth academy")); gtk_widget_show (menu_move_to_youth_academy); gtk_container_add (GTK_CONTAINER (menu_player_menu), menu_move_to_youth_academy); - image2545 = create_pixmap (main_window, "menu_player_move_to_ya.png"); - gtk_widget_show (image2545); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_move_to_youth_academy), image2545); + image2586 = create_pixmap (main_window, "menu_player_move_to_ya.png"); + gtk_widget_show (image2586); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_move_to_youth_academy), image2586); trennlinie10 = gtk_separator_menu_item_new (); gtk_widget_show (trennlinie10); @@ -858,9 +861,9 @@ create_main_window (void) gtk_widget_show (menu_browse_players); gtk_container_add (GTK_CONTAINER (menu_player_menu), menu_browse_players); - image2546 = create_pixmap (main_window, "menu_player_browse.png"); - gtk_widget_show (image2546); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_browse_players), image2546); + image2587 = create_pixmap (main_window, "menu_player_browse.png"); + gtk_widget_show (image2587); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_browse_players), image2587); menu_user = gtk_menu_item_new_with_mnemonic (_("_User")); gtk_widget_show (menu_user); @@ -873,42 +876,42 @@ create_main_window (void) gtk_widget_show (menu_user_show_last_match); gtk_container_add (GTK_CONTAINER (menu_user_menu), menu_user_show_last_match); gtk_widget_add_accelerator (menu_user_show_last_match, "activate", accel_group, - GDK_v, GDK_CONTROL_MASK, + GDK_v, (GdkModifierType) GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - image2547 = create_pixmap (main_window, "menu_last_match.png"); - gtk_widget_show (image2547); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_user_show_last_match), image2547); + image2588 = create_pixmap (main_window, "menu_last_match.png"); + gtk_widget_show (image2588); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_user_show_last_match), image2588); menu_user_show_last_stats = gtk_image_menu_item_new_with_mnemonic (_("Show last match stats")); gtk_widget_show (menu_user_show_last_stats); gtk_container_add (GTK_CONTAINER (menu_user_menu), menu_user_show_last_stats); gtk_widget_add_accelerator (menu_user_show_last_stats, "activate", accel_group, - GDK_F2, 0, + GDK_F2, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); - image2548 = create_pixmap (main_window, "menu_match_stats.png"); - gtk_widget_show (image2548); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_user_show_last_stats), image2548); + image2589 = create_pixmap (main_window, "menu_match_stats.png"); + gtk_widget_show (image2589); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_user_show_last_stats), image2589); menu_user_show_coming_matches = gtk_image_menu_item_new_with_mnemonic (_("Show coming matches")); gtk_widget_show (menu_user_show_coming_matches); gtk_container_add (GTK_CONTAINER (menu_user_menu), menu_user_show_coming_matches); gtk_widget_add_accelerator (menu_user_show_coming_matches, "activate", accel_group, - GDK_F1, 0, + GDK_F1, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); - image2549 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2549); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_user_show_coming_matches), image2549); + image2590 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2590); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_user_show_coming_matches), image2590); memorable_matches = gtk_image_menu_item_new_with_mnemonic (_("Memorable matches")); gtk_widget_show (memorable_matches); gtk_container_add (GTK_CONTAINER (menu_user_menu), memorable_matches); - image2550 = create_pixmap (main_window, "menu_mmatches.png"); - gtk_widget_show (image2550); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (memorable_matches), image2550); + image2591 = create_pixmap (main_window, "menu_mmatches.png"); + gtk_widget_show (image2591); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (memorable_matches), image2591); memorable_matches_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (memorable_matches), memorable_matches_menu); @@ -918,24 +921,24 @@ create_main_window (void) gtk_container_add (GTK_CONTAINER (memorable_matches_menu), mm_add_last_match); gtk_tooltips_set_tip (tooltips, mm_add_last_match, _("Add last recorded match to the current memorable matches file."), NULL); gtk_widget_add_accelerator (mm_add_last_match, "activate", accel_group, - GDK_a, GDK_CONTROL_MASK, + GDK_a, (GdkModifierType) GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - image2551 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2551); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mm_add_last_match), image2551); + image2592 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2592); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mm_add_last_match), image2592); mm_manage_matches = gtk_image_menu_item_new_with_mnemonic (_("Manage matches")); gtk_widget_show (mm_manage_matches); gtk_container_add (GTK_CONTAINER (memorable_matches_menu), mm_manage_matches); gtk_tooltips_set_tip (tooltips, mm_manage_matches, _("Replay, delete or add memorable matches."), NULL); gtk_widget_add_accelerator (mm_manage_matches, "activate", accel_group, - GDK_m, GDK_CONTROL_MASK, + GDK_m, (GdkModifierType) GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - image2552 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2552); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mm_manage_matches), image2552); + image2593 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2593); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mm_manage_matches), image2593); trennlinie12 = gtk_separator_menu_item_new (); gtk_widget_show (trennlinie12); @@ -946,12 +949,12 @@ create_main_window (void) gtk_widget_show (menu_user_show_history); gtk_container_add (GTK_CONTAINER (menu_user_menu), menu_user_show_history); gtk_widget_add_accelerator (menu_user_show_history, "activate", accel_group, - GDK_h, GDK_CONTROL_MASK, + GDK_h, (GdkModifierType) GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - image2553 = create_pixmap (main_window, "menu_history.png"); - gtk_widget_show (image2553); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_user_show_history), image2553); + image2594 = create_pixmap (main_window, "menu_history.png"); + gtk_widget_show (image2594); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_user_show_history), image2594); trennlinie9 = gtk_separator_menu_item_new (); gtk_widget_show (trennlinie9); @@ -962,34 +965,34 @@ create_main_window (void) gtk_widget_show (menu_next_user); gtk_container_add (GTK_CONTAINER (menu_user_menu), menu_next_user); gtk_widget_add_accelerator (menu_next_user, "activate", accel_group, - GDK_F9, 0, + GDK_F9, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); - image2554 = gtk_image_new_from_stock ("gtk-media-forward", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2554); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_next_user), image2554); + image2595 = gtk_image_new_from_stock ("gtk-media-forward", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2595); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_next_user), image2595); menu_previous_user = gtk_image_menu_item_new_with_mnemonic (_("Previous user")); gtk_widget_show (menu_previous_user); gtk_container_add (GTK_CONTAINER (menu_user_menu), menu_previous_user); gtk_widget_add_accelerator (menu_previous_user, "activate", accel_group, - GDK_F8, 0, + GDK_F8, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); - image2555 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2555); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_previous_user), image2555); + image2596 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2596); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_previous_user), image2596); menu_manage_users = gtk_image_menu_item_new_with_mnemonic (_("Manage users")); gtk_widget_show (menu_manage_users); gtk_container_add (GTK_CONTAINER (menu_user_menu), menu_manage_users); gtk_widget_add_accelerator (menu_manage_users, "activate", accel_group, - GDK_F12, 0, + GDK_F12, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); - image2556 = gtk_image_new_from_stock ("gtk-justify-fill", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2556); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_manage_users), image2556); + image2597 = gtk_image_new_from_stock ("gtk-justify-fill", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2597); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_manage_users), image2597); menu_finances_stadium = gtk_menu_item_new_with_mnemonic (_("Fin_Stad")); gtk_widget_show (menu_finances_stadium); @@ -1002,23 +1005,23 @@ create_main_window (void) gtk_widget_show (menu_show_finances); gtk_container_add (GTK_CONTAINER (menu_finances_stadium_menu), menu_show_finances); gtk_widget_add_accelerator (menu_show_finances, "activate", accel_group, - GDK_f, 0, + GDK_f, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); - image2557 = create_pixmap (main_window, "menu_finances.png"); - gtk_widget_show (image2557); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_show_finances), image2557); + image2598 = create_pixmap (main_window, "menu_finances.png"); + gtk_widget_show (image2598); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_show_finances), image2598); menu_show_stadium = gtk_image_menu_item_new_with_mnemonic (_("Show stadium")); gtk_widget_show (menu_show_stadium); gtk_container_add (GTK_CONTAINER (menu_finances_stadium_menu), menu_show_stadium); gtk_widget_add_accelerator (menu_show_stadium, "activate", accel_group, - GDK_f, GDK_CONTROL_MASK, + GDK_f, (GdkModifierType) GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - image2558 = create_pixmap (main_window, "menu_stadium.png"); - gtk_widget_show (image2558); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_show_stadium), image2558); + image2599 = create_pixmap (main_window, "menu_stadium.png"); + gtk_widget_show (image2599); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_show_stadium), image2599); trennlinie15 = gtk_separator_menu_item_new (); gtk_widget_show (trennlinie15); @@ -1030,7 +1033,7 @@ create_main_window (void) gtk_container_add (GTK_CONTAINER (menu_finances_stadium_menu), menu_betting); gtk_tooltips_set_tip (tooltips, menu_betting, _("Show the betting window"), NULL); gtk_widget_add_accelerator (menu_betting, "activate", accel_group, - GDK_b, 0, + GDK_b, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); menu_help1 = gtk_menu_item_new_with_mnemonic (_("_Help")); @@ -1044,25 +1047,25 @@ create_main_window (void) gtk_widget_show (menu_about); gtk_container_add (GTK_CONTAINER (menu_help1_menu), menu_about); - image2559 = gtk_image_new_from_stock ("gtk-dialog-info", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2559); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_about), image2559); + image2600 = gtk_image_new_from_stock ("gtk-dialog-info", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2600); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_about), image2600); menu_contributors = gtk_image_menu_item_new_with_mnemonic (_("Contributors")); gtk_widget_show (menu_contributors); gtk_container_add (GTK_CONTAINER (menu_help1_menu), menu_contributors); - image2560 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2560); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_contributors), image2560); + image2601 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2601); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_contributors), image2601); menu_help = gtk_image_menu_item_new_with_mnemonic (_("Help")); gtk_widget_show (menu_help); gtk_container_add (GTK_CONTAINER (menu_help1_menu), menu_help); - image2561 = gtk_image_new_from_stock ("gtk-help", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2561); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_help), image2561); + image2602 = gtk_image_new_from_stock ("gtk-help", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2602); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_help), image2602); hbox1 = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox1); @@ -1114,7 +1117,7 @@ create_main_window (void) gtk_container_set_border_width (GTK_CONTAINER (button_back_to_main), 2); gtk_tooltips_set_tip (tooltips, button_back_to_main, _("Back to main menu (Esc)"), NULL); gtk_widget_add_accelerator (button_back_to_main, "clicked", accel_group, - GDK_Escape, 0, + GDK_Escape, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); image20 = gtk_image_new_from_stock ("gtk-home", GTK_ICON_SIZE_BUTTON); @@ -1127,7 +1130,7 @@ create_main_window (void) gtk_container_set_border_width (GTK_CONTAINER (button_transfers), 2); gtk_tooltips_set_tip (tooltips, button_transfers, _("Show transferlist (T)"), NULL); gtk_widget_add_accelerator (button_transfers, "clicked", accel_group, - GDK_t, 0, + GDK_t, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); image32 = create_pixmap (main_window, "transfers.png"); @@ -1145,7 +1148,7 @@ create_main_window (void) gtk_container_set_border_width (GTK_CONTAINER (button_new_week), 2); gtk_tooltips_set_tip (tooltips, button_new_week, _("Begin a new week (Space)"), NULL); gtk_widget_add_accelerator (button_new_week, "clicked", accel_group, - GDK_space, 0, + GDK_space, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); image23 = create_pixmap (main_window, "new_week.png"); @@ -1371,7 +1374,7 @@ create_main_window (void) gtk_widget_set_sensitive (button_cl_back, FALSE); gtk_tooltips_set_tip (tooltips, button_cl_back, _("Previous league/cup (1)"), NULL); gtk_widget_add_accelerator (button_cl_back, "clicked", accel_group, - GDK_1, 0, + GDK_1, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); image215 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_BUTTON); @@ -1384,7 +1387,7 @@ create_main_window (void) gtk_widget_set_sensitive (button_cl_forward, FALSE); gtk_tooltips_set_tip (tooltips, button_cl_forward, _("Next league/cup (2)"), NULL); gtk_widget_add_accelerator (button_cl_forward, "clicked", accel_group, - GDK_2, 0, + GDK_2, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); image216 = gtk_image_new_from_stock ("gtk-go-forward", GTK_ICON_SIZE_BUTTON); @@ -1397,7 +1400,7 @@ create_main_window (void) gtk_widget_set_sensitive (button_browse_back, FALSE); gtk_tooltips_set_tip (tooltips, button_browse_back, _("Previous (Q)"), NULL); gtk_widget_add_accelerator (button_browse_back, "clicked", accel_group, - GDK_q, 0, + GDK_q, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); image10 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_BUTTON); @@ -1410,7 +1413,7 @@ create_main_window (void) gtk_widget_set_sensitive (button_browse_forward, FALSE); gtk_tooltips_set_tip (tooltips, button_browse_forward, _("Next (W)"), NULL); gtk_widget_add_accelerator (button_browse_forward, "clicked", accel_group, - GDK_w, 0, + GDK_w, (GdkModifierType) 0, GTK_ACCEL_VISIBLE); image9 = gtk_image_new_from_stock ("gtk-go-forward", GTK_ICON_SIZE_BUTTON); @@ -1721,7 +1724,7 @@ create_main_window (void) GLADE_HOOKUP_OBJECT (main_window, menu_new, "menu_new"); GLADE_HOOKUP_OBJECT (main_window, menu_open, "menu_open"); GLADE_HOOKUP_OBJECT (main_window, menu_load_last_save, "menu_load_last_save"); - GLADE_HOOKUP_OBJECT (main_window, image2520, "image2520"); + GLADE_HOOKUP_OBJECT (main_window, image2561, "image2561"); GLADE_HOOKUP_OBJECT (main_window, menu_save, "menu_save"); GLADE_HOOKUP_OBJECT (main_window, menu_save_as, "menu_save_as"); GLADE_HOOKUP_OBJECT (main_window, trennlinie1, "trennlinie1"); @@ -1729,35 +1732,35 @@ create_main_window (void) GLADE_HOOKUP_OBJECT (main_window, menu_options, "menu_options"); GLADE_HOOKUP_OBJECT (main_window, menu_options_menu, "menu_options_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_preferences, "menu_preferences"); - GLADE_HOOKUP_OBJECT (main_window, image2521, "image2521"); + GLADE_HOOKUP_OBJECT (main_window, image2562, "image2562"); GLADE_HOOKUP_OBJECT (main_window, trennlinie7, "trennlinie7"); GLADE_HOOKUP_OBJECT (main_window, menu_job_offers, "menu_job_offers"); GLADE_HOOKUP_OBJECT (main_window, menu_live_game, "menu_live_game"); GLADE_HOOKUP_OBJECT (main_window, menu_overwrite, "menu_overwrite"); GLADE_HOOKUP_OBJECT (main_window, trennlinie14, "trennlinie14"); GLADE_HOOKUP_OBJECT (main_window, menu_save_window_geometry, "menu_save_window_geometry"); - GLADE_HOOKUP_OBJECT (main_window, image2522, "image2522"); + GLADE_HOOKUP_OBJECT (main_window, image2563, "image2563"); GLADE_HOOKUP_OBJECT (main_window, menu_figures, "menu_figures"); GLADE_HOOKUP_OBJECT (main_window, menu_figures_menu, "menu_figures_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_fixtures_week, "menu_fixtures_week"); - GLADE_HOOKUP_OBJECT (main_window, image2523, "image2523"); + GLADE_HOOKUP_OBJECT (main_window, image2564, "image2564"); GLADE_HOOKUP_OBJECT (main_window, menu_fixtures, "menu_fixtures"); - GLADE_HOOKUP_OBJECT (main_window, image2524, "image2524"); + GLADE_HOOKUP_OBJECT (main_window, image2565, "image2565"); GLADE_HOOKUP_OBJECT (main_window, menu_tables, "menu_tables"); - GLADE_HOOKUP_OBJECT (main_window, image2525, "image2525"); + GLADE_HOOKUP_OBJECT (main_window, image2566, "image2566"); GLADE_HOOKUP_OBJECT (main_window, menu_my_league_results, "menu_my_league_results"); - GLADE_HOOKUP_OBJECT (main_window, image2526, "image2526"); + GLADE_HOOKUP_OBJECT (main_window, image2567, "image2567"); GLADE_HOOKUP_OBJECT (main_window, menu_season_results, "menu_season_results"); - GLADE_HOOKUP_OBJECT (main_window, image2527, "image2527"); + GLADE_HOOKUP_OBJECT (main_window, image2568, "image2568"); GLADE_HOOKUP_OBJECT (main_window, trennlinie13, "trennlinie13"); GLADE_HOOKUP_OBJECT (main_window, menu_league_stats, "menu_league_stats"); - GLADE_HOOKUP_OBJECT (main_window, image2528, "image2528"); + GLADE_HOOKUP_OBJECT (main_window, image2569, "image2569"); GLADE_HOOKUP_OBJECT (main_window, menu_season_history, "menu_season_history"); - GLADE_HOOKUP_OBJECT (main_window, image2529, "image2529"); + GLADE_HOOKUP_OBJECT (main_window, image2570, "image2570"); GLADE_HOOKUP_OBJECT (main_window, menu_team, "menu_team"); GLADE_HOOKUP_OBJECT (main_window, menu_team_menu, "menu_team_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_playing_style, "menu_playing_style"); - GLADE_HOOKUP_OBJECT (main_window, image2530, "image2530"); + GLADE_HOOKUP_OBJECT (main_window, image2571, "image2571"); GLADE_HOOKUP_OBJECT (main_window, menu_playing_style_menu, "menu_playing_style_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_all_out_defend, "menu_all_out_defend"); GLADE_HOOKUP_OBJECT (main_window, menu_defend, "menu_defend"); @@ -1765,21 +1768,21 @@ create_main_window (void) GLADE_HOOKUP_OBJECT (main_window, menu_attack, "menu_attack"); GLADE_HOOKUP_OBJECT (main_window, menu_all_out_attack, "menu_all_out_attack"); GLADE_HOOKUP_OBJECT (main_window, menu_scout, "menu_scout"); - GLADE_HOOKUP_OBJECT (main_window, image2531, "image2531"); + GLADE_HOOKUP_OBJECT (main_window, image2572, "image2572"); GLADE_HOOKUP_OBJECT (main_window, menu_scout_menu, "menu_scout_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_scout_best, "menu_scout_best"); GLADE_HOOKUP_OBJECT (main_window, menu_scout_good, "menu_scout_good"); GLADE_HOOKUP_OBJECT (main_window, menu_scout_average, "menu_scout_average"); GLADE_HOOKUP_OBJECT (main_window, menu_scout_bad, "menu_scout_bad"); GLADE_HOOKUP_OBJECT (main_window, menu_physio, "menu_physio"); - GLADE_HOOKUP_OBJECT (main_window, image2532, "image2532"); + GLADE_HOOKUP_OBJECT (main_window, image2573, "image2573"); GLADE_HOOKUP_OBJECT (main_window, menu_physio_menu, "menu_physio_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_physio_best, "menu_physio_best"); GLADE_HOOKUP_OBJECT (main_window, menu_physio_good, "menu_physio_good"); GLADE_HOOKUP_OBJECT (main_window, menu_physio_average, "menu_physio_average"); GLADE_HOOKUP_OBJECT (main_window, menu_physio_bad, "menu_physio_bad"); GLADE_HOOKUP_OBJECT (main_window, menu_youth_academy, "menu_youth_academy"); - GLADE_HOOKUP_OBJECT (main_window, image2533, "image2533"); + GLADE_HOOKUP_OBJECT (main_window, image2574, "image2574"); GLADE_HOOKUP_OBJECT (main_window, menu_youth_academy_menu, "menu_youth_academy_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_show_youth_academy, "menu_show_youth_academy"); GLADE_HOOKUP_OBJECT (main_window, youth_coach1, "youth_coach1"); @@ -1797,7 +1800,7 @@ create_main_window (void) GLADE_HOOKUP_OBJECT (main_window, menu_recruit4, "menu_recruit4"); GLADE_HOOKUP_OBJECT (main_window, menu_set_investment, "menu_set_investment"); GLADE_HOOKUP_OBJECT (main_window, menu_boost, "menu_boost"); - GLADE_HOOKUP_OBJECT (main_window, image2534, "image2534"); + GLADE_HOOKUP_OBJECT (main_window, image2575, "image2575"); GLADE_HOOKUP_OBJECT (main_window, menu_boost_menu, "menu_boost_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_boost_on, "menu_boost_on"); GLADE_HOOKUP_OBJECT (main_window, menu_boost_off, "menu_boost_off"); @@ -1806,76 +1809,76 @@ create_main_window (void) GLADE_HOOKUP_OBJECT (main_window, menu_training_camp, "menu_training_camp"); GLADE_HOOKUP_OBJECT (main_window, trennlinie18, "trennlinie18"); GLADE_HOOKUP_OBJECT (main_window, menu_reset_players, "menu_reset_players"); - GLADE_HOOKUP_OBJECT (main_window, image2535, "image2535"); + GLADE_HOOKUP_OBJECT (main_window, image2576, "image2576"); GLADE_HOOKUP_OBJECT (main_window, menu_custom_structure, "menu_custom_structure"); - GLADE_HOOKUP_OBJECT (main_window, image2536, "image2536"); + GLADE_HOOKUP_OBJECT (main_window, image2577, "image2577"); GLADE_HOOKUP_OBJECT (main_window, menu_rearrange_team, "menu_rearrange_team"); - GLADE_HOOKUP_OBJECT (main_window, image2537, "image2537"); + GLADE_HOOKUP_OBJECT (main_window, image2578, "image2578"); GLADE_HOOKUP_OBJECT (main_window, trennlinie8, "trennlinie8"); GLADE_HOOKUP_OBJECT (main_window, menu_browse_teams, "menu_browse_teams"); - GLADE_HOOKUP_OBJECT (main_window, image2538, "image2538"); + GLADE_HOOKUP_OBJECT (main_window, image2579, "image2579"); GLADE_HOOKUP_OBJECT (main_window, trennlinie16, "trennlinie16"); GLADE_HOOKUP_OBJECT (main_window, menu_show_job_exchange, "menu_show_job_exchange"); GLADE_HOOKUP_OBJECT (main_window, menu_player, "menu_player"); GLADE_HOOKUP_OBJECT (main_window, menu_player_menu, "menu_player_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_show_info, "menu_show_info"); - GLADE_HOOKUP_OBJECT (main_window, image2539, "image2539"); + GLADE_HOOKUP_OBJECT (main_window, image2580, "image2580"); GLADE_HOOKUP_OBJECT (main_window, menu_put_on_transfer_list, "menu_put_on_transfer_list"); - GLADE_HOOKUP_OBJECT (main_window, image2540, "image2540"); + GLADE_HOOKUP_OBJECT (main_window, image2581, "image2581"); GLADE_HOOKUP_OBJECT (main_window, menu_remove_from_transfer_list, "menu_remove_from_transfer_list"); - GLADE_HOOKUP_OBJECT (main_window, image2541, "image2541"); + GLADE_HOOKUP_OBJECT (main_window, image2582, "image2582"); GLADE_HOOKUP_OBJECT (main_window, menu_offer_new_contract, "menu_offer_new_contract"); - GLADE_HOOKUP_OBJECT (main_window, image2542, "image2542"); + GLADE_HOOKUP_OBJECT (main_window, image2583, "image2583"); GLADE_HOOKUP_OBJECT (main_window, menu_fire, "menu_fire"); - GLADE_HOOKUP_OBJECT (main_window, image2543, "image2543"); + GLADE_HOOKUP_OBJECT (main_window, image2584, "image2584"); GLADE_HOOKUP_OBJECT (main_window, menu_shoots_penalties, "menu_shoots_penalties"); - GLADE_HOOKUP_OBJECT (main_window, image2544, "image2544"); + GLADE_HOOKUP_OBJECT (main_window, image2585, "image2585"); GLADE_HOOKUP_OBJECT (main_window, menu_move_to_youth_academy, "menu_move_to_youth_academy"); - GLADE_HOOKUP_OBJECT (main_window, image2545, "image2545"); + GLADE_HOOKUP_OBJECT (main_window, image2586, "image2586"); GLADE_HOOKUP_OBJECT (main_window, trennlinie10, "trennlinie10"); GLADE_HOOKUP_OBJECT (main_window, menu_browse_players, "menu_browse_players"); - GLADE_HOOKUP_OBJECT (main_window, image2546, "image2546"); + GLADE_HOOKUP_OBJECT (main_window, image2587, "image2587"); GLADE_HOOKUP_OBJECT (main_window, menu_user, "menu_user"); GLADE_HOOKUP_OBJECT (main_window, menu_user_menu, "menu_user_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_user_show_last_match, "menu_user_show_last_match"); - GLADE_HOOKUP_OBJECT (main_window, image2547, "image2547"); + GLADE_HOOKUP_OBJECT (main_window, image2588, "image2588"); GLADE_HOOKUP_OBJECT (main_window, menu_user_show_last_stats, "menu_user_show_last_stats"); - GLADE_HOOKUP_OBJECT (main_window, image2548, "image2548"); + GLADE_HOOKUP_OBJECT (main_window, image2589, "image2589"); GLADE_HOOKUP_OBJECT (main_window, menu_user_show_coming_matches, "menu_user_show_coming_matches"); - GLADE_HOOKUP_OBJECT (main_window, image2549, "image2549"); + GLADE_HOOKUP_OBJECT (main_window, image2590, "image2590"); GLADE_HOOKUP_OBJECT (main_window, memorable_matches, "memorable_matches"); - GLADE_HOOKUP_OBJECT (main_window, image2550, "image2550"); + GLADE_HOOKUP_OBJECT (main_window, image2591, "image2591"); GLADE_HOOKUP_OBJECT (main_window, memorable_matches_menu, "memorable_matches_menu"); GLADE_HOOKUP_OBJECT (main_window, mm_add_last_match, "mm_add_last_match"); - GLADE_HOOKUP_OBJECT (main_window, image2551, "image2551"); + GLADE_HOOKUP_OBJECT (main_window, image2592, "image2592"); GLADE_HOOKUP_OBJECT (main_window, mm_manage_matches, "mm_manage_matches"); - GLADE_HOOKUP_OBJECT (main_window, image2552, "image2552"); + GLADE_HOOKUP_OBJECT (main_window, image2593, "image2593"); GLADE_HOOKUP_OBJECT (main_window, trennlinie12, "trennlinie12"); GLADE_HOOKUP_OBJECT (main_window, menu_user_show_history, "menu_user_show_history"); - GLADE_HOOKUP_OBJECT (main_window, image2553, "image2553"); + GLADE_HOOKUP_OBJECT (main_window, image2594, "image2594"); GLADE_HOOKUP_OBJECT (main_window, trennlinie9, "trennlinie9"); GLADE_HOOKUP_OBJECT (main_window, menu_next_user, "menu_next_user"); - GLADE_HOOKUP_OBJECT (main_window, image2554, "image2554"); + GLADE_HOOKUP_OBJECT (main_window, image2595, "image2595"); GLADE_HOOKUP_OBJECT (main_window, menu_previous_user, "menu_previous_user"); - GLADE_HOOKUP_OBJECT (main_window, image2555, "image2555"); + GLADE_HOOKUP_OBJECT (main_window, image2596, "image2596"); GLADE_HOOKUP_OBJECT (main_window, menu_manage_users, "menu_manage_users"); - GLADE_HOOKUP_OBJECT (main_window, image2556, "image2556"); + GLADE_HOOKUP_OBJECT (main_window, image2597, "image2597"); GLADE_HOOKUP_OBJECT (main_window, menu_finances_stadium, "menu_finances_stadium"); GLADE_HOOKUP_OBJECT (main_window, menu_finances_stadium_menu, "menu_finances_stadium_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_show_finances, "menu_show_finances"); - GLADE_HOOKUP_OBJECT (main_window, image2557, "image2557"); + GLADE_HOOKUP_OBJECT (main_window, image2598, "image2598"); GLADE_HOOKUP_OBJECT (main_window, menu_show_stadium, "menu_show_stadium"); - GLADE_HOOKUP_OBJECT (main_window, image2558, "image2558"); + GLADE_HOOKUP_OBJECT (main_window, image2599, "image2599"); GLADE_HOOKUP_OBJECT (main_window, trennlinie15, "trennlinie15"); GLADE_HOOKUP_OBJECT (main_window, menu_betting, "menu_betting"); GLADE_HOOKUP_OBJECT (main_window, menu_help1, "menu_help1"); GLADE_HOOKUP_OBJECT (main_window, menu_help1_menu, "menu_help1_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_about, "menu_about"); - GLADE_HOOKUP_OBJECT (main_window, image2559, "image2559"); + GLADE_HOOKUP_OBJECT (main_window, image2600, "image2600"); GLADE_HOOKUP_OBJECT (main_window, menu_contributors, "menu_contributors"); - GLADE_HOOKUP_OBJECT (main_window, image2560, "image2560"); + GLADE_HOOKUP_OBJECT (main_window, image2601, "image2601"); GLADE_HOOKUP_OBJECT (main_window, menu_help, "menu_help"); - GLADE_HOOKUP_OBJECT (main_window, image2561, "image2561"); + GLADE_HOOKUP_OBJECT (main_window, image2602, "image2602"); GLADE_HOOKUP_OBJECT (main_window, hbox1, "hbox1"); GLADE_HOOKUP_OBJECT (main_window, button_load, "button_load"); GLADE_HOOKUP_OBJECT (main_window, image11, "image11"); diff --git a/src/training.c b/src/training.c index 3c5c1d19..dca12ef1 100755 --- a/src/training.c +++ b/src/training.c @@ -1,106 +1,108 @@ /* - bet_struct.h + bet_struct.h - Bygfoot Football Manager -- a small and simple GTK2-based - football management game. + Bygfoot Football Manager -- a small and simple GTK2-based + football management game. - http://bygfoot.sourceforge.net + http://bygfoot.sourceforge.net - Copyright (C) 2005 Gyözö Both (gyboth@bygfoot.com) + Copyright (C) 2005 Gyözö Both (gyboth@bygfoot.com) - 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 2 - of the License, or (at your option) any later version. + 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 2 + 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. + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "enums.h" +#include "finance.h" #include "glib.h" +#include "option.h" #include "training.h" #include "player.h" void calculateTrainingCamp(Team *current_team, - gdouble value_training, + gdouble value_training, gdouble value_recreation, gint number_camp) { - gint count, i; - Player *player; - gfloat skill_points=0.0; - gfloat fitness_points=0.0; - gint recovery_points=0; + gint count, i; + Player *player; + gfloat skill_points=0.0; + gfloat fitness_points=0.0; + gint recovery_points=0; - for (count=0; countplayers->len; count++) + for (count=0; countplayers->len; count++) + { + player = &g_array_index(current_team->players, Player, count); + + if (((value_training>0) || (value_recreation>0)) && (player->health == 0)) { - player = &g_array_index(current_team->players, Player, count); - - if (((value_training>0) || (value_recreation>0)) && (player->health == 0)) - { - skill_points=calculate_skill_points((gint) value_training, - number_camp, - player->age, - player->fitness, - player->lsu); + skill_points=calculate_skill_points((gint) value_training, + number_camp, + player->age, + player->fitness, + player->lsu); - fitness_points=calculate_fitness_points((gint) value_training, - (gint) value_recreation, - number_camp, - player->age); + fitness_points=calculate_fitness_points((gint) value_training, + (gint) value_recreation, + number_camp, + player->age); recovery_points=0; - } - else - { - recovery_points = calculate_recovery_points((gint) value_recreation, - number_camp, - player->age); - skill_points=0.0; - fitness_points=0.0; - } - - //Set new values - if ((player->health > 0) && (player->recovery > 0)) - { - //Health & recovery - player->recovery -= recovery_points; - } - else - { - //Skill - if ((player->skill+skill_points) <= (player->talent-2)) - { - player->skill += skill_points; - player->lsu = 0; - - // Functions which are called during a skill-update by player_update_skill() in player.c - player->cskill = player_get_cskill(player, player->cpos, TRUE); - player->value = player_assign_value(player); - - for(i=0; iskill > player->etal[i]) - { - player_estimate_talent(player); - break; - } - } - - //Fitness - player->fitness -= fitness_points; - if (player->fitness > 1) - player->fitness = 1; - else if (player->fitness < 0) - player->fitness = 0; - } } + else + { + recovery_points = calculate_recovery_points((gint) value_recreation, + number_camp, + player->age); + skill_points=0.0; + fitness_points=0.0; + } + + //Set new values + if ((player->health > 0) && (player->recovery > 0)) + { + //Health & recovery + player->recovery -= recovery_points; + } + else + { + //Skill + if ((player->skill+skill_points) <= (player->talent-2)) + { + player->skill += skill_points; + player->lsu = 0; + + // Functions which are called during a skill-update by player_update_skill() in player.c + player->cskill = player_get_cskill(player, player->cpos, TRUE); + player->value = player_assign_value(player); + + for(i=0; iskill > player->etal[i]) + { + player_estimate_talent(player); + break; + } + } + + //Fitness + player->fitness -= fitness_points; + if (player->fitness > 1) + player->fitness = 1; + else if (player->fitness < 0) + player->fitness = 0; + } + } } gfloat @@ -110,110 +112,110 @@ calculate_skill_points(gint value_training, gfloat fitness, gfloat lsu) { - gint training_points=0; - gfloat skill_points=0.0; - gint random=0; + gint training_points=0; + gfloat skill_points=0.0; + gint random=0; - //Calculat training points -> age - if (age < 20) - training_points += 4; - else if (age < 25) - training_points += 3; - else if (age < 30) - training_points += 2; - else - training_points += 1; + //Calculat training points -> age + if (age < 20) + training_points += 4; + else if (age < 25) + training_points += 3; + else if (age < 30) + training_points += 2; + else + training_points += 1; - //Calculat training points -> fittness - if (fitness > 0.75) - training_points += 4; - else if (fitness > 0.50) - training_points += 3; - else if (fitness > 0.25) - training_points += 2; - else - training_points += 1; + //Calculat training points -> fittness + if (fitness > 0.75) + training_points += 4; + else if (fitness > 0.50) + training_points += 3; + else if (fitness > 0.25) + training_points += 2; + else + training_points += 1; - //Calculat training points -> lsu - if (lsu > 15) - training_points += 4; - else if (lsu > 10) - training_points += 3; - else if (lsu > 5) - training_points += 2; - else - training_points += 1; + //Calculat training points -> lsu + if (lsu > 15) + training_points += 4; + else if (lsu > 10) + training_points += 3; + else if (lsu > 5) + training_points += 2; + else + training_points += 1; - //Calculate skill points - random = random_int(1, 3); - skill_points = training_points - random; + //Calculate skill points + random = random_int(1, 3); + skill_points = training_points - random; - if (skill_points == 0) - return skill_points; - else - { - skill_points = skill_points * value_training * number_camp / 100.0; - return skill_points; - } + if (skill_points == 0) + return skill_points; + else + { + skill_points = skill_points * value_training * number_camp / 100.0; + return skill_points; + } } gfloat calculate_fitness_points(gint value_training, - gint value_recreation, + gint value_recreation, gint number_camp, gfloat age) { - gint training_points=0; - gfloat fitness_points=0.0; - gint random=0; + gint training_points=0; + gfloat fitness_points=0.0; + gint random=0; - if (value_recreation > 8) + if (value_recreation > 8) + { + if (value_recreation == 9) { - if (value_recreation == 9) - { - //Calculate fitness points - random = random_int(1, 2); - fitness_points = ((0.02 * number_camp) + (random / 100.0)) * -1; - } - else - { - //Calculate fitness points - random = random_int(1, 2); - fitness_points = ((0.04 * number_camp) + (random / 100.0)) * -1; - } + //Calculate fitness points + random = random_int(1, 2); + fitness_points = ((0.02 * number_camp) + (random / 100.0)) * -1; } else { - //Calculat fitness points -> age - if (age < 20) - training_points += 1; - else if (age < 25) - training_points += 2; - else if (age < 30) - training_points += 3; - else - training_points += 4; + //Calculate fitness points + random = random_int(1, 2); + fitness_points = ((0.04 * number_camp) + (random / 100.0)) * -1; + } + } + else + { + //Calculat fitness points -> age + if (age < 20) + training_points += 1; + else if (age < 25) + training_points += 2; + else if (age < 30) + training_points += 3; + else + training_points += 4; - //Calculat fitness points -> value training - switch (value_training) - { - case 2: training_points += 1; break; - case 3: training_points += 1; break; - case 4: training_points += 2; break; - case 5: training_points += 2; break; - case 6: training_points += 3; break; - case 7: training_points += 3; break; - case 8: training_points += 4; break; - case 9: training_points += 4; break; - case 10: training_points += 5; break; - } - - //Calculate fitness points - random = random_int(1, 2); - fitness_points = (((gfloat) training_points + random) / number_camp) / 100; + //Calculat fitness points -> value training + switch (value_training) + { + case 2: training_points += 1; break; + case 3: training_points += 1; break; + case 4: training_points += 2; break; + case 5: training_points += 2; break; + case 6: training_points += 3; break; + case 7: training_points += 3; break; + case 8: training_points += 4; break; + case 9: training_points += 4; break; + case 10: training_points += 5; break; } - return fitness_points; + //Calculate fitness points + random = random_int(1, 2); + fitness_points = (((gfloat) training_points + random) / number_camp) / 100; + } + + return fitness_points; } @@ -222,66 +224,61 @@ calculate_recovery_points(gint value_recreation, gint number_camp, gfloat age) { - gint training_points=0; - gint recovery_points=0; - gint random=0; + gint training_points=0; + gint recovery_points=0; + gint random=0; - //Calculat recovery points -> age - if (age < 20) - training_points += 4; - else if (age < 25) - training_points += 3; - else if (age < 30) - training_points += 2; - else - training_points += 1; + //Calculat recovery points -> age + if (age < 20) + training_points += 4; + else if (age < 25) + training_points += 3; + else if (age < 30) + training_points += 2; + else + training_points += 1; - //Calculat recovery points -> recreation - switch (value_recreation) - { - case 10: training_points += 4; break; - case 9: training_points += 3; break; - case 8: training_points += 2; break; - case 7: training_points += 1; break; - } + //Calculat recovery points -> recreation + switch (value_recreation) + { + case 10: training_points += 4; break; + case 9: training_points += 3; break; + case 8: training_points += 2; break; + case 7: training_points += 1; break; + } - //Calculate recreation points - random = random_int(1, 2); - recovery_points = (training_points + random) * number_camp; + //Calculate recreation points + random = random_int(1, 2); + recovery_points = (training_points + random) * number_camp; - if (recovery_points > 17) - return 1; - else - return 0; + if (recovery_points > 17) + return 1; + else + return 0; } gint random_int(gint min, gint max) { - gint random=0; - GRand *grand = NULL; + gint random=0; + GRand *grand = NULL; - grand = g_rand_new (); - random = (gint) g_rand_int_range(grand, min, max+1); //random() works until max -1 - return random; + grand = g_rand_new (); + random = (gint) g_rand_int_range(grand, min, max+1); //random() works until max -1 + return random; } void calculateCostsTrainingCamp(gint number_camp) { - gint *money_out = current_user.money_out[0]; - gint *money = ¤t_user.money; + gint *money_out = current_user.money_out[0]; + gint *money = ¤t_user.money; + gfloat factor = finance_wage_unit(current_user.tm); - switch (number_camp) - { - case 1: money_out[MON_OUT_TRAINING_CAMP] -= COSTS_CAMP_1; - *money -= COSTS_CAMP_1; - break; - case 2: money_out[MON_OUT_TRAINING_CAMP] -= COSTS_CAMP_2; - *money -= COSTS_CAMP_2; - break; - case 3: money_out[MON_OUT_TRAINING_CAMP] -= COSTS_CAMP_3; - *money -= COSTS_CAMP_3; - break; - } + gint costs[3] = {factor * const_float("float_training_camp_factor1"), + factor * const_float("float_training_camp_factor2"), + factor * const_float("float_training_camp_factor2")}; + + money_out[MON_OUT_TRAINING_CAMP] -= costs[number_camp - 1]; + *money -= costs[number_camp - 1]; } diff --git a/src/training_callbacks.c b/src/training_callbacks.c index d380f8a1..5c89726a 100755 --- a/src/training_callbacks.c +++ b/src/training_callbacks.c @@ -1,26 +1,26 @@ /* - bet_struct.h + bet_struct.h - Bygfoot Football Manager -- a small and simple GTK2-based - football management game. + Bygfoot Football Manager -- a small and simple GTK2-based + football management game. - http://bygfoot.sourceforge.net + http://bygfoot.sourceforge.net - Copyright (C) 2005 Gyözö Both (gyboth@bygfoot.com) + Copyright (C) 2005 Gyözö Both (gyboth@bygfoot.com) - 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 2 - of the License, or (at your option) any later version. + 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 2 + 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. + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -30,7 +30,11 @@ #include #include "bygfoot.h" +#include "finance.h" #include "game_gui.h" +#include "option.h" +#include "maths.h" +#include "misc.h" #include "support.h" #include "training.h" #include "training_callbacks.h" @@ -45,66 +49,68 @@ void on_b_cancel_clicked (GtkButton *button, gpointer user_data) { - window_destroy(&window.training_camp); + window_destroy(&window.training_camp); } void on_b_ok_clicked (GtkButton *button, gpointer user_data) { - GtkWidget *rb_camp1; + GtkWidget *rb_camp1; GtkWidget *rb_camp2; GtkHScale *hs_recreation; GtkHScale *hs_training; gdouble value_training; - gdouble value_recreation; - gint number_camp; - Team *current_team = current_user.tm; + gdouble value_recreation; + gint number_camp; + Team *current_team = current_user.tm; - //Get active radio - rb_camp1 = GTK_WIDGET(lookup_widget(window.training_camp, "rb_camp1")); + //Get active radio + rb_camp1 = GTK_WIDGET(lookup_widget(window.training_camp, "rb_camp1")); rb_camp2 = GTK_WIDGET(lookup_widget(window.training_camp, "rb_camp2")); - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rb_camp1))) - number_camp = 1; - else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rb_camp2))) - number_camp = 2; - else - number_camp = 3; + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rb_camp1))) + number_camp = 1; + else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rb_camp2))) + number_camp = 2; + else + number_camp = 3; - //Get values for training and recreation + //Get values for training and recreation hs_recreation = GTK_HSCALE(lookup_widget(window.training_camp, "hs_recreation")); hs_training = GTK_HSCALE(lookup_widget(window.training_camp, "hs_training")); value_training = gtk_range_get_value(GTK_RANGE(hs_training)); value_recreation = gtk_range_get_value(GTK_RANGE(hs_recreation)); - //Calculate training camp - calculateTrainingCamp(current_team, value_training, value_recreation, number_camp); + //Calculate training camp + calculateTrainingCamp(current_team, value_training, value_recreation, number_camp); - //Set new av-values -> GUI - game_gui_write_av_skills(current_team); + //Set new av-values -> GUI + game_gui_write_av_skills(current_team); - //Set new player values in GUI - treeview_show_user_player_list(); + //Set new player values in GUI + treeview_show_user_player_list(); - //Calculate costs of the training camp - calculateCostsTrainingCamp(number_camp); + //Calculate costs of the training camp + calculateCostsTrainingCamp(number_camp); - //Set new av-values -> GUI - game_gui_write_money(); + //Set new av-values -> GUI + game_gui_write_money(); - window_destroy(&window.training_camp); + window_destroy(&window.training_camp); } void on_rb_camp3_clicked (GtkButton *button, gpointer user_data) { - GtkEntry *tfCosts; - gchar buf[SMALL]; + GtkEntry *tfCosts; + gchar buf[SMALL]; - sprintf(buf, "%d", COSTS_CAMP_3); - tfCosts = GTK_ENTRY(lookup_widget(window.training_camp, "tf_costs")); + misc_print_grouped_int( + math_round_integer(finance_wage_unit(current_user.tm) * const_float("float_training_camp_factor3"), -2), + buf); + tfCosts = GTK_ENTRY(lookup_widget(window.training_camp, "tf_costs")); gtk_entry_set_text (tfCosts, buf); } @@ -113,24 +119,28 @@ void on_rb_camp2_clicked (GtkButton *button, gpointer user_data) { - GtkEntry *tfCosts; - gchar buf[SMALL]; + GtkEntry *tfCosts; + gchar buf[SMALL]; - sprintf(buf, "%d", COSTS_CAMP_2); - tfCosts = GTK_ENTRY(lookup_widget(window.training_camp, "tf_costs")); + misc_print_grouped_int( + math_round_integer(finance_wage_unit(current_user.tm) * const_float("float_training_camp_factor2"), -2), + buf); + tfCosts = GTK_ENTRY(lookup_widget(window.training_camp, "tf_costs")); gtk_entry_set_text (tfCosts, buf); } void on_rb_camp1_clicked (GtkButton *button, - gpointer user_data) + gpointer user_data) { - GtkEntry *tfCosts; - gchar buf[SMALL]; + GtkEntry *tfCosts; + gchar buf[SMALL]; - sprintf(buf, "%d", COSTS_CAMP_1); - tfCosts = GTK_ENTRY(lookup_widget(window.training_camp, "tf_costs")); + misc_print_grouped_int( + math_round_integer(finance_wage_unit(current_user.tm) * const_float("float_training_camp_factor1"), -2), + buf); + tfCosts = GTK_ENTRY(lookup_widget(window.training_camp, "tf_costs")); gtk_entry_set_text (tfCosts, buf); } @@ -138,23 +148,23 @@ void on_b_dec_recreation_clicked (GtkButton *button, gpointer user_data) { - GtkHScale *hs_camp_points; - GtkHScale *hs_recreation; - gdouble value_camp_points; - gdouble value_recreation; + GtkHScale *hs_camp_points; + GtkHScale *hs_recreation; + gdouble value_camp_points; + gdouble value_recreation; - hs_camp_points = GTK_HSCALE(lookup_widget(window.training_camp, "hs_camp_points")); - hs_recreation = GTK_HSCALE(lookup_widget(window.training_camp, "hs_recreation")); - value_camp_points = gtk_range_get_value(GTK_RANGE(hs_camp_points)); - value_recreation = gtk_range_get_value(GTK_RANGE(hs_recreation)); + hs_camp_points = GTK_HSCALE(lookup_widget(window.training_camp, "hs_camp_points")); + hs_recreation = GTK_HSCALE(lookup_widget(window.training_camp, "hs_recreation")); + value_camp_points = gtk_range_get_value(GTK_RANGE(hs_camp_points)); + value_recreation = gtk_range_get_value(GTK_RANGE(hs_recreation)); - if (value_recreation > CAMP_SCALE_MIN) - { - value_recreation --; - value_camp_points ++; - gtk_range_set_value(GTK_RANGE(hs_recreation), value_recreation); - gtk_range_set_value(GTK_RANGE(hs_camp_points), value_camp_points); - } + if (value_recreation > CAMP_SCALE_MIN) + { + value_recreation --; + value_camp_points ++; + gtk_range_set_value(GTK_RANGE(hs_recreation), value_recreation); + gtk_range_set_value(GTK_RANGE(hs_camp_points), value_camp_points); + } } @@ -162,23 +172,23 @@ void on_b_inc_recreation_clicked (GtkButton *button, gpointer user_data) { - GtkHScale *hs_camp_points; - GtkHScale *hs_recreation; - gdouble value_camp_points; - gdouble value_recreation; + GtkHScale *hs_camp_points; + GtkHScale *hs_recreation; + gdouble value_camp_points; + gdouble value_recreation; - hs_camp_points = GTK_HSCALE(lookup_widget(window.training_camp, "hs_camp_points")); - hs_recreation = GTK_HSCALE(lookup_widget(window.training_camp, "hs_recreation")); - value_camp_points = gtk_range_get_value(GTK_RANGE(hs_camp_points)); - value_recreation = gtk_range_get_value(GTK_RANGE(hs_recreation)); + hs_camp_points = GTK_HSCALE(lookup_widget(window.training_camp, "hs_camp_points")); + hs_recreation = GTK_HSCALE(lookup_widget(window.training_camp, "hs_recreation")); + value_camp_points = gtk_range_get_value(GTK_RANGE(hs_camp_points)); + value_recreation = gtk_range_get_value(GTK_RANGE(hs_recreation)); - if (value_camp_points > CAMP_SCALE_MIN) - { - value_recreation ++; - value_camp_points --; - gtk_range_set_value(GTK_RANGE(hs_recreation), value_recreation); - gtk_range_set_value(GTK_RANGE(hs_camp_points), value_camp_points); - } + if (value_camp_points > CAMP_SCALE_MIN) + { + value_recreation ++; + value_camp_points --; + gtk_range_set_value(GTK_RANGE(hs_recreation), value_recreation); + gtk_range_set_value(GTK_RANGE(hs_camp_points), value_camp_points); + } } @@ -186,23 +196,23 @@ void on_b_dec_training_clicked (GtkButton *button, gpointer user_data) { - GtkHScale *hs_camp_points; - GtkHScale *hs_training; - gdouble value_camp_points; - gdouble value_training; + GtkHScale *hs_camp_points; + GtkHScale *hs_training; + gdouble value_camp_points; + gdouble value_training; - hs_camp_points = GTK_HSCALE(lookup_widget(window.training_camp, "hs_camp_points")); - hs_training = GTK_HSCALE(lookup_widget(window.training_camp, "hs_training")); - value_camp_points = gtk_range_get_value(GTK_RANGE(hs_camp_points)); - value_training = gtk_range_get_value(GTK_RANGE(hs_training)); + hs_camp_points = GTK_HSCALE(lookup_widget(window.training_camp, "hs_camp_points")); + hs_training = GTK_HSCALE(lookup_widget(window.training_camp, "hs_training")); + value_camp_points = gtk_range_get_value(GTK_RANGE(hs_camp_points)); + value_training = gtk_range_get_value(GTK_RANGE(hs_training)); - if (value_training > CAMP_SCALE_MIN) - { - value_training --; - value_camp_points ++; - gtk_range_set_value(GTK_RANGE(hs_training), value_training); - gtk_range_set_value(GTK_RANGE(hs_camp_points), value_camp_points); - } + if (value_training > CAMP_SCALE_MIN) + { + value_training --; + value_camp_points ++; + gtk_range_set_value(GTK_RANGE(hs_training), value_training); + gtk_range_set_value(GTK_RANGE(hs_camp_points), value_camp_points); + } } @@ -210,23 +220,23 @@ void on_b_inc_training_clicked (GtkButton *button, gpointer user_data) { - GtkHScale *hs_camp_points; - GtkHScale *hs_training; - gdouble value_camp_points; - gdouble value_training; + GtkHScale *hs_camp_points; + GtkHScale *hs_training; + gdouble value_camp_points; + gdouble value_training; - hs_camp_points = GTK_HSCALE(lookup_widget(window.training_camp, "hs_camp_points")); - hs_training = GTK_HSCALE(lookup_widget(window.training_camp, "hs_training")); - value_camp_points = gtk_range_get_value(GTK_RANGE(hs_camp_points)); - value_training = gtk_range_get_value(GTK_RANGE(hs_training)); + hs_camp_points = GTK_HSCALE(lookup_widget(window.training_camp, "hs_camp_points")); + hs_training = GTK_HSCALE(lookup_widget(window.training_camp, "hs_training")); + value_camp_points = gtk_range_get_value(GTK_RANGE(hs_camp_points)); + value_training = gtk_range_get_value(GTK_RANGE(hs_training)); - if (value_camp_points > CAMP_SCALE_MIN) - { - value_training ++; - value_camp_points --; - gtk_range_set_value(GTK_RANGE(hs_training), value_training); - gtk_range_set_value(GTK_RANGE(hs_camp_points), value_camp_points); - } + if (value_camp_points > CAMP_SCALE_MIN) + { + value_training ++; + value_camp_points --; + gtk_range_set_value(GTK_RANGE(hs_training), value_training); + gtk_range_set_value(GTK_RANGE(hs_camp_points), value_camp_points); + } } @@ -239,4 +249,3 @@ on_window_training_camp_delete_event (GtkWidget *widget, return TRUE; } - diff --git a/src/training_callbacks.h b/src/training_callbacks.h index e442f5fc..531000b0 100755 --- a/src/training_callbacks.h +++ b/src/training_callbacks.h @@ -66,3 +66,7 @@ gboolean on_window_training_camp_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data); + +void +on_hs_recreation_value_changed (GtkRange *range, + gpointer user_data); diff --git a/src/training_interface.c b/src/training_interface.c index 15c06a94..95317463 100755 --- a/src/training_interface.c +++ b/src/training_interface.c @@ -51,10 +51,10 @@ create_window_training_camp (void) GtkWidget *image4; GtkWidget *hs_camp_points; GtkWidget *hs_training; - GtkWidget *hs_recreation; GtkWidget *b_dec_recreation; GtkWidget *image1; GtkWidget *rb_camp1; + GtkWidget *hs_recreation; window_training_camp = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window_training_camp), _("Training camp")); @@ -171,13 +171,6 @@ create_window_training_camp (void) GTK_WIDGET_UNSET_FLAGS (hs_training, GTK_CAN_FOCUS); gtk_scale_set_value_pos (GTK_SCALE (hs_training), GTK_POS_RIGHT); - hs_recreation = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 1, 10, 1, 0, 0))); - gtk_widget_show (hs_recreation); - gtk_fixed_put (GTK_FIXED (panel_camp), hs_recreation, 220, 120); - gtk_widget_set_size_request (hs_recreation, 200, 36); - GTK_WIDGET_UNSET_FLAGS (hs_recreation, GTK_CAN_FOCUS); - gtk_scale_set_value_pos (GTK_SCALE (hs_recreation), GTK_POS_RIGHT); - b_dec_recreation = gtk_button_new (); gtk_widget_show (b_dec_recreation); gtk_fixed_put (GTK_FIXED (panel_camp), b_dec_recreation, 176, 125); @@ -194,6 +187,13 @@ create_window_training_camp (void) gtk_radio_button_set_group (GTK_RADIO_BUTTON (rb_camp1), rb_camp2_group); rb_camp2_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (rb_camp1)); + hs_recreation = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 1, 10, 1, 0, 0))); + gtk_widget_show (hs_recreation); + gtk_fixed_put (GTK_FIXED (panel_camp), hs_recreation, 220, 120); + gtk_widget_set_size_request (hs_recreation, 200, 36); + GTK_WIDGET_UNSET_FLAGS (hs_recreation, GTK_CAN_FOCUS); + gtk_scale_set_value_pos (GTK_SCALE (hs_recreation), GTK_POS_RIGHT); + g_signal_connect ((gpointer) window_training_camp, "delete_event", G_CALLBACK (on_window_training_camp_delete_event), NULL); @@ -247,10 +247,10 @@ create_window_training_camp (void) GLADE_HOOKUP_OBJECT (window_training_camp, image4, "image4"); GLADE_HOOKUP_OBJECT (window_training_camp, hs_camp_points, "hs_camp_points"); GLADE_HOOKUP_OBJECT (window_training_camp, hs_training, "hs_training"); - GLADE_HOOKUP_OBJECT (window_training_camp, hs_recreation, "hs_recreation"); GLADE_HOOKUP_OBJECT (window_training_camp, b_dec_recreation, "b_dec_recreation"); GLADE_HOOKUP_OBJECT (window_training_camp, image1, "image1"); GLADE_HOOKUP_OBJECT (window_training_camp, rb_camp1, "rb_camp1"); + GLADE_HOOKUP_OBJECT (window_training_camp, hs_recreation, "hs_recreation"); gtk_widget_grab_focus (rb_camp1); return window_training_camp; diff --git a/src/training_struct.h b/src/training_struct.h index 28d4ea22..cfac741a 100755 --- a/src/training_struct.h +++ b/src/training_struct.h @@ -28,10 +28,6 @@ #include "bygfoot.h" -#define COSTS_CAMP_1 200000 -#define COSTS_CAMP_2 400000 -#define COSTS_CAMP_3 600000 - #define CAMP_SCALE_MIN 0 #define CAMP_SCALE_MAX 10 #define CAMP_SCALE_STEP 1 diff --git a/src/window.c b/src/window.c index e93a852f..0c1c4bee 100644 --- a/src/window.c +++ b/src/window.c @@ -38,6 +38,7 @@ #include "load_save.h" #include "main.h" #include "maths.h" +#include "misc.h" #include "misc_callback_func.h" #include "misc_interface.h" #include "misc2_interface.h" @@ -941,7 +942,9 @@ window_show_training_camp(void) window_create(WINDOW_TRAINING_CAMP); // Initialize entry costs - sprintf(buf, "%d", COSTS_CAMP_1); + misc_print_grouped_int( + math_round_integer(finance_wage_unit(current_user.tm) * const_float("float_training_camp_factor1"), -2), + buf); tfCosts = GTK_ENTRY(lookup_widget(window.training_camp, "tf_costs")); gtk_entry_set_text (tfCosts, buf); diff --git a/support_files/bygfoot_constants b/support_files/bygfoot_constants index ce7c3d22..65381af0 100644 --- a/support_files/bygfoot_constants +++ b/support_files/bygfoot_constants @@ -976,3 +976,8 @@ float_transfer_star_prob_decrease 15000 # probability of a star goalie accepting if there's # already one present float_transfer_star_goalie_accepts 12000 + +# wage unit factors for training camp hotel +float_training_camp_factor1 500000 +float_training_camp_factor2 1000000 +float_training_camp_factor3 1500000