Fix tests
This commit is contained in:
parent
3e6fcc4450
commit
c29ea4e261
5 changed files with 11 additions and 18 deletions
|
@ -214,11 +214,7 @@ void context_manager::edit_side_dialog(int side)
|
|||
//TODO
|
||||
//t.support()
|
||||
|
||||
// TODO: @celticminstrel: the side parameter passed here is then used to access
|
||||
// the team by index in set_side_setup. In teditor_edit_side, it's displayed as
|
||||
// a side number, as as such is shown +1. Just a note for the team index refactor
|
||||
// branch.
|
||||
editor_team_info team_info(t, side);
|
||||
editor_team_info team_info(t);
|
||||
|
||||
if(gui2::teditor_edit_side::execute(team_info, gui_.video())) {
|
||||
get_map_context().set_side_setup(team_info);
|
||||
|
|
|
@ -40,8 +40,8 @@
|
|||
|
||||
namespace editor {
|
||||
|
||||
editor_team_info::editor_team_info(const team& t, const int side)
|
||||
: side(side)
|
||||
editor_team_info::editor_team_info(const team& t)
|
||||
: side(t.side())
|
||||
, id(t.team_name())
|
||||
, name(t.user_team_name())
|
||||
, gold(t.gold())
|
||||
|
@ -219,8 +219,8 @@ map_context::map_context(const config& game_config, const std::string& filename,
|
|||
|
||||
void map_context::set_side_setup(editor_team_info& info)
|
||||
{
|
||||
assert(teams_.size() > static_cast<unsigned int>(info.side));
|
||||
team& t = teams_[info.side];
|
||||
assert(teams_.size() >= static_cast<unsigned int>(info.side));
|
||||
team& t = teams_[info.side - 1];
|
||||
// t.set_save_id(id);
|
||||
// t.set_name(name);
|
||||
t.change_team(info.id, info.name);
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
namespace editor {
|
||||
|
||||
struct editor_team_info {
|
||||
editor_team_info(const team& t, const int side);
|
||||
editor_team_info(const team& t);
|
||||
|
||||
int side;
|
||||
std::string id;
|
||||
|
|
|
@ -54,7 +54,7 @@ teditor_edit_side::teditor_edit_side(editor::editor_team_info& info)
|
|||
: controller_(info.controller)
|
||||
, share_vision_(info.share_vision)
|
||||
{
|
||||
register_label("side_number", true, std::to_string(info.side + 1), true);
|
||||
register_label("side_number", true, std::to_string(info.side), true);
|
||||
|
||||
register_text("team_name", true, info.id, true);
|
||||
register_text("user_team_name", true, info.name, true);
|
||||
|
|
|
@ -675,15 +675,12 @@ struct twrapper<gui2::teditor_edit_scenario>
|
|||
template<>
|
||||
struct twrapper<gui2::teditor_edit_side>
|
||||
{
|
||||
std::string name, user_name;
|
||||
int gold, income, village, support;
|
||||
bool no_leader, hidden, fog, shroud;
|
||||
team::CONTROLLER controller;
|
||||
team::SHARE_VISION share_vision;
|
||||
team t;
|
||||
editor::editor_team_info info;
|
||||
twrapper() : info(t) {}
|
||||
gui2::teditor_edit_side* create()
|
||||
{
|
||||
return new gui2::
|
||||
teditor_edit_side(1, name, user_name, gold, income, village, support, fog, shroud, share_vision, controller, no_leader, hidden);
|
||||
return new gui2::teditor_edit_side(info);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue