浏览代码

Pressing shift will now add tile coordinates to adventure map hover text

Ivan Savenko 1 年之前
父节点
当前提交
56ee3713fe
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      client/adventureMap/AdventureMapInterface.cpp

+ 4 - 0
client/adventureMap/AdventureMapInterface.cpp

@@ -643,11 +643,15 @@ void AdventureMapInterface::onTileHovered(const int3 &targetPosition)
 		objRelations = LOCPLINT->cb->getPlayerRelations(LOCPLINT->playerID, objAtTile->tempOwner);
 		std::string text = LOCPLINT->localState->getCurrentHero() ? objAtTile->getHoverText(LOCPLINT->localState->getCurrentHero()) : objAtTile->getHoverText(LOCPLINT->playerID);
 		boost::replace_all(text,"\n"," ");
+		if (GH.isKeyboardShiftDown())
+			text.append(" (" + std::to_string(targetPosition.x) + ", " + std::to_string(targetPosition.y) + ")");
 		GH.statusbar()->write(text);
 	}
 	else if(isTargetPositionVisible)
 	{
 		std::string tileTooltipText = CGI->mh->getTerrainDescr(targetPosition, false);
+		if (GH.isKeyboardShiftDown())
+			tileTooltipText.append(" (" + std::to_string(targetPosition.x) + ", " + std::to_string(targetPosition.y) + ")");
 		GH.statusbar()->write(tileTooltipText);
 	}