COLOR_DIALOG_MODEL '1 1 1'
COLOR_DIALOG_CROSSHAIR '1 1 1'
COLOR_DIALOG_HUD '1 1 1'
-COLOR_DIALOG_SCREENSHOTVIEWER '1 1 1'
COLOR_DIALOG_SERVERINFO '1 1 1'
+COLOR_DIALOG_SCREENSHOTVIEWER '1 1 1'
COLOR_DIALOG_FIRSTRUN '1 1 1'
+COLOR_DIALOG_WELCOME '1 1 1'
COLOR_DIALOG_CVARS '1 0.2 0.15'
COLOR_DIALOG_HUDCONFIRM '1 0.2 0.15'
return true;
}
+bool ImageExists(string img)
+{
+ if(fexists(strcat(img, ".tga"))) return true;
+ if(fexists(strcat(img, ".png"))) return true;
+ if(fexists(strcat(img, ".jpg"))) return true;
+ if(fexists(strcat(img, ".pcx"))) return true;
+
+ return false;
+}
+
// Databases (hash tables)
const float DB_BUCKETS = 8192;
void db_save(float db, string pFilename)
string ftos_decimals(float number, float decimals);
bool fexists(string f);
+bool ImageExists(string img);
vector colormapPaletteColor(float c, float isPants);
if(argv(0) == "directmenu" || argv(0) == "directpanelhudmenu")
{
- float i;
+ int i;
entity e;
string s;
string filter = string_null;
}
void XonoticWelcomeDialog_readInputArgs(entity me, float argsbuf)
{
- float i = 0;
+ int i = 0;
string s;
welcomeDialog_resetStrings(me);
while((s = bufstr_get(argsbuf, i)) != "")
}
void XonoticTextListBox_setText(entity me, string theText)
{
- float i, k;
+ int i, k;
string ts;
if(me.textbuf >= 0)
buf_del(me.textbuf);
WriteString(MSG_ONE, "128.03.192.999"); // FIXME: send the real server ip
WriteString(MSG_ONE, autocvar_hostname);
WriteString(MSG_ONE, getwelcomemessage());
- WriteString(MSG_ONE, strcat("128.03.192.999", "/banner"));
+ string pic = strcat("128.03.192.999", "/banner");
+ if(ImageExists(pic))
+ {
+ print("Warning: image %s doesn't exist!\n", pic);
+ pic = "";
+ }
+ WriteString(MSG_ONE, pic);
}
void serverinfo_pic_send()
{
+ string pic = strcat("128.03.192.999", "/banner");
+ if(ImageExists(pic))
+ {
+ print("Cannot send %s, file doesn't exist!\n", pic);
+ return;
+ }
msg_entity = self;
WriteByte(MSG_ONE, SVC_TEMPENTITY);
WriteByte(MSG_ONE, TE_CSQC_SERVERINFO_PIC);
- WritePicture(MSG_ONE, strcat("128.03.192.999", "/banner"), 3072);
+ WritePicture(MSG_ONE, pic, 3072);
}
/*