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

Method sendEvent

source/frontend/StarInventory.cpp:278–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278bool InventoryPane::sendEvent(InputEvent const& event) {
279 if (m_alwaysDisplayCosmetics)
280 return Pane::sendEvent(event);
281
282 if (auto mousePosition = Widget::context()->mousePosition(event)) {
283 bool displayingCosmetics = false;
284 for (auto const& p : EquipmentSlotNames) {
285 if (auto itemSlot = fetchChild<ItemSlotWidget>(p.second)) {
286 if ((displayingCosmetics = itemSlot->inMember(*mousePosition)))
287 break;
288 }
289 }
290
291 if (m_displayingCosmetics != displayingCosmetics) {
292 for (auto const& p : EquipmentSlotNames) {
293 if (p.first >= EquipmentSlot::Cosmetic1) {
294 if (auto itemSlot = fetchChild<ItemSlotWidget>(p.second))
295 itemSlot->setVisibility(displayingCosmetics);
296 }
297 }
298 m_displayingCosmetics = displayingCosmetics;
299 }
300 }
301
302 return Pane::sendEvent(event);
303}
304
305bool InventoryPane::giveContainerResult(ContainerResult result) {
306 if (!m_expectingSwap)

Callers

nothing calls this directly

Calls 3

inMemberMethod · 0.80
setVisibilityMethod · 0.80
mousePositionMethod · 0.45

Tested by

no test coverage detected