CWindowWithArtifacts.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. /*
  2. * CWindowWithArtifacts.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 "CWindowWithArtifacts.h"
  12. #include "../gui/CGuiHandler.h"
  13. #include "../gui/CursorHandler.h"
  14. #include "../gui/WindowHandler.h"
  15. #include "../render/IRenderHandler.h"
  16. #include "../render/CAnimation.h"
  17. #include "../render/IImage.h"
  18. #include "../widgets/CComponent.h"
  19. #include "../windows/CHeroWindow.h"
  20. #include "../windows/CSpellWindow.h"
  21. #include "../windows/GUIClasses.h"
  22. #include "../windows/CHeroBackpackWindow.h"
  23. #include "../CPlayerInterface.h"
  24. #include "../CGameInfo.h"
  25. #include "../../lib/ArtifactUtils.h"
  26. #include "../../lib/CGeneralTextHandler.h"
  27. #include "../../lib/mapObjects/CGHeroInstance.h"
  28. #include "../../lib/networkPacks/ArtifactLocation.h"
  29. #include "../../lib/CConfigHandler.h"
  30. #include "../../CCallback.h"
  31. CWindowWithArtifacts::CWindowWithArtifacts(const std::vector<CArtifactsOfHeroPtr> * artSets)
  32. {
  33. if(artSets)
  34. this->artSets.insert(this->artSets.end(), artSets->begin(), artSets->end());
  35. }
  36. void CWindowWithArtifacts::addSet(CArtifactsOfHeroPtr newArtSet)
  37. {
  38. artSets.emplace_back(newArtSet);
  39. }
  40. void CWindowWithArtifacts::addSetAndCallbacks(CArtifactsOfHeroPtr newArtSet)
  41. {
  42. addSet(newArtSet);
  43. std::visit([this](auto artSetWeak)
  44. {
  45. auto artSet = artSetWeak.lock();
  46. artSet->clickPressedCallback = std::bind(&CWindowWithArtifacts::clickPressedArtPlaceHero, this, _1, _2, _3);
  47. artSet->showPopupCallback = std::bind(&CWindowWithArtifacts::showPopupArtPlaceHero, this, _1, _2, _3);
  48. artSet->gestureCallback = std::bind(&CWindowWithArtifacts::gestureArtPlaceHero, this, _1, _2, _3);
  49. }, newArtSet);
  50. }
  51. void CWindowWithArtifacts::addCloseCallback(const CloseCallback & callback)
  52. {
  53. closeCallback = callback;
  54. }
  55. const CGHeroInstance * CWindowWithArtifacts::getHeroPickedArtifact()
  56. {
  57. auto res = getState();
  58. if(res.has_value())
  59. return std::get<const CGHeroInstance*>(res.value());
  60. else
  61. return nullptr;
  62. }
  63. const CArtifactInstance * CWindowWithArtifacts::getPickedArtifact()
  64. {
  65. auto res = getState();
  66. if(res.has_value())
  67. return std::get<const CArtifactInstance*>(res.value());
  68. else
  69. return nullptr;
  70. }
  71. void CWindowWithArtifacts::clickPressedArtPlaceHero(const CArtifactsOfHeroBase & artsInst, CArtPlace & artPlace, const Point & cursorPosition)
  72. {
  73. const auto currentArtSet = findAOHbyRef(artsInst);
  74. assert(currentArtSet.has_value());
  75. if(artPlace.isLocked())
  76. return;
  77. std::visit(
  78. [this, &artPlace](auto artSetWeak) -> void
  79. {
  80. const auto artSetPtr = artSetWeak.lock();
  81. // Hero(Main, Exchange) window, Kingdom window, Altar window, Backpack window left click handler
  82. if constexpr(
  83. std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroMain>> ||
  84. std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroKingdom>> ||
  85. std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroAltar>> ||
  86. std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroBackpack>>)
  87. {
  88. const auto pickedArtInst = getPickedArtifact();
  89. const auto heroPickedArt = getHeroPickedArtifact();
  90. const auto hero = artSetPtr->getHero();
  91. auto isTransferAllowed = false;
  92. std::string msg;
  93. if(pickedArtInst)
  94. {
  95. auto srcLoc = ArtifactLocation(heroPickedArt->id, ArtifactPosition::TRANSITION_POS);
  96. auto dstLoc = ArtifactLocation(hero->id, artPlace.slot);
  97. if(ArtifactUtils::isSlotBackpack(artPlace.slot))
  98. {
  99. if(pickedArtInst->artType->isBig())
  100. {
  101. // War machines cannot go to backpack
  102. msg = boost::str(boost::format(CGI->generaltexth->allTexts[153]) % pickedArtInst->artType->getNameTranslated());
  103. }
  104. else
  105. {
  106. if(ArtifactUtils::isBackpackFreeSlots(heroPickedArt))
  107. isTransferAllowed = true;
  108. else
  109. msg = CGI->generaltexth->translate("core.genrltxt.152");
  110. }
  111. }
  112. // Check if artifact transfer is possible
  113. else if(pickedArtInst->canBePutAt(hero, artPlace.slot, true) && (!artPlace.getArt() || hero->tempOwner == LOCPLINT->playerID))
  114. {
  115. isTransferAllowed = true;
  116. }
  117. if constexpr(std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroKingdom>>)
  118. {
  119. if(hero != heroPickedArt)
  120. isTransferAllowed = false;
  121. }
  122. if(isTransferAllowed)
  123. LOCPLINT->cb->swapArtifacts(srcLoc, dstLoc);
  124. }
  125. else if(auto art = artPlace.getArt())
  126. {
  127. if(artSetPtr->getHero()->getOwner() == LOCPLINT->playerID)
  128. {
  129. if(checkSpecialArts(*art, hero, std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroAltar>> ? true : false))
  130. {
  131. assert(artSetPtr->getHero()->getSlotByInstance(art) != ArtifactPosition::PRE_FIRST);
  132. if(GH.isKeyboardCtrlDown())
  133. {
  134. std::shared_ptr<CArtifactsOfHeroMain> anotherHeroEquipmentPointer = nullptr;
  135. for(auto set : artSets)
  136. {
  137. if(std::holds_alternative<std::weak_ptr<CArtifactsOfHeroMain>>(set))
  138. {
  139. std::shared_ptr<CArtifactsOfHeroMain> heroEquipmentPointer = std::get<std::weak_ptr<CArtifactsOfHeroMain>>(set).lock();
  140. if(heroEquipmentPointer->getHero()->id != artSetPtr->getHero()->id)
  141. {
  142. anotherHeroEquipmentPointer = heroEquipmentPointer;
  143. break;
  144. }
  145. }
  146. }
  147. if(anotherHeroEquipmentPointer != nullptr)
  148. {
  149. ArtifactPosition availablePosition = ArtifactUtils::getArtAnyPosition(anotherHeroEquipmentPointer->getHero(), art->getTypeId());
  150. if(availablePosition != ArtifactPosition::PRE_FIRST)
  151. {
  152. LOCPLINT->cb->swapArtifacts(ArtifactLocation(artSetPtr->getHero()->id, artSetPtr->getHero()->getSlotByInstance(art)),
  153. ArtifactLocation(anotherHeroEquipmentPointer->getHero()->id, availablePosition));
  154. }
  155. }
  156. }
  157. else if(GH.isKeyboardAltDown())
  158. {
  159. ArtifactPosition destinationPosition = ArtifactPosition::PRE_FIRST;
  160. if(ArtifactUtils::isSlotEquipment(artPlace.slot))
  161. {
  162. ArtifactPosition availablePosition = ArtifactUtils::getArtBackpackPosition(artSetPtr->getHero(), art->getTypeId());
  163. if(availablePosition != ArtifactPosition::PRE_FIRST)
  164. {
  165. destinationPosition = availablePosition;
  166. }
  167. }
  168. else if(ArtifactUtils::isSlotBackpack(artPlace.slot))
  169. {
  170. ArtifactPosition availablePosition = ArtifactUtils::getArtAnyPosition(artSetPtr->getHero(), art->getTypeId());
  171. if(availablePosition != ArtifactPosition::PRE_FIRST && availablePosition != ArtifactPosition::BACKPACK_START)
  172. {
  173. destinationPosition = availablePosition;
  174. }
  175. }
  176. if(destinationPosition != ArtifactPosition::PRE_FIRST)
  177. {
  178. LOCPLINT->cb->swapArtifacts(ArtifactLocation(artSetPtr->getHero()->id, artPlace.slot),
  179. ArtifactLocation(artSetPtr->getHero()->id, destinationPosition));
  180. }
  181. }
  182. else
  183. {
  184. LOCPLINT->cb->swapArtifacts(ArtifactLocation(artSetPtr->getHero()->id, artPlace.slot),
  185. ArtifactLocation(artSetPtr->getHero()->id, ArtifactPosition::TRANSITION_POS));
  186. }
  187. }
  188. }
  189. else
  190. {
  191. for(const auto artSlot : ArtifactUtils::unmovableSlots())
  192. if(artPlace.slot == artSlot)
  193. {
  194. msg = CGI->generaltexth->allTexts[21];
  195. break;
  196. }
  197. }
  198. }
  199. if constexpr(std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroBackpack>>)
  200. {
  201. if(!isTransferAllowed && artPlace.getArt() && closeCallback)
  202. closeCallback();
  203. }
  204. else
  205. {
  206. if(!msg.empty())
  207. LOCPLINT->showInfoDialog(msg);
  208. }
  209. }
  210. // Market window left click handler
  211. else if constexpr(std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroMarket>>)
  212. {
  213. if(artSetPtr->selectArtCallback && artPlace.getArt())
  214. {
  215. if(artPlace.getArt()->artType->isTradable())
  216. {
  217. artSetPtr->unmarkSlots();
  218. artPlace.selectSlot(true);
  219. artSetPtr->selectArtCallback(&artPlace);
  220. }
  221. else
  222. {
  223. // This item can't be traded
  224. LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[21]);
  225. }
  226. }
  227. }
  228. else if constexpr(std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroQuickBackpack>>)
  229. {
  230. const auto hero = artSetPtr->getHero();
  231. LOCPLINT->cb->swapArtifacts(ArtifactLocation(hero->id, artPlace.slot), ArtifactLocation(hero->id, artSetPtr->getFilterSlot()));
  232. if(closeCallback)
  233. closeCallback();
  234. }
  235. }, currentArtSet.value());
  236. }
  237. void CWindowWithArtifacts::showPopupArtPlaceHero(const CArtifactsOfHeroBase & artsInst, CArtPlace & artPlace, const Point & cursorPosition)
  238. {
  239. const auto currentArtSet = findAOHbyRef(artsInst);
  240. assert(currentArtSet.has_value());
  241. if(artPlace.isLocked())
  242. return;
  243. std::visit(
  244. [&artPlace, &cursorPosition](auto artSetWeak) -> void
  245. {
  246. const auto artSetPtr = artSetWeak.lock();
  247. // Hero (Main, Exchange) window, Kingdom window, Backpack window right click handler
  248. if constexpr(
  249. std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroAltar>> ||
  250. std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroMain>> ||
  251. std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroKingdom>> ||
  252. std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroBackpack>>)
  253. {
  254. if(artPlace.getArt())
  255. {
  256. if(ArtifactUtilsClient::askToDisassemble(artSetPtr->getHero(), artPlace.slot))
  257. {
  258. return;
  259. }
  260. if(ArtifactUtilsClient::askToAssemble(artSetPtr->getHero(), artPlace.slot))
  261. {
  262. return;
  263. }
  264. if(artPlace.text.size())
  265. artPlace.LRClickableAreaWTextComp::showPopupWindow(cursorPosition);
  266. }
  267. }
  268. // Altar window, Market window right click handler
  269. else if constexpr(
  270. std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroMarket>> ||
  271. std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroQuickBackpack>>)
  272. {
  273. if(artPlace.getArt() && artPlace.text.size())
  274. artPlace.LRClickableAreaWTextComp::showPopupWindow(cursorPosition);
  275. }
  276. }, currentArtSet.value());
  277. }
  278. void CWindowWithArtifacts::gestureArtPlaceHero(const CArtifactsOfHeroBase & artsInst, CArtPlace & artPlace, const Point & cursorPosition)
  279. {
  280. const auto currentArtSet = findAOHbyRef(artsInst);
  281. assert(currentArtSet.has_value());
  282. if(artPlace.isLocked())
  283. return;
  284. std::visit(
  285. [&artPlace, cursorPosition](auto artSetWeak) -> void
  286. {
  287. const auto artSetPtr = artSetWeak.lock();
  288. if constexpr(
  289. std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroMain>> ||
  290. std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroKingdom>>)
  291. {
  292. if(!settings["general"]["enableUiEnhancements"].Bool())
  293. return;
  294. GH.windows().createAndPushWindow<CHeroQuickBackpackWindow>(artSetPtr->getHero(), artPlace.slot);
  295. auto backpackWindow = GH.windows().topWindow<CHeroQuickBackpackWindow>();
  296. backpackWindow->moveTo(cursorPosition - Point(1, 1));
  297. backpackWindow->fitToScreen(15);
  298. }
  299. }, currentArtSet.value());
  300. }
  301. void CWindowWithArtifacts::activate()
  302. {
  303. if(const auto art = getPickedArtifact())
  304. setCursorAnimation(*art);
  305. CWindowObject::activate();
  306. }
  307. void CWindowWithArtifacts::deactivate()
  308. {
  309. CCS->curh->dragAndDropCursor(nullptr);
  310. CWindowObject::deactivate();
  311. }
  312. void CWindowWithArtifacts::enableArtifactsCostumeSwitcher() const
  313. {
  314. for(auto artSet : artSets)
  315. std::visit(
  316. [](auto artSetWeak)
  317. {
  318. if constexpr(std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroMain>>)
  319. {
  320. const auto artSetPtr = artSetWeak.lock();
  321. artSetPtr->enableArtifactsCostumeSwitcher();
  322. }
  323. }, artSet);
  324. }
  325. void CWindowWithArtifacts::artifactRemoved(const ArtifactLocation & artLoc)
  326. {
  327. update();
  328. }
  329. void CWindowWithArtifacts::artifactMoved(const ArtifactLocation & srcLoc, const ArtifactLocation & destLoc, bool withRedraw)
  330. {
  331. auto curState = getState();
  332. if(!curState.has_value())
  333. // Transition state. Nothing to do here. Just skip. Need to wait for final state.
  334. return;
  335. auto pickedArtInst = std::get<const CArtifactInstance*>(curState.value());
  336. auto artifactMovedBody = [this, withRedraw, &destLoc, &pickedArtInst](auto artSetWeak) -> void
  337. {
  338. auto artSetPtr = artSetWeak.lock();
  339. if(artSetPtr)
  340. {
  341. const auto hero = artSetPtr->getHero();
  342. if(pickedArtInst)
  343. {
  344. setCursorAnimation(*pickedArtInst);
  345. }
  346. else
  347. {
  348. artSetPtr->unmarkSlots();
  349. CCS->curh->dragAndDropCursor(nullptr);
  350. }
  351. if(withRedraw)
  352. {
  353. artSetPtr->updateWornSlots();
  354. artSetPtr->updateBackpackSlots();
  355. // Update arts bonuses on window.
  356. // TODO rework this part when CHeroWindow and CExchangeWindow are reworked
  357. if(auto * chw = dynamic_cast<CHeroWindow*>(this))
  358. {
  359. chw->update(hero, true);
  360. }
  361. else if(auto * cew = dynamic_cast<CExchangeWindow*>(this))
  362. {
  363. cew->updateWidgets();
  364. }
  365. artSetPtr->redraw();
  366. }
  367. // Make sure the status bar is updated so it does not display old text
  368. if(destLoc.artHolder == hero->id)
  369. {
  370. if(auto artPlace = artSetPtr->getArtPlace(destLoc.slot))
  371. artPlace->hover(true);
  372. }
  373. }
  374. };
  375. for(auto artSetWeak : artSets)
  376. std::visit(artifactMovedBody, artSetWeak);
  377. }
  378. void CWindowWithArtifacts::artifactDisassembled(const ArtifactLocation & artLoc)
  379. {
  380. update();
  381. }
  382. void CWindowWithArtifacts::artifactAssembled(const ArtifactLocation & artLoc)
  383. {
  384. markPossibleSlots();
  385. update();
  386. }
  387. void CWindowWithArtifacts::update() const
  388. {
  389. auto updateSlotBody = [](auto artSetWeak) -> void
  390. {
  391. if(const auto artSetPtr = artSetWeak.lock())
  392. {
  393. artSetPtr->updateWornSlots();
  394. artSetPtr->updateBackpackSlots();
  395. artSetPtr->redraw();
  396. }
  397. };
  398. for(auto artSetWeak : artSets)
  399. std::visit(updateSlotBody, artSetWeak);
  400. }
  401. std::optional<std::tuple<const CGHeroInstance*, const CArtifactInstance*>> CWindowWithArtifacts::getState()
  402. {
  403. const CArtifactInstance * artInst = nullptr;
  404. std::map<const CGHeroInstance*, size_t> pickedCnt;
  405. auto getHeroArtBody = [&artInst, &pickedCnt](auto artSetWeak) -> void
  406. {
  407. auto artSetPtr = artSetWeak.lock();
  408. if(artSetPtr)
  409. {
  410. if(const auto art = artSetPtr->getPickedArtifact())
  411. {
  412. const auto hero = artSetPtr->getHero();
  413. if(pickedCnt.count(hero) == 0)
  414. {
  415. pickedCnt.insert({ hero, hero->artifactsTransitionPos.size() });
  416. artInst = art;
  417. }
  418. }
  419. }
  420. };
  421. for(auto artSetWeak : artSets)
  422. std::visit(getHeroArtBody, artSetWeak);
  423. // The state is possible when the hero has placed an artifact in the ArtifactPosition::TRANSITION_POS,
  424. // and the previous artifact has not yet removed from the ArtifactPosition::TRANSITION_POS.
  425. // This is a transitional state. Then return nullopt.
  426. if(std::accumulate(std::begin(pickedCnt), std::end(pickedCnt), 0, [](size_t accum, const auto & value)
  427. {
  428. return accum + value.second;
  429. }) > 1)
  430. return std::nullopt;
  431. else
  432. return std::make_tuple(pickedCnt.begin()->first, artInst);
  433. }
  434. std::optional<CWindowWithArtifacts::CArtifactsOfHeroPtr> CWindowWithArtifacts::findAOHbyRef(const CArtifactsOfHeroBase & artsInst)
  435. {
  436. std::optional<CArtifactsOfHeroPtr> res;
  437. auto findAOHBody = [&res, &artsInst](auto & artSetWeak) -> void
  438. {
  439. if(&artsInst == artSetWeak.lock().get())
  440. res = artSetWeak;
  441. };
  442. for(auto artSetWeak : artSets)
  443. {
  444. std::visit(findAOHBody, artSetWeak);
  445. if(res.has_value())
  446. return res;
  447. }
  448. return res;
  449. }
  450. void CWindowWithArtifacts::markPossibleSlots()
  451. {
  452. if(const auto pickedArtInst = getPickedArtifact())
  453. {
  454. const auto heroArtOwner = getHeroPickedArtifact();
  455. auto artifactAssembledBody = [&pickedArtInst, &heroArtOwner](auto artSetWeak) -> void
  456. {
  457. if(auto artSetPtr = artSetWeak.lock())
  458. {
  459. if(artSetPtr->isActive())
  460. {
  461. const auto hero = artSetPtr->getHero();
  462. if(heroArtOwner == hero || !std::is_same_v<decltype(artSetWeak), std::weak_ptr<CArtifactsOfHeroKingdom>>)
  463. artSetPtr->markPossibleSlots(pickedArtInst, hero->tempOwner == LOCPLINT->playerID);
  464. }
  465. }
  466. };
  467. for(auto artSetWeak : artSets)
  468. std::visit(artifactAssembledBody, artSetWeak);
  469. }
  470. }
  471. bool CWindowWithArtifacts::checkSpecialArts(const CArtifactInstance & artInst, const CGHeroInstance * hero, bool isTrade) const
  472. {
  473. const auto artId = artInst.getTypeId();
  474. if(artId == ArtifactID::SPELLBOOK)
  475. {
  476. GH.windows().createAndPushWindow<CSpellWindow>(hero, LOCPLINT, LOCPLINT->battleInt.get());
  477. return false;
  478. }
  479. if(artId == ArtifactID::CATAPULT)
  480. {
  481. // The Catapult must be equipped
  482. LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[312],
  483. std::vector<std::shared_ptr<CComponent>>(1, std::make_shared<CComponent>(ComponentType::ARTIFACT, ArtifactID(ArtifactID::CATAPULT))));
  484. return false;
  485. }
  486. if(isTrade && !artInst.artType->isTradable())
  487. {
  488. LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[21],
  489. std::vector<std::shared_ptr<CComponent>>(1, std::make_shared<CComponent>(ComponentType::ARTIFACT, artId)));
  490. return false;
  491. }
  492. return true;
  493. }
  494. void CWindowWithArtifacts::setCursorAnimation(const CArtifactInstance & artInst)
  495. {
  496. markPossibleSlots();
  497. if(artInst.isScroll() && settings["general"]["enableUiEnhancements"].Bool())
  498. {
  499. assert(artInst.getScrollSpellID().num >= 0);
  500. const auto animation = GH.renderHandler().loadAnimation(AnimationPath::builtin("spellscr"));
  501. animation->load(artInst.getScrollSpellID().num);
  502. CCS->curh->dragAndDropCursor(animation->getImage(artInst.getScrollSpellID().num)->scaleFast(Point(44, 34)));
  503. }
  504. else
  505. {
  506. CCS->curh->dragAndDropCursor(AnimationPath::builtin("artifact"), artInst.artType->getIconIndex());
  507. }
  508. }