1
1
mirror of https://github.com/tstellar/bygfoot.git synced 2025-01-30 23:44:49 +01:00

Reset button.

This commit is contained in:
gyboth 2005-04-26 15:00:26 +00:00
parent 214538c1d5
commit 273fd4eb5e
10 changed files with 236 additions and 66 deletions

View File

@ -15,6 +15,11 @@
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="icon">bygfoot_icon.png</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="delete_event" handler="on_button_quit_clicked" last_modification_time="Fri, 06 Feb 2004 18:11:00 GMT"/>
<signal name="destroy_event" handler="on_button_quit_clicked" last_modification_time="Fri, 06 Feb 2004 18:10:51 GMT"/>
@ -64,7 +69,7 @@
<accelerator key="l" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image293">
<widget class="GtkImage" id="image299">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
<property name="icon_size">1</property>
@ -96,7 +101,7 @@
</child>
<child>
<widget class="GtkMenuItem" id="trennlinie1">
<widget class="GtkSeparatorMenuItem" id="trennlinie1">
<property name="visible">True</property>
</widget>
</child>
@ -132,7 +137,7 @@
<accelerator key="p" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image294">
<widget class="GtkImage" id="image300">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">1</property>
@ -146,7 +151,7 @@
</child>
<child>
<widget class="GtkMenuItem" id="trennlinie7">
<widget class="GtkSeparatorMenuItem" id="trennlinie7">
<property name="visible">True</property>
</widget>
</child>
@ -489,11 +494,20 @@
</child>
<child>
<widget class="GtkMenuItem" id="trennlinie11">
<widget class="GtkSeparatorMenuItem" id="trennlinie11">
<property name="visible">True</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menu_reset_players">
<property name="tooltip" translatable="yes">Reset player list to the formation at the beginning of the live game pause (right click on player list)</property>
<property name="label" translatable="yes">Reset player list</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menu_reset_players_activate" last_modification_time="Tue, 26 Apr 2005 13:16:39 GMT"/>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menu_custom_structure">
<property name="visible">True</property>
@ -515,7 +529,7 @@
</child>
<child>
<widget class="GtkMenuItem" id="trennlinie8">
<widget class="GtkSeparatorMenuItem" id="trennlinie8">
<property name="visible">True</property>
</widget>
</child>
@ -597,7 +611,7 @@
</child>
<child>
<widget class="GtkMenuItem" id="trennlinie10">
<widget class="GtkSeparatorMenuItem" id="trennlinie10">
<property name="visible">True</property>
</widget>
</child>
@ -644,7 +658,7 @@
</child>
<child>
<widget class="GtkMenuItem" id="trennlinie12">
<widget class="GtkSeparatorMenuItem" id="trennlinie12">
<property name="visible">True</property>
</widget>
</child>
@ -660,7 +674,7 @@
</child>
<child>
<widget class="GtkMenuItem" id="trennlinie9">
<widget class="GtkSeparatorMenuItem" id="trennlinie9">
<property name="visible">True</property>
</widget>
</child>
@ -674,7 +688,7 @@
<accelerator key="F9" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image295">
<widget class="GtkImage" id="image301">
<property name="visible">True</property>
<property name="stock">gtk-go-forward</property>
<property name="icon_size">1</property>
@ -696,7 +710,7 @@
<accelerator key="F8" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image296">
<widget class="GtkImage" id="image302">
<property name="visible">True</property>
<property name="stock">gtk-go-back</property>
<property name="icon_size">1</property>
@ -718,7 +732,7 @@
<accelerator key="F12" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image297">
<widget class="GtkImage" id="image303">
<property name="visible">True</property>
<property name="stock">gtk-justify-fill</property>
<property name="icon_size">1</property>
@ -811,6 +825,7 @@
<property name="tooltip" translatable="yes">Load game (Ctrl - O)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_load_clicked" last_modification_time="Fri, 06 Feb 2004 10:20:08 GMT"/>
<child>
@ -839,6 +854,7 @@
<property name="tooltip" translatable="yes">Save game (Ctrl - S)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_save_clicked" last_modification_time="Fri, 06 Feb 2004 10:20:01 GMT"/>
<child>
@ -867,6 +883,7 @@
<property name="tooltip" translatable="yes">Quit (Ctrl - Q)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_quit_clicked" last_modification_time="Fri, 06 Feb 2004 17:14:19 GMT"/>
<child>
@ -921,6 +938,7 @@
<property name="tooltip" translatable="yes">Back to main menu (Esc)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_back_to_main_clicked" last_modification_time="Sun, 01 Feb 2004 18:32:31 GMT"/>
<accelerator key="Escape" modifiers="0" signal="clicked"/>
@ -950,6 +968,7 @@
<property name="tooltip" translatable="yes">Show transferlist (T)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_transfers_clicked" last_modification_time="Thu, 22 Jul 2004 11:14:11 GMT"/>
<accelerator key="t" modifiers="0" signal="clicked"/>
@ -978,6 +997,7 @@
<property name="tooltip" translatable="yes">Show my last games and a preview of my next games (F1)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_preview_clicked" last_modification_time="Wed, 04 Feb 2004 13:24:35 GMT"/>
<accelerator key="F1" modifiers="0" signal="clicked"/>
@ -1019,6 +1039,7 @@
<property name="tooltip" translatable="yes">Begin a new week (Space)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_new_week_clicked" last_modification_time="Tue, 03 Feb 2004 09:38:07 GMT"/>
<accelerator key="space" modifiers="0" signal="clicked"/>
@ -1047,6 +1068,7 @@
<property name="tooltip" translatable="yes">Help (H)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_help_clicked" last_modification_time="Wed, 11 Feb 2004 12:34:21 GMT"/>
<accelerator key="h" modifiers="0" signal="clicked"/>
@ -1112,6 +1134,8 @@
<child>
<widget class="GtkEventBox" id="eventbox_main_info">
<property name="visible">True</property>
<property name="visible_window">True</property>
<property name="above_child">False</property>
<child>
<widget class="GtkHBox" id="hbox18">
@ -1289,6 +1313,8 @@
<widget class="GtkEventBox" id="eventbox_style">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Right click and left click to change your playing style</property>
<property name="visible_window">True</property>
<property name="above_child">False</property>
<signal name="button_press_event" handler="on_eventbox_style_button_press_event" last_modification_time="Fri, 11 Mar 2005 15:30:28 GMT"/>
<child>
@ -1312,6 +1338,8 @@
<widget class="GtkEventBox" id="eventbox_boost">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Right click and left click to change boost state</property>
<property name="visible_window">True</property>
<property name="above_child">False</property>
<signal name="button_press_event" handler="on_eventbox_boost_button_press_event" last_modification_time="Fri, 11 Mar 2005 15:30:40 GMT"/>
<child>
@ -1334,6 +1362,8 @@
<child>
<widget class="GtkEventBox" id="eventbox_team_name">
<property name="visible">True</property>
<property name="visible_window">True</property>
<property name="above_child">False</property>
<child>
<widget class="GtkLabel" id="label_team">
@ -1389,6 +1419,8 @@
<child>
<widget class="GtkEventBox" id="eventbox_rank">
<property name="visible">True</property>
<property name="visible_window">True</property>
<property name="above_child">False</property>
<child>
<widget class="GtkHBox" id="hbox49">
@ -1519,6 +1551,8 @@
<widget class="GtkEventBox" id="eventbox1">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">First value: average current skill of the first 11 players. Second value: average skill of all players.</property>
<property name="visible_window">True</property>
<property name="above_child">False</property>
<child>
<widget class="GtkHBox" id="hbox50">
@ -1709,6 +1743,33 @@
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button_reset_players">
<property name="tooltip" translatable="yes">Reset player list to the formation at the beginning of the live game pause (right click on player list)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_reset_players_clicked" last_modification_time="Tue, 26 Apr 2005 13:12:43 GMT"/>
<child>
<widget class="GtkImage" id="image298">
<property name="visible">True</property>
<property name="stock">gtk-undo</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="shrink">True</property>
@ -1734,6 +1795,7 @@
<property name="tooltip" translatable="yes">Previous league/cup (1)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_cl_back_clicked" last_modification_time="Mon, 14 Mar 2005 09:36:55 GMT"/>
<accelerator key="1" modifiers="0" signal="clicked"/>
@ -1762,6 +1824,7 @@
<property name="tooltip" translatable="yes">Next league/cup (2)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_cl_forward_clicked" last_modification_time="Mon, 14 Mar 2005 09:37:07 GMT"/>
<accelerator key="2" modifiers="0" signal="clicked"/>
@ -1790,6 +1853,7 @@
<property name="tooltip" translatable="yes">Previous (Q)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_browse_back_clicked" last_modification_time="Sun, 01 Feb 2004 12:04:37 GMT"/>
<accelerator key="q" modifiers="0" signal="clicked"/>
@ -1818,6 +1882,7 @@
<property name="tooltip" translatable="yes">Next (W)</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_browse_forward_clicked" last_modification_time="Sun, 01 Feb 2004 12:04:29 GMT"/>
<accelerator key="w" modifiers="0" signal="clicked"/>

View File

@ -10,7 +10,7 @@ bin_PROGRAMS = bygfoot
bygfoot_SOURCES = \
callback_func.c callback_func.h callbacks.h cup.h finance.h fixture.h game_gui.h league.h live_game.h maths.h misc.h option.h player.h start_end.h team.h transfer.h treeview.h user.h window.h \
callbacks.c callbacks.h callback_func.h free.h game_gui.h gui.h load_save.h main.h option.h player.h team.h transfer.h treeview.h treeview_helper.h user.h window.h \
callbacks.c callbacks.h callback_func.h free.h game.h game_gui.h gui.h load_save.h main.h option.h player.h team.h transfer.h treeview.h treeview_helper.h user.h window.h \
cup.c cup.h fixture.h free.h league.h main.h maths.h misc.h team.h variables.h xml_league.h \
file.c file.h free.h main.h misc.h option.h support.h variables.h \
finance.c callbacks.h finance.h game_gui.h maths.h option.h player.h team.h user.h \

View File

@ -1,6 +1,7 @@
#include "callbacks.h"
#include "callback_func.h"
#include "free.h"
#include "game.h"
#include "game_gui.h"
#include "gui.h"
#include "load_save.h"
@ -109,7 +110,8 @@ void
on_button_back_to_main_clicked (GtkButton *button,
gpointer user_data)
{
stat0 = STATUS_MAIN;
if(stat0 != STATUS_LIVE_GAME_PAUSE)
stat0 = STATUS_MAIN;
gtk_notebook_set_current_page(GTK_NOTEBOOK(lookup_widget(window.main, "notebook_player")), 0);
game_gui_show_main();
@ -179,6 +181,11 @@ on_player_list1_button_press_event (GtkWidget *widget,
on_menu_rearrange_team_activate(NULL, NULL);
return TRUE;
}
else if(stat0 == STATUS_LIVE_GAME_PAUSE && event->button == 3)
{
on_menu_reset_players_activate(NULL, NULL);
return TRUE;
}
if(treeview_helper_select_row(GTK_TREE_VIEW(widget), event))
idx = treeview_helper_get_index(GTK_TREE_VIEW(widget), 0);
@ -795,3 +802,31 @@ on_menu_user_show_history_activate (GtkMenuItem *menuitem,
gui_set_arrows();
}
void
on_button_reset_players_clicked (GtkButton *button,
gpointer user_data)
{
on_menu_reset_players_activate(NULL, NULL);
}
void
on_menu_reset_players_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
gint idx = -1;
if(team_is_user(usr(stat2).live_game.fix->teams[0]) == -1 ||
team_is_user(usr(stat2).live_game.fix->teams[1]) == -1)
idx = (team_is_user(usr(stat2).live_game.fix->teams[0]) == -1);
else
{
if(team_is_user(usr(stat2).live_game.fix->teams[0]) == cur_user)
idx = 0;
else
idx = 1;
}
game_reset_players(idx);
}

View File

@ -248,4 +248,12 @@ on_menu_fixtures_week_activate (GtkMenuItem *menuitem,
void
on_menu_user_show_history_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_button_reset_players_clicked (GtkButton *button,
gpointer user_data);
void
on_menu_reset_players_activate (GtkMenuItem *menuitem,
gpointer user_data);
#endif

View File

@ -386,12 +386,44 @@ game_check_live_game_resume_state(void)
subs[i]++;
if(subs[i] > usr(stat2).live_game.subs_left[i])
{
game_reset_players(i);
return_value = FALSE;
}
}
return return_value;
}
/** Undo the player swaps the user made during a live game pause.
@param idx The team index in the current live game fixture. */
void
game_reset_players(gint idx)
{
gint i;
Team *tm = usr(stat2).live_game.fix->teams[idx];
GArray *players = g_array_new(FALSE, FALSE, sizeof(Player));
for(i=0;i<11;i++)
g_array_append_val(players,
*player_of_id_team(tm, usr(stat2).live_game.team_state[idx].player_ids[i]));
for(i=0;i<tm->players->len;i++)
if(!query_integer_is_in_array(player_of_idx_team(tm, i)->id,
usr(stat2).live_game.team_state[idx].player_ids,
0, 11))
g_array_append_val(players, *player_of_idx_team(tm, i));
g_array_free(tm->players, TRUE);
tm->players = players;
team_change_structure(tm, team_find_appropriate_structure(tm));
team_rearrange(tm);
treeview_show_user_player_list();
}
/** Find pairs of substituted players after a live game pause. */
void
game_get_subs(gint team_number, gint *subs_in, gint *subs_out)

View File

@ -85,4 +85,7 @@ game_stadium_event(Stadium *stadium, gint type);
void
game_get_max_values(gfloat max_values[3]);
void
game_reset_players(gint idx);
#endif

View File

@ -317,7 +317,7 @@ game_gui_show_main(void)
game_gui_set_main_window_header();
treeview_show_user_player_list();
if(current_user.counters[COUNT_USER_SHOW_RES])
if(current_user.counters[COUNT_USER_SHOW_RES] && stat0 != STATUS_LIVE_GAME_PAUSE)
{
on_menu_user_show_last_stats_activate(NULL, NULL);
current_user.counters[COUNT_USER_SHOW_RES] = 0;
@ -379,6 +379,13 @@ enum MainWindowInensitiveItems
INSENSITIVE_ITEM_END
};
enum MainWindowShowItems
{
SHOW_ITEM_RESET_BUTTON = 0,
SHOW_ITEM_RESET_MENU,
SHOW_ITEM_END
};
/** Set appropriate parts of the main window insensitive when
the live game is paused or resumed.
@param value Whether we set sensitive or insensitive. */
@ -387,6 +394,7 @@ game_gui_set_main_window_sensitivity(gboolean value)
{
gint i;
GtkWidget *insensitive_items[INSENSITIVE_ITEM_END];
GtkWidget *show_items[SHOW_ITEM_END];
insensitive_items[INSENSITIVE_ITEM_TOOLBAR] =
lookup_widget(window.main, "hbox1");
@ -427,9 +435,21 @@ game_gui_set_main_window_sensitivity(gboolean value)
insensitive_items[INSENSITIVE_ITEM_MENU_OFFER_CONTRACT] =
lookup_widget(window.main, "menu_offer_new_contract");
show_items[SHOW_ITEM_RESET_BUTTON] =
lookup_widget(window.main, "button_reset_players");
show_items[SHOW_ITEM_RESET_MENU] =
lookup_widget(window.main, "menu_reset_players");
for(i=0;i<INSENSITIVE_ITEM_END;i++)
gtk_widget_set_sensitive(insensitive_items[i], !value);
if(value)
for(i=0;i<SHOW_ITEM_END;i++)
gtk_widget_show(show_items[i]);
else
for(i=0;i<SHOW_ITEM_END;i++)
gtk_widget_hide(show_items[i]);
gtk_widget_set_sensitive(window.main, value);
}

View File

@ -38,7 +38,7 @@ create_main_window (void)
GtkWidget *menu_new;
GtkWidget *menu_open;
GtkWidget *menu_load_last_save;
GtkWidget *image293;
GtkWidget *image299;
GtkWidget *menu_save;
GtkWidget *menu_save_as;
GtkWidget *trennlinie1;
@ -46,7 +46,7 @@ create_main_window (void)
GtkWidget *menu_options;
GtkWidget *menu_options_menu;
GtkWidget *menu_preferences;
GtkWidget *image294;
GtkWidget *image300;
GtkWidget *trennlinie7;
GtkWidget *menu_job_offers;
GtkWidget *menu_live_game;
@ -90,6 +90,7 @@ create_main_window (void)
GtkWidget *menu_boost_off;
GtkWidget *menu_boost_anti;
GtkWidget *trennlinie11;
GtkWidget *menu_reset_players;
GtkWidget *menu_custom_structure;
GtkWidget *menu_rearrange_team;
GtkWidget *trennlinie8;
@ -112,11 +113,11 @@ create_main_window (void)
GtkWidget *menu_user_show_history;
GtkWidget *trennlinie9;
GtkWidget *menu_next_user;
GtkWidget *image295;
GtkWidget *image301;
GtkWidget *menu_previous_user;
GtkWidget *image296;
GtkWidget *image302;
GtkWidget *menu_manage_users;
GtkWidget *image297;
GtkWidget *image303;
GtkWidget *menu_finances_stadium;
GtkWidget *menu_finances_stadium_menu;
GtkWidget *menu_show_finances;
@ -186,6 +187,8 @@ create_main_window (void)
GtkWidget *label71;
GtkWidget *player_list2;
GtkWidget *label72;
GtkWidget *button_reset_players;
GtkWidget *image298;
GtkWidget *vbox8;
GtkWidget *hbox_14;
GtkWidget *button_cl_back;
@ -246,9 +249,9 @@ create_main_window (void)
GDK_l, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
GTK_ACCEL_VISIBLE);
image293 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU);
gtk_widget_show (image293);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_load_last_save), image293);
image299 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU);
gtk_widget_show (image299);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_load_last_save), image299);
menu_save = gtk_image_menu_item_new_from_stock ("gtk-save", accel_group);
gtk_widget_show (menu_save);
@ -258,7 +261,7 @@ create_main_window (void)
gtk_widget_show (menu_save_as);
gtk_container_add (GTK_CONTAINER (menu_file_menu), menu_save_as);
trennlinie1 = gtk_menu_item_new ();
trennlinie1 = gtk_separator_menu_item_new ();
gtk_widget_show (trennlinie1);
gtk_container_add (GTK_CONTAINER (menu_file_menu), trennlinie1);
gtk_widget_set_sensitive (trennlinie1, FALSE);
@ -281,11 +284,11 @@ create_main_window (void)
GDK_p, GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
image294 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU);
gtk_widget_show (image294);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_preferences), image294);
image300 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU);
gtk_widget_show (image300);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_preferences), image300);
trennlinie7 = gtk_menu_item_new ();
trennlinie7 = gtk_separator_menu_item_new ();
gtk_widget_show (trennlinie7);
gtk_container_add (GTK_CONTAINER (menu_options_menu), trennlinie7);
gtk_widget_set_sensitive (trennlinie7, FALSE);
@ -475,11 +478,15 @@ create_main_window (void)
gtk_container_add (GTK_CONTAINER (menu_boost_menu), menu_boost_anti);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_boost_anti), TRUE);
trennlinie11 = gtk_menu_item_new ();
trennlinie11 = gtk_separator_menu_item_new ();
gtk_widget_show (trennlinie11);
gtk_container_add (GTK_CONTAINER (menu_team_menu), trennlinie11);
gtk_widget_set_sensitive (trennlinie11, FALSE);
menu_reset_players = gtk_menu_item_new_with_mnemonic (_("Reset player list"));
gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_reset_players);
gtk_tooltips_set_tip (tooltips, menu_reset_players, _("Reset player list to the formation at the beginning of the live game pause (right click on player list)"), NULL);
menu_custom_structure = gtk_menu_item_new_with_mnemonic (_("Enter custom structure"));
gtk_widget_show (menu_custom_structure);
gtk_container_add (GTK_CONTAINER (menu_team_menu), menu_custom_structure);
@ -492,7 +499,7 @@ create_main_window (void)
GDK_r, GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
trennlinie8 = gtk_menu_item_new ();
trennlinie8 = gtk_separator_menu_item_new ();
gtk_widget_show (trennlinie8);
gtk_container_add (GTK_CONTAINER (menu_team_menu), trennlinie8);
gtk_widget_set_sensitive (trennlinie8, FALSE);
@ -532,7 +539,7 @@ create_main_window (void)
gtk_widget_show (menu_shoots_penalties);
gtk_container_add (GTK_CONTAINER (menu_player_menu), menu_shoots_penalties);
trennlinie10 = gtk_menu_item_new ();
trennlinie10 = gtk_separator_menu_item_new ();
gtk_widget_show (trennlinie10);
gtk_container_add (GTK_CONTAINER (menu_player_menu), trennlinie10);
gtk_widget_set_sensitive (trennlinie10, FALSE);
@ -559,7 +566,7 @@ create_main_window (void)
GDK_F2, 0,
GTK_ACCEL_VISIBLE);
trennlinie12 = gtk_menu_item_new ();
trennlinie12 = gtk_separator_menu_item_new ();
gtk_widget_show (trennlinie12);
gtk_container_add (GTK_CONTAINER (menu_user_menu), trennlinie12);
gtk_widget_set_sensitive (trennlinie12, FALSE);
@ -571,7 +578,7 @@ create_main_window (void)
GDK_h, GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
trennlinie9 = gtk_menu_item_new ();
trennlinie9 = gtk_separator_menu_item_new ();
gtk_widget_show (trennlinie9);
gtk_container_add (GTK_CONTAINER (menu_user_menu), trennlinie9);
gtk_widget_set_sensitive (trennlinie9, FALSE);
@ -583,9 +590,9 @@ create_main_window (void)
GDK_F9, 0,
GTK_ACCEL_VISIBLE);
image295 = gtk_image_new_from_stock ("gtk-go-forward", GTK_ICON_SIZE_MENU);
gtk_widget_show (image295);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_next_user), image295);
image301 = gtk_image_new_from_stock ("gtk-go-forward", GTK_ICON_SIZE_MENU);
gtk_widget_show (image301);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_next_user), image301);
menu_previous_user = gtk_image_menu_item_new_with_mnemonic (_("Previous user"));
gtk_widget_show (menu_previous_user);
@ -594,9 +601,9 @@ create_main_window (void)
GDK_F8, 0,
GTK_ACCEL_VISIBLE);
image296 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_MENU);
gtk_widget_show (image296);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_previous_user), image296);
image302 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_MENU);
gtk_widget_show (image302);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_previous_user), image302);
menu_manage_users = gtk_image_menu_item_new_with_mnemonic (_("Manage users"));
gtk_widget_show (menu_manage_users);
@ -605,9 +612,9 @@ create_main_window (void)
GDK_F12, 0,
GTK_ACCEL_VISIBLE);
image297 = gtk_image_new_from_stock ("gtk-justify-fill", GTK_ICON_SIZE_MENU);
gtk_widget_show (image297);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_manage_users), image297);
image303 = gtk_image_new_from_stock ("gtk-justify-fill", GTK_ICON_SIZE_MENU);
gtk_widget_show (image303);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_manage_users), image303);
menu_finances_stadium = gtk_menu_item_new_with_mnemonic (_("FinStad"));
gtk_widget_show (menu_finances_stadium);
@ -776,39 +783,32 @@ create_main_window (void)
label_user = gtk_label_new (_("user"));
gtk_widget_show (label_user);
gtk_box_pack_start (GTK_BOX (hbox18), label_user, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_user), GTK_JUSTIFY_LEFT);
label23 = gtk_label_new (_(" Season "));
gtk_widget_show (label23);
gtk_box_pack_start (GTK_BOX (hbox18), label23, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label23), GTK_JUSTIFY_LEFT);
gtk_misc_set_padding (GTK_MISC (label23), 5, 0);
label_season = gtk_label_new (_("1"));
gtk_widget_show (label_season);
gtk_box_pack_start (GTK_BOX (hbox18), label_season, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_season), GTK_JUSTIFY_LEFT);
label25 = gtk_label_new (_(" Week "));
gtk_widget_show (label25);
gtk_box_pack_start (GTK_BOX (hbox18), label25, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label25), GTK_JUSTIFY_LEFT);
gtk_misc_set_padding (GTK_MISC (label25), 5, 0);
label_week = gtk_label_new (_("1"));
gtk_widget_show (label_week);
gtk_box_pack_start (GTK_BOX (hbox18), label_week, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_week), GTK_JUSTIFY_LEFT);
label13114 = gtk_label_new (_(" Round "));
gtk_widget_show (label13114);
gtk_box_pack_start (GTK_BOX (hbox18), label13114, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label13114), GTK_JUSTIFY_LEFT);
label_round = gtk_label_new (_("1"));
gtk_widget_show (label_round);
gtk_box_pack_start (GTK_BOX (hbox18), label_round, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_round), GTK_JUSTIFY_LEFT);
vseparator14 = gtk_vseparator_new ();
gtk_widget_show (vseparator14);
@ -846,13 +846,11 @@ create_main_window (void)
label_team = gtk_label_new (_("Arsenal"));
gtk_widget_show (label_team);
gtk_container_add (GTK_CONTAINER (eventbox_team_name), label_team);
gtk_label_set_justify (GTK_LABEL (label_team), GTK_JUSTIFY_LEFT);
gtk_misc_set_padding (GTK_MISC (label_team), 5, 0);
label_league = gtk_label_new (_("Premier Division"));
gtk_widget_show (label_league);
gtk_box_pack_start (GTK_BOX (hbox18), label_league, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_league), GTK_JUSTIFY_LEFT);
gtk_misc_set_padding (GTK_MISC (label_league), 5, 0);
eventbox_rank = gtk_event_box_new ();
@ -866,13 +864,11 @@ create_main_window (void)
label29 = gtk_label_new (_("Rank "));
gtk_widget_show (label29);
gtk_box_pack_start (GTK_BOX (hbox49), label29, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label29), GTK_JUSTIFY_LEFT);
gtk_misc_set_padding (GTK_MISC (label29), 5, 0);
label_rank = gtk_label_new (_("1"));
gtk_widget_show (label_rank);
gtk_box_pack_start (GTK_BOX (hbox49), label_rank, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_rank), GTK_JUSTIFY_LEFT);
vseparator15 = gtk_vseparator_new ();
gtk_widget_show (vseparator15);
@ -882,13 +878,11 @@ create_main_window (void)
label34 = gtk_label_new (_("Money "));
gtk_widget_show (label34);
gtk_box_pack_start (GTK_BOX (hbox18), label34, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label34), GTK_JUSTIFY_LEFT);
gtk_misc_set_padding (GTK_MISC (label34), 5, 0);
label_money = gtk_label_new (_("2000"));
gtk_widget_show (label_money);
gtk_box_pack_start (GTK_BOX (hbox18), label_money, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_money), GTK_JUSTIFY_LEFT);
vseparator17 = gtk_vseparator_new ();
gtk_widget_show (vseparator17);
@ -907,12 +901,10 @@ create_main_window (void)
label69 = gtk_label_new (_("Av. skills: "));
gtk_widget_show (label69);
gtk_box_pack_start (GTK_BOX (hbox50), label69, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label69), GTK_JUSTIFY_LEFT);
label_av_skills = gtk_label_new (_("label70"));
gtk_widget_show (label_av_skills);
gtk_box_pack_start (GTK_BOX (hbox50), label_av_skills, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_av_skills), GTK_JUSTIFY_LEFT);
gtk_misc_set_padding (GTK_MISC (label_av_skills), 5, 0);
hbox7 = gtk_hbox_new (FALSE, 0);
@ -951,7 +943,6 @@ create_main_window (void)
label71 = gtk_label_new (_("Player list 1"));
gtk_widget_show (label71);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook_player), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook_player), 0), label71);
gtk_label_set_justify (GTK_LABEL (label71), GTK_JUSTIFY_LEFT);
player_list2 = gtk_tree_view_new ();
gtk_widget_show (player_list2);
@ -960,7 +951,14 @@ create_main_window (void)
label72 = gtk_label_new (_("Player list 2"));
gtk_widget_show (label72);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook_player), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook_player), 1), label72);
gtk_label_set_justify (GTK_LABEL (label72), GTK_JUSTIFY_LEFT);
button_reset_players = gtk_button_new ();
gtk_box_pack_start (GTK_BOX (vbox3), button_reset_players, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, button_reset_players, _("Reset player list to the formation at the beginning of the live game pause (right click on player list)"), NULL);
image298 = gtk_image_new_from_stock ("gtk-undo", GTK_ICON_SIZE_BUTTON);
gtk_widget_show (image298);
gtk_container_add (GTK_CONTAINER (button_reset_players), image298);
vbox8 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox8);
@ -1132,6 +1130,9 @@ create_main_window (void)
g_signal_connect ((gpointer) menu_boost_anti, "button_press_event",
G_CALLBACK (on_menu_team_button_press_event),
NULL);
g_signal_connect ((gpointer) menu_reset_players, "activate",
G_CALLBACK (on_menu_reset_players_activate),
NULL);
g_signal_connect ((gpointer) menu_custom_structure, "activate",
G_CALLBACK (on_menu_custom_structure_activate),
NULL);
@ -1225,6 +1226,9 @@ create_main_window (void)
g_signal_connect ((gpointer) player_list2, "button_press_event",
G_CALLBACK (on_player_list1_button_press_event),
NULL);
g_signal_connect ((gpointer) button_reset_players, "clicked",
G_CALLBACK (on_button_reset_players_clicked),
NULL);
g_signal_connect ((gpointer) button_cl_back, "clicked",
G_CALLBACK (on_button_cl_back_clicked),
NULL);
@ -1250,7 +1254,7 @@ create_main_window (void)
GLADE_HOOKUP_OBJECT (main_window, menu_new, "menu_new");
GLADE_HOOKUP_OBJECT (main_window, menu_open, "menu_open");
GLADE_HOOKUP_OBJECT (main_window, menu_load_last_save, "menu_load_last_save");
GLADE_HOOKUP_OBJECT (main_window, image293, "image293");
GLADE_HOOKUP_OBJECT (main_window, image299, "image299");
GLADE_HOOKUP_OBJECT (main_window, menu_save, "menu_save");
GLADE_HOOKUP_OBJECT (main_window, menu_save_as, "menu_save_as");
GLADE_HOOKUP_OBJECT (main_window, trennlinie1, "trennlinie1");
@ -1258,7 +1262,7 @@ create_main_window (void)
GLADE_HOOKUP_OBJECT (main_window, menu_options, "menu_options");
GLADE_HOOKUP_OBJECT (main_window, menu_options_menu, "menu_options_menu");
GLADE_HOOKUP_OBJECT (main_window, menu_preferences, "menu_preferences");
GLADE_HOOKUP_OBJECT (main_window, image294, "image294");
GLADE_HOOKUP_OBJECT (main_window, image300, "image300");
GLADE_HOOKUP_OBJECT (main_window, trennlinie7, "trennlinie7");
GLADE_HOOKUP_OBJECT (main_window, menu_job_offers, "menu_job_offers");
GLADE_HOOKUP_OBJECT (main_window, menu_live_game, "menu_live_game");
@ -1298,6 +1302,7 @@ create_main_window (void)
GLADE_HOOKUP_OBJECT (main_window, menu_boost_off, "menu_boost_off");
GLADE_HOOKUP_OBJECT (main_window, menu_boost_anti, "menu_boost_anti");
GLADE_HOOKUP_OBJECT (main_window, trennlinie11, "trennlinie11");
GLADE_HOOKUP_OBJECT (main_window, menu_reset_players, "menu_reset_players");
GLADE_HOOKUP_OBJECT (main_window, menu_custom_structure, "menu_custom_structure");
GLADE_HOOKUP_OBJECT (main_window, menu_rearrange_team, "menu_rearrange_team");
GLADE_HOOKUP_OBJECT (main_window, trennlinie8, "trennlinie8");
@ -1320,11 +1325,11 @@ create_main_window (void)
GLADE_HOOKUP_OBJECT (main_window, menu_user_show_history, "menu_user_show_history");
GLADE_HOOKUP_OBJECT (main_window, trennlinie9, "trennlinie9");
GLADE_HOOKUP_OBJECT (main_window, menu_next_user, "menu_next_user");
GLADE_HOOKUP_OBJECT (main_window, image295, "image295");
GLADE_HOOKUP_OBJECT (main_window, image301, "image301");
GLADE_HOOKUP_OBJECT (main_window, menu_previous_user, "menu_previous_user");
GLADE_HOOKUP_OBJECT (main_window, image296, "image296");
GLADE_HOOKUP_OBJECT (main_window, image302, "image302");
GLADE_HOOKUP_OBJECT (main_window, menu_manage_users, "menu_manage_users");
GLADE_HOOKUP_OBJECT (main_window, image297, "image297");
GLADE_HOOKUP_OBJECT (main_window, image303, "image303");
GLADE_HOOKUP_OBJECT (main_window, menu_finances_stadium, "menu_finances_stadium");
GLADE_HOOKUP_OBJECT (main_window, menu_finances_stadium_menu, "menu_finances_stadium_menu");
GLADE_HOOKUP_OBJECT (main_window, menu_show_finances, "menu_show_finances");
@ -1394,6 +1399,8 @@ create_main_window (void)
GLADE_HOOKUP_OBJECT (main_window, label71, "label71");
GLADE_HOOKUP_OBJECT (main_window, player_list2, "player_list2");
GLADE_HOOKUP_OBJECT (main_window, label72, "label72");
GLADE_HOOKUP_OBJECT (main_window, button_reset_players, "button_reset_players");
GLADE_HOOKUP_OBJECT (main_window, image298, "image298");
GLADE_HOOKUP_OBJECT (main_window, vbox8, "vbox8");
GLADE_HOOKUP_OBJECT (main_window, hbox_14, "hbox_14");
GLADE_HOOKUP_OBJECT (main_window, button_cl_back, "button_cl_back");

View File

@ -221,7 +221,7 @@ on_button_resume_clicked (GtkButton *button,
live_game_resume();
}
else
game_gui_show_warning("There were too many substitutions. Only 3 per game are allowed.");
game_gui_show_warning("There were too many substitutions. Only 3 per game are allowed. Player list reset.");
}
void

View File

@ -220,7 +220,7 @@ int_user_success_relegation 60
# points above or below which there might be a job
# offer
int_user_success_offer_limit 500
int_user_success_offer_limit 400
# base probability that the counter is considered at all
float_user_success_counter_check 2500