mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +02:00
add ImageLocator::toString
This commit is contained in:
@ -90,3 +90,37 @@ ImageLocator ImageLocator::copyFileTransformScale() const
|
||||
{
|
||||
return *this; // full copy
|
||||
}
|
||||
|
||||
std::string ImageLocator::toString() const
|
||||
{
|
||||
std::string result;
|
||||
if (empty())
|
||||
return "invalid";
|
||||
|
||||
if (image)
|
||||
result += image->getOriginalName();
|
||||
|
||||
if (defFile)
|
||||
{
|
||||
result += defFile->getOriginalName();
|
||||
result += "-" + std::to_string(defGroup);
|
||||
result += "-" + std::to_string(defFrame);
|
||||
}
|
||||
|
||||
if (verticalFlip)
|
||||
result += "-vflip";
|
||||
|
||||
if (horizontalFlip)
|
||||
result += "-hflip";
|
||||
|
||||
if (scalingFactor > 1)
|
||||
result += "-scale" + std::to_string(scalingFactor);
|
||||
|
||||
if (playerColored.isValidPlayer())
|
||||
result += "-player" + playerColored.toString();
|
||||
|
||||
if (layer != EImageLayer::ALL)
|
||||
result =+ "-layer" + std::to_string(static_cast<int>(layer));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user