void SelectMenu::loadLevel(void* object, const std::string& map) { //Explicitly cast to a pointer to SelectMenu SelectMenu* self = (SelectMenu*) object; //Call member self->load(map); }
void setupControls() { mTrayMgr->showCursor(); // make room for the controls mTrayMgr->showLogo( TL_TOPRIGHT ); mTrayMgr->showFrameStats( TL_TOPRIGHT ); mTrayMgr->toggleAdvancedFrameStats(); mInfoLabel = mTrayMgr->createLabel( TL_TOP, "TInfo", "", 350 ); mEditMenu = mTrayMgr->createLongSelectMenu( TL_BOTTOM, "EditMode", "Edit Mode", 370, 250, 3 ); mEditMenu->addItem( "None" ); mEditMenu->addItem( "Elevation" ); mEditMenu->addItem( "Blend" ); mEditMenu->selectItem( 0 ); // no edit mode mFlyBox = mTrayMgr->createCheckBox( TL_BOTTOM, "Fly", "Fly" ); mFlyBox->setChecked( false, false ); mShadowsMenu = mTrayMgr->createLongSelectMenu( TL_BOTTOM, "Shadows", "Shadows", 370, 250, 3 ); mShadowsMenu->addItem( "None" ); mShadowsMenu->addItem( "Colour Shadows" ); mShadowsMenu->addItem( "Depth Shadows" ); mShadowsMenu->selectItem( 0 ); // no edit mode // a friendly reminder StringVector names; names.push_back( "Help" ); mTrayMgr->createParamsPanel( TL_TOPLEFT, "Help", 100, names )->setParamValue( 0, "H/F1" ); }
void Sample_MeshLod::setupControls( int uimode /*= 0*/ ) { cleanupControls(); SelectMenu* models = mTrayMgr->createLongSelectMenu(TL_TOPLEFT, "cmbModels", "Model:", 150, 8); models->addItem("Sinbad.mesh"); models->addItem("ogrehead.mesh"); models->addItem("knot.mesh"); models->addItem("fish.mesh"); models->addItem("penguin.mesh"); models->addItem("ninja.mesh"); models->addItem("dragon.mesh"); models->addItem("athene.mesh"); models->addItem("sibenik.mesh"); // Add all meshes from popular: StringVectorPtr meshes = ResourceGroupManager::getSingleton().findResourceNames("General", "*.mesh"); StringVector::iterator it, itEnd; it = meshes->begin(); itEnd = meshes->end(); for(; it != itEnd; it++){ models->addItem(*it); } // Basic options: mWireframe = mTrayMgr->createCheckBox(TL_TOPLEFT, "chkShowWireframe", "Show wireframe", 200); mUseVertexNormals = mTrayMgr->createCheckBox(TL_TOPLEFT, "chkUseVertexNormals", "Use vertex normals", 200); mOutsideWeightSlider = mTrayMgr->createThickSlider(TL_TOPLEFT, "sldOutsideWeight", "Weighten outside", 200, 50, 0, 100, 101); mOutsideWalkAngle = mTrayMgr->createThickSlider(TL_TOPLEFT, "sldOutsideWalkAngle", "Outside angle", 200, 50, -1, 1, 201); mManualMeshes = mTrayMgr->createLongSelectMenu(TL_TOPLEFT, "cmbManualMesh", "Manual LOD:", 100, 8); mManualMeshes->copyItemsFrom(models); mManualMeshes->insertItem(0,""); mReductionSlider = mTrayMgr->createThickSlider(TL_TOPLEFT, "sldReductionValue", "Reduced vertices", 200, 50, 0, 100, 101); mTrayMgr->createButton(TL_TOPLEFT, "btnReduceMore","Reduce More"); mTrayMgr->createButton(TL_TOPLEFT, "btnReduceLess","Reduce Less"); // Level options: mDistanceLabel = mTrayMgr->createLabel(TL_TOPRIGHT, "lblDistance", "Distance: ", 250); mLodLevelList = mTrayMgr->createLongSelectMenu(TL_TOPRIGHT, "cmbLodLevels", "Lod level:", 150, 4); mTrayMgr->createButton(TL_TOPRIGHT, "btnAddLodLevel","Add level", 220); mTrayMgr->createButton(TL_TOPRIGHT, "btnRemoveSelectedLodLevel","Remove level", 220); mTrayMgr->createButton(TL_TOPRIGHT, "btnRemoveInitialLodLevel","Remove level #0", 220); // Serializer options: mTrayMgr->createButton(TL_TOPRIGHT, "btnShowAll", "Show all levels", 220); mTrayMgr->createButton(TL_TOPRIGHT, "btnAutoconfigure", "Show autoconfigured LODs", 220); mTrayMgr->createButton(TL_TOPRIGHT, "btnShowMesh", "Show LODs stored in mesh", 220); mTrayMgr->createButton(TL_TOPRIGHT, "btnSaveMesh", "Save mesh", 220); mTrayMgr->createButton(TL_TOPRIGHT, "btnRestoreMesh", "Restore original mesh", 220); // Profile options mProfileList = mTrayMgr->createLongSelectMenu(TL_TOPRIGHT, "cmbProfiledVertices", "Profile:", 180, 4); mTrayMgr->createButton(TL_TOPRIGHT, "btnRemoveFromProfile","Remove from profile", 220.0); mTrayMgr->createButton(TL_TOPRIGHT, "btnAddToProfile","Add to profile", 220.0); //mTrayMgr->createTextBox(TL_TOPRIGHT, "Help","Help", 200, 200) // ->setText("The last reduced vertex is the selected vertex. Use the slider to select the vertex, then decide to keep or remove it. You can export the Lod buffers into the .mesh file after configuration."); mTrayMgr->showCursor(); }