Может кто-то помочь добавить 2 кнопки или добавить чат команду (показать и скрыть все худы или хотябы один дальше сделаю сам)
в InfoPanel (не реклама)? (место нахождения и символ настрою сам).
в InfoPanel (не реклама)? (место нахождения и символ настрою сам).
private void ButtonsUI2(BasePlayer player)
{
var ButtonsContainer2 = new CuiElementContainer();
ButtonsContainer2.Add(new CuiPanel
{
RectTransform = {AnchorMin = "0 0", AnchorMax = "1 1"},
Image = {Color = "0 0 0 0"}
}, Layer, Layer + ".Menu.Opened1");
ButtonsContainer2.Add(new CuiPanel
{
RectTransform =
{
AnchorMin = "10 0", AnchorMax = "10 20",
OffsetMin = _config.Btn.closeMenuBTN.OffMin,
OffsetMax = _config.Btn.closeMenuBTN.OffMax
},
Image = {Color = HexToCuiColor(_config.CloseColor)}
}, Layer + ".Menu.Opened1", Layer + ".Menu.Opened1.Close2");
ButtonsContainer2.Add(new CuiButton
{
RectTransform = {AnchorMin = "0 0", AnchorMax = "1 1"},
Button = {Color = "0 0 0 0", Command = $"chat.say /tpmenu"},
Text =
{
Text = "<b>◄</b>", Align = TextAnchor.MiddleCenter, Font = "robotocondensed-bold.ttf", FontSize = 13
}
}, Layer + ".Menu.Opened1.Close2");
CuiHelper.DestroyUi(player, Layer + ".Menu.Opened1");
CuiHelper.AddUi(player, ButtonsContainer2);
}
private void CmdMenu(IPlayer user, string cmd, string[] args)
{
var player = user?.Object as BasePlayer;
if (player == null) return;
if (MenuUsers.Contains(player))
{
CuiHelper.DestroyUi(player, Layer + ".Menu.Opened");
CuiHelper.DestroyUi(player, Layer + ".Menu.Opened1");
MenuUsers.Remove(player);
}
else
{
ButtonsUI(player);
ButtonsUI2(player);
MenuUsers.Add(player);
}
}
{
var ButtonsContainer2 = new CuiElementContainer();
ButtonsContainer2.Add(new CuiPanel
{
RectTransform = {AnchorMin = "0 0", AnchorMax = "1 1"},
Image = {Color = "0 0 0 0"}
}, Layer, Layer + ".Menu.Opened1");
ButtonsContainer2.Add(new CuiPanel
{
RectTransform =
{
AnchorMin = "10 0", AnchorMax = "10 20",
OffsetMin = _config.Btn.closeMenuBTN.OffMin,
OffsetMax = _config.Btn.closeMenuBTN.OffMax
},
Image = {Color = HexToCuiColor(_config.CloseColor)}
}, Layer + ".Menu.Opened1", Layer + ".Menu.Opened1.Close2");
ButtonsContainer2.Add(new CuiButton
{
RectTransform = {AnchorMin = "0 0", AnchorMax = "1 1"},
Button = {Color = "0 0 0 0", Command = $"chat.say /tpmenu"},
Text =
{
Text = "<b>◄</b>", Align = TextAnchor.MiddleCenter, Font = "robotocondensed-bold.ttf", FontSize = 13
}
}, Layer + ".Menu.Opened1.Close2");
CuiHelper.DestroyUi(player, Layer + ".Menu.Opened1");
CuiHelper.AddUi(player, ButtonsContainer2);
}
private void CmdMenu(IPlayer user, string cmd, string[] args)
{
var player = user?.Object as BasePlayer;
if (player == null) return;
if (MenuUsers.Contains(player))
{
CuiHelper.DestroyUi(player, Layer + ".Menu.Opened");
CuiHelper.DestroyUi(player, Layer + ".Menu.Opened1");
MenuUsers.Remove(player);
}
else
{
ButtonsUI(player);
ButtonsUI2(player);
MenuUsers.Add(player);
}
}
Последнее редактирование: