1
1
mirror of https://github.com/tstellar/bygfoot.git synced 2025-06-05 21:49:20 +02:00

"Live game commentary in xml files."

This commit is contained in:
gyboth
2005-06-26 11:42:01 +00:00
parent f26d18bf3f
commit 9e55218a2a
35 changed files with 2319 additions and 2167 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

1869
po/de.po

File diff suppressed because it is too large Load Diff

View File

@@ -21,11 +21,11 @@ bygfoot_SOURCES = \
game_gui.c callbacks.h file.h game_gui.h gui.h league.h live_game.h maths.h misc.h option.h support.h team.h treeview.h user.h variables.h window.h \ game_gui.c callbacks.h file.h game_gui.h gui.h league.h live_game.h maths.h misc.h option.h support.h team.h treeview.h user.h variables.h window.h \
gui.c gui.h misc.h support.h variables.h window.h \ gui.c gui.h misc.h support.h variables.h window.h \
interface.c callbacks.h interface.h support.h \ interface.c callbacks.h interface.h support.h \
language.c callbacks.h free.h language.h misc.h option.h variables.h window.h \ language.c callbacks.h free.h language.h lg_commentary.h misc.h option.h variables.h window.h \
lg_commentary.c free.h lg_commentary.h live_game.h main.h misc.h option.h player.h variables.h \ lg_commentary.c file.h free.h lg_commentary.h live_game.h main.h misc.h option.h player.h variables.h xml_lg_commentary.h \
league.c cup.h league.h main.h maths.h misc.h option.h player.h stat.h table.h team.h user.h variables.h \ league.c cup.h free.h league.h main.h maths.h misc.h option.h player.h stat.h table.h team.h user.h variables.h \
live_game.c callbacks.h fixture.h free.h game_gui.h game.h lg_commentary.h live_game.h main.h maths.h misc_callback_func.h option.h player.h support.h team.h treeview.h user.h variables.h window.h \ live_game.c callbacks.h fixture.h free.h game_gui.h game.h lg_commentary.h live_game.h main.h maths.h misc_callback_func.h option.h player.h support.h team.h treeview.h user.h variables.h window.h \
load_save.c callbacks.h file.h game_gui.h gui.h load_save.h option.h support.h user.h variables.h xml.h xml_loadsave_cup.h xml_loadsave_league.h xml_loadsave_misc.h xml_loadsave_season_stats.h xml_loadsave_transfers.h xml_loadsave_users.h \ load_save.c callbacks.h file.h game_gui.h gui.h language.h load_save.h option.h support.h user.h variables.h xml.h xml_loadsave_cup.h xml_loadsave_league.h xml_loadsave_misc.h xml_loadsave_season_stats.h xml_loadsave_transfers.h xml_loadsave_users.h \
main.c file.h free.h language.h live_game.h main.h misc_callbacks.h name_struct.h option.h stat_struct.h transfer_struct.h variables.h window.h \ main.c file.h free.h language.h live_game.h main.h misc_callbacks.h name_struct.h option.h stat_struct.h transfer_struct.h variables.h window.h \
maths.c maths.h misc.h variables.h \ maths.c maths.h misc.h variables.h \
misc.c main.h maths.h misc.h \ misc.c main.h maths.h misc.h \
@@ -66,6 +66,7 @@ bygfoot_SOURCES = \
xml_cup.c cup.h file.h main.h misc.h option.h variables.h xml_cup.h \ xml_cup.c cup.h file.h main.h misc.h option.h variables.h xml_cup.h \
xml_country.c file.h free.h misc.h option.h variables.h xml_country.h xml_cup.h xml_league.h \ xml_country.c file.h free.h misc.h option.h variables.h xml_country.h xml_cup.h xml_league.h \
xml_league.c cup_struct.h file.h free.h league.h misc.h table.h team.h variables.h xml_cup.h xml_league.h \ xml_league.c cup_struct.h file.h free.h league.h misc.h table.h team.h variables.h xml_cup.h xml_league.h \
xml_lg_commentary.c free.h lg_commentary.h live_game.h misc.h variables.h xml_lg_commentary.h \
xml_name.c file.h free.h misc.h name.h variables.h xml_name.h \ xml_name.c file.h free.h misc.h name.h variables.h xml_name.h \
xml_team.c file.h free.h main.h misc.h option.h player.h team.h variables.h xml_team.h xml_team.c file.h free.h main.h misc.h option.h player.h team.h variables.h xml_team.h

View File

@@ -81,6 +81,7 @@ enum ExitCodes
EXIT_OPTION_NOT_FOUND, /**< An option couldn't be found. */ EXIT_OPTION_NOT_FOUND, /**< An option couldn't be found. */
EXIT_POINTER_NOT_FOUND, /**< We didn't find a pointer needed. */ EXIT_POINTER_NOT_FOUND, /**< We didn't find a pointer needed. */
EXIT_INT_NOT_FOUND, /**< We didn't find an integer value (mostly indices). */ EXIT_INT_NOT_FOUND, /**< We didn't find an integer value (mostly indices). */
EXIT_FILE_NOT_FOUND, /**< Some file couldn't be found. */
EXIT_NO_SUPPORT_DIR, /**< No support directory found. */ EXIT_NO_SUPPORT_DIR, /**< No support directory found. */
EXIT_CUP_ROUND_ERROR, /**< Too few cup rounds. */ EXIT_CUP_ROUND_ERROR, /**< Too few cup rounds. */
EXIT_LOAD_TEAM_DEF, /**< Error loading a team definition file. */ EXIT_LOAD_TEAM_DEF, /**< Error loading a team definition file. */

View File

@@ -142,7 +142,7 @@ void
on_button_transfers_clicked (GtkButton *button, on_button_transfers_clicked (GtkButton *button,
gpointer user_data) gpointer user_data)
{ {
if(opt_int("int_opt_disable_transfers")) if(sett_int("int_opt_disable_transfers"))
game_gui_print_message(_("Transfers are disabled in this country definition.")); game_gui_print_message(_("Transfers are disabled in this country definition."));
else if(week < transfer_get_deadline()) else if(week < transfer_get_deadline())
{ {
@@ -393,7 +393,7 @@ void
on_menu_put_on_transfer_list_activate (GtkMenuItem *menuitem, on_menu_put_on_transfer_list_activate (GtkMenuItem *menuitem,
gpointer user_data) gpointer user_data)
{ {
if(opt_int("int_opt_disable_transfers")) if(sett_int("int_opt_disable_transfers"))
game_gui_print_message(_("Transfers are disabled in this country definition.")); game_gui_print_message(_("Transfers are disabled in this country definition."));
else if(selected_row[0] == -1) else if(selected_row[0] == -1)
game_gui_print_message(_("You haven't selected a player.")); game_gui_print_message(_("You haven't selected a player."));
@@ -716,7 +716,7 @@ on_eventbox_boost_button_press_event (GtkWidget *widget,
else else
return FALSE; return FALSE;
if(new_boost == 1 && opt_int("int_opt_disable_boost_on")) if(new_boost == 1 && sett_int("int_opt_disable_boost_on"))
{ {
new_boost = 0; new_boost = 0;
game_gui_print_message(_("Boost ON is disabled in this country definition.")); game_gui_print_message(_("Boost ON is disabled in this country definition."));
@@ -739,7 +739,7 @@ void
on_menu_show_finances_activate (GtkMenuItem *menuitem, on_menu_show_finances_activate (GtkMenuItem *menuitem,
gpointer user_data) gpointer user_data)
{ {
if(opt_int("int_opt_disable_finances")) if(sett_int("int_opt_disable_finances"))
{ {
game_gui_print_message(_("Finances are disabled in this country definition.")); game_gui_print_message(_("Finances are disabled in this country definition."));
return; return;
@@ -758,7 +758,7 @@ void
on_menu_show_stadium_activate (GtkMenuItem *menuitem, on_menu_show_stadium_activate (GtkMenuItem *menuitem,
gpointer user_data) gpointer user_data)
{ {
if(opt_int("int_opt_disable_stadium")) if(sett_int("int_opt_disable_stadium"))
{ {
game_gui_print_message(_("Stadium management is disabled in this country definition.")); game_gui_print_message(_("Stadium management is disabled in this country definition."));
return; return;
@@ -783,7 +783,7 @@ void
on_menu_offer_new_contract_activate (GtkMenuItem *menuitem, on_menu_offer_new_contract_activate (GtkMenuItem *menuitem,
gpointer user_data) gpointer user_data)
{ {
if(opt_int("int_opt_disable_contracts")) if(sett_int("int_opt_disable_contracts"))
{ {
game_gui_print_message(_("Contracts are disabled in this country definition.")); game_gui_print_message(_("Contracts are disabled in this country definition."));
return; return;

View File

@@ -811,6 +811,7 @@ cup_get_round_name(const Cup *cup, gint round, gchar *buf)
switch(cup->rounds->len - round) switch(cup->rounds->len - round)
{ {
default: default:
/* A cup stage, e.g. Last 32 when there are only 32 teams left. */
sprintf(buf, _("Last %d"), (gint)rint(powf(2, cup->rounds->len - round))); sprintf(buf, _("Last %d"), (gint)rint(powf(2, cup->rounds->len - round)));
break; break;
case 1: case 1:

View File

@@ -25,7 +25,7 @@ finance_update_user_weekly(User *user)
const_float("float_finance_scout_factor3"), const_float("float_finance_scout_factor3"),
const_float("float_finance_scout_factor4")}; const_float("float_finance_scout_factor4")};
if(opt_int("int_opt_disable_finances")) if(sett_int("int_opt_disable_finances"))
return; return;
if(week % 2 == 1) if(week % 2 == 1)

View File

@@ -793,8 +793,10 @@ fixture_result_to_buf(const Fixture *fix, gchar *buf)
sprintf(local_buf, "%d - %d", math_sum_int_array(fix->result[0], 3), sprintf(local_buf, "%d - %d", math_sum_int_array(fix->result[0], 3),
math_sum_int_array(fix->result[1], 3)); math_sum_int_array(fix->result[1], 3));
if(fix->result[0][2] + fix->result[1][2] != 0) if(fix->result[0][2] + fix->result[1][2] != 0)
/* Game was decided in penalty shoot-out. */
strcat(local_buf, _(" p.")); strcat(local_buf, _(" p."));
else if(fix->result[0][1] + fix->result[1][1] != 0) else if(fix->result[0][1] + fix->result[1][1] != 0)
/* Game was decided in extra time. */
strcat(local_buf, _(" e.t.")); strcat(local_buf, _(" e.t."));
if(fix->second_leg) if(fix->second_leg)

View File

@@ -450,10 +450,16 @@ free_cup_choose_team(CupChooseTeam *cup_choose_team)
void void
free_variables(void) free_variables(void)
{ {
gint i;
free_option_list(&options, FALSE); free_option_list(&options, FALSE);
free_option_list(&settings, FALSE);
free_option_list(&constants, FALSE); free_option_list(&constants, FALSE);
free_option_list(&constants_app, FALSE); free_option_list(&constants_app, FALSE);
for(i=0;i<LIVE_GAME_EVENT_END;i++)
free_g_string_array(&lg_commentary[i]);
free_g_string(&save_file); free_g_string(&save_file);
g_rand_free(rand_generator); g_rand_free(rand_generator);

View File

@@ -252,7 +252,7 @@ game_initialize(Fixture *fix)
ticket_income = ticket_income =
fix->attendance * const_int("int_team_stadium_ticket_price"); fix->attendance * const_int("int_team_stadium_ticket_price");
if(!opt_int("int_opt_disable_finances") && user_idx[0] != -1 && fix->home_advantage) if(!sett_int("int_opt_disable_finances") && user_idx[0] != -1 && fix->home_advantage)
{ {
usr(user_idx[0]).money += ticket_income; usr(user_idx[0]).money += ticket_income;
usr(user_idx[0]).money_in[1][MON_IN_TICKET] += ticket_income; usr(user_idx[0]).money_in[1][MON_IN_TICKET] += ticket_income;
@@ -863,8 +863,10 @@ game_update_stats_player(gpointer live_game, gconstpointer live_game_unit)
array_index = (own_goal) ? !team : team; array_index = (own_goal) ? !team : team;
if(live_game_unit_before(unit, -1)->event.type == LIVE_GAME_EVENT_PENALTY) if(live_game_unit_before(unit, -1)->event.type == LIVE_GAME_EVENT_PENALTY)
/* A goal scored with penalty. */
strcpy(buf2, _(" (P)")); strcpy(buf2, _(" (P)"));
else if(live_game_unit_before(unit, -1)->event.type == LIVE_GAME_EVENT_FREE_KICK) else if(live_game_unit_before(unit, -1)->event.type == LIVE_GAME_EVENT_FREE_KICK)
/* A goal scored with a free kick. */
strcpy(buf2, _(" (FK)")); strcpy(buf2, _(" (FK)"));
else if(unit->event.type == LIVE_GAME_EVENT_OWN_GOAL) else if(unit->event.type == LIVE_GAME_EVENT_OWN_GOAL)
strcpy(buf2, _(" (OG)")); strcpy(buf2, _(" (OG)"));

View File

@@ -122,7 +122,7 @@ game_gui_live_game_set_hscale(const LiveGameUnit *unit, GtkHScale *hscale)
((unit->possession == 0) ? 1 : -1))); ((unit->possession == 0) ? 1 : -1)));
} }
else if(unit->event.type == LIVE_GAME_EVENT_POST || else if(unit->event.type == LIVE_GAME_EVENT_POST ||
unit->event.type == LIVE_GAME_EVENT_MISSED || unit->event.type == LIVE_GAME_EVENT_MISS ||
unit->event.type == LIVE_GAME_EVENT_SAVE || unit->event.type == LIVE_GAME_EVENT_SAVE ||
unit->event.type == LIVE_GAME_EVENT_CROSS_BAR) unit->event.type == LIVE_GAME_EVENT_CROSS_BAR)
gdk_color_parse(const_app("string_game_gui_live_game_scale_color_miss"), &color); gdk_color_parse(const_app("string_game_gui_live_game_scale_color_miss"), &color);
@@ -199,7 +199,7 @@ game_gui_set_main_window_header(void)
gui_label_set_text_from_int(label_round, week_round, FALSE); gui_label_set_text_from_int(label_round, week_round, FALSE);
gui_label_set_text_from_int(label_rank, week_round, FALSE); gui_label_set_text_from_int(label_rank, week_round, FALSE);
if(!opt_int("int_opt_disable_finances")) if(!sett_int("int_opt_disable_finances"))
{ {
misc_print_grouped_int(current_user.money, buf, FALSE); misc_print_grouped_int(current_user.money, buf, FALSE);
gtk_label_set_text(label_money, buf); gtk_label_set_text(label_money, buf);
@@ -303,7 +303,7 @@ game_gui_read_radio_items(GtkWidget *widget)
{ {
current_user.tm->boost = i - 1; current_user.tm->boost = i - 1;
if(current_user.tm->boost == 1 && opt_int("int_opt_disable_boost_on")) if(current_user.tm->boost == 1 && sett_int("int_opt_disable_boost_on"))
{ {
current_user.tm->boost = 0; current_user.tm->boost = 0;
game_gui_print_message(_("Boost ON is disabled in this country definition.")); game_gui_print_message(_("Boost ON is disabled in this country definition."));

View File

@@ -3,6 +3,7 @@
#include "callbacks.h" #include "callbacks.h"
#include "free.h" #include "free.h"
#include "language.h" #include "language.h"
#include "lg_commentary.h"
#include "misc.h" #include "misc.h"
#include "option.h" #include "option.h"
#include "variables.h" #include "variables.h"
@@ -30,11 +31,13 @@ language_set(gint index)
if(window.main != NULL) if(window.main != NULL)
{ {
window_destroy(&window.main, FALSE); window_destroy(&window.main, FALSE);
window_create(WINDOW_MAIN); window_create(WINDOW_MAIN);
on_button_back_to_main_clicked(NULL, NULL); on_button_back_to_main_clicked(NULL, NULL);
} }
} }
lg_commentary_load_commentary_file_from_option();
free_g_string_array(&codes); free_g_string_array(&codes);
} }

View File

@@ -1,3 +1,6 @@
#include <locale.h>
#include "file.h"
#include "free.h" #include "free.h"
#include "lg_commentary.h" #include "lg_commentary.h"
#include "live_game.h" #include "live_game.h"
@@ -6,6 +9,7 @@
#include "option.h" #include "option.h"
#include "player.h" #include "player.h"
#include "variables.h" #include "variables.h"
#include "xml_lg_commentary.h"
/** Generate commentary for the live game event in the unit. /** Generate commentary for the live game event in the unit.
@param unit The unit we comment. @param unit The unit we comment.
@@ -14,22 +18,35 @@ void
lg_commentary_generate(LiveGameUnit *unit, const Fixture *fix) lg_commentary_generate(LiveGameUnit *unit, const Fixture *fix)
{ {
gchar *strings[LG_TOKEN_END][2]; gchar *strings[LG_TOKEN_END][2];
GPtrArray *commentaries = NULL;
gchar buf[SMALL]; gchar buf[SMALL];
GPtrArray **commentaries = NULL;
gint i; gint i;
lg_commentary_set_strings(strings, unit, fix); lg_commentary_set_strings(strings, unit, fix);
if(unit->event.type == LIVE_GAME_EVENT_STYLE_CHANGE_ALL_OUT_DEFEND ||
unit->event.type == LIVE_GAME_EVENT_STYLE_CHANGE_DEFEND ||
unit->event.type == LIVE_GAME_EVENT_STYLE_CHANGE_BALANCED ||
unit->event.type == LIVE_GAME_EVENT_STYLE_CHANGE_ATTACK ||
unit->event.type == LIVE_GAME_EVENT_STYLE_CHANGE_ALL_OUT_ATTACK)
commentaries = &lg_commentary[LIVE_GAME_EVENT_STYLE_CHANGE_ALL_OUT_DEFEND];
else if(unit->event.type == LIVE_GAME_EVENT_BOOST_CHANGE_ANTI ||
unit->event.type == LIVE_GAME_EVENT_BOOST_CHANGE_OFF ||
unit->event.type == LIVE_GAME_EVENT_BOOST_CHANGE_ON)
commentaries = &lg_commentary[LIVE_GAME_EVENT_BOOST_CHANGE_ANTI];
else
commentaries = &lg_commentary[unit->event.type];
commentaries = lg_commentary_get_commentaries(unit->event.type); *commentaries = misc_randomise_g_pointer_array(*commentaries);
for(i=0;i<commentaries->len;i++) for(i=0;i<(*commentaries)->len;i++)
{ {
if(lg_commentary_replace_tokens( if(lg_commentary_replace_tokens(
((GString*)g_ptr_array_index(commentaries, i))->str, strings, buf)) ((GString*)g_ptr_array_index((*commentaries), i))->str, strings, buf))
break; break;
} }
if(i == commentaries->len) if(i == (*commentaries)->len)
{ {
g_warning("lg_commentary_generate: didn't find fitting commentary for unit type %d \n", g_warning("lg_commentary_generate: didn't find fitting commentary for unit type %d \n",
unit->event.type); unit->event.type);
@@ -40,8 +57,6 @@ lg_commentary_generate(LiveGameUnit *unit, const Fixture *fix)
for(i=LG_TOKEN_ATTENDANCE;i<LG_TOKEN_END;i++) for(i=LG_TOKEN_ATTENDANCE;i<LG_TOKEN_END;i++)
g_free(strings[i][1]); g_free(strings[i][1]);
free_g_string_array(&commentaries);
} }
/** Try to replace all special tokens in the string and write the result to dest. /** Try to replace all special tokens in the string and write the result to dest.
@@ -70,253 +85,6 @@ lg_commentary_replace_tokens(const gchar *string, gchar *strings[][2], gchar *de
return TRUE; return TRUE;
} }
/** Get an array of commentary strings with tokens depending on
the live game event. */
GPtrArray*
lg_commentary_get_commentaries(gint event_type)
{
GPtrArray *commentaries = g_ptr_array_new();
if(event_type == LIVE_GAME_EVENT_STYLE_CHANGE_ALL_OUT_DEFEND ||
event_type == LIVE_GAME_EVENT_STYLE_CHANGE_DEFEND ||
event_type == LIVE_GAME_EVENT_STYLE_CHANGE_BALANCED ||
event_type == LIVE_GAME_EVENT_STYLE_CHANGE_ATTACK ||
event_type == LIVE_GAME_EVENT_STYLE_CHANGE_ALL_OUT_ATTACK)
g_ptr_array_add(commentaries, g_string_new(_("TT has changed their style to EX")));
else if(event_type == LIVE_GAME_EVENT_BOOST_CHANGE_ANTI ||
event_type == LIVE_GAME_EVENT_BOOST_CHANGE_OFF ||
event_type == LIVE_GAME_EVENT_BOOST_CHANGE_ON)
g_ptr_array_add(commentaries, g_string_new(_("TT has changed their boost to EX")));
else
{
switch(event_type)
{
default:
g_warning("lg_commentary_get_commentaries: unknown event type %d. \n", event_type);
break;
case LIVE_GAME_EVENT_GENERAL:
g_ptr_array_add(commentaries, g_string_new(_("P2 feeds the ball through to P1")));
g_ptr_array_add(commentaries, g_string_new(_("P2 threads a great ball to P1 ")));
g_ptr_array_add(commentaries, g_string_new(_("Lovely pass from P2 releases P1")));
g_ptr_array_add(commentaries, g_string_new(_("Long floating pass from P2 finds P1")));
g_ptr_array_add(commentaries, g_string_new(_("Good passing move across the pitch and down the right")));
g_ptr_array_add(commentaries, g_string_new(_("Quick passing move down the left")));
g_ptr_array_add(commentaries, g_string_new(_("P2 cross controlled by P1 who slips past his man")));
g_ptr_array_add(commentaries, g_string_new(_("Another decent move down the wing")));
g_ptr_array_add(commentaries, g_string_new(_("P1 latches onto P2's pass")));
g_ptr_array_add(commentaries, g_string_new(_("P2 needles ball through players and finds P1")));
g_ptr_array_add(commentaries, g_string_new(_("P2 controls it with his chest and passes to P1")));
g_ptr_array_add(commentaries, g_string_new(_("P2 heads the ball towards P1")));
g_ptr_array_add(commentaries, g_string_new(_("P1 twisting and turning again")));
g_ptr_array_add(commentaries, g_string_new(_("P1 rips through the midfield")));
g_ptr_array_add(commentaries, g_string_new(_("P1 spins past his marker")));
break;
case LIVE_GAME_EVENT_LOST_POSSESSION:
g_ptr_array_add(commentaries, g_string_new(_("P1 wins the ball with a perfectly timed challenge")));
g_ptr_array_add(commentaries, g_string_new(_("Bad control by P2 lets P1 steal the ball off him")));
g_ptr_array_add(commentaries, g_string_new(_("P1 takes the ball away from P2 with a sliding tackle")));
g_ptr_array_add(commentaries, g_string_new(_("Loose ball falls to P1")));
break;
case LIVE_GAME_EVENT_FOUL:
g_ptr_array_add(commentaries, g_string_new(_("Oww, nasty tackle on P1")));
g_ptr_array_add(commentaries, g_string_new(_("Surely that's a sending off offence")));
g_ptr_array_add(commentaries, g_string_new(_("P2 knocks over P1 with a double footed lunge")));
g_ptr_array_add(commentaries, g_string_new(_("Crunching challenge on P1")));
g_ptr_array_add(commentaries, g_string_new(_("P1 gets his legs taken away from him by P2")));
g_ptr_array_add(commentaries, g_string_new(_("Slicing challenge by P2 on P1")));
g_ptr_array_add(commentaries, g_string_new(_("Vicious tackle from P2 leaves P1 lying on the floor in agony")));
g_ptr_array_add(commentaries, g_string_new(_("Ouch that's got to hurt")));
g_ptr_array_add(commentaries, g_string_new(_("Extremely high boot from P2 sends P1 to the ground")));
break;
case LIVE_GAME_EVENT_SCORING_CHANCE:
g_ptr_array_add(commentaries, g_string_new(_("P1 charges towards goal and shoots!")));
g_ptr_array_add(commentaries, g_string_new(_("P1 spins and shoots")));
g_ptr_array_add(commentaries, g_string_new(_("Long ball from P2 finds P1 at far post")));
g_ptr_array_add(commentaries, g_string_new(_("P1 can't quite get it under control but his miss kick heads toward goal")));
g_ptr_array_add(commentaries, g_string_new(_("P1 shoots from 22 yards looks like it's going wide")));
g_ptr_array_add(commentaries, g_string_new(_("P1 dribbles into the box, turns inside the defence and fires")));
g_ptr_array_add(commentaries, g_string_new(_("P1 cuts in from the left flank and shoots")));
g_ptr_array_add(commentaries, g_string_new(_("P1 tries his luck from 30 yards")));
g_ptr_array_add(commentaries, g_string_new(_("P1 arrows shot towards top left corner")));
g_ptr_array_add(commentaries, g_string_new(_("P1 shoots from close range")));
g_ptr_array_add(commentaries, g_string_new(_("Great ball from P2 sends P1 one on one with the goalkeeper")));
g_ptr_array_add(commentaries, g_string_new(_("P1's overhead kick heads towards the top right hand corner")));
g_ptr_array_add(commentaries, g_string_new(_("P1 spins past two defenders, wrong foots the keeper and back heels the ball towards goal")));
g_ptr_array_add(commentaries, g_string_new(_("P2 lays the ball off to P1 who sends a rocket of a shot towards goal")));
break;
case LIVE_GAME_EVENT_GOAL:
g_ptr_array_add(commentaries, g_string_new(_("Goal!!!")));
g_ptr_array_add(commentaries, g_string_new(_("And the ball is smacked into the back of the net!!!")));
g_ptr_array_add(commentaries, g_string_new(_("P1 scores!!!")));
g_ptr_array_add(commentaries, g_string_new(_("And the ball flies straight past P2 and into the back of the net!!!")));
g_ptr_array_add(commentaries, g_string_new(_("The ball flies past P2 and it's a goal!!!")));
g_ptr_array_add(commentaries, g_string_new(_("P1 wheels away in celebration after a great goal sent the fans wild")));
g_ptr_array_add(commentaries, g_string_new(_("P2's despairing dive can't keep P1's shot out and the ball is in the back of the net!!!")));
g_ptr_array_add(commentaries, g_string_new(_("The dance ignites the fans, P1 celebrates in his own special fashion")));
break;
case LIVE_GAME_EVENT_MISSED:
g_ptr_array_add(commentaries, g_string_new(_("P1 fired wide!")));
g_ptr_array_add(commentaries, g_string_new(_("P1 should have squared the ball went alone and lashed wide")));
g_ptr_array_add(commentaries, g_string_new(_("Defender clears")));
g_ptr_array_add(commentaries, g_string_new(_("P1 curls ball over")));
g_ptr_array_add(commentaries, g_string_new(_("Defender back to block just as it seemed to open up")));
g_ptr_array_add(commentaries, g_string_new(_("P1 smacks into row Z")));
g_ptr_array_add(commentaries, g_string_new(_("And the shot creeps just past the post")));
break;
case LIVE_GAME_EVENT_SAVE:
g_ptr_array_add(commentaries, g_string_new(_("P2's fingertips flicks it wide")));
g_ptr_array_add(commentaries, g_string_new(_("P2 forced to tip P1's shot over the crossbar")));
g_ptr_array_add(commentaries, g_string_new(_("Great pace shown by P1 to get to the ball first but P2 produced superb block tackle")));
g_ptr_array_add(commentaries, g_string_new(_("Low shot taken well to his left by P2")));
g_ptr_array_add(commentaries, g_string_new(_("P2 makes a superb reflex save to tip wide")));
g_ptr_array_add(commentaries, g_string_new(_("P2 runs at P1 and blocks shot with ankle")));
g_ptr_array_add(commentaries, g_string_new(_("Easy save for the goalkeeper")));
g_ptr_array_add(commentaries, g_string_new(_("Caught well by P2")));
break;
case LIVE_GAME_EVENT_START_MATCH:
g_ptr_array_add(commentaries, g_string_new(_("It's a crowd of AT here as the whistle blows")));
g_ptr_array_add(commentaries, g_string_new(_("We're under way")));
g_ptr_array_add(commentaries, g_string_new(_("The two teams are greeted by a wall of noise as they take to the pitch")));
g_ptr_array_add(commentaries, g_string_new(_("The crowd roars as the players run out from the tunnel to start the match")));
g_ptr_array_add(commentaries, g_string_new(_("A cloudless day, gives the impression this match is going to sparkle")));
g_ptr_array_add(commentaries, g_string_new(_("AT fans can't be wrong, this is the match we have all come to watch")));
g_ptr_array_add(commentaries, g_string_new(_("The referee gets the nod from the linesman and we are away")));
g_ptr_array_add(commentaries, g_string_new(_("The clash of the titans kicks off")));
g_ptr_array_add(commentaries, g_string_new(_("The referees are ready, players set, the battle begins")));
break;
case LIVE_GAME_EVENT_HALF_TIME:
g_ptr_array_add(commentaries, g_string_new(_("It's half time")));
g_ptr_array_add(commentaries, g_string_new(_("It's a RE at half time.")));
g_ptr_array_add(commentaries, g_string_new(_("It's a RE at half time, TL's manager has to find something special to spur his team on.")));
g_ptr_array_add(commentaries, g_string_new(_("TL heads into the tunnel to await the managers scolding")));
g_ptr_array_add(commentaries, g_string_new(_("TW are just 45 minutes away from a stunning victory")));
g_ptr_array_add(commentaries, g_string_new(_("TL's manager cops a rollicking from the fans as he turns from the dugout")));
g_ptr_array_add(commentaries, g_string_new(_("There are two teams out there and only one of them is playing football")));
break;
case LIVE_GAME_EVENT_EXTRA_TIME:
g_ptr_array_add(commentaries, g_string_new(_("After a close match the game heads into extra time")));
g_ptr_array_add(commentaries, g_string_new(_("It's still RE: extra time")));
g_ptr_array_add(commentaries, g_string_new(_("After MI minutes it's still RE: extra time")));
g_ptr_array_add(commentaries, g_string_new(_("Who will breakdown first, extra time it is")));
g_ptr_array_add(commentaries, g_string_new(_("It's down to determination and fitness now as we head into extra time")));
break;
case LIVE_GAME_EVENT_PENALTIES:
g_ptr_array_add(commentaries, g_string_new(_("Who would have thought MI minutes ago it would come down to this")));
g_ptr_array_add(commentaries, g_string_new(_("And now we have the tense drama of a penalty shoot out")));
g_ptr_array_add(commentaries, g_string_new(_("Two teams, equall till now in every respect,face off in penalties")));
g_ptr_array_add(commentaries, g_string_new(_("The teams cant do it so now it's one on one. Striker against goalie")));
break;
case LIVE_GAME_EVENT_END_MATCH:
g_ptr_array_add(commentaries, g_string_new(_("The match is over!")));
g_ptr_array_add(commentaries, g_string_new(_("TW are triumphant!!!")));
g_ptr_array_add(commentaries, g_string_new(_("The fans boo TL off the pitch")));
g_ptr_array_add(commentaries, g_string_new(_("After MI minutes the match ends with a RE")));
g_ptr_array_add(commentaries, g_string_new(_("The referee checks his watch and blows for full time")));
g_ptr_array_add(commentaries, g_string_new(_("Well that's that. It ends RE")));
g_ptr_array_add(commentaries, g_string_new(_("RE, what an astonishing result for TW")));
break;
case LIVE_GAME_EVENT_OWN_GOAL:
g_ptr_array_add(commentaries, g_string_new(_("Ohh no, the ball ricocheted off P1 into the net")));
g_ptr_array_add(commentaries, g_string_new(_("It's a pinball in the penalty box, finally spinning off P1 across the line")));
g_ptr_array_add(commentaries, g_string_new(_("Oh that's a great shot and it's deflected off P1 and into the back of the net")));
g_ptr_array_add(commentaries, g_string_new(_("P1 passes the ball back to his goalie, oh no the keepers missed it! It's an own goal by P1!")));
g_ptr_array_add(commentaries, g_string_new(_("That little missunderstanding has cost TT a goal")));
break;
case LIVE_GAME_EVENT_HEADER:
g_ptr_array_add(commentaries, g_string_new(_("P2 chips the ball towards P1 who heads the ball towards goal")));
g_ptr_array_add(commentaries, g_string_new(_("Diving header by P1")));
g_ptr_array_add(commentaries, g_string_new(_("He just floated in midair for ages then thunder heads it towards home")));
break;
case LIVE_GAME_EVENT_POST:
g_ptr_array_add(commentaries, g_string_new(_("Sweet strike by P1, hits the post")));
g_ptr_array_add(commentaries, g_string_new(_("And the shot glances wide off the post")));
g_ptr_array_add(commentaries, g_string_new(_("I'm suprised the post has managed to withstand that cracking shot")));
break;
case LIVE_GAME_EVENT_CROSS_BAR:
g_ptr_array_add(commentaries, g_string_new(_("Ball dinked over P2 but hit crossbar and bounced to safety")));
g_ptr_array_add(commentaries, g_string_new(_("The ball smacks into the crossbar with P2 stranded")));
g_ptr_array_add(commentaries, g_string_new(_("P2 seemed to be everywhere at once, finally tipping the ball off the crossbar")));
break;
case LIVE_GAME_EVENT_PENALTY:
g_ptr_array_add(commentaries, g_string_new(_("P1 steps up to take the penalty")));
g_ptr_array_add(commentaries, g_string_new(_("P1 has a chance to score with a penalty kick")));
g_ptr_array_add(commentaries, g_string_new(_("P1 has missed a penalty before but he now has a chance to redeem himself")));
g_ptr_array_add(commentaries, g_string_new(_("You have to bury the nerves, swallow and concentrate when your taking penalties")));
break;
case LIVE_GAME_EVENT_FREE_KICK:
g_ptr_array_add(commentaries, g_string_new(_("Short free-kick from P1")));
g_ptr_array_add(commentaries, g_string_new(_("P1 drives free kick low and hard")));
g_ptr_array_add(commentaries, g_string_new(_("P1 takes free-kick quickly and curls around wall")));
g_ptr_array_add(commentaries, g_string_new(_("P1 curls the free kick over the wall")));
g_ptr_array_add(commentaries, g_string_new(_("Free kick: P1 plays the ball out wide")));
g_ptr_array_add(commentaries, g_string_new(_("Free kick: P1 hits a long ball up the pitch")));
g_ptr_array_add(commentaries, g_string_new(_("Free kick whipped across the face of goal by P1")));
break;
case LIVE_GAME_EVENT_FOUL_YELLOW:
g_ptr_array_add(commentaries, g_string_new(_("P2 for dangerous slide tackle on P1")));
g_ptr_array_add(commentaries, g_string_new(_("P2 for foul on P1")));
g_ptr_array_add(commentaries, g_string_new(_("P2 for kicking ball away ")));
g_ptr_array_add(commentaries, g_string_new(_("P2 for time wasting")));
g_ptr_array_add(commentaries, g_string_new(_("P2 for handball")));
g_ptr_array_add(commentaries, g_string_new(_("P2 for stopping P1 taking a quick free-kick")));
g_ptr_array_add(commentaries, g_string_new(_("P2 is booked for repeated dissent")));
break;
case LIVE_GAME_EVENT_FOUL_RED:
g_ptr_array_add(commentaries, g_string_new(_("P2 is reprimanded for high kicking")));
g_ptr_array_add(commentaries, g_string_new(_("P2 is given his marching orders for contempt")));
g_ptr_array_add(commentaries, g_string_new(_("P2 for malicious showing of studs")));
g_ptr_array_add(commentaries, g_string_new(_("P2 for intentional handball")));
g_ptr_array_add(commentaries, g_string_new(_("P2 is sent off for stopping a clear goal scoring opportunity")));
g_ptr_array_add(commentaries, g_string_new(_("P2 has been red carded for punching P1")));
g_ptr_array_add(commentaries, g_string_new(_("P2 for swearing at opposition fans")));
break;
case LIVE_GAME_EVENT_FOUL_RED_INJURY:
g_ptr_array_add(commentaries, g_string_new(_("P2 fouls and the stretcher bearers come racing on with P1 lying in agony on the turf")));
g_ptr_array_add(commentaries, g_string_new(_("Foul by P2; P1 seems to be injured... he might have to be substituted")));
break;
case LIVE_GAME_EVENT_SEND_OFF:
g_ptr_array_add(commentaries, g_string_new(_("P1 has been sent off")));
break;
case LIVE_GAME_EVENT_INJURY:
g_ptr_array_add(commentaries, g_string_new(_("P1 will have to go off after what seems an ankle injury")));
g_ptr_array_add(commentaries, g_string_new(_("P1 looks like he's badly injured")));
break;
case LIVE_GAME_EVENT_TEMP_INJURY:
g_ptr_array_add(commentaries, g_string_new(_("P1 has pulled a muscle but should be able to continue")));
g_ptr_array_add(commentaries, g_string_new(_("P1 has picked up a slight knock")));
g_ptr_array_add(commentaries, g_string_new(_("P1 has a large cut above his left eye but it has been patched up and he will be able to continue ")));
break;
case LIVE_GAME_EVENT_STADIUM_BREAKDOWN:
g_ptr_array_add(commentaries, g_string_new(_("TH is undergoing stadium problems")));
g_ptr_array_add(commentaries, g_string_new(_("The floodlights have just gone out")));
break;
case LIVE_GAME_EVENT_STADIUM_RIOTS:
g_ptr_array_add(commentaries, g_string_new(_("The peasants are revolting")));
g_ptr_array_add(commentaries, g_string_new(_("And the fans are throwing flares onto the pitch")));
g_ptr_array_add(commentaries, g_string_new(_("The riot police have moved in to stop fighting between sets of oppostion supporters")));
g_ptr_array_add(commentaries, g_string_new(_("A fan has managed to get onto the pitch and has begun to attack the referee")));
g_ptr_array_add(commentaries, g_string_new(_("The fans pour onto the pitch in a full scale pitch invasion")));
break;
case LIVE_GAME_EVENT_STADIUM_FIRE:
g_ptr_array_add(commentaries, g_string_new(_("Fire consumes TT's stadium")));
g_ptr_array_add(commentaries, g_string_new(_("Away fans have set fire to the north stand")));
g_ptr_array_add(commentaries, g_string_new(_("A flare chucked onto the touchline has started a massive blaze")));
g_ptr_array_add(commentaries, g_string_new(_("A speaker has gone up in flames and the blaze spreading around the entire stadium")));
break;
case LIVE_GAME_EVENT_SUBSTITUTION:
g_ptr_array_add(commentaries, g_string_new(_("TT make a substitution, P1 comes on to replace P2")));
g_ptr_array_add(commentaries, g_string_new(_("P2 goes off to applause from the fans, P1 replaces him")));
g_ptr_array_add(commentaries, g_string_new(_("P2 is booed off the pitch as he is replaced by P1")));
break;
case LIVE_GAME_EVENT_STRUCTURE_CHANGE:
g_ptr_array_add(commentaries, g_string_new(_("TT has changed their structure to EX")));
break;
}
}
return misc_randomise_g_pointer_array(commentaries);
}
/** Get the strings corresponding to the commentary tokens. */ /** Get the strings corresponding to the commentary tokens. */
void void
lg_commentary_set_strings(gchar *strings[][2], const LiveGameUnit *unit, const Fixture *fix) lg_commentary_set_strings(gchar *strings[][2], const LiveGameUnit *unit, const Fixture *fix)
@@ -405,7 +173,7 @@ lg_commentary_get_player_name(const LiveGameUnit *unit, const Fixture *fix, gboo
unit->event.player)->name->str); unit->event.player)->name->str);
} }
else if(unit->event.type == LIVE_GAME_EVENT_GOAL || else if(unit->event.type == LIVE_GAME_EVENT_GOAL ||
unit->event.type == LIVE_GAME_EVENT_MISSED || unit->event.type == LIVE_GAME_EVENT_MISS ||
unit->event.type == LIVE_GAME_EVENT_SAVE || unit->event.type == LIVE_GAME_EVENT_SAVE ||
unit->event.type == LIVE_GAME_EVENT_POST || unit->event.type == LIVE_GAME_EVENT_POST ||
unit->event.type == LIVE_GAME_EVENT_CROSS_BAR) unit->event.type == LIVE_GAME_EVENT_CROSS_BAR)
@@ -493,3 +261,55 @@ lg_commentary_get_extra_data(const LiveGameUnit *unit, const Fixture *fix)
return g_strdup(buf); return g_strdup(buf);
} }
/** Load the appropriate commentary file by evaluating
the language option. */
void
lg_commentary_load_commentary_file_from_option(void)
{
gchar buf[SMALL], commentary_file[SMALL];
gchar *cur_locale = setlocale(LC_MESSAGES, NULL);
if(strcmp(opt_str("string_opt_language_code"), "") == 0)
{
strncpy(buf, cur_locale, 2);
buf[2] = '\0';
}
else if(strcmp(opt_str("string_opt_language_code"), "C") == 0)
strcpy(buf, "en");
else
{
strncpy(buf, opt_str("string_opt_language_code"), 2);
buf[2] = '\0';
}
sprintf(commentary_file, "lg_commentary_%s.xml", buf);
lg_commentary_load_commentary_file(commentary_file, FALSE);
}
/** Load the commentary file given. Abort if not found and abort=TRUE,
load default english file otherwise. */
void
lg_commentary_load_commentary_file(const gchar *commentary_file, gboolean abort)
{
gchar *file_name = file_find_support_file(commentary_file, FALSE);
gchar buf[SMALL];
if(file_name != NULL)
{
xml_lg_commentary_read(file_name);
g_free(file_name);
}
else
{
if(abort)
{
sprintf(buf, "lg_commentary_load_commentary_file: file %s not found \n",
file_name);
main_exit_program(EXIT_FILE_NOT_FOUND, buf);
}
else
lg_commentary_load_commentary_file("lg_commentary_en.xml", TRUE);
}
}

View File

@@ -33,14 +33,16 @@ lg_commentary_set_strings(gchar *strings[][2], const LiveGameUnit *unit, const F
void void
lg_commentary_generate(LiveGameUnit *unit, const Fixture *fix); lg_commentary_generate(LiveGameUnit *unit, const Fixture *fix);
GPtrArray*
lg_commentary_get_commentaries(gint event_type);
gchar* gchar*
lg_commentary_get_extra_data(const LiveGameUnit *unit, const Fixture *fix); lg_commentary_get_extra_data(const LiveGameUnit *unit, const Fixture *fix);
gboolean gboolean
lg_commentary_replace_tokens(const gchar *string, gchar *strings[][2], gchar *dest); lg_commentary_replace_tokens(const gchar *string, gchar *strings[][2], gchar *dest);
#endif void
lg_commentary_load_commentary_file_from_option(void);
void
lg_commentary_load_commentary_file(const gchar *commentary_file, gboolean abort);
#endif

View File

@@ -674,7 +674,7 @@ live_game_event_general(gboolean create_new)
} }
else if(last_unit.event.type == LIVE_GAME_EVENT_GOAL || else if(last_unit.event.type == LIVE_GAME_EVENT_GOAL ||
last_unit.event.type == LIVE_GAME_EVENT_OWN_GOAL || last_unit.event.type == LIVE_GAME_EVENT_OWN_GOAL ||
last_unit.event.type == LIVE_GAME_EVENT_MISSED || last_unit.event.type == LIVE_GAME_EVENT_MISS ||
last_unit.event.type == LIVE_GAME_EVENT_SAVE || last_unit.event.type == LIVE_GAME_EVENT_SAVE ||
last_unit.event.type == LIVE_GAME_EVENT_POST || last_unit.event.type == LIVE_GAME_EVENT_POST ||
last_unit.event.type == LIVE_GAME_EVENT_CROSS_BAR) last_unit.event.type == LIVE_GAME_EVENT_CROSS_BAR)
@@ -1474,7 +1474,7 @@ live_game_event_get_verbosity(gint event_type)
event_type == LIVE_GAME_EVENT_HEADER || event_type == LIVE_GAME_EVENT_HEADER ||
event_type == LIVE_GAME_EVENT_FREE_KICK || event_type == LIVE_GAME_EVENT_FREE_KICK ||
event_type == LIVE_GAME_EVENT_POST || event_type == LIVE_GAME_EVENT_POST ||
event_type == LIVE_GAME_EVENT_MISSED || event_type == LIVE_GAME_EVENT_MISS ||
event_type == LIVE_GAME_EVENT_CROSS_BAR || event_type == LIVE_GAME_EVENT_CROSS_BAR ||
event_type == LIVE_GAME_EVENT_SAVE) event_type == LIVE_GAME_EVENT_SAVE)
return_value = 1; return_value = 1;

View File

@@ -25,7 +25,7 @@ enum LiveGameEventType
LIVE_GAME_EVENT_GOAL, LIVE_GAME_EVENT_GOAL,
LIVE_GAME_EVENT_OWN_GOAL, LIVE_GAME_EVENT_OWN_GOAL,
LIVE_GAME_EVENT_POST, LIVE_GAME_EVENT_POST,
LIVE_GAME_EVENT_MISSED, LIVE_GAME_EVENT_MISS,
LIVE_GAME_EVENT_SAVE, LIVE_GAME_EVENT_SAVE,
LIVE_GAME_EVENT_CROSS_BAR, LIVE_GAME_EVENT_CROSS_BAR,
LIVE_GAME_EVENT_FOUL, LIVE_GAME_EVENT_FOUL,

View File

@@ -2,6 +2,7 @@
#include "file.h" #include "file.h"
#include "gui.h" #include "gui.h"
#include "game_gui.h" #include "game_gui.h"
#include "language.h"
#include "load_save.h" #include "load_save.h"
#include "option.h" #include "option.h"
#include "support.h" #include "support.h"
@@ -188,6 +189,7 @@ load_save_load_game(const gchar* filename)
file_load_opt_file(buf, &options); file_load_opt_file(buf, &options);
sprintf(buf, "%s___constants", prefix); sprintf(buf, "%s___constants", prefix);
file_load_opt_file(buf, &constants); file_load_opt_file(buf, &constants);
language_set(language_get_code_index(opt_str("string_opt_language_code")) + 1);
if(debug > 60) if(debug > 60)
printf("load_save_load leagues \n"); printf("load_save_load leagues \n");

View File

@@ -54,9 +54,9 @@ main_init_variables(void)
save_file = g_string_new(""); save_file = g_string_new("");
constants_app.list = constants_app.list = settings.list =
constants.list = options.list = NULL; constants.list = options.list = NULL;
constants_app.datalist = constants_app.datalist = settings.datalist =
constants.datalist = options.datalist = NULL; constants.datalist = options.datalist = NULL;
popups_active = 0; popups_active = 0;
@@ -64,17 +64,20 @@ main_init_variables(void)
timeout_id = -1; timeout_id = -1;
for(i=0;i<LIVE_GAME_EVENT_END;i++)
lg_commentary[i] = g_ptr_array_new();
file_load_conf_files(); file_load_conf_files();
language_set(language_get_code_index(opt_str("string_opt_language_code")) + 1); language_set(language_get_code_index(opt_str("string_opt_language_code")) + 1);
/** Some of these (or all) are disabled (set to 1) in supernational /** Some of these (or all) are disabled (set to 1) in supernational
country defs. */ country defs. */
option_add(&options, "int_opt_disable_finances", 0, NULL); option_add(&settings, "int_opt_disable_finances", 0, NULL);
option_add(&options, "int_opt_disable_transfers", 0, NULL); option_add(&settings, "int_opt_disable_transfers", 0, NULL);
option_add(&options, "int_opt_disable_stadium", 0, NULL); option_add(&settings, "int_opt_disable_stadium", 0, NULL);
option_add(&options, "int_opt_disable_contracts", 0, NULL); option_add(&settings, "int_opt_disable_contracts", 0, NULL);
option_add(&options, "int_opt_disable_boost_on", 0, NULL); option_add(&settings, "int_opt_disable_boost_on", 0, NULL);
} }
/** /**

View File

@@ -131,7 +131,10 @@ option_add(OptionList *optionlist, const gchar *name, gint int_value, const gcha
{ {
gint i; gint i;
Option new; Option new;
gpointer element = g_datalist_get_data(&optionlist->datalist, name); gpointer element = NULL;
if(optionlist->list != NULL)
g_datalist_get_data(&optionlist->datalist, name);
if(element != NULL) if(element != NULL)
{ {
@@ -143,8 +146,14 @@ option_add(OptionList *optionlist, const gchar *name, gint int_value, const gcha
new.value = int_value; new.value = int_value;
new.string_value = (string_value == NULL) ? NULL : g_string_new(string_value); new.string_value = (string_value == NULL) ? NULL : g_string_new(string_value);
g_array_append_val(optionlist->list, new); if(optionlist->list == NULL)
{
optionlist->list = g_array_new(FALSE, FALSE, sizeof(Option));
g_datalist_init(&optionlist->datalist);
}
g_array_append_val(optionlist->list, new);
for(i=0;i<optionlist->list->len;i++) for(i=0;i<optionlist->list->len;i++)
g_datalist_set_data(&optionlist->datalist, g_array_index(optionlist->list, Option, i).name->str, g_datalist_set_data(&optionlist->datalist, g_array_index(optionlist->list, Option, i).name->str,
&g_array_index(optionlist->list, Option, i)); &g_array_index(optionlist->list, Option, i));

View File

@@ -33,6 +33,9 @@
#define const_int(name) option_int(name, &constants) #define const_int(name) option_int(name, &constants)
#define const_float(name) option_float(name, &constants) #define const_float(name) option_float(name, &constants)
#define sett_int(name) option_int(name, &settings)
#define sett_set_int(name, value) option_set_int(name, &settings, value)
gfloat gfloat
option_float(const gchar *name, OptionList *optionlist); option_float(const gchar *name, OptionList *optionlist);

View File

@@ -1012,11 +1012,11 @@ player_update_weekly(Team *tm, gint idx)
{ {
pl->age += 0.0192; pl->age += 0.0192;
if(!opt_int("int_opt_disable_contracts")) if(!sett_int("int_opt_disable_contracts"))
pl->contract -= 0.0192; pl->contract -= 0.0192;
} }
if(!opt_int("int_opt_disable_contracts") && debug < 50 && if(!sett_int("int_opt_disable_contracts") && debug < 50 &&
pl->contract * 12 <= opt_user_int("int_opt_user_contract_limit") && pl->contract * 12 <= opt_user_int("int_opt_user_contract_limit") &&
(pl->contract + 0.0192) * 12 > opt_user_int("int_opt_user_contract_limit")) (pl->contract + 0.0192) * 12 > opt_user_int("int_opt_user_contract_limit"))
{ {

View File

@@ -512,10 +512,13 @@ team_attribute_to_char(gint attribute, gint value)
switch(value) switch(value)
{ {
case -1: case -1:
/* Boost value. */
return _("ANTI"); return _("ANTI");
case 0: case 0:
/* Boost value. */
return _("OFF"); return _("OFF");
case 1: case 1:
/* Boost value. */
return _("ON"); return _("ON");
} }
break; break;
@@ -967,15 +970,18 @@ team_write_own_results(const Team *tm, gchar *buf, gboolean sort)
if(res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] != current_user.tm] > if(res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] != current_user.tm] >
res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] == current_user.tm]) res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] == current_user.tm])
/* a won match */
sprintf(buf2, _("W %d : %d"), sprintf(buf2, _("W %d : %d"),
res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] != current_user.tm], res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] != current_user.tm],
res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] == current_user.tm]); res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] == current_user.tm]);
else if(res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] != current_user.tm] < else if(res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] != current_user.tm] <
res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] == current_user.tm]) res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] == current_user.tm])
/* a lost match */
sprintf(buf2, _("L %d : %d"), sprintf(buf2, _("L %d : %d"),
res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] != current_user.tm], res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] != current_user.tm],
res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] == current_user.tm]); res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] == current_user.tm]);
else else
/* a drawn match */
sprintf(buf2, _("Dw %d : %d"), sprintf(buf2, _("Dw %d : %d"),
res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] != current_user.tm], res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] != current_user.tm],
res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] == current_user.tm]); res[((Fixture*)g_ptr_array_index(matches, i))->teams[0] == current_user.tm]);
@@ -985,11 +991,13 @@ team_write_own_results(const Team *tm, gchar *buf, gboolean sort)
if(((Fixture*)g_ptr_array_index(matches, i))->teams[0] == current_user.tm) if(((Fixture*)g_ptr_array_index(matches, i))->teams[0] == current_user.tm)
{ {
/* a match at home */
sprintf(buf3, _("%s (H) "), buf2); sprintf(buf3, _("%s (H) "), buf2);
place = 0; place = 0;
} }
else else
{ {
/* a match away */
sprintf(buf3, _("<span background='%s' foreground='%s'>%s (A) </span> "), sprintf(buf3, _("<span background='%s' foreground='%s'>%s (A) </span> "),
const_app("string_treeview_live_game_commentary_away_bg"), const_app("string_treeview_live_game_commentary_away_bg"),
const_app("string_treeview_live_game_commentary_away_fg"), const_app("string_treeview_live_game_commentary_away_fg"),
@@ -999,6 +1007,7 @@ team_write_own_results(const Team *tm, gchar *buf, gboolean sort)
} }
else else
{ {
/* a match on neutral ground */
sprintf(buf3, _("%s (N) "), buf2); sprintf(buf3, _("%s (N) "), buf2);
place = -1; place = -1;
} }
@@ -1048,11 +1057,14 @@ team_write_results(const Team *tm, gchar *result_buf, gchar *goals_buf)
g_ptr_array_index(latest_fixtures, i))-> g_ptr_array_index(latest_fixtures, i))->
result[(((Fixture*)g_ptr_array_index(latest_fixtures, i))->teams[0] == tm)], 2); result[(((Fixture*)g_ptr_array_index(latest_fixtures, i))->teams[0] == tm)], 2);
if(res[0] == res[1]) if(res[0] == res[1])
/* draw */
strcat(result_buf, _("Dw ")); strcat(result_buf, _("Dw "));
else if(res[(((Fixture*)g_ptr_array_index(latest_fixtures, i))->teams[0] == tm)] > else if(res[(((Fixture*)g_ptr_array_index(latest_fixtures, i))->teams[0] == tm)] >
res[(((Fixture*)g_ptr_array_index(latest_fixtures, i))->teams[0] != tm)]) res[(((Fixture*)g_ptr_array_index(latest_fixtures, i))->teams[0] != tm)])
/* lost */
strcat(result_buf, _("L ")); strcat(result_buf, _("L "));
else else
/* won */
strcat(result_buf, _("W ")); strcat(result_buf, _("W "));
} }

View File

@@ -20,7 +20,7 @@ transfer_update(void)
gint i, j; gint i, j;
if(week > transfer_get_deadline() || if(week > transfer_get_deadline() ||
opt_int("int_opt_disable_transfers")) sett_int("int_opt_disable_transfers"))
return; return;
if(week == transfer_get_deadline()) if(week == transfer_get_deadline())

View File

@@ -134,8 +134,8 @@ treeview_set_up_team_selection_treeview(GtkTreeView *treeview)
gtk_tree_view_column_add_attribute(col, renderer, gtk_tree_view_column_add_attribute(col, renderer,
"text", 3); "text", 3);
/* Average skill */
col = gtk_tree_view_column_new(); col = gtk_tree_view_column_new();
/* Average skill */
gtk_tree_view_column_set_title(col, _("Av.Sk.")); gtk_tree_view_column_set_title(col, _("Av.Sk."));
gtk_tree_view_column_set_sort_column_id(col, 4); gtk_tree_view_column_set_sort_column_id(col, 4);
gtk_tree_view_append_column(treeview, col); gtk_tree_view_append_column(treeview, col);
@@ -244,17 +244,28 @@ treeview_set_up_player_list(GtkTreeView *treeview, gint *attributes, gint max,
GtkCellRenderer *renderer; GtkCellRenderer *renderer;
gchar *titles[PLAYER_LIST_ATTRIBUTE_END] = gchar *titles[PLAYER_LIST_ATTRIBUTE_END] =
{_("Name"), {_("Name"),
/* Current position of a player. */
_("CPos"), _("CPos"),
/* Position of a player. */
_("Pos"), _("Pos"),
/* Current skill of a player. */
_("CSk"), _("CSk"),
/* Skill of a player. */
_("Sk"), _("Sk"),
/* Fitness of a player. */
_("Fit"), _("Fit"),
/* Games of a player. */
_("Ga"), _("Ga"),
/* Shots of a player. */
_("Sh"), _("Sh"),
/* Goals of a player. */
_("Go"), _("Go"),
/* Status of a player. */
_("Status"), _("Status"),
/* Yellow cards of a player. */
_("YC"), _("YC"),
_("Age"), _("Age"),
/* Estimated talent of a player. */
_("Etal"), _("Etal"),
_("Value"), _("Value"),
_("Wage"), _("Wage"),
@@ -651,6 +662,7 @@ treeview_create_game_stats(LiveGame *live_game)
gchar buf[2][SMALL]; gchar buf[2][SMALL];
gchar buf3[SMALL]; gchar buf3[SMALL];
gchar *categories[LIVE_GAME_STAT_VALUE_END] = gchar *categories[LIVE_GAME_STAT_VALUE_END] =
/* 'Normal' goals, ie. no penalties or free kicks. */
{_("Goals (regular)"), {_("Goals (regular)"),
_("Shots"), _("Shots"),
_("Shot %"), _("Shot %"),
@@ -1021,6 +1033,7 @@ treeview_table_write_header(GtkListStore *ls, const Table *table, gint number)
symbol = cup_from_clid(table->clid)->symbol->str; symbol = cup_from_clid(table->clid)->symbol->str;
if(g_array_index(cup_from_clid(table->clid)->rounds, CupRound, if(g_array_index(cup_from_clid(table->clid)->rounds, CupRound,
table->round).tables->len > 1) table->round).tables->len > 1)
/* A group of a round robin stage of a cup. */
sprintf(buf, _("%s Group %d"), cup_from_clid(table->clid)->name->str, number); sprintf(buf, _("%s Group %d"), cup_from_clid(table->clid)->name->str, number);
else else
sprintf(buf, "%s", cup_from_clid(table->clid)->name->str); sprintf(buf, "%s", cup_from_clid(table->clid)->name->str);
@@ -1134,13 +1147,21 @@ treeview_set_up_table(GtkTreeView *treeview)
GtkCellRenderer *renderer; GtkCellRenderer *renderer;
gchar *titles[9] = gchar *titles[9] =
{_("Team"), {_("Team"),
/* Games played (a number). */
_("PL"), _("PL"),
/* Games won. */
_("W"), _("W"),
/* Games drawn. */
_("Dw"), _("Dw"),
/* Games lost. */
_("L"), _("L"),
/* Goals for. */
_("GF"), _("GF"),
/* Goals against. */
_("GA"), _("GA"),
/* Goal difference. */
_("GD"), _("GD"),
/* Points. */
_("PTS")}; _("PTS")};
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(treeview), gtk_tree_selection_set_mode(gtk_tree_view_get_selection(treeview),
@@ -1254,6 +1275,7 @@ treeview_create_finances(const User* user)
_("Physio"), _("Physio"),
_("Scout"), _("Scout"),
_("Journey costs"), _("Journey costs"),
/* Money paid to players a user fired. */
_("Compensations")}; _("Compensations")};
GtkTreeIter iter; GtkTreeIter iter;
@@ -1264,6 +1286,7 @@ treeview_create_finances(const User* user)
G_TYPE_STRING); G_TYPE_STRING);
gtk_list_store_append(ls, &iter); gtk_list_store_append(ls, &iter);
/* Finances balance. */
gtk_list_store_set(ls, &iter, 0, _("Bi-weekly balance"), 1, "", 2, "", -1); gtk_list_store_set(ls, &iter, 0, _("Bi-weekly balance"), 1, "", 2, "", -1);
for(i=0;i<MON_IN_TRANSFERS;i++) for(i=0;i<MON_IN_TRANSFERS;i++)
@@ -1288,6 +1311,7 @@ treeview_create_finances(const User* user)
misc_print_grouped_int(balance, buf, FALSE); misc_print_grouped_int(balance, buf, FALSE);
gtk_list_store_append(ls, &iter); gtk_list_store_append(ls, &iter);
/* Finances balance. */
gtk_list_store_set(ls, &iter, 0, _("Balance"), 1, "", 2, "", -1); gtk_list_store_set(ls, &iter, 0, _("Balance"), 1, "", 2, "", -1);
if(balance >= 0) if(balance >= 0)
strcpy(buf2, buf); strcpy(buf2, buf);
@@ -1353,6 +1377,7 @@ treeview_create_finances(const User* user)
2, "", -1); 2, "", -1);
misc_print_grouped_int(user->sponsor.benefit, buf, FALSE); misc_print_grouped_int(user->sponsor.benefit, buf, FALSE);
/* Contract time and money a sponsor pays. */
sprintf(buf2, _("%.1f months / %s"), ((gfloat)user->sponsor.contract) / 4, buf); sprintf(buf2, _("%.1f months / %s"), ((gfloat)user->sponsor.contract) / 4, buf);
gtk_list_store_append(ls, &iter); gtk_list_store_append(ls, &iter);
gtk_list_store_set(ls, &iter, 0, _("Contract / Money"), 1, buf2, 2, "", -1); gtk_list_store_set(ls, &iter, 0, _("Contract / Money"), 1, buf2, 2, "", -1);
@@ -1553,7 +1578,8 @@ treeview_create_next_opponent(void)
gtk_list_store_set(ls, &iter, 0, _("Goals"), 1, buf2, -1); gtk_list_store_set(ls, &iter, 0, _("Goals"), 1, buf2, -1);
team_write_own_results(opp, buf, FALSE); team_write_own_results(opp, buf, FALSE);
gtk_list_store_append(ls, &iter); gtk_list_store_append(ls, &iter);
/* The user's results against a specific team. */
gtk_list_store_set(ls, &iter, 0, _("Your results"), 1, buf, -1); gtk_list_store_set(ls, &iter, 0, _("Your results"), 1, buf, -1);
return GTK_TREE_MODEL(ls); return GTK_TREE_MODEL(ls);
@@ -1781,6 +1807,8 @@ treeview_create_player_info(const Player *pl)
_("Wage"), _("Wage"),
_("Contract"), _("Contract"),
_("Games/Goals\n"), _("Games/Goals\n"),
/* 'Limit' is the number of yellow cards until a player gets
banned automatically for a match. */
_("Yellow cards (limit)\n"), _("Yellow cards (limit)\n"),
_("Banned\n"), _("Banned\n"),
_("Career values"), _("Career values"),
@@ -1925,7 +1953,9 @@ treeview_set_up_user_history(GtkTreeView *treeview)
gint i; gint i;
GtkTreeViewColumn *col; GtkTreeViewColumn *col;
GtkCellRenderer *renderer; GtkCellRenderer *renderer;
gchar *titles[3] ={_("Sea"), _("Week"), _("Team")}; /* Season. */
gchar *titles[3] ={_("Sea"),
_("Week"), _("Team")};
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(treeview), gtk_tree_selection_set_mode(gtk_tree_view_get_selection(treeview),
GTK_SELECTION_NONE); GTK_SELECTION_NONE);
@@ -1990,7 +2020,9 @@ treeview_create_league_stats(GtkListStore *ls, const LeagueStat *league_stat)
gchar *team_icons[2] = {const_app("string_treeview_league_stats_off_teams_icon"), gchar *team_icons[2] = {const_app("string_treeview_league_stats_off_teams_icon"),
const_app("string_treeview_league_stats_def_teams_icon")}; const_app("string_treeview_league_stats_def_teams_icon")};
gchar *player_titles[2][2] = {{_("Best goal scorers"), _("Shot %")}, gchar *player_titles[2][2] = {{_("Best goal scorers"), _("Shot %")},
{_("Best goalkeepers"), _("Save %")}}; {_("Best goalkeepers"),
/* % of saves for goalies (#goals / #shots) */
_("Save %")}};
gchar *player_icons[2] = {const_app("string_treeview_league_stats_scorers_icon"), gchar *player_icons[2] = {const_app("string_treeview_league_stats_scorers_icon"),
const_app("string_treeview_league_stats_goalies_icon")}; const_app("string_treeview_league_stats_goalies_icon")};
gchar *colour_fg = NULL, *colour_bg = NULL; gchar *colour_fg = NULL, *colour_bg = NULL;
@@ -2041,7 +2073,9 @@ treeview_create_league_stats(GtkListStore *ls, const LeagueStat *league_stat)
gtk_list_store_append(ls, &iter); gtk_list_store_append(ls, &iter);
treeview_helper_insert_icon(ls, &iter, 0, player_icons[i]); treeview_helper_insert_icon(ls, &iter, 0, player_icons[i]);
gtk_list_store_set(ls, &iter, 1, const_int("int_treeview_helper_int_empty"), gtk_list_store_set(ls, &iter, 1, const_int("int_treeview_helper_int_empty"),
/* Goals. */
2, player_titles[i][0], 3, _("Go"), 2, player_titles[i][0], 3, _("Go"),
/* Goals per game. */
4, _("Go/Ga"), 5, player_titles[i][1], -1); 4, _("Go/Ga"), 5, player_titles[i][1], -1);
for(j=0;j<players[i]->len;j++) for(j=0;j<players[i]->len;j++)
@@ -2330,6 +2364,7 @@ treeview_create_language_list(void)
misc_separate_strings(const_str("string_language_symbols")); misc_separate_strings(const_str("string_language_symbols"));
gtk_list_store_append(ls, &iter); gtk_list_store_append(ls, &iter);
/* Language is system-set (not user chosen). */
gtk_list_store_set(ls, &iter, 0, NULL, 1, _("System"), -1); gtk_list_store_set(ls, &iter, 0, NULL, 1, _("System"), -1);
for(i=0;i<names->len;i++) for(i=0;i<names->len;i++)

View File

@@ -186,8 +186,8 @@ treeview_helper_live_game_icon(gint event_type)
return const_app("string_live_game_event_cross_bar_icon"); return const_app("string_live_game_event_cross_bar_icon");
else if(event_type == LIVE_GAME_EVENT_SAVE) else if(event_type == LIVE_GAME_EVENT_SAVE)
return const_app("string_live_game_event_save_icon"); return const_app("string_live_game_event_save_icon");
else if(event_type == LIVE_GAME_EVENT_MISSED) else if(event_type == LIVE_GAME_EVENT_MISS)
return const_app("string_live_game_event_missed_icon"); return const_app("string_live_game_event_miss_icon");
else if(event_type == LIVE_GAME_EVENT_FOUL) else if(event_type == LIVE_GAME_EVENT_FOUL)
return const_app("string_live_game_event_foul_icon"); return const_app("string_live_game_event_foul_icon");
else if(event_type == LIVE_GAME_EVENT_FOUL_YELLOW) else if(event_type == LIVE_GAME_EVENT_FOUL_YELLOW)
@@ -776,6 +776,7 @@ treeview_helper_player_info_banned_to_cell(GtkCellRenderer *renderer, const GArr
for(i=0;i<cards->len;i++) for(i=0;i<cards->len;i++)
if(g_array_index(cards, PlayerCard, i).red > 0) if(g_array_index(cards, PlayerCard, i).red > 0)
{ {
/* Ban info of a player in the format: 'Cup/league name: Number of weeks banned' */
sprintf(buf2, _("%s: %d weeks\n"), sprintf(buf2, _("%s: %d weeks\n"),
league_cup_get_name_string(g_array_index(cards, PlayerCard, i).clid), league_cup_get_name_string(g_array_index(cards, PlayerCard, i).clid),
g_array_index(cards, PlayerCard, i).red); g_array_index(cards, PlayerCard, i).red);
@@ -811,6 +812,8 @@ treeview_helper_player_info_yellow_to_cell(GtkCellRenderer *renderer, const GArr
g_array_index(cards, PlayerCard, i).yellow, yellow_red); g_array_index(cards, PlayerCard, i).yellow, yellow_red);
} }
else else
/* Yellow cards of a player in a cup/league. No limit means there isn't a limit
after which the player gets banned for a match automatically. */
sprintf(buf2, _("%s: %d (no limit)\n"), sprintf(buf2, _("%s: %d (no limit)\n"),
league_cup_get_name_string(g_array_index(cards, PlayerCard, i).clid), league_cup_get_name_string(g_array_index(cards, PlayerCard, i).clid),
g_array_index(cards, PlayerCard, i).yellow); g_array_index(cards, PlayerCard, i).yellow);
@@ -960,6 +963,7 @@ treeview_helper_player_name_to_cell(GtkCellRenderer *renderer, gchar *buf, const
strcpy(buf, pl->name->str); strcpy(buf, pl->name->str);
if(pl->team == current_user.tm && if(pl->team == current_user.tm &&
opt_user_int("int_opt_user_penalty_shooter") == pl->id) opt_user_int("int_opt_user_penalty_shooter") == pl->id)
/* Penalty shooter. */
strcat(buf, _(" (P)")); strcat(buf, _(" (P)"));
if(off != NULL) if(off != NULL)
@@ -1065,6 +1069,7 @@ treeview_helper_player_status_to_cell(GtkCellRenderer *renderer, gchar *buf, con
if(pl->health != PLAYER_INJURY_NONE) if(pl->health != PLAYER_INJURY_NONE)
{ {
/* Injury info. */
sprintf(buf, _("INJ(%d)"), pl->recovery); sprintf(buf, _("INJ(%d)"), pl->recovery);
g_object_set(renderer, "background", g_object_set(renderer, "background",
const_app("string_treeview_helper_color_player_injury"), NULL); const_app("string_treeview_helper_color_player_injury"), NULL);
@@ -1074,11 +1079,13 @@ treeview_helper_player_status_to_cell(GtkCellRenderer *renderer, gchar *buf, con
if(ban > 0) if(ban > 0)
{ {
/* Red card info (how long the player is banned). */
sprintf(buf, _("BAN(%d)"), ban); sprintf(buf, _("BAN(%d)"), ban);
g_object_set(renderer, "background", g_object_set(renderer, "background",
const_app("string_treeview_helper_color_player_banned"), NULL); const_app("string_treeview_helper_color_player_banned"), NULL);
} }
else else
/* Player status: ok. */
strcpy(buf, _("OK")); strcpy(buf, _("OK"));
if(ban == -1) if(ban == -1)
@@ -1146,6 +1153,7 @@ treeview_helper_player_pos_to_cell(GtkCellRenderer *renderer, gchar *buf, gint p
switch(pos) switch(pos)
{ {
default: default:
/* Goalie */
strcpy(buf, _("G")); strcpy(buf, _("G"));
g_object_set(renderer, "background", g_object_set(renderer, "background",
const_app("string_treeview_helper_color_player_pos_goalie_bg"), const_app("string_treeview_helper_color_player_pos_goalie_bg"),
@@ -1153,6 +1161,7 @@ treeview_helper_player_pos_to_cell(GtkCellRenderer *renderer, gchar *buf, gint p
const_app("string_treeview_helper_color_player_pos_goalie_fg"), NULL); const_app("string_treeview_helper_color_player_pos_goalie_fg"), NULL);
break; break;
case PLAYER_POS_DEFENDER: case PLAYER_POS_DEFENDER:
/* Defender */
strcpy(buf, _("D")); strcpy(buf, _("D"));
g_object_set(renderer, "background", g_object_set(renderer, "background",
const_app("string_treeview_helper_color_player_pos_defender_bg"), const_app("string_treeview_helper_color_player_pos_defender_bg"),
@@ -1160,6 +1169,7 @@ treeview_helper_player_pos_to_cell(GtkCellRenderer *renderer, gchar *buf, gint p
const_app("string_treeview_helper_color_player_pos_defender_fg"), NULL); const_app("string_treeview_helper_color_player_pos_defender_fg"), NULL);
break; break;
case PLAYER_POS_MIDFIELDER: case PLAYER_POS_MIDFIELDER:
/* Midfielder */
strcpy(buf, _("M")); strcpy(buf, _("M"));
g_object_set(renderer, "background", g_object_set(renderer, "background",
const_app("string_treeview_helper_color_player_pos_midfielder_bg"), const_app("string_treeview_helper_color_player_pos_midfielder_bg"),
@@ -1167,6 +1177,7 @@ treeview_helper_player_pos_to_cell(GtkCellRenderer *renderer, gchar *buf, gint p
const_app("string_treeview_helper_color_player_pos_midfielder_fg"), NULL); const_app("string_treeview_helper_color_player_pos_midfielder_fg"), NULL);
break; break;
case PLAYER_POS_FORWARD: case PLAYER_POS_FORWARD:
/* Forward */
strcpy(buf, _("F")); strcpy(buf, _("F"));
g_object_set(renderer, "background", g_object_set(renderer, "background",
const_app("string_treeview_helper_color_player_pos_forward_bg"), const_app("string_treeview_helper_color_player_pos_forward_bg"),

View File

@@ -101,7 +101,7 @@ user_set_up_team(User *user)
user_set_up_finances(user); user_set_up_finances(user);
user_set_up_counters(user); user_set_up_counters(user);
user->counters[COUNT_USER_NEW_SPONSOR] = (opt_int("int_opt_disable_finances")) ? -5 : 1; user->counters[COUNT_USER_NEW_SPONSOR] = (sett_int("int_opt_disable_finances")) ? -5 : 1;
} }
@@ -463,17 +463,20 @@ user_event_show_next(void)
case EVENT_TYPE_TRANSFER_OFFER_REJECTED_WAGE: case EVENT_TYPE_TRANSFER_OFFER_REJECTED_WAGE:
misc_print_grouped_int(event->value1, buf2, FALSE); misc_print_grouped_int(event->value1, buf2, FALSE);
misc_print_grouped_int(event->value2, buf3, FALSE); misc_print_grouped_int(event->value2, buf3, FALSE);
/* A player from a team has rejected a transfer offer. */
sprintf(buf, _("%s of %s has rejected your offer (%s / %s). He wasn't satisfied with the wage you offered."), sprintf(buf, _("%s of %s has rejected your offer (%s / %s). He wasn't satisfied with the wage you offered."),
event->value_string->str, event->value_string->str,
((Team*)event->value_pointer)->name->str, buf2, buf3); ((Team*)event->value_pointer)->name->str, buf2, buf3);
game_gui_show_warning(buf); game_gui_show_warning(buf);
break; break;
case EVENT_TYPE_TRANSFER_OFFER_MONEY: case EVENT_TYPE_TRANSFER_OFFER_MONEY:
/* Buy a player from a team. */
sprintf(buf, _("You didn't have enough money to buy %s from %s."), sprintf(buf, _("You didn't have enough money to buy %s from %s."),
event->value_string->str, ((Team*)event->value_pointer)->name->str); event->value_string->str, ((Team*)event->value_pointer)->name->str);
game_gui_show_warning(buf); game_gui_show_warning(buf);
break; break;
case EVENT_TYPE_TRANSFER_OFFER_ROSTER: case EVENT_TYPE_TRANSFER_OFFER_ROSTER:
/* Buy a player from a team. */
sprintf(buf, _("Your roster is full. You couldn't buy %s from %s."), sprintf(buf, _("Your roster is full. You couldn't buy %s from %s."),
event->value_string->str, ((Team*)event->value_pointer)->name->str); event->value_string->str, ((Team*)event->value_pointer)->name->str);
game_gui_show_warning(buf); game_gui_show_warning(buf);
@@ -669,58 +672,69 @@ user_history_to_string(const UserHistory *history, gchar *buf)
g_warning("user_history_to_string: unknown history type %d.\n", history->type); g_warning("user_history_to_string: unknown history type %d.\n", history->type);
strcpy(buf, "FIXME!!!"); strcpy(buf, "FIXME!!!");
case USER_HISTORY_START_GAME: case USER_HISTORY_START_GAME:
/* Buy a team in a league. */
sprintf(buf, _("You start the game with %s in the %s."), sprintf(buf, _("You start the game with %s in the %s."),
team_of_id(history->team_id)->name->str, team_of_id(history->team_id)->name->str,
league_cup_get_name_string(history->value1)); league_cup_get_name_string(history->value1));
break; break;
case USER_HISTORY_FIRE_FINANCES: case USER_HISTORY_FIRE_FINANCES:
/* Team fires, team in a league. */
sprintf(buf, _("%s fires you because of financial mismanagement.\nYou find a new job with %s in the %s."), sprintf(buf, _("%s fires you because of financial mismanagement.\nYou find a new job with %s in the %s."),
team_of_id(history->team_id)->name->str, team_of_id(history->team_id)->name->str,
team_of_id(history->value1)->name->str, team_of_id(history->value1)->name->str,
league_cup_get_name_string(history->value2)); league_cup_get_name_string(history->value2));
break; break;
case USER_HISTORY_FIRE_FAILURE: case USER_HISTORY_FIRE_FAILURE:
/* Team fires, team in a league. */
sprintf(buf, _("%s fires you because of unsuccessfulness.\nYou find a new job with %s in the %s."), sprintf(buf, _("%s fires you because of unsuccessfulness.\nYou find a new job with %s in the %s."),
team_of_id(history->team_id)->name->str, team_of_id(history->team_id)->name->str,
team_of_id(history->value1)->name->str, team_of_id(history->value1)->name->str,
league_cup_get_name_string(history->value2)); league_cup_get_name_string(history->value2));
break; break;
case USER_HISTORY_JOB_OFFER_ACCEPTED: case USER_HISTORY_JOB_OFFER_ACCEPTED:
/* Team in a league. Leave team. */
sprintf(buf, _("%s offer you a job in the %s.\nYou accept the challenge and leave %s."), sprintf(buf, _("%s offer you a job in the %s.\nYou accept the challenge and leave %s."),
team_of_id(history->value1)->name->str, team_of_id(history->value1)->name->str,
league_cup_get_name_string(history->value2), league_cup_get_name_string(history->value2),
team_of_id(history->team_id)->name->str); team_of_id(history->team_id)->name->str);
break; break;
case USER_HISTORY_END_SEASON: case USER_HISTORY_END_SEASON:
/* League name. */
sprintf(buf, _("You finish the season in the %s on rank %d."), sprintf(buf, _("You finish the season in the %s on rank %d."),
league_cup_get_name_string(history->value1), league_cup_get_name_string(history->value1),
history->value2); history->value2);
break; break;
case USER_HISTORY_PROMOTED: case USER_HISTORY_PROMOTED:
/* League name. */
sprintf(buf, _("You get promoted to the %s."), sprintf(buf, _("You get promoted to the %s."),
league_cup_get_name_string(history->value1)); league_cup_get_name_string(history->value1));
break; break;
case USER_HISTORY_RELEGATED: case USER_HISTORY_RELEGATED:
/* League name. */
sprintf(buf, _("You get relegated to the %s."), sprintf(buf, _("You get relegated to the %s."),
league_cup_get_name_string(history->value1)); league_cup_get_name_string(history->value1));
break; break;
case USER_HISTORY_WIN_FINAL: case USER_HISTORY_WIN_FINAL:
/* Cup name, team name. */
sprintf(buf, _("You win the %s final against %s."), sprintf(buf, _("You win the %s final against %s."),
league_cup_get_name_string(history->value1), league_cup_get_name_string(history->value1),
history->value_string->str); history->value_string->str);
break; break;
case USER_HISTORY_LOSE_FINAL: case USER_HISTORY_LOSE_FINAL:
/* Cup name, team name. */
sprintf(buf, _("You lose in the %s final against %s."), sprintf(buf, _("You lose in the %s final against %s."),
league_cup_get_name_string(history->value1), league_cup_get_name_string(history->value1),
history->value_string->str); history->value_string->str);
break; break;
case USER_HISTORY_REACH_CUP_ROUND: case USER_HISTORY_REACH_CUP_ROUND:
cup_get_round_name(cup_from_clid(history->value1), history->value2, buf2); cup_get_round_name(cup_from_clid(history->value1), history->value2, buf2);
/* Cup round name (e.g. Last 32), number, cup name. */
sprintf(buf, _("You reach the %s (round %d) of the %s."), buf2, sprintf(buf, _("You reach the %s (round %d) of the %s."), buf2,
history->value2 + 1, history->value2 + 1,
league_cup_get_name_string(history->value1)); league_cup_get_name_string(history->value1));
break; break;
case USER_HISTORY_CHAMPION: case USER_HISTORY_CHAMPION:
/* League name. */
sprintf(buf, _("You are champion of the %s!"), sprintf(buf, _("You are champion of the %s!"),
league_cup_get_name_string(history->value1)); league_cup_get_name_string(history->value1));
break; break;
@@ -748,35 +762,63 @@ user_get_sponsor(const User *user)
UserSponsor new; UserSponsor new;
gint suc_factor = (current_user.counters[COUNT_USER_SUCCESS] < 0) ? -1 : 1; gint suc_factor = (current_user.counters[COUNT_USER_SUCCESS] < 0) ? -1 : 1;
gchar *names[18] = gchar *names[18] =
/* Company name. */
{_(" Systems"), {_(" Systems"),
/* Company name. */
_(" Communications"), _(" Communications"),
/* Company name. */
_(" Holdings"), _(" Holdings"),
/* Company name. */
_(" Industries"), _(" Industries"),
/* Company name. */
_(" Company"), _(" Company"),
/* Company name. */
_(" Telecommunications"), _(" Telecommunications"),
/* Company name. */
_(" Labs"), _(" Labs"),
/* Company name. */
_(" Technologies"), _(" Technologies"),
/* Company name. */
_(" Chemicals"), _(" Chemicals"),
/* Company name. */
_(" Energy"), _(" Energy"),
/* Company name. */
_(" Bank"), _(" Bank"),
/* Company name. */
_(" Products"), _(" Products"),
/* Company name. */
_(" Software"), _(" Software"),
/* Company name. */
_(" Scientific"), _(" Scientific"),
/* Company name. */
_(" Financial"), _(" Financial"),
/* Company name. */
_(" Petroleum"), _(" Petroleum"),
/* Company name. */
_(" Restaurants"), _(" Restaurants"),
/* Company name. */
_(" Data Systems")}; _(" Data Systems")};
gchar *short_names[7] = gchar *short_names[7] =
/* Company short name, leading to things like 'Marshall Data Systems Ltd.' */
{_(" Ltd."), {_(" Ltd."),
/* Company short name. */
_(" Assoc."), _(" Assoc."),
/* Company short name. */
_(" Co."), _(" Co."),
/* Company short name. */
_(" Ent."), _(" Ent."),
/* Company short name. Copy the '&amp;'. */
_(" &amp; Co."), _(" &amp; Co."),
/* Company short name. */
_(" Corp."), _(" Corp."),
/* Company short name. */
_(" Group")}; _(" Group")};
gchar *name_add[3] = gchar *name_add[3] =
/* Company addition, leading to 'Marshall & Sons Petroleum Co.'. Copy the '&amp;'. */
{_(" &amp; Sons"), {_(" &amp; Sons"),
/* Company addition. Copy the '&amp;'. */
_(" &amp; Daughters"), _(" &amp; Daughters"),
/* Company addition. */
_(" Bros.")}; _(" Bros.")};
new.name = g_string_new(name_get_random_last_name(name_get_list_from_sid(user->tm->names_file->str))); new.name = g_string_new(name_get_random_last_name(name_get_list_from_sid(user->tm->names_file->str)));

View File

@@ -29,6 +29,11 @@ OptionList constants;
/** Array of constants affecting game appearance rather than /** Array of constants affecting game appearance rather than
behaviour. */ behaviour. */
OptionList constants_app; OptionList constants_app;
/** Array with internal settings. */
OptionList settings;
/** The array containing the live game commentary strings. */
GPtrArray *lg_commentary[LIVE_GAME_EVENT_END];
/** The array containing players to be transfered. /** The array containing players to be transfered.
@see TransferPlayer */ @see TransferPlayer */

View File

@@ -142,11 +142,11 @@ xml_country_read_text (GMarkupParseContext *context,
country.sid = g_string_new(buf); country.sid = g_string_new(buf);
else if(state == STATE_SUPERNATIONAL) else if(state == STATE_SUPERNATIONAL)
{ {
opt_set_int("int_opt_disable_finances", 1); sett_set_int("int_opt_disable_finances", 1);
opt_set_int("int_opt_disable_transfers", 1); sett_set_int("int_opt_disable_transfers", 1);
opt_set_int("int_opt_disable_stadium", 1); sett_set_int("int_opt_disable_stadium", 1);
opt_set_int("int_opt_disable_contracts", 1); sett_set_int("int_opt_disable_contracts", 1);
opt_set_int("int_opt_disable_boost_on", 1); sett_set_int("int_opt_disable_boost_on", 1);
} }
else if(state == STATE_LEAGUE) else if(state == STATE_LEAGUE)
xml_league_read(buf, ligs); xml_league_read(buf, ligs);
@@ -199,11 +199,11 @@ xml_country_read(const gchar *country_name)
free_country(TRUE); free_country(TRUE);
opt_set_int("int_opt_disable_finances", 0); sett_set_int("int_opt_disable_finances", 0);
opt_set_int("int_opt_disable_transfers", 0); sett_set_int("int_opt_disable_transfers", 0);
opt_set_int("int_opt_disable_stadium", 0); sett_set_int("int_opt_disable_stadium", 0);
opt_set_int("int_opt_disable_contracts", 0); sett_set_int("int_opt_disable_contracts", 0);
opt_set_int("int_opt_disable_boost_on", 0); sett_set_int("int_opt_disable_boost_on", 0);
if(g_markup_parse_context_parse(context, file_contents, length, &error)) if(g_markup_parse_context_parse(context, file_contents, length, &error))
{ {

259
src/xml_lg_commentary.c Normal file
View File

@@ -0,0 +1,259 @@
#include "free.h"
#include "lg_commentary.h"
#include "live_game.h"
#include "misc.h"
#include "variables.h"
#include "xml_lg_commentary.h"
#define TAG_LG_COMMENTARY "lg_commentary"
#define TAG_EVENT "event"
#define TAG_EVENT_NAME "name"
#define TAG_EVENT_COMMENTARY "commentary"
#define EVENT_NAME_GENERAL "general"
#define EVENT_NAME_START_MATCH "start_match"
#define EVENT_NAME_HALF_TIME "half_time"
#define EVENT_NAME_EXTRA_TIME "extra_time"
#define EVENT_NAME_END_MATCH "end_match"
#define EVENT_NAME_LOST_POSSESSION "lost_possession"
#define EVENT_NAME_SCORING_CHANCE "scoring_chance"
#define EVENT_NAME_HEADER "header"
#define EVENT_NAME_PENALTY "penalty"
#define EVENT_NAME_FREE_KICK "free_kick"
#define EVENT_NAME_GOAL "goal"
#define EVENT_NAME_OWN_GOAL "own_goal"
#define EVENT_NAME_POST "post"
#define EVENT_NAME_MISS "miss"
#define EVENT_NAME_SAVE "save"
#define EVENT_NAME_CROSS_BAR "cross_bar"
#define EVENT_NAME_FOUL "foul"
#define EVENT_NAME_FOUL_YELLOW "foul_yellow"
#define EVENT_NAME_FOUL_RED "foul_red"
#define EVENT_NAME_FOUL_RED_INJURY "foul_red_injury"
#define EVENT_NAME_SEND_OFF "send_off"
#define EVENT_NAME_INJURY "injury"
#define EVENT_NAME_TEMP_INJURY "temp_injury"
#define EVENT_NAME_PENALTIES "penalties"
#define EVENT_NAME_STADIUM_BREAKDOWN "stadium_breakdown"
#define EVENT_NAME_STADIUM_RIOTS "stadium_riots"
#define EVENT_NAME_STADIUM_FIRE "stadium_fire"
#define EVENT_NAME_SUBSTITUTION "substitution"
#define EVENT_NAME_STRUCTURE_CHANGE "structure_change"
#define EVENT_NAME_STYLE_CHANGE "style_change"
#define EVENT_NAME_BOOST_CHANGE "boost_change"
enum XmlLgCommentaryStates
{
STATE_LG_COMMENTARY = 0,
STATE_EVENT,
STATE_EVENT_NAME,
STATE_EVENT_COMMENTARY,
STATE_END
};
gint state, commentary_idx;
/**
* The function called by the parser when an opening tag is read.
* The state variable is changed in this function and
* sometimes memory allocated for the information that's going to be read.
* @see The GLib manual (Simple XML parser).
*/
void
xml_lg_commentary_read_start_element (GMarkupParseContext *context,
const gchar *element_name,
const gchar **attribute_names,
const gchar **attribute_values,
gpointer user_data,
GError **error)
{
if(strcmp(element_name, TAG_EVENT) == 0)
state = STATE_EVENT;
else if(strcmp(element_name, TAG_EVENT_NAME) == 0)
state = STATE_EVENT_NAME;
else if(strcmp(element_name, TAG_EVENT_COMMENTARY) == 0)
state = STATE_EVENT_COMMENTARY;
else if(strcmp(element_name, TAG_LG_COMMENTARY) != 0)
g_warning("xml_lg_commentary_read_start_element: unknown tag: %s; I'm in state %d\n",
element_name, state);
}
/**
* The function called by the parser when a closing tag is read.
* The state variable is changed in this function.
* @see The GLib manual (Simple XML parser).
*/
void
xml_lg_commentary_read_end_element (GMarkupParseContext *context,
const gchar *element_name,
gpointer user_data,
GError **error)
{
if(strcmp(element_name, TAG_EVENT) == 0)
state = STATE_LG_COMMENTARY;
else if(strcmp(element_name, TAG_EVENT_NAME) == 0 ||
strcmp(element_name, TAG_EVENT_COMMENTARY) == 0)
state = STATE_EVENT;
else if(strcmp(element_name, TAG_LG_COMMENTARY) != 0)
g_warning("xml_lg_commentary_read_start_element: unknown tag: %s; I'm in state %d\n",
element_name, state);
}
/**
* The function called by the parser when the text between tags is read.
* This function is responsible for filling in the variables (e.g. team names)
* when a file gets loaded.
* @see The GLib manual (Simple XML parser).
*/
void
xml_lg_commentary_read_text (GMarkupParseContext *context,
const gchar *text,
gsize text_len,
gpointer user_data,
GError **error)
{
gchar buf[text_len + 1];
gint int_value;
GString *commentary = NULL;
strncpy(buf, text, text_len);
buf[text_len] = '\0';
int_value = (gint)g_ascii_strtod(buf, NULL);
if(state == STATE_EVENT_NAME)
{
if(strcmp(buf, EVENT_NAME_GENERAL) == 0)
commentary_idx = LIVE_GAME_EVENT_GENERAL;
else if(strcmp(buf, EVENT_NAME_START_MATCH) == 0)
commentary_idx = LIVE_GAME_EVENT_START_MATCH;
else if(strcmp(buf, EVENT_NAME_HALF_TIME) == 0)
commentary_idx = LIVE_GAME_EVENT_HALF_TIME;
else if(strcmp(buf, EVENT_NAME_EXTRA_TIME) == 0)
commentary_idx = LIVE_GAME_EVENT_EXTRA_TIME;
else if(strcmp(buf, EVENT_NAME_END_MATCH) == 0)
commentary_idx = LIVE_GAME_EVENT_END_MATCH;
else if(strcmp(buf, EVENT_NAME_LOST_POSSESSION) == 0)
commentary_idx = LIVE_GAME_EVENT_LOST_POSSESSION;
else if(strcmp(buf, EVENT_NAME_SCORING_CHANCE) == 0)
commentary_idx = LIVE_GAME_EVENT_SCORING_CHANCE;
else if(strcmp(buf, EVENT_NAME_HEADER) == 0)
commentary_idx = LIVE_GAME_EVENT_HEADER;
else if(strcmp(buf, EVENT_NAME_PENALTY) == 0)
commentary_idx = LIVE_GAME_EVENT_PENALTY;
else if(strcmp(buf, EVENT_NAME_FREE_KICK) == 0)
commentary_idx = LIVE_GAME_EVENT_FREE_KICK;
else if(strcmp(buf, EVENT_NAME_GOAL) == 0)
commentary_idx = LIVE_GAME_EVENT_GOAL;
else if(strcmp(buf, EVENT_NAME_OWN_GOAL) == 0)
commentary_idx = LIVE_GAME_EVENT_OWN_GOAL;
else if(strcmp(buf, EVENT_NAME_POST) == 0)
commentary_idx = LIVE_GAME_EVENT_POST;
else if(strcmp(buf, EVENT_NAME_MISS) == 0)
commentary_idx = LIVE_GAME_EVENT_MISS;
else if(strcmp(buf, EVENT_NAME_SAVE) == 0)
commentary_idx = LIVE_GAME_EVENT_SAVE;
else if(strcmp(buf, EVENT_NAME_CROSS_BAR) == 0)
commentary_idx = LIVE_GAME_EVENT_CROSS_BAR;
else if(strcmp(buf, EVENT_NAME_FOUL) == 0)
commentary_idx = LIVE_GAME_EVENT_FOUL;
else if(strcmp(buf, EVENT_NAME_FOUL_YELLOW) == 0)
commentary_idx = LIVE_GAME_EVENT_FOUL_YELLOW;
else if(strcmp(buf, EVENT_NAME_FOUL_RED) == 0)
commentary_idx = LIVE_GAME_EVENT_FOUL_RED;
else if(strcmp(buf, EVENT_NAME_FOUL_RED_INJURY) == 0)
commentary_idx = LIVE_GAME_EVENT_FOUL_RED_INJURY;
else if(strcmp(buf, EVENT_NAME_SEND_OFF) == 0)
commentary_idx = LIVE_GAME_EVENT_SEND_OFF;
else if(strcmp(buf, EVENT_NAME_INJURY) == 0)
commentary_idx = LIVE_GAME_EVENT_INJURY;
else if(strcmp(buf, EVENT_NAME_TEMP_INJURY) == 0)
commentary_idx = LIVE_GAME_EVENT_TEMP_INJURY;
else if(strcmp(buf, EVENT_NAME_PENALTIES) == 0)
commentary_idx = LIVE_GAME_EVENT_PENALTIES;
else if(strcmp(buf, EVENT_NAME_STADIUM_BREAKDOWN) == 0)
commentary_idx = LIVE_GAME_EVENT_STADIUM_BREAKDOWN;
else if(strcmp(buf, EVENT_NAME_STADIUM_RIOTS) == 0)
commentary_idx = LIVE_GAME_EVENT_STADIUM_RIOTS;
else if(strcmp(buf, EVENT_NAME_STADIUM_FIRE) == 0)
commentary_idx = LIVE_GAME_EVENT_STADIUM_FIRE;
else if(strcmp(buf, EVENT_NAME_SUBSTITUTION) == 0)
commentary_idx = LIVE_GAME_EVENT_SUBSTITUTION;
else if(strcmp(buf, EVENT_NAME_STRUCTURE_CHANGE) == 0)
commentary_idx = LIVE_GAME_EVENT_STRUCTURE_CHANGE;
else if(strcmp(buf, EVENT_NAME_STYLE_CHANGE) == 0)
commentary_idx = LIVE_GAME_EVENT_STYLE_CHANGE_ALL_OUT_DEFEND;
else if(strcmp(buf, EVENT_NAME_BOOST_CHANGE) == 0)
commentary_idx = LIVE_GAME_EVENT_BOOST_CHANGE_ANTI;
else
g_warning("xml_lg_commentary_read_text: unknown event name %s \n", buf);
}
else if(state == STATE_EVENT_COMMENTARY)
{
commentary = g_string_new(buf);
g_ptr_array_add(lg_commentary[commentary_idx], commentary);
}
}
/**
* Function reading an XML file specifying a country.
* The variable #country gets freed and overwritten afterwards.
* @param lg_commentary_name name of the xml file (e.g. 'lg_commentary_england.xml')
* to be read. Full path is not necessary, if the file is located in
* one of the suppport directories; neither are the prefix 'lg_commentary_'
* or the suffix '.xml'.
*/
void
xml_lg_commentary_read(const gchar *commentary_file)
{
GMarkupParser parser = {xml_lg_commentary_read_start_element,
xml_lg_commentary_read_end_element,
xml_lg_commentary_read_text, NULL, NULL};
GMarkupParseContext *context;
gchar *file_contents;
gint length;
GError *error = NULL;
gint i;
context =
g_markup_parse_context_new(&parser, 0, NULL, NULL);
if(!g_file_get_contents(commentary_file, &file_contents, &length, &error))
{
g_warning("xml_lg_commentary_read: error reading file %s\n", commentary_file);
if(g_str_has_suffix(commentary_file, "lg_commentary_en.xml"))
misc_print_error(&error, TRUE);
else
{
misc_print_error(&error, FALSE);
lg_commentary_load_commentary_file("lg_commentary_en.xml", TRUE);
}
return;
}
for(i=0;i<LIVE_GAME_EVENT_END;i++)
{
free_g_string_array(&lg_commentary[i]);
lg_commentary[i] = g_ptr_array_new();
}
if(g_markup_parse_context_parse(context, file_contents, length, &error))
{
g_markup_parse_context_end_parse(context, NULL);
g_markup_parse_context_free(context);
g_free(file_contents);
}
else
{
g_warning("xml_lg_commentary_read: error parsing file %s\n", commentary_file);
if(g_str_has_suffix(commentary_file, "lg_commentary_en.xml"))
misc_print_error(&error, TRUE);
else
{
misc_print_error(&error, FALSE);
lg_commentary_load_commentary_file("lg_commentary_en.xml", TRUE);
}
return;
}
}

31
src/xml_lg_commentary.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef XML_LG_COMMENTARY_H
#define XML_LG_COMMENTARY_H
#include "bygfoot.h"
void
xml_lg_commentary_read(const gchar *commentary_file);
void
xml_lg_commentary_read_text (GMarkupParseContext *context,
const gchar *text,
gsize text_len,
gpointer user_data,
GError **error);
void
xml_lg_commentary_read_end_element (GMarkupParseContext *context,
const gchar *element_name,
gpointer user_data,
GError **error);
void
xml_lg_commentary_read_start_element (GMarkupParseContext *context,
const gchar *element_name,
const gchar **attribute_names,
const gchar **attribute_values,
gpointer user_data,
GError **error);
#endif

View File

@@ -162,7 +162,7 @@ string_live_game_event_own_goal_icon goal_own.png
string_live_game_event_post_icon post.png string_live_game_event_post_icon post.png
string_live_game_event_cross_bar_icon cross_bar.png string_live_game_event_cross_bar_icon cross_bar.png
string_live_game_event_save_icon save.png string_live_game_event_save_icon save.png
string_live_game_event_missed_icon miss.png string_live_game_event_miss_icon miss.png
string_live_game_event_foul_icon foul.png string_live_game_event_foul_icon foul.png
string_live_game_event_foul_yellow_icon yellow.png string_live_game_event_foul_yellow_icon yellow.png
string_live_game_event_send_off_icon red.png string_live_game_event_send_off_icon red.png

View File

@@ -350,20 +350,20 @@ int_team_new_bound_upper 10
int_team_new_bound_lower 20 int_team_new_bound_lower 20
# tokens in the live game commentary # tokens in the live game commentary
string_lg_commentary_token_team_home TH string_lg_commentary_token_team_home _TH_
string_lg_commentary_token_team_away TA string_lg_commentary_token_team_away _TA_
string_lg_commentary_token_team_in_poss TP string_lg_commentary_token_team_in_poss _TP_
string_lg_commentary_token_team_not_in_poss TN string_lg_commentary_token_team_not_in_poss _TN_
string_lg_commentary_token_team_losing TL string_lg_commentary_token_team_losing _TL_
string_lg_commentary_token_team_winning TW string_lg_commentary_token_team_winning _TW_
string_lg_commentary_token_team TT string_lg_commentary_token_team _TT_
string_lg_commentary_token_player1 P1 string_lg_commentary_token_player1 _P1_
string_lg_commentary_token_player2 P2 string_lg_commentary_token_player2 _P2_
string_lg_commentary_token_attendance AT string_lg_commentary_token_attendance _AT_
string_lg_commentary_token_result RE string_lg_commentary_token_result _RE_
string_lg_commentary_token_minute MI string_lg_commentary_token_minute _MI_
string_lg_commentary_token_extra EX string_lg_commentary_token_extra _EX_
_
# base probability that the ball gets from defending area # base probability that the ball gets from defending area
# to midfield area. # to midfield area.
float_live_game_area_def_mid 5000 float_live_game_area_def_mid 5000

View File

@@ -0,0 +1,252 @@
<lg_commentary>
<event>
<name>general</name>
<commentary>_P2_ spielt in die Gasse und findet _P1_</commentary>
<commentary>Kurzpass auf die linke Außenbahn</commentary>
<commentary>Scharfer Pass von _P2_ an _P1_</commentary>
<commentary>_P2_ köpft den Ball zu _P1_</commentary>
<commentary>Brustannahme von _P2_, leitet weiter an _P1_</commentary>
<commentary>_P1_ bringt Querpass von _P2_ unter Kontrolle</commentary>
<commentary>_P2_ schiebt zu _P1_</commentary>
<commentary>_P1_ ist wieder am Ball</commentary>
<commentary>_P1_ lässt seinen Verteidiger stehen</commentary>
<commentary>_P1_ pflügt durch das Mittelfeld</commentary>
<commentary>_P1_ bekommt den Ball von _P2_</commentary>
<commentary>Ein langer Pass von _P2_ findet _P1_ am langen Pfosten</commentary>
<commentary>Ein Seitenwechsel von _P2_ zu _P1_</commentary>
<commentary>_P1_ bekommt den Ball</commentary>
<commentary>Schöner Pass von _P2_ eröffnet den Raum vor _P1_</commentary>
<commentary>Guter Querpass auf die rechte Seite</commentary>
<commentary>Ein weiterer Flankenlauf</commentary>
</event>
<event>
<name>goal</name>
<commentary>Und der Ball fliegt an _P2_ vorbei und zappelt im Netz!!!</commentary>
<commentary>Tor!!!</commentary>
<commentary>Und der Ball ist im Tor!!!</commentary>
<commentary>_P1_ trifft!!!</commentary>
<commentary>Oh, ein schöner Schuss, er wird von _P2_ ins Tor abgelenkt</commentary>
<commentary>_P2_ hechtet vergeblich, der Ball ist versenkt!!!</commentary>
<commentary>Der Ball ist unerreichbar für _P2_, Tor!!</commentary>
<commentary>_P1_ feiert in der ihm eigenen Art ein exzellentes Tor</commentary>
<commentary>_P1_ vollführt eine Freudentanz nach einem wunderbaren Tor</commentary>
</event>
<event>
<name>header</name>
<commentary>Hoher Ball von _P2_ an _P1_, der köpft</commentary>
<commentary>Flugkopfball von _P1_</commentary>
<commentary>Er scheint in der Luft zu schweben und produzier dann einen druckvollen Kopfball</commentary>
</event>
<event>
<name>start_match</name>
<commentary>Ein wolkenloser Himmel verheißt ein spannedes Spiel</commentary>
<commentary>Die Mannschaften werden durch eine ohrenbetäubende Lärmkulisse begrüßt</commentary>
<commentary>Der Kampf der Titanen beginnt</commentary>
<commentary>Die Menge begrüßt die Mannschaften mit rauschendem Applaus</commentary>
<commentary>_AT_ Zuschauer warten auf den Anpfiff</commentary>
<commentary>Der Schiedsrichter schaut zum Assistenten und pfeift an</commentary>
<commentary>Der Schiri ist bereit, es kann losgehen</commentary>
<commentary>Es kann losgehen</commentary>
<commentary>_AT_ Fans können nicht irren, dies ist das Spiel, das wir alle sehen wollen</commentary>
</event>
<event>
<name>stadium_riots</name>
<commentary>Die Fans stürmen das Spielfeld</commentary>
<commentary>Die Hooligans toben</commentary>
<commentary>Ein Fan ist aufs Spielfeld gelangt und greift den Schiedsrichter an</commentary>
<commentary>Und die Fans schießen Leuchtraketen aufs Feld</commentary>
<commentary>Die Ordner müssen eine Schlägerei zwischen den Fans unter Kontrolle bekommen</commentary>
</event>
<event>
<name>stadium_fire</name>
<commentary>Eine Leuchtrakete hat einen Teil der Sitze entzündet</commentary>
<commentary>Die Auswärtsfans haben Sitze entzündet</commentary>
<commentary>Ein Feuer verschlingt _TT_'s Stadion</commentary>
</event>
<event>
<name>stadium_breakdown</name>
<commentary>__TH__'s Stadion scheint technische Probleme zu haben</commentary>
<commentary>Die Flutlichtanlage ist ausgefallen</commentary>
</event>
<event>
<name>extra_time</name>
<commentary>Nach _MI_ Minuten steht's _RE_: Verlängerung</commentary>
<commentary>Nach einem engen Spiel beginnt die Verlängerung</commentary>
<commentary>Verlängerung: jetzt geht's um Willenskraft und Entschlossenheit</commentary>
<commentary>Es steht immer noch _RE_: Verlängerung</commentary>
<commentary>Jetzt geht's um alles, die Verlängerung beginnt</commentary>
</event>
<event>
<name>end_match</name>
<commentary>_TL_ schleicht vom Platz, eine Standpauke folgt</commentary>
<commentary>Das Spiel ist aus!</commentary>
<commentary>_TW_ gewinnt!</commentary>
<commentary>Nach _MI_ Minuten ended das Spiel mit einem _RE_</commentary>
<commentary>Die Fans buhen _TL_ vom Platz</commentary>
<commentary>Das wars, das Spiel endet _RE_</commentary>
<commentary>Der Schiedsrichter schaut auf seine Uhr und pfeift, das Spiel ist aus</commentary>
<commentary>_RE_, was für ein Ergebnis für _TW_</commentary>
</event>
<event>
<name>half_time</name>
<commentary>_TW_ muss noch 45 Minuten überstehen</commentary>
<commentary>Der Trainer von _TL_ wird zur Halbzeit ausgebuht</commentary>
<commentary>Da draußen sind zwei Mannschaften, aber nur eine spielt Fußball</commentary>
<commentary>Halbzeit.</commentary>
<commentary>Es steht _RE_ zur Halbzeit, der Trainer von _TL_ sollte seine Mannschaft anspornen</commentary>
<commentary>Es steht _RE_ zur Halbzeit.</commentary>
</event>
<event>
<name>penalties</name>
<commentary>Jetzt geht es Mann gegen Mann, Schütze gegen Torwart</commentary>
<commentary>Zwei Mannschaften waren gleichwertig, jetzt geht's ins Penaltyschießen</commentary>
<commentary>Wer hätte das vor _MI_ Minuten gedacht, dass es soweit kommen würde</commentary>
<commentary>Man muss die Nerven unter Kontrolle bekommen wenn man eine Chance im Elfmeterschießen haben will</commentary>
<commentary>Und nun kommt das spannende Drama eines Elfmeterschießens</commentary>
</event>
<event>
<name>post</name>
<commentary>Ich bin überrascht, dass der Pfosten diesem Schuss standhielt</commentary>
<commentary>Und der Schuss knallt gegen den Pfosten</commentary>
</event>
<event>
<name>cross_bar</name>
<commentary>Der Ball zirkelt über _P2_, trifft aber nur die Latte</commentary>
<commentary>Zentimetergenauer Schuss von _P1_, trifft Aluminium</commentary>
<commentary>_P2_ ist ohne Chance, aber der Ball trifft nur die Latte</commentary>
</event>
<event>
<name>save</name>
<commentary>Superreflex von _P2_</commentary>
<commentary>Ein Flachschuss, gut abgewehrt von _P2_</commentary>
<commentary>_P2_ scheint über sich hinauszuwachsen und kann den Ball ablenken</commentary>
<commentary>_P2_ war noch dran</commentary>
<commentary>_P2_ lenkt den Ball gerade noch über die Latte</commentary>
<commentary>Gute Abwehr von _P2_</commentary>
<commentary>Ein dankbarer Ball für den Torhüter</commentary>
</event>
<event>
<name>foul</name>
<commentary>_P1_ wird hart attackiert</commentary>
<commentary>Hohes Bein von _P2_ schickt _P1_ zu Boden</commentary>
<commentary>Aua, das war schmerzhaft</commentary>
<commentary>Au, Blutgrätsche gegen _P1_</commentary>
<commentary>_P2_ holt _P1_ von den Beinen</commentary>
<commentary>_P2_ holt rüde mit gestrecktem Bein _P1_ von den Beinen</commentary>
<commentary>Ein gemeines Foul von _P2_ lässt _P1_ meterweit fliegen</commentary>
<commentary>_P2_ attackiert _P1_ ohne Gnade</commentary>
<commentary>Das war ein harter Angriff</commentary>
</event>
<event>
<name>foul_red_injury</name>
<commentary>_P2_ foult und _P2_ windet sich in Schmerzen am Boden</commentary>
<commentary>_P2_ foult: _P1_ scheint verletzt zu sein... er muss vielleicht raus</commentary>
</event>
<event>
<name>free_kick</name>
<commentary>_P1_ knallt einen Freistoß Richtung Tor</commentary>
<commentary>_P1_ lupft den Freistoß</commentary>
<commentary>Gelupfter Freistoß von _P1_</commentary>
<commentary>_P1_ führt Freistoß schnell aus</commentary>
<commentary>_P1_ dreht den Ball um die Mauer</commentary>
<commentary>Freistoß: _P1_ schießt aus großer Entfernung</commentary>
<commentary>Freistoß: _P1_ schlenzt den Ball über die Mauer</commentary>
</event>
<event>
<name>lost_possession</name>
<commentary>_P1_ ersprintet den Ball aber _P2_ grätscht sauber</commentary>
<commentary>_P1_ nimmt _P2_ den Ball mit einer sauberen Grätsche ab</commentary>
<commentary>_P2_ kontrolliert den Ball schlecht, _P1_ kann ihn erobern</commentary>
<commentary>_P1_ erobert mit gutem Körpereinsatz den Ball</commentary>
</event>
<event>
<name>own_goal</name>
<commentary>Rückpass von _P1_... oh nein, der Torwart verfehlt ihn! Eigentor!</commentary>
<commentary>Dieses Mißverständnis wurde mit einem Tor bezahlt</commentary>
<commentary>Oh nein, der Ball springt gegen _P1_ und ins Netz</commentary>
<commentary>Ein Billiardball im 5-Meterraum trifft _P1_ und rollt über die Linie</commentary>
</event>
<event>
<name>scoring_chance</name>
<commentary>_P1_ schießt ins lange Eck</commentary>
<commentary>_P1_ lässt zwei Verteiger stehen und versetzt den Torwart</commentary>
<commentary>_P1_ verspringt der Ball aber er sein Schuss fliegt Richtung Tor </commentary>
<commentary>_P1_ zieht zur Mitte und schießt</commentary>
<commentary>_P2_ versucht es einfach aus 25 Metern</commentary>
<commentary>_P1_ dribbelt im 16er, dreht sich und schießt</commentary>
<commentary>_P1_ zieht aus 20 Metern ab, scheint danebenzugehen</commentary>
<commentary>_P2_ legt den Ball zu _P1_ ab der einen Bombenschuss abfeuert</commentary>
<commentary>_P1_ hält aus kurzer Distanz drauf</commentary>
<commentary>Superpass von _P2_ schickt _P1_ Eins gegen Eins gegen den Torhüter</commentary>
<commentary>_P1_ dreht sich um die eigene Achse und schießt</commentary>
<commentary>Fallrückzieher von _P1_!</commentary>
<commentary>_P1_ nimmt Fahrt auf und schießt!</commentary>
</event>
<event>
<name>miss</name>
<commentary>Ein Verteidiger klärt in letzter Minute</commentary>
<commentary>_P2_ greift _P1_ an und blockiert den Schuss</commentary>
<commentary>Und der Schuss kriecht Zentimeter am Pfosten vorbei</commentary>
<commentary>Ein Verteidiger klärt</commentary>
<commentary>_P1_ hätte abgeben müssen, verschießt den Ball</commentary>
<commentary>_P1_ trifft nur die Tribüne</commentary>
<commentary>_P1_ verzieht</commentary>
<commentary>_P1_'s Schuß weit daneben</commentary>
</event>
<event>
<name>temp_injury</name>
<commentary>_P1_ ist leicht angeschlagen, kann aber weitermachen</commentary>
<commentary>_P1_ hat eine Platzwunde, aber sie wird getackert und er kann weiterspielen</commentary>
<commentary>_P1_ hat einen Krampf, spielt weiter</commentary>
</event>
<event>
<name>injury</name>
<commentary>_P1_ scheint eine schwere Verletzung davongetragen zu haben</commentary>
<commentary>_P1_ wird wohl das Feld verlassen müssen, scheint eine Knöchelverletzung zu sein</commentary>
</event>
<event>
<name>penalty</name>
<commentary>_P1_ hat schon mal einen Elfer verschossen, hoffentlich trifft er diesmal</commentary>
<commentary>_P1_ darf an den Elfmeterpunkt</commentary>
<commentary>_P1_ übernimmt die Verantwortung und tritt den Elfmeter</commentary>
</event>
<event>
<name>substitution</name>
<commentary>_P2_ verlässt unter großem Applaus das Spielfeld, _P1_ ersetzt ihn</commentary>
<commentary>_TT_ wechselt aus, _P1_ kommt für _P2_</commentary>
<commentary>_P2_ wird vom Platz gebuht und durch _P1_ ersetzt</commentary>
</event>
<event>
<name>foul_yellow</name>
<commentary>_P2_ für Grätschen von hinten</commentary>
<commentary>_P2_ für bösartiges Foul an _P1_</commentary>
<commentary>_P2_ für Handspiel</commentary>
<commentary>_P2_ für ungebührliches Verhalten</commentary>
<commentary>_P2_ wird für hohes Bein verwarnt</commentary>
<commentary>_P2_ für Ballwegtreten</commentary>
<commentary>_P2_ für Zeitschinden</commentary>
<commentary>_P2_ für Behinderung</commentary>
<commentary>_P2_ wird wegen Meckerns verwarnt</commentary>
</event>
<event>
<name>foul_red</name>
<commentary>_P2_ für eine Blutgrätsche</commentary>
<commentary>_P2_ für absichtliches Handspiel</commentary>
<commentary>_P1_ wurde vom Platz gestellt</commentary>
<commentary>_P2_ sieht die rote Karte</commentary>
<commentary>_P2_ wird wegen wiederholtem Meckern vom Platz gestellt</commentary>
<commentary>_P2_ wird nach einer Notbremse zum Duschen geschickt</commentary>
</event>
<event>
<name>boost_change</name>
<commentary>_TT_ hat den Boost auf _EX_ gestellt</commentary>
</event>
<event>
<name>structure_change</name>
<commentary>_TT_ hat das System auf _EX_ umgestellt</commentary>
</event>
<event>
<name>style_change</name>
<commentary>_TT_ hat den Spielstil auf _EX_ umgestellt</commentary>
</event>
</lg_commentary>

View File

@@ -0,0 +1,256 @@
<lg_commentary>
<event>
<name>general</name>
<commentary>_P2_ feeds the ball through to _P1_</commentary>
<commentary>_P2_ threads a great ball to _P1_ </commentary>
<commentary>Lovely pass from _P2_ releases _P1_</commentary>
<commentary>Long floating pass from _P2_ finds _P1_</commentary>
<commentary>Good passing move across the pitch and down the right</commentary>
<commentary>Quick passing move down the left</commentary>
<commentary>_P2_ cross controlled by _P1_ who slips past his man</commentary>
<commentary>Another decent move down the wing</commentary>
<commentary>_P1_ latches onto _P2_'s pass</commentary>
<commentary>_P2_ needles ball through players and finds _P1_</commentary>
<commentary>_P2_ controls it with his chest and passes to _P1_</commentary>
<commentary>_P2_ heads the ball towards _P1_</commentary>
<commentary>_P1_ twisting and turning again</commentary>
<commentary>_P1_ rips through the midfield</commentary>
<commentary>_P1_ spins past his marker</commentary>
</event>
<event>
<name>lost_possession</name>
<commentary>_P1_ wins the ball with a perfectly timed challenge</commentary>
<commentary>Bad control by _P2_ lets _P1_ steal the ball off him</commentary>
<commentary>_P1_ takes the ball away from _P2_ with a sliding tackle</commentary>
<commentary>Loose ball falls to _P1_</commentary>
</event>
<event>
<name>foul</name>
<commentary>Oww, nasty tackle on _P1_</commentary>
<commentary>Surely that's a sending off offence</commentary>
<commentary>_P2_ knocks over _P1_ with a double footed lunge</commentary>
<commentary>Crunching challenge on _P1_</commentary>
<commentary>_P1_ gets his legs taken away from him by _P2_</commentary>
<commentary>Slicing challenge by _P2_ on _P1_</commentary>
<commentary>Vicious tackle from _P2_ leaves _P1_ lying on the floor in agony</commentary>
<commentary>Ouch that's got to hurt</commentary>
<commentary>Extremely high boot from _P2_ sends _P1_ to the ground</commentary>
</event>
<event>
<name>scoring_chance</name>
<commentary>_P1_ charges towards goal and shoots!</commentary>
<commentary>_P1_ spins and shoots</commentary>
<commentary>Long ball from _P2_ finds _P1_ at far post</commentary>
<commentary>_P1_ can't quite get it under control but his miss kick heads toward goal</commentary>
<commentary>_P1_ shoots from 22 yards looks like it's going wide</commentary>
<commentary>_P1_ dribbles into the box, turns inside the defence and fires</commentary>
<commentary>_P1_ cuts in from the left flank and shoots</commentary>
<commentary>_P1_ tries his luck from 30 yards</commentary>
<commentary>_P1_ arrows shot towards top left corner</commentary>
<commentary>_P1_ shoots from close range</commentary>
<commentary>Great ball from _P2_ sends _P1_ one on one with the goalkeeper</commentary>
<commentary>_P1_'s overhead kick heads towards the top right hand corner</commentary>
<commentary>_P1_ spins past two defenders, wrong foots the keeper and back heels the ball towards goal</commentary>
<commentary>_P2_ lays the ball off to _P1_ who sends a rocket of a shot towards goal</commentary>
</event>
<event>
<name>goal</name>
<commentary>Goal!!!</commentary>
<commentary>And the ball is smacked into the back of the net!!!</commentary>
<commentary>_P1_ scores!!!</commentary>
<commentary>And the ball flies straight past _P2_ and into the back of the net!!!</commentary>
<commentary>The ball flies past _P2_ and it's a goal!!!</commentary>
<commentary>_P1_ wheels away in celebration after a great goal sent the fans wild</commentary>
<commentary>_P2_'s despairing dive can't keep _P1_'s shot out and the ball is in the back of the net!!!</commentary>
<commentary>The dance ignites the fans, _P1_ celebrates in his own special fashion</commentary>
</event>
<event>
<name>miss</name>
<commentary>_P1_ fired wide!</commentary>
<commentary>_P1_ should have squared the ball went alone and lashed wide</commentary>
<commentary>Defender clears</commentary>
<commentary>_P1_ curls ball over</commentary>
<commentary>Defender back to block just as it seemed to open up</commentary>
<commentary>_P1_ smacks into row Z</commentary>
<commentary>And the shot creeps just past the post</commentary>
</event>
<event>
<name>save</name>
<commentary>_P2_'s fingertips flicks it wide</commentary>
<commentary>_P2_ forced to tip _P1_'s shot over the crossbar</commentary>
<commentary>Great pace shown by _P1_ to get to the ball first but _P2_ produced superb block tackle</commentary>
<commentary>Low shot taken well to his left by _P2_</commentary>
<commentary>_P2_ makes a superb reflex save to tip wide</commentary>
<commentary>_P2_ runs at _P1_ and blocks shot with ankle</commentary>
<commentary>Easy save for the goalkeeper</commentary>
<commentary>Caught well by _P2_</commentary>
</event>
<event>
<name>start_match</name>
<commentary>It's a crowd of _AT_ here as the whistle blows</commentary>
<commentary>We're under way</commentary>
<commentary>The two teams are greeted by a wall of noise as they take to the pitch</commentary>
<commentary>The crowd roars as the players run out from the tunnel to start the match</commentary>
<commentary>A cloudless day, gives the impression this match is going to sparkle</commentary>
<commentary>_AT_ fans can't be wrong, this is the match we have all come to watch</commentary>
<commentary>The referee gets the nod from the linesman and we are away</commentary>
<commentary>The clash of the titans kicks off</commentary>
<commentary>The referees are ready, players set, the battle begins</commentary>
</event>
<event>
<name>half_time</name>
<commentary>It's half time</commentary>
<commentary>It's a _RE_ at half time.</commentary>
<commentary>It's a _RE_ at half time, _TL_'s manager has to find something special to spur his team on.</commentary>
<commentary>_TL_ heads into the tunnel to await the managers scolding</commentary>
<commentary>_TW_ are just 45 minutes away from a stunning victory</commentary>
<commentary>_TL_'s manager cops a rollicking from the fans as he turns from the dugout</commentary>
<commentary>There are two teams out there and only one of them is playing football</commentary>
</event>
<event>
<name>extra_time</name>
<commentary>After a close match the game heads into extra time</commentary>
<commentary>It's still _RE_: extra time</commentary>
<commentary>After _MI_ minutes it's still _RE_: extra time</commentary>
<commentary>Who will breakdown first, extra time it is</commentary>
<commentary>It's down to determination and fitness now as we head into extra time</commentary>
</event>
<event>
<name>penalties</name>
<commentary>Who would have thought _MI_ minutes ago it would come down to this</commentary>
<commentary>And now we have the tense drama of a penalty shoot out</commentary>
<commentary>Two teams, equall till now in every respect,face off in penalties</commentary>
<commentary>The teams cant do it so now it's one on one. Striker against goalie</commentary>
</event>
<event>
<name>end_match</name>
<commentary>The match is over!</commentary>
<commentary>_TW_ are triumphant!!!</commentary>
<commentary>The fans boo _TL_ off the pitch</commentary>
<commentary>After _MI_ minutes the match ends with a _RE_</commentary>
<commentary>The referee checks his watch and blows for full time</commentary>
<commentary>Well that's that. It ends _RE_</commentary>
<commentary>_RE_, what an astonishing result for _TW_</commentary>
</event>
<event>
<name>own_goal</name>
<commentary>Ohh no, the ball ricocheted off _P1_ into the net</commentary>
<commentary>It's a pinball in the penalty box, finally spinning off _P1_ across the line</commentary>
<commentary>Oh that's a great shot and it's deflected off _P1_ and into the back of the net</commentary>
<commentary>_P1_ passes the ball back to his goalie, oh no the keepers missed it! It's an own goal by _P1_!</commentary>
<commentary>That little missunderstanding has cost _TT_ a goal</commentary>
</event>
<event>
<name>header</name>
<commentary>_P2_ chips the ball towards _P1_ who heads the ball towards goal</commentary>
<commentary>Diving header by _P1_</commentary>
<commentary>He just floated in midair for ages then thunder heads it towards home</commentary>
</event>
<event>
<name>post</name>
<commentary>Sweet strike by _P1_, hits the post</commentary>
<commentary>And the shot glances wide off the post</commentary>
<commentary>I'm suprised the post has managed to withstand that cracking shot</commentary>
</event>
<event>
<name>cross_bar</name>
<commentary>Ball dinked over _P2_ but hit crossbar and bounced to safety</commentary>
<commentary>The ball smacks into the crossbar with _P2_ stranded</commentary>
<commentary>_P2_ seemed to be everywhere at once, finally tipping the ball off the crossbar</commentary>
</event>
<event>
<name>penalty</name>
<commentary>_P1_ steps up to take the penalty</commentary>
<commentary>_P1_ has a chance to score with a penalty kick</commentary>
<commentary>_P1_ has missed a penalty before but he now has a chance to redeem himself</commentary>
<commentary>You have to bury the nerves, swallow and concentrate when your taking penalties</commentary>
</event>
<event>
<name>free_kick</name>
<commentary>Short free-kick from _P1_</commentary>
<commentary>_P1_ drives free kick low and hard</commentary>
<commentary>_P1_ takes free-kick quickly and curls around wall</commentary>
<commentary>_P1_ curls the free kick over the wall</commentary>
<commentary>Free kick: _P1_ plays the ball out wide</commentary>
<commentary>Free kick: _P1_ hits a long ball up the pitch</commentary>
<commentary>Free kick whipped across the face of goal by _P1_</commentary>
</event>
<event>
<name>foul_yellow</name>
<commentary>_P2_ for dangerous slide tackle on _P1_</commentary>
<commentary>_P2_ for foul on _P1_</commentary>
<commentary>_P2_ for kicking ball away </commentary>
<commentary>_P2_ for time wasting</commentary>
<commentary>_P2_ for handball</commentary>
<commentary>_P2_ for stopping _P1_ taking a quick free-kick</commentary>
<commentary>_P2_ is booked for repeated dissent</commentary>
</event>
<event>
<name>foul_red</name>
<commentary>_P2_ is reprimanded for high kicking</commentary>
<commentary>_P2_ is given his marching orders for contempt</commentary>
<commentary>_P2_ for malicious showing of studs</commentary>
<commentary>_P2_ for intentional handball</commentary>
<commentary>_P2_ is sent off for stopping a clear goal scoring opportunity</commentary>
<commentary>_P2_ has been red carded for punching _P1_</commentary>
<commentary>_P2_ for swearing at opposition fans</commentary>
</event>
<event>
<name>foul_red_injury</name>
<commentary>_P2_ fouls and the stretcher bearers come racing on with _P1_ lying in agony on the turf</commentary>
<commentary>Foul by _P2_; _P1_ seems to be injured... he might have to be substituted</commentary>
</event>
<event>
<name>send_off</name>
<commentary>_P1_ has been sent off</commentary>
</event>
<event>
<name>injury</name>
<commentary>_P1_ will have to go off after what seems an ankle injury</commentary>
<commentary>_P1_ looks like he's badly injured</commentary>
</event>
<event>
<name>temp_injury</name>
<commentary>_P1_ has pulled a muscle but should be able to continue</commentary>
<commentary>_P1_ has picked up a slight knock</commentary>
<commentary>_P1_ has a large cut above his left eye but it has been patched up and he will be able to continue </commentary>
</event>
<event>
<name>stadium_breakdown</name>
<commentary>_TH_ is undergoing stadium problems</commentary>
<commentary>The floodlights have just gone out</commentary>
</event>
<event>
<name>stadium_riots</name>
<commentary>The peasants are revolting</commentary>
<commentary>And the fans are throwing flares onto the pitch</commentary>
<commentary>The riot police have moved in to stop fighting between sets of oppostion supporters</commentary>
<commentary>A fan has managed to get onto the pitch and has begun to attack the referee</commentary>
<commentary>The fans pour onto the pitch in a full scale pitch invasion</commentary>
</event>
<event>
<name>stadium_fire</name>
<commentary>Fire consumes _TT_'s stadium</commentary>
<commentary>Away fans have set fire to the north stand</commentary>
<commentary>A flare chucked onto the touchline has started a massive blaze</commentary>
<commentary>A speaker has gone up in flames and the blaze spreading around the entire stadium</commentary>
</event>
<event>
<name>substitution</name>
<commentary>_TT_ make a substitution, _P1_ comes on to replace _P2_</commentary>
<commentary>_P2_ goes off to applause from the fans, _P1_ replaces him</commentary>
<commentary>_P2_ is booed off the pitch as he is replaced by _P1_</commentary>
</event>
<event>
<name>structure_change</name>
<commentary>_TT_ has changed their structure to _EX_</commentary>
</event>
<event>
<name>style_change</name>
<commentary>_TT_ has changed their style to _EX_</commentary>
</event>
<event>
<name>boost_change</name>
<commentary>_TT_ has changed their boost to _EX_</commentary>
</event>
</lg_commentary>