#ifdef INTERFACE
-CLASS(XonoticWeaponsList) EXTENDS(XonoticListBox)
+CLASS(XonoticWeaponsList, XonoticListBox)
METHOD(XonoticWeaponsList, configureXonoticWeaponsList, void(entity))
METHOD(XonoticWeaponsList, toString, string(entity))
ATTRIB(XonoticWeaponsList, rowsPerItem, float, 1)
entity makeXonoticWeaponsList()
{
entity me;
- me = spawnXonoticWeaponsList();
+ me = NEW(XonoticWeaponsList);
me.configureXonoticWeaponsList(me);
return me;
}
{
SUPER(XonoticWeaponsList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
- me.realFontSize_y = me.fontSize / (absSize_y * me.itemHeight);
- me.realFontSize_x = me.fontSize / (absSize_x * (1 - me.controlWidth));
- me.realUpperMargin = 0.5 * (1 - me.realFontSize_y);
+ me.realFontSize_y = me.fontSize / (absSize.y * me.itemHeight);
+ me.realFontSize_x = me.fontSize / (absSize.x * (1 - me.controlWidth));
+ me.realUpperMargin = 0.5 * (1 - me.realFontSize.y);
}
float XonoticWeaponsList_mouseDrag(entity me, vector pos)
{
- float f, i;
- i = me.selectedItem;
- f = SUPER(XonoticWeaponsList).mouseDrag(me, pos);
+ int i = me.selectedItem;
+ float f = SUPER(XonoticWeaponsList).mouseDrag(me, pos);
if(me.pressed != 1) // don't change priority if the person is just scrolling
{
msg = sprintf(_("%s (mutator weapon)"), msg);
vector save_fontscale = draw_fontscale;
- float f = draw_CondensedFontFactor(msg, FALSE, me.realFontSize, 1);
- draw_fontscale_x *= f;
+ float f = draw_CondensedFontFactor(msg, false, me.realFontSize, 1);
+ draw_fontscale.x *= f;
vector fs = me.realFontSize;
- fs_x *= f;
+ fs.x *= f;
draw_Text(me.realUpperMargin * eY, msg, fs, SKINCOLOR_TEXT, SKINALPHA_TEXT, 0);
draw_fontscale = save_fontscale;
}