0x00435314
| 170 | |
| 171 | // 0x00435314 |
| 172 | static void scrollMouseDown(Window& self, [[maybe_unused]] const int16_t x, const int16_t y, [[maybe_unused]] const uint8_t scroll_index) |
| 173 | { |
| 174 | const auto objRow = getObjectFromSelection(y); |
| 175 | |
| 176 | if (objRow.index == ObjectManager::kNullObjectIndex) |
| 177 | { |
| 178 | return; |
| 179 | } |
| 180 | self.invalidate(); |
| 181 | |
| 182 | auto mousePos = Input::getMouseLocation(); |
| 183 | Audio::playSound(Audio::SoundId::clickDown, Audio::ChannelId::ui, mousePos.x); |
| 184 | |
| 185 | if (_callingWindowType == WindowType::company) |
| 186 | { |
| 187 | GameCommands::setErrorTitle(StringIds::cant_select_face); |
| 188 | |
| 189 | GameCommands::ChangeCompanyFaceArgs args{}; |
| 190 | args.companyId = self.owner; |
| 191 | args.objHeader = objRow.object._header; |
| 192 | |
| 193 | const auto result = GameCommands::doCommand(args, GameCommands::Flags::apply) != GameCommands::kFailure; |
| 194 | if (result) |
| 195 | { |
| 196 | WindowManager::close(&self); |
| 197 | } |
| 198 | } |
| 199 | else if (_callingWindowType == WindowType::options) |
| 200 | { |
| 201 | auto& config = Config::get(); |
| 202 | config.preferredOwnerFace = objRow.object._header; |
| 203 | Config::write(); |
| 204 | |
| 205 | WindowManager::close(&self); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | // 0x004352C7 |
| 210 | static void scrollMouseOver(Window& self, [[maybe_unused]] const int16_t x, const int16_t y, [[maybe_unused]] const uint8_t scroll_index) |
nothing calls this directly
no test coverage detected