Add support for custom mission timers: UserInterfaceGlobal

This commit is contained in:
abcdefg30
2015-05-16 01:27:14 +02:00
parent 852ea87daa
commit 35374d168f
7 changed files with 95 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using OpenRA.Graphics;
using OpenRA.Scripting;
namespace OpenRA.Mods.Common.Scripting.Global
{
[ScriptGlobal("HSLColor")]
public class HSLColorGlobal : ScriptGlobal
{
public HSLColorGlobal(ScriptContext context)
: base(context) { }
[Desc("Create a new HSL color with the specified hue/saturation/luminosity.")]
public HSLColor New(int hue, int saturation, int luminosity)
{
var h = (byte)hue.Clamp(0, 255);
var s = (byte)saturation.Clamp(0, 255);
var l = (byte)luminosity.Clamp(0, 255);
return new HSLColor(h, s, l);
}
}
}