1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-01 12:57:51 +02:00

read from mapheader; move chr to subfolder

This commit is contained in:
Laserlicht 2024-09-24 21:41:37 +02:00
parent 138cbc6a81
commit 2d60252e4c
3 changed files with 65 additions and 60 deletions

View File

@ -55,6 +55,7 @@
#include "../../lib/campaign/CampaignState.h" #include "../../lib/campaign/CampaignState.h"
#include "../../lib/mapping/CMapService.h" #include "../../lib/mapping/CMapService.h"
#include "../../lib/mapping/CMapInfo.h" #include "../../lib/mapping/CMapInfo.h"
#include "../../lib/mapping/CMapHeader.h"
#include "../../lib/mapObjects/CGHeroInstance.h" #include "../../lib/mapObjects/CGHeroInstance.h"
@ -402,6 +403,7 @@ void CBonusSelection::goBack()
CSH->state = EClientState::LOBBY; CSH->state = EClientState::LOBBY;
} }
*/ */
CMM->playMusic();
} }
void CBonusSelection::startMap() void CBonusSelection::startMap()
@ -498,7 +500,10 @@ CBonusSelection::CRegion::CRegion(CampaignScenarioID id, bool accessible, bool s
auto labelPos = campDsc.getLabelPosition(id); auto labelPos = campDsc.getLabelPosition(id);
if(labelPos) if(labelPos)
label = std::make_shared<CLabel>((*labelPos).x, (*labelPos).y, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CSH->si->campState->scenario(idOfMapAndRegion).scenarioName.toString()); {
auto mapHeader = CSH->si->campState->getMapHeader(idOfMapAndRegion);
label = std::make_shared<CLabel>((*labelPos).x, (*labelPos).y, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, mapHeader->name.toString());
}
} }
void CBonusSelection::CRegion::updateState() void CBonusSelection::CRegion::updateState()

View File

@ -6,7 +6,7 @@
"introVideo": "H3X1intr", "introVideo": "H3X1intr",
"videoRim": "IntroRm2" "videoRim": "IntroRm2"
}, },
"MAPS/HC1_MAIN" : { // Heroes Chronicles 1 "MAPS/CHRONICLES/HC1_MAIN" : { // Heroes Chronicles 1
"regions": "regions":
{ {
"background": "chronicles_1/CamBkHc", "background": "chronicles_1/CamBkHc",
@ -39,7 +39,7 @@
"videoRim": "chronicles_1/INTRORIM", "videoRim": "chronicles_1/INTRORIM",
"introVideo": "chronicles_1/Intro" "introVideo": "chronicles_1/Intro"
}, },
"MAPS/HC2_MAIN" : { // Heroes Chronicles 2 "MAPS/CHRONICLES/HC2_MAIN" : { // Heroes Chronicles 2
"regions": "regions":
{ {
"background": "chronicles_2/CamBkHc", "background": "chronicles_2/CamBkHc",
@ -47,14 +47,14 @@
"suffix": ["1", "2", "3"], "suffix": ["1", "2", "3"],
"color_suffix_length": 0, "color_suffix_length": 0,
"desc": [ "desc": [
{ "infix": "1", "x": 27, "y": 43 }, { "infix": "1", "x": 27, "y": 43, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "2", "x": 231, "y": 43 }, { "infix": "2", "x": 231, "y": 43, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "3", "x": 27, "y": 178 }, { "infix": "3", "x": 27, "y": 178, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "4", "x": 231, "y": 178 }, { "infix": "4", "x": 231, "y": 178, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "5", "x": 27, "y": 312 }, { "infix": "5", "x": 27, "y": 312, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "6", "x": 231, "y": 312 }, { "infix": "6", "x": 231, "y": 312, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "7", "x": 27, "y": 447 }, { "infix": "7", "x": 27, "y": 447, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "8", "x": 231, "y": 447 } { "infix": "8", "x": 231, "y": 447, "labelPos": { "x": 98, "y": 112 } }
] ]
}, },
"scenarioCount": 8, "scenarioCount": 8,
@ -72,7 +72,7 @@
"videoRim": "chronicles_2/INTRORIM", "videoRim": "chronicles_2/INTRORIM",
"introVideo": "chronicles_2/Intro" "introVideo": "chronicles_2/Intro"
}, },
"MAPS/HC3_MAIN" : { // Heroes Chronicles 3 "MAPS/CHRONICLES/HC3_MAIN" : { // Heroes Chronicles 3
"regions": "regions":
{ {
"background": "chronicles_3/CamBkHc", "background": "chronicles_3/CamBkHc",
@ -80,14 +80,14 @@
"suffix": ["1", "2", "3"], "suffix": ["1", "2", "3"],
"color_suffix_length": 0, "color_suffix_length": 0,
"desc": [ "desc": [
{ "infix": "1", "x": 27, "y": 43 }, { "infix": "1", "x": 27, "y": 43, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "2", "x": 231, "y": 43 }, { "infix": "2", "x": 231, "y": 43, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "3", "x": 27, "y": 178 }, { "infix": "3", "x": 27, "y": 178, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "4", "x": 231, "y": 178 }, { "infix": "4", "x": 231, "y": 178, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "5", "x": 27, "y": 312 }, { "infix": "5", "x": 27, "y": 312, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "6", "x": 231, "y": 312 }, { "infix": "6", "x": 231, "y": 312, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "7", "x": 27, "y": 447 }, { "infix": "7", "x": 27, "y": 447, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "8", "x": 231, "y": 447 } { "infix": "8", "x": 231, "y": 447, "labelPos": { "x": 98, "y": 112 } }
] ]
}, },
"scenarioCount": 8, "scenarioCount": 8,
@ -105,7 +105,7 @@
"videoRim": "chronicles_3/INTRORIM", "videoRim": "chronicles_3/INTRORIM",
"introVideo": "chronicles_3/Intro" "introVideo": "chronicles_3/Intro"
}, },
"MAPS/HC4_MAIN" : { // Heroes Chronicles 4 "MAPS/CHRONICLES/HC4_MAIN" : { // Heroes Chronicles 4
"regions": "regions":
{ {
"background": "chronicles_4/CamBkHc", "background": "chronicles_4/CamBkHc",
@ -113,14 +113,14 @@
"suffix": ["1", "2", "3"], "suffix": ["1", "2", "3"],
"color_suffix_length": 0, "color_suffix_length": 0,
"desc": [ "desc": [
{ "infix": "1", "x": 27, "y": 43 }, { "infix": "1", "x": 27, "y": 43, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "2", "x": 231, "y": 43 }, { "infix": "2", "x": 231, "y": 43, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "3", "x": 27, "y": 178 }, { "infix": "3", "x": 27, "y": 178, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "4", "x": 231, "y": 178 }, { "infix": "4", "x": 231, "y": 178, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "5", "x": 27, "y": 312 }, { "infix": "5", "x": 27, "y": 312, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "6", "x": 231, "y": 312 }, { "infix": "6", "x": 231, "y": 312, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "7", "x": 27, "y": 447 }, { "infix": "7", "x": 27, "y": 447, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "8", "x": 231, "y": 447 } { "infix": "8", "x": 231, "y": 447, "labelPos": { "x": 98, "y": 112 } }
] ]
}, },
"scenarioCount": 8, "scenarioCount": 8,
@ -138,7 +138,7 @@
"videoRim": "chronicles_4/INTRORIM", "videoRim": "chronicles_4/INTRORIM",
"introVideo": "chronicles_4/Intro" "introVideo": "chronicles_4/Intro"
}, },
"MAPS/HC5_MAIN" : { // Heroes Chronicles 5 "MAPS/CHRONICLES/HC5_MAIN" : { // Heroes Chronicles 5
"regions": "regions":
{ {
"background": "chronicles_5/CamBkHc", "background": "chronicles_5/CamBkHc",
@ -146,11 +146,11 @@
"suffix": ["1", "2", "3"], "suffix": ["1", "2", "3"],
"color_suffix_length": 0, "color_suffix_length": 0,
"desc": [ "desc": [
{ "infix": "1", "x": 34, "y": 184 }, { "infix": "1", "x": 34, "y": 184, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "2", "x": 235, "y": 184 }, { "infix": "2", "x": 235, "y": 184, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "3", "x": 34, "y": 320 }, { "infix": "3", "x": 34, "y": 320, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "4", "x": 235, "y": 320 }, { "infix": "4", "x": 235, "y": 320, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "5", "x": 129, "y": 459 } { "infix": "5", "x": 129, "y": 459, "labelPos": { "x": 98, "y": 112 } }
] ]
}, },
"scenarioCount": 5, "scenarioCount": 5,
@ -165,7 +165,7 @@
"videoRim": "chronicles_5/INTRORIM", "videoRim": "chronicles_5/INTRORIM",
"introVideo": "chronicles_5/Intro" "introVideo": "chronicles_5/Intro"
}, },
"MAPS/HC6_MAIN" : { // Heroes Chronicles 6 "MAPS/CHRONICLES/HC6_MAIN" : { // Heroes Chronicles 6
"regions": "regions":
{ {
"background": "chronicles_6/CamBkHc", "background": "chronicles_6/CamBkHc",
@ -173,11 +173,11 @@
"suffix": ["1", "2", "3"], "suffix": ["1", "2", "3"],
"color_suffix_length": 0, "color_suffix_length": 0,
"desc": [ "desc": [
{ "infix": "1", "x": 34, "y": 184 }, { "infix": "1", "x": 34, "y": 184, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "2", "x": 235, "y": 184 }, { "infix": "2", "x": 235, "y": 184, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "3", "x": 34, "y": 320 }, { "infix": "3", "x": 34, "y": 320, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "4", "x": 235, "y": 320 }, { "infix": "4", "x": 235, "y": 320, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "5", "x": 129, "y": 459 } { "infix": "5", "x": 129, "y": 459, "labelPos": { "x": 98, "y": 112 } }
] ]
}, },
"scenarioCount": 5, "scenarioCount": 5,
@ -192,7 +192,7 @@
"videoRim": "chronicles_6/INTRORIM", "videoRim": "chronicles_6/INTRORIM",
"introVideo": "chronicles_6/Intro" "introVideo": "chronicles_6/Intro"
}, },
"MAPS/HC7_MAIN" : { // Heroes Chronicles 7 "MAPS/CHRONICLES/HC7_MAIN" : { // Heroes Chronicles 7
"regions": "regions":
{ {
"background": "chronicles_7/CamBkHc", "background": "chronicles_7/CamBkHc",
@ -200,14 +200,14 @@
"suffix": ["1", "2", "3"], "suffix": ["1", "2", "3"],
"color_suffix_length": 0, "color_suffix_length": 0,
"desc": [ "desc": [
{ "infix": "1", "x": 27, "y": 43 }, { "infix": "1", "x": 27, "y": 43, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "2", "x": 231, "y": 43 }, { "infix": "2", "x": 231, "y": 43, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "3", "x": 27, "y": 178 }, { "infix": "3", "x": 27, "y": 178, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "4", "x": 231, "y": 178 }, { "infix": "4", "x": 231, "y": 178, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "5", "x": 27, "y": 312 }, { "infix": "5", "x": 27, "y": 312, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "6", "x": 231, "y": 312 }, { "infix": "6", "x": 231, "y": 312, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "7", "x": 27, "y": 447 }, { "infix": "7", "x": 27, "y": 447, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "8", "x": 231, "y": 447 } { "infix": "8", "x": 231, "y": 447, "labelPos": { "x": 98, "y": 112 } }
] ]
}, },
"scenarioCount": 8, "scenarioCount": 8,
@ -225,7 +225,7 @@
"videoRim": "chronicles_7/INTRORIM", "videoRim": "chronicles_7/INTRORIM",
"introVideo": "chronicles_7/Intro5" "introVideo": "chronicles_7/Intro5"
}, },
"MAPS/HC8_MAIN" : { // Heroes Chronicles 8 "MAPS/CHRONICLES/HC8_MAIN" : { // Heroes Chronicles 8
"regions": "regions":
{ {
"background": "chronicles_8/CamBkHc", "background": "chronicles_8/CamBkHc",
@ -233,14 +233,14 @@
"suffix": ["1", "2", "3"], "suffix": ["1", "2", "3"],
"color_suffix_length": 0, "color_suffix_length": 0,
"desc": [ "desc": [
{ "infix": "1", "x": 27, "y": 43 }, { "infix": "1", "x": 27, "y": 43, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "2", "x": 231, "y": 43 }, { "infix": "2", "x": 231, "y": 43, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "3", "x": 27, "y": 178 }, { "infix": "3", "x": 27, "y": 178, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "4", "x": 231, "y": 178 }, { "infix": "4", "x": 231, "y": 178, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "5", "x": 27, "y": 312 }, { "infix": "5", "x": 27, "y": 312, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "6", "x": 231, "y": 312 }, { "infix": "6", "x": 231, "y": 312, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "7", "x": 27, "y": 447 }, { "infix": "7", "x": 27, "y": 447, "labelPos": { "x": 98, "y": 112 } },
{ "infix": "8", "x": 231, "y": 447 } { "infix": "8", "x": 231, "y": 447, "labelPos": { "x": 98, "y": 112 } }
] ]
}, },
"scenarioCount": 8, "scenarioCount": 8,

View File

@ -168,7 +168,7 @@ void ChroniclesExtractor::extractFiles(int no) const
QDir outDirSprites(pathToQString(basePath / "Sprites" / chroniclesDir)); QDir outDirSprites(pathToQString(basePath / "Sprites" / chroniclesDir));
QDir outDirVideo(pathToQString(basePath / "Video" / chroniclesDir)); QDir outDirVideo(pathToQString(basePath / "Video" / chroniclesDir));
QDir outDirSounds(pathToQString(basePath / "Sounds" / chroniclesDir)); QDir outDirSounds(pathToQString(basePath / "Sounds" / chroniclesDir));
QDir outDirMaps(pathToQString(basePath / "Maps")); QDir outDirMaps(pathToQString(basePath / "Maps" / "Chronicles"));
auto extract = [](QDir scrDir, QDir dest, QString file, std::vector<std::string> files = {}){ auto extract = [](QDir scrDir, QDir dest, QString file, std::vector<std::string> files = {}){
CArchiveLoader archive("", scrDir.filePath(scrDir.entryList({file}).front()).toStdString(), false); CArchiveLoader archive("", scrDir.filePath(scrDir.entryList({file}).front()).toStdString(), false);