mirror of
https://github.com/tstellar/bygfoot.git
synced 2025-02-22 22:37:46 +01:00
Minor fixes.
This commit is contained in:
parent
7a29699be3
commit
e4efb19c16
@ -110,7 +110,7 @@
|
||||
<accelerator key="p" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image261">
|
||||
<widget class="GtkImage" id="image264">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-preferences</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -134,7 +134,7 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Job offers</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="active">True</property>
|
||||
<signal name="button_press_event" handler="on_menu_check_button_press_event" last_modification_time="Thu, 24 Mar 2005 12:28:14 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
@ -146,8 +146,6 @@
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">False</property>
|
||||
<signal name="button_press_event" handler="on_menu_check_button_press_event" last_modification_time="Thu, 24 Mar 2005 12:28:28 GMT"/>
|
||||
<signal name="activate" handler="on_menu_live_game_activate" last_modification_time="Thu, 24 Mar 2005 17:16:03 GMT"/>
|
||||
<accelerator key="l" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
@ -156,7 +154,7 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Overwrite</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="active">True</property>
|
||||
<signal name="button_press_event" handler="on_menu_check_button_press_event" last_modification_time="Thu, 24 Mar 2005 12:28:40 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
@ -611,7 +609,7 @@
|
||||
<accelerator key="F9" modifiers="0" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image262">
|
||||
<widget class="GtkImage" id="image265">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-go-forward</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -633,7 +631,7 @@
|
||||
<accelerator key="F8" modifiers="0" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image263">
|
||||
<widget class="GtkImage" id="image266">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-go-back</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -655,7 +653,7 @@
|
||||
<accelerator key="F12" modifiers="0" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image264">
|
||||
<widget class="GtkImage" id="image267">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-justify-fill</property>
|
||||
<property name="icon_size">1</property>
|
||||
|
@ -122,12 +122,6 @@ callback_show_last_match(void)
|
||||
{
|
||||
gint i;
|
||||
|
||||
if(current_user.live_game.units->len == 0)
|
||||
{
|
||||
game_gui_show_warning("No match to show.");
|
||||
return;
|
||||
}
|
||||
|
||||
stat2 = cur_user;
|
||||
|
||||
window_create(WINDOW_LIVE);
|
||||
@ -198,7 +192,7 @@ callback_get_loan(void)
|
||||
return;
|
||||
}
|
||||
|
||||
stat0 = STATUS_GET_LOAN;
|
||||
stat1 = STATUS_GET_LOAN;
|
||||
misc_print_grouped_int(max_loan, buf2, FALSE);
|
||||
sprintf(buf, _("You can take out at most %s."), buf2);
|
||||
|
||||
@ -224,7 +218,7 @@ callback_pay_loan(void)
|
||||
return;
|
||||
}
|
||||
|
||||
stat0 = STATUS_PAY_LOAN;
|
||||
stat1 = STATUS_PAY_LOAN;
|
||||
misc_print_grouped_int(max_payback, buf2, FALSE);
|
||||
sprintf(buf, _("You can pay back at most %s"), buf2);
|
||||
|
||||
@ -254,7 +248,8 @@ callback_transfer_list_clicked(gint idx)
|
||||
|
||||
sprintf(buf, _("You are making an offer for %s. Your scout's recommendations for value and wage are preset."),
|
||||
player_of_id(tr->tm, tr->id)->name->str);
|
||||
stat1 = idx;
|
||||
stat1 = STATUS_SHOW_TRANSFER_LIST;
|
||||
stat2 = idx;
|
||||
|
||||
window_show_digits(buf, _("Fee"), tr->fee[current_user.scout % 10],
|
||||
_("Wage"), tr->wage[current_user.scout % 10]);
|
||||
|
@ -457,7 +457,7 @@ void
|
||||
on_menu_custom_structure_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
stat0 = STATUS_CUSTOM_STRUCTURE;
|
||||
stat1 = STATUS_CUSTOM_STRUCTURE;
|
||||
window_show_digits(_("Enter a structure. The digits must sum up to 10."),
|
||||
NULL, -1, _("Structure"), current_user.tm->structure);
|
||||
}
|
||||
@ -489,6 +489,12 @@ void
|
||||
on_menu_user_show_last_match_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
if(current_user.live_game.units->len == 0)
|
||||
{
|
||||
game_gui_show_warning("No match to show.");
|
||||
return;
|
||||
}
|
||||
|
||||
stat0 = STATUS_SHOW_LAST_MATCH;
|
||||
callback_show_last_match();
|
||||
}
|
||||
@ -498,6 +504,12 @@ void
|
||||
on_menu_user_show_last_stats_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
if(current_user.live_game.units->len == 0)
|
||||
{
|
||||
game_gui_show_warning("No match to show.");
|
||||
return;
|
||||
}
|
||||
|
||||
stat0 = STATUS_SHOW_LAST_MATCH_STATS;
|
||||
treeview_show_game_stats(GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right")),
|
||||
¤t_user.live_game);
|
||||
@ -592,21 +604,6 @@ on_menu_check_button_press_event (GtkWidget *widget,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_menu_live_game_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
gchar buf[SMALL];
|
||||
|
||||
game_gui_read_check_items(GTK_WIDGET(menuitem));
|
||||
sprintf(buf, "Live game set to %s.",
|
||||
team_attribute_to_char(TEAM_ATTRIBUTE_BOOST,
|
||||
opt_user_int("int_opt_user_show_live_game")));
|
||||
game_gui_print_message(buf);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_menu_offer_new_contract_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
@ -680,4 +677,3 @@ on_menu_browse_players_activate (GtkMenuItem *menuitem,
|
||||
callback_show_player_list(SHOW_CURRENT);
|
||||
stat0 = STATUS_SHOW_PLAYER_LIST;
|
||||
}
|
||||
|
||||
|
@ -202,11 +202,6 @@ gboolean
|
||||
on_menu_check_button_press_event (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_menu_live_game_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_menu_offer_new_contract_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
@ -238,8 +233,8 @@ void
|
||||
on_player_menu_shoots_penalties_activate
|
||||
(GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
#endif
|
||||
|
||||
void
|
||||
on_menu_browse_players_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
#endif
|
||||
|
@ -505,19 +505,35 @@ game_gui_write_check_items(void)
|
||||
void
|
||||
game_gui_read_check_items(GtkWidget *widget)
|
||||
{
|
||||
gchar buf[SMALL];
|
||||
GtkWidget *menu_job_offers =
|
||||
lookup_widget(window.main, "menu_job_offers"),
|
||||
*menu_live_game = lookup_widget(window.main, "menu_live_game"),
|
||||
*menu_overwrite = lookup_widget(window.main, "menu_overwrite");
|
||||
|
||||
if(widget == menu_job_offers)
|
||||
{
|
||||
opt_user_set_int("int_opt_user_show_job_offers", !opt_user_int("int_opt_user_show_job_offers"));
|
||||
sprintf(buf, "Job offers set to %s.",
|
||||
team_attribute_to_char(TEAM_ATTRIBUTE_BOOST,
|
||||
opt_user_int("int_opt_user_show_job_offers")));
|
||||
}
|
||||
else if(widget == menu_live_game)
|
||||
{
|
||||
opt_user_set_int("int_opt_user_show_live_game", !opt_user_int("int_opt_user_show_live_game"));
|
||||
sprintf(buf, "Live game set to %s.",
|
||||
team_attribute_to_char(TEAM_ATTRIBUTE_BOOST,
|
||||
opt_user_int("int_opt_user_show_live_game")));
|
||||
}
|
||||
else if(widget == menu_overwrite)
|
||||
{
|
||||
opt_set_int("int_opt_save_will_overwrite", !opt_int("int_opt_save_will_overwrite"));
|
||||
sprintf(buf, "Overwrite set to %s.",
|
||||
team_attribute_to_char(TEAM_ATTRIBUTE_BOOST,
|
||||
opt_int("int_opt_save_will_overwrite")));
|
||||
}
|
||||
else
|
||||
g_warning("game_gui_read_check_items: unknown widget.");
|
||||
|
||||
game_gui_print_message(buf);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ create_main_window (void)
|
||||
GtkWidget *menu_options;
|
||||
GtkWidget *menu_options_menu;
|
||||
GtkWidget *menu_preferences;
|
||||
GtkWidget *image261;
|
||||
GtkWidget *image264;
|
||||
GtkWidget *trennlinie7;
|
||||
GtkWidget *menu_job_offers;
|
||||
GtkWidget *menu_live_game;
|
||||
@ -105,11 +105,11 @@ create_main_window (void)
|
||||
GtkWidget *menu_user_show_last_stats;
|
||||
GtkWidget *trennlinie9;
|
||||
GtkWidget *menu_next_user;
|
||||
GtkWidget *image262;
|
||||
GtkWidget *image265;
|
||||
GtkWidget *menu_previous_user;
|
||||
GtkWidget *image263;
|
||||
GtkWidget *image266;
|
||||
GtkWidget *menu_manage_users;
|
||||
GtkWidget *image264;
|
||||
GtkWidget *image267;
|
||||
GtkWidget *menu_finances_stadium;
|
||||
GtkWidget *menu_finances_stadium_menu;
|
||||
GtkWidget *menu_show_finances;
|
||||
@ -263,9 +263,9 @@ create_main_window (void)
|
||||
GDK_p, GDK_CONTROL_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
image261 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image261);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_preferences), image261);
|
||||
image264 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image264);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_preferences), image264);
|
||||
|
||||
trennlinie7 = gtk_menu_item_new ();
|
||||
gtk_widget_show (trennlinie7);
|
||||
@ -275,17 +275,16 @@ create_main_window (void)
|
||||
menu_job_offers = gtk_check_menu_item_new_with_mnemonic (_("Job offers"));
|
||||
gtk_widget_show (menu_job_offers);
|
||||
gtk_container_add (GTK_CONTAINER (menu_options_menu), menu_job_offers);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_job_offers), TRUE);
|
||||
|
||||
menu_live_game = gtk_check_menu_item_new_with_mnemonic (_("Live game"));
|
||||
gtk_widget_show (menu_live_game);
|
||||
gtk_container_add (GTK_CONTAINER (menu_options_menu), menu_live_game);
|
||||
gtk_widget_add_accelerator (menu_live_game, "activate", accel_group,
|
||||
GDK_l, GDK_CONTROL_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
menu_overwrite = gtk_check_menu_item_new_with_mnemonic (_("Overwrite"));
|
||||
gtk_widget_show (menu_overwrite);
|
||||
gtk_container_add (GTK_CONTAINER (menu_options_menu), menu_overwrite);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_overwrite), TRUE);
|
||||
|
||||
menu_figures = gtk_menu_item_new_with_mnemonic (_("Figures"));
|
||||
gtk_widget_show (menu_figures);
|
||||
@ -534,9 +533,9 @@ create_main_window (void)
|
||||
GDK_F9, 0,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
image262 = gtk_image_new_from_stock ("gtk-go-forward", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image262);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_next_user), image262);
|
||||
image265 = gtk_image_new_from_stock ("gtk-go-forward", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image265);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_next_user), image265);
|
||||
|
||||
menu_previous_user = gtk_image_menu_item_new_with_mnemonic (_("Previous user"));
|
||||
gtk_widget_show (menu_previous_user);
|
||||
@ -545,9 +544,9 @@ create_main_window (void)
|
||||
GDK_F8, 0,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
image263 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image263);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_previous_user), image263);
|
||||
image266 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image266);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_previous_user), image266);
|
||||
|
||||
menu_manage_users = gtk_image_menu_item_new_with_mnemonic (_("Manage users"));
|
||||
gtk_widget_show (menu_manage_users);
|
||||
@ -556,9 +555,9 @@ create_main_window (void)
|
||||
GDK_F12, 0,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
image264 = gtk_image_new_from_stock ("gtk-justify-fill", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image264);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_manage_users), image264);
|
||||
image267 = gtk_image_new_from_stock ("gtk-justify-fill", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image267);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_manage_users), image267);
|
||||
|
||||
menu_finances_stadium = gtk_menu_item_new_with_mnemonic (_("FinStad"));
|
||||
gtk_widget_show (menu_finances_stadium);
|
||||
@ -1015,9 +1014,6 @@ create_main_window (void)
|
||||
g_signal_connect ((gpointer) menu_live_game, "button_press_event",
|
||||
G_CALLBACK (on_menu_check_button_press_event),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) menu_live_game, "activate",
|
||||
G_CALLBACK (on_menu_live_game_activate),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) menu_overwrite, "button_press_event",
|
||||
G_CALLBACK (on_menu_check_button_press_event),
|
||||
NULL);
|
||||
@ -1202,7 +1198,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, image261, "image261");
|
||||
GLADE_HOOKUP_OBJECT (main_window, image264, "image264");
|
||||
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");
|
||||
@ -1259,11 +1255,11 @@ create_main_window (void)
|
||||
GLADE_HOOKUP_OBJECT (main_window, menu_user_show_last_stats, "menu_user_show_last_stats");
|
||||
GLADE_HOOKUP_OBJECT (main_window, trennlinie9, "trennlinie9");
|
||||
GLADE_HOOKUP_OBJECT (main_window, menu_next_user, "menu_next_user");
|
||||
GLADE_HOOKUP_OBJECT (main_window, image262, "image262");
|
||||
GLADE_HOOKUP_OBJECT (main_window, image265, "image265");
|
||||
GLADE_HOOKUP_OBJECT (main_window, menu_previous_user, "menu_previous_user");
|
||||
GLADE_HOOKUP_OBJECT (main_window, image263, "image263");
|
||||
GLADE_HOOKUP_OBJECT (main_window, image266, "image266");
|
||||
GLADE_HOOKUP_OBJECT (main_window, menu_manage_users, "menu_manage_users");
|
||||
GLADE_HOOKUP_OBJECT (main_window, image264, "image264");
|
||||
GLADE_HOOKUP_OBJECT (main_window, image267, "image267");
|
||||
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");
|
||||
|
@ -64,7 +64,7 @@ misc2_callback_transfer_user_player(void)
|
||||
}
|
||||
|
||||
/** Change the user team's structure to a value he's specified. */
|
||||
void
|
||||
gboolean
|
||||
misc2_callback_change_structure(gint structure)
|
||||
{
|
||||
gchar buf[SMALL];
|
||||
@ -73,12 +73,14 @@ misc2_callback_change_structure(gint structure)
|
||||
math_get_place(structure, 3) != 10)
|
||||
{
|
||||
sprintf(buf, _("The structure value %d is invalid."), structure);
|
||||
game_gui_print_message(buf);
|
||||
return;
|
||||
game_gui_show_warning(buf);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
team_change_structure(current_user.tm, structure);
|
||||
treeview_show_user_player_list();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/** Handle a click on the contract offer button. */
|
||||
|
@ -6,7 +6,7 @@
|
||||
void
|
||||
misc2_callback_transfer_user_player(void);
|
||||
|
||||
void
|
||||
gboolean
|
||||
misc2_callback_change_structure(gint structure);
|
||||
|
||||
void
|
||||
|
@ -86,8 +86,9 @@ on_button_digits_ok_clicked (GtkButton *button,
|
||||
gint values[2] =
|
||||
{gtk_spin_button_get_value_as_int(spinbutton1),
|
||||
gtk_spin_button_get_value_as_int(spinbutton2)};
|
||||
gboolean destroy_window = TRUE;
|
||||
|
||||
switch(stat0)
|
||||
switch(stat1)
|
||||
{
|
||||
case STATUS_GET_LOAN:
|
||||
finance_get_loan(values[0]);
|
||||
@ -96,17 +97,18 @@ on_button_digits_ok_clicked (GtkButton *button,
|
||||
finance_pay_loan(values[0]);
|
||||
break;
|
||||
case STATUS_SHOW_TRANSFER_LIST:
|
||||
if(transfer_add_offer(stat1, current_user.tm, values[0], values[1]))
|
||||
if(transfer_add_offer(stat2, current_user.tm, values[0], values[1]))
|
||||
game_gui_print_message(_("Your offer has been updated."));
|
||||
else
|
||||
game_gui_print_message(_("Your offer will be considered next week."));
|
||||
break;
|
||||
case STATUS_CUSTOM_STRUCTURE:
|
||||
misc2_callback_change_structure(values[1]);
|
||||
destroy_window = misc2_callback_change_structure(values[1]);
|
||||
break;
|
||||
}
|
||||
|
||||
window_destroy(&window.digits, TRUE);
|
||||
if(destroy_window)
|
||||
window_destroy(&window.digits, TRUE);
|
||||
|
||||
game_gui_set_main_window_header();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user