@@ -2120,7 +2120,10 @@ CMageGuildScreen::CMageGuildScreen(CCastleInterface * owner, const ImagePath & i
assert(guildWindow.size() == 1 || guildWindow.size() == GAME->interface()->castleInt->town->getTown()->mageLevel);
auto selectedGuildWindow = guildWindow.size() == 1 ? guildWindow[0] : guildWindow[owner->town->mageGuildLevel() - 1];
- window = std::make_shared<CPicture>(selectedGuildWindow, 332, 76);
+ auto windowPosition = owner->town->getTown()->clientInfo.guildWindowPosition;
+ if(windowPosition == Point(0, 0)) // TODO: remove legacy for compatibility
+ windowPosition = Point(332, 76);
+ window = std::make_shared<CPicture>(selectedGuildWindow, windowPosition.x, windowPosition.y);
resdatabar = std::make_shared<CMinorResDataBar>();
resdatabar->moveBy(pos.topLeft(), true);
@@ -153,6 +153,7 @@
[ { "x": 570, "y": 82 }, { "x": 672, "y": 82 }, { "x": 570, "y": 157 }, { "x": 672, "y": 157 } ],
[ { "x": 183, "y": 42 }, { "x": 183, "y": 148 }, { "x": 183, "y": 253 } ]
],
+ "guildWindowPosition": { "x": 332, "y": 76 },
"moatAbility" : "castleMoat",
// primaryResource not specified so town get both Wood and Ore for resource bonus
@@ -158,6 +158,7 @@
[ { "x": 183, "y": 42 }, { "x": 183, "y": 148 }, { "x": 183, "y": 253 } ],
[ { "x": 491, "y": 325 }, { "x": 591, "y": 325 } ]
"primaryResource" : "mercury",
@@ -154,6 +154,7 @@
"primaryResource" : "sulfur",
"moatAbility" : "dungeonMoat",
@@ -152,6 +152,7 @@
[ { "x": 48, "y": 53 }, { "x": 48, "y": 147 }, { "x": 48, "y": 241 }, { "x": 48, "y": 335 }, { "x": 48, "y": 429 } ],
[ { "x": 570, "y": 82 }, { "x": 672, "y": 82 }, { "x": 570, "y": 157 }, { "x": 672, "y": 157 } ]
"moatAbility" : "fortressMoat",
@@ -155,6 +155,7 @@
"moatAbility" : "infernoMoat",
@@ -159,6 +159,7 @@
"moatAbility" : "necropolisMoat",
"primaryResource" : "crystal",
"moatAbility" : "rampartMoat",
@@ -150,6 +150,7 @@
"moatAbility" : "strongholdMoat",
"moatAbility" : "towerMoat",
"buildings" :
@@ -183,6 +183,17 @@
"format" : "imageFile"
}
},
+ "guildWindowPosition" : {
+ "type" : "array",
+ "items" : {
+ "type" : "object",
+ "additionalProperties" : false,
+ "properties" : {
+ "x" : { "type" : "number", "description" : "X coordinate on screen" },
+ "y" : { "type" : "number", "description" : "Y coordinate on screen" }
+ }
+ },
"guildSpellPositions" : {
"type" : "array",
"description" : "Positions of spells in mage guild",
@@ -90,6 +90,7 @@ public:
ImagePath townBackground;
std::vector<ImagePath> guildBackground;
std::vector<ImagePath> guildWindow;
+ Point guildWindowPosition;
std::vector<std::vector<Point>> guildSpellPositions;
AnimationPath buildingsIcons;
ImagePath hallBackground;
@@ -565,6 +565,7 @@ void CTownHandler::loadClientData(CTown &town, const JsonNode & source) const
info.townBackground = ImagePath::fromJson(source["townBackground"]);
info.buildingsIcons = AnimationPath::fromJson(source["buildingsIcons"]);
info.tavernVideo = VideoPath::fromJson(source["tavernVideo"]);
+ info.guildWindowPosition = Point(source["guildWindowPosition"]["x"].Integer(), source["guildWindowPosition"]["y"].Integer());
info.guildSpellPositions.clear();
for(auto & level : source["guildSpellPositions"].Vector())