本文整理汇总了C++中LaunchItem函数的典型用法代码示例。如果您正苦于以下问题:C++ LaunchItem函数的具体用法?C++ LaunchItem怎么用?C++ LaunchItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LaunchItem函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: VectorCopy
/*
================
Drop_Item
Spawns an item and tosses it forward
================
*/
gentity_t *Drop_Item( gentity_t *ent, gitem_t *item, float angle, qboolean copytarget ) {
gentity_t *dropped = NULL;
vec3_t velocity;
vec3_t angles;
VectorCopy( ent->s.apos.trBase, angles );
angles[YAW] += angle;
angles[PITCH] = 0; // always forward
AngleVectors( angles, velocity, NULL, NULL );
VectorScale( velocity, 150, velocity );
velocity[2] += 200 + crandom() * 50;
if ( copytarget )
{
dropped = LaunchItem( item, ent->s.pos.trBase, velocity, ent->opentarget );
}
else
{
dropped = LaunchItem( item, ent->s.pos.trBase, velocity, NULL );
}
dropped->activator = ent;//so we know who we belonged to so they can pick it back up later
dropped->s.time = level.time;//mark this time so we aren't picked up instantly by the guy who dropped us
return dropped;
}
开发者ID:Almightygir,项目名称:OpenJK,代码行数:33,代码来源:g_items.cpp
示例2: ClearScrollArea
void StartMenu::UpdateFavs(){
//SYNTAX NOTE: (per-line) "<name>::::[dir/app/<mimetype>]::::<path>"
QStringList newfavs = LUtils::listFavorites();
if(favs == newfavs){ return; } //nothing to do - same as before
favs = newfavs;
ClearScrollArea(ui->scroll_favs);
favs.sort();
//Iterate over types of favorites
QStringList rest = favs;
for(int type = 0; type<3; type++){
QStringList tmp;
if(type==0){ tmp = favs.filter("::::app::::"); } //apps first
else if(type==1){ tmp = favs.filter("::::dir::::"); } //dirs next
else{ tmp = rest; } //everything left over
for(int i=0; i<tmp.length(); i++){
if(type<2){ rest.removeAll(tmp[i]); }
if(!QFile::exists(tmp[i].section("::::",2,50))){ continue; } //invalid favorite - skip it
ItemWidget *it = new ItemWidget(ui->scroll_favs->widget(), tmp[i].section("::::",2,50), tmp[i].section("::::",1,1) );
if(!it->gooditem){ continue; } //invalid for some reason
ui->scroll_favs->widget()->layout()->addWidget(it);
connect(it, SIGNAL(NewShortcut()), this, SLOT(UpdateFavs()) );
connect(it, SIGNAL(RemovedShortcut()), this, SLOT(UpdateFavs()) );
connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
}
QApplication::processEvents();
}
}
开发者ID:grahamperrin,项目名称:lumina,代码行数:27,代码来源:StartMenu.cpp
示例3: if
void UserWidget::updateFavItems(bool newfilter){
if(updatingfavs){ return; }
updatingfavs = true;
//qDebug() << "Updating User Favorite Items";
QStringList newfavs = LUtils::listFavorites();
//qDebug() << "Favorites:" << newfavs;
if(lastHomeUpdate.isNull() || (QFileInfo(QDir::homePath()+"/Desktop").lastModified() > lastHomeUpdate) || newfavs!=favs ){
favs = newfavs;
homefiles = LSession::handle()->DesktopFiles();
lastHomeUpdate = QDateTime::currentDateTime();
}else if(!newfilter){ updatingfavs = false; return; } //nothing new to change - stop now
//qDebug() << " - Passed Smoke Test...";
QStringList favitems;
//Remember for format for favorites: <name>::::[app/dir/<mimetype>]::::<full path>
if(ui->tool_fav_apps->isChecked()){
favitems = favs.filter("::::app::::");
for(int i=0; i<homefiles.length(); i++){
if(homefiles[i].fileName().endsWith(".desktop")){
favitems << homefiles[i].fileName()+"::::app-home::::"+homefiles[i].absoluteFilePath();
}
}
}else if(ui->tool_fav_dirs->isChecked()){
favitems = favs.filter("::::dir::::");
for(int i=0; i<homefiles.length(); i++){
if(homefiles[i].isDir()){
favitems << homefiles[i].fileName()+"::::dir-home::::"+homefiles[i].absoluteFilePath();
}
}
}else{
//Files
for(int i=0; i<favs.length(); i++){
QString type = favs[i].section("::::",1,1);
if(type != "app" && type !="dir"){
favitems << favs[i];
}
}
for(int i=0; i<homefiles.length(); i++){
if(!homefiles[i].isDir() && !homefiles[i].fileName().endsWith(".desktop") ){
favitems << homefiles[i].fileName()+"::::"+LXDG::findAppMimeForFile(homefiles[i].fileName())+"-home::::"+homefiles[i].absoluteFilePath();
}
}
}
ClearScrollArea(ui->scroll_fav);
//qDebug() << " - Sorting Items";
favitems.sort(); //sort them alphabetically
//qDebug() << " - Creating Items:" << favitems;
for(int i=0; i<favitems.length(); i++){
UserItemWidget *it = new UserItemWidget(ui->scroll_fav->widget(), favitems[i].section("::::",2,50), favitems[i].section("::::",1,1) );
if(!it->gooditem){ continue; }
ui->scroll_fav->widget()->layout()->addWidget(it);
connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) );
QApplication::processEvents(); //keep the UI snappy - might be a number of these
}
SortScrollArea(ui->scroll_fav);
updatingfavs = false;
//qDebug() << " - Done";
}
开发者ID:abishai,项目名称:lumina,代码行数:60,代码来源:UserWidget.cpp
示例4: ClearScrollArea
//Listing Update routines
void StartMenu::UpdateApps(){
ClearScrollArea(ui->scroll_apps);
//Now assemble the apps list (note: this normally happens in the background - not when it is visible/open)
//qDebug() << "Update Apps:" << CCat << ui->check_apps_showcats->checkState();
if(ui->check_apps_showcats->checkState() == Qt::PartiallyChecked){
//qDebug() << " - Partially Checked";
//Show a single page of apps, but still divided up by categories
CCat.clear();
QStringList cats = sysapps->keys();
cats.sort();
cats.removeAll("All");
for(int c=0; c<cats.length(); c++){
QList<XDGDesktop> apps = sysapps->value(cats[c]);
if(apps.isEmpty()){ continue; }
//Add the category label to the scroll
QLabel *catlabel = new QLabel("<b>"+cats[c]+"</b>",ui->scroll_apps->widget());
catlabel->setAlignment(Qt::AlignCenter);
ui->scroll_apps->widget()->layout()->addWidget(catlabel);
//Now add all the apps for this category
for(int i=0; i<apps.length(); i++){
ItemWidget *it = new ItemWidget(ui->scroll_apps->widget(), apps[i] );
if(!it->gooditem){ continue; } //invalid for some reason
ui->scroll_apps->widget()->layout()->addWidget(it);
connect(it, SIGNAL(NewShortcut()), this, SLOT(UpdateFavs()) );
connect(it, SIGNAL(RemovedShortcut()), this, SLOT(UpdateFavs()) );
connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) );
}
}
}else if(ui->check_apps_showcats->checkState() == Qt::Checked){
开发者ID:yamajun,项目名称:lumina,代码行数:32,代码来源:StartMenu.cpp
示例5: ClearScrollArea
void UserWidget::updateFavItems(){
ClearScrollArea(ui->scroll_fav);
QFileInfoList items;
QDir homedir = QDir( QDir::homePath()+"/Desktop");
QDir favdir = QDir( QDir::homePath()+"/.lumina/favorites");
if(!favdir.exists()){ favdir.mkpath( QDir::homePath()+"/.lumina/favorites"); }
if(ui->tool_fav_apps->isChecked()){
items = homedir.entryInfoList(QStringList()<<"*.desktop", QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
items << favdir.entryInfoList(QStringList()<<"*.desktop", QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
}else if(ui->tool_fav_dirs->isChecked()){
items = homedir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
items << favdir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
}else{
//Files
items = homedir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
items << favdir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
for(int i=0; i<items.length(); i++){
if(items[i].suffix()=="desktop"){ items.removeAt(i); i--; }
}
}
for(int i=0; i<items.length(); i++){
UserItemWidget *it = new UserItemWidget(ui->scroll_fav->widget(), items[i].absoluteFilePath(), ui->tool_fav_dirs->isChecked());
ui->scroll_fav->widget()->layout()->addWidget(it);
connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) );
}
static_cast<QBoxLayout*>(ui->scroll_fav->widget()->layout())->addStretch();
}
开发者ID:KhuramAli,项目名称:lumina,代码行数:29,代码来源:UserWidget.cpp
示例6: QMainWindow
MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI) {
ui->setupUi(this); //load the designer file
//setupIcons();
ui->radio_apps->setChecked(true); //always default to starting here
ui->tool_stop->setVisible(false); //no search running initially
ui->tool_configure->setVisible(false); //app search initially set
livetime = new QTimer(this);
livetime->setInterval(300); //1/3 second for live searches
livetime->setSingleShot(true);
workthread = new QThread(this);
workthread->setObjectName("Lumina Search Process");
searcher = new Worker();
searcher->moveToThread(workthread);
closeShort = new QShortcut(QKeySequence(tr("Esc")), this);
//Setup the connections
connect(livetime, SIGNAL(timeout()), this, SLOT(startSearch()) );
connect(this, SIGNAL(SearchTerm(QString, bool)), searcher, SLOT(StartSearch(QString, bool)) );
connect(searcher, SIGNAL(FoundItem(QString)), this, SLOT(foundSearchItem(QString)) );
connect(searcher, SIGNAL(SearchUpdate(QString)), this, SLOT(searchMessage(QString)) );
connect(searcher, SIGNAL(SearchDone()), this, SLOT(searchFinished()) );
connect(ui->tool_stop, SIGNAL(clicked()), this, SLOT(stopSearch()) );
connect(ui->push_done, SIGNAL(clicked()), this, SLOT(closeApplication()) );
connect(ui->push_launch, SIGNAL(clicked()), this, SLOT(LaunchItem()) );
connect(ui->line_search, SIGNAL(textEdited(QString)), this, SLOT(searchChanged()) );
connect(ui->line_search, SIGNAL(returnPressed()), this, SLOT(LaunchItem()) );
connect(ui->radio_apps, SIGNAL(toggled(bool)), this, SLOT(searchTypeChanged()) );
connect(ui->listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(LaunchItem(QListWidgetItem*)) );
connect(ui->listWidget, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(LaunchItem(QListWidgetItem*)) );
connect(ui->tool_configure, SIGNAL(clicked()), this, SLOT(configureSearch()) );
connect(closeShort, SIGNAL(activated()), this, SLOT( close() ) );
//Setup the settings file
QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina");
settings = new QSettings("LuminaDE", "lumina-search",this);
searcher->startDir = settings->value("StartSearchDir", QDir::homePath()).toString();
searcher->skipDirs = settings->value("SkipSearchDirs", QStringList()).toStringList();
updateDefaultStatusTip();
this->show();
workthread->start();
QTimer::singleShot(0,this, SLOT(setupIcons()) );
}
开发者ID:abishai,项目名称:lumina,代码行数:46,代码来源:MainUI.cpp
示例7: LaunchItem
void UserWidget::slotGoToDir(QString dir){
if(!QFileInfo(dir).isDir()){
LaunchItem(dir);
}else{
ui->label_home_dir->setWhatsThis(dir);
updateHome();
}
}
开发者ID:abishai,项目名称:lumina,代码行数:8,代码来源:UserWidget.cpp
示例8: ParseCommandLine
////////////////////////////////////////////////////////////////////////////////////////////////////
// Parses command line options and invokes required functionality or reports an error to user.
// Returns TRUE if application should stay alive, FALSE if job is done and we need to exit.
BOOL ParseCommandLine ( LPCTSTR lpCmdLine )
{
// First we need to parse command line options and perform validation.
LPWSTR *szArglist;
int nArgs;
HRESULT hr ;
szArglist = CommandLineToArgvW ( lpCmdLine , &nArgs ) ;
if ( 2 != nArgs ) // we always expect 2 arguments - option and parameter
{
Usage ( ) ;
return FALSE ;
}
switch ( szArglist [ 0 ] [ 1 ] )
{
case L'l': // User wants to list directory content
// Copy path of the directory to list to the global buffer
hr = StringCchCopy ( g_szTargetDir , MAX_PATH , szArglist [ 1 ] ) ;
if ( FAILED ( hr ) )
{
MessageBox ( g_hWnd ,
TEXT ( "Invalid directory name passed as parameter" ) ,
TEXT ( "Invalid Parameter" ) ,
MB_ICONERROR | MB_OK ) ;
return FALSE ;
}
// And ask directory lister to perform it's work
g_pLister = new CDirectoryLister ( g_hWnd ) ;
if ( -1 == g_pLister->ShowMenu ( g_szTargetDir ) )
{
MessageBox ( g_hWnd ,
g_szTargetDir ,
TEXT ( "Could not list directory" ) ,
MB_OK | MB_ICONERROR ) ;
return FALSE ;
}
return TRUE ; // Wait while user selects something from the popup menu
case L'o': // User wants to launch a predefined application
LaunchItem ( szArglist [ 1 ] ) ;
return FALSE ;
default:
Usage ( ) ;
return FALSE ;
}
}
开发者ID:sergey-rybalkin,项目名称:QLaunch,代码行数:53,代码来源:QuickLaunch.cpp
示例9: ClearScrollArea
void UserWidget::updateApps(){
if(ui->combo_app_cats->currentIndex() < 0){ return; } //no cat
QString cat = ui->combo_app_cats->itemData( ui->combo_app_cats->currentIndex() ).toString();
QList<XDGDesktop> items = sysapps->value(cat);
ClearScrollArea(ui->scroll_apps);
for(int i=0; i<items.length(); i++){
UserItemWidget *it = new UserItemWidget(ui->scroll_apps->widget(), items[i]);
ui->scroll_apps->widget()->layout()->addWidget(it);
connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) );
}
static_cast<QBoxLayout*>(ui->scroll_apps->widget()->layout())->addStretch();
}
开发者ID:xiazhen06,项目名称:lumina,代码行数:14,代码来源:UserWidget.cpp
示例10: ClearScrollArea
void UserWidget::updateApps(){
if(ui->combo_app_cats->currentIndex() < 0){ return; } //no cat
QString cat = ui->combo_app_cats->itemData( ui->combo_app_cats->currentIndex() ).toString();
QList<XDGDesktop> items = sysapps->value(cat);
ClearScrollArea(ui->scroll_apps);
for(int i=0; i<items.length(); i++){
UserItemWidget *it = new UserItemWidget(ui->scroll_apps->widget(), items[i]);
ui->scroll_apps->widget()->layout()->addWidget(it);
connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) );
connect(it, SIGNAL(NewShortcut()), this, SLOT(updateFavItems()) );
connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) );
QApplication::processEvents(); //keep the UI snappy - might be a number of these
}
}
开发者ID:abishai,项目名称:lumina,代码行数:14,代码来源:UserWidget.cpp
示例11: TossClientCubes
void TossClientCubes(gentity_t * self)
{
gitem_t *item;
gentity_t *drop;
vec3_t velocity;
vec3_t angles;
vec3_t origin;
self->client->ps.generic1 = 0;
// this should never happen but we should never
// get the server to crash due to skull being spawned in
if(!G_EntitiesFree())
{
return;
}
if(self->client->sess.sessionTeam == TEAM_RED)
{
item = BG_FindItem("Red Cube");
}
else
{
item = BG_FindItem("Blue Cube");
}
angles[YAW] = (float)(level.time % 360);
angles[PITCH] = 0; // always forward
angles[ROLL] = 0;
AngleVectors(angles, velocity, NULL, NULL);
VectorScale(velocity, 150, velocity);
velocity[2] += 200 + crandom() * 50;
if(neutralObelisk)
{
VectorCopy(neutralObelisk->s.pos.trBase, origin);
origin[2] += 44;
}
else
{
VectorClear(origin);
}
drop = LaunchItem(item, origin, velocity);
drop->nextthink = level.time + g_cubeTimeout.integer * 1000;
drop->think = G_FreeEntity;
drop->spawnflags = self->client->sess.sessionTeam;
}
开发者ID:SinSiXX,项目名称:Rogue-Reborn,代码行数:50,代码来源:g_combat.c
示例12: VectorCopy
// Spawns an item and drops it
gentity_t *Drop_Item( gentity_t *ent, const gitem_t *item, float angle ) {
vector3 velocity;
vector3 angles;
VectorCopy( &ent->s.apos.trBase, &angles );
angles.yaw += angle;
angles.pitch = 0; // always forward
AngleVectors( &angles, &velocity, NULL, NULL );
VectorScale( &velocity, 150, &velocity );
velocity.z += 200 + crandom() * 50;
return LaunchItem( item, &ent->s.pos.trBase, &velocity );
}
开发者ID:Razish,项目名称:QtZ,代码行数:15,代码来源:g_items.c
示例13: VectorCopy
/*
================
Drop_Item
Spawns an item and tosses it forward
================
*/
gentity_t *Drop_Item( gentity_t *ent, gitem_t *item, float angle ) {
vec3_t velocity;
vec3_t angles;
VectorCopy( ent->s.apos.trBase, angles );
angles[YAW] += angle;
angles[PITCH] = 0; // always forward
AngleVectors( angles, velocity, NULL, NULL );
VectorScale( velocity, 150, velocity );
velocity[2] += 200 + crandom() * 50;
return LaunchItem( item, ent->s.pos.trBase, velocity );
}
开发者ID:LavenderMoon,项目名称:mint-arena,代码行数:21,代码来源:g_items.c
示例14: VectorCopy
/*
================
Drop_Item
Spawns an item and tosses it forward
================
*/
gentity_t *Drop_Item( gentity_t *ent, gitem_t *item, float angle ) {
vec3_t velocity;
vec3_t angles;
VectorCopy( ent->s.apos.trBase, angles );
angles[YAW] += angle;
angles[PITCH] = 0; // always forward
AngleVectors( angles, velocity, NULL, NULL );
VectorScale( velocity, 150, velocity );
velocity[2] += 200 + crandom() * 50;
// FIXME: Cartridges call LaunchItem() directly
G_LogPrintf( "DropItem: %ld %s\n", ( ent - g_entities ), item->classname );
return LaunchItem( item, ent->s.pos.trBase, velocity );
}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:24,代码来源:g_items.c
示例15: VectorCopy
/*
================
Modified by Elder
dropWeapon XRAY FMJ
================
*/
gentity_t *dropWeapon(gentity_t * ent, gitem_t * item, float angle, int xr_flags)
{
vec3_t velocity;
vec3_t angles;
vec3_t origin;
//int throwheight;
vec3_t mins, maxs;
trace_t tr;
VectorCopy(ent->s.pos.trBase, origin);
VectorCopy(ent->s.apos.trBase, angles);
angles[YAW] += angle;
angles[PITCH] = -55; // always at a 55 degree above horizontal angle
AngleVectors(angles, velocity, NULL, NULL);
// set aiming directions
//AngleVectors (ent->client->ps.viewangles, velocity, NULL, NULL);
//Elder: don't toss from the head, but from the "waist"
origin[2] += 10; // (ent->client->ps.viewheight / 2);
VectorMA(origin, 5, velocity, origin); // 14 34 10
// Set temporary bounding box for trace
VectorSet(mins, -ITEM_RADIUS, -ITEM_RADIUS, -ITEM_RADIUS);
VectorSet(maxs, ITEM_RADIUS, ITEM_RADIUS, ITEM_RADIUS);
// NiceAss: Check if the new location starts in a solid.
// FIXME: Use trap_point or whatever?
trap_Trace(&tr, origin, mins, maxs, origin, ent->s.number, MASK_SOLID);
if (tr.startsolid == qtrue)
VectorMA(origin, -7, velocity, origin); // -5 won't work (hint: it should work). Only -7 or less will..
// snap to integer coordinates for more efficient network bandwidth usage
SnapVector(origin);
// less vertical velocity
//velocity[2] += 0.2f;
//velocity[2] = 20;
VectorNormalize(velocity);
VectorScale(velocity, 5, velocity);
return LaunchItem(item, origin, velocity, xr_flags);
}
开发者ID:zturtleman,项目名称:reaction,代码行数:51,代码来源:g_items.c
示例16: player_die
//.........这里部分代码省略.........
AddKillScore( attacker, WOLF_FRAG_BONUS );
}
attacker->client->lastKillTime = level.time;
}
} else {
AddScore( self, -1 );
if( g_gametype.integer == GT_WOLF_LMS )
AddKillScore( self, -1 );
}
// Add team bonuses
Team_FragBonuses(self, inflictor, attacker);
// drop flag regardless
if (self->client->ps.powerups[PW_REDFLAG]) {
item = BG_FindItem("Red Flag");
if (!item)
item = BG_FindItem("Objective");
self->client->ps.powerups[PW_REDFLAG] = 0;
}
if (self->client->ps.powerups[PW_BLUEFLAG]) {
item = BG_FindItem("Blue Flag");
if (!item)
item = BG_FindItem("Objective");
self->client->ps.powerups[PW_BLUEFLAG] = 0;
}
if (item) {
vec3_t launchvel = { 0, 0, 0 };
gentity_t *flag = LaunchItem(item, self->r.currentOrigin, launchvel, self->s.number);
flag->s.modelindex2 = self->s.otherEntityNum2;// JPW NERVE FIXME set player->otherentitynum2 with old modelindex2 from flag and restore here
flag->message = self->message; // DHM - Nerve :: also restore item name
// Clear out player's temp copies
self->s.otherEntityNum2 = 0;
self->message = NULL;
}
// send a fancy "MEDIC!" scream. Sissies, ain' they?
if (self->client != NULL) {
if( self->health > GIB_HEALTH && meansOfDeath != MOD_SUICIDE && meansOfDeath != MOD_SWITCHTEAM ) {
G_AddEvent( self, EV_MEDIC_CALL, 0 );
}
}
Cmd_Score_f( self ); // show scores
// send updated scores to any clients that are following this one,
// or they would get stale scoreboards
for(i=0; i<level.numConnectedClients; i++) {
gclient_t *client = &level.clients[level.sortedClients[i]];
if(client->pers.connected != CON_CONNECTED) continue;
if(client->sess.sessionTeam != TEAM_SPECTATOR) continue;
if(client->sess.spectatorClient == self->s.number) {
Cmd_Score_f(g_entities + level.sortedClients[i]);
}
}
self->takedamage = qtrue; // can still be gibbed
self->r.contents = CONTENTS_CORPSE;
开发者ID:BackupTheBerlios,项目名称:et-flf-svn,代码行数:67,代码来源:g_combat.c
示例17: player_die
//.........这里部分代码省略.........
// if client is in a nodrop area, don't drop anything
// JPW NERVE new drop behavior
if ( g_gametype.integer == GT_SINGLE_PLAYER ) { // only drop here in single player; in multiplayer, drop @ limbo
contents = trap_PointContents( self->r.currentOrigin, -1 );
if ( !( contents & CONTENTS_NODROP ) ) {
TossClientItems( self );
}
}
// drop flag regardless
if ( g_gametype.integer != GT_SINGLE_PLAYER ) {
if ( self->client->ps.powerups[PW_REDFLAG] ) {
item = BG_FindItem( "Red Flag" );
if ( !item ) {
item = BG_FindItem( "Objective" );
}
self->client->ps.powerups[PW_REDFLAG] = 0;
}
if ( self->client->ps.powerups[PW_BLUEFLAG] ) {
item = BG_FindItem( "Blue Flag" );
if ( !item ) {
item = BG_FindItem( "Objective" );
}
self->client->ps.powerups[PW_BLUEFLAG] = 0;
}
if ( item ) {
launchvel[0] = crandom() * 20;
launchvel[1] = crandom() * 20;
launchvel[2] = 10 + random() * 10;
flag = LaunchItem( item,self->r.currentOrigin,launchvel,self->s.number );
flag->s.modelindex2 = self->s.otherEntityNum2; // JPW NERVE FIXME set player->otherentitynum2 with old modelindex2 from flag and restore here
flag->message = self->message; // DHM - Nerve :: also restore item name
// Clear out player's temp copies
self->s.otherEntityNum2 = 0;
self->message = NULL;
}
// send a fancy "MEDIC!" scream. Sissies, ain' they?
if ( self->client != NULL ) {
if ( self->health > GIB_HEALTH && meansOfDeath != MOD_SUICIDE ) {
if ( self->client->sess.sessionTeam == TEAM_RED ) {
if ( random() > 0.5 ) {
G_AddEvent( self, EV_GENERAL_SOUND, G_SoundIndex( "sound/multiplayer/axis/g-medic2.wav" ) );
} else {
G_AddEvent( self, EV_GENERAL_SOUND, G_SoundIndex( "sound/multiplayer/axis/g-medic3.wav" ) );
}
} else {
if ( random() > 0.5 ) {
G_AddEvent( self, EV_GENERAL_SOUND, G_SoundIndex( "sound/multiplayer/allies/a-medic3.wav" ) );
} else {
G_AddEvent( self, EV_GENERAL_SOUND, G_SoundIndex( "sound/multiplayer/allies/a-medic2.wav" ) );
}
}
}
}
}
// jpw
Cmd_Score_f( self ); // show scores
// send updated scores to any clients that are following this one,
// or they would get stale scoreboards
开发者ID:bibendovsky,项目名称:rtcw,代码行数:67,代码来源:g_combat.cpp
示例18: LaunchItem
void StartMenu::on_tool_launch_desksettings_clicked(){
LaunchItem("lumina-config", false);
}
开发者ID:grahamperrin,项目名称:lumina,代码行数:3,代码来源:StartMenu.cpp
示例19: G_DropWeapon
void G_DropWeapon( gentity_t *ent, weapon_t weapon )
{
vec3_t angles, velocity, org, offset, mins, maxs;
gclient_t *client = ent->client;
gentity_t *ent2;
gitem_t *item;
trace_t tr;
item = BG_FindItemForWeapon( weapon );
VectorCopy( client->ps.viewangles, angles );
// clamp pitch
if ( angles[PITCH] < -30 )
angles[PITCH] = -30;
else if ( angles[PITCH] > 30 )
angles[PITCH] = 30;
AngleVectors( angles, velocity, NULL, NULL );
VectorScale( velocity, 64, offset );
offset[2] += client->ps.viewheight / 2.f;
VectorScale( velocity, 75, velocity );
velocity[2] += 50 + random() * 35;
VectorAdd( client->ps.origin, offset, org );
VectorSet( mins, -ITEM_RADIUS, -ITEM_RADIUS, 0 );
VectorSet( maxs, ITEM_RADIUS, ITEM_RADIUS, 2*ITEM_RADIUS );
trap_Trace( &tr, client->ps.origin, mins, maxs, org, ent->s.number, MASK_SOLID );
VectorCopy( tr.endpos, org );
ent2 = LaunchItem( item, org, velocity, client->ps.clientNum );
COM_BitClear( client->ps.weapons, weapon );
if( weapon == WP_KAR98 ) {
COM_BitClear( client->ps.weapons, WP_GPG40 );
} else if ( weapon == WP_CARBINE ) {
COM_BitClear( client->ps.weapons, WP_M7 );
} else if ( weapon == WP_FG42 ) {
COM_BitClear( client->ps.weapons, WP_FG42SCOPE );
} else if( weapon == WP_K43 ) {
COM_BitClear( client->ps.weapons, WP_K43_SCOPE );
} else if( weapon == WP_GARAND ) {
COM_BitClear( client->ps.weapons, WP_GARAND_SCOPE );
} else if( weapon == WP_MORTAR ) {
COM_BitClear( client->ps.weapons, WP_MORTAR_SET );
} else if( weapon == WP_MOBILE_MG42 ) {
COM_BitClear( client->ps.weapons, WP_MOBILE_MG42_SET );
}
// Clear out empty weapon, change to next best weapon
G_AddEvent( ent, EV_WEAPONSWITCHED, 0 );
if( weapon == client->ps.weapon )
client->ps.weapon = 0;
if( weapon == WP_MORTAR ) {
ent2->count = client->ps.ammo[BG_FindAmmoForWeapon(weapon)] + client->ps.ammoclip[BG_FindClipForWeapon(weapon)];
} else {
ent2->count = client->ps.ammoclip[BG_FindClipForWeapon(weapon)];
}
if( weapon == WP_KAR98 || weapon == WP_CARBINE ) {
ent2->delay = client->ps.ammo[BG_FindAmmoForWeapon(weapAlts[weapon])] + client->ps.ammoclip[BG_FindClipForWeapon(weapAlts[weapon])];
} else {
ent2->delay = 0;
}
// ent2->item->quantity = client->ps.ammoclip[BG_FindClipForWeapon(weapon)]; // Gordon: um, modifying an item is not a good idea
client->ps.ammoclip[BG_FindClipForWeapon(weapon)] = 0;
}
开发者ID:BackupTheBerlios,项目名称:et-flf-svn,代码行数:71,代码来源:g_items.c
示例20: ClientThink_real
//.........这里部分代码省略.........
if ( g_gametype.integer != GT_SINGLE_PLAYER ) {
if ( ucmd->wbuttons & WBUTTON_DROP ) {
if ( !client->dropWeaponTime ) {
client->dropWeaponTime = 1; // just latch it for now
if ( ( client->ps.stats[STAT_PLAYER_CLASS] == PC_SOLDIER ) || ( client->ps.stats[STAT_PLAYER_CLASS] == PC_LT ) ) {
for ( i = 0; i < MAX_WEAPS_IN_BANK_MP; i++ ) {
weapon = weapBanksMultiPlayer[3][i];
if ( COM_BitCheck( client->ps.weapons,weapon ) ) {
item = BG_FindItemForWeapon( weapon );
VectorCopy( client->ps.viewangles, angles );
// clamp pitch
if ( angles[PITCH] < -30 ) {
angles[PITCH] = -30;
} else if ( angles[PITCH] > 30 ) {
angles[PITCH] = 30;
}
AngleVectors( angles, velocity, NULL, NULL );
VectorScale( velocity, 64, offset );
offset[2] += client->ps.viewheight / 2;
VectorScale( velocity, 75, velocity );
velocity[2] += 50 + random() * 35;
VectorAdd( client->ps.origin,offset,org );
VectorSet( mins, -ITEM_RADIUS, -ITEM_RADIUS, 0 );
VectorSet( maxs, ITEM_RADIUS, ITEM_RADIUS, 2 * ITEM_RADIUS );
trap_Trace( &tr, client->ps.origin, mins, maxs, org, ent->s.number, MASK_SOLID );
VectorCopy( tr.endpos, org );
ent2 = LaunchItem( item, org, velocity, client->ps.clientNum );
COM_BitClear( client->ps.weapons,weapon );
if ( weapon == WP_MAUSER ) {
COM_BitClear( client->ps.weapons,WP_SNIPERRIFLE );
}
// Clear out empty weapon, change to next best weapon
G_AddEvent( ent, EV_NOAMMO, 0 );
i = MAX_WEAPS_IN_BANK_MP;
// show_bug.cgi?id=568
if ( client->ps.weapon == weapon ) {
client->ps.weapon = 0;
}
ent2->count = client->ps.ammoclip[BG_FindClipForWeapon( weapon )];
ent2->item->quantity = client->ps.ammoclip[BG_FindClipForWeapon( weapon )];
client->ps.ammoclip[BG_FindClipForWeapon( weapon )] = 0;
}
}
}
}
} else {
client->dropWeaponTime = 0;
}
}
// jpw
// check for inactivity timer, but never drop the local client of a non-dedicated server
if ( !ClientInactivityTimer( client ) ) {
return;
}
开发者ID:chegestar,项目名称:omni-bot,代码行数:66,代码来源:g_active.c
注:本文中的LaunchItem函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论