Ejemplo n.º 1
0
void
MultiplayerDialog::currentLandscapeWasChanged( const QString& _landscapeName )
{
	m_environment.getLandscapeViewer()
		->initLandscape( m_environment.getLandscapesDirectory() + "/" + _landscapeName );

	updateMapPreview();
	updatePlayersList();
	updateWidgetsStates();

} // MultiplayerDialog::currentLandscapeWasChanged
Ejemplo n.º 2
0
// ----------------------------------------------------------------------------
// MapBackupPanel::MapBackupPanel
//
// MapBackupPanel class constructor
// ----------------------------------------------------------------------------
MapBackupPanel::MapBackupPanel(wxWindow* parent) :
	wxPanel{ parent, -1 },
	archive_backups_{ new ZipArchive() }
{
	// Setup Sizer
	wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
	SetSizer(sizer);

	// Backups list
	sizer->Add(list_backups_ = new ListView(this, -1), 0, wxEXPAND|wxRIGHT, UI::pad());

	// Map preview
	sizer->Add(canvas_map_ = new MapPreviewCanvas(this), 1, wxEXPAND);

	// Bind events
	list_backups_->Bind(wxEVT_LIST_ITEM_SELECTED, [&](wxListEvent&) { updateMapPreview(); });

	Layout();
}
Ejemplo n.º 3
0
void
MultiplayerDialog::onPlayerColorChanged()
{
	boost::intrusive_ptr< Core::LandscapeModel::IModelLocker >
		locker = m_environment.lockModel();

	PlayersDataCollectionIterator
			begin = m_playersData.begin()
		,	end = m_playersData.end();

	for ( ; begin != end; ++begin )
	{
		boost::intrusive_ptr< Core::LandscapeModel::IPlayer > player = locker->getLandscapeModel()->getPlayer( begin->first );
		m_environment.getGraphicsInfo()->setStartPointColor( player->getStartPointId(), Utilities::colorFromString( begin->second.m_color.currentText() ) );
	}

	updatePlayersColors();
	updateMapPreview();

} // MultiplayerDialog::onPlayerColorChanged
Ejemplo n.º 4
0
/* MapBackupPanel::onBackupListChanged
 * Called when the selection changes on the backup list
 *******************************************************************/
void MapBackupPanel::onBackupListChanged(wxListEvent& e)
{
	updateMapPreview();
}