From 58709f88681ded13a54e3aa5dcf1949787341ec7 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 24 Jul 2015 16:04:18 +0200 Subject: [PATCH] Fix campaign list --- qcsrc/menu/xonotic/campaign.qc | 6 +++++- qcsrc/menu/xonotic/dialog_singleplayer.qc | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qcsrc/menu/xonotic/campaign.qc b/qcsrc/menu/xonotic/campaign.qc index 36c748310..76d90285b 100644 --- a/qcsrc/menu/xonotic/campaign.qc +++ b/qcsrc/menu/xonotic/campaign.qc @@ -129,8 +129,12 @@ void XonoticCampaignList_loadCvars(entity me) if(me.columnNameSize) rewrapCampaign(me.columnNameSize, me.rowsPerItem - 3, me.emptyLineHeight, me.realFontSize); me.nItems = min(me.campaignIndex + 2, campaign_entries); - me.scrollPos = me.nItems * me.itemHeight - 1; 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.labelTitle) me.labelTitle.setText(me.labelTitle, campaign_title); } diff --git a/qcsrc/menu/xonotic/dialog_singleplayer.qc b/qcsrc/menu/xonotic/dialog_singleplayer.qc index 1620349bf..aa00d8fe8 100644 --- a/qcsrc/menu/xonotic/dialog_singleplayer.qc +++ b/qcsrc/menu/xonotic/dialog_singleplayer.qc @@ -133,7 +133,6 @@ void XonoticSingleplayerDialog_fill(entity me) me.campaignBox.buttonNext = btnNext; me.campaignBox.buttonPrev = btnPrev; me.campaignBox.labelTitle = lblTitle; - me.campaignBox.campaignGo(me.campaignBox, 0); me.gotoRC(me, me.rows - 2, 0); me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Campaign Difficulty:"))); -- 2.39.2