| 58 | |
| 59 | public: |
| 60 | explicit Button(const ButtonDef &buttonDef, const std::string_view text, const Concepts::FontRenderer &fontRenderer, std::function<void()> onClick) |
| 61 | : _drawable(buttonDef.resourceName), _def(buttonDef), _state(ButtonState::Normal), _text(text), _label(fontRenderer), _onClick(std::move(onClick)), |
| 62 | _clickSound(std::make_unique<Streams::AudioStream>(Singletons::getFileProvider().loadFile(buttonDef.clickSound))) { |
| 63 | _drawable.setPalette(_def.palette); |
| 64 | _label.setText(_text); |
| 65 | } |
| 66 | |
| 67 | auto draw(const int x, const int y) -> void { |
| 68 | handleMouse(x, y); |
nothing calls this directly
no test coverage detected