MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / CMPSideButton

Method CMPSideButton

engine/Poseidon/UI/DisplayUISetup.cpp:454–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
463CMPSideButton::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

Callers

nothing calls this directly

Calls 5

GetPackedColorFunction · 0.85
FindPictureFunction · 0.85
GlobLoadTextureFunction · 0.85
LowerMethod · 0.80
SetMaxSizeMethod · 0.80

Tested by

no test coverage detected