]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/cvarlist.c
Merge branch 'master' into Mario/showspecs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / cvarlist.c
index 4d36c92581b277b338afbc05982d88cac6012f96..722917f553c8e7876f03ee0a0b4b0799f1bd4890 100644 (file)
@@ -35,6 +35,7 @@ entity makeXonoticCvarList();
 void CvarList_Filter_Change(entity box, entity me);
 void CvarList_Value_Change(entity box, entity me);
 void CvarList_Revert_Click(entity btn, entity me);
+void CvarList_End_Editing(entity box, entity me);
 #endif
 
 #ifdef IMPLEMENTATION
@@ -64,7 +65,7 @@ void XonoticCvarList_setSelected(entity me, float i)
        SUPER(XonoticCvarList).setSelected(me, i);
        if(me.nItems == 0)
                return;
-       
+
        if(me.cvarName)
                strunzone(me.cvarName);
        if(me.cvarDescription)
@@ -136,7 +137,7 @@ void XonoticCvarList_drawListBoxItem(entity me, float i, vector absSize, float i
 
        if(isSelected)
                draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
-       
+
        k = bufstr_get(me.handle, i);
 
        v = cvar_string(k);
@@ -165,7 +166,10 @@ float XonoticCvarList_keyDown(entity me, float scan, float ascii, float shift)
                return 1;
        }
        else if(scan == K_ENTER)
+       {
                me.cvarValueBox.parent.setFocus(me.cvarValueBox.parent, me.cvarValueBox);
+               return 1;
+       }
        else if(SUPER(XonoticCvarList).keyDown(me, scan, ascii, shift))
                return 1;
        else if(!me.controlledTextbox)
@@ -192,4 +196,9 @@ void CvarList_Revert_Click(entity btn, entity me)
        me.cvarValueBox.cursorPos = strlen(me.cvarDefault);
 }
 
+void CvarList_End_Editing(entity box, entity me)
+{
+       box.parent.setFocus(box.parent, me);
+}
+
 #endif