]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/soundlist.qc
Sort menu classes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / soundlist.qc
index 7d1515062ab5428aa09b0c272272aa4722a2f4c7..ec80643b989c40fb3db873532f510cc87b951668 100644 (file)
@@ -1,5 +1,6 @@
-#ifdef INTERFACE
-CLASS(XonoticSoundList) EXTENDS(XonoticListBox)
+#ifndef SOUNDLIST_H
+#define SOUNDLIST_H
+CLASS(XonoticSoundList, XonoticListBox)
        METHOD(XonoticSoundList, configureXonoticSoundList, void(entity))
        ATTRIB(XonoticSoundList, rowsPerItem, float, 1)
        METHOD(XonoticSoundList, resizeNotify, void(entity, vector, vector, vector, vector))
@@ -38,7 +39,7 @@ void SoundList_Menu_Track_Reset(entity box, entity me);
 entity makeXonoticSoundList()
 {
        entity me;
-       me = spawnXonoticSoundList();
+       me = NEW(XonoticSoundList);
        me.configureXonoticSoundList(me);
        return me;
 }
@@ -71,7 +72,7 @@ void XonoticSoundList_getSounds(entity me)
        if(me.listSound >= 0)
                search_end(me.listSound);
 
-       me.listSound = search_begin(s, FALSE, TRUE);
+       me.listSound = search_begin(s, false, true);
 
        if(me.listSound < 0)
                me.nItems=0;
@@ -90,15 +91,15 @@ 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.realUpperMargin = 0.5 * (1 - me.realFontSize_y);
+       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.realUpperMargin = 0.5 * (1 - me.realFontSize.y);
 
        me.columnNumberOrigin = 0;
-       me.columnNumberSize = me.realFontSize_x * 3;
+       me.columnNumberSize = me.realFontSize.x * 3;
 
        me.columnNameOrigin = me.columnNumberSize;
-       me.columnNameSize = 1 - me.columnNameOrigin - me.realFontSize_x;
+       me.columnNameSize = 1 - me.columnNameOrigin - me.realFontSize.x;
 }
 
 void XonoticSoundList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)