mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-11-03 23:56:47 +00:00 
			
		
		
		
	fixed the tooltip for doors leading to exteriors, fixed map window cell name
This commit is contained in:
		
							parent
							
								
									94993b515c
								
							
						
					
					
						commit
						2e57cf5730
					
				
					 2 changed files with 26 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -164,12 +164,30 @@ namespace MWClass
 | 
			
		|||
 | 
			
		||||
        std::string text;
 | 
			
		||||
 | 
			
		||||
        /// \todo If destCell is empty, the teleport target is an exterior cell. In that case we 
 | 
			
		||||
        /// need to fetch that cell (via target position) and retrieve the region name.
 | 
			
		||||
        if (ref->ref.teleport && (ref->ref.destCell != ""))
 | 
			
		||||
        if (ref->ref.teleport)
 | 
			
		||||
        {
 | 
			
		||||
            std::string dest;
 | 
			
		||||
            if (ref->ref.destCell != "")
 | 
			
		||||
            {
 | 
			
		||||
                // door leads to an interior, use interior name as tooltip
 | 
			
		||||
                dest = ref->ref.destCell;
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                // door leads to exterior, use cell name (if any), otherwise translated region name
 | 
			
		||||
                int x,y;
 | 
			
		||||
                environment.mWorld->positionToIndex (ref->ref.doorDest.pos[0], ref->ref.doorDest.pos[1], x, y);
 | 
			
		||||
                const ESM::Cell* cell = environment.mWorld->getStore().cells.findExt(x,y);
 | 
			
		||||
                if (cell->name != "")
 | 
			
		||||
                    dest = cell->name;
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    const ESM::Region* region = environment.mWorld->getStore().regions.search(cell->region);
 | 
			
		||||
                    dest = region->name;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            text += "\n" + environment.mWorld->getStore().gameSettings.search("sTo")->str;
 | 
			
		||||
            text += "\n"+ref->ref.destCell;
 | 
			
		||||
            text += "\n"+dest;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (ref->ref.lockLevel > 0)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -433,7 +433,10 @@ void WindowManager::changeCell(MWWorld::Ptr::CellStore* cell)
 | 
			
		|||
        if (cell->cell->name != "")
 | 
			
		||||
            name = cell->cell->name;
 | 
			
		||||
        else
 | 
			
		||||
            name = cell->cell->region;
 | 
			
		||||
        {
 | 
			
		||||
            const ESM::Region* region = environment.mWorld->getStore().regions.search(cell->cell->region);
 | 
			
		||||
            name = region->name;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        map->setCellName( name );
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue