]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/campaign.qc
Reimplement the campaign list fix (commit 58709f8868) in the listbox class so it...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / campaign.qc
index 76d90285bb95d646b852e7fbc3c7d9d8fb301d69..2387735165ca70229a5797ded781fe6acc3b5261 100644 (file)
@@ -130,11 +130,8 @@ void XonoticCampaignList_loadCvars(entity me)
                rewrapCampaign(me.columnNameSize, me.rowsPerItem - 3, me.emptyLineHeight, me.realFontSize);
        me.nItems = min(me.campaignIndex + 2, campaign_entries);
        me.setSelected(me, min(me.campaignIndex, me.nItems - 1));
-       // itemHeight will be initialized to the correct value at the first resizeNotify call
-       if(me.itemHeight == 1) // initial temporary value of itemHeight is 1
-               me.scrollPosTarget = 9999;
-       else
-               me.scrollPosTarget = me.nItems * me.itemHeight - 1;
+       if(me.nItems - 1 > me.campaignIndex)
+               me.scrollToItem(me, me.nItems - 1);
        if(me.labelTitle)
                me.labelTitle.setText(me.labelTitle, campaign_title);
 }