]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/misc_bugfixes
authorterencehill <piuntn@gmail.com>
Sun, 4 Jul 2010 23:08:29 +0000 (01:08 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 4 Jul 2010 23:08:29 +0000 (01:08 +0200)
13 files changed:
defaultXonotic.cfg
qcsrc/menu/item/button.c
qcsrc/menu/item/listbox.c
qcsrc/menu/item/nexposee.c
qcsrc/menu/xonotic/campaign.c
qcsrc/menu/xonotic/charmap.c
qcsrc/menu/xonotic/demolist.c
qcsrc/menu/xonotic/inputbox.c
qcsrc/menu/xonotic/keybinder.c
qcsrc/menu/xonotic/maplist.c
qcsrc/menu/xonotic/serverlist.c
qcsrc/menu/xonotic/skinlist.c
qcsrc/server/vote.qc

index 307f58fa78b76005964d1a54f514d599d9baac6a..b42917ba07a7534ed1bacdb84ee0d6316faa7405 100644 (file)
@@ -1375,7 +1375,7 @@ set timelimit_increment 5
 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"
 
index 728413135ad1d5f8f9dfb6bd189e041e63aefef5..3d91229ec6669dcd6f3af7c1b56858db72708b2f 100644 (file)
@@ -50,7 +50,7 @@ void Button_configureButton(entity me, string txt, float sz, string gfx)
 }
 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;
index 4d6174cc593cb4bacb484addb4ec9b551e019909..ba3fa6a9f28ca8c3dbbb31f11b85982ba8bede03 100644 (file)
@@ -7,6 +7,7 @@ CLASS(ListBox) EXTENDS(Item)
        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')
@@ -188,6 +189,13 @@ float ListBox_mouseRelease(entity me, vector pos)
        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;
index c43f44f509f38b9ee7cd2f902dfcc59fb949e885..2369a41077db5334d6ea9ac63348fe3fb47c2b56 100644 (file)
@@ -309,7 +309,7 @@ float Nexposee_keyDown(entity me, float scan, float ascii, float shift)
        {
                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:
index bd31f435e2f0d30e7bfcbb4c193bccfda3e5fb6c..e7667f69cfd64ceae7fd3bd7fd65b5397d5c18c6 100644 (file)
@@ -315,7 +315,7 @@ void XonoticCampaignList_setSelected(entity me, float i)
 
 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);
index a448e3547e563f8eceae79086716a3b685c982df..0e375c9cc4654e10f81b938232f25ef36eca3c93 100644 (file)
@@ -122,6 +122,7 @@ float XonoticCharmap_keyDown(entity me, float key, float ascii, float 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));
index 0882a3ed4af375cfb0b157c411c3fe112e27c311..c16e4ae0008efe802b593f6be86b6e1d4b3d1569 100644 (file)
@@ -155,7 +155,7 @@ void XonoticDemoList_clickListBoxItem(entity me, float i, vector where)
 
 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;
     }
index 26dc4536c477fa198a1abdf44c2adac91833ebb5..e457414b4a4ed411b422a7c0404925cab92c7603 100644 (file)
@@ -74,7 +74,7 @@ float XonoticInputBox_keyDown(entity me, float key, float ascii, float shift)
 {
        float r;
        r = 0;
-       if(key == K_ENTER)
+       if(key == K_ENTER || key == K_KP_ENTER)
        {
                if(me.cvarName)
                {
index 2eb51755dca6027427873bc4aabe7719fac22f3c..01ed3a55375d9ca6503790c3707eb0f1cede091d 100644 (file)
@@ -240,10 +240,12 @@ float XonoticKeyBinder_keyDown(entity me, float key, float ascii, float shift)
        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;
index 7a5a4ba150c6f5d332eaaa0648c3cd0961c3ac96..8b5ce6d6a7b46a3a9c58f0e1b090b47ee71c52c0 100644 (file)
@@ -295,7 +295,7 @@ void MapList_LoadMap(entity btn, entity me)
 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);
index c205fba70574e031eb1951cecbfa33d413c766ba..d721c2555e2dbae45621da79f75b5d4601c88978 100644 (file)
@@ -582,7 +582,7 @@ float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift)
        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;
@@ -592,7 +592,7 @@ float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift)
                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)
index bcb62251aa9f30650c41894a486add3546383ae4..864b3054a5bb85dccbabb3b538ecf76bc0b8fb82 100644 (file)
@@ -195,7 +195,7 @@ void XonoticSkinList_clickListBoxItem(entity me, float i, vector where)
 
 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;
        }
index 338d98476b38b2a685cfd71ce2b396d827e204b5..07b71d99968d005ea36083f737ca516ca43c9a2c 100644 (file)
@@ -165,6 +165,8 @@ float GameCommand_Vote(string s, entity e) {
                                                        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);
@@ -203,7 +205,7 @@ float GameCommand_Vote(string s, entity e) {
                                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")) {