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

Method warpMouseToSelectedAlchemyItem

src/interface/interface.cpp:20238–20272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20236}
20237
20238bool GenericGUIMenu::AlchemyGUI_t::warpMouseToSelectedAlchemyItem(Item* snapToItem, Uint32 flags)
20239{
20240 if ( alchemyGUIHasBeenCreated() )
20241 {
20242 int x = getSelectedAlchemySlotX();
20243 int y = getSelectedAlchemySlotY();
20244 if ( snapToItem )
20245 {
20246 x = snapToItem->x;
20247 y = snapToItem->y;
20248 }
20249
20250 if ( auto slot = getAlchemySlotFrame(x, y) )
20251 {
20252 int playernum = parentGUI.getPlayer();
20253 auto player = players[playernum];
20254 if ( !isInteractable )
20255 {
20256 //messagePlayer(0, "[Debug]: select item queued");
20257 player->inventoryUI.cursor.queuedModule = Player::GUI_t::MODULE_ALCHEMY;
20258 player->inventoryUI.cursor.queuedFrameToWarpTo = slot;
20259 return false;
20260 }
20261 else
20262 {
20263 //messagePlayer(0, "[Debug]: select item warped");
20264 player->inventoryUI.cursor.queuedModule = Player::GUI_t::MODULE_NONE;
20265 player->inventoryUI.cursor.queuedFrameToWarpTo = nullptr;
20266 slot->warpMouseToFrame(playernum, flags);
20267 }
20268 return true;
20269 }
20270 }
20271 return false;
20272}
20273
20274void GenericGUIMenu::AlchemyGUI_t::clearItemDisplayed()
20275{

Callers 3

closeRecipePanelMethod · 0.80
updateInventoryMethod · 0.80

Calls 2

warpMouseToFrameMethod · 0.80
getPlayerMethod · 0.45

Tested by

no test coverage detected