MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / customBarClick

Method customBarClick

source/frontend/StarActionBar.cpp:304–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304void ActionBar::customBarClick(uint8_t index, bool primary) {
305 if (auto swapItem = m_player->inventory()->swapSlotItem()) {
306 if (primary || itemSafeTwoHanded(swapItem))
307 m_player->inventory()->setCustomBarPrimarySlot(index, InventorySlot(SwapSlot()));
308 else
309 m_player->inventory()->setCustomBarSecondarySlot(index, InventorySlot(SwapSlot()));
310
311 m_player->inventory()->clearSwap();
312
313 } else {
314 m_player->inventory()->selectActionBarLocation(index);
315 }
316}
317
318void ActionBar::customBarClickRight(uint8_t index, bool primary) {
319 if (m_paneManager->registeredPaneIsDisplayed(MainInterfacePanes::Inventory)) {

Callers

nothing calls this directly

Calls 7

itemSafeTwoHandedFunction · 0.85
swapSlotItemMethod · 0.80
inventoryMethod · 0.80
clearSwapMethod · 0.45

Tested by

no test coverage detected