Example #1
0
File: screen.cpp Project: q4a/attal
void Screen::handleDelete()
{
	if( _currentCell->getLord() ) {
		GenericLord * lord = _currentCell->getLord();
		if(lord->getOwner()){
			lord->getOwner()->removeLord(lord);
		}
		lord->setCell( NULL );
	} else if( _currentCell->getCreature() ) {
		GenericMapCreature * creature = _currentCell->getCreature();
		removeMapCreature(creature);
		_currentCell->setCreature( NULL );
	} else if( _currentCell->getBuilding() ) {
		GenericBuilding * build = _currentCell->getBuilding();
		removeBuilding( build );
		_currentCell->setBuilding( NULL );
	} else if( _currentCell->getBase() ) {
		GenericBase * base = _currentCell->getBase();
		removeBase(  base );
		_currentCell->setBase( NULL );
	} else if( _currentCell->getEvent() ) {
		Event * event = (Event *)( _currentCell->getEvent() );
		removeEvent( event );
		_currentCell->setEvent( NULL );
	}

	_currentCell->setDecoration( 0, 0 );
	_currentCell->setTransition( 0 );
	_currentCell->setTransitionCellType( 0 );

	cellChanged( _currentCell );
}
Example #2
0
BuildingsForm::BuildingsForm(QWidget* parent): QDialog(parent)
{
	setupUi(this);
	
	currentBuildingTextEdit->setReadOnly(true);

	modifyBuildingPushButton->setDefault(true);

	buildingsListWidget->setSelectionMode(QAbstractItemView::SingleSelection);

	connect(addBuildingPushButton, SIGNAL(clicked()), this, SLOT(addBuilding()));
	connect(removeBuildingPushButton, SIGNAL(clicked()), this, SLOT(removeBuilding()));
	connect(buildingsListWidget, SIGNAL(currentRowChanged(int)), this, SLOT(buildingChanged(int)));
	connect(closePushButton, SIGNAL(clicked()), this, SLOT(close()));
	connect(modifyBuildingPushButton, SIGNAL(clicked()), this, SLOT(modifyBuilding()));

	connect(moveBuildingUpPushButton, SIGNAL(clicked()), this, SLOT(moveBuildingUp()));
	connect(moveBuildingDownPushButton, SIGNAL(clicked()), this, SLOT(moveBuildingDown()));

	connect(sortBuildingsPushButton, SIGNAL(clicked()), this, SLOT(sortBuildings()));
	connect(buildingsListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(modifyBuilding()));

	connect(commentsPushButton, SIGNAL(clicked()), this, SLOT(comments()));

	centerWidgetOnScreen(this);
	restoreFETDialogGeometry(this);
	//restore splitter state
	QSettings settings(COMPANY, PROGRAM);
	if(settings.contains(this->metaObject()->className()+QString("/splitter-state")))
		splitter->restoreState(settings.value(this->metaObject()->className()+QString("/splitter-state")).toByteArray());
	
	this->filterChanged();
}
Example #3
0
LairTool::LairTool(QWidget *parent) : QDialog(parent), ui(new Ui::LairTool) {
    ui->setupUi(this);

    currentTemplate = NULL;

    nameMobileForm = new NewLairMobile(this);
    nameBuildingForm = new LairName(this);

    connect(ui->pushButton_addMobile, SIGNAL(clicked()), nameMobileForm, SLOT(show()));
    connect(ui->pushButton_AddBuilding, SIGNAL(clicked()), nameBuildingForm, SLOT(show()));
    connect(nameMobileForm, SIGNAL(accepted()), this, SLOT(addMobile()));
    connect(nameBuildingForm, SIGNAL(accepted()), this, SLOT(addBuilding()));
    connect(ui->pushButton_RemoveBuilding, SIGNAL(clicked()), this, SLOT(removeBuilding()));
    connect(ui->pushButton_removeMobile, SIGNAL(clicked()), this, SLOT(removeMobile()));
    connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(commitToTemplate()));
    connect(ui->pushButton_view3d, SIGNAL(clicked()), this, SLOT(view3d()));

    this->setWindowFlags(windowFlags() | Qt::WindowMaximizeButtonHint | Qt::WindowMinimizeButtonHint);
}