MCPcopy Create free account
hub / github.com/TurningWheel/Barony / warpMouseToSelectedShopItem

Method warpMouseToSelectedShopItem

src/player.cpp:5706–5738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5704}
5705
5706bool Player::ShopGUI_t::warpMouseToSelectedShopItem(Item* snapToItem, Uint32 flags)
5707{
5708 if ( shopFrame )
5709 {
5710 int x = getSelectedShopX();
5711 int y = getSelectedShopY();
5712 if ( snapToItem )
5713 {
5714 x = snapToItem->x;
5715 y = snapToItem->y;
5716 }
5717
5718 if ( auto slot = getShopSlotFrame(x, y) )
5719 {
5720 if ( !isInteractable )
5721 {
5722 //messagePlayer(0, "[Debug]: select item queued");
5723 player.inventoryUI.cursor.queuedModule = Player::GUI_t::MODULE_SHOP;
5724 player.inventoryUI.cursor.queuedFrameToWarpTo = slot;
5725 return false;
5726 }
5727 else
5728 {
5729 //messagePlayer(0, "[Debug]: select item warped");
5730 player.inventoryUI.cursor.queuedModule = Player::GUI_t::MODULE_NONE;
5731 player.inventoryUI.cursor.queuedFrameToWarpTo = nullptr;
5732 slot->warpMouseToFrame(player.playernum, flags);
5733 }
5734 return true;
5735 }
5736 }
5737 return false;
5738}
5739
5740Frame* Player::Inventory_t::getInventorySlotFrame(int x, int y) const
5741{

Callers 2

updateInventoryMethod · 0.80

Calls 1

warpMouseToFrameMethod · 0.80

Tested by

no test coverage detected