-#ifdef INTERFACE
-CLASS(XonoticKeyBinder) EXTENDS(XonoticListBox)
- METHOD(XonoticKeyBinder, configureXonoticKeyBinder, void(entity))
+#ifndef KEYBINDER_H
+#define KEYBINDER_H
+#include "listbox.qc"
+CLASS(XonoticKeyBinder, XonoticListBox)
+ METHOD(XonoticKeyBinder, configureXonoticKeyBinder, void(entity));
ATTRIB(XonoticKeyBinder, rowsPerItem, int, 1)
- METHOD(XonoticKeyBinder, drawListBoxItem, void(entity, int, vector, bool, float))
- METHOD(XonoticKeyBinder, doubleClickListBoxItem, void(entity, float, vector))
- METHOD(XonoticKeyBinder, resizeNotify, void(entity, vector, vector, vector, vector))
- METHOD(XonoticKeyBinder, setSelected, void(entity, float))
- METHOD(XonoticKeyBinder, keyDown, float(entity, float, float, float))
- METHOD(XonoticKeyBinder, keyGrabbed, void(entity, float, float))
+ METHOD(XonoticKeyBinder, drawListBoxItem, void(entity, int, vector, bool, bool));
+ METHOD(XonoticKeyBinder, doubleClickListBoxItem, void(entity, float, vector));
+ METHOD(XonoticKeyBinder, resizeNotify, void(entity, vector, vector, vector, vector));
+ METHOD(XonoticKeyBinder, setSelected, void(entity, float));
+ METHOD(XonoticKeyBinder, keyDown, float(entity, float, float, float));
+ METHOD(XonoticKeyBinder, keyGrabbed, void(entity, float, float));
ATTRIB(XonoticKeyBinder, realFontSize, vector, '0 0 0')
ATTRIB(XonoticKeyBinder, realUpperMargin, float, 0)
ATTRIB(XonoticKeyBinder, keyGrabButton, entity, NULL)
ATTRIB(XonoticKeyBinder, clearButton, entity, NULL)
ATTRIB(XonoticKeyBinder, userbindEditDialog, entity, NULL)
- METHOD(XonoticKeyBinder, editUserbind, void(entity, string, string, string))
+ METHOD(XonoticKeyBinder, editUserbind, void(entity, string, string, string));
ENDCLASS(XonoticKeyBinder)
entity makeXonoticKeyBinder();
void KeyBinder_Bind_Change(entity btn, entity me);
void KeyBinder_Bind_Clear(entity btn, entity me);
void KeyBinder_Bind_Edit(entity btn, entity me);
+void KeyBinder_Bind_Reset_All(entity btn, entity me);
#endif
#ifdef IMPLEMENTATION
entity makeXonoticKeyBinder()
{
entity me;
- me = spawnXonoticKeyBinder();
+ me = NEW(XonoticKeyBinder);
me.configureXonoticKeyBinder(me);
return me;
}
}
return r;
}
-void XonoticKeyBinder_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, float highlightedTime)
+void XonoticKeyBinder_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
{
string s;
int j, n;
else
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
}
- else if(highlightedTime)
- draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, getHighlightAlpha(SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED, highlightedTime));
+ else if(isFocused)
+ {
+ me.focusedItemAlpha = getFadedAlpha(me.focusedItemAlpha, SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED);
+ draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, me.focusedItemAlpha);
+ }
theAlpha = SKINALPHA_KEYGRABBER_KEYS;
theColor = SKINCOLOR_KEYGRABBER_KEYS;