X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fskinlist.qc;h=c849254e8b85c66a925a5f2d8bcdc28b1d285bbb;hb=86c9dc7c3696c329496b06375c1e79fb407401ce;hp=9990c83fe162ee2c2ab4f37ea7e1c43a1fcf24ce;hpb=530e06120a7b41f6175b1144fedf6903da8c13b0;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/skinlist.qc b/qcsrc/menu/xonotic/skinlist.qc index 9990c83fe..c849254e8 100644 --- a/qcsrc/menu/xonotic/skinlist.qc +++ b/qcsrc/menu/xonotic/skinlist.qc @@ -1,17 +1,19 @@ -#ifdef INTERFACE -CLASS(XonoticSkinList) EXTENDS(XonoticListBox) - METHOD(XonoticSkinList, configureXonoticSkinList, void(entity)) +#ifndef SKINLIST_H +#define SKINLIST_H +#include "listbox.qc" +CLASS(XonoticSkinList, XonoticListBox) + METHOD(XonoticSkinList, configureXonoticSkinList, void(entity)); ATTRIB(XonoticSkinList, rowsPerItem, float, 4) - METHOD(XonoticSkinList, resizeNotify, void(entity, vector, vector, vector, vector)) - METHOD(XonoticSkinList, drawListBoxItem, void(entity, float, vector, float)) - METHOD(XonoticSkinList, getSkins, void(entity)) - METHOD(XonoticSkinList, setSkin, void(entity)) - METHOD(XonoticSkinList, loadCvars, void(entity)) - METHOD(XonoticSkinList, saveCvars, void(entity)) - METHOD(XonoticSkinList, skinParameter, string(entity, float, float)) - METHOD(XonoticSkinList, doubleClickListBoxItem, void(entity, float, vector)) - METHOD(XonoticSkinList, keyDown, float(entity, float, float, float)) - METHOD(XonoticSkinList, destroy, void(entity)) + METHOD(XonoticSkinList, resizeNotify, void(entity, vector, vector, vector, vector)); + METHOD(XonoticSkinList, drawListBoxItem, void(entity, int, vector, bool, bool)); + METHOD(XonoticSkinList, getSkins, void(entity)); + METHOD(XonoticSkinList, setSkin, void(entity)); + METHOD(XonoticSkinList, loadCvars, void(entity)); + METHOD(XonoticSkinList, saveCvars, void(entity)); + METHOD(XonoticSkinList, skinParameter, string(entity, float, float)); + METHOD(XonoticSkinList, doubleClickListBoxItem, void(entity, float, vector)); + METHOD(XonoticSkinList, keyDown, float(entity, float, float, float)); + METHOD(XonoticSkinList, destroy, void(entity)); ATTRIB(XonoticSkinList, skinlist, float, -1) ATTRIB(XonoticSkinList, realFontSize, vector, '0 0 0') @@ -42,7 +44,7 @@ const float SKINPARM_COUNT = 4; entity makeXonoticSkinList() { entity me; - me = spawnXonoticSkinList(); + me = NEW(XonoticSkinList); me.configureXonoticSkinList(me); return me; } @@ -64,7 +66,7 @@ void XonoticSkinList_loadCvars(entity me) { if(me.skinParameter(me, i, SKINPARM_NAME) == s) { - me.selectedItem = i; + me.setSelected(me, i); break; } } @@ -83,7 +85,7 @@ string XonoticSkinList_skinParameter(entity me, float i, float key) void XonoticSkinList_getSkins(entity me) { float glob, buf, i, n, fh; - string s; + string s, name; buf = buf_create(); glob = search_begin("gfx/menu/*/skinvalues.txt", true, true); @@ -98,7 +100,8 @@ void XonoticSkinList_getSkins(entity me) for(i = 0; i < n; ++i) { s = search_getfilename(glob, i); - bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_NAME, substring(s, 9, strlen(s) - 24)); // the * part + name = substring(s, 9, strlen(s) - 24); // the * part + bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_NAME, name); bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_TITLE, _("