MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / scrollMouseDown

Function scrollMouseDown

src/OpenLoco/src/Ui/Windows/TerraForm.cpp:650–673  ·  view source on GitHub ↗

0x004BBF3B

Source from the content-addressed store, hash-verified

648
649 // 0x004BBF3B
650 static void scrollMouseDown(Window& self, int16_t x, int16_t y, [[maybe_unused]] uint8_t scroll_index)
651 {
652 auto index = getRowIndex(x, y);
653
654 for (auto i = 0; i < self.rowCount; i++)
655 {
656 auto rowInfo = self.rowInfo[i];
657 index--;
658 if (index < 0)
659 {
660 self.rowHover = rowInfo;
661 getGameState().lastTreeOption = static_cast<uint8_t>(rowInfo);
662
663 updateTreeColours(self);
664
665 int32_t pan = (self.width >> 1) + self.x;
666 Audio::playSound(Audio::SoundId::clickDown, Audio::ChannelId::ui, pan);
667 self.expandContentCounter = -16;
668 _lastTreeCost = GameCommands::kFailure;
669 self.invalidate();
670 break;
671 }
672 }
673 }
674
675 // 0x004BBEF8
676 static void scrollMouseOver(Window& self, int16_t x, int16_t y, [[maybe_unused]] uint8_t scroll_index)

Callers

nothing calls this directly

Calls 4

updateTreeColoursFunction · 0.85
playSoundFunction · 0.85
getRowIndexFunction · 0.70
invalidateMethod · 0.45

Tested by

no test coverage detected