void bankManager::saveScene(ofxXmlSettings & XML, ofPtr<scene> sn){
    
    XML.addValue("NAME", sn->getName());
    XML.addValue("UID", sn->getUid());
    XML.addValue("FADE_IN", sn->getFadeIn());
    XML.addValue("FADE_OUT", sn->getFadeOut());
    
    vector <ofPtr<triggerZone> > t_tzs = sn->getTriggerZones();
    vector <ofPtr<triggerZone> > ::iterator it;
    int count = 0;
    
    for(it = t_tzs.begin(); it != t_tzs.end(); it++){
        
        XML.addTag("ZONE");
        
        ofPtr<triggerZone> z = (*it);
        
        if(XML.pushTag("ZONE", count)){
            
            saveZone(XML, z);
                        
            count++;
            
            //zone tag
            XML.popTag();
        }
        
        
    }

    
}
Exemple #2
0
void testApp::updateSceneControls(ofPtr<scene> s, ofPtr<triggerZone> zn){
    
    sc2TextInput[0]->setTextString(s->getName());
    
    fInSlid->setValue(s->getFadeIn());
    fOutSlid->setValue(s->getFadeOut());
    
    if(s->getNumTriggerZones() > 0){
        
        if(displayMode == DT_DM_3D){
            
            zoneCanvases[0]->setVisible(true);
            
            if(zn->getShape() == TZ_SPHERE){
                zoneCanvases[1]->setVisible(true);
                zoneCanvases[2]->setVisible(false);
                zoneCanvases[3]->setVisible(false);
            }else if(zn->getShape() == TZ_BOX){
                zoneCanvases[1]->setVisible(false);
                zoneCanvases[2]->setVisible(true);
                zoneCanvases[3]->setVisible(false);
            }else{
                zoneCanvases[1]->setVisible(false);
                zoneCanvases[2]->setVisible(false);
                zoneCanvases[3]->setVisible(true);
            }
        }
        
        updateTZGuiElements(zn);
        
    }else{
        for(int i = 0; i < 4; i++)zoneCanvases[i]->setVisible(false);
        sc2TextInput[1]->setTextString("none");
    }
    
    
}