virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */) { NL3D::UInstance inst = Scene->createInstance("wind.ps"); if (!inst.empty()) { inst.setPos(MainCam.getPos()); } }
void initInventoryScene() { map<uint32, NL3D::UInstance*>::iterator itu; for(itu = InventoryItems.begin(); itu!=InventoryItems.end(); itu++) { InventoryScene->deleteInstance( (*itu).second); } InventoryItems.clear(); // invSelectPS->setPos (0.0f, 0.0f, 0.0f); // invSelectPS->setScale( 1.0f, 1.0f, 1.0f ); if (ShowDebugInChat) nlinfo("InvScene cleared"); placeInList=0; map<uint32,uint8>::iterator it; for(it = CharacterInventory._Inventory.begin(); it!=CharacterInventory._Inventory.end(); it++) { if (ShowDebugInChat) nlinfo(". %d",placeInList); placeInList++; if ((*it).second==1) { // DIT dynamicObject = DynamicObjects.find ((*it).first); // CClientDynamicObject &dynamicObjecta = dynamicObject->second; // hack // if (dynamicObjecta.MeshName=="") dynamicObjecta.MeshName = "MagicWand01.shape"; // UInstance* dynamicInventoryItem = InventoryScene->createInstance( dynamicObjecta.MeshName ); // dynamicInventoryItem->setPos (-1.0f, 3.5f, placeInList*-0.5f); // dynamicInventoryItem->setScale( CVector(0.2f, 0.2f, 0.2f )); // InventoryItems.insert(make_pair (dynamicObjecta.Id, dynamicInventoryItem)); // PlaceInInventoryList.insert(make_pair (dynamicObjecta.Id, placeInList)); } else if ((*it).second==2) { FIT dynamicFirearmObject = Firearms.find ((*it).first); CClientFirearm &dynamicFirearmObjecta = dynamicFirearmObject->second; // hack if (dynamicFirearmObjecta.MeshName=="") dynamicFirearmObjecta.MeshName = "handgun.shape"; NL3D::UInstance* dynamicInventoryItem = InventoryScene->createInstance( dynamicFirearmObjecta.MeshName ); dynamicInventoryItem->setPos (-2.0f, 4.5f, placeInList*-0.4f); InventoryItems.insert(make_pair (dynamicFirearmObjecta.Id, dynamicInventoryItem)); PlaceInInventoryList.insert(make_pair (dynamicFirearmObjecta.Id, placeInList)); } if ((*it).first==CharacterInventory.getSelected()) { // nlinfo("setting select particle system"); // invSelectPS->show(); // invSelectPS->setPos (-2.0f, 4.5f, (placeInList*-1.0f)+0.7f); // invSelectPS->setScale( 0.3f, 0.3f, 0.3f ); } } sendSelectedInInventory( CharacterInventory.getSelected() ); }