Иконка ресурса

FREE Logo : 1.0.0 1.0.0

Нет прав для скачивания
C#:
using Oxide.Game.Rust.Cui;
using System.Collections.Generic;
using Oxide.Core;
using Oxide.Core.Onion;
using UnityEngine;
using Oxide.Core.Plugins;

namespace Oxide.Plugins
{
    [Info("Logo", "Rustmix", "1.0.0")]
    class Logo : RustPlugin
    {
        void OnServerInitialized()
        {
            foreach (var player in BasePlayer.activePlayerList)
                OnPlayerInit(player);
        }
        
        void OnPlayerInit(BasePlayer player)
        {
            if (player.IsReceivingSnapshot)
            {
                NextTick(() =>
                {
                    OnPlayerInit(player);
                    return;
                });
            }
            
            DrawGUI(player);
        }

        [ChatCommand("logo")]
        private void cmdRemove(BasePlayer player)
        {
            CuiHelper.DestroyUi(player, "LogoPanel");
        }
        
        void DrawGUI(BasePlayer player)
        {
            CuiHelper.DestroyUi(player, "LogoPanel");
            
            var container = new CuiElementContainer();
            var Panel = container.Add(new CuiPanel
            {
                Image = { Color = $"0 0 0 0" },
                RectTransform = { AnchorMin = "0 1", AnchorMax = "0 1",  OffsetMin = "10 -35", OffsetMax = "180 -15" },
                CursorEnabled = false,
            }, "Overlay", "LogoPanel");
            
            container.Add(new CuiElement
            {
                Parent = "LogoPanel",
                Components = {
                    new CuiTextComponent() { Color = "#FFFFFF5A".HexToCuiColor(), FadeIn = 1f, Text = "ONION - ADVANCE CLASSIC", FontSize = 20, Align = TextAnchor.UpperLeft, Font = "robotocondensed-bold.ttf" },
                    new CuiRectTransformComponent { AnchorMin = "0 0", AnchorMax = "3 1.5" },
                }
            });
            
            container.Add(new CuiElement
            {
                Parent = "LogoPanel",
                Components = {
                    new CuiTextComponent() { Color = "#FFFFFF5A".HexToCuiColor(), FadeIn = 1f, Text = "НАЖМИТЕ ЧТОБЫ ОТКРЫТЬ МЕНЮ", FontSize = 12, Align = TextAnchor.LowerLeft, Font = "robotocondensed-bold.ttf" },
                    new CuiRectTransformComponent { AnchorMin = "0 -0.1", AnchorMax = "2 1" },
                }
            });

            container.Add(new CuiButton
            {
                RectTransform = { AnchorMin = "0 0", AnchorMax = "1 2" },
                Button = { Command = "chat.say /menu", Color = "0 0 0 0"},
                Text = { Text = "" }
            }, "LogoPanel");
            
            CuiHelper.AddUi(player, container);
        }
    }
}

Автор
15FPS
Скачиваний
0
Просмотры
1
Первый выпуск
Обновление
Оценка
0.00 звёзд 0 оценок

Другие ресурсы пользователя 15FPS

Сверху