FIX: Rewrite options

This commit is contained in:
2026-03-14 14:13:49 +03:00
parent 09d28be195
commit badd59b644
67 changed files with 1093 additions and 1377 deletions

View File

@@ -77,28 +77,20 @@ class OptionButton: public ImageButton
{
typedef ImageButton super;
public:
OptionButton(const Options::Option* option);
OptionButton(const Options::Option* option, float onValue, float offValue);
OptionButton(OptionId optId);
void toggle(Options* options);
void updateImage(Options* options);
static const int ButtonId = 9999999;
protected:
bool isSecondImage(bool hovered);
bool isSecondImage(bool hovered) { return _secondImage; }
virtual void mouseClicked( Minecraft* minecraft, int x, int y, int buttonNum );
private:
const Options::Option* _option;
OptionId m_optId;
bool _secondImage;
// If not float, it's considered to be a boolean value
bool _isFloat;
float _onValue;
float _offValue;
float _current;
};