C#:
//Reference: System.Drawing
using System;
using System.Globalization;
using Oxide.Game.Rust.Cui;
using System.Collections.Generic;
using Newtonsoft.Json;
using UnityEngine;
using Oxide.Core.Plugins;
using Oxide.Core;
namespace Oxide.Plugins {
[Info("StudyTree", "Drop Dead", "1.0.2")]
public class StudyTree : RustPlugin {
[PluginReference]
private Plugin ImageLibrary;
bool debug = false;
private static StudyTree _ins;
string Layer = "StudyTree.Main";
string ButtonLayer = "StudyTree.ButtonLayer";
public Dictionary<ulong, List<string>> Blueprints = new Dictionary<ulong, List<string>>();
#region Config
private PluginConfig cfg;
public class PluginConfig {
[JsonProperty("Настройки интерфейса")]
public PSettings pluginsettings = new PSettings();
[JsonProperty("Настройки цен предметов", ObjectCreationHandling = ObjectCreationHandling.Replace)]
public Dictionary<string, int> scrapcount = new Dictionary<string, int>() {
["hammer.salvaged"]
= 75, ["hatchet"] = 75, ["spikes.floor"] = 20, ["barricade.wood"] = 20, ["barricade.woodwire"] = 75, ["bucket.water"] = 20, ["bucket.helmet"] = 75, ["weapon.mod.muzzleboost"] = 125, ["floor.ladder.hatch"] = 125, ["water.catcher.small"] = 20, ["water.barrel"] = 20, ["fridge"] = 20, ["lantern"] = 20, ["trap.bear"] = 75, ["shutter.wood.a"] = 20, ["ladder.wooden.wall"] = 125, ["wall.external.high"] = 125, ["gates.external.high.wood"] = 125, ["planter.large"] = 20, ["mailbox"] = 20, ["shelves"] = 75, ["table"] = 20, ["bed"] = 75, ["fireplace.stone"] = 20, ["shirt.tanktop"] = 20, ["tshirt"] = 20, ["hat.beenie"] = 20, ["shirt.collared"] = 75, ["mask.balaclava"] = 20, ["pants.shorts"] = 20, ["tshirt.long"] = 20, ["pants"] = 75, ["jacket.snow"] = 20, ["jacket"] = 20, ["hat.miner"] = 20, ["riot.helmet"] = 75, ["burlap.gloves"] = 20, ["ceilinglight"] = 20, ["target.reactive"] = 20, ["pickaxe"] = 75, ["salvaged.sword"] = 75, ["mace"] = 75, ["salvaged.cleaver"] = 75, ["shotgun.waterpipe"] = 75, ["shotgun.double"] = 125, ["flare"] = 20, ["largemedkit"] = 75, ["syringe.medical"] = 75, ["guntrap"] = 125, ["ammo.pistol"] = 75, ["weapon.mod.silencer"] = 75, ["pistol.revolver"] = 75, ["weapon.mod.flashlight"] = 75, ["grenade.beancan"] = 75, ["arrow.fire"] = 20, ["explosive.satchel"] = 125, ["flameturret"] = 75, ["tunalight"] = 20, ["barricade.stone"] = 20, ["barricade.sandbags"] = 20, ["rug"] = 20, ["wall.frame.fence"] = 20, ["wall.frame.fence.gate"] = 20, ["floor.grill"] = 75, ["sign.wooden.large"] = 75, ["sign.wooden.huge"] = 75, ["rug.bear"] = 20, ["spinner.wheel"] = 20, ["dropbox"] = 75, ["tool.binoculars"] = 75, ["chair"] = 20, ["hazmatsuit"] = 125, ["hoodie"] = 75, ["shoes.boots"] = 75, ["coffeecan.helmet"] = 75, ["roadsign.kilt"] = 75, ["roadsign.jacket"] = 75, ["heavy.plate.helmet"] = 125, ["heavy.plate.jacket"] = 125, ["heavy.plate.pants"] = 125, ["longsword"] = 75, ["icepick.salvaged"] = 125, ["axe.salvaged"] = 125, ["ammo.shotgun"] = 75, ["ammo.shotgun.slug"] = 75, ["shotgun.pump"] = 125, ["trap.landmine"] = 125, ["pistol.semiauto"] = 125, ["grenade.f1"] = 75, ["pistol.python"] = 125, ["flamethrower"] = 125, ["ammo.pistol.fire"] = 125, ["ammo.pistol.hv"] = 125, ["weapon.mod.muzzlebrake"] = 125, ["smg.2"] = 125, ["smg.thompson"] = 125, ["ammo.rifle"] = 125, ["rifle.semiauto"] = 125, ["weapon.mod.holosight"] = 125, ["rocket.launcher"] = 500, ["ammo.rocket.fire"] = 125, ["ammo.rocket.hv"] = 125, ["shutter.metal.embrasure.a"] = 20, ["shutter.metal.embrasure.b"] = 20, ["wall.window.glass.reinforced"] = 75, ["wall.frame.garagedoor"] = 75, ["wall.frame.cell.gate"] = 75, ["wall.frame.cell"] = 75, ["locker"] = 75, ["furnace.large"] = 125, ["water.catcher.large"] = 75, ["small.oil.refinery"] = 75, ["wall.external.high.stone"] = 500, ["gates.external.high.stone"] = 500, ["searchlight"] = 75, ["autoturret"] = 500, ["barricade.concrete"] = 20, ["barricade.metal"] = 125, ["wall.window.bars.toptier"] = 125, ["door.hinged.toptier"] = 500, ["door.double.hinged.toptier"] = 500, ["smg.mp5"] = 500, ["weapon.mod.lasersight"] = 125, ["ammo.rifle.hv"] = 125, ["ammo.rifle.incendiary"] = 125, ["ammo.rifle.explosive"] = 125, ["metal.fragments"] = 500, ["metal.plate.torso"] = 500, ["rifle.ak"] = 500, ["rifle.bolt"] = 500, ["weapon.mod.small.scope"] = 125, ["explosives"] = 500, ["explosive.timed"] = 500, ["ammo.rocket.basic"] = 125, ["metal.facemask"] = 500,
}
;
public class PSettings {
[JsonProperty("Цвет кнопки открытия дерева в верстаке")]
public string buttoncolor = "#EDEDED0E";
[JsonProperty("Цвет фона не изученного предмета")]
public string itemcolor = "#2F312FFF";
[JsonProperty("Цвет фона изученного предмета")]
public string researcheditemcolor = "#445837DD";
[JsonProperty("Цвет полосок между предметами")]
public string connectorscolor = "#455937DE";
}
}
protected override void LoadDefaultConfig() {
Config.WriteObject(new PluginConfig(), true);
}
#endregion
#region Data
private void SaveData() {
Interface.Oxide.DataFileSystem.WriteObject($"{Title}/Blueprints", Blueprints);
}
private void LoadData() {
if (Interface.Oxide.DataFileSystem.ExistsDatafile($"{Title}/Blueprints")) Blueprints = Interface.Oxide.DataFileSystem.ReadObject<Dictionary<ulong, List<string>>>($"{Title}/Blueprints");
}
#endregion
#region Init and Unload
private void Init() {
_ins = this;
cfg = Config.ReadObject<PluginConfig>();
Config.WriteObject(cfg);
}
void Unload() {
foreach (var player in BasePlayer.activePlayerList) {
CuiHelper.DestroyUi(player, Layer);
CuiHelper.DestroyUi(player, ButtonLayer);
}
_ins = null;
SaveData();
}
void OnServerSave() {
SaveData();
}
private void OnServerInitialized() {
LoadData();
if (!plugins.Exists("ImageLibrary")) {
PrintError("Плагин ImageLibrary не загружен, дальнейшая работа плагина невозможна!");
Interface.Oxide.UnloadPlugin(Title);
return;
}
LoadImages();
ManualLoadImage("StudyTree.background");
ManualLoadImage("lockedicon");
ManualLoadImage("unlockedicon");
ManualLoadImage("scrap");
ManualLoadImage("4xscope");
ManualLoadImage("mine");
permission.RegisterPermission($"{Title}.use", this);
}
void LoadImages() {
foreach (String Key in cfg.scrapcount.Keys) {
char chr = System.IO.Path.DirectorySeparatorChar;
string str = Interface.GetMod().DataDirectory + "/StudyTree/Images/" + $"{Key}.png";
if (IMGLibrary.HasImage(Key, 0)) continue;
try {
var image = System.Drawing.Image.FromFile(str);
using (var ms = new System.IO.MemoryStream()) {
image.Save(ms, image.RawFormat);
IMGLibrary.AddImageData(Key, ms.ToArray());
ms.Dispose();
}
}
catch (Exception e) {
if (e.ToString().Contains("FileNotFoundException")) throw new Exception($"[StudyTree] File '{str}' not found!\n{e}");
else Debug.LogError(e);
}
}
}
void ManualLoadImage(string name) {
char chr = System.IO.Path.DirectorySeparatorChar;
string str = Interface.GetMod().DataDirectory + "/StudyTree/Images/" + $"{name}.png";
if (IMGLibrary.HasImage(name, 0)) return;
try {
var image = System.Drawing.Image.FromFile(str);
using (var ms = new System.IO.MemoryStream()) {
image.Save(ms, image.RawFormat);
IMGLibrary.AddImageData(name, ms.ToArray());
ms.Dispose();
}
}
catch (Exception e) {
if (e.ToString().Contains("FileNotFoundException")) throw new Exception($"[StudyTree] File '{str}' not found!\n{e}");
else Debug.LogError(e);
}
}
#endregion
#region Oxide hooks
void OnLootEntity(BasePlayer player, BaseEntity entity) {
if (player == null || entity == null) return;
if (!permission.UserHasPermission(player.UserIDString, $"{Title}.use")) return;
if (entity.ShortPrefabName == "workbench1.deployed") {
if (debug) Puts($"{player.displayName}/{player.userID} opened workbench1");
DrawTreeButton(player, 1);
}
if (entity.ShortPrefabName == "workbench2.deployed") {
if (debug) Puts($"{player.displayName}/{player.userID} opened workbench2");
DrawTreeButton(player, 2);
}
if (entity.ShortPrefabName == "workbench3.deployed") {
if (debug) Puts($"{player.displayName}/{player.userID} opened workbench3");
DrawTreeButton(player, 3);
}
return;
}
void OnLootEntityEnd(BasePlayer player, BaseEntity entity) {
if (player == null || entity == null) return;
if (!permission.UserHasPermission(player.UserIDString, $"{Title}.use")) return;
if (entity.ShortPrefabName == "workbench1.deployed") {
if (debug) Puts($"Destroy UI for {player.displayName}/{player.userID}, closed: workbench1");
CuiHelper.DestroyUi(player, ButtonLayer);
CuiHelper.DestroyUi(player, Layer);
}
if (entity.ShortPrefabName == "workbench2.deployed") {
if (debug) Puts($"Destroy UI for {player.displayName}/{player.userID}, closed: workbench2");
CuiHelper.DestroyUi(player, ButtonLayer);
CuiHelper.DestroyUi(player, Layer);
}
if (entity.ShortPrefabName == "workbench3.deployed") {
if (debug) Puts($"Destroy UI for {player.displayName}/{player.userID}, closed: workbench3");
CuiHelper.DestroyUi(player, ButtonLayer);
CuiHelper.DestroyUi(player, Layer);
}
return;
}
#endregion
#region Commands
[ConsoleCommand("StudyTreeHandler")]
private void StudyTreeHandler(ConsoleSystem.Arg args) {
BasePlayer player = args.Player();
if (player == null) return;
if (!args.HasArgs(1)) if (debug) Puts($"{player.displayName} calling command \"StudyTreeHandler\", workbench level: {args.Args[0]}");
if (args.Args[0] == "1") {
DrawFirstWBTree(player);
return;
}
if (args.Args[0] == "2") {
DrawSecondWBTree(player);
return;
}
if (args.Args[0] == "3") {
DrawThirdWBTree(player);
return;
}
}
[ConsoleCommand("GetInfoItem")]
private void GetInfoItem(ConsoleSystem.Arg args) {
BasePlayer player = args.Player();
if (player == null) return;
if (!args.HasArgs(2)) return;
if (debug) Puts($"{player.displayName} calling command \"GetInfoItem\", shortname: {args.Args[0]}, wblevel: {args.Args[1]}");
var shortname = args.Args[0];
var wblevel = int.Parse(args.Args[1]);
if (string.IsNullOrEmpty(shortname)) return;
if (!cfg.scrapcount.ContainsKey(shortname)) {
player.ChatMessage("Цена на данный предмет ещё не добавлена, обратитесь к администратору сервера");
PrintWarning($"Игрок {player.displayName}/{player.userID} попытался изучить предмет \"{shortname}\", но он ещё не добавлен в конфигурацию плагина!");
return;
}
var scrapcount = cfg.scrapcount[shortname];
var itemname = ItemManager.FindItemDefinition(shortname).displayName.translated;
var itemdescription = ItemManager.FindItemDefinition(shortname).displayDescription.translated;
SendEffect(player, "assets/bundled/prefabs/fx/notice/item.select.fx.prefab");
DisplayExperiment(player, shortname, itemname, itemdescription, scrapcount, wblevel);
if (debug) Puts($"{player.displayName} calling command \"DisplayExperiment\" from command \"GetInfoItem\"");
}
[ConsoleCommand("ResearchItem")]
private void ResearchItem(ConsoleSystem.Arg args) {
BasePlayer player = args.Player();
if (player == null) return;
if (!args.HasArgs(3)) return;
if (debug) Puts($"{player.displayName} calling command \"ResearchItem\", shortname: {args.Args[0]}, scrap amount: {args.Args[1]}, wb level: {args.Args[2]}");
var shortname = args.Args[0];
var scrapcount = int.Parse(args.Args[1]);
var wblevel = int.Parse(args.Args[2]);
if (!HaveScrap(player, scrapcount)) return;
/*foreach (var item in player.inventory.AllItems())
{
if (item.info.shortname == "scrap")
{
item.UseItem(scrapcount);
}
}*/
foreach (var item in player.inventory.AllItems()) {
if (item.info.shortname != "scrap") continue;
if (item.amount > scrapcount) {
item.UseItem(scrapcount);
break;
}
scrapcount -= item.amount;
item.UseItem(item.amount);
}
SendEffect(player, "assets/prefabs/misc/blueprintbase/effects/blueprint_read.prefab");
UnlockBlueprint(player, shortname);
var itemname = ItemManager.FindItemDefinition(shortname).displayName.translated;
var itemdescription = ItemManager.FindItemDefinition(shortname).displayDescription.translated;
if (args.Args[2] == "1") DrawFirstWBTree(player);
if (args.Args[2] == "2") DrawSecondWBTree(player);
if (args.Args[2] == "3") DrawThirdWBTree(player);
DisplayExperiment(player, shortname, itemname, itemdescription, scrapcount, wblevel);
}
[ConsoleCommand("StudyTreeReset")]
private void StudyTreeReset(ConsoleSystem.Arg arg) {
if (!arg.IsAdmin) return;
if (!arg.HasArgs()) return;
var player = BasePlayer.Find(arg.Args[0]);
if (player == null) return;
Blueprints.Remove(player.userID);
}
#endregion
#region UI
private void DrawTreeButton(BasePlayer player, int wbnumber) {
if (debug) Puts($"Called DrawTreeButton for {player.displayName}/{player.userID}");
CuiHelper.DestroyUi(player, ButtonLayer);
var container = new CuiElementContainer();
container.Add(new CuiPanel {
Image = {
Color = HexToRustFormat(cfg.pluginsettings.buttoncolor), Material = "assets/content/ui/uibackgroundblur-ingamemenu.mat"
}
, RectTransform = {
AnchorMin = "1 0", AnchorMax = "1 0", OffsetMin = "-448 78", OffsetMax = "-270 104"
}
, CursorEnabled = true,
}
, "Overlay", ButtonLayer);
container.Add(new CuiButton {
RectTransform = {
AnchorMin = "0 0", AnchorMax = "1 1"
}
, Button = {
Command = "StudyTreeHandler " + wbnumber.ToString(), Color = "0 0 0 0"
}
, Text = {
Color = HexToRustFormat("#CCC1B8FF"), Text = "ОТКРЫТЬ ВЕТКУ ИЗУЧЕНИЙ", Align = TextAnchor.MiddleCenter, FontSize = 12, Font = "RobotoCondensed-bold.ttf"
}
}
, ButtonLayer);
CuiHelper.AddUi(player, container);
}
private void DrawFirstWBTree(BasePlayer player) {
if (debug) Puts($"Called DrawFirstWBTree for {player.displayName}/{player.userID}");
CuiHelper.DestroyUi(player, Layer);
var container = new CuiElementContainer();
container.Add(new CuiPanel {
Image = {
Color = "0 0 0 1", Material = "assets/content/ui/uibackgroundblur-notice.mat"
}
, RectTransform = {
AnchorMin = "0 0", AnchorMax = "1 1"
}
, CursorEnabled = true,
}
, "Overlay", Layer);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat("#303030C6")
}
, new CuiRectTransformComponent {
AnchorMin = "0 0", AnchorMax = "1 1"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiRawImageComponent {
Png = GetImage("StudyTree.background"), Color = HexToRustFormat("#FFFFFFB9")
}
, new CuiRectTransformComponent {
AnchorMin = "0 0", AnchorMax = "1 1"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3630166 0.8314792", AnchorMax = "0.3645791 0.8546273"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2666667 0.8416642", AnchorMax = "0.3630208 0.8449049"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2651015 0.8314792", AnchorMax = "0.266664 0.8444422"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2276014 0.6833354", AnchorMax = "0.2291639 0.7055576"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2276014 0.6092635", AnchorMax = "0.2291639 0.6314857"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.1916666 0.6194485", AnchorMax = "0.2276042 0.6222262"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.1916634 0.6092635", AnchorMax = "0.1932259 0.6194487"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2276014 0.5351916", AnchorMax = "0.2291639 0.5574138"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.1916666 0.5453765", AnchorMax = "0.2276042 0.5481541"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.1916634 0.5351916", AnchorMax = "0.1932259 0.5453768"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2276014 0.4611184", AnchorMax = "0.2291639 0.4833408"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2276014 0.3870432", AnchorMax = "0.2291639 0.4092655"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2645806 0.7694441", AnchorMax = "0.2661431 0.7796293"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2276014 0.7666664", AnchorMax = "0.3026014 0.7694441"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2276014 0.7574074", AnchorMax = "0.2291639 0.7675926"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2645806 0.7574074", AnchorMax = "0.2661431 0.7675926"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3010384 0.7574074", AnchorMax = "0.3026009 0.7675926"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2645806 0.6833354", AnchorMax = "0.2661431 0.7055576"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2645806 0.5351916", AnchorMax = "0.2661431 0.5574138"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2645806 0.4592665", AnchorMax = "0.2661431 0.4814889"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2645806 0.6092635", AnchorMax = "0.2661431 0.6314857"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3010384 0.6833354", AnchorMax = "0.3026009 0.7055576"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3010384 0.6092635", AnchorMax = "0.3026009 0.6314857"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3010384 0.5351916", AnchorMax = "0.3026009 0.5574138"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3010384 0.4592665", AnchorMax = "0.3026009 0.4814889"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3010384 0.3870432", AnchorMax = "0.3026009 0.4092655"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3010384 0.3129698", AnchorMax = "0.3026009 0.3351921"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3630166 0.7574072", AnchorMax = "0.3645791 0.7796294"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3630166 0.6833353", AnchorMax = "0.3645791 0.7055575"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3630166 0.6092634", AnchorMax = "0.3645791 0.6314856"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3630166 0.5092663", AnchorMax = "0.3645791 0.5574144"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3630166 0.4351924", AnchorMax = "0.3645791 0.4574146"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3645833 0.4453743", AnchorMax = "0.4369791 0.448152"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3989536 0.4351924", AnchorMax = "0.4005161 0.4453776"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.4354114 0.4351924", AnchorMax = "0.4369739 0.4453776"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3630166 0.3611181", AnchorMax = "0.3645791 0.3833403"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3630166 0.2870439", AnchorMax = "0.3645791 0.3092661"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3989536 0.3611181", AnchorMax = "0.4005161 0.3833403"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3989536 0.2870439", AnchorMax = "0.4005161 0.3092661"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.4354114 0.3611181", AnchorMax = "0.4369739 0.3833403"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3989536 0.2250067", AnchorMax = "0.4005161 0.2351919"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3812499 0.2222262", AnchorMax = "0.4187499 0.2250039"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3812456 0.2129696", AnchorMax = "0.3828081 0.2231548"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.4171825 0.2129696", AnchorMax = "0.418745 0.2231548"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.3812456 0.1388953", AnchorMax = "0.3828081 0.1611175"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.6307208 0.843516", AnchorMax = "0.6322834 0.8537012"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.5942661 0.8416642", AnchorMax = "0.7052037 0.8449049"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.5942633 0.8314793", AnchorMax = "0.5958257 0.8416645"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.6307208 0.8314793", AnchorMax = "0.6322834 0.8416645"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.6671786 0.8314793", AnchorMax = "0.6687412 0.8416645"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.7036363 0.8314793", AnchorMax = "0.705199 0.8416645"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.6671786 0.7574073", AnchorMax = "0.6687411 0.7796295"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.7036364 0.7574073", AnchorMax = "0.7051995 0.7796295"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.7036364 0.6833354", AnchorMax = "0.7051995 0.7055576"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.7036364 0.6092635", AnchorMax = "0.7051995 0.6314857"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.6671818 0.6194485", AnchorMax = "0.7036402 0.6222262"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.6671786 0.6092635", AnchorMax = "0.6687417 0.6222264"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.6671786 0.5351916", AnchorMax = "0.6687417 0.5574138"
}
}
}
);
container.Add(new CuiElement {
Parent = Layer, Components = {
new CuiImageComponent {
Color = HexToRustFormat(cfg.pluginsettings.connectorscolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.6671786 0.4611185", AnchorMax = "0.6687417 0.4833407"
}
}
}
);
//salvaged hammer
container.Add(new CuiElement {
Parent = Layer, Name = "hammer.salvaged", Components = {
new CuiImageComponent {
Color = IsUnlocked(player, "hammer.salvaged") ? HexToRustFormat(cfg.pluginsettings.researcheditemcolor) : HexToRustFormat(cfg.pluginsettings.itemcolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.347915 0.8518518", AnchorMax = "0.379166 0.9074074",
}
}
}
);
container.Add(new CuiElement {
Parent = "hammer.salvaged", Components = {
new CuiRawImageComponent {
Png = GetImage("hammer.salvaged")
}
, new CuiRectTransformComponent {
AnchorMin = "0.08333047 0.09999995", AnchorMax = "0.899969 0.9166662"
}
}
}
);
container.Add(new CuiButton {
RectTransform = {
AnchorMin = "0 0", AnchorMax = "1 1"
}
, Button = {
Command = "GetInfoItem hammer.salvaged 1", Color = "0 0 0 0"
}
, Text = {
Text = ""
}
}
, "hammer.salvaged");
//hatchet
container.Add(new CuiElement {
Parent = Layer, Name = "hatchet", Components = {
new CuiImageComponent {
Color = IsUnlocked(player, "hatchet") ? HexToRustFormat(cfg.pluginsettings.researcheditemcolor) : HexToRustFormat(cfg.pluginsettings.itemcolor)
}
, new CuiRectTransformComponent {
AnchorMin = "0.2494767 0.7777799", AnchorMax = "0.2807274 0.8333355",
}
}
}
);
container.Add(new CuiElement {
Parent = "hatchet", Components = {
new CuiRawImageComponent {
Png = GetImage("hatc
// ... [Code preview truncated due to length. Full source in attached file] ...