Пример #1
0
void VisibleEntity::makeGUI(class GuiPane* pane, class GApp* app) {
    Entity::makeGUI(pane, app);

    Array<String> modelNames("<none>");
    int selected = 0;
    for (ModelTable::Iterator it = m_scene->modelTable().begin(); it.hasMore(); ++it) {        
        modelNames.append(it->key + " (" + it->value->className() + ")");
        if (it->value == m_model) {
            selected = modelNames.size() - 1;
        }
    }
    m_modelDropDownList = pane->addDropDownList("Model", modelNames, NULL, GuiControl::Callback(this, &VisibleEntity::onModelDropDownAction));
    m_modelDropDownList->setSelectedIndex(selected);
    pane->addCheckBox("Visible", &m_visible);
}
Пример #2
0
void VisibleEntity::makeGUI(class GuiPane* pane, class GApp* app) {
    Entity::makeGUI(pane, app);

    Array<String> modelNames("<none>");
    int selected = 0;
    for (ModelTable::Iterator it = m_scene->modelTable().begin(); it.hasMore(); ++it) {      
        const lazy_ptr<Model>& m = it->value;

        if (m.resolved()) {
            modelNames.append(it->key + " (" + it->value.resolve()->className() + ")");
        } else {
            // The model type is unknown because it hasn't been loaded yet
            modelNames.append(it->key);
        }

        if (it->value == m_model) {
            selected = modelNames.size() - 1;
        }
    }
    m_modelDropDownList = pane->addDropDownList("Model", modelNames, NULL, GuiControl::Callback(this, &VisibleEntity::onModelDropDownAction));
    m_modelDropDownList->setSelectedIndex(selected);
    pane->addCheckBox("Visible", &m_visible);
}