| 452 | Ref<Texture> _sideDisabled; |
| 453 | |
| 454 | public: |
| 455 | CMPSideButton(ControlsContainer* parent, int idc, const ParamEntry& cls, TargetSide side); |
| 456 | |
| 457 | bool IsToggled() const { return _toggled; } |
| 458 | void Toggle(bool set) { _toggled = set; } |
| 459 | |
| 460 | void OnDraw(float alpha) override; |
| 461 | }; |
| 462 | |
| 463 | CMPSideButton::CMPSideButton(ControlsContainer* parent, int idc, const ParamEntry& cls, TargetSide side) |
| 464 | : C3DActiveText(parent, idc, cls) |
| 465 | { |
| 466 | _side = side; |
| 467 | _toggled = false; |
| 468 | |
| 469 | _colorShade = GetPackedColor(cls >> "colorShade"); |
| 470 | _colorDisabled = GetPackedColor(cls >> "colorDisabled"); |
| 471 | |
| 472 | RString path = FindPicture(cls >> "picture"); |
| 473 | path.Lower(); |
| 474 | _texture = GlobLoadTexture(path); |
| 475 | if (_texture) |
| 476 | { |
| 477 | _texture->SetMaxSize(1024); // no limits |
| 478 | } |
| 479 |
nothing calls this directly
no test coverage detected