CWindowWithArtifacts.cpp 17 KB

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