private bool AddImage(string url) //(string url, string imageName, ulong imageId, Action callback = null) { if (ImageLibrary == null || !ImageLibrary.IsLoaded) { NextTick(() => AddImage(url)); Puts("Image queued"); return(false); } else { Puts("Image added"); return(ImageLibrary.AddImage(url, url, 1L)); } }
private void AddImage(string shortname) { if (ImageLibrary == null || !ImageLibrary.IsLoaded) { NextTick(() => AddImage(shortname)); } else { string url = shortname; if (!url.StartsWith("http") && !url.StartsWith("www") && !url.StartsWith("file://")) { url = $"{dataDirectory}{shortname}.png"; } ImageLibrary.AddImage(url, shortname, 0); } }
private void LoadImages() { if (!ImageLibrary.IsReady()) { timer.In(10, () => LoadImages()); Puts("[Warning] Waiting for Image Library to finish processing images"); return; } ImageLibrary.AddImage(image1, "crosshair1", 0); ImageLibrary.AddImage(image2, "crosshair2", 0); ImageLibrary.AddImage(image3, "crosshair3", 0); ImageLibrary.AddImage(image4, "crosshair4", 0); ImageLibrary.AddImage(image5, "crosshair5", 0); ImageLibrary.AddImage(image6, "crosshair6", 0); ImageLibrary.AddImage(image7, "crosshair7", 0); ImageLibrary.AddImage(image8, "crosshair8", 0); ImageLibrary.AddImage(background, "background", 0); ImageLibrary.AddImage(background2, "background2", 0); isILReady = true; Puts("Crosshair images loaded"); }
private void OnServerInitialized() { if (bProtectionEnabled == true) { RemoveOldUsers(); ProtectionTimer = timer.Repeat(iUpdateTimerInterval, 0, () => UpdateProtectedList(true)); string minutes = Convert.ToInt32(TimeSpan.FromSeconds(iTime).TotalMinutes).ToString(); Puts("Start Protection has been enabled [Minutes: " + minutes + "] (type /sp toggle to disable)."); foreach (BasePlayer player in BasePlayer.activePlayerList) { if (storedData.Players.ContainsKey(player.userID)) { DestroyUi(player); } } } else { Puts("Start Protection is not enabled (type /sp toggle to enable)."); } ImageLibrary.AddImage(UIIcon, "noak47", 0); LoadImage(); }