void Item::Respawn( Event * ) { if ( _missingSkin ) { ChangeSkin( _missingSkin, false ); } else { showModel(); } // allow it to be touched again setSolidType( SOLID_TRIGGER ); // play respawn sound if ( playrespawn ) { Sound( "snd_itemspawn" ); } setOrigin(); if ( animate->HasAnim( "respawn" ) ) animate->RandomAnimate( "respawn", EV_Item_RespawnDone ); look_at_me = true; has_been_looked_at = false; }
static void prButton( GtkObject * object,gpointer user_data ) { if ( sbSelectedSkin ) { switch ( (int)user_data ) { case 0: // cancel if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin ); break; case 1: // ok ChangeSkin( sbSelectedSkin ); if ( skinName ) free( skinName ); skinName=strdup( sbSelectedSkin ); break; } } HideSkinBrowser(); }
static void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data ) { gtk_clist_get_text( clist,row,0,&sbSelectedSkin ); if ( strcmp( prev,sbSelectedSkin ) ) { prev=sbSelectedSkin; ChangeSkin( sbSelectedSkin ); gtkActive( SkinBrowser ); } if( !bevent ) return; if( bevent->type == GDK_2BUTTON_PRESS ) { if ( skinName ) free( skinName ); skinName=strdup( sbSelectedSkin ); HideSkinBrowser(); } }
vd::status Context::Reset(Skin::Base* skin) { Input::Base* old_input = m_Input; Canvas::Base* old_canvas = m_Canvas; ChangeSkin(skin ? skin : VD_NEW(Skin::Default, m_Renderer)); m_Canvas = VD_NEW(Canvas::Base, GetSkin() ); m_Canvas->Initialize(); // m_Canvas->SetDrawBackground( true ); // m_Canvas->SetBackgroundColor( Gwen::Color( 150, 170, 170, 255 ) ); m_Input = VD_NEW(Input::Base); m_Input->Initialize( m_Canvas ); VD_SAFE_DELETE(old_canvas); VD_SAFE_DELETE(old_input); return Status::Code::Success; }
void CMainFrame::OnAppLook(UINT id) { CBCGPDockManager::SetDockMode(BCGP_DT_SMART); m_nAppLook = id; theApp.WriteInt(_T("ApplicationLook"), m_nAppLook); ChangeSkin(id); CBCGPDockManager* pDockManager = GetDockManager(); if (pDockManager != NULL) { ASSERT_VALID(pDockManager); pDockManager->AdjustBarFrames(); } RecalcLayout(); RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); CJXCMainDlg::AutoChangeSkin(); }
// // Name: _pickupArmor() // Class: Armor // // Description: Takes care of "Picking Up" the armor, by playing the // appropriate sounds, removing the model... // // Parameters: None // // Returns: None // void Armor::_pickupArmor( Sentient *sentient) { str realname; // Play pickup sound realname = GetRandomAlias( "snd_pickup" ); if ( realname.length() > 1 ) sentient->Sound( realname, CHAN_ITEM ); // Cancel some events CancelEventsOfType( EV_Item_DropToFloor ); CancelEventsOfType( EV_Item_Respawn ); CancelEventsOfType( EV_FadeOut ); // Hide the model setSolidType( SOLID_NOT ); if ( _missingSkin ) { ChangeSkin( _missingSkin, true ); } else { hideModel(); } // Respawn? if ( !Respawnable() ) PostEvent( EV_Remove, FRAMETIME ); else PostEvent( EV_Item_Respawn, RespawnTime() ); // fire off any pickup_thread's if ( pickup_thread.length() ) ExecuteThread( pickup_thread ); }
Item *PowerupBase::ItemPickup( Entity *other, qboolean add_to_inventory, qboolean ) { Player *player; str realname; Q_UNUSED(add_to_inventory); if ( !other->isSubclassOf( Player ) ) return NULL; if ( !Pickupable( other ) ) return NULL; if ( multiplayerManager.inMultiplayer() ) { if ( !multiplayerManager.canPickup( (Player *)other, getMultiplayerItemType(), item_name ) ) return NULL; } player = ( Player * )other; // Play pickup sound realname = GetRandomAlias( "snd_pickup" ); if ( realname.length() > 1 ) player->Sound( realname, CHAN_ITEM ); // Cancel some events CancelEventsOfType( EV_Item_DropToFloor ); CancelEventsOfType( EV_Item_Respawn ); CancelEventsOfType( EV_FadeOut ); // Hide the model setSolidType( SOLID_NOT ); if ( _missingSkin ) { ChangeSkin( _missingSkin, true ); } else { hideModel(); } // Respawn? if ( !Respawnable() ) PostEvent( EV_Remove, FRAMETIME ); else PostEvent( EV_Item_Respawn, RespawnTime() ); // fire off any pickup_thread's if ( pickup_thread.length() ) { ExecuteThread( pickup_thread ); } givePlayerItem( player ); if ( multiplayerManager.inMultiplayer() ) { multiplayerManager.pickedupItem( (Player *)other, MP_ITEM_TYPE_POWERUP, item_name ); } return NULL; // This doesn't create any items }
Item * Item::ItemPickup( Entity *other, qboolean add_to_inventory, qboolean checkautopickup ) { Sentient * sent; Item * item = NULL; str realname; // Query the gameplay manager and see if we should not auto-pickup this item if ( checkautopickup ) { GameplayManager *gpm = GameplayManager::getTheGameplayManager(); if ( gpm->hasProperty(getArchetype(), "noautopickup") ) return NULL; } if ( !Pickupable( other ) ) { return NULL; } sent = ( Sentient * )other; if ( add_to_inventory ) { item = sent->giveItem( model, getAmount(), true ); if ( !item ) return NULL; } else { item = this; } // // make sure to copy over the coolness factor :) // item->coolitem = coolitem; item->cool_dialog = cool_dialog; item->cool_anim = cool_anim; item->coolitemforced = coolitemforced; // // let our sent know they received it // we put this here so we can transfer information from the original item we picked up // if ( !isSubclassOf( Weapon ) || add_to_inventory ) sent->ReceivedItem( item ); realname = GetRandomAlias( "snd_pickup" ); if ( realname.length() > 1 ) sent->Sound( realname, CHAN_ITEM ); if ( !Removable() ) { // leave the item for others to pickup return item; } look_at_me = false; CancelEventsOfType( EV_Item_DropToFloor ); CancelEventsOfType( EV_Item_Respawn ); CancelEventsOfType( EV_FadeOut ); setSolidType( SOLID_NOT ); if ( animate && animate->HasAnim( "pickup" ) ) animate->RandomAnimate( "pickup", EV_Item_PickupDone ); else { if ( !no_remove ) { if ( _missingSkin ) { ChangeSkin( _missingSkin, true ); } else { hideModel(); } if ( !Respawnable() ) PostEvent( EV_Remove, FRAMETIME ); } } if ( Respawnable() ) PostEvent( EV_Item_Respawn, RespawnTime() ); // fire off any pickup_thread's if ( pickup_thread.length() ) { ExecuteThread( pickup_thread ); } if ( item && multiplayerManager.checkFlag( MP_FLAG_INSTANT_ITEMS ) ) { Event *ev; ev = new Event( EV_InventoryItem_Use ); ev->AddEntity( other ); item->ProcessEvent( ev ); } return item; }
//换肤 void CDlgDIYChat::OnExchangeSkin(const CString& strFileName,const CString& strSkinKey,const CString& strSkinPath) { ChangeSkin(strFileName,strSkinKey,strSkinPath); //OnPaint(); Invalidate(); }