1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Make each windows coniguration in separate file

This commit is contained in:
nordsoft 2022-12-12 04:52:44 +04:00
parent b3d60ec418
commit 8dbc5c1c1f
3 changed files with 512 additions and 515 deletions

View File

@ -35,7 +35,7 @@ RandomMapTab::RandomMapTab():
recActions = 0;
mapGenOptions = std::make_shared<CMapGenOptions>();
const JsonNode config(ResourceID("config/windows.json"));
const JsonNode config(ResourceID("config/windows/randomMapTab.json"));
addCallback("toggleMapSize", [&](int btnId)
{
auto mapSizeVal = getPossibleMapSizes();
@ -105,7 +105,7 @@ RandomMapTab::RandomMapTab():
updateMapInfoByHost();
});
init(config["randomMapTab"]);
init(config);
updateMapInfoByHost();
}

View File

@ -1,513 +0,0 @@
{
"randomMapTab":
{
"items":
[
{
"name": "background",
"type": "picture",
"image": "RANMAPBK",
"position": {"x": 0, "y": 6}
},
{
"name": "labelHeadlineBig",
"type": "label",
"font": "big",
"alignment": "center",
"color": "yellow",
"text": 738,
"position": {"x": 222, "y": 36}
},
{
"name": "labelHeadlineSmall",
"type": "label",
"font": "small",
"alignment": "center",
"color": "white",
"text": 739,
"position": {"x": 222, "y": 56}
},
{
"name": "labelMapSize",
"type": "label",
"font": "small",
"alignment": "center",
"color": "white",
"text": 752,
"position": {"x": 104, "y": 97}
},
{
"name": "groupMapSize",
"type": "toggleGroup",
"position": {"x": 158, "y": 81},
"items":
[
{
"index": 0,
"type": "toggleButton",
"image": "RANSIZS",
"zelp": 198,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0},
},
{
"type": "toggleButton",
"image": "RANSIZM",
"zelp": 199,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 47, "y": 0},
},
{
"type": "toggleButton",
"image": "RANSIZL",
"zelp": 200,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 94, "y": 0},
},
{
"type": "toggleButton",
"image": "RANSIZX",
"zelp": 201,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 141, "y": 0}
}
],
"selected": 1,
"callback": "toggleMapSize"
},
{
"name": "buttonTwoLevels",
"type": "toggleButton",
"image": "RANUNDR",
"position": {"x": 346, "y": 81},
"selected": true,
"callback": "toggleTwoLevels"
},
{
"name": "groupMaxPlayers",
"type": "toggleGroup",
"position": {"x": 67, "y": 153},
"items":
[
{
"index": 1,
"type": "toggleButton",
"image": "RANNUM1",
"zelp": 204,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM2",
"zelp": 205,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 32, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM3",
"zelp": 206,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 64, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM4",
"zelp": 207,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 96, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM5",
"zelp": 208,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 128, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM6",
"zelp": 209,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 160, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM7",
"zelp": 210,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 192, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM8",
"zelp": 211,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 224, "y": 0}
},
{
"index": -1,
"type": "toggleButton",
"image": "RANRAND",
"zelp": 212,
"position": {"x": 256, "y": 0},
}
],
"selected": 7,
"callback": "setPlayersCount"
},
{
"name": "groupMaxTeams",
"type": "toggleGroup",
"position": {"x": 67, "y": 219},
"items":
[
{
"index": 0,
"type": "toggleButton",
"image": "RANNUM0",
"zelp": 214,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM1",
"zelp": 215,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 32, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM2",
"zelp": 216,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 64, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM3",
"zelp": 217,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 96, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM4",
"zelp": 218,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 128, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM5",
"zelp": 219,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 160, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM6",
"zelp": 220,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 192, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM7",
"zelp": 221,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 224, "y": 0}
},
{
"index": -1,
"type": "toggleButton",
"image": "RANRAND",
"zelp": 222,
"position": {"x": 256, "y": 0},
}
],
"selected": 7,
"callback": "setTeamsCount"
},
{
"name": "groupCompOnlyPlayers",
"type": "toggleGroup",
"position": {"x": 67, "y": 285},
"items":
[
{
"index": 0,
"type": "toggleButton",
"image": "RANNUM0",
"zelp": 224,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM1",
"zelp": 225,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 32, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM2",
"zelp": 226,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 64, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM3",
"zelp": 227,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 96, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM4",
"zelp": 228,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 128, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM5",
"zelp": 229,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 160, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM6",
"zelp": 230,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 192, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM7",
"zelp": 231,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 224, "y": 0}
},
{
"index": -1,
"type": "toggleButton",
"image": "RANRAND",
"zelp": 232,
"position": {"x": 256, "y": 0},
}
],
"selected": 7,
"callback": "setCompOnlyPlayers"
},
{
"name": "groupCompOnlyTeams",
"type": "toggleGroup",
"position": {"x": 67, "y": 351},
"items":
[
{
"index": 0,
"type": "toggleButton",
"image": "RANNUM0",
"zelp": 234,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM1",
"zelp": 235,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 32, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM2",
"zelp": 236,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 64, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM3",
"zelp": 237,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 96, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM4",
"zelp": 238,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 128, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM5",
"zelp": 239,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 160, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM6",
"zelp": 240,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 192, "y": 0}
},
{
"index": -1,
"type": "toggleButton",
"image": "RANRAND",
"zelp": 241,
"position": {"x": 256, "y": 0},
}
],
"selected": 7,
"callback": "setCompOnlyTeams"
},
{
"name": "groupWaterContent",
"type": "toggleGroup",
"position": {"x": 67, "y": 419},
"items":
[
{
"index": 0,
"type": "toggleButton",
"image": "RANNONE",
"zelp": 243,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNORM",
"zelp": 244,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 85, "y": 0}
},
{
"type": "toggleButton",
"image": "RANISLD",
"zelp": 245,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 170, "y": 0}
},
{
"index": -1,
"type": "toggleButton",
"image": "RANRAND",
"zelp": 246,
"position": {"x": 256, "y": 0},
}
],
"selected": 3,
"callback": "setWaterContent"
},
{
"name": "groupMonsterStrength",
"type": "toggleGroup",
"position": {"x": 67, "y": 485},
"items":
[
{
"index": 2,
"type": "toggleButton",
"image": "RANWEAK",
"zelp": 248,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0}
},
{
"index": 3,
"type": "toggleButton",
"image": "RANNORM",
"zelp": 249,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 85, "y": 0}
},
{
"index": 4,
"type": "toggleButton",
"image": "RANSTRG",
"zelp": 250,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 170, "y": 0}
},
{
"index": -2,
"type": "toggleButton",
"image": "RANRAND",
"zelp": 251,
"position": {"x": 256, "y": 0},
}
],
"selected": 3,
"callback": "setMonsterStrenght"
},
{
"name": "buttonShowRandomMaps",
"type": "button",
"position": {"x": 54, "y": 535},
"image": "RANSHOW",
"zelp": 252
},
{
"type": "labelGroup",
"font": "small",
"alignment": "left",
"color": "white",
"items":
[
{
"position": {"x": 68, "y": 133},
"text": 753
},
{
"position": {"x": 68, "y": 199},
"text": 754
},
{
"position": {"x": 68, "y": 265},
"text": 755
},
{
"position": {"x": 68, "y": 331},
"text": 756
},
{
"position": {"x": 68, "y": 398},
"text": 757
},
{
"position": {"x": 68, "y": 465},
"text": 758
}
]
}
]
}
}

View File

@ -0,0 +1,510 @@
{
"items":
[
{
"name": "background",
"type": "picture",
"image": "RANMAPBK",
"position": {"x": 0, "y": 6}
},
{
"name": "labelHeadlineBig",
"type": "label",
"font": "big",
"alignment": "center",
"color": "yellow",
"text": 738,
"position": {"x": 222, "y": 36}
},
{
"name": "labelHeadlineSmall",
"type": "label",
"font": "small",
"alignment": "center",
"color": "white",
"text": 739,
"position": {"x": 222, "y": 56}
},
{
"name": "labelMapSize",
"type": "label",
"font": "small",
"alignment": "center",
"color": "white",
"text": 752,
"position": {"x": 104, "y": 97}
},
{
"name": "groupMapSize",
"type": "toggleGroup",
"position": {"x": 158, "y": 81},
"items":
[
{
"index": 0,
"type": "toggleButton",
"image": "RANSIZS",
"zelp": 198,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0},
},
{
"type": "toggleButton",
"image": "RANSIZM",
"zelp": 199,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 47, "y": 0},
},
{
"type": "toggleButton",
"image": "RANSIZL",
"zelp": 200,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 94, "y": 0},
},
{
"type": "toggleButton",
"image": "RANSIZX",
"zelp": 201,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 141, "y": 0}
}
],
"selected": 1,
"callback": "toggleMapSize"
},
{
"name": "buttonTwoLevels",
"type": "toggleButton",
"image": "RANUNDR",
"position": {"x": 346, "y": 81},
"selected": true,
"callback": "toggleTwoLevels"
},
{
"name": "groupMaxPlayers",
"type": "toggleGroup",
"position": {"x": 67, "y": 153},
"items":
[
{
"index": 1,
"type": "toggleButton",
"image": "RANNUM1",
"zelp": 204,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM2",
"zelp": 205,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 32, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM3",
"zelp": 206,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 64, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM4",
"zelp": 207,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 96, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM5",
"zelp": 208,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 128, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM6",
"zelp": 209,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 160, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM7",
"zelp": 210,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 192, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM8",
"zelp": 211,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 224, "y": 0}
},
{
"index": -1,
"type": "toggleButton",
"image": "RANRAND",
"zelp": 212,
"position": {"x": 256, "y": 0},
}
],
"selected": 7,
"callback": "setPlayersCount"
},
{
"name": "groupMaxTeams",
"type": "toggleGroup",
"position": {"x": 67, "y": 219},
"items":
[
{
"index": 0,
"type": "toggleButton",
"image": "RANNUM0",
"zelp": 214,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM1",
"zelp": 215,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 32, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM2",
"zelp": 216,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 64, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM3",
"zelp": 217,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 96, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM4",
"zelp": 218,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 128, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM5",
"zelp": 219,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 160, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM6",
"zelp": 220,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 192, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM7",
"zelp": 221,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 224, "y": 0}
},
{
"index": -1,
"type": "toggleButton",
"image": "RANRAND",
"zelp": 222,
"position": {"x": 256, "y": 0},
}
],
"selected": 7,
"callback": "setTeamsCount"
},
{
"name": "groupCompOnlyPlayers",
"type": "toggleGroup",
"position": {"x": 67, "y": 285},
"items":
[
{
"index": 0,
"type": "toggleButton",
"image": "RANNUM0",
"zelp": 224,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM1",
"zelp": 225,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 32, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM2",
"zelp": 226,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 64, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM3",
"zelp": 227,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 96, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM4",
"zelp": 228,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 128, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM5",
"zelp": 229,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 160, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM6",
"zelp": 230,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 192, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM7",
"zelp": 231,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 224, "y": 0}
},
{
"index": -1,
"type": "toggleButton",
"image": "RANRAND",
"zelp": 232,
"position": {"x": 256, "y": 0},
}
],
"selected": 7,
"callback": "setCompOnlyPlayers"
},
{
"name": "groupCompOnlyTeams",
"type": "toggleGroup",
"position": {"x": 67, "y": 351},
"items":
[
{
"index": 0,
"type": "toggleButton",
"image": "RANNUM0",
"zelp": 234,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM1",
"zelp": 235,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 32, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM2",
"zelp": 236,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 64, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM3",
"zelp": 237,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 96, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM4",
"zelp": 238,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 128, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM5",
"zelp": 239,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 160, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNUM6",
"zelp": 240,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 192, "y": 0}
},
{
"index": -1,
"type": "toggleButton",
"image": "RANRAND",
"zelp": 241,
"position": {"x": 256, "y": 0},
}
],
"selected": 7,
"callback": "setCompOnlyTeams"
},
{
"name": "groupWaterContent",
"type": "toggleGroup",
"position": {"x": 67, "y": 419},
"items":
[
{
"index": 0,
"type": "toggleButton",
"image": "RANNONE",
"zelp": 243,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0}
},
{
"type": "toggleButton",
"image": "RANNORM",
"zelp": 244,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 85, "y": 0}
},
{
"type": "toggleButton",
"image": "RANISLD",
"zelp": 245,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 170, "y": 0}
},
{
"index": -1,
"type": "toggleButton",
"image": "RANRAND",
"zelp": 246,
"position": {"x": 256, "y": 0},
}
],
"selected": 3,
"callback": "setWaterContent"
},
{
"name": "groupMonsterStrength",
"type": "toggleGroup",
"position": {"x": 67, "y": 485},
"items":
[
{
"index": 2,
"type": "toggleButton",
"image": "RANWEAK",
"zelp": 248,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 0, "y": 0}
},
{
"index": 3,
"type": "toggleButton",
"image": "RANNORM",
"zelp": 249,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 85, "y": 0}
},
{
"index": 4,
"type": "toggleButton",
"image": "RANSTRG",
"zelp": 250,
"imageOrder": [0, 1, 1, 3],
"position": {"x": 170, "y": 0}
},
{
"index": -2,
"type": "toggleButton",
"image": "RANRAND",
"zelp": 251,
"position": {"x": 256, "y": 0},
}
],
"selected": 3,
"callback": "setMonsterStrenght"
},
{
"name": "buttonShowRandomMaps",
"type": "button",
"position": {"x": 54, "y": 535},
"image": "RANSHOW",
"zelp": 252
},
{
"type": "labelGroup",
"font": "small",
"alignment": "left",
"color": "white",
"items":
[
{
"position": {"x": 68, "y": 133},
"text": 753
},
{
"position": {"x": 68, "y": 199},
"text": 754
},
{
"position": {"x": 68, "y": 265},
"text": 755
},
{
"position": {"x": 68, "y": 331},
"text": 756
},
{
"position": {"x": 68, "y": 398},
"text": 757
},
{
"position": {"x": 68, "y": 465},
"text": 758
}
]
}
]
}