CBonusSelection.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. /*
  2. * CBonusSelection.cpp, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #include "StdInc.h"
  11. #include "CBonusSelection.h"
  12. #include <vcmi/spells/Spell.h>
  13. #include <vcmi/spells/Service.h>
  14. #include "CSelectionBase.h"
  15. #include "../CGameInfo.h"
  16. #include "../CMessage.h"
  17. #include "../CMusicHandler.h"
  18. #include "../CVideoHandler.h"
  19. #include "../CPlayerInterface.h"
  20. #include "../CServerHandler.h"
  21. #include "../gui/CAnimation.h"
  22. #include "../gui/CGuiHandler.h"
  23. #include "../mainmenu/CMainMenu.h"
  24. #include "../mainmenu/CPrologEpilogVideo.h"
  25. #include "../widgets/CComponent.h"
  26. #include "../widgets/Buttons.h"
  27. #include "../widgets/MiscWidgets.h"
  28. #include "../widgets/ObjectLists.h"
  29. #include "../widgets/TextControls.h"
  30. #include "../windows/GUIClasses.h"
  31. #include "../windows/InfoWindows.h"
  32. #include "../../lib/filesystem/Filesystem.h"
  33. #include "../../lib/CGeneralTextHandler.h"
  34. #include "../../lib/CBuildingHandler.h"
  35. #include "../../lib/CSkillHandler.h"
  36. #include "../../lib/CTownHandler.h"
  37. #include "../../lib/CHeroHandler.h"
  38. #include "../../lib/CCreatureHandler.h"
  39. #include "../../lib/StartInfo.h"
  40. #include "../../lib/mapping/CCampaignHandler.h"
  41. #include "../../lib/mapping/CMapService.h"
  42. #include "../../lib/mapping/CMapInfo.h"
  43. #include "../../lib/mapObjects/CGHeroInstance.h"
  44. std::shared_ptr<CCampaignState> CBonusSelection::getCampaign()
  45. {
  46. return CSH->si->campState;
  47. }
  48. CBonusSelection::CBonusSelection()
  49. : CWindowObject(BORDERED)
  50. {
  51. OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
  52. static const std::string bgNames[] =
  53. {
  54. "E1_BG.BMP", "G2_BG.BMP", "E2_BG.BMP", "G1_BG.BMP", "G3_BG.BMP", "N1_BG.BMP",
  55. "S1_BG.BMP", "BR_BG.BMP", "IS_BG.BMP", "KR_BG.BMP", "NI_BG.BMP", "TA_BG.BMP", "AR_BG.BMP", "HS_BG.BMP",
  56. "BB_BG.BMP", "NB_BG.BMP", "EL_BG.BMP", "RN_BG.BMP", "UA_BG.BMP", "SP_BG.BMP"
  57. };
  58. loadPositionsOfGraphics();
  59. setBackground(bgNames[getCampaign()->camp->header.mapVersion]);
  60. panelBackground = std::make_shared<CPicture>("CAMPBRF.BMP", 456, 6);
  61. buttonStart = std::make_shared<CButton>(Point(475, 536), "CBBEGIB.DEF", CButton::tooltip(), std::bind(&CBonusSelection::startMap, this), SDLK_RETURN);
  62. buttonRestart = std::make_shared<CButton>(Point(475, 536), "CBRESTB.DEF", CButton::tooltip(), std::bind(&CBonusSelection::restartMap, this), SDLK_RETURN);
  63. buttonBack = std::make_shared<CButton>(Point(624, 536), "CBCANCB.DEF", CButton::tooltip(), std::bind(&CBonusSelection::goBack, this), SDLK_ESCAPE);
  64. campaignName = std::make_shared<CLabel>(481, 28, FONT_BIG, ETextAlignment::TOPLEFT, Colors::YELLOW, CSH->si->getCampaignName());
  65. iconsMapSizes = std::make_shared<CAnimImage>("SCNRMPSZ", 4, 0, 735, 26);
  66. labelCampaignDescription = std::make_shared<CLabel>(481, 63, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[38]);
  67. campaignDescription = std::make_shared<CTextBox>(getCampaign()->camp->header.description, Rect(480, 86, 286, 117), 1);
  68. mapName = std::make_shared<CLabel>(481, 219, FONT_BIG, ETextAlignment::TOPLEFT, Colors::YELLOW, CSH->mi->getName());
  69. labelMapDescription = std::make_shared<CLabel>(481, 253, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[496]);
  70. mapDescription = std::make_shared<CTextBox>("", Rect(480, 280, 286, 117), 1);
  71. labelChooseBonus = std::make_shared<CLabel>(511, 432, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[71]);
  72. groupBonuses = std::make_shared<CToggleGroup>(std::bind(&IServerAPI::setCampaignBonus, CSH, _1));
  73. flagbox = std::make_shared<CFlagBox>(Rect(486, 407, 335, 23));
  74. std::vector<std::string> difficulty;
  75. boost::split(difficulty, CGI->generaltexth->allTexts[492], boost::is_any_of(" "));
  76. labelDifficulty = std::make_shared<CLabel>(689, 432, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE, difficulty.back());
  77. for(size_t b = 0; b < difficultyIcons.size(); ++b)
  78. {
  79. difficultyIcons[b] = std::make_shared<CAnimImage>("GSPBUT" + boost::lexical_cast<std::string>(b + 3) + ".DEF", 0, 0, 709, 455);
  80. }
  81. if(getCampaign()->camp->header.difficultyChoosenByPlayer)
  82. {
  83. buttonDifficultyLeft = std::make_shared<CButton>(Point(694, 508), "SCNRBLF.DEF", CButton::tooltip(), std::bind(&CBonusSelection::decreaseDifficulty, this));
  84. buttonDifficultyRight = std::make_shared<CButton>(Point(738, 508), "SCNRBRT.DEF", CButton::tooltip(), std::bind(&CBonusSelection::increaseDifficulty, this));
  85. }
  86. for(int g = 0; g < getCampaign()->camp->scenarios.size(); ++g)
  87. {
  88. if(getCampaign()->camp->conquerable(g))
  89. regions.push_back(std::make_shared<CRegion>(g, true, true, campDescriptions[getCampaign()->camp->header.mapVersion]));
  90. else if(getCampaign()->camp->scenarios[g].conquered) //display as striped
  91. regions.push_back(std::make_shared<CRegion>(g, false, false, campDescriptions[getCampaign()->camp->header.mapVersion]));
  92. }
  93. }
  94. void CBonusSelection::loadPositionsOfGraphics()
  95. {
  96. const JsonNode config(ResourceID("config/campaign_regions.json"));
  97. int idx = 0;
  98. for(const JsonNode & campaign : config["campaign_regions"].Vector())
  99. {
  100. SCampPositions sc;
  101. sc.campPrefix = campaign["prefix"].String();
  102. sc.colorSuffixLength = static_cast<int>(campaign["color_suffix_length"].Float());
  103. for(const JsonNode & desc : campaign["desc"].Vector())
  104. {
  105. SCampPositions::SRegionDesc rd;
  106. rd.infix = desc["infix"].String();
  107. rd.xpos = static_cast<int>(desc["x"].Float());
  108. rd.ypos = static_cast<int>(desc["y"].Float());
  109. sc.regions.push_back(rd);
  110. }
  111. campDescriptions.push_back(sc);
  112. idx++;
  113. }
  114. }
  115. void CBonusSelection::createBonusesIcons()
  116. {
  117. OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
  118. const CCampaignScenario & scenario = getCampaign()->camp->scenarios[CSH->campaignMap];
  119. const std::vector<CScenarioTravel::STravelBonus> & bonDescs = scenario.travelOptions.bonusesToChoose;
  120. groupBonuses = std::make_shared<CToggleGroup>(std::bind(&IServerAPI::setCampaignBonus, CSH, _1));
  121. static const char * bonusPics[] =
  122. {
  123. "SPELLBON.DEF", // Spell
  124. "TWCRPORT.DEF", // Monster
  125. "", // Building - BO*.BMP
  126. "ARTIFBON.DEF", // Artifact
  127. "SPELLBON.DEF", // Spell scroll
  128. "PSKILBON.DEF", // Primary skill
  129. "SSKILBON.DEF", // Secondary skill
  130. "BORES.DEF", // Resource
  131. "PORTRAITSLARGE", // Hero HPL*.BMP
  132. "PORTRAITSLARGE"
  133. // Player - CREST58.DEF
  134. };
  135. for(int i = 0; i < bonDescs.size(); i++)
  136. {
  137. std::string picName = bonusPics[bonDescs[i].type];
  138. size_t picNumber = bonDescs[i].info2;
  139. std::string desc;
  140. switch(bonDescs[i].type)
  141. {
  142. case CScenarioTravel::STravelBonus::SPELL:
  143. desc = CGI->generaltexth->allTexts[715];
  144. boost::algorithm::replace_first(desc, "%s", CGI->spells()->getByIndex(bonDescs[i].info2)->getName());
  145. break;
  146. case CScenarioTravel::STravelBonus::MONSTER:
  147. picNumber = bonDescs[i].info2 + 2;
  148. desc = CGI->generaltexth->allTexts[717];
  149. boost::algorithm::replace_first(desc, "%d", boost::lexical_cast<std::string>(bonDescs[i].info3));
  150. boost::algorithm::replace_first(desc, "%s", CGI->creatures()->getByIndex(bonDescs[i].info2)->getPluralName());
  151. break;
  152. case CScenarioTravel::STravelBonus::BUILDING:
  153. {
  154. int faction = -1;
  155. for(auto & elem : CSH->si->playerInfos)
  156. {
  157. if(elem.second.isControlledByHuman())
  158. {
  159. faction = elem.second.castle;
  160. break;
  161. }
  162. }
  163. assert(faction != -1);
  164. BuildingID buildID = CBuildingHandler::campToERMU(bonDescs[i].info1, faction, std::set<BuildingID>());
  165. picName = graphics->ERMUtoPicture[faction][buildID];
  166. picNumber = -1;
  167. if(vstd::contains((*CGI->townh)[faction]->town->buildings, buildID))
  168. desc = (*CGI->townh)[faction]->town->buildings.find(buildID)->second->Name();
  169. break;
  170. }
  171. case CScenarioTravel::STravelBonus::ARTIFACT:
  172. desc = CGI->generaltexth->allTexts[715];
  173. boost::algorithm::replace_first(desc, "%s", CGI->artifacts()->getByIndex(bonDescs[i].info2)->getName());
  174. break;
  175. case CScenarioTravel::STravelBonus::SPELL_SCROLL:
  176. desc = CGI->generaltexth->allTexts[716];
  177. boost::algorithm::replace_first(desc, "%s", CGI->spells()->getByIndex(bonDescs[i].info2)->getName());
  178. break;
  179. case CScenarioTravel::STravelBonus::PRIMARY_SKILL:
  180. {
  181. int leadingSkill = -1;
  182. std::vector<std::pair<int, int>> toPrint; //primary skills to be listed <num, val>
  183. const ui8 * ptr = reinterpret_cast<const ui8 *>(&bonDescs[i].info2);
  184. for(int g = 0; g < GameConstants::PRIMARY_SKILLS; ++g)
  185. {
  186. if(leadingSkill == -1 || ptr[g] > ptr[leadingSkill])
  187. {
  188. leadingSkill = g;
  189. }
  190. if(ptr[g] != 0)
  191. {
  192. toPrint.push_back(std::make_pair(g, ptr[g]));
  193. }
  194. }
  195. picNumber = leadingSkill;
  196. desc = CGI->generaltexth->allTexts[715];
  197. std::string substitute; //text to be printed instead of %s
  198. for(int v = 0; v < toPrint.size(); ++v)
  199. {
  200. substitute += boost::lexical_cast<std::string>(toPrint[v].second);
  201. substitute += " " + CGI->generaltexth->primarySkillNames[toPrint[v].first];
  202. if(v != toPrint.size() - 1)
  203. {
  204. substitute += ", ";
  205. }
  206. }
  207. boost::algorithm::replace_first(desc, "%s", substitute);
  208. break;
  209. }
  210. case CScenarioTravel::STravelBonus::SECONDARY_SKILL:
  211. desc = CGI->generaltexth->allTexts[718];
  212. boost::algorithm::replace_first(desc, "%s", CGI->generaltexth->levels[bonDescs[i].info3 - 1]); //skill level
  213. boost::algorithm::replace_first(desc, "%s", CGI->skillh->skillName(bonDescs[i].info2)); //skill name
  214. picNumber = bonDescs[i].info2 * 3 + bonDescs[i].info3 - 1;
  215. break;
  216. case CScenarioTravel::STravelBonus::RESOURCE:
  217. {
  218. int serialResID = 0;
  219. switch(bonDescs[i].info1)
  220. {
  221. case 0:
  222. case 1:
  223. case 2:
  224. case 3:
  225. case 4:
  226. case 5:
  227. case 6:
  228. serialResID = bonDescs[i].info1;
  229. break;
  230. case 0xFD: //wood + ore
  231. serialResID = 7;
  232. break;
  233. case 0xFE: //rare resources
  234. serialResID = 8;
  235. break;
  236. }
  237. picNumber = serialResID;
  238. desc = CGI->generaltexth->allTexts[717];
  239. boost::algorithm::replace_first(desc, "%d", boost::lexical_cast<std::string>(bonDescs[i].info2));
  240. std::string replacement;
  241. if(serialResID <= 6)
  242. {
  243. replacement = CGI->generaltexth->restypes[serialResID];
  244. }
  245. else
  246. {
  247. replacement = CGI->generaltexth->allTexts[714 + serialResID];
  248. }
  249. boost::algorithm::replace_first(desc, "%s", replacement);
  250. break;
  251. }
  252. case CScenarioTravel::STravelBonus::HEROES_FROM_PREVIOUS_SCENARIO:
  253. {
  254. auto superhero = getCampaign()->camp->scenarios[bonDescs[i].info2].strongestHero(PlayerColor(bonDescs[i].info1));
  255. if(!superhero)
  256. logGlobal->warn("No superhero! How could it be transferred?");
  257. picNumber = superhero ? superhero->portrait : 0;
  258. desc = CGI->generaltexth->allTexts[719];
  259. boost::algorithm::replace_first(desc, "%s", getCampaign()->camp->scenarios[bonDescs[i].info2].scenarioName);
  260. break;
  261. }
  262. case CScenarioTravel::STravelBonus::HERO:
  263. desc = CGI->generaltexth->allTexts[718];
  264. boost::algorithm::replace_first(desc, "%s", CGI->generaltexth->capColors[bonDescs[i].info1]); //hero's color
  265. if(bonDescs[i].info2 == 0xFFFF)
  266. {
  267. boost::algorithm::replace_first(desc, "%s", CGI->generaltexth->allTexts[101]); //hero's name
  268. picNumber = -1;
  269. picName = "CBONN1A3.BMP";
  270. }
  271. else
  272. {
  273. boost::algorithm::replace_first(desc, "%s", CGI->heroh->objects[bonDescs[i].info2]->name);
  274. }
  275. break;
  276. }
  277. std::shared_ptr<CToggleButton> bonusButton = std::make_shared<CToggleButton>(Point(475 + i * 68, 455), "", CButton::tooltip(desc, desc));
  278. if(picNumber != -1)
  279. picName += ":" + boost::lexical_cast<std::string>(picNumber);
  280. auto anim = std::make_shared<CAnimation>();
  281. anim->setCustom(picName, 0);
  282. bonusButton->setImage(anim);
  283. if(CSH->campaignBonus == i)
  284. bonusButton->setBorderColor(Colors::BRIGHT_YELLOW);
  285. groupBonuses->addToggle(i, bonusButton);
  286. }
  287. if(vstd::contains(getCampaign()->chosenCampaignBonuses, CSH->campaignMap))
  288. {
  289. groupBonuses->setSelected(getCampaign()->chosenCampaignBonuses[CSH->campaignMap]);
  290. }
  291. }
  292. void CBonusSelection::updateAfterStateChange()
  293. {
  294. if(CSH->state != EClientState::GAMEPLAY)
  295. {
  296. buttonRestart->disable();
  297. buttonStart->enable();
  298. if(!getCampaign()->mapsConquered.empty())
  299. buttonBack->block(true);
  300. else
  301. buttonBack->block(false);
  302. }
  303. else
  304. {
  305. buttonStart->disable();
  306. buttonRestart->enable();
  307. buttonBack->block(false);
  308. if(buttonDifficultyLeft)
  309. buttonDifficultyLeft->disable();
  310. if(buttonDifficultyRight)
  311. buttonDifficultyRight->disable();
  312. }
  313. if(CSH->campaignBonus == -1)
  314. {
  315. buttonStart->block(getCampaign()->camp->scenarios[CSH->campaignMap].travelOptions.bonusesToChoose.size());
  316. }
  317. else if(buttonStart->isBlocked())
  318. {
  319. buttonStart->block(false);
  320. }
  321. for(auto region : regions)
  322. region->updateState();
  323. if(!CSH->mi)
  324. return;
  325. iconsMapSizes->setFrame(CSH->mi->getMapSizeIconId());
  326. mapDescription->setText(CSH->mi->getDescription());
  327. for(size_t i = 0; i < difficultyIcons.size(); i++)
  328. {
  329. if(i == CSH->si->difficulty)
  330. difficultyIcons[i]->enable();
  331. else
  332. difficultyIcons[i]->disable();
  333. }
  334. flagbox->recreate();
  335. createBonusesIcons();
  336. }
  337. void CBonusSelection::goBack()
  338. {
  339. if(CSH->state != EClientState::GAMEPLAY)
  340. {
  341. GH.popInts(2);
  342. }
  343. else
  344. {
  345. close();
  346. }
  347. // TODO: we can actually only pop bonus selection interface for custom campaigns
  348. // Though this would require clearing CLobbyScreen::bonusSel pointer when poping this interface
  349. /*
  350. else
  351. {
  352. close();
  353. CSH->state = EClientState::LOBBY;
  354. }
  355. */
  356. }
  357. void CBonusSelection::startMap()
  358. {
  359. auto showPrologVideo = [=]()
  360. {
  361. auto exitCb = [=]()
  362. {
  363. logGlobal->info("Starting scenario %d", CSH->campaignMap);
  364. CSH->sendStartGame();
  365. };
  366. const CCampaignScenario & scenario = getCampaign()->camp->scenarios[CSH->campaignMap];
  367. if(scenario.prolog.hasPrologEpilog)
  368. {
  369. GH.pushIntT<CPrologEpilogVideo>(scenario.prolog, exitCb);
  370. }
  371. else
  372. {
  373. exitCb();
  374. }
  375. };
  376. //block buttons immediately
  377. buttonStart->block(true);
  378. buttonRestart->block(true);
  379. buttonBack->block(true);
  380. if(LOCPLINT) // we're currently ingame, so ask for starting new map and end game
  381. {
  382. close();
  383. LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[67], [=]()
  384. {
  385. showPrologVideo();
  386. }, 0);
  387. }
  388. else
  389. {
  390. showPrologVideo();
  391. }
  392. }
  393. void CBonusSelection::restartMap()
  394. {
  395. close();
  396. LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[67], [=]()
  397. {
  398. LOCPLINT->sendCustomEvent(EUserEvent::RESTART_GAME);
  399. }, 0);
  400. }
  401. void CBonusSelection::increaseDifficulty()
  402. {
  403. CSH->setDifficulty(CSH->si->difficulty + 1);
  404. }
  405. void CBonusSelection::decreaseDifficulty()
  406. {
  407. // avoid negative overflow (0 - 1 = 255)
  408. if (CSH->si->difficulty > 0)
  409. CSH->setDifficulty(CSH->si->difficulty - 1);
  410. }
  411. CBonusSelection::CRegion::CRegion(int id, bool accessible, bool selectable, const SCampPositions & campDsc)
  412. : CIntObject(LCLICK | RCLICK), idOfMapAndRegion(id), accessible(accessible), selectable(selectable)
  413. {
  414. OBJ_CONSTRUCTION;
  415. static const std::string colors[2][8] =
  416. {
  417. {"R", "B", "N", "G", "O", "V", "T", "P"},
  418. {"Re", "Bl", "Br", "Gr", "Or", "Vi", "Te", "Pi"}
  419. };
  420. const SCampPositions::SRegionDesc & desc = campDsc.regions[idOfMapAndRegion];
  421. pos.x += desc.xpos;
  422. pos.y += desc.ypos;
  423. std::string prefix = campDsc.campPrefix + desc.infix + "_";
  424. std::string suffix = colors[campDsc.colorSuffixLength - 1][CSH->si->campState->camp->scenarios[idOfMapAndRegion].regionColor];
  425. graphicsNotSelected = std::make_shared<CPicture>(prefix + "En" + suffix + ".BMP");
  426. graphicsNotSelected->disable();
  427. graphicsSelected = std::make_shared<CPicture>(prefix + "Se" + suffix + ".BMP");
  428. graphicsSelected->disable();
  429. graphicsStriped = std::make_shared<CPicture>(prefix + "Co" + suffix + ".BMP");
  430. graphicsStriped->disable();
  431. pos.w = graphicsNotSelected->bg->w;
  432. pos.h = graphicsNotSelected->bg->h;
  433. }
  434. void CBonusSelection::CRegion::updateState()
  435. {
  436. if(!accessible)
  437. {
  438. graphicsNotSelected->disable();
  439. graphicsSelected->disable();
  440. graphicsStriped->enable();
  441. }
  442. else if(CSH->campaignMap == idOfMapAndRegion)
  443. {
  444. graphicsNotSelected->disable();
  445. graphicsSelected->enable();
  446. graphicsStriped->disable();
  447. }
  448. else
  449. {
  450. graphicsNotSelected->enable();
  451. graphicsSelected->disable();
  452. graphicsStriped->disable();
  453. }
  454. }
  455. void CBonusSelection::CRegion::clickLeft(tribool down, bool previousState)
  456. {
  457. //select if selectable & clicked inside our graphic
  458. if(indeterminate(down))
  459. return;
  460. if(!down && selectable && !CSDL_Ext::isTransparent(graphicsNotSelected->getSurface(), GH.current->motion.x - pos.x, GH.current->motion.y - pos.y))
  461. {
  462. CSH->setCampaignMap(idOfMapAndRegion);
  463. }
  464. }
  465. void CBonusSelection::CRegion::clickRight(tribool down, bool previousState)
  466. {
  467. // FIXME: For some reason "down" is only ever contain indeterminate_value
  468. auto text = CSH->si->campState->camp->scenarios[idOfMapAndRegion].regionText;
  469. if(!CSDL_Ext::isTransparent(graphicsNotSelected->getSurface(), GH.current->motion.x - pos.x, GH.current->motion.y - pos.y) && text.size())
  470. {
  471. CRClickPopup::createAndPush(text);
  472. }
  473. }