mirror of
https://github.com/tstellar/bygfoot.git
synced 2024-12-16 18:29:21 +01:00
Add the boost and style to the default team (ticket 2778645 )
This commit is contained in:
parent
4b3f081aab
commit
8bafb64b70
@ -81,6 +81,8 @@ user_new(void)
|
||||
new.bets[0] = g_array_new(FALSE, FALSE, sizeof(BetUser));
|
||||
new.bets[1] = g_array_new(FALSE, FALSE, sizeof(BetUser));
|
||||
new.default_team = g_array_new(FALSE, FALSE, sizeof(gint));
|
||||
new.default_style = 0;
|
||||
new.default_boost = 0;
|
||||
return new;
|
||||
}
|
||||
|
||||
@ -1343,6 +1345,8 @@ store_default_team(User *user)
|
||||
g_array_append_val(user->default_team, g_array_index(user->tm->players, Player, i).id);
|
||||
}
|
||||
user->default_structure = user->tm->structure;
|
||||
user->default_style = user->tm->style;
|
||||
user->default_boost = user->tm->boost;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1370,4 +1374,8 @@ restore_default_team(User *user)
|
||||
}
|
||||
}
|
||||
team_change_structure(user->tm, user->default_structure);
|
||||
team_change_attribute_with_message(user->tm, TEAM_ATTRIBUTE_STYLE, user->default_style);
|
||||
team_change_attribute_with_message(user->tm, TEAM_ATTRIBUTE_BOOST, user->default_boost);
|
||||
game_gui_write_meters(current_user.tm);
|
||||
game_gui_write_radio_items();
|
||||
}
|
||||
|
@ -189,6 +189,10 @@ typedef struct
|
||||
GArray *default_team;
|
||||
// the default structure of a user team.
|
||||
gint default_structure;
|
||||
// the default playing style of a user team.
|
||||
gint default_style;
|
||||
// the default boost of a user team.
|
||||
gint default_boost;
|
||||
} User;
|
||||
|
||||
enum EventType
|
||||
|
@ -78,6 +78,8 @@ enum
|
||||
TAG_USER_YA_PREFERENCE,
|
||||
TAG_USER_DEFAULT_TEAM,
|
||||
TAG_USER_DEFAULT_STRUCTURE,
|
||||
TAG_USER_DEFAULT_STYLE,
|
||||
TAG_USER_DEFAULT_BOOST,
|
||||
TAG_END
|
||||
};
|
||||
|
||||
@ -199,7 +201,9 @@ xml_loadsave_users_end_element (GMarkupParseContext *context,
|
||||
tag == TAG_USER_BET0 ||
|
||||
tag == TAG_USER_BET1 ||
|
||||
tag == TAG_USER_DEFAULT_TEAM ||
|
||||
tag == TAG_USER_DEFAULT_STRUCTURE)
|
||||
tag == TAG_USER_DEFAULT_STRUCTURE ||
|
||||
tag == TAG_USER_DEFAULT_STYLE ||
|
||||
tag == TAG_USER_DEFAULT_BOOST)
|
||||
{
|
||||
state = TAG_USER;
|
||||
if(tag == TAG_USER_COUNTER)
|
||||
@ -355,6 +359,10 @@ xml_loadsave_users_text (GMarkupParseContext *context,
|
||||
g_array_append_val(new_user.default_team, int_value);
|
||||
else if(state == TAG_USER_DEFAULT_STRUCTURE)
|
||||
new_user.default_structure = int_value;
|
||||
else if(state == TAG_USER_DEFAULT_STYLE)
|
||||
new_user.default_style = int_value;
|
||||
else if(state == TAG_USER_DEFAULT_BOOST)
|
||||
new_user.default_boost = int_value;
|
||||
else if(state >= TAG_START_PLAYERS && state <= TAG_END_PLAYERS)
|
||||
xml_loadsave_players_text(buf);
|
||||
}
|
||||
@ -478,6 +486,8 @@ xml_loadsave_users_write(const gchar *prefix)
|
||||
xml_write_int(fil, g_array_index(usr(i).default_team, gint, j), TAG_USER_DEFAULT_TEAM, I1);
|
||||
}
|
||||
xml_write_int(fil, usr(i).default_structure, TAG_USER_DEFAULT_STRUCTURE, I1);
|
||||
xml_write_int(fil, usr(i).default_style, TAG_USER_DEFAULT_STYLE, I1);
|
||||
xml_write_int(fil, usr(i).default_boost, TAG_USER_DEFAULT_BOOST, I1);
|
||||
xml_loadsave_players_write(fil, usr(i).youth_academy.players);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user