コード例 #1
0
//==== Load Type Choice ====//
void ManageGeomScreen::LoadTypeChoice()
{
    m_GeomUI->geomTypeChoice->clear();

    Vehicle* veh = m_ScreenMgr->GetVehiclePtr();

    int num_type  = veh->GetNumGeomTypes();
    int num_fixed = veh->GetNumFixedGeomTypes();
    int cnt = 1;

    for ( int i = 0 ; i < num_type ; i++ )
    {
        GeomType type = veh->GetGeomType( i );

        string item = type.m_Name.c_str();
        if ( i == ( num_fixed - 1 ) )
        {
            item = "_" + item;
        }

        if ( !type.m_FixedFlag )
        {
            item = StringUtil::int_to_string( cnt, "%d.  " ) + item;
            cnt++;
        }
        m_GeomUI->geomTypeChoice->add( item.c_str() );

    }

    m_GeomUI->geomTypeChoice->value( m_TypeIndex );
}
コード例 #2
0
//==== Add Geom - Type From Type Choice ====//
void ManageGeomScreen::AddGeom()
{
    Vehicle* veh = m_ScreenMgr->GetVehiclePtr();

    GeomType type = veh->GetGeomType( m_TypeIndex );

    if ( type.m_Type < NUM_GEOM_TYPE )
    {
        string added_id = m_VehiclePtr->AddGeom( type );
        m_VehiclePtr->SetActiveGeom( added_id );
        ShowHideGeomScreens();
    }

}