1
1
mirror of https://github.com/tstellar/bygfoot.git synced 2025-03-09 15:20:08 +01:00

Opponent bars.

This commit is contained in:
gyboth 2005-03-25 11:44:49 +00:00
parent a6dfb9968d
commit 266678c0e3
4 changed files with 24 additions and 3 deletions

View File

@ -287,9 +287,15 @@ callback_offer_new_contract(gint idx)
game_gui_print_message(_("You can't offer a new contract if the old one is still above 2 years."));
return;
}
else if(pl->offers == const_int("int_contract_max_offers"))
{
game_gui_print_message(_("The player won't negotiate with you anymore."));
return;
}
stat0 = STATUS_CONTRACT_OFFER;
stat1 = player_assign_wage(pl);
statp = (gpointer)pl;
if(pl->age < pl->peak_age)
stat1 = MAX(stat1, pl->wage);
@ -298,7 +304,8 @@ callback_offer_new_contract(gint idx)
window_create(WINDOW_CONTRACT);
sprintf(buf, "You are negotiating with %s about a new contract. Pay attention to what you're doing; if you don't come to terms with him within 3 offers, he's going to leave your team after his current contract expires (unless you sell him).\nYour scout's recommendations are preset:", pl->name->str);
sprintf(buf, "You are negotiating with %s about a new contract. Pay attention to what you're doing; if you don't come to terms with him within %d offers, he's going to leave your team after his current contract expires (unless you sell him).\nYour scout's recommendations are preset:", pl->name->str,
const_int("int_contract_max_offers"));
gtk_label_set_text(GTK_LABEL(lookup_widget(window.contract, "label_contract")), buf);
for(i=0;i<4;i++)

View File

@ -1102,6 +1102,7 @@ game_get_max_values(gfloat max_values[3])
for(i=0;i<3;i++)
{
max_values[i] = 0;
for(j=1;j<11;j++)
{
pl.cpos = player_get_position_from_structure(442, j);

View File

@ -1706,7 +1706,7 @@ void
treeview_create_next_opponent_values(GtkListStore *liststore, const Fixture *fix)
{
gint i, j;
gchar buf[SMALL];
gchar buf[SMALL], buf2[SMALL];
gfloat max_values[3],
team_values[2][GAME_TEAM_VALUE_END];
gchar *titles[3] =
@ -1720,10 +1720,17 @@ treeview_create_next_opponent_values(GtkListStore *liststore, const Fixture *fix
for(i=0;i<3;i++)
{
strcpy(buf, "");
strcpy(buf2, "");
for(j=0;j<(gint)rint((gfloat)const_int("int_treeview_max_pipes") *
(team_values[fix->teams[0] == current_user.tm][i] / max_values[i]));j++)
strcat(buf2, "|");
sprintf(buf, "%s\n<span foreground='%s'>", buf2,
const_str("string_treeview_opponent_value_colour_fg"));
for(j=0;j<(gint)rint((gfloat)const_int("int_treeview_max_pipes") *
(team_values[fix->teams[0] != current_user.tm][i] / max_values[i]));j++)
strcat(buf, "|");
strcat(buf, "</span>");
gtk_list_store_append(liststore, &iter);
gtk_list_store_set(liststore, &iter, 0, titles[i], 1, buf, -1);

View File

@ -613,6 +613,9 @@ int_transfer_contract_upper 4
# or below their peak age for longer contracts than 1 year
float_contract_scale_factor 300
# max. number of offers when a new contract is negotiated
int_contract_max_offers 3
#### colours and icons
# live game scale configuration
@ -731,3 +734,6 @@ string_treeview_opponent_skill_negative_fg darkgreen
# background of the home column in the league results
string_treeview_league_results_away_bg lightgrey
string_treeview_league_results_away_fg black
# foreground of own team bar in the opponent preview
string_treeview_opponent_value_colour_fg darkgreen