public override string Compile() { if (IsEnhancedClient) { return(String.Empty); } var compiled = String.Empty; if (!VirtualAsset.IsNullOrEmpty(_Asset)) { _Asset.ForEach( (x, y, c) => { if (!c.IsEmpty && c != Color.Transparent) { compiled += Compile(x, y, 1, 1, c); } }); } if (String.IsNullOrWhiteSpace(compiled)) { compiled = Compile(_X, _Y, Width, Height, Color.Transparent); } return(compiled); }
public override void AppendTo(IGumpWriter disp) { if (IsEnhancedClient) { AppendEmptyLayout(disp); return; } var first = true; if (!VirtualAsset.IsNullOrEmpty(_Asset)) { _Asset.ForEach( (x, y, c) => { if (!c.IsEmpty && c != Color.Transparent) { AppendTo(disp, ref first, x, y, 1, 1, c); } }); } if (first) { AppendTo(disp, ref first, _X, _Y, Width, Height, Color.Transparent); } }
public virtual void AddAsset(int x, int y, VirtualAsset asset) { Add(new GumpAsset(x, y, asset)); }
protected bool LoadAsset(string path) { return(!VirtualAsset.IsNullOrEmpty(VirtualAsset.LoadAsset(path))); }
/// <summary> /// Reloads a single virtual asset. /// </summary> /// <param name="self">The asset to reload.</param> public static void Reload(this VirtualAsset self) => ((patch_VirtualAsset)(object)self).Reload();
public GumpAsset(int x, int y, VirtualAsset asset) { _X = x; _Y = y; _Asset = asset; }
public GumpAsset(int x, int y, FileInfo file) : this(x, y, VirtualAsset.LoadAsset(file)) { }
public GumpAsset(int x, int y, Uri url) : this(x, y, VirtualAsset.LoadAsset(url)) { }
public GumpAsset(int x, int y, string path) : this(x, y, VirtualAsset.LoadAsset(path)) { }
public override void Dispose() { _Asset = null; base.Dispose(); }