#define ITEM_BUTTON_H
#include "label.qc"
CLASS(Button, Label)
- METHOD(Button, configureButton, void(entity, string, float, string))
- METHOD(Button, draw, void(entity))
- METHOD(Button, showNotify, void(entity))
- METHOD(Button, resizeNotify, void(entity, vector, vector, vector, vector))
- METHOD(Button, keyDown, float(entity, float, float, float))
- METHOD(Button, mousePress, float(entity, vector))
- METHOD(Button, mouseDrag, float(entity, vector))
- METHOD(Button, mouseRelease, float(entity, vector))
- METHOD(Button, playClickSound, void(entity))
+ METHOD(Button, configureButton, void(entity, string, float, string));
+ METHOD(Button, draw, void(entity));
+ METHOD(Button, showNotify, void(entity));
+ METHOD(Button, resizeNotify, void(entity, vector, vector, vector, vector));
+ METHOD(Button, keyDown, float(entity, float, float, float));
+ METHOD(Button, mousePress, float(entity, vector));
+ METHOD(Button, mouseDrag, float(entity, vector));
+ METHOD(Button, mouseRelease, float(entity, vector));
+ METHOD(Button, playClickSound, void(entity));
ATTRIB(Button, onClick, void(entity, entity), func_null)
ATTRIB(Button, onClickEntity, entity, NULL)
ATTRIB(Button, src, string, string_null)
if(me.srcMulti)
me.keepspaceLeft = 0;
else
- me.keepspaceLeft = min(0.8, absSize.y / absSize.x);
+ me.keepspaceLeft = min(0.8, absSize.x == 0 ? 0 : (absSize.y / absSize.x));
SUPER(Button).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
}
void Button_configureButton(entity me, string txt, float sz, string gfx)