mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:26:43 +00:00 
			
		
		
		
	Set the selected index after all items are added (workaround for MyGUI bug)
This commit is contained in:
		
							parent
							
								
									5eeed03f5b
								
							
						
					
					
						commit
						1265131203
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		|  | @ -80,6 +80,8 @@ namespace MWGui | |||
| 
 | ||||
|         mCharacterSelection->removeAllItems(); | ||||
| 
 | ||||
|         int selectedIndex = MyGUI::ITEM_NONE; | ||||
| 
 | ||||
|         for (MWBase::StateManager::CharacterIterator it = mgr->characterBegin(); it != mgr->characterEnd(); ++it) | ||||
|         { | ||||
|             if (it->begin()!=it->end()) | ||||
|  | @ -109,11 +111,13 @@ namespace MWGui | |||
|                     it->begin()->mPath.parent_path().filename().string()))) | ||||
|                 { | ||||
|                     mCurrentCharacter = &*it; | ||||
|                     mCharacterSelection->setIndexSelected(mCharacterSelection->getItemCount()-1); | ||||
|                     selectedIndex = mCharacterSelection->getItemCount()-1; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         mCharacterSelection->setIndexSelected(selectedIndex); | ||||
| 
 | ||||
|         fillSaveList(); | ||||
| 
 | ||||
|     } | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue