-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImageDatabaseModule.cs
51 lines (46 loc) · 1.64 KB
/
ImageDatabaseModule.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using Oxide.Core;
using Oxide.Core.Plugins;
using System;
using System.Collections.Generic;
namespace Oxide.Ext.CarbonAliases
{
public class ImageDatabaseModule
{
private static Plugin ImageLibrary;
public ImageDatabaseModule() {
ImageLibrary = Interface.GetMod().RootPluginManager.GetPlugin("ImageLibrary");
if (ImageLibrary == null)
Interface.Oxide.LogWarning("ImageLibrary not found! Images will print errors!");
else
Interface.Oxide.LogInfo("ImageLibrary is being used in Carbon to Oxide Conversion...");
}
public void QueueBatch(bool @override, IEnumerable<string> urls)
{
foreach (var url in urls)
ImageLibrary.Call<bool>("AddImage", url, url, 0uL);
}
public void QueueBatch(float scale, bool @override, IEnumerable<string> urls)
{
foreach (var url in urls)
ImageLibrary.Call<bool>("AddImage", url, url, 0uL);
}
public void AddMap(string key, string url)
{
ImageLibrary.Call<bool>("AddImage", url, key, 0uL);
}
public void RemoveMap(string key, string url)
{
}
public uint GetImage(string key, float scale = 0, bool silent = false)
{
return Convert.ToUInt32(ImageLibrary.Call<string>("GetImage", key));
}
public string GetImageString(string key, float scale = 0, bool silent = false)
{
return ImageLibrary.Call<string>("GetImage", key);
}
public void DeleteImage(string url, float scale = 0)
{
}
}
}