Skip to content

Commit

Permalink
Правки для предстоящего обновления Метростроя
Browse files Browse the repository at this point in the history
На новом Метрострое при отсутствии Metrostroi Advanced кнопка перемещения к поезду будет работать с использованием новой команды !tgoto
  • Loading branch information
Alexell committed Jan 31, 2022
1 parent a6212c2 commit 29aef69
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions lua/metrostroi_scoreboard/player_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 29aef69

Please sign in to comment.