示例#1
0
Entity *MeshEntity::DuplicateEntity()
{
    MeshEntity *ent = (MeshEntity*)this->GetObjectClass()->Create(FALSE);
    List<BYTE> data;

    BufferOutputSerializer sSave(data);
    this->Serialize(sSave);

    BufferInputSerializer sLoad(data);
    ent->Serialize(sLoad);
    ent->GenerateUniqueName();

    ent->bLightmapped = FALSE;

    ent->Init();

    return ent;
}
示例#2
0
packages::packages(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_autoUpdate, SIGNAL(toggled(bool)), this, SLOT(sHandleAutoUpdate(bool)));
  connect(_close,   SIGNAL(clicked()), this, SLOT(close()));
  connect(_delete,  SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_disable, SIGNAL(clicked()), this, SLOT(sDisable()));
  connect(_edit,    SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_enable,  SIGNAL(clicked()), this, SLOT(sEnable()));
  connect(_load,    SIGNAL(clicked()), this, SLOT(sLoad()));
  connect(_new,     SIGNAL(clicked()), this, SLOT(sNew()));
  connect(_package, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_print,   SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_view,    SIGNAL(clicked()), this, SLOT(sView()));

  _package->addColumn(tr("Name"),    _itemColumn, Qt::AlignLeft, true, "pkghead_name");
  _package->addColumn(tr("Description"),      -1, Qt::AlignLeft, true, "pkghead_descrip");
  _package->addColumn(tr("Version"), _itemColumn, Qt::AlignRight,true, "pkghead_version");
  _package->addColumn(tr("Enabled"),   _ynColumn, Qt::AlignCenter,true, "enabled");

  _load->setEnabled(package::userHasPriv(cNew));
  // It would be nice if we could create (8225) and export (8224) packages
  //_new->setEnabled(package::userHasPriv(cNew));
  _new->setVisible(false);
  _edit->setEnabled(package::userHasPriv(cEdit));

  if (package::userHasPriv(cEdit))
  {
    disconnect(_package, SIGNAL(itemSelected(int)), _view, SLOT(animateClick()));
    connect(_package,      SIGNAL(valid(bool)), _edit,  SLOT(setEnabled(bool)));
    connect(_package,SIGNAL(itemSelected(int)), _edit,  SLOT(animateClick()));
  }
  else
    connect(_package, SIGNAL(itemSelected(int)), _view, SLOT(animateClick()));

  if (package::userHasPriv(cNew))
  {
    connect(_package, SIGNAL(valid(bool)), this, SLOT(sHandleButtons(bool)));
  }

  sHandleAutoUpdate(_autoUpdate->isChecked());
}