METHOD(XonoticWeaponsDialog, showNotify, void(entity))
ATTRIB(XonoticWeaponsDialog, title, string, _("Weapon settings"))
ATTRIB(XonoticWeaponsDialog, color, vector, SKINCOLOR_DIALOG_WEAPONS)
- ATTRIB(XonoticWeaponsDialog, intendedWidth, float, 0.4)
- ATTRIB(XonoticWeaponsDialog, rows, float, 18)
- ATTRIB(XonoticWeaponsDialog, columns, float, 3)
+ ATTRIB(XonoticWeaponsDialog, intendedWidth, float, 0.7)
+ ATTRIB(XonoticWeaponsDialog, rows, float, 12)
+ ATTRIB(XonoticWeaponsDialog, columns, float, 5.2)
ATTRIB(XonoticWeaponsDialog, weaponsList, entity, NULL)
ENDCLASS(XonoticWeaponsDialog)
#endif
entity e;
me.TR(me);
- me.TD(me, 1, 3, makeXonoticTextLabel(0, _("Weapon priority list:")));
+ me.TD(me, 1, 2, makeXonoticTextLabel(0, _("Weapon priority list:")));
me.TR(me);
- me.TD(me, 10, 3, e = me.weaponsList = makeXonoticWeaponsList());
- me.gotoRC(me, 11, 0);
- me.TDempty(me, 0.5);
+ me.TD(me, 8, 2, e = me.weaponsList = makeXonoticWeaponsList());
+ me.gotoRC(me, 9, 0);
me.TD(me, 1, 1, e = makeXonoticButton(_("Up"), '0 0 0'));
e.onClick = WeaponsList_MoveUp_Click;
e.onClickEntity = me.weaponsList;
me.TD(me, 1, 1, e = makeXonoticButton(_("Down"), '0 0 0'));
e.onClick = WeaponsList_MoveDown_Click;
e.onClickEntity = me.weaponsList;
- me.TR(me);
+
+ me.gotoRC(me, 0, 2.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_weaponpriority_useforcycling", _("Use priority list for weapon cycling")));
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_autoswitch", _("Auto switch weapons on pickup")));
+ me.TR(me);
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_drawviewmodel", _("Draw 1st person weapon model")));
me.TR(me);
me.TD(me, 1, 1.0, e = makeXonoticRadioButton(1, "cl_gunalign", "3", _("Right align")));
setDependent(e, "r_drawviewmodel", 1, 1);
me.TR(me);
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_followmodel", _("Gun model swaying")));
+ makeMulti(e, "cl_leanmodel");
+ setDependent(e, "r_drawviewmodel", 1, 1);
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_bobmodel", _("Gun model bobbing")));
+ setDependent(e, "r_drawviewmodel", 1, 1);
+ me.TR(me);
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Scale")));
+ setDependent(e, "r_drawviewmodel", 1, 1);
+ me.TD(me, 1, 2, e = makeXonoticSlider(-1, 1, 0.2, "cl_viewmodel_scale"));
+ setDependent(e, "r_drawviewmodel", 1, 1);
+
+ me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
e.onClick = Dialog_Close;
e.onClickEntity = me;
ATTRIB(XonoticWeaponsList, realFontSize, vector, '0 0 0')
ATTRIB(XonoticWeaponsList, realUpperMargin, float, 0)
METHOD(XonoticWeaponsList, mouseDrag, float(entity, vector))
- ATTRIB(XonoticWeaponsList, scrollbarWidth, float, 0)
ENDCLASS(XonoticWeaponsList)
entity makeXonoticWeaponsList();
void WeaponsList_MoveUp_Click(entity btn, entity me);
}
float XonoticWeaponsList_mouseDrag(entity me, vector pos)
{
- float f, i;
+ float f, i, scrollbar;
i = me.selectedItem;
f = SUPER(XonoticWeaponsList).mouseDrag(me, pos);
- if(me.selectedItem != i)
- cvar_set("cl_weaponpriority", swapInPriorityList(cvar_string("cl_weaponpriority"), me.selectedItem, i));
+
+ scrollbar = 1;
+ if(pos_x < 1 - me.controlWidth - me.tolerance_y * me.controlWidth) scrollbar = 0;
+ if(pos_y < 0 - me.tolerance_x) scrollbar = 0;
+ if(pos_x >= 1 + me.tolerance_y * me.controlWidth) scrollbar = 0;
+ if(pos_y >= 1 + me.tolerance_x) scrollbar = 0;
+
+ if not(scrollbar) // don't change priority if the person is just scrolling
+ {
+ if(me.selectedItem != i)
+ cvar_set("cl_weaponpriority", swapInPriorityList(cvar_string("cl_weaponpriority"), me.selectedItem, i));
+ }
+
return f;
}
string XonoticWeaponsList_toString(entity me)