182 lines
3.8 KiB
Plaintext
182 lines
3.8 KiB
Plaintext
drawText(text, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort)
|
|
{
|
|
hud = self createFontString(font, fontScale);
|
|
hud setText(text);
|
|
hud.x = x;
|
|
hud.y = y;
|
|
hud.color = color;
|
|
hud.alpha = alpha;
|
|
hud.glowColor = glowColor;
|
|
hud.glowAlpha = glowAlpha;
|
|
hud.sort = sort;
|
|
hud.alpha = alpha;
|
|
hud.archived = false;
|
|
return hud;
|
|
}
|
|
|
|
drawShader(shader, x, y, width, height, color, alpha, sort)
|
|
{
|
|
hud = newClientHudElem(self);
|
|
hud.elemtype = "icon";
|
|
hud.color = color;
|
|
hud.alpha = alpha;
|
|
hud.sort = sort;
|
|
hud.children = [];
|
|
hud setParent(level.uiParent);
|
|
hud setShader(shader, width, height);
|
|
hud.x = x;
|
|
hud.y = y;
|
|
hud.archived = false;
|
|
return hud;
|
|
}
|
|
|
|
drawText2(text, font, fontScale, align, relative, x, y, color, alpha, sort)
|
|
{
|
|
hud = self createFontString(font, fontScale);
|
|
hud setPoint( align, relative, x, y );
|
|
hud.color = color;
|
|
hud.alpha = alpha;
|
|
hud.archived = false;
|
|
hud.hideWhenInMenu = true;
|
|
hud.sort = sort;
|
|
|
|
level.result += 1;
|
|
hud setText(text);
|
|
level notify("textset");
|
|
|
|
return hud;
|
|
}
|
|
|
|
setMenuColor(color)
|
|
{
|
|
|
|
|
|
self.EPI["animation"] FadeOverTime(0.2);
|
|
self.EPI["scroller"] FadeOverTime(0.2);
|
|
self.EPI["line"] FadeOverTime(0.2);
|
|
self.EPI["line2"] FadeOverTime(0.2);
|
|
self.EPI["line3"] FadeOverTime(0.2);
|
|
self.EPI["line4"] FadeOverTime(0.2);
|
|
self.EPI["animation"].color = color;
|
|
self.EPI["scroller"].color = color;
|
|
self.EPI["backgrounddesign"].color = color;
|
|
self.EPI["line"].color = color;
|
|
self.EPI["line2"].color = color;
|
|
self.EPI["line3"].color = color;
|
|
self.EPI["line4"].color = color;
|
|
self.EPI["options"].glowColor = color;
|
|
|
|
}
|
|
|
|
addColor(name, rgb)
|
|
{
|
|
level.Private["colors"][name] = rgb;
|
|
}
|
|
|
|
color(name)
|
|
{
|
|
return level.Private["colors"][name];
|
|
}
|
|
|
|
setColor(elem, color)
|
|
{
|
|
self.Private["colors"][elem] = color;
|
|
}
|
|
|
|
//Shaders
|
|
AS(name, shaderName)
|
|
{
|
|
level.Private["shaders"][name] = shaderName;
|
|
}
|
|
|
|
shader(name)
|
|
{
|
|
return level.Private["shaders"][name];
|
|
}
|
|
|
|
setShader(elem, shader)
|
|
{
|
|
self.Private["shaders"][elem] = shader;
|
|
}
|
|
|
|
changeShader(shader)
|
|
{
|
|
self.EPI["header"] destroy();
|
|
self.Private["header"] destroy();
|
|
setShader("header", shader);
|
|
self.Private["header"].shader = shader;
|
|
shaders = self.Private["shaders"];
|
|
self.Private["header"] = self drawShader(shaders["header"], 235, -34, 200, 70, (1, 1, 1), 255, 1);
|
|
self.Private["header"].foreground = true;
|
|
}
|
|
|
|
UIMessage(header, message, glowcolor, duration, icon)
|
|
{
|
|
notifyData = spawnstruct();
|
|
notifyData.titleText = header;
|
|
notifyData.notifyText = message;
|
|
notifyData.glowColor = glowcolor;
|
|
notifyData.duration = duration;
|
|
if(isDefined(icon))
|
|
notifyData.iconName = icon;
|
|
else
|
|
notifyData.iconName = "lui_loader_no_offset";
|
|
notifyData.font = "hudbig";
|
|
notifyData.hideWhenInMenu = false;
|
|
self thread maps\mp\gametypes\_hud_message::notifyMessage(notifyData);
|
|
}
|
|
|
|
rainbowMenu()
|
|
{
|
|
self endon("stop_rainbow_menu");
|
|
for(;;)
|
|
{
|
|
self setMenuColor((1, 0, 0));
|
|
wait 0.3;
|
|
self setMenuColor((1, 0.502, 0));
|
|
wait 0.3;
|
|
self setMenuColor((1, 1, 0));
|
|
wait 0.3;
|
|
self setMenuColor((0.047, 0.910, 0));
|
|
wait 0.3;
|
|
self setMenuColor((0, 1, 0));
|
|
wait 0.3;
|
|
self setMenuColor((0.157, 0.804, 0.941));
|
|
wait 0.3;
|
|
self setMenuColor((0, 255, 255));
|
|
wait 0.3;
|
|
self setMenuColor((0, 0.502, 1));
|
|
wait 0.3;
|
|
self setMenuColor((0, 0, 1));
|
|
wait 0.3;
|
|
self setMenuColor((1, 0, 1));
|
|
wait 0.3;
|
|
self setMenuColor((0.502, 0, 1));
|
|
wait 0.3;
|
|
self setMenuColor((0.502, 0.502, 0.502));
|
|
wait 0.3;
|
|
self setMenuColor((1, 1, 1));
|
|
wait 0.3;
|
|
}
|
|
|
|
}
|
|
|
|
ToggleRainbowMenu()
|
|
{
|
|
|
|
self.rainbow_menu = booleanOpposite(self.rainbow_menu);
|
|
|
|
if(self.rainbow_menu)
|
|
{
|
|
self thread rainbowMenu();
|
|
}
|
|
else
|
|
{
|
|
self notify("stop_rainbow_menu");
|
|
}
|
|
onOrOff(self.rainbow_menu, "Rainbow Menu");
|
|
}
|
|
|
|
|
|
|