+}
+
+void getAllHUDSkins(entity me, int sortbuf)
+{
+ int n = buf_getsize(sortbuf);
+ for(int i = 0; i < n; ++i)
+ {
+ string entry = bufstr_get(sortbuf, i);
+ int ofs = strstrofs(entry, "/", 0);
+ string s = "";
+ string filename = entry;
+ if(ofs >= 0)
+ {
+ s = substring(entry, ofs + 1, -1); // skip initial "/"
+ s = strcat(s, "/");
+ bufstr_set(me.listHUDSkin, i * HUDSKINPARM_COUNT + HUDSKINPARM_PATH, s);
+ filename = strcat(s, substring(entry, 0, ofs));
+ }
+ else
+ ofs = strlen(entry);
+ s = substring(entry, 4, ofs - 4 - 4); // remove "hud_" prefix and ".cfg" suffix
+ bufstr_set(me.listHUDSkin, i * HUDSKINPARM_COUNT + HUDSKINPARM_NAME, s);
+
+ int fh = fopen(filename, FILE_READ);
+ if(fh < 0)
+ continue;
+ while((s = fgets(fh)) && substring(s, 0, 2) == "//")
+ {
+ tokenize_console(substring(s, 2, -1));
+ if(argv(0) == "title")
+ bufstr_set(me.listHUDSkin, i * HUDSKINPARM_COUNT + HUDSKINPARM_TITLE, argv(1));
+ else if(argv(0) == "author")
+ bufstr_set(me.listHUDSkin, i * HUDSKINPARM_COUNT + HUDSKINPARM_AUTHOR, argv(1));
+ }
+ fclose(fh);
+ }