C#:
//Requires: VehicleLicence
using Oxide.Game.Rust.Cui;
using UnityEngine;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace Oxide.Plugins {
[Info("RustyBangers", "MikeHawke", "1.1.1")]
[Description("UI For Vehicle Licence")]
class RustyBangers : RustPlugin {
private VehicleLicence vl;
void Unload() {
foreach (BasePlayer current in BasePlayer.activePlayerList) {
Destroy(current);
}
}
void OnServerInitialized() {
vl = VehicleLicence.Instance;
LoadConfigVariables();
SaveConfig(configData);
}
#region ConfigVar
private ConfigData configData;
class ConfigData {
public Genericset Genericsettings = new Genericset();
public P1Permissions Page1Settings = new P1Permissions();
public P2Permissions Page2Settings = new P2Permissions();
public P3Permissions Page3Settings = new P3Permissions();
public Pages PageSettings = new Pages();
public Button ButtonSettings = new Button();
}
class Genericset {
[JsonProperty(PropertyName = "Command List", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<string> items = new List<string> {
"mini", "tcop", "hab", "ch47", "rhib", "row", "sedan", "horse", "smallchassis", "mediumchassis", "largechassis", "smallcar", "mediumcar", "largecar", "workcart", "magnetcrane", "subsolo", "subduo"
}
;
}
class P1Permissions {
[JsonProperty(PropertyName = "Slot 1 Permission")]
public string Slot1Perm = "vehiclelicence.minicopter";
[JsonProperty(PropertyName = "Slot 1 Image")]
public string Slot1Img = "https://i.imgur.com/1eCWmxC.png";
[JsonProperty(PropertyName = "Slot 2 Permission")]
public string Slot2Perm = "vehiclelicence.transportcopter";
[JsonProperty(PropertyName = "Slot 2 Image")]
public string Slot2Img = "https://i.imgur.com/KMXvIiC.png";
[JsonProperty(PropertyName = "Slot 3 Permission")]
public string Slot3Perm = "vehiclelicence.hotairballoon";
[JsonProperty(PropertyName = "Slot 3 Image")]
public string Slot3Img = "https://i.imgur.com/huK1pU3.png";
[JsonProperty(PropertyName = "Slot 4 Permission")]
public string Slot4Perm = "vehiclelicence.chinook";
[JsonProperty(PropertyName = "Slot 4 Image")]
public string Slot4Img = "https://i.imgur.com/MQRcEcv.png";
[JsonProperty(PropertyName = "Slot 5 Permission")]
public string Slot5Perm = "vehiclelicence.rhib";
[JsonProperty(PropertyName = "Slot 5 Image")]
public string Slot5Img = "https://i.imgur.com/jXf4fNl.png";
[JsonProperty(PropertyName = "Slot 6 Permission")]
public string Slot6Perm = "vehiclelicence.rowboat";
[JsonProperty(PropertyName = "Slot 6 Image")]
public string Slot6Img = "https://i.imgur.com/SlE8lLs.png";
[JsonProperty(PropertyName = "Slot 7 Permission")]
public string Slot7Perm = "vehiclelicence.sedan";
[JsonProperty(PropertyName = "Slot 7 Image")]
public string Slot7Img = "https://i.imgur.com/aNUvab6.png";
[JsonProperty(PropertyName = "Slot 8 Permission")]
public string Slot8Perm = "vehiclelicence.ridablehorse";
[JsonProperty(PropertyName = "Slot 8 Image")]
public string Slot8Img = "https://i.imgur.com/eZvi0n2.png";
}
class P2Permissions {
[JsonProperty(PropertyName = "Slot 1 Permission")]
public string Slot1Perm = "vehiclelicence.smallchassis";
[JsonProperty(PropertyName = "Slot 1 Image")]
public string Slot1Img = "https://i.imgur.com/Nlgsj4h.png";
[JsonProperty(PropertyName = "Slot 2 Permission")]
public string Slot2Perm = "vehiclelicence.mediumchassis";
[JsonProperty(PropertyName = "Slot 2 Image")]
public string Slot2Img = "https://i.imgur.com/WX0iPUB.png";
[JsonProperty(PropertyName = "Slot 3 Permission")]
public string Slot3Perm = "vehiclelicence.largechassis";
[JsonProperty(PropertyName = "Slot 3 Image")]
public string Slot3Img = "https://i.imgur.com/0JSrdCy.png";
[JsonProperty(PropertyName = "Slot 4 Permission")]
public string Slot4Perm = "vehiclelicence.smallmodularcar";
[JsonProperty(PropertyName = "Slot 4 Image")]
public string Slot4Img = "https://i.imgur.com/7QsY72X.png";
[JsonProperty(PropertyName = "Slot 5 Permission")]
public string Slot5Perm = "vehiclelicence.mediummodularcar";
[JsonProperty(PropertyName = "Slot 5 Image")]
public string Slot5Img = "https://i.imgur.com/65VPddU.png";
[JsonProperty(PropertyName = "Slot 6 Permission")]
public string Slot6Perm = "vehiclelicence.largemodularcar";
[JsonProperty(PropertyName = "Slot 6 Image")]
public string Slot6Img = "https://i.imgur.com/zkmYF9d.png";
[JsonProperty(PropertyName = "Slot 7 Permission")]
public string Slot7Perm = "vehiclelicence.workcart";
[JsonProperty(PropertyName = "Slot 7 Image")]
public string Slot7Img = "https://i.imgur.com/TU0DD1v.png";
[JsonProperty(PropertyName = "Slot 8 Permission")]
public string Slot8Perm = "vehiclelicence.magnetcrane";
[JsonProperty(PropertyName = "Slot 8 Image")]
public string Slot8Img = "https://i.imgur.com/sXMrzuq.png";
}
class P3Permissions {
[JsonProperty(PropertyName = "Slot 1 Permission")]
public string Slot1Perm = "vehiclelicence.submarinesolo";
[JsonProperty(PropertyName = "Slot 1 Image")]
public string Slot1Img = "https://i.imgur.com/bu3vBjM.png";
[JsonProperty(PropertyName = "Slot 2 Permission")]
public string Slot2Perm = "vehiclelicence.submarineduo";
[JsonProperty(PropertyName = "Slot 2 Image")]
public string Slot2Img = "https://i.imgur.com/To7tiMp.png";
[JsonProperty(PropertyName = "Slot 3 Permission")]
public string Slot3Perm = "";
[JsonProperty(PropertyName = "Slot 3 Image")]
public string Slot3Img = "https://i.imgur.com/6RjWdNd.png";
[JsonProperty(PropertyName = "Slot 4 Permission")]
public string Slot4Perm = "";
[JsonProperty(PropertyName = "Slot 4 Image")]
public string Slot4Img = "https://i.imgur.com/6RjWdNd.png";
[JsonProperty(PropertyName = "Slot 5 Permission")]
public string Slot5Perm = "";
[JsonProperty(PropertyName = "Slot 5 Image")]
public string Slot5Img = "https://i.imgur.com/6RjWdNd.png";
[JsonProperty(PropertyName = "Slot 6 Permission")]
public string Slot6Perm = "";
[JsonProperty(PropertyName = "Slot 6 Image")]
public string Slot6Img = "https://i.imgur.com/6RjWdNd.png";
[JsonProperty(PropertyName = "Slot 7 Permission")]
public string Slot7Perm = "";
[JsonProperty(PropertyName = "Slot 7 Image")]
public string Slot7Img = "https://i.imgur.com/6RjWdNd.png";
[JsonProperty(PropertyName = "Slot 8 Permission")]
public string Slot8Perm = "";
[JsonProperty(PropertyName = "Slot 8 Image")]
public string Slot8Img = "https://i.imgur.com/6RjWdNd.png";
}
class Pages {
[JsonProperty(PropertyName = "Home Icon Image")]
public string HomeImg = "https://i.imgur.com/ZTNqNQM.png";
[JsonProperty(PropertyName = "Page 2 active")]
public bool Page2 = true;
[JsonProperty(PropertyName = "Page 2 Icon Image")]
public string Page2Img = "https://i.imgur.com/W9Kr4jB.png";
[JsonProperty(PropertyName = "Page 3 active")]
public bool Page3 = true;
[JsonProperty(PropertyName = "Page 3 Icon Image")]
public string Page3Img = "https://i.imgur.com/qi5kX0c.png";
}
class Button {
[JsonProperty(PropertyName = "Buy Button Color")]
public string buybtncol = "1 0 0 1";
[JsonProperty(PropertyName = "Deliver Button Color")]
public string delbtncol = "0 1 0 1";
[JsonProperty(PropertyName = "Recall Button Color")]
public string recbtncol = "0 0 1 1";
[JsonProperty(PropertyName = "Kill Button Color")]
public string killbtncol = "0.5 0.5 0.5 1";
}
#endregion
private void LoadConfigVariables() {
configData = Config.ReadObject<ConfigData>();
SaveConfig(configData);
}
protected override void LoadDefaultConfig() {
Puts("Creating new config file.");
var config = new ConfigData();
SaveConfig(config);
}
void SaveConfig(ConfigData config) {
Config.WriteObject(config, true);
}
void Destroy(BasePlayer player) {
CuiHelper.DestroyUi(player, "Rusty");
}
[ChatCommand("Rusty")]
void RustyUICall(BasePlayer player) {
if (permission.UserHasPermission(player.userID.ToString(), "vehiclelicence.use")) {
RBUI(player);
}
else {
SendReply(player, "You do not have permission to use this command!");
return;
}
}
[ConsoleCommand("RBOpen")]
void RustyUICall(ConsoleSystem.Arg arg) {
if (arg.Player() == null) return;
if (permission.UserHasPermission(arg.Player().userID.ToString(), "vehiclelicence.use")) {
RBUI(arg.Player());
}
else {
SendReply(arg.Player(), "You do not have permission to use this command!");
return;
}
}
void RBUI(BasePlayer player) {
CuiHelper.DestroyUi(player, "Rusty");
var RBelements = new CuiElementContainer();
var RustyBangers = RBelements.Add(new CuiPanel {
Image = {
Color = "1 0.1 0.1 0"
}
, RectTransform = {
AnchorMin = "0.02 0.063", AnchorMax = "0.957 0.965"
}
, CursorEnabled = true, FadeOut = 0.1f
}
, "Overlay", "Rusty");
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = "https://i.imgur.com/BDtHARN.png", FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0 0", AnchorMax = $"1 1"
}
}
}
);
if (configData.PageSettings.Page2 == true) {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.PageSettings.Page2Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.451 0.109", AnchorMax = $"0.549 0.278"
}
}
}
);
RBelements.Add(new CuiButton {
Button = {
Command = "Page2", Color = "1 0 0 0"
}
, RectTransform = {
AnchorMin = $"0.451 0.109", AnchorMax = $"0.549 0.278"
}
, Text = {
Text = "", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
}
if (configData.PageSettings.Page3 == true) {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.PageSettings.Page3Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.442 0.555", AnchorMax = $"0.54 0.725"
}
}
}
);
RBelements.Add(new CuiButton {
Button = {
Command = "Page3", Color = "1 0 0 0"
}
, RectTransform = {
AnchorMin = $"0.442 0.555", AnchorMax = $"0.54 0.725"
}
, Text = {
Text = "", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
}
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page1Settings.Slot1Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.086 0.492", AnchorMax = $"0.18 0.663"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page1Settings.Slot2Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.257 0.494", AnchorMax = $"0.351 0.665"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page1Settings.Slot3Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.087 0.194", AnchorMax = $"0.181 0.365"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page1Settings.Slot4Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.257 0.195", AnchorMax = $"0.351 0.366"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page1Settings.Slot5Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.657 0.482", AnchorMax = $"0.751 0.652"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page1Settings.Slot6Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.828 0.485", AnchorMax = $"0.922 0.655"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page1Settings.Slot7Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.657 0.183", AnchorMax = $"0.751 0.354"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page1Settings.Slot8Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.828 0.186", AnchorMax = $"0.922 0.357"
}
}
}
);
if (!permission.UserHasPermission(player.userID.ToString(), configData.Page1Settings.Slot1Perm) || configData.Page1Settings.Slot1Perm == "") {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = "https://i.imgur.com/i6L98ZC.png", FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.084 0.485", AnchorMax = $"0.184 0.669"
}
}
}
);
}
else {
RBelements.Add(new CuiButton {
Button = {
Command = "RBbuy 1", Color = configData.ButtonSettings.buybtncol
}
, RectTransform = {
AnchorMin = "0.069 0.402", AnchorMax = "0.107 0.463"
}
, Text = {
Text = "Buy", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBdel 1", Color = configData.ButtonSettings.delbtncol
}
, RectTransform = {
AnchorMin = "0.106 0.402", AnchorMax = "0.143 0.463"
}
, Text = {
Text = "Deliver", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBRec 1", Color = configData.ButtonSettings.recbtncol
}
, RectTransform = {
AnchorMin = "0.143 0.402", AnchorMax = "0.181 0.463"
}
, Text = {
Text = "Recall", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBkill 1", Color = configData.ButtonSettings.killbtncol
}
, RectTransform = {
AnchorMin = "0.18 0.402", AnchorMax = "0.218 0.463"
}
, Text = {
Text = "Kill", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
}
if (!permission.UserHasPermission(player.userID.ToString(), configData.Page1Settings.Slot2Perm) || configData.Page1Settings.Slot2Perm == "") {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = "https://i.imgur.com/i6L98ZC.png", FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.257 0.486", AnchorMax = $"0.357 0.671"
}
}
}
);
}
else {
RBelements.Add(new CuiButton {
Button = {
Command = "RBbuy 2", Color = configData.ButtonSettings.buybtncol
}
, RectTransform = {
AnchorMin = "0.223 0.402", AnchorMax = "0.261 0.463"
}
, Text = {
Text = "Buy", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBdel 2", Color = configData.ButtonSettings.delbtncol
}
, RectTransform = {
AnchorMin = "0.261 0.402", AnchorMax = "0.298 0.463"
}
, Text = {
Text = "Deliver", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBRec 2", Color = configData.ButtonSettings.recbtncol
}
, RectTransform = {
AnchorMin = "0.298 0.402", AnchorMax = "0.336 0.463"
}
, Text = {
Text = "Recall", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBkill 2", Color = configData.ButtonSettings.killbtncol
}
, RectTransform = {
AnchorMin = "0.335 0.402", AnchorMax = "0.373 0.463"
}
, Text = {
Text = "Kill", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
}
if (!permission.UserHasPermission(player.userID.ToString(), configData.Page1Settings.Slot3Perm) || configData.Page1Settings.Slot3Perm == "") {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = "https://i.imgur.com/i6L98ZC.png", FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.081 0.185", AnchorMax = $"0.181 0.369"
}
}
}
);
}
else {
RBelements.Add(new CuiButton {
Button = {
Command = "RBbuy 3", Color = configData.ButtonSettings.buybtncol
}
, RectTransform = {
AnchorMin = "0.069 0.102", AnchorMax = "0.107 0.163"
}
, Text = {
Text = "Buy", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBdel 3", Color = configData.ButtonSettings.delbtncol
}
, RectTransform = {
AnchorMin = "0.107 0.102", AnchorMax = "0.144 0.163"
}
, Text = {
Text = "Deliver", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBRec 3", Color = configData.ButtonSettings.recbtncol
}
, RectTransform = {
AnchorMin = "0.144 0.102", AnchorMax = "0.182 0.163"
}
, Text = {
Text = "Recall", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBkill 3", Color = configData.ButtonSettings.killbtncol
}
, RectTransform = {
AnchorMin = "0.181 0.102", AnchorMax = "0.218 0.163"
}
, Text = {
Text = "Kill", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
}
if (!permission.UserHasPermission(player.userID.ToString(), configData.Page1Settings.Slot4Perm) || configData.Page1Settings.Slot4Perm == "") {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = "https://i.imgur.com/i6L98ZC.png", FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.253 0.188", AnchorMax = $"0.353 0.372"
}
}
}
);
}
else {
RBelements.Add(new CuiButton {
Button = {
Command = "RBbuy 4", Color = configData.ButtonSettings.buybtncol
}
, RectTransform = {
AnchorMin = "0.223 0.102", AnchorMax = "0.261 0.163"
}
, Text = {
Text = "Buy", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBdel 4", Color = configData.ButtonSettings.delbtncol
}
, RectTransform = {
AnchorMin = "0.261 0.102", AnchorMax = "0.298 0.163"
}
, Text = {
Text = "Deliver", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBRec 4", Color = configData.ButtonSettings.recbtncol
}
, RectTransform = {
AnchorMin = "0.298 0.102", AnchorMax = "0.336 0.163"
}
, Text = {
Text = "Recall", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBkill 4", Color = configData.ButtonSettings.killbtncol
}
, RectTransform = {
AnchorMin = "0.335 0.102", AnchorMax = "0.373 0.163"
}
, Text = {
Text = "Kill", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
}
if (!permission.UserHasPermission(player.userID.ToString(), configData.Page1Settings.Slot5Perm) || configData.Page1Settings.Slot5Perm == "") {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = "https://i.imgur.com/i6L98ZC.png", FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.654 0.477", AnchorMax = $"0.754 0.662"
}
}
}
);
}
else {
RBelements.Add(new CuiButton {
Button = {
Command = "RBbuy 5", Color = configData.ButtonSettings.buybtncol
}
, RectTransform = {
AnchorMin = "0.612 0.392", AnchorMax = "0.649 0.452"
}
, Text = {
Text = "Buy", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBdel 5", Color = configData.ButtonSettings.delbtncol
}
, RectTransform = {
AnchorMin = "0.649 0.392", AnchorMax = "0.687 0.452"
}
, Text = {
Text = "Deliver", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBRec 5", Color = configData.ButtonSettings.recbtncol
}
, RectTransform = {
AnchorMin = "0.687 0.392", AnchorMax = "0.724 0.452"
}
, Text = {
Text = "Recall", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBkill 5", Color = configData.ButtonSettings.killbtncol
}
, RectTransform = {
AnchorMin = "0.723 0.392", AnchorMax = "0.761 0.452"
}
, Text = {
Text = "Kill", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
}
if (!permission.UserHasPermission(player.userID.ToString(), configData.Page1Settings.Slot6Perm) || configData.Page1Settings.Slot6Perm == "") {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = "https://i.imgur.com/i6L98ZC.png", FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.826 0.475", AnchorMax = $"0.926 0.66"
}
}
}
);
}
else {
RBelements.Add(new CuiButton {
Button = {
Command = "RBbuy 6", Color = configData.ButtonSettings.buybtncol
}
, RectTransform = {
AnchorMin = "0.81 0.392", AnchorMax = "0.848 0.452"
}
, Text = {
Text = "Buy", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBdel 6", Color = configData.ButtonSettings.delbtncol
}
, RectTransform = {
AnchorMin = "0.848 0.392", AnchorMax = "0.885 0.452"
}
, Text = {
Text = "Deliver", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBRec 6", Color = configData.ButtonSettings.recbtncol
}
, RectTransform = {
AnchorMin = "0.885 0.392", AnchorMax = "0.923 0.452"
}
, Text = {
Text = "Recall", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBkill 6", Color = configData.ButtonSettings.killbtncol
}
, RectTransform = {
AnchorMin = "0.923 0.392", AnchorMax = "0.959 0.452"
}
, Text = {
Text = "Kill", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
}
if (!permission.UserHasPermission(player.userID.ToString(), configData.Page1Settings.Slot7Perm) || configData.Page1Settings.Slot7Perm == "") {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = "https://i.imgur.com/i6L98ZC.png", FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.653 0.177", AnchorMax = $"0.753 0.362"
}
}
}
);
}
else {
RBelements.Add(new CuiButton {
Button = {
Command = "RBbuy 7", Color = configData.ButtonSettings.buybtncol
}
, RectTransform = {
AnchorMin = "0.612 0.094", AnchorMax = "0.649 0.154"
}
, Text = {
Text = "Buy", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBdel 7", Color = configData.ButtonSettings.delbtncol
}
, RectTransform = {
AnchorMin = "0.649 0.094", AnchorMax = "0.687 0.154"
}
, Text = {
Text = "Deliver", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBRec 7", Color = configData.ButtonSettings.recbtncol
}
, RectTransform = {
AnchorMin = "0.687 0.094", AnchorMax = "0.724 0.154"
}
, Text = {
Text = "Recall", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBkill 7", Color = configData.ButtonSettings.killbtncol
}
, RectTransform = {
AnchorMin = "0.723 0.094", AnchorMax = "0.761 0.154"
}
, Text = {
Text = "Kill", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
}
if (!permission.UserHasPermission(player.userID.ToString(), configData.Page1Settings.Slot8Perm) || configData.Page1Settings.Slot8Perm == "") {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = "https://i.imgur.com/i6L98ZC.png", FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.824 0.175", AnchorMax = $"0.924 0.36"
}
}
}
);
}
else {
RBelements.Add(new CuiButton {
Button = {
Command = "RBbuy 8", Color = configData.ButtonSettings.buybtncol
}
, RectTransform = {
AnchorMin = "0.782 0.094", AnchorMax = "0.819 0.154"
}
, Text = {
Text = "Buy", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBdel 8", Color = configData.ButtonSettings.delbtncol
}
, RectTransform = {
AnchorMin = "0.819 0.094", AnchorMax = "0.857 0.154"
}
, Text = {
Text = "Deliver", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBRec 8", Color = configData.ButtonSettings.recbtncol
}
, RectTransform = {
AnchorMin = "0.857 0.094", AnchorMax = "0.894 0.154"
}
, Text = {
Text = "Recall", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
RBelements.Add(new CuiButton {
Button = {
Command = "RBkill 8", Color = configData.ButtonSettings.killbtncol
}
, RectTransform = {
AnchorMin = "0.893 0.094", AnchorMax = "0.931 0.154"
}
, Text = {
Text = "Kill", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
}
RBelements.Add(new CuiButton {
Button = {
Command = "rusyclose", Color = "1 0 0 1"
}
, RectTransform = {
AnchorMin = "0.911 0.865", AnchorMax = "0.928 0.895"
}
, Text = {
Text = "X", Color = "0 0 0 1", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
CuiHelper.AddUi(player, RBelements);
}
void RBUI2(BasePlayer player) {
//Change one icon to home
CuiHelper.DestroyUi(player, "Rusty");
var RBelements = new CuiElementContainer();
var RustyBangers = RBelements.Add(new CuiPanel {
Image = {
Color = "1 0.1 0.1 0"
}
, RectTransform = {
AnchorMin = "0.02 0.063", AnchorMax = "0.957 0.965"
}
, CursorEnabled = true, FadeOut = 0.1f
}
, "Overlay", "Rusty");
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = "https://i.imgur.com/BDtHARN.png", FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0 0", AnchorMax = $"1 1"
}
}
}
);
if (configData.PageSettings.Page2 == true) {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.PageSettings.HomeImg, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.451 0.109", AnchorMax = $"0.549 0.278"
}
}
}
);
RBelements.Add(new CuiButton {
Button = {
Command = "Page1", Color = "1 0 0 0"
}
, RectTransform = {
AnchorMin = $"0.451 0.109", AnchorMax = $"0.549 0.278"
}
, Text = {
Text = "", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
}
if (configData.PageSettings.Page3 == true) {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.PageSettings.Page3Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.442 0.555", AnchorMax = $"0.54 0.725"
}
}
}
);
RBelements.Add(new CuiButton {
Button = {
Command = "Page3", Color = "1 0 0 0"
}
, RectTransform = {
AnchorMin = $"0.442 0.555", AnchorMax = $"0.54 0.725"
}
, Text = {
Text = "", FontSize = 11, Align = TextAnchor.MiddleCenter
}
}
, RustyBangers);
}
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page2Settings.Slot1Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.086 0.492", AnchorMax = $"0.18 0.663"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page2Settings.Slot2Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.257 0.494", AnchorMax = $"0.351 0.665"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page2Settings.Slot3Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.087 0.194", AnchorMax = $"0.181 0.365"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page2Settings.Slot4Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.257 0.195", AnchorMax = $"0.351 0.366"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page2Settings.Slot5Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.657 0.482", AnchorMax = $"0.751 0.652"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page2Settings.Slot6Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.828 0.485", AnchorMax = $"0.922 0.655"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page2Settings.Slot7Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.657 0.183", AnchorMax = $"0.751 0.354"
}
}
}
);
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = configData.Page2Settings.Slot8Img, FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.828 0.186", AnchorMax = $"0.922 0.357"
}
}
}
);
if (!permission.UserHasPermission(player.userID.ToString(), configData.Page2Settings.Slot1Perm) || configData.Page2Settings.Slot1Perm == "") {
RBelements.Add(new CuiElement {
Parent = "Rusty", Components = {
new CuiRawImageComponent {
Url = "https://i.imgur.com/i6L98ZC.png", FadeIn = 0.8f
}
, new CuiRectTransformComponent {
AnchorMin = $"0.084 0.485", AnchorMax = $"0.184 0.669"
}
}
}
);
}
else {
RBelements.Add(new CuiButton {
Button = {
Command = "RBbuy 9", Color = confi
// ... [Code preview truncated due to length. Full source in attached file] ...