1
1
mirror of https://github.com/tstellar/bygfoot.git synced 2024-12-16 10:21:15 +01:00

Removed news from weekly functions.

This commit is contained in:
gyboth 2008-12-03 21:46:27 +00:00
parent 46ff17548d
commit 9f93039e05
6 changed files with 29 additions and 32 deletions

View File

@ -426,6 +426,7 @@ cup_load_choose_team_from_cup(Cup *cup, const Cup *cup_temp, GPtrArray *teams, c
ct->number_of_teams, number_of_teams, cup->group);
}
}
void
cup_load_choose_team_from_league(Cup *cup, const League *league,
GPtrArray *teams, const CupChooseTeam *ct)

View File

@ -705,16 +705,21 @@ void
misc_token_add(GPtrArray **token_rep, gint token_idx,
gchar *replacement)
{
/* printf("tok +%s+ rep +%s+\n", */
/* g_strdup(g_array_index(tokens.list, Option, token_idx).string_value), */
/* replacement); */
g_ptr_array_add(token_rep[0],
(gpointer)g_strdup(g_array_index(tokens.list, Option, token_idx).string_value));
g_ptr_array_add(token_rep[1], (gpointer)replacement);
}
/** Add a 0 or 1 as a token to the token array. */
void
misc_token_add_bool(GPtrArray **token_rep, gint token_idx,
gboolean value)
{
g_ptr_array_add(token_rep[0],
(gpointer)g_strdup(g_array_index(tokens.list, Option, token_idx).string_value));
g_ptr_array_add(token_rep[1], misc_int_to_char(value));
}
/** Remove the replacement rule given by the index. */
void
misc_token_remove(GPtrArray **token_rep, gint idx)

View File

@ -125,4 +125,8 @@ gboolean
misc_string_replace_all_tokens(GPtrArray **token_rep,
const gchar *text_tokens, gchar *dest);
void
misc_token_add_bool(GPtrArray **token_rep, gint token_idx,
gboolean value);
#endif

View File

@ -314,9 +314,9 @@ news_set_scorer_tokens(const LiveGameStats *stats)
if(strcmp(scorer_str, "") != 0)
{
sprintf(buf, "string_token_multiple_scorers%d", i);
misc_token_add(token_rep_news,
option_int(buf, &tokens),
misc_int_to_char((scorers[i]->len > 1)));
misc_token_add_bool(token_rep_news,
option_int(buf, &tokens),
(scorers[i]->len > 1));
sprintf(buf, "string_token_scorers%d", i);
misc_token_add(token_rep_news,
@ -364,9 +364,9 @@ news_set_league_cup_tokens(const Fixture *fix)
option_int("string_token_league_cup_name", &tokens),
g_strdup(league_cup_get_name_string(fix->clid)));
misc_token_add(token_rep_news,
option_int("string_token_cup", &tokens),
misc_int_to_char((fix->clid >= ID_CUP_START)));
misc_token_add_bool(token_rep_news,
option_int("string_token_cup", &tokens),
(fix->clid >= ID_CUP_START));
if(fix->clid >= ID_CUP_START)
{
@ -378,25 +378,9 @@ news_set_league_cup_tokens(const Fixture *fix)
option_int("string_token_cup_round_name", &tokens),
g_strdup(buf));
if(cupround->tables->len > 0)
{
misc_token_add(token_rep_news,
misc_token_add_bool(token_rep_news,
option_int("string_token_cup_knockout", &tokens),
g_strdup("0"));
misc_token_add(token_rep_news,
option_int("string_token_cup_round_robin", &tokens),
g_strdup("1"));
}
else
{
misc_token_add(token_rep_news,
option_int("string_token_cup_knockout", &tokens),
g_strdup("1"));
misc_token_add(token_rep_news,
option_int("string_token_cup_round_robin", &tokens),
g_strdup("0"));
}
(cupround->tables->len == 0));
if(fix->decisive)
misc_token_add(token_rep_news,

View File

@ -60,7 +60,9 @@ typedef void(*WeekFunc)(void);
is ended. */
WeekFunc end_week_round_funcs[] =
{end_week_round_results, end_week_round_sort_tables,
end_week_round_update_fixtures, end_week_round_generate_news, NULL};
end_week_round_update_fixtures, NULL};
/* {end_week_round_results, end_week_round_sort_tables, */
/* end_week_round_update_fixtures, end_week_round_generate_news, NULL}; */
/** Array of functions called when a week round
is started. */
@ -393,6 +395,7 @@ end_week_round_results(void)
}
for(i=0;i<acps->len;i++)
{
for(j=0;j<acp(i)->fixtures->len;j++)
{
if(g_array_index(acp(i)->fixtures, Fixture, j).week_number == week &&
@ -424,7 +427,8 @@ end_week_round_results(void)
g_print("%s \n", buf2);
}
}
}
gui_show_progress(-1, "", PIC_TYPE_MATCHPIC);
}

View File

@ -84,7 +84,6 @@ string_token_form _FORMATION_
# tokens for news articles
#------------------------------------
string_token_cup _CUP_
string_token_cup_round_robin _CUPRR_
string_token_cup_knockout _CUPKO_
string_token_cup_stage _CUPSTAGE_
string_token_cup_match_winner _CUPMATCHWINNER_