void pyNotify::SetSender(pyKey& selfKey) { fSenderKey = selfKey.getKey(); fReceivers.Reset(); for (int j = 0; j < selfKey.NotifyListCount(); j++) fReceivers.Append(selfKey.GetNotifyListItem(j)); }
void pySceneObject::addObjPyKey(pyKey& objkey) { if ( objkey.getKey() != nil ) { fSceneObjects.Append(objkey.getKey()); IAddObjKeyToAll(objkey.getKey()); } }
pySceneObject::pySceneObject(pyKey& objkey, pyKey& selfkey) { // make sure these are created fDraw = cyDraw::New(); fPhysics = cyPhysics::New(); fAvatar = cyAvatar::New(); fParticle = cyParticleSys::New(); addObjKey(objkey.getKey()); setSenderKey(selfkey.getKey()); setPyMod(selfkey); fNetForce = false; }
pyNotify::pyNotify(pyKey& selfkey) { fSenderKey = selfkey.getKey(); fNetPropagate = true; fNetForce = false; fBuildMsg.fType = plNotifyMsg::kActivator; fBuildMsg.fState = 0.0f; fBuildMsg.fID = 0; // loop though adding the ones that want to be notified of the change int j; for ( j=0 ; j<selfkey.NotifyListCount() ; j++ ) fReceivers.Append(selfkey.GetNotifyListItem(j)); }
void pySceneObject::PopCutsceneCamera(pyKey& avKey) { if ( fSceneObjects.Count() > 0 ) { // get the object pointer of just the first one in the list // (We really can't tell which one the user is thinking of if they are // referring to multiple objects, so the first one in the list will do.) plSceneObject* obj = plSceneObject::ConvertNoRef(fSceneObjects[0]->ObjectIsLoaded()); if ( obj ) { for (int i = 0; i < obj->GetNumModifiers(); i++) { const plCameraModifier1* pCam = plCameraModifier1::ConvertNoRef(obj->GetModifier(i)); if (pCam) { plCameraMsg* pMsg = new plCameraMsg; pMsg->SetSender(pCam->GetKey()); pMsg->SetBCastFlag(plMessage::kBCastByType); // set command to do the transition pMsg->SetCmd(plCameraMsg::kPythonOverridePop); // set the new camera pMsg->SetTriggerer(avKey.getKey()); pMsg->SetNewCam(pCam->GetKey()); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes return; } } } } }
///////////////////////////////////////////////////////////////////////////// // // Function : Pop // PARAMETERS : // // PURPOSE : Restore the state of the virtual camera with a previously saved setting // void pySceneObject::PopCamera(pyKey& avKey) { plSceneObject* obj = plSceneObject::ConvertNoRef(fSceneObjects[0]->ObjectIsLoaded()); if ( obj ) { for (int i = 0; i < obj->GetNumModifiers(); i++) { const plCameraModifier1* pCam = plCameraModifier1::ConvertNoRef(obj->GetModifier(i)); if (pCam) { // create message plCameraMsg* pMsg = new plCameraMsg; pMsg->SetSender(pCam->GetKey()); pMsg->SetBCastFlag(plMessage::kBCastByType); // set command to do the transition pMsg->SetCmd(plCameraMsg::kRegionPushCamera); // set the new camera pMsg->SetTriggerer(avKey.getKey()); pMsg->SetNewCam(pCam->GetKey()); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } } } }
void pyGameScore::FindAgeHighScores(const ST::string& name, uint32_t maxScores, pyKey& rcvr) { if (hsRef<RelVaultNode> ageInfo = VaultGetAgeInfoNode()) { pfGameScore::FindHighScores(ageInfo->GetNodeId(), maxScores, name, rcvr.getKey()); } else hsAssert(false, "Age has no vault... Need to rewrite score python script?"); }
void pyGameScore::CreatePlayerScore(const ST::string& name, uint32_t type, int32_t points, pyKey& rcvr) { if (hsRef<RelVaultNode> node = VaultGetPlayerInfoNode()) { uint32_t ownerId = node->GetNodeId(); pfGameScore::Create(ownerId, name, type, points, rcvr.getKey()); } else hsAssert(false, "No PlayerInfo node... Need to rewrite python script?"); }
void pyGameScore::CreateAgeScore(const ST::string& name, uint32_t type, int32_t points, pyKey& rcvr) { if (hsRef<RelVaultNode> ageInfo = VaultGetAgeInfoNode()) { uint32_t ownerId = ageInfo->GetNodeId(); pfGameScore::Create(ownerId, name, type, points, rcvr.getKey()); } else hsAssert(false, "Age has no vault... Need to rewrite score python script?"); }
void pyImage::setKey(pyKey& mipmapKey) // only for python glue, do NOT call { #ifndef BUILDING_PYPLASMA if (fMipmap && fMipMapKey) fMipMapKey->UnRefObject(); fMipmap = nil; #endif fMipMapKey = mipmapKey.getKey(); }
void pyGameScore::FindAgeScores(const plString& name, pyKey& rcvr) { if (RelVaultNode* ageInfo = VaultGetAgeInfoNodeIncRef()) { uint32_t ownerId = ageInfo->nodeId; pfGameScore::Find(ownerId, name, rcvr.getKey()); ageInfo->DecRef(); } else hsAssert(false, "Age has no vault... Need to rewrite score python script?"); }
void pyGameScore::FindPlayerScores(const plString& name, pyKey& rcvr) { if (RelVaultNode* node = VaultGetPlayerInfoNodeIncRef()) { uint32_t ownerId = node->nodeId; pfGameScore::Find(ownerId, name, rcvr.getKey()); node->DecRef(); } else hsAssert(false, "No PlayerInfo node.. Need to rewrite python script?"); }
void pyGUIDialog::SetFocus( pyKey& gcKey ) { if ( fGCkey ) { pfGUIDialogMod* pdmod = pfGUIDialogMod::ConvertNoRef(fGCkey->ObjectIsLoaded()); if ( pdmod ) { pfGUIControlMod* pcontrolmod = pfGUIControlMod::ConvertNoRef(gcKey.getKey()->ObjectIsLoaded()); if ( pcontrolmod ) pdmod->SetFocus(pcontrolmod); } } }
uint32_t pyGUIDialog::WhatControlType(pyKey& gckey) { // Do the pop-up menu test first, since it's derived from dialog if ( pyGUIPopUpMenu::IsGUIPopUpMenu(gckey) ) return kPopUpMenu; else if ( pyGUIDialog::IsGUIDialog(gckey) ) return kDialog; else if ( pyGUIControlButton::IsGUIControlButton(gckey) ) return kButton; else if ( pyGUIControlCheckBox::IsGUIControlCheckBox(gckey) ) return kCheckBox; else if ( pyGUIControlEditBox::IsGUIControlEditBox(gckey) ) return kEditBox; else if ( pyGUIControlListBox::IsGUIControlListBox(gckey) ) return kListBox; else if ( pyGUIControlRadioGroup::IsGUIControlRadioGroup(gckey) ) return kRadioGroup; else if ( pyGUIControlTextBox::IsGUIControlTextBox(gckey) ) return kTextBox; else if ( pyGUIControlValue::IsGUIControlValue(gckey) ) { // then see what kind of value control it is if ( pfGUIKnobCtrl::ConvertNoRef(gckey.getKey()->GetObjectPtr()) ) return kKnob; else if ( pfGUIUpDownPairMod::ConvertNoRef(gckey.getKey()->GetObjectPtr()) ) return kUpDownPair; else return 0; } else if ( pyGUIControlDynamicText::IsGUIControlDynamicText( gckey ) ) return kDynamicText; else if ( pyGUIControlMultiLineEdit::IsGUIControlMultiLineEdit( gckey ) ) return kMultiLineEdit; else if ( pyGUIControlClickMap::IsGUIControlClickMap( gckey ) ) return kClickMap; else return 0; }
///////////////////////////////////////////////////////////////////////////// // // Function : Pop // PARAMETERS : // // PURPOSE : Restore the state of the virtual camera with a previously saved setting // void cyCamera::Pop(pyKey& oldCamKey) { // create message plCameraMsg* pMsg = new plCameraMsg; if ( fSender ) pMsg->SetSender(fSender); // if we're sending to the virtual camera if ( fTheCam ) pMsg->AddReceiver(fTheCam); else // otherwise, broadcast by type pMsg->SetBCastFlag(plMessage::kBCastByType); // set command to undo the camera... somehow not saying ResponderTrigger but Push means Pop...whatever pMsg->SetCmd(plCameraMsg::kRegionPushCamera); // set the new camera pMsg->SetNewCam(oldCamKey.getKey()); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes }
///////////////////////////////////////////////////////////////////////////// // // Function : Push // PARAMETERS : // // PURPOSE : Save the current state of the virtual camera // // NOTE: doesn't work by itself at the moment // void cyCamera::Push(pyKey& newCamKey) { // create message plCameraMsg* pMsg = new plCameraMsg; if ( fSender ) pMsg->SetSender(fSender); // if we're sending to the virtual camera if ( fTheCam ) pMsg->AddReceiver(fTheCam); else // otherwise, broadcast by type pMsg->SetBCastFlag(plMessage::kBCastByType); // set command to do the transition pMsg->SetCmd(plCameraMsg::kResponderTrigger); pMsg->SetCmd(plCameraMsg::kRegionPushCamera); // set the new camera pMsg->SetNewCam(newCamKey.getKey()); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes }
///////////////////////////////////////////////////////////////////////////// // // Function : TransitionTo // PARAMETERS : newCamKey - what to switch the camera to // : time - how long it takes to transition to new camera // // PURPOSE : Transition to a new camera (position and settings) // void cyCamera::TransitionTo(pyKey& newCamKey, double time, bool save) { // create message plCameraMsg* pMsg = new plCameraMsg; if ( fSender ) pMsg->SetSender(fSender); // must have a receiver! if ( fTheCam ) { pMsg->AddReceiver(fTheCam); // set command to do the transition pMsg->SetCmd(plCameraMsg::kTransitionTo); // set the new camera pMsg->SetNewCam(newCamKey.getKey()); // set the transition time pMsg->SetTransTime(time); // test to see if they want to save if ( save ) pMsg->SetCmd(plCameraMsg::kPush); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } }
void pySceneObject::setPyMod(pyKey& pymod) { fPyMod = pymod.getKey(); }
pyGrassShader::pyGrassShader(pyKey& key) { fShaderKey = key.getKey(); }
bool pyGUIControlButton::IsGUIControlButton(pyKey& gckey) { if ( gckey.getKey() && pfGUIButtonMod::ConvertNoRef(gckey.getKey()->ObjectIsLoaded()) ) return true; return false; }
bool pyGUISkin::IsGUISkin(pyKey& gckey) { if ( gckey.getKey() && pfGUISkin::ConvertNoRef(gckey.getKey()->GetObjectPtr()) ) return true; return false; }
pyGUISkin::pyGUISkin(pyKey& gckey) { fGCkey = gckey.getKey(); }
bool pyGUIControlEditBox::IsGUIControlEditBox(pyKey& gckey) { if ( gckey.getKey() && pfGUIEditBoxMod::ConvertNoRef(gckey.getKey()->ObjectIsLoaded()) ) return true; return false; }
void pyGameScore::CreateGlobalScore(const plString& name, uint32_t type, int32_t points, pyKey& rcvr) { pfGameScore::Create(0, name, type, points, rcvr.getKey()); }
void pyGameScore::FindGlobalScores(const plString& name, pyKey& rcvr) { pfGameScore::Find(0, name, rcvr.getKey()); }
void pyGameScore::CreateScore(uint32_t ownerId, const plString& name, uint32_t type, int32_t points, pyKey& rcvr) { pfGameScore::Create(ownerId, name, type, points, rcvr.getKey()); }
bool pyGUIControlDraggable::IsGUIControlDraggable(pyKey& gckey) { if ( gckey.getKey() && pfGUIDraggableMod::ConvertNoRef(gckey.getKey()->ObjectIsLoaded()) ) return true; return false; }
void pyGameScore::FindScores(uint32_t ownerId, const plString& name, pyKey& rcvr) { pfGameScore::Find(ownerId, name, rcvr.getKey()); }
void pyVarSyncGame::JoinCommonVarSyncGame(pyKey& callbackKey) { // NOTE: We don't let the player specify the game ID, because there should only be one of these in an age, ever VarSync_CreateParam init; pfGameMgr::GetInstance()->JoinCommonGame(callbackKey.getKey(), kGameTypeId_VarSync, kGameId, sizeof(init), &init); }
void pyGameScore::AddPoints(int32_t numPoints, pyKey& rcvr) { if (fScore) fScore->AddPoints(numPoints, rcvr.getKey()); }