C#:
// #define TESTING
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Text.RegularExpressions;
using Facepunch;
using Facepunch.Extend;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Oxide.Core;
using Oxide.Core.Libraries;
using Oxide.Core.Libraries.Covalence;
using Oxide.Core.Plugins;
using Oxide.Game.Rust.Cui;
using Oxide.Plugins.ServerPanelPopUpsExtensionMethods;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
using Global = Rust.Global;
using Image = UnityEngine.UI.Image;
using Random = UnityEngine.Random;
using Time = UnityEngine.Time;
#if CARBON
using Carbon.Base;
using Carbon.Modules;
#endif
namespace Oxide.Plugins
{
[Info("ServerPanel Pop Ups", "Mevent", "2.0.5")]
public class ServerPanelPopUps : RustPlugin
{
#region Fields
[PluginReference] private Plugin
ServerPanel = null,
Notify = null,
UINotify = null,
ImageLibrary = null;
private static ServerPanelPopUps Instance;
#if CARBON
private ImageDatabaseModule imageDatabase;
#endif
private bool _enabledImageLibrary;
private const string
Perm_Edit = "serverpanelpopups.edit",
CmdMainConsole = "UI_ServerPanel_PopUps",
Layer = "UI.PopUp",
EditingLayerPopUpEditor = "UI.PopUp.EditingLayer.PopUpEditor",
EditingLayerElementEditor = "UI.PopUp.EditingLayer.ElementEditor",
EditingLayerModalAnchorSelector = "UI.PopUp.EditingLayer.Modal.AnchorSelector",
EditingLayerModalColorSelector = "UI.PopUp.EditingLayer.Modal.ColorSelector",
EditingLayerModalTextEditor = "UI.PopUp.EditingLayer.Modal.TextEditor",
EditingLayerModalPreClose = "UI.PopUp.EditingLayer.Modal.PreClose",
EditingElementOutline = "UI.PopUp.EditingLayer.EditingElement.Outline";
private Dictionary<string, int> _popUpByCommand = new();
private Dictionary<int, int> _popUpByID = new();
private readonly Dictionary<ulong, float> _lastCommandTime = new();
#endregion
#region Config
private Configuration _config;
private class Configuration
{
#region Fields
[JsonProperty(PropertyName = "Work with Notify?")]
public bool UseNotify = true;
[JsonProperty(PropertyName = "Enable Offline Image Mode")]
public bool EnableOfflineImageMode = false;
[JsonProperty(PropertyName = "Cooldown between actions (in seconds)")]
public float CooldownBetweenActions = 0.2f;
[JsonProperty(PropertyName = "Pop Ups", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public List<PopUpEntry> PopUps = new()
{
new PopUpEntry
{
Enabled = true,
ID = GetUniquePopUpID(),
Commands = new[] {"pop.server.rules"},
Background = new PopUpEntry.BackgroundUI
{
Background = UiElement.CreatePanel(InterfacePosition.CreatePosition(),
new IColor("#000000", 90), material: "assets/content/ui/uibackgroundblur.mat",
sprite: "assets/content/ui/ui.background.transparent.radial.psd"),
CloseAfterClick = true,
ParentLayer = "Overlay"
},
Content = new PopUpEntry.ContentUI
{
Background =
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0.5 0.5", "0.5 0.5", "-450 -175", "450 175"),
new IColor("#000000", 100),
randomName: "PopUp.ServerRules.Background"),
ContentElements = new List<UiElement>
{
UiElement.CreateImage(InterfacePosition.CreatePosition("0 1", "0 1", "4 -346", "394 -4"),
"https://gitlab.com/TheMevent/PluginsStorage/raw/main/Images/ServerPanel/serverpanel-popups-banner-rules.png",
randomName: "PopUp.ServerRules.Banner"), // Banner
UiElement.CreateImage(InterfacePosition.CreatePosition("0 1", "0 1", "410 -54", "438 -26"),
"https://gitlab.com/TheMevent/PluginsStorage/raw/main/Images/ServerPanel/serverpanel-icon-rules.png",
randomName: "PopUp.ServerRules.HeaderIcon"), // HeaderIcon
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "1 1", "448 -62.5", "-22 -17.5"),
new IColor("#CF432D", 90), "SERVER RULES", 32,
align: TextAnchor.UpperLeft,
randomName: "PopUp.ServerRules.HeaderTitle"), // HeaderTitle
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 1", "1 1", "0 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerRules.Outline.1"), // Outline (1)
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 0", "1 0", "0 0", "0 4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerRules.Outline.2"), // Outline (2)
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 0", "0 1", "0 4", "4 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerRules.Outline.3"), // Outline (3)
UiElement.CreatePanel(InterfacePosition.CreatePosition("1 0", "1 1", "-4 4", "0 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerRules.Outline.4") // Outline (4)
},
UseScrolling = true,
ScrollView = new PopUpEntry.ScrollViewUI
{
Scroll = new ScrollUIElement
{
AnchorMinX = 0, AnchorMinY = 0,
AnchorMaxX = 1, AnchorMaxY = 1,
OffsetMinX = 410, OffsetMinY = 20,
OffsetMaxX = -22, OffsetMaxY = -80,
ScrollType = ScrollType.Vertical,
MovementType = ScrollRect.MovementType.Clamped,
Elasticity = 0.25f,
DecelerationRate = 0.3f,
ScrollSensitivity = 24f,
Scrollbar = new ScrollUIElement.ScrollBarSettings
{
AutoHide = false,
Size = 3f,
HandleColor = new IColor("#D74933", 100),
PressedColor = new IColor("#D74933", 100),
HighlightColor = new IColor("#D74933", 100),
TrackColor = new IColor("#373737", 100)
}
},
ScrollElements = new List<UiElement>
{
UiElement.CreateLabel(
InterfacePosition.CreatePosition(),
new IColor("#E2DBD3", 100),
new List<string>
{
"Welcome to <color=#CF432D>{server_name}</color>! Before you start playing, we would like to remind you of our rules.",
"",
"1. <color=#CF432D>Respect for other players</color>: Please be polite and respectful when interacting with other members of the community.",
"2. <color=#CF432D>No cheats or exploits</color>: We strictly prohibit the use of any software or methods that give an unfair advantage to players.",
"3. <color=#CF432D>No insults or threats</color>: Any form of harassment, discrimination, or threats is not tolerated.",
"4. <color=#CF432D>No profanity</color>: Avoid using harsh language or obscene words in chat.",
"5. <color=#CF432D>Fair play</color>: Do not grief or kill other players without reason. Cooperation and fair play are encouraged.",
"6. <color=#CF432D>Non-interference</color>: Do not interfere with the progress of other players to complete their objectives.",
"7. <color=#CF432D>Privacy</color>: Do not disclose personal information or private details about other members of our community.",
"8. <color=#CF432D>Advertising of third-party resources is not allowed.</color> Please do not share links to other websites or resources without the permission of the administrators.",
"9. The administrators have the right to remove any content that does not comply with the rules of this server.",
"10. In case of any violation of the rules by a player, the administrators have the authority to block their account.",
"", "Thank you for your cooperation and enjoy the game!"
},
14, "robotocondensed-regular.ttf",
randomName: "PopUp.ServerRules.Description") // Description
},
ScrollHeight = 350
}
},
CloseButton = new PopUpEntry.CloseButtonUI
{
Background =
UiElement.CreatePanel(InterfacePosition.CreatePosition("1 1", "1 1", "-49 -49", "-9 -9"),
new IColor("#000000", 0)),
Title = UiElement.CreateImage(
InterfacePosition.CreatePosition("0.5 0.5", "0.5 0.5", "-10 -10", "10 10"),
"assets/icons/close.png")
}
},
new PopUpEntry
{
Enabled = true,
ID = GetUniquePopUpID(),
Commands = new[] {"pop.server.commands"},
Background = new PopUpEntry.BackgroundUI
{
Background = UiElement.CreatePanel(InterfacePosition.CreatePosition(),
new IColor("#000000", 90), material: "assets/content/ui/uibackgroundblur.mat",
sprite: "assets/content/ui/ui.background.transparent.radial.psd"),
CloseAfterClick = true,
ParentLayer = "Overlay"
},
Content = new PopUpEntry.ContentUI
{
Background =
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0.5 0.5", "0.5 0.5", "-450 -175", "450 175"),
new IColor("#000000", 100),
randomName: "PopUp.ServerCommands.Background"),
ContentElements = new List<UiElement>
{
UiElement.CreateImage(InterfacePosition.CreatePosition("0 1", "0 1", "4 -346", "394 -4"),
"https://gitlab.com/TheMevent/PluginsStorage/raw/main/Images/ServerPanel/serverpanel-popups-banner-commands.png",
randomName: "PopUp.ServerCommands.Banner"), // Banner
UiElement.CreateImage(InterfacePosition.CreatePosition("0 1", "0 1", "410 -54", "438 -26"),
"https://gitlab.com/TheMevent/PluginsStorage/raw/main/Images/ServerPanel/serverpanel-icon-commands.png",
randomName: "PopUp.ServerCommands.HeaderIcon"), // HeaderIcon
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "1 1", "448 -62.5", "-22 -17.5"),
new IColor("#CF432D", 90), "SERVER COMMANDS", 32,
align: TextAnchor.UpperLeft,
randomName: "PopUp.ServerCommands.HeaderTitle"), // HeaderTitle
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 1", "1 1", "0 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerCommands.Outline.1"), // Outline (1)
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 0", "1 0", "0 0", "0 4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerCommands.Outline.2"), // Outline (2)
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 0", "0 1", "0 4", "4 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerCommands.Outline.3"), // Outline (3)
UiElement.CreatePanel(InterfacePosition.CreatePosition("1 0", "1 1", "-4 4", "0 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerCommands.Outline.4") // Outline (4)
},
UseScrolling = true,
ScrollView = new PopUpEntry.ScrollViewUI
{
Scroll = new ScrollUIElement
{
AnchorMinX = 0, AnchorMinY = 0,
AnchorMaxX = 1, AnchorMaxY = 1,
OffsetMinX = 410, OffsetMinY = 20,
OffsetMaxX = -22, OffsetMaxY = -80,
ScrollType = ScrollType.Vertical,
MovementType = ScrollRect.MovementType.Clamped,
Elasticity = 0.25f,
DecelerationRate = 0.3f,
ScrollSensitivity = 24f,
Scrollbar = new ScrollUIElement.ScrollBarSettings
{
AutoHide = false,
Size = 3f,
HandleColor = new IColor("#D74933", 100),
PressedColor = new IColor("#D74933", 100),
HighlightColor = new IColor("#D74933", 100),
TrackColor = new IColor("#373737", 100)
}
},
ScrollElements = new List<UiElement>
{
UiElement.CreateLabel(
InterfacePosition.CreatePosition(),
new IColor("#E2DBD3", 100),
new List<string>
{
"<color=#CF432D>/info</color> – open this menu",
"<color=#CF432D>/trade player_name</color> – safe trade with other players",
"<color=#CF432D>/online</color> – see how many players online",
"<color=#CF432D>/shop</color> – open in-game shop",
"<color=#CF432D>/kits</color> – open kits menu",
"<color=#CF432D>/clan</color> – open clans menu",
"<color=#CF432D>/tpr player_name</color> – send teleport request to other player",
"<color=#CF432D>/tpa</color> – accept player teleport request",
"<color=#CF432D>/tpc</color> – cancel player teleport request",
"<color=#CF432D>/sethome home_name</color> – set your home location",
"<color=#CF432D>/home home_name</color> – teleport to your home"
},
14, "robotocondensed-regular.ttf",
randomName: "PopUp.ServerCommands.Description") // Description
},
ScrollHeight = 350
}
},
CloseButton = new PopUpEntry.CloseButtonUI
{
Background =
UiElement.CreatePanel(InterfacePosition.CreatePosition("1 1", "1 1", "-49 -49", "-9 -9"),
new IColor("#000000", 0)),
Title = UiElement.CreateImage(
InterfacePosition.CreatePosition("0.5 0.5", "0.5 0.5", "-10 -10", "10 10"),
"assets/icons/close.png")
}
},
new PopUpEntry
{
Enabled = true,
ID = GetUniquePopUpID(),
Commands = new[] {"pop.server.binds"},
Background = new PopUpEntry.BackgroundUI
{
Background = UiElement.CreatePanel(InterfacePosition.CreatePosition(),
new IColor("#000000", 90), material: "assets/content/ui/uibackgroundblur.mat",
sprite: "assets/content/ui/ui.background.transparent.radial.psd"),
CloseAfterClick = true,
ParentLayer = "Overlay"
},
Content = new PopUpEntry.ContentUI
{
Background =
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0.5 0.5", "0.5 0.5", "-450 -175", "450 175"),
new IColor("#000000", 100),
randomName: "PopUp.ServerBinds.Background"),
ContentElements = new List<UiElement>
{
UiElement.CreateImage(InterfacePosition.CreatePosition("0 1", "0 1", "4 -346", "394 -4"),
"https://gitlab.com/TheMevent/PluginsStorage/raw/main/Images/ServerPanel/serverpanel-popups-banner-binds.png",
randomName: "PopUp.ServerBinds.Banner"), // Banner
UiElement.CreateImage(InterfacePosition.CreatePosition("0 1", "0 1", "410 -54", "438 -26"),
"https://gitlab.com/TheMevent/PluginsStorage/raw/main/Images/ServerPanel/serverpanel-icon-binds.png",
randomName: "PopUp.ServerBinds.HeaderIcon"), // HeaderIcon
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "1 1", "448 -62.5", "-22 -17.5"),
new IColor("#CF432D", 90), "SERVER BINDS", 32,
align: TextAnchor.UpperLeft,
randomName: "PopUp.ServerBinds.HeaderTitle"), // HeaderTitle
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 1", "1 1", "0 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerBinds.Outline.1"), // Outline (1)
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 0", "1 0", "0 0", "0 4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerBinds.Outline.2"), // Outline (2)
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 0", "0 1", "0 4", "4 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerBinds.Outline.3"), // Outline (3)
UiElement.CreatePanel(InterfacePosition.CreatePosition("1 0", "1 1", "-4 4", "0 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerBinds.Outline.4") // Outline (4)
},
UseScrolling = true,
ScrollView = new PopUpEntry.ScrollViewUI
{
Scroll = new ScrollUIElement
{
AnchorMinX = 0, AnchorMinY = 0,
AnchorMaxX = 1, AnchorMaxY = 1,
OffsetMinX = 410, OffsetMinY = 20,
OffsetMaxX = -22, OffsetMaxY = -80,
ScrollType = ScrollType.Vertical,
MovementType = ScrollRect.MovementType.Clamped,
Elasticity = 0.25f,
DecelerationRate = 0.3f,
ScrollSensitivity = 24f,
Scrollbar = new ScrollUIElement.ScrollBarSettings
{
AutoHide = false,
Size = 3f,
HandleColor = new IColor("#D74933", 100),
PressedColor = new IColor("#D74933", 100),
HighlightColor = new IColor("#D74933", 100),
TrackColor = new IColor("#373737", 100)
}
},
ScrollElements = new List<UiElement>
{
UiElement.CreateLabel(
InterfacePosition.CreatePosition(),
new IColor("#E2DBD3", 100),
"To install binds, use the console (F1 key):",
13, "robotocondensed-regular.ttf",
randomName: "PopUp.ServerBinds.Description"), // Description
#region Binds
#region Bind 1
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -50", "188 -30"),
IColor.Create("#E2DBD3"), "OPEN GRAFFITI MENU", 12,
randomName: "PopUp.ServerBinds.Bind.1.Title"),
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -50", "363 -30"),
IColor.Create("#696969", 30),
randomName: "PopUp.ServerBinds.Bind.1.Value.Background"),
UiElement.CreateInputField(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -50", "363 -30"),
IColor.Create("#E2DBD3"), "bind KEY +spray", 10,
align: TextAnchor.MiddleCenter,
randomName: "PopUp.ServerBinds.Bind.1.Value.Input"),
#endregion
#region Bind 2
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -75", "188 -55"),
IColor.Create("#E2DBD3"), "AUTO-RUN", 12,
randomName: "PopUp.ServerBinds.Bind.2.Title"),
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -75", "363 -55"),
IColor.Create("#696969", 30),
randomName: "PopUp.ServerBinds.Bind.2.Value.Background"),
UiElement.CreateInputField(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -75", "363 -55"),
IColor.Create("#E2DBD3"), "bind KEY forward;sprint", 10,
align: TextAnchor.MiddleCenter,
randomName: "PopUp.ServerBinds.Bind.2.Value.Input"),
#endregion
#region Bind 3
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -100", "188 -80"),
IColor.Create("#E2DBD3"), "AUTO-ATTACK", 12,
randomName: "PopUp.ServerBinds.Bind.3.Title"),
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -100", "363 -80"),
IColor.Create("#696969", 30),
randomName: "PopUp.ServerBinds.Bind.3.Value.Background"),
UiElement.CreateInputField(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -100", "363 -80"),
IColor.Create("#E2DBD3"), "bind KEY attack", 10,
align: TextAnchor.MiddleCenter,
randomName: "PopUp.ServerBinds.Bind.3.Value.Input"),
#endregion
#region Bind 4
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -125", "188 -105"),
IColor.Create("#E2DBD3"), "OPEN KITS MENU", 12,
randomName: "PopUp.ServerBinds.Bind.4.Title"),
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -125", "363 -105"),
IColor.Create("#696969", 30),
randomName: "PopUp.ServerBinds.Bind.4.Value.Background"),
UiElement.CreateInputField(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -125", "363 -105"),
IColor.Create("#E2DBD3"), "bind KEY chat.say /kits", 10,
align: TextAnchor.MiddleCenter,
randomName: "PopUp.ServerBinds.Bind.4.Value.Input"),
#endregion
#region Bind 5
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -150", "188 -130"),
IColor.Create("#E2DBD3"), "TELEPORT TO HOME", 12,
randomName: "PopUp.ServerBinds.Bind.5.Title"),
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -150", "363 -130"),
IColor.Create("#696969", 30),
randomName: "PopUp.ServerBinds.Bind.5.Value.Background"),
UiElement.CreateInputField(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -150", "363 -130"),
IColor.Create("#E2DBD3"), "bind KEY chat.say /home {name}", 10,
align: TextAnchor.MiddleCenter,
randomName: "PopUp.ServerBinds.Bind.5.Value.Input"),
#endregion
#region Bind 6
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -175", "188 -155"),
IColor.Create("#E2DBD3"), "ACCEPT TELEPORT REQUEST", 12,
randomName: "PopUp.ServerBinds.Bind.6.Title"),
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -175", "363 -155"),
IColor.Create("#696969", 30),
randomName: "PopUp.ServerBinds.Bind.6.Value.Background"),
UiElement.CreateInputField(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -175", "363 -155"),
IColor.Create("#E2DBD3"), "bind KEY chat.say /tpa", 10,
align: TextAnchor.MiddleCenter,
randomName: "PopUp.ServerBinds.Bind.6.Value.Input"),
#endregion
#region Bind 7
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -200", "188 -180"),
IColor.Create("#E2DBD3"), "OPEN SKILLS", 12,
randomName: "PopUp.ServerBinds.Bind.7.Title"),
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -200", "363 -180"),
IColor.Create("#696969", 30),
randomName: "PopUp.ServerBinds.Bind.7.Value.Background"),
UiElement.CreateInputField(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -200", "363 -180"),
IColor.Create("#E2DBD3"), "bind KEY chat.say /skills", 10,
align: TextAnchor.MiddleCenter,
randomName: "PopUp.ServerBinds.Bind.7.Value.Input"),
#endregion
#region Bind 8
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -225", "188 -205"),
IColor.Create("#E2DBD3"), "OPEN DAILY REWARDS", 12,
randomName: "PopUp.ServerBinds.Bind.8.Title"),
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -225", "363 -205"),
IColor.Create("#696969", 30),
randomName: "PopUp.ServerBinds.Bind.8.Value.Background"),
UiElement.CreateInputField(
InterfacePosition.CreatePosition("0 1", "0 1", "213 -225", "363 -205"),
IColor.Create("#E2DBD3"), "bind KEY chat.say /daily", 10,
align: TextAnchor.MiddleCenter,
randomName: "PopUp.ServerBinds.Bind.8.Value.Input"),
#endregion
#endregion Binds
},
ScrollHeight = 350
}
},
CloseButton = new PopUpEntry.CloseButtonUI
{
Background =
UiElement.CreatePanel(InterfacePosition.CreatePosition("1 1", "1 1", "-49 -49", "-9 -9"),
new IColor("#000000", 0)),
Title = UiElement.CreateImage(
InterfacePosition.CreatePosition("0.5 0.5", "0.5 0.5", "-10 -10", "10 10"),
"assets/icons/close.png")
}
},
new PopUpEntry
{
Enabled = true,
ID = GetUniquePopUpID(),
Commands = new[] {"pop.server.contacts"},
Background = new PopUpEntry.BackgroundUI
{
Background = UiElement.CreatePanel(InterfacePosition.CreatePosition(),
new IColor("#000000", 90), material: "assets/content/ui/uibackgroundblur.mat",
sprite: "assets/content/ui/ui.background.transparent.radial.psd"),
CloseAfterClick = true,
ParentLayer = "Overlay"
},
Content = new PopUpEntry.ContentUI
{
Background =
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0.5 0.5", "0.5 0.5", "-450 -175", "450 175"),
new IColor("#000000", 100),
randomName: "PopUp.ServerContacts.Background"),
ContentElements = new List<UiElement>
{
UiElement.CreateImage(InterfacePosition.CreatePosition("0 1", "0 1", "4 -346", "394 -4"),
"https://gitlab.com/TheMevent/PluginsStorage/raw/main/Images/ServerPanel/serverpanel-popups-banner-contacts.png",
randomName: "PopUp.ServerContacts.Banner"), // Banner
UiElement.CreateImage(InterfacePosition.CreatePosition("0 1", "0 1", "410 -54", "438 -26"),
"https://gitlab.com/TheMevent/PluginsStorage/raw/main/Images/ServerPanel/serverpanel-icon-contacts.png",
randomName: "PopUp.ServerContacts.HeaderIcon"), // HeaderIcon
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "1 1", "448 -62.5", "-22 -17.5"),
new IColor("#CF432D", 90), "SERVER CONTACTS", 32,
align: TextAnchor.UpperLeft,
randomName: "PopUp.ServerContacts.HeaderTitle"), // HeaderTitle
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 1", "1 1", "0 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerContacts.Outline.1"), // Outline (1)
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 0", "1 0", "0 0", "0 4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerContacts.Outline.2"), // Outline (2)
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 0", "0 1", "0 4", "4 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerContacts.Outline.3"), // Outline (3)
UiElement.CreatePanel(InterfacePosition.CreatePosition("1 0", "1 1", "-4 4", "0 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerContacts.Outline.4") // Outline (4)
},
UseScrolling = true,
ScrollView = new PopUpEntry.ScrollViewUI
{
Scroll = new ScrollUIElement
{
AnchorMinX = 0, AnchorMinY = 0,
AnchorMaxX = 1, AnchorMaxY = 1,
OffsetMinX = 410, OffsetMinY = 20,
OffsetMaxX = -22, OffsetMaxY = -80,
ScrollType = ScrollType.Vertical,
MovementType = ScrollRect.MovementType.Clamped,
Elasticity = 0.25f,
DecelerationRate = 0.3f,
ScrollSensitivity = 24f,
Scrollbar = new ScrollUIElement.ScrollBarSettings
{
AutoHide = false,
Size = 3f,
HandleColor = new IColor("#D74933", 100),
PressedColor = new IColor("#D74933", 100),
HighlightColor = new IColor("#D74933", 100),
TrackColor = new IColor("#373737", 100)
}
},
ScrollElements = new List<UiElement>
{
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -250", "468 0"),
new IColor("#E2DBD3", 100),
new List<string>
{
"Are your questions urgent or do you have any questions depending on your VIP, please contact us through our website."
},
14, "robotocondensed-regular.ttf",
randomName: "PopUp.ServerContacts.Description"), // Description
#region QR (1)
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -235", "120 -55"),
new IColor("#696969", 20),
randomName: "PopUp.ServerContacts.QR.Website.Background"), //BG
UiElement.CreateImage(
InterfacePosition.CreatePosition("0 1", "0 1", "10 -170", "110 -70"),
"{qr_website}",
randomName: "PopUp.ServerContacts.QR.Website.Image"), //IMAGE
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -235", "120 -210"),
new IColor("#CF432D", 80),
randomName: "PopUp.ServerContacts.QR.Website.Contact"), // Contact Panel
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -235", "120 -210"),
new IColor("#E2DBD3", 100), "STORE", 12,
align: TextAnchor.MiddleCenter,
randomName: "PopUp.ServerContacts.QR.Website.Contact.Label"), // Contact Label
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -210", "120 -185"),
new IColor("#CF432D", 15),
randomName: "PopUp.ServerContacts.QR.Website.URL.Panel"), // Link Panel
UiElement.CreateInputField(
InterfacePosition.CreatePosition("0 1", "0 1", "0 -210", "120 -185"),
new IColor("#E2DBD3", 60),
"{url_website}",
10,
align: TextAnchor.MiddleCenter, font:
"robotocondensed-regular.ttf",
randomName: "PopUp.ServerContacts.QR.Website.URL.Input"), // Link Label
#endregion QR (1)
#region QR (2)
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "140 -235", "260 -55"),
new IColor("#696969", 20),
randomName: "PopUp.ServerContacts.QR.Discord.Background"), //BG
UiElement.CreateImage(
InterfacePosition.CreatePosition("0 1", "0 1", "150 -170", "250 -70"),
"{qr_discord}",
randomName: "PopUp.ServerContacts.QR.Discord.Image"), //IMAGE
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "140 -235", "260 -210"),
new IColor("#CF432D", 80),
randomName: "PopUp.ServerContacts.QR.Discord.Contact"), // Contact Panel
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "0 1", "140 -235", "260 -210"),
new IColor("#E2DBD3", 100), "DISCORD", 12,
align: TextAnchor.MiddleCenter,
randomName: "PopUp.ServerContacts.QR.Discord.Contact.Label"), // Contact Label
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0 1", "0 1", "140 -210", "260 -185"),
new IColor("#CF432D", 15),
randomName: "PopUp.ServerContacts.QR.Discord.URL.Panel"), // Link Panel
UiElement.CreateInputField(
InterfacePosition.CreatePosition("0 1", "0 1", "140 -210", "260 -185"),
new IColor("#E2DBD3", 60),
"{url_discord}",
10,
align: TextAnchor.MiddleCenter, font:
"robotocondensed-regular.ttf",
randomName: "PopUp.ServerContacts.QR.Discord.URL.Input"), // Link Label
#endregion QR (2)
},
ScrollHeight = 350
}
},
CloseButton = new PopUpEntry.CloseButtonUI
{
Background =
UiElement.CreatePanel(InterfacePosition.CreatePosition("1 1", "1 1", "-49 -49", "-9 -9"),
new IColor("#000000", 0)),
Title = UiElement.CreateImage(
InterfacePosition.CreatePosition("0.5 0.5", "0.5 0.5", "-10 -10", "10 10"),
"assets/icons/close.png")
}
},
new PopUpEntry
{
Enabled = true,
ID = GetUniquePopUpID(),
Commands = new[] {"pop.server.info"},
Background = new PopUpEntry.BackgroundUI
{
Background = UiElement.CreatePanel(InterfacePosition.CreatePosition(),
new IColor("#000000", 90), material: "assets/content/ui/uibackgroundblur.mat",
sprite: "assets/content/ui/ui.background.transparent.radial.psd"),
CloseAfterClick = true,
ParentLayer = "Overlay"
},
Content = new PopUpEntry.ContentUI
{
Background =
UiElement.CreatePanel(
InterfacePosition.CreatePosition("0.5 0.5", "0.5 0.5", "-450 -175", "450 175"),
new IColor("#000000", 100),
randomName: "PopUp.ServerInfo.Background"),
ContentElements = new List<UiElement>
{
UiElement.CreateImage(InterfacePosition.CreatePosition("0 1", "0 1", "4 -346", "394 -4"),
"https://gitlab.com/TheMevent/PluginsStorage/raw/main/Images/ServerPanel/serverpanel-popups-banner-info.png",
randomName: "PopUp.ServerInfo.Banner"), // Banner
UiElement.CreateImage(InterfacePosition.CreatePosition("0 1", "0 1", "410 -54", "438 -26"),
"https://gitlab.com/TheMevent/PluginsStorage/raw/main/Images/ServerPanel/serverpanel-icon-info.png",
randomName: "PopUp.ServerInfo.HeaderIcon"), // HeaderIcon
UiElement.CreateLabel(
InterfacePosition.CreatePosition("0 1", "1 1", "448 -62.5", "-22 -17.5"),
new IColor("#CF432D", 90), "SERVER INFO", 32,
align: TextAnchor.UpperLeft,
randomName: "PopUp.ServerInfo.HeaderTitle"), // HeaderTitle
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 1", "1 1", "0 -4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerInfo.Outline.1"), // Outline (1)
UiElement.CreatePanel(InterfacePosition.CreatePosition("0 0", "1 0", "0 0", "0 4"),
new IColor("#CF432D", 100),
randomName: "PopUp.ServerInfo.Outline.2"), // Outline (2)
// ... [Code preview truncated due to length. Full source in attached file] ...