C#:
using System;
using System.Collections.Generic;
using System.Linq;
using Rust;
using Newtonsoft.Json;
using Oxide.Core;
using Oxide.Core.Plugins;
using Oxide.Game.Rust.Cui;
using UnityEngine;
using System.Globalization;
using Color = UnityEngine.Color;
namespace Oxide.Plugins
{
[Info("ZealStatistics", "Kira", "1.0.6")]
[Description("Плагин сбора статистики для сервера Rust.")]
class ZealStatistics : RustPlugin
{
#region [Reference] / [Запросы]
[PluginReference] Plugin ImageLibrary;
private StoredData DataBase = new StoredData();
private string GetImg(string name)
{
return (string) ImageLibrary?.Call("GetImage", name) ?? "";
}
public string GetImage(string shortname, ulong skin = 0) =>
(string) ImageLibrary?.Call("GetImage", shortname, skin);
#endregion
#region [Configuraton] / [Конфигурация]
static public ConfigData config;
public class ConfigData
{
[JsonProperty(PropertyName = "ZealStatistics")]
public GUICFG ZealStatistics = new GUICFG();
public class GUICFG
{
[JsonProperty(PropertyName = "Разрешить просматривать информацию об игроках ?")]
public bool info;
}
}
public ConfigData GetDefaultConfig()
{
return new ConfigData
{
ZealStatistics = new ConfigData.GUICFG
{
info = true
}
};
}
protected override void LoadConfig()
{
base.LoadConfig();
try
{
config = Config.ReadObject<ConfigData>();
}
catch
{
LoadDefaultConfig();
}
SaveConfig();
}
protected override void LoadDefaultConfig()
{
PrintError("Файл конфигурации поврежден (или не существует), создан новый!");
config = GetDefaultConfig();
}
protected override void SaveConfig()
{
Config.WriteObject(config);
}
#endregion
#region [Dictionary/Vars] / [Словари/Переменные]
public ulong state1;
public ulong state2;
public ulong state3;
public ulong state4;
public ulong state5;
private string Sharp = "assets/content/ui/ui.background.tile.psd";
private string Blur = "assets/content/ui/uibackgroundblur.mat";
private string radial = "assets/content/ui/ui.background.transparent.radial.psd";
private string regular = "robotocondensed-regular.ttf";
public ulong LastDamagePlayer;
public class Filter
{
public string Name;
public int Number;
}
public List<Filter> Filters = new List<Filter>
{
new Filter
{
Name = "● Убийствам",
Number = 0
},
new Filter
{
Name = "● Смертям",
Number = 1
},
new Filter
{
Name = "● Убийствам животных",
Number = 2
},
new Filter
{
Name = "● Добыче серы",
Number = 3
},
new Filter
{
Name = "● Добыче камня",
Number = 4
},
new Filter
{
Name = "● Добыче металла",
Number = 5
},
new Filter
{
Name = "● Добыче дерева",
Number = 6
},
new Filter
{
Name = "● Уничтоженным вертолётам",
Number = 7
},
new Filter
{
Name = "● Уничтоженным танкам",
Number = 8
},
new Filter
{
Name = "● Наигранному времени",
Number = 9
}
};
#endregion
#region [DrawUI] / [Показ UI]
string Layer = "BoxStatistics";
void PlayerList(BasePlayer player)
{
CuiElementContainer Gui = new CuiElementContainer();
CuiHelper.DestroyUi(player, Layer);
Gui.Add(new CuiPanel
{
CursorEnabled = true,
Image =
{
Color = HexToRustFormat("#000000F9"),
Material = Blur,
Sprite = radial
},
RectTransform =
{
AnchorMin = "0 0",
AnchorMax = "1 1"
}
}, "Overlay", Layer);
Gui.Add(new CuiButton
{
Button =
{
Command = "close.stats",
Color = "0 0 0 0"
},
Text =
{
Text = " "
},
RectTransform =
{
AnchorMin = "0 0",
AnchorMax = "1 1"
}
}, Layer, "CloseStatistics");
Gui.Add(new CuiElement
{
Name = "Zagolovok",
Parent = Layer,
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
Color = HexToRustFormat("#EAEAEAFF"),
FontSize = 35,
Text = "ПАНЕЛЬ УПРАВЛЕНИЯ СТАТИСТИКОЙ",
Font = regular
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.9213709",
AnchorMax = "1 1"
}
}
});
Gui.Add(new CuiElement
{
Name = "DescPl",
Parent = Layer,
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
Color = HexToRustFormat("#EAEAEAFF"),
FontSize = 25,
Text = "Выберите игрока, чтобы заблокировать сбор данных для него",
Font = regular
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.8881495",
AnchorMax = "1 0.9446309"
}
}
});
Gui.Add(new CuiElement
{
Name = "BoxPlayers",
Parent = Layer,
Components =
{
new CuiImageComponent
{
Color = "0 0 0 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.04166667 0.83425",
AnchorMax = "0.1536459 0.8731388"
}
}
});
int x = 0, y = 0, num = 0;
foreach (var plobj in BasePlayer.activePlayerList)
{
if (x == 8)
{
x = 0;
y++;
}
string nick = plobj.displayName;
if (DataBase.IgnorePlayers.Contains(plobj.userID))
{
nick += " <color=#DE3A3A>✖</color>";
}
else
{
nick += " <color=#62E24B>✔</color>";
}
Gui.Add(new CuiButton
{
Button =
{
Command = "stats.ban " + plobj.userID,
Color = HexToRustFormat("#0000005A"),
Material = Blur,
FadeIn = 0.1f + (num * 0.01f)
},
Text =
{
Text = nick,
Align = TextAnchor.MiddleCenter,
Color = HexToRustFormat("#ffffff"),
Font = regular,
FontSize = 15,
FadeIn = 0.1f + (num * 0.01f)
},
RectTransform =
{
AnchorMin = $"{0 + (x * 1.02)} {0 - (y * 1.1)}",
AnchorMax = $"{1 + (x * 1.02)} {1 - (y * 1.1)}"
}
}, "BoxPlayers", "Player" + num);
x++;
num++;
}
CuiHelper.AddUi(player, Gui);
}
void MainGui(BasePlayer player)
{
CheckDataBase(player);
CuiElementContainer Gui = new CuiElementContainer();
var DB = DataBase.StatisticDB[player.userID];
filter = false;
Gui.Add(new CuiPanel
{
CursorEnabled = true,
Image =
{
Color = HexToRustFormat("#000000F9"),
Material = Blur,
Sprite = radial
},
RectTransform =
{
AnchorMin = "0 0",
AnchorMax = "1 1"
}
}, "Overlay", "BoxStatistics");
Gui.Add(new CuiButton
{
Button =
{
Command = "close.stats",
Color = "0 0 0 0"
},
Text =
{
Text = " "
},
RectTransform =
{
AnchorMin = "0 0",
AnchorMax = "1 1"
}
}, Layer, "ButtonCloseGUI");
Gui.Add(new CuiElement
{
Name = Layer + "ServerName",
Parent = Layer,
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
Color = HexToRustFormat("#EAEAEAFF"),
FontSize = 40,
Text = ConVar.Server.hostname,
Font = "robotocondensed-regular.ttf"
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.9213709",
AnchorMax = "1 1"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
Gui.Add(new CuiButton
{
Button =
{
Command = "servertop",
Color = "0 0 0 0"
},
Text =
{
Align = TextAnchor.MiddleCenter,
Color = HexToRustFormat("#EAEAEAFF"),
FontSize = 18,
Text = "ПЕРЕЙТИ В ОБЩУЮ СТАТИСТИКУ\n▼"
},
RectTransform =
{
AnchorMin = "0.3665158 0.01108896",
AnchorMax = "0.6329185 0.08165347"
}
}, Layer, "GoTop");
if (player.IsAdmin)
{
Gui.Add(new CuiButton
{
Button =
{
Command = "stats.manager",
Color = "0 0 0 0"
},
Text =
{
Align = TextAnchor.MiddleCenter,
Color = HexToRustFormat("#EAEAEAFF"),
FontSize = 18,
Text = "ПАНЕЛЬ УПРАВЛЕНИЯ СТАТИСТИКОЙ\n▶"
},
RectTransform =
{
AnchorMin = "0.7331769 0.01108896",
AnchorMax = "1 0.08165347"
}
}, Layer, "GoStatisticsManager");
}
Gui.Add(new CuiElement
{
Name = Layer + "AvatarBG",
Parent = Layer,
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#FFFFFFA4")
},
new CuiRectTransformComponent
{
AnchorMin = "0.4360861 0.6925457",
AnchorMax = "0.5627829 0.9183521"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Avatar",
Parent = Layer,
Components =
{
new CuiRawImageComponent
{
Color = "1 1 1 1",
Png = GetImage(player.UserIDString, 0)
},
new CuiRectTransformComponent
{
AnchorMin = "0.4372173 0.6945619",
AnchorMax = "0.5616518 0.9163328"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Sprite",
Parent = Layer + "Avatar",
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#000000AA"),
Sprite = radial
},
new CuiRectTransformComponent
{
AnchorMin = "0 0",
AnchorMax = "0.99 0.99"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Nick",
Parent = Layer,
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
Color = "1 1 1 1",
FontSize = 23,
Text = player.displayName,
Font = "robotocondensed-regular.ttf"
},
new CuiRectTransformComponent
{
AnchorMin = "0.3212669 0.641129",
AnchorMax = "0.6804298 0.6875"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Line1",
Parent = Layer,
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#CBCBCBFF")
},
new CuiRectTransformComponent
{
AnchorMin = "0.3829193 0.6401247",
AnchorMax = "0.6193514 0.6411328"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "SteamID",
Parent = Layer,
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
Color = "1 1 1 1",
FontSize = 14,
Text = player.UserIDString,
Font = "robotocondensed-regular.ttf"
},
new CuiRectTransformComponent
{
AnchorMin = "0.3212669 0.6088712",
AnchorMax = "0.6804298 0.6421358"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
#region BoxValue1
Gui.Add(new CuiElement
{
Name = "BoxValue1",
Parent = "BoxStatistics",
Components =
{
new CuiImageComponent
{
Color = "0 0 0 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.1357466 0.4969758",
AnchorMax = "0.2697965 0.5977818"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "ValueName1",
Parent = "BoxValue1",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 18,
Color = HexToRustFormat("#CBCBCBFF"),
Text = "Убийств"
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.5300055",
AnchorMax = "1 0.8300002"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Line2",
Parent = "BoxValue1",
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#CBCBCBFF")
},
new CuiRectTransformComponent
{
AnchorMin = "0.01265823 0.4900047",
AnchorMax = "0.9873418 0.5000047"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Value1",
Parent = "BoxValue1",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 19,
Color = HexToRustFormat("#CBCBCBFF"),
Text = DB.Kills.ToString()
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.1499948",
AnchorMax = "1 0.4499854"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
#endregion
#region BoxValue2
Gui.Add(new CuiElement
{
Name = "BoxValue2",
Parent = "BoxStatistics",
Components =
{
new CuiImageComponent
{
Color = "0 0 0 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.2828054 0.4969758",
AnchorMax = "0.4168553 0.5977818"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "ValueName2",
Parent = "BoxValue2",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 18,
Color = HexToRustFormat("#CBCBCBFF"),
Text = "Смертей"
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.5300055",
AnchorMax = "1 0.8300002"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Line3",
Parent = "BoxValue2",
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#CBCBCBFF")
},
new CuiRectTransformComponent
{
AnchorMin = "0.01265823 0.4900047",
AnchorMax = "0.9873418 0.5000047"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Value2",
Parent = "BoxValue2",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 19,
Color = HexToRustFormat("#CBCBCBFF"),
Text = DB.Death.ToString()
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.1499948",
AnchorMax = "1 0.4499854"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
#endregion
#region BoxValue3
Gui.Add(new CuiElement
{
Name = "BoxValue3",
Parent = "BoxStatistics",
Components =
{
new CuiImageComponent
{
Color = "0 0 0 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.4298643 0.4969758",
AnchorMax = "0.5639175 0.5977818"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "ValueName3",
Parent = "BoxValue3",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 18,
Color = HexToRustFormat("#CBCBCBFF"),
Text = "Убийств животных"
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.5300055",
AnchorMax = "1 0.8300002"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Line4",
Parent = "BoxValue3",
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#CBCBCBFF")
},
new CuiRectTransformComponent
{
AnchorMin = "0.01265823 0.4900047",
AnchorMax = "0.9873418 0.5000047"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Value3",
Parent = "BoxValue3",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 19,
Color = HexToRustFormat("#CBCBCBFF"),
Text = DB.AnimalKills.ToString()
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.1499948",
AnchorMax = "1 0.4499854"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
#endregion
#region BoxValue4
Gui.Add(new CuiElement
{
Name = "BoxValue4",
Parent = "BoxStatistics",
Components =
{
new CuiImageComponent
{
Color = "0 0 0 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.5769231 0.4969758",
AnchorMax = "0.7109792 0.5977818"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "ValueName4",
Parent = "BoxValue4",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 17,
Color = HexToRustFormat("#CBCBCBFF"),
Text = "Уничтожено танков"
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.5300055",
AnchorMax = "1 0.8300002"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Line5",
Parent = "BoxValue4",
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#CBCBCBFF")
},
new CuiRectTransformComponent
{
AnchorMin = "0.01265823 0.4900047",
AnchorMax = "0.9873418 0.5000047"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Value4",
Parent = "BoxValue4",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 19,
Color = HexToRustFormat("#CBCBCBFF"),
Text = DB.BradleyKills.ToString()
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.1499948",
AnchorMax = "1 0.4499854"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
#endregion
#region BoxValue5
Gui.Add(new CuiElement
{
Name = "BoxValue5",
Parent = "BoxStatistics",
Components =
{
new CuiImageComponent
{
Color = "0 0 0 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.7239819 0.4969758",
AnchorMax = "0.8580387 0.5977818"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "ValueName5",
Parent = "BoxValue5",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 17,
Color = HexToRustFormat("#CBCBCBFF"),
Text = "Уничтожено вертолётов"
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.5300055",
AnchorMax = "1 0.8300002"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Line6",
Parent = "BoxValue5",
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#CBCBCBFF")
},
new CuiRectTransformComponent
{
AnchorMin = "0.01265823 0.4900047",
AnchorMax = "0.9873418 0.5000047"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Value5",
Parent = "BoxValue5",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 19,
Color = HexToRustFormat("#CBCBCBFF"),
Text = DB.HeliKills.ToString()
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.1499948",
AnchorMax = "1 0.4499854"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
#endregion
#region BoxValue6
Gui.Add(new CuiElement
{
Name = "BoxValue6",
Parent = "BoxStatistics",
Components =
{
new CuiImageComponent
{
Color = "0 0 0 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.2092738 0.3669356",
AnchorMax = "0.343323 0.4677444"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "ValueName6",
Parent = "BoxValue6",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 18,
Color = HexToRustFormat("#CBCBCBFF"),
Text = "Добыто серы"
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.5300055",
AnchorMax = "1 0.8300002"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Line7",
Parent = "BoxValue6",
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#CBCBCBFF")
},
new CuiRectTransformComponent
{
AnchorMin = "0.01265823 0.4900047",
AnchorMax = "0.9873418 0.4900044"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Value6",
Parent = "BoxValue6",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 19,
Color = HexToRustFormat("#CBCBCBFF"),
Text = DB.Sulfur.ToString()
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.1499948",
AnchorMax = "1 0.4499854"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
#endregion
#region BoxValue7
Gui.Add(new CuiElement
{
Name = "BoxValue7",
Parent = "BoxStatistics",
Components =
{
new CuiImageComponent
{
Color = "0 0 0 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.3563318 0.3669356",
AnchorMax = "0.4903821 0.4677444"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "ValueName7",
Parent = "BoxValue7",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 18,
Color = HexToRustFormat("#CBCBCBFF"),
Text = "Добыто камня"
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.5300055",
AnchorMax = "1 0.8300002"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Line8",
Parent = "BoxValue7",
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#CBCBCBFF")
},
new CuiRectTransformComponent
{
AnchorMin = "0.01265823 0.4900047",
AnchorMax = "0.9873418 0.4900044"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Value7",
Parent = "BoxValue7",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 19,
Color = HexToRustFormat("#CBCBCBFF"),
Text = DB.Stones.ToString()
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.1499948",
AnchorMax = "1 0.4499854"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
#endregion
#region BoxValue8
Gui.Add(new CuiElement
{
Name = "BoxValue8",
Parent = "BoxStatistics",
Components =
{
new CuiImageComponent
{
Color = "0 0 0 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.5033906 0.3669356",
AnchorMax = "0.637444 0.4677444"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "ValueName8",
Parent = "BoxValue8",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 18,
Color = HexToRustFormat("#CBCBCBFF"),
Text = "Добыто металла"
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.5300055",
AnchorMax = "1 0.8300002"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Line9",
Parent = "BoxValue8",
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#CBCBCBFF")
},
new CuiRectTransformComponent
{
AnchorMin = "0.01265823 0.4900047",
AnchorMax = "0.9873418 0.4900044"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Value8",
Parent = "BoxValue8",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 19,
Color = HexToRustFormat("#CBCBCBFF"),
Text = DB.MetalOre.ToString()
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.1499948",
AnchorMax = "1 0.4499854"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
#endregion
#region BoxValue9
Gui.Add(new CuiElement
{
Name = "BoxValue9",
Parent = "BoxStatistics",
Components =
{
new CuiImageComponent
{
Color = "0 0 0 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.6504495 0.3669356",
AnchorMax = "0.7845057 0.4677444"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "ValueName9",
Parent = "BoxValue9",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 18,
Color = HexToRustFormat("#CBCBCBFF"),
Text = "Добыто дерева"
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.5300055",
AnchorMax = "1 0.8300002"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Line10",
Parent = "BoxValue9",
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#CBCBCBFF")
},
new CuiRectTransformComponent
{
AnchorMin = "0.01265823 0.4900047",
AnchorMax = "0.9873418 0.4900044"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Value9",
Parent = "BoxValue9",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 19,
Color = HexToRustFormat("#CBCBCBFF"),
Text = DB.Wood.ToString()
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.1499948",
AnchorMax = "1 0.4499854"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
#endregion
#region BoxValue10
Gui.Add(new CuiElement
{
Name = "BoxValue10",
Parent = "BoxStatistics",
Components =
{
new CuiImageComponent
{
Color = "0 0 0 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.4318515 0.2558242",
AnchorMax = "0.5659018 0.356633"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "ValueName10",
Parent = "BoxValue10",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 18,
Color = HexToRustFormat("#CBCBCBFF"),
Text = "Наигранно времени"
},
new CuiRectTransformComponent
{
AnchorMin = "0 0.5300055",
AnchorMax = "1 0.8300002"
},
new CuiOutlineComponent
{
Color = HexToRustFormat("#000000AE"),
Distance = "0.5 0.5"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Line11",
Parent = "BoxValue10",
Components =
{
new CuiImageComponent
{
Color = HexToRustFormat("#CBCBCBFF")
},
new CuiRectTransformComponent
{
AnchorMin = "0.01265823 0.4800047",
AnchorMax = "0.9873418 0.4900044"
}
}
});
Gui.Add(new CuiElement
{
Name = Layer + "Value10",
Parent = "BoxValue10",
Components =
{
new CuiTextComponent
{
Align = TextAnchor.MiddleCenter,
FontSize = 19,
Color = HexToRustFormat("#CBCBCBFF"),
Text = $"{GetPlayerTimePlayed(DataBase.StatisticDB[player.userID].TimePlayed)}"
},
new CuiRectTransformComponent
{
AnchorMin = "-1 0.1499948",
AnchorMax = "2 0.4499854"
},
new CuiOutlineComponent
// ... [Code preview truncated due to length. Full source in attached file] ...