mirror of
https://github.com/tstellar/bygfoot.git
synced 2025-02-19 04:50:48 +01:00
"Cup highlight."
This commit is contained in:
parent
bf2cd54ba6
commit
4fb13a6a8c
File diff suppressed because one or more lines are too long
@ -23,7 +23,7 @@ bygfoot_SOURCES = \
|
|||||||
interface.c callbacks.h interface.h support.h \
|
interface.c callbacks.h interface.h support.h \
|
||||||
lg_commentary.c free.h lg_commentary.h live_game.h misc.h option.h player.h variables.h \
|
lg_commentary.c free.h lg_commentary.h live_game.h misc.h option.h player.h variables.h \
|
||||||
league.c cup.h league.h maths.h misc.h option.h player.h stat.h table.h team.h user.h variables.h \
|
league.c cup.h league.h maths.h misc.h option.h player.h stat.h table.h team.h user.h variables.h \
|
||||||
live_game.c fixture.h free.h game.h game_gui.h lg_commentary.h live_game.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.h game_gui.h lg_commentary.h live_game.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_loadsave_misc.h xml_loadsave_cup.h xml_loadsave_league.h xml_loadsave_season_stats.h xml_loadsave_transfers.h xml_loadsave_users.h xml.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_loadsave_misc.h xml_loadsave_cup.h xml_loadsave_league.h xml_loadsave_season_stats.h xml_loadsave_transfers.h xml_loadsave_users.h xml.h \
|
||||||
main.c cup_struct.h misc_callbacks.h file.h free.h league_struct.h live_game.h main.h stat_struct.h transfer_struct.h variables.h window.h \
|
main.c cup_struct.h misc_callbacks.h file.h free.h league_struct.h live_game.h main.h stat_struct.h transfer_struct.h variables.h window.h \
|
||||||
maths.c maths.h misc.h \
|
maths.c maths.h misc.h \
|
||||||
|
33
src/cup.c
33
src/cup.c
@ -804,10 +804,11 @@ query_cup_begins(const Cup *cup)
|
|||||||
g_array_index(league->fixtures, Fixture,
|
g_array_index(league->fixtures, Fixture,
|
||||||
league->fixtures->len - 1).week_round_number == week_round) ||
|
league->fixtures->len - 1).week_round_number == week_round) ||
|
||||||
(league == NULL &&
|
(league == NULL &&
|
||||||
g_array_index(cup_temp->fixtures, Fixture,
|
(cup_temp->fixtures->len > 0 &&
|
||||||
cup_temp->fixtures->len - 1).week_number == week &&
|
g_array_index(cup_temp->fixtures, Fixture,
|
||||||
g_array_index(cup_temp->fixtures, Fixture,
|
cup_temp->fixtures->len - 1).week_number == week &&
|
||||||
cup_temp->fixtures->len - 1).week_round_number == week_round))
|
g_array_index(cup_temp->fixtures, Fixture,
|
||||||
|
cup_temp->fixtures->len - 1).week_round_number == week_round)))
|
||||||
proceed = TRUE;
|
proceed = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -823,8 +824,9 @@ query_cup_begins(const Cup *cup)
|
|||||||
g_array_index(league->fixtures, Fixture,
|
g_array_index(league->fixtures, Fixture,
|
||||||
league->fixtures->len - 1).attendance == -1) ||
|
league->fixtures->len - 1).attendance == -1) ||
|
||||||
(league == NULL &&
|
(league == NULL &&
|
||||||
g_array_index(cup_temp->fixtures, Fixture,
|
(cup_temp->fixtures->len > 0 &&
|
||||||
cup_temp->fixtures->len - 1).attendance == -1))
|
g_array_index(cup_temp->fixtures, Fixture,
|
||||||
|
cup_temp->fixtures->len - 1).attendance == -1)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -843,3 +845,22 @@ cup_count_international(void)
|
|||||||
|
|
||||||
return return_value;
|
return return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Find out whether the cup has a highlight property
|
||||||
|
and return the highlight colour. */
|
||||||
|
gchar*
|
||||||
|
cup_get_highlight_colour(const Cup *cup)
|
||||||
|
{
|
||||||
|
gint i;
|
||||||
|
gchar buf[SMALL];
|
||||||
|
|
||||||
|
for(i=0;i<cup->properties->len;i++)
|
||||||
|
if(g_str_has_prefix(((GString*)g_ptr_array_index(cup->properties, i))->str, "highlight"))
|
||||||
|
{
|
||||||
|
sprintf(buf, "string_cup_%s",
|
||||||
|
((GString*)g_ptr_array_index(cup->properties, i))->str);
|
||||||
|
return const_app(buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
#define query_cup_is_international(clid) query_cup_has_property(clid, "international")
|
#define query_cup_is_international(clid) query_cup_has_property(clid, "international")
|
||||||
#define query_cup_is_national(clid) query_cup_has_property(clid, "national")
|
#define query_cup_is_national(clid) query_cup_has_property(clid, "national")
|
||||||
#define query_cup_is_supercup(clid) query_cup_has_property(clid, "supercup")
|
#define query_cup_is_supercup(clid) query_cup_has_property(clid, "supercup")
|
||||||
#define query_cup_is_promotion(clid) query_cup_has_property(clid, "promotion")
|
|
||||||
#define query_cup_hide(clid) query_cup_has_property(clid, "hide")
|
#define query_cup_hide(clid) query_cup_has_property(clid, "hide")
|
||||||
|
|
||||||
Cup
|
Cup
|
||||||
@ -96,4 +95,7 @@ cup_get_winner(const Cup *cup);
|
|||||||
gint
|
gint
|
||||||
cup_count_international(void);
|
cup_count_international(void);
|
||||||
|
|
||||||
|
gchar*
|
||||||
|
cup_get_highlight_colour(const Cup *cup);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -570,11 +570,24 @@ gint
|
|||||||
fixture_get_free_round(gint week_number, gint clid)
|
fixture_get_free_round(gint week_number, gint clid)
|
||||||
{
|
{
|
||||||
gint i, j;
|
gint i, j;
|
||||||
gint max_round = 1;
|
gint max_round = 0;
|
||||||
|
|
||||||
if(clid < ID_CUP_START || query_cup_is_promotion(clid))
|
if(clid < ID_CUP_START)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
for(i=0;i<ligs->len;i++)
|
||||||
|
{
|
||||||
|
for(j=0;j<lig(i).fixtures->len;j++)
|
||||||
|
if(g_array_index(lig(i).fixtures, Fixture, j).week_number == week_number)
|
||||||
|
{
|
||||||
|
max_round = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(max_round == 1)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for(i=0;i<acps->len;i++)
|
for(i=0;i<acps->len;i++)
|
||||||
{
|
{
|
||||||
if(acp(i)->id != clid &&
|
if(acp(i)->id != clid &&
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include "callbacks.h"
|
||||||
#include "fixture.h"
|
#include "fixture.h"
|
||||||
#include "free.h"
|
#include "free.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
@ -47,8 +48,16 @@ live_game_calculate_fixture(Fixture *fix)
|
|||||||
stat2 = fixture_user_team_involved(fix);
|
stat2 = fixture_user_team_involved(fix);
|
||||||
statp = match;
|
statp = match;
|
||||||
|
|
||||||
if(show && window.live == NULL)
|
if(show)
|
||||||
window.live = window_create(WINDOW_LIVE);
|
{
|
||||||
|
cur_user = stat2;
|
||||||
|
on_button_back_to_main_clicked(NULL, NULL);
|
||||||
|
|
||||||
|
if(window.live == NULL)
|
||||||
|
window.live = window_create(WINDOW_LIVE);
|
||||||
|
else
|
||||||
|
window_live_set_spinbuttons();
|
||||||
|
}
|
||||||
|
|
||||||
live_game_reset(match, fix, TRUE);
|
live_game_reset(match, fix, TRUE);
|
||||||
game_initialize(fix);
|
game_initialize(fix);
|
||||||
|
@ -332,9 +332,7 @@ start_week_round(void)
|
|||||||
cur_user = 0;
|
cur_user = 0;
|
||||||
game_gui_show_main();
|
game_gui_show_main();
|
||||||
|
|
||||||
/*d ??*/
|
user_event_show_next();
|
||||||
/* if(week_round == 1) */
|
|
||||||
user_event_show_next();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
35
src/team.c
35
src/team.c
@ -966,26 +966,21 @@ query_team_plays(const Team *tm, gint week_number, gint week_round_number)
|
|||||||
{
|
{
|
||||||
gint i, j;
|
gint i, j;
|
||||||
|
|
||||||
if(week_round_number == 1)
|
for(i=0;i<ligs->len;i++)
|
||||||
{
|
for(j=0;j<lig(i).fixtures->len;j++)
|
||||||
for(i=0;i<ligs->len;i++)
|
if(g_array_index(lig(i).fixtures, Fixture, j).week_number == week_number &&
|
||||||
for(j=0;j<lig(i).fixtures->len;j++)
|
g_array_index(lig(i).fixtures, Fixture, j).week_round_number == week_round_number &&
|
||||||
if(g_array_index(lig(i).fixtures, Fixture, j).week_number == week_number &&
|
(g_array_index(lig(i).fixtures, Fixture, j).teams[0] == tm ||
|
||||||
g_array_index(lig(i).fixtures, Fixture, j).week_round_number == week_round_number &&
|
g_array_index(lig(i).fixtures, Fixture, j).teams[1] == tm))
|
||||||
(g_array_index(lig(i).fixtures, Fixture, j).teams[0] == tm ||
|
return TRUE;
|
||||||
g_array_index(lig(i).fixtures, Fixture, j).teams[1] == tm))
|
|
||||||
return TRUE;
|
for(i=0;i<acps->len;i++)
|
||||||
}
|
for(j=0;j<acp(i)->fixtures->len;j++)
|
||||||
else
|
if(g_array_index(acp(i)->fixtures, Fixture, j).week_number == week_number &&
|
||||||
{
|
g_array_index(acp(i)->fixtures, Fixture, j).week_round_number == week_round_number &&
|
||||||
for(i=0;i<acps->len;i++)
|
(g_array_index(acp(i)->fixtures, Fixture, j).teams[0] == tm ||
|
||||||
for(j=0;j<acp(i)->fixtures->len;j++)
|
g_array_index(acp(i)->fixtures, Fixture, j).teams[1] == tm))
|
||||||
if(g_array_index(acp(i)->fixtures, Fixture, j).week_number == week_number &&
|
return TRUE;
|
||||||
g_array_index(acp(i)->fixtures, Fixture, j).week_round_number == week_round_number &&
|
|
||||||
(g_array_index(acp(i)->fixtures, Fixture, j).teams[0] == tm ||
|
|
||||||
g_array_index(acp(i)->fixtures, Fixture, j).teams[1] == tm))
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1040,7 +1040,7 @@ treeview_create_single_table(GtkListStore *ls, const Table *table, gint number)
|
|||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
TableElement *elem = NULL;
|
TableElement *elem = NULL;
|
||||||
gchar buf[10][SMALL];
|
gchar buf[10][SMALL];
|
||||||
gchar colour_bg[SMALL], colour_fg[SMALL];
|
gchar *colour_bg = NULL, *colour_fg = NULL;
|
||||||
|
|
||||||
treeview_table_write_header(ls, table, number);
|
treeview_table_write_header(ls, table, number);
|
||||||
|
|
||||||
@ -1063,11 +1063,11 @@ treeview_create_single_table(GtkListStore *ls, const Table *table, gint number)
|
|||||||
treeview_helper_insert_icon(ls, &iter, 2,
|
treeview_helper_insert_icon(ls, &iter, 2,
|
||||||
const_app("string_treeview_table_stay_icon"));
|
const_app("string_treeview_table_stay_icon"));
|
||||||
|
|
||||||
treeview_helper_get_table_element_colours(table, i, colour_fg, colour_bg, FALSE);
|
treeview_helper_get_table_element_colours(table, i, &colour_fg, &colour_bg, FALSE);
|
||||||
sprintf(buf[0], "<span background='%s' foreground='%s'>%d</span>",
|
sprintf(buf[0], "<span background='%s' foreground='%s'>%d</span>",
|
||||||
colour_bg, colour_fg, i + 1);
|
colour_bg, colour_fg, i + 1);
|
||||||
|
|
||||||
treeview_helper_get_table_element_colours(table, i, colour_fg, colour_bg, TRUE);
|
treeview_helper_get_table_element_colours(table, i, &colour_fg, &colour_bg, TRUE);
|
||||||
sprintf(buf[1], "<span background='%s' foreground='%s'>%s</span>",
|
sprintf(buf[1], "<span background='%s' foreground='%s'>%s</span>",
|
||||||
colour_bg, colour_fg, elem->team->name->str);
|
colour_bg, colour_fg, elem->team->name->str);
|
||||||
|
|
||||||
|
@ -413,38 +413,43 @@ treeview_helper_player_compare(GtkTreeModel *model,
|
|||||||
table would participate in an international cup and set the
|
table would participate in an international cup and set the
|
||||||
colours accordingly. */
|
colours accordingly. */
|
||||||
gboolean
|
gboolean
|
||||||
treeview_helper_get_table_element_colour_cups(const League *league, gint idx, gchar *colour_bg)
|
treeview_helper_get_table_element_colour_cups(const League *league, gint idx, gchar **colour_bg)
|
||||||
{
|
{
|
||||||
gint i, j, k;
|
gint i, j, k;
|
||||||
const CupRound *cup_round = NULL;
|
const CupRound *cup_round = NULL;
|
||||||
gint league_idx = league_cup_get_index_from_clid(league->id) + 1;
|
gint league_idx = league_cup_get_index_from_clid(league->id) + 1;
|
||||||
gchar buf[SMALL];
|
gchar buf[SMALL];
|
||||||
|
gchar *cup_highlight_colour = NULL;
|
||||||
|
|
||||||
sprintf(buf, "LEAGUE%d", league_idx);
|
sprintf(buf, "LEAGUE%d", league_idx);
|
||||||
|
|
||||||
for(i=0;i<cps->len;i++)
|
for(i=0;i<cps->len;i++)
|
||||||
for(k=0;k<cp(i).rounds->len;k++)
|
{
|
||||||
{
|
cup_highlight_colour = cup_get_highlight_colour(&cp(i));
|
||||||
cup_round = &g_array_index(cp(i).rounds, CupRound, k);
|
|
||||||
for(j=0;j<cup_round->choose_teams->len;j++)
|
|
||||||
if(query_cup_is_international(cp(i).id) &&
|
|
||||||
(strcmp(g_array_index(cup_round->choose_teams, CupChooseTeam, j).sid->str, buf) == 0 ||
|
|
||||||
strcmp(g_array_index(cup_round->choose_teams, CupChooseTeam, j).sid->str, league->sid->str) == 0))
|
|
||||||
{
|
|
||||||
if((idx + 1 >= g_array_index(cup_round->choose_teams, CupChooseTeam, j).start_idx &&
|
|
||||||
idx + 1 <= g_array_index(cup_round->choose_teams, CupChooseTeam, j).end_idx &&
|
|
||||||
g_array_index(cup_round->choose_teams, CupChooseTeam, j).randomly) ||
|
|
||||||
(idx + 1 >= g_array_index(cup_round->choose_teams, CupChooseTeam, j).start_idx &&
|
|
||||||
idx + 1 < g_array_index(cup_round->choose_teams, CupChooseTeam, j).start_idx +
|
|
||||||
g_array_index(cup_round->choose_teams, CupChooseTeam, j).number_of_teams &&
|
|
||||||
!g_array_index(cup_round->choose_teams, CupChooseTeam, j).randomly))
|
|
||||||
{
|
|
||||||
strcpy(colour_bg, const_app("string_treeview_table_cup"));
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if(cup_highlight_colour != NULL)
|
||||||
|
for(k=0;k<cp(i).rounds->len;k++)
|
||||||
|
{
|
||||||
|
cup_round = &g_array_index(cp(i).rounds, CupRound, k);
|
||||||
|
for(j=0;j<cup_round->choose_teams->len;j++)
|
||||||
|
if(strcmp(g_array_index(cup_round->choose_teams, CupChooseTeam, j).sid->str, buf) == 0 ||
|
||||||
|
strcmp(g_array_index(cup_round->choose_teams, CupChooseTeam, j).sid->str, league->sid->str) == 0)
|
||||||
|
{
|
||||||
|
if((idx + 1 >= g_array_index(cup_round->choose_teams, CupChooseTeam, j).start_idx &&
|
||||||
|
idx + 1 <= g_array_index(cup_round->choose_teams, CupChooseTeam, j).end_idx &&
|
||||||
|
g_array_index(cup_round->choose_teams, CupChooseTeam, j).randomly) ||
|
||||||
|
(idx + 1 >= g_array_index(cup_round->choose_teams, CupChooseTeam, j).start_idx &&
|
||||||
|
idx + 1 < g_array_index(cup_round->choose_teams, CupChooseTeam, j).start_idx +
|
||||||
|
g_array_index(cup_round->choose_teams, CupChooseTeam, j).number_of_teams &&
|
||||||
|
!g_array_index(cup_round->choose_teams, CupChooseTeam, j).randomly))
|
||||||
|
{
|
||||||
|
*colour_bg = cup_highlight_colour;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -453,8 +458,8 @@ treeview_helper_get_table_element_colour_cups(const League *league, gint idx, gc
|
|||||||
@param idx The index of the element we're looking at.
|
@param idx The index of the element we're looking at.
|
||||||
@param user Whether to take into account user colours. */
|
@param user Whether to take into account user colours. */
|
||||||
void
|
void
|
||||||
treeview_helper_get_table_element_colours(const Table *table, gint idx, gchar *colour_fg,
|
treeview_helper_get_table_element_colours(const Table *table, gint idx, gchar **colour_fg,
|
||||||
gchar *colour_bg, gboolean user)
|
gchar **colour_bg, gboolean user)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
const TableElement *elem = &g_array_index(table->elements, TableElement, idx);
|
const TableElement *elem = &g_array_index(table->elements, TableElement, idx);
|
||||||
@ -462,25 +467,25 @@ treeview_helper_get_table_element_colours(const Table *table, gint idx, gchar *c
|
|||||||
const League *league = NULL;
|
const League *league = NULL;
|
||||||
GPtrArray *cup_advance = NULL;
|
GPtrArray *cup_advance = NULL;
|
||||||
|
|
||||||
strcpy(colour_fg, const_app("string_treeview_helper_color_default_foreground"));
|
*colour_fg = const_app("string_treeview_helper_color_default_foreground");
|
||||||
strcpy(colour_bg, const_app("string_treeview_helper_color_default_background"));
|
*colour_bg = const_app("string_treeview_helper_color_default_background");
|
||||||
|
|
||||||
if(user && elem->team == current_user.tm)
|
if(user && elem->team == current_user.tm)
|
||||||
{
|
{
|
||||||
strcpy(colour_fg, const_app("string_treeview_current_user_fg"));
|
*colour_fg = const_app("string_treeview_current_user_fg");
|
||||||
strcpy(colour_bg, const_app("string_treeview_current_user_bg"));
|
*colour_bg = const_app("string_treeview_current_user_bg");
|
||||||
}
|
}
|
||||||
else if(user && team_is_user(elem->team) != -1)
|
else if(user && team_is_user(elem->team) != -1)
|
||||||
{
|
{
|
||||||
strcpy(colour_fg, const_app("string_treeview_user_fg"));
|
*colour_fg = const_app("string_treeview_user_fg");
|
||||||
strcpy(colour_bg, const_app("string_treeview_user_bg"));
|
*colour_bg = const_app("string_treeview_user_bg");
|
||||||
}
|
}
|
||||||
else if(table->clid < ID_CUP_START)
|
else if(table->clid < ID_CUP_START)
|
||||||
{
|
{
|
||||||
league = league_from_clid(table->clid);
|
league = league_from_clid(table->clid);
|
||||||
|
|
||||||
if(idx + 1 == 1)
|
if(idx + 1 == 1)
|
||||||
strcpy(colour_bg, const_app("string_treeview_table_first"));
|
*colour_bg = const_app("string_treeview_table_first");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!treeview_helper_get_table_element_colour_cups(league, idx, colour_bg))
|
if(!treeview_helper_get_table_element_colour_cups(league, idx, colour_bg))
|
||||||
@ -491,14 +496,11 @@ treeview_helper_get_table_element_colours(const Table *table, gint idx, gchar *c
|
|||||||
if(pelem->ranks[0] <= idx + 1 && idx + 1 <= pelem->ranks[1])
|
if(pelem->ranks[0] <= idx + 1 && idx + 1 <= pelem->ranks[1])
|
||||||
{
|
{
|
||||||
if(pelem->type == PROM_REL_PROMOTION)
|
if(pelem->type == PROM_REL_PROMOTION)
|
||||||
strcpy(colour_bg, const_app("string_treeview_table_promotion"));
|
*colour_bg = const_app("string_treeview_table_promotion");
|
||||||
else if(pelem->type == PROM_REL_RELEGATION)
|
else if(pelem->type == PROM_REL_RELEGATION)
|
||||||
strcpy(colour_bg, const_app("string_treeview_table_relegation"));
|
*colour_bg = const_app("string_treeview_table_relegation");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(query_league_rank_in_prom_games(league, idx + 1))
|
|
||||||
strcpy(colour_bg, const_app("string_treeview_table_promgames"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -508,7 +510,7 @@ treeview_helper_get_table_element_colours(const Table *table, gint idx, gchar *c
|
|||||||
fixture_get_round_robin_advance(cup_from_clid(table->clid), table->round);
|
fixture_get_round_robin_advance(cup_from_clid(table->clid), table->round);
|
||||||
for(i=0;i<cup_advance->len;i++)
|
for(i=0;i<cup_advance->len;i++)
|
||||||
if((Team*)g_ptr_array_index(cup_advance, i) == elem->team)
|
if((Team*)g_ptr_array_index(cup_advance, i) == elem->team)
|
||||||
strcpy(colour_bg, const_app("string_treeview_table_promotion"));
|
*colour_bg = const_app("string_treeview_table_promotion");
|
||||||
|
|
||||||
free_g_ptr_array(&cup_advance);
|
free_g_ptr_array(&cup_advance);
|
||||||
}
|
}
|
||||||
|
@ -38,15 +38,15 @@ gint
|
|||||||
treeview_helper_get_col_number_column (GtkTreeViewColumn *col);
|
treeview_helper_get_col_number_column (GtkTreeViewColumn *col);
|
||||||
|
|
||||||
void
|
void
|
||||||
treeview_helper_get_table_element_colours(const Table *table, gint idx, gchar *colour_fg,
|
treeview_helper_get_table_element_colours(const Table *table, gint idx, gchar **colour_fg,
|
||||||
gchar *colour_bg, gboolean user);
|
gchar **colour_bg, gboolean user);
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
treeview_helper_get_table_element_colour_cups(const League *league, gint idx, gchar **colour_bg);
|
||||||
|
|
||||||
void
|
void
|
||||||
treeview_helper_set_user_colours(const Team *tm, gchar **colour_bg, gchar **colour_fg);
|
treeview_helper_set_user_colours(const Team *tm, gchar **colour_bg, gchar **colour_fg);
|
||||||
|
|
||||||
gboolean
|
|
||||||
treeview_helper_get_table_element_colour_cups(const League *league, gint idx, gchar *colour_bg);
|
|
||||||
|
|
||||||
PlayerListAttribute
|
PlayerListAttribute
|
||||||
treeview_helper_get_attributes_from_scout(gint scout);
|
treeview_helper_get_attributes_from_scout(gint scout);
|
||||||
|
|
||||||
|
20
src/window.c
20
src/window.c
@ -242,6 +242,19 @@ window_show_yesno(gchar *text)
|
|||||||
gtk_label_set_text(GTK_LABEL(lookup_widget(window.yesno, "label_yesno")), text);
|
gtk_label_set_text(GTK_LABEL(lookup_widget(window.yesno, "label_yesno")), text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Set the spinbuttons in the live window
|
||||||
|
to the correct values. */
|
||||||
|
void
|
||||||
|
window_live_set_spinbuttons(void)
|
||||||
|
{
|
||||||
|
gtk_spin_button_set_value(
|
||||||
|
GTK_SPIN_BUTTON(lookup_widget(window.live, "spinbutton_speed")),
|
||||||
|
(gfloat)option_int("int_opt_user_live_game_speed", &usr(stat2).options));
|
||||||
|
gtk_spin_button_set_value(
|
||||||
|
GTK_SPIN_BUTTON(lookup_widget(window.live, "spinbutton_verbosity")),
|
||||||
|
(gfloat)option_int("int_opt_user_live_game_verbosity", &usr(stat2).options));
|
||||||
|
}
|
||||||
|
|
||||||
/** Create and show a window. Which one depends on the argument.
|
/** Create and show a window. Which one depends on the argument.
|
||||||
@param window_type An integer telling us which window to
|
@param window_type An integer telling us which window to
|
||||||
create.
|
create.
|
||||||
@ -295,12 +308,7 @@ window_create(gint window_type)
|
|||||||
}
|
}
|
||||||
strcpy(buf, "Bygfoot Live game");
|
strcpy(buf, "Bygfoot Live game");
|
||||||
wind = window.live;
|
wind = window.live;
|
||||||
gtk_spin_button_set_value(
|
window_live_set_spinbuttons();
|
||||||
GTK_SPIN_BUTTON(lookup_widget(wind, "spinbutton_speed")),
|
|
||||||
(gfloat)option_int("int_opt_user_live_game_speed", &usr(stat2).options));
|
|
||||||
gtk_spin_button_set_value(
|
|
||||||
GTK_SPIN_BUTTON(lookup_widget(wind, "spinbutton_verbosity")),
|
|
||||||
(gfloat)option_int("int_opt_user_live_game_verbosity", &usr(stat2).options));
|
|
||||||
break;
|
break;
|
||||||
case WINDOW_WARNING:
|
case WINDOW_WARNING:
|
||||||
if(window.warning != NULL)
|
if(window.warning != NULL)
|
||||||
|
@ -56,4 +56,7 @@ window_show_options(void);
|
|||||||
void
|
void
|
||||||
window_show_menu_player(GdkEvent *event);
|
window_show_menu_player(GdkEvent *event);
|
||||||
|
|
||||||
|
void
|
||||||
|
window_live_set_spinbuttons(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -86,9 +86,9 @@ string_treeview_symbol_bg lightgrey
|
|||||||
string_treeview_table_first tomato
|
string_treeview_table_first tomato
|
||||||
string_treeview_table_promotion lightblue
|
string_treeview_table_promotion lightblue
|
||||||
string_treeview_table_relegation lightgreen
|
string_treeview_table_relegation lightgreen
|
||||||
string_treeview_table_promgames khaki
|
string_cup_highlight1 lightblue
|
||||||
string_treeview_table_best_advance khaki
|
string_cup_highlight2 khaki
|
||||||
string_treeview_table_cup lightblue
|
string_cup_highlight3 gold
|
||||||
|
|
||||||
# colour for expenses in the finances
|
# colour for expenses in the finances
|
||||||
string_treeview_finances_expenses_fg red
|
string_treeview_finances_expenses_fg red
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<sid>belgium_eindronde2</sid>
|
<sid>belgium_eindronde2</sid>
|
||||||
<add_week>1000</add_week>
|
<add_week>1000</add_week>
|
||||||
<property>national</property>
|
<property>national</property>
|
||||||
<property>promotion</property>
|
<property>highlight2</property>
|
||||||
<yellow_red>3</yellow_red>
|
<yellow_red>3</yellow_red>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<sid>brazil_prom_games2</sid>
|
<sid>brazil_prom_games2</sid>
|
||||||
<add_week>1000</add_week>
|
<add_week>1000</add_week>
|
||||||
<property>national</property>
|
<property>national</property>
|
||||||
<property>promotion</property>
|
<property>highlight2</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
<cup_round>
|
<cup_round>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<sid>brazil_prom_games3</sid>
|
<sid>brazil_prom_games3</sid>
|
||||||
<add_week>1000</add_week>
|
<add_week>1000</add_week>
|
||||||
<property>national</property>
|
<property>national</property>
|
||||||
<property>promotion</property>
|
<property>highlight2</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
<cup_round>
|
<cup_round>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<sid>brazil_prom_games4</sid>
|
<sid>brazil_prom_games4</sid>
|
||||||
<add_week>1000</add_week>
|
<add_week>1000</add_week>
|
||||||
<property>national</property>
|
<property>national</property>
|
||||||
<property>promotion</property>
|
<property>highlight2</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
<cup_round>
|
<cup_round>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<sid>brazil_prom_games5</sid>
|
<sid>brazil_prom_games5</sid>
|
||||||
<add_week>1000</add_week>
|
<add_week>1000</add_week>
|
||||||
<property>national</property>
|
<property>national</property>
|
||||||
<property>promotion</property>
|
<property>highlight2</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
<cup_round>
|
<cup_round>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<sid>brazil_prom_games6</sid>
|
<sid>brazil_prom_games6</sid>
|
||||||
<add_week>1000</add_week>
|
<add_week>1000</add_week>
|
||||||
<property>national</property>
|
<property>national</property>
|
||||||
<property>promotion</property>
|
<property>highlight2</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
<cup_round>
|
<cup_round>
|
||||||
|
@ -7,7 +7,9 @@
|
|||||||
<skill_diff>500</skill_diff>
|
<skill_diff>500</skill_diff>
|
||||||
<last_week>15</last_week>
|
<last_week>15</last_week>
|
||||||
<week_gap>1</week_gap>
|
<week_gap>1</week_gap>
|
||||||
|
<group>1005</group>
|
||||||
<property>international</property>
|
<property>international</property>
|
||||||
|
<property>hide</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
|
|
||||||
|
@ -7,7 +7,9 @@
|
|||||||
<skill_diff>500</skill_diff>
|
<skill_diff>500</skill_diff>
|
||||||
<last_week>15</last_week>
|
<last_week>15</last_week>
|
||||||
<week_gap>1</week_gap>
|
<week_gap>1</week_gap>
|
||||||
|
<group>1005</group>
|
||||||
<property>international</property>
|
<property>international</property>
|
||||||
|
<property>hide</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
<last_week>15</last_week>
|
<last_week>15</last_week>
|
||||||
<week_gap>2</week_gap>
|
<week_gap>2</week_gap>
|
||||||
<property>international</property>
|
<property>international</property>
|
||||||
|
<property>hide</property>
|
||||||
|
<property>highlight1</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
|
|
||||||
@ -19,10 +21,23 @@
|
|||||||
<choose_teams>
|
<choose_teams>
|
||||||
<choose_team>
|
<choose_team>
|
||||||
<choose_team_sid>brazil1</choose_team_sid>
|
<choose_team_sid>brazil1</choose_team_sid>
|
||||||
<number_of_teams>3</number_of_teams>
|
<number_of_teams>1</number_of_teams>
|
||||||
<start_idx>1</start_idx>
|
<start_idx>1</start_idx>
|
||||||
<end_idx>12</end_idx>
|
<end_idx>1</end_idx>
|
||||||
<randomly>1</randomly>
|
</choose_team>
|
||||||
|
|
||||||
|
<choose_team>
|
||||||
|
<choose_team_sid>brazil1</choose_team_sid>
|
||||||
|
<number_of_teams>1</number_of_teams>
|
||||||
|
<start_idx>5</start_idx>
|
||||||
|
<end_idx>5</end_idx>
|
||||||
|
</choose_team>
|
||||||
|
|
||||||
|
<choose_team>
|
||||||
|
<choose_team_sid>brazil1</choose_team_sid>
|
||||||
|
<number_of_teams>1</number_of_teams>
|
||||||
|
<start_idx>9</start_idx>
|
||||||
|
<end_idx>9</end_idx>
|
||||||
</choose_team>
|
</choose_team>
|
||||||
</choose_teams>
|
</choose_teams>
|
||||||
</cup_round>
|
</cup_round>
|
||||||
|
@ -7,7 +7,10 @@
|
|||||||
<group>1005</group>
|
<group>1005</group>
|
||||||
<last_week>15</last_week>
|
<last_week>15</last_week>
|
||||||
<week_gap>2</week_gap>
|
<week_gap>2</week_gap>
|
||||||
|
<group>1005</group>
|
||||||
<property>international</property>
|
<property>international</property>
|
||||||
|
<property>hide</property>
|
||||||
|
<property>highlight1</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
|
|
||||||
@ -19,12 +22,25 @@
|
|||||||
<choose_teams>
|
<choose_teams>
|
||||||
<choose_team>
|
<choose_team>
|
||||||
<choose_team_sid>brazil1</choose_team_sid>
|
<choose_team_sid>brazil1</choose_team_sid>
|
||||||
<number_of_teams>3</number_of_teams>
|
<number_of_teams>1</number_of_teams>
|
||||||
<start_idx>1</start_idx>
|
<start_idx>2</start_idx>
|
||||||
<end_idx>12</end_idx>
|
<end_idx>2</end_idx>
|
||||||
<randomly>1</randomly>
|
|
||||||
</choose_team>
|
</choose_team>
|
||||||
</choose_teams>
|
|
||||||
|
<choose_team>
|
||||||
|
<choose_team_sid>brazil1</choose_team_sid>
|
||||||
|
<number_of_teams>1</number_of_teams>
|
||||||
|
<start_idx>6</start_idx>
|
||||||
|
<end_idx>6</end_idx>
|
||||||
|
</choose_team>
|
||||||
|
|
||||||
|
<choose_team>
|
||||||
|
<choose_team_sid>brazil1</choose_team_sid>
|
||||||
|
<number_of_teams>1</number_of_teams>
|
||||||
|
<start_idx>10</start_idx>
|
||||||
|
<end_idx>10</end_idx>
|
||||||
|
</choose_team>
|
||||||
|
</choose_teams>
|
||||||
</cup_round>
|
</cup_round>
|
||||||
|
|
||||||
</cup_rounds>
|
</cup_rounds>
|
||||||
|
@ -7,7 +7,10 @@
|
|||||||
<group>1005</group>
|
<group>1005</group>
|
||||||
<last_week>15</last_week>
|
<last_week>15</last_week>
|
||||||
<week_gap>2</week_gap>
|
<week_gap>2</week_gap>
|
||||||
|
<group>1005</group>
|
||||||
<property>international</property>
|
<property>international</property>
|
||||||
|
<property>hide</property>
|
||||||
|
<property>highlight1</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
|
|
||||||
@ -19,12 +22,25 @@
|
|||||||
<choose_teams>
|
<choose_teams>
|
||||||
<choose_team>
|
<choose_team>
|
||||||
<choose_team_sid>brazil1</choose_team_sid>
|
<choose_team_sid>brazil1</choose_team_sid>
|
||||||
<number_of_teams>3</number_of_teams>
|
<number_of_teams>1</number_of_teams>
|
||||||
<start_idx>1</start_idx>
|
<start_idx>3</start_idx>
|
||||||
<end_idx>12</end_idx>
|
<end_idx>3</end_idx>
|
||||||
<randomly>1</randomly>
|
|
||||||
</choose_team>
|
</choose_team>
|
||||||
</choose_teams>
|
|
||||||
|
<choose_team>
|
||||||
|
<choose_team_sid>brazil1</choose_team_sid>
|
||||||
|
<number_of_teams>1</number_of_teams>
|
||||||
|
<start_idx>7</start_idx>
|
||||||
|
<end_idx>7</end_idx>
|
||||||
|
</choose_team>
|
||||||
|
|
||||||
|
<choose_team>
|
||||||
|
<choose_team_sid>brazil1</choose_team_sid>
|
||||||
|
<number_of_teams>1</number_of_teams>
|
||||||
|
<start_idx>11</start_idx>
|
||||||
|
<end_idx>11</end_idx>
|
||||||
|
</choose_team>
|
||||||
|
</choose_teams>
|
||||||
</cup_round>
|
</cup_round>
|
||||||
|
|
||||||
</cup_rounds>
|
</cup_rounds>
|
||||||
|
@ -7,7 +7,10 @@
|
|||||||
<group>1005</group>
|
<group>1005</group>
|
||||||
<last_week>15</last_week>
|
<last_week>15</last_week>
|
||||||
<week_gap>2</week_gap>
|
<week_gap>2</week_gap>
|
||||||
|
<group>1005</group>
|
||||||
<property>international</property>
|
<property>international</property>
|
||||||
|
<property>hide</property>
|
||||||
|
<property>highlight1</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
|
|
||||||
@ -19,12 +22,25 @@
|
|||||||
<choose_teams>
|
<choose_teams>
|
||||||
<choose_team>
|
<choose_team>
|
||||||
<choose_team_sid>brazil1</choose_team_sid>
|
<choose_team_sid>brazil1</choose_team_sid>
|
||||||
<number_of_teams>3</number_of_teams>
|
<number_of_teams>1</number_of_teams>
|
||||||
<start_idx>1</start_idx>
|
<start_idx>4</start_idx>
|
||||||
<end_idx>12</end_idx>
|
<end_idx>4</end_idx>
|
||||||
<randomly>1</randomly>
|
|
||||||
</choose_team>
|
</choose_team>
|
||||||
</choose_teams>
|
|
||||||
|
<choose_team>
|
||||||
|
<choose_team_sid>brazil1</choose_team_sid>
|
||||||
|
<number_of_teams>1</number_of_teams>
|
||||||
|
<start_idx>8</start_idx>
|
||||||
|
<end_idx>8</end_idx>
|
||||||
|
</choose_team>
|
||||||
|
|
||||||
|
<choose_team>
|
||||||
|
<choose_team_sid>brazil1</choose_team_sid>
|
||||||
|
<number_of_teams>1</number_of_teams>
|
||||||
|
<start_idx>12</start_idx>
|
||||||
|
<end_idx>12</end_idx>
|
||||||
|
</choose_team>
|
||||||
|
</choose_teams>
|
||||||
</cup_round>
|
</cup_round>
|
||||||
|
|
||||||
</cup_rounds>
|
</cup_rounds>
|
||||||
|
@ -7,7 +7,9 @@
|
|||||||
<skill_diff>500</skill_diff>
|
<skill_diff>500</skill_diff>
|
||||||
<last_week>15</last_week>
|
<last_week>15</last_week>
|
||||||
<week_gap>1</week_gap>
|
<week_gap>1</week_gap>
|
||||||
|
<group>1005</group>
|
||||||
<property>international</property>
|
<property>international</property>
|
||||||
|
<property>hide</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
|
|
||||||
|
@ -7,7 +7,9 @@
|
|||||||
<skill_diff>500</skill_diff>
|
<skill_diff>500</skill_diff>
|
||||||
<last_week>15</last_week>
|
<last_week>15</last_week>
|
||||||
<week_gap>1</week_gap>
|
<week_gap>1</week_gap>
|
||||||
|
<group>1005</group>
|
||||||
<property>international</property>
|
<property>international</property>
|
||||||
|
<property>hide</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
|
|
||||||
|
@ -7,7 +7,9 @@
|
|||||||
<skill_diff>500</skill_diff>
|
<skill_diff>500</skill_diff>
|
||||||
<last_week>15</last_week>
|
<last_week>15</last_week>
|
||||||
<week_gap>1</week_gap>
|
<week_gap>1</week_gap>
|
||||||
|
<group>1005</group>
|
||||||
<property>international</property>
|
<property>international</property>
|
||||||
|
<property>hide</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<sid>england_prom_games2</sid>
|
<sid>england_prom_games2</sid>
|
||||||
<add_week>1000</add_week>
|
<add_week>1000</add_week>
|
||||||
<property>national</property>
|
<property>national</property>
|
||||||
<property>promotion</property>
|
<property>highlight2</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
<cup_round>
|
<cup_round>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<sid>england_prom_games3</sid>
|
<sid>england_prom_games3</sid>
|
||||||
<add_week>1000</add_week>
|
<add_week>1000</add_week>
|
||||||
<property>national</property>
|
<property>national</property>
|
||||||
<property>promotion</property>
|
<property>highlight2</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
<cup_round>
|
<cup_round>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<sid>england_prom_games4</sid>
|
<sid>england_prom_games4</sid>
|
||||||
<add_week>1000</add_week>
|
<add_week>1000</add_week>
|
||||||
<property>national</property>
|
<property>national</property>
|
||||||
<property>promotion</property>
|
<property>highlight2</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
<cup_round>
|
<cup_round>
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
<add_week>0</add_week>
|
<add_week>0</add_week>
|
||||||
<week_gap>4</week_gap>
|
<week_gap>4</week_gap>
|
||||||
<property>international</property>
|
<property>international</property>
|
||||||
|
<property>highlight1</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
<add_week>0</add_week>
|
<add_week>0</add_week>
|
||||||
<week_gap>4</week_gap>
|
<week_gap>4</week_gap>
|
||||||
<property>international</property>
|
<property>international</property>
|
||||||
|
<property>highlight1</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
<cup_round>
|
<cup_round>
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
<last_week>44</last_week>
|
<last_week>44</last_week>
|
||||||
<add_week>0</add_week>
|
<add_week>0</add_week>
|
||||||
<property>international</property>
|
<property>international</property>
|
||||||
|
<property>highlight1</property>
|
||||||
|
|
||||||
<cup_rounds>
|
<cup_rounds>
|
||||||
<cup_round>
|
<cup_round>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user