Exemplo n.º 1
0
void calcScriptCmd()
{
	/* intreprets any command out of the cmd stack pointer. shouldn't take too
	 * much processing time*/
	 UInt16 i;
	 PointType pos;
	 
	 for(i = 0; i < map.numCmds; i++)
	 {
	 	//if y coord of obj is in second segment of mapWin just created
		if(script[i].y > (mapWinYOffset) 
		&& script[i].y < (mapWinYOffset + (MAP_SEGMENT_EXTENT_Y / 2)))
		{
			if(cmdIsAI(script[i].type))
			{
				//place ai
				pos.x = script[i].x;
				pos.y = script[i].y;
				//minus 5 to get playertype value
				addAI((PlayerType)script[i].type - 5, pos);
			}
			else
			{	
				//place stationary objective
				pos.x = script[i].x;
				pos.y = script[i].y;
				addObjective(script[i].type, pos);
			}
		}
	 }
}
Exemplo n.º 2
0
QF3ObjectiveCombobox::QF3ObjectiveCombobox(QWidget* parent):
    QWidget(parent)
{
    if (m_notifier==NULL) m_notifier=new QF3ObjectiveComboboxNotifier(NULL);
    globalobjectives="";
    localobjectives="";

    hbl=new QHBoxLayout();
    setLayout(hbl);
    hbl->setContentsMargins(0,0,0,0);
    hbl->setSpacing(1);
    cmbObjective=new QFEnhancedComboBox(this);
    cmbObjective->setSizeAdjustPolicy(QComboBox::AdjustToContents);
    connect(cmbObjective, SIGNAL(currentIndexChanged(int)), this, SLOT(currentObjectiveChanged(int)));
    hbl->addWidget(cmbObjective);

    btnAddObjective=new QToolButton(this);
    btnAddObjective->setToolTip(tr("add a new objective"));
    btnAddObjective->setIcon(QIcon(":/libqf3widgets/objective_add.png"));
    btnAddObjective->setEnabled(true);
    connect(btnAddObjective, SIGNAL(clicked()), this, SLOT(addObjective()));
    hbl->addWidget(btnAddObjective);
    btnDeleteObjective=new QToolButton(this);
    btnDeleteObjective->setToolTip(tr("delete an objective"));
    btnDeleteObjective->setIcon(QIcon(":/libqf3widgets/objective_delete.png"));
    btnDeleteObjective->setEnabled(true);
    connect(btnDeleteObjective, SIGNAL(clicked()), this, SLOT(deleteObjective()));
    hbl->addWidget(btnDeleteObjective);
    btnEditObjective=new QToolButton(this);
    btnEditObjective->setToolTip(tr("edit an objective"));
    btnEditObjective->setIcon(QIcon(":/libqf3widgets/objective_rename.png"));
    btnEditObjective->setEnabled(true);
    connect(btnEditObjective, SIGNAL(clicked()), this, SLOT(editObjective()));
    hbl->addWidget(btnEditObjective);
    labObjectiveDescription=new QLabel(this);
    hbl->addWidget(labObjectiveDescription, 1);


    connect(m_notifier, SIGNAL(doUpdate()), this, SLOT(loadObjectives()));

}