]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/campaign.qc
Merge branch 'terencehill/menu_remove_tab_title' of git://de.git.xonotic.org/xonotic...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / campaign.qc
index de97153543f47e66d6c93a2505cd138f3af7e0aa..826a0b4f2d7c6d81cf22f906f3fd7230dbc99a32 100644 (file)
@@ -1,5 +1,9 @@
-#ifdef INTERFACE
-CLASS(XonoticCampaignList) EXTENDS(XonoticListBox)
+#include "../../common/campaign_common.qh"
+
+#ifndef CAMPAIGN_H
+#define CAMPAIGN_H
+#include "listbox.qc"
+CLASS(XonoticCampaignList, XonoticListBox)
        METHOD(XonoticCampaignList, configureXonoticCampaignList, void(entity))
        ATTRIB(XonoticCampaignList, rowsPerItem, float, 10)
        METHOD(XonoticCampaignList, draw, void(entity))
@@ -48,8 +52,9 @@ string campaign_longdesc_wrapped[CAMPAIGN_MAX_ENTRIES];
 
 void rewrapCampaign(float w, float l0, float emptyheight, vector theFontSize)
 {
-       float i, j;
-       float n, l;
+       int i, j;
+       int n;
+       float l;
        string r, s;
        for(i = 0; i < campaign_entries; ++i)
        {
@@ -89,14 +94,14 @@ void rewrapCampaign(float w, float l0, float emptyheight, vector theFontSize)
 entity makeXonoticCampaignList()
 {
        entity me;
-       me = spawnXonoticCampaignList();
+       me = NEW(XonoticCampaignList);
        me.configureXonoticCampaignList(me);
        return me;
 }
 void XonoticCampaignList_configureXonoticCampaignList(entity me)
 {
        me.configureXonoticListBox(me);
-       me.campaignGlob = search_begin("maps/campaign*.txt", TRUE, TRUE);
+       me.campaignGlob = search_begin("maps/campaign*.txt", true, true);
        me.loadCvars(me);
        me.campaignGo(me, 0); // takes care of enabling/disabling buttons too
 }
@@ -234,7 +239,7 @@ void XonoticCampaignList_doubleClickListBoxItem(entity me, float i, vector where
 {
        CampaignList_LoadMap(me, me);
 }
-void XonoticCampaignList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
+void XonoticCampaignList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected)
 {
        string s;
        vector theColor;