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

Method customBarClickRight

source/frontend/StarActionBar.cpp:318–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318void ActionBar::customBarClickRight(uint8_t index, bool primary) {
319 if (m_paneManager->registeredPaneIsDisplayed(MainInterfacePanes::Inventory)) {
320 auto inventory = m_player->inventory();
321 auto primarySlot = inventory->customBarPrimarySlot(index);
322 auto secondarySlot = inventory->customBarSecondarySlot(index);
323
324 if (primary || (primarySlot && itemSafeTwoHanded(inventory->itemsAt(*primarySlot))))
325 inventory->setCustomBarPrimarySlot(index, {});
326 else
327 inventory->setCustomBarSecondarySlot(index, {});
328 }
329}
330
331void ActionBar::essentialBarClick(uint8_t index) {
332 m_player->inventory()->selectActionBarLocation((EssentialItem)index);

Callers

nothing calls this directly

Calls 8

itemSafeTwoHandedFunction · 0.85
inventoryMethod · 0.80
customBarPrimarySlotMethod · 0.80
itemsAtMethod · 0.80

Tested by

no test coverage detected