mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Merge pull request #4978 from IvanSavenko/swap_h3_icons
Fix h3 bug: icons of View Earth and View Air are swapped
This commit is contained in:
commit
7fdddee503
8
Mods/vcmi/Content/Sprites/cprsmall.json
Normal file
8
Mods/vcmi/Content/Sprites/cprsmall.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"images" :
|
||||||
|
[
|
||||||
|
// Fix for swapped in H3 icons of Wight and Wraith
|
||||||
|
{ "frame" : 62, "defFile" : "cprsmall.def", "defFrame" : 63},
|
||||||
|
{ "frame" : 63, "defFile" : "cprsmall.def", "defFrame" : 62}
|
||||||
|
]
|
||||||
|
}
|
8
Mods/vcmi/Content/Sprites/spells.json
Normal file
8
Mods/vcmi/Content/Sprites/spells.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"images" :
|
||||||
|
[
|
||||||
|
// Fix for swapped in H3 icons of View Earth and View Air
|
||||||
|
{ "frame" : 3, "defFile" : "spells.def", "defFrame" : 5},
|
||||||
|
{ "frame" : 5, "defFile" : "spells.def", "defFrame" : 3}
|
||||||
|
]
|
||||||
|
}
|
@ -15,15 +15,17 @@
|
|||||||
|
|
||||||
#include "../../lib/json/JsonNode.h"
|
#include "../../lib/json/JsonNode.h"
|
||||||
|
|
||||||
|
|
||||||
ImageLocator::ImageLocator(const JsonNode & config)
|
ImageLocator::ImageLocator(const JsonNode & config)
|
||||||
: image(ImagePath::fromJson(config["file"]))
|
: defFrame(config["defFrame"].Integer())
|
||||||
, defFile(AnimationPath::fromJson(config["defFile"]))
|
|
||||||
, defFrame(config["defFrame"].Integer())
|
|
||||||
, defGroup(config["defGroup"].Integer())
|
, defGroup(config["defGroup"].Integer())
|
||||||
, verticalFlip(config["verticalFlip"].Bool())
|
, verticalFlip(config["verticalFlip"].Bool())
|
||||||
, horizontalFlip(config["horizontalFlip"].Bool())
|
, horizontalFlip(config["horizontalFlip"].Bool())
|
||||||
{
|
{
|
||||||
|
if(!config["file"].isNull())
|
||||||
|
image = ImagePath::fromJson(config["file"]);
|
||||||
|
|
||||||
|
if(!config["defFile"].isNull())
|
||||||
|
defFile = AnimationPath::fromJson(config["defFile"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageLocator::ImageLocator(const ImagePath & path)
|
ImageLocator::ImageLocator(const ImagePath & path)
|
||||||
|
@ -142,7 +142,13 @@ void RenderHandler::initFromJson(AnimationLayoutMap & source, const JsonNode & c
|
|||||||
|
|
||||||
JsonNode toAdd = node;
|
JsonNode toAdd = node;
|
||||||
JsonUtils::inherit(toAdd, base);
|
JsonUtils::inherit(toAdd, base);
|
||||||
|
|
||||||
|
if (toAdd.Struct().count("file"))
|
||||||
toAdd["file"].String() = basepath + node["file"].String();
|
toAdd["file"].String() = basepath + node["file"].String();
|
||||||
|
|
||||||
|
if (toAdd.Struct().count("defFile"))
|
||||||
|
toAdd["defFile"].String() = basepath + node["defFile"].String();
|
||||||
|
|
||||||
source[group][frame] = ImageLocator(toAdd);
|
source[group][frame] = ImageLocator(toAdd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user