From 29aef694ba5a4cf95c4c86bd3eb52ee368e68b26 Mon Sep 17 00:00:00 2001 From: Alexell Date: Mon, 31 Jan 2022 12:47:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BF=D1=80=D0=B5=D0=B4=D1=81=D1=82=D0=BE=D1=8F?= =?UTF-8?q?=D1=89=D0=B5=D0=B3=D0=BE=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=9C=D0=B5=D1=82=D1=80=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit На новом Метрострое при отсутствии Metrostroi Advanced кнопка перемещения к поезду будет работать с использованием новой команды !tgoto --- lua/metrostroi_scoreboard/player_panel.lua | 26 ++++++++++++++++------ 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/lua/metrostroi_scoreboard/player_panel.lua b/lua/metrostroi_scoreboard/player_panel.lua index 3405b85..25290d1 100644 --- a/lua/metrostroi_scoreboard/player_panel.lua +++ b/lua/metrostroi_scoreboard/player_panel.lua @@ -47,6 +47,9 @@ function PlayerPanel:Init() if (MetrostroiAdvanced and PlayerPermission(LocalPlayer(),"ulx traintp")) then self.BtnTrainTP = vgui.Create("DImageButton",self) self.BtnTrainTP.DoClick = function() RunConsoleCommand("ulx","traintp",self.Player:Nick()) end + elseif (Metrostroi.Version > 1537278077 and PlayerPermission(LocalPlayer(),"ulx traingoto")) then + self.BtnTrainTP = vgui.Create("DImageButton",self) + self.BtnTrainTP.DoClick = function() RunConsoleCommand("ulx","traingoto") end end if (PlayerPermission(LocalPlayer(),"ulx ban")) then @@ -91,13 +94,22 @@ function PlayerPanel:PerformLayout() end end if (self.BtnTrainTP) then - if (self.Player:GetNW2String("MSTrainClass","-") ~= "-") then - self.BtnTrainTP:SetSize(32,32) - self.BtnTrainTP:SetPos(offsetL,0) - self.BtnTrainTP:SetImage("mscoreboard/ms_traintp.png") - offsetL = offsetL + self.BtnTrainTP:GetWide() + 5 - else - self.BtnTrainTP:SetVisible(false) + if MetrostroiAdvanced then + if (self.Player:GetNW2String("MSTrainClass","-") ~= "-") then + self.BtnTrainTP:SetSize(32,32) + self.BtnTrainTP:SetPos(offsetL,0) + self.BtnTrainTP:SetImage("mscoreboard/ms_traintp.png") + else + self.BtnTrainTP:SetVisible(false) + end + elseif Metrostroi.Version > 1537278077 then + if (self.Player == LocalPlayer() and self.Player:GetNW2String("MSTrainClass","-") ~= "-") then + self.BtnTrainTP:SetSize(32,32) + self.BtnTrainTP:SetPos(offsetL,0) + self.BtnTrainTP:SetImage("mscoreboard/ms_traintp.png") + else + self.BtnTrainTP:SetVisible(false) + end end end