]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/soundlist.qc
Restore white tos text
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / soundlist.qc
index 961c5b00be757e34c4aa6bb389cd6591594baef3..99094b0af2cb125550f23bf1bb6137faf8401ed3 100644 (file)
@@ -1,41 +1,7 @@
-#ifndef SOUNDLIST_H
-#define SOUNDLIST_H
-#include "listbox.qc"
-CLASS(XonoticSoundList, XonoticListBox)
-       METHOD(XonoticSoundList, configureXonoticSoundList, void(entity));
-       ATTRIB(XonoticSoundList, rowsPerItem, float, 1)
-       METHOD(XonoticSoundList, resizeNotify, void(entity, vector, vector, vector, vector));
-       METHOD(XonoticSoundList, drawListBoxItem, void(entity, int, vector, bool, bool));
-       METHOD(XonoticSoundList, getSounds, void(entity));
-       METHOD(XonoticSoundList, soundName, string(entity, int));
-       METHOD(XonoticSoundList, doubleClickListBoxItem, void(entity, int, vector));
-       METHOD(XonoticSoundList, keyDown, float(entity, float, float, float));
-       METHOD(XonoticSoundList, destroy, void(entity));
-       METHOD(XonoticSoundList, showNotify, void(entity));
-
-       ATTRIB(XonoticSoundList, listSound, int, -1)
-       ATTRIB(XonoticSoundList, realFontSize, vector, '0 0 0')
-       ATTRIB(XonoticSoundList, columnNameOrigin, float, 0)
-       ATTRIB(XonoticSoundList, columnNameSize, float, 0)
-       ATTRIB(XonoticSoundList, columnNumberOrigin, float, 0)
-       ATTRIB(XonoticSoundList, columnNumberSize, float, 0)
-       ATTRIB(XonoticSoundList, realUpperMargin, float, 0)
-       ATTRIB(XonoticSoundList, origin, vector, '0 0 0')
-       ATTRIB(XonoticSoundList, itemAbsSize, vector, '0 0 0')
-
-       ATTRIB(XonoticSoundList, filterString, string, string_null)
-       ATTRIB(XonoticSoundList, playlist, entity, NULL)
-ENDCLASS(XonoticSoundList)
-
-entity makeXonoticSoundList();
-void SoundList_Filter_Change(entity box, entity me);
-void SoundList_Add(entity box, entity me);
-void SoundList_Add_All(entity box, entity me);
-void SoundList_Menu_Track_Change(entity box, entity me);
-void SoundList_Menu_Track_Reset(entity box, entity me);
-#endif
-
-#ifdef IMPLEMENTATION
+#include "soundlist.qh"
+
+#include "inputbox.qh"
+#include "playlist.qh"
 
 entity makeXonoticSoundList()
 {
@@ -89,8 +55,10 @@ void XonoticSoundList_resizeNotify(entity me, vector relOrigin, vector relSize,
        me.itemAbsSize = '0 0 0';
        SUPER(XonoticSoundList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
 
-       me.realFontSize_y = me.fontSize / (me.itemAbsSize_y = (absSize.y * me.itemHeight));
-       me.realFontSize_x = me.fontSize / (me.itemAbsSize_x = (absSize.x * (1 - me.controlWidth)));
+       me.itemAbsSize.y = absSize.y * me.itemHeight;
+       me.itemAbsSize.x = absSize.x * (1 - me.controlWidth);
+       me.realFontSize.y = me.fontSize / me.itemAbsSize.y;
+       me.realFontSize.x = me.fontSize / me.itemAbsSize.x;
        me.realUpperMargin = 0.5 * (1 - me.realFontSize.y);
 
        me.columnNumberOrigin = 0;
@@ -138,13 +106,10 @@ void SoundList_Menu_Track_Reset(entity box, entity me)
 
 void SoundList_Filter_Change(entity box, entity me)
 {
-       if(me.filterString)
-               strunzone(me.filterString);
+       strfree(me.filterString);
 
        if(box.text != "")
                me.filterString = strzone(box.text);
-       else
-               me.filterString = string_null;
 
        me.getSounds(me);
 }
@@ -175,5 +140,3 @@ float XonoticSoundList_keyDown(entity me, float scan, float ascii, float shift)
        else
                return SUPER(XonoticSoundList).keyDown(me, scan, ascii, shift);
 }
-#endif
-