set timelimit_decrement 5
set timelimit_min 5
set timelimit_max 60
-alias extendmatchtime "sv_cmd rpn /timelimit timelimit timelimit_max timelimit timelimit_increment add bound def"
+alias extendmatchtime "sv_cmd rpn /timelimit timelimit timelimit_max 0 timelimit when timelimit timelimit_increment add bound def"
alias reducematchtime "sv_cmd rpn /timelimit timelimit timelimit_decrement sub timelimit_min timelimit bound def"
alias endmatch "timelimit -1"
}
float Button_keyDown(entity me, float key, float ascii, float shift)
{
- if(key == K_ENTER || key == K_SPACE)
+ if(key == K_ENTER || key == K_SPACE || key == K_KP_ENTER)
{
me.clickTime = 0.1; // delayed for effect
return 1;
METHOD(ListBox, mousePress, float(entity, vector))
METHOD(ListBox, mouseDrag, float(entity, vector))
METHOD(ListBox, mouseRelease, float(entity, vector))
+ METHOD(ListBox, focusLeave, void(entity))
ATTRIB(ListBox, focusable, float, 1)
ATTRIB(ListBox, selectedItem, float, 0)
ATTRIB(ListBox, size, vector, '0 0 0')
me.pressed = 0;
return 1;
}
+void ListBox_focusLeave(entity me)
+{
+ // Reset the var pressed in case listbox loses focus
+ // by a mouse click on an item of the list
+ // for example showing a dialog on right click
+ me.pressed = 0;
+}
void ListBox_updateControlTopBottom(entity me)
{
float f;
{
case 0:
case 3:
- nexposeeKey = ((scan == K_SPACE) || (scan == K_ENTER));
+ nexposeeKey = ((scan == K_SPACE) || (scan == K_ENTER) || (scan == K_KP_ENTER));
break;
case 1:
case 2:
float XonoticCampaignList_keyDown(entity me, float scan, float ascii, float shift)
{
- if(scan == K_ENTER || scan == K_SPACE)
+ if(scan == K_ENTER || scan == K_SPACE || scan == K_KP_ENTER)
CampaignList_LoadMap(me, me);
else
return SUPER(XonoticCampaignList).keyDown(me, scan, ascii, shift);
return 1;
case K_SPACE:
case K_ENTER:
+ case K_KP_ENTER:
case K_INS:
case K_KP_INS:
me.controlledTextbox.enterText(me.controlledTextbox, CharMap_CellToChar(me.selectedCharacterCell));
float XonoticDemoList_keyDown(entity me, float scan, float ascii, float shift)
{
- if(scan == K_ENTER) {
+ if(scan == K_ENTER || scan == K_KP_ENTER) {
me.startDemo(me);
return 1;
}
{
float r;
r = 0;
- if(key == K_ENTER)
+ if(key == K_ENTER || key == K_KP_ENTER)
{
if(me.cvarName)
{
switch(key)
{
case K_ENTER:
+ case K_KP_ENTER:
case K_SPACE:
KeyBinder_Bind_Change(me, me);
break;
case K_DEL:
+ case K_KP_DEL:
case K_BACKSPACE:
KeyBinder_Bind_Clear(me, me);
break;
float XonoticMapList_keyDown(entity me, float scan, float ascii, float shift)
{
string ch, save;
- if(scan == K_ENTER)
+ if(scan == K_ENTER || scan == K_KP_ENTER)
{
// pop up map info screen
main.mapInfoDialog.loadMapInfo(main.mapInfoDialog, me.selectedItem, me);
org = boxToGlobal(eY * (me.selectedItem * me.itemHeight - me.scrollPos), me.origin, me.size);
sz = boxToGlobalSize(eY * me.itemHeight + eX * (1 - me.controlWidth), me.size);
- if(scan == K_ENTER)
+ if(scan == K_ENTER || scan == K_KP_ENTER)
{
ServerList_Connect_Click(NULL, me);
return 1;
main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
DialogOpenButton_Click_withCoords(me, main.serverInfoDialog, org, sz);
}
- else if(scan == K_INS || scan == K_MOUSE3)
+ else if(scan == K_INS || scan == K_MOUSE3 || scan == K_KP_INS)
{
i = me.selectedItem;
if(i < me.nItems)
float XonoticSkinList_keyDown(entity me, float scan, float ascii, float shift)
{
- if(scan == K_ENTER) {
+ if(scan == K_ENTER || scan == K_KP_ENTER) {
me.setSkin(me);
return 1;
}
print_to(e, strcat("^1You have to wait ^2", ftos(ceil(e.vote_next - time)), "^1 seconds before you can again call a vote."));
} else if(VoteCheckNasty(vote)) {
print_to(e, "Syntax error in command. See 'vhelp' for more info.");
+ } else if(cvar("timelimit") == 0 && (vote == "extendmatchtime" || vote == "reducematchtime")) {
+ print_to(e, "^1Match time can not be reduced or extended as it is infinite. See 'vhelp' for more info.");
} else if(RemapVote(vote, "vcall", e)) {
votecalledvote = strzone(RemapVote_vote);
votecalledvote_display = strzone(RemapVote_display);
VoteDialog_Reset();
VoteStop(e);
} else {
- print_to(e, "^1You are not allowed to stop that Vote.");
+ print_to(e, "^1You are not allowed to stop that vote.");
}
} else if(argv(1) == "master") {
if(cvar("sv_vote_master")) {