mirror of
https://github.com/metrostroi-repo/MetrostroiAddon.git
synced 2026-05-02 00:42:29 +00:00
Merge pull request #572 from metrostroi-repo/#447
This commit is contained in:
@@ -4,17 +4,28 @@ local function OpenGUI()
|
|||||||
Frame:SetSize(600,300)
|
Frame:SetSize(600,300)
|
||||||
Frame:Center()
|
Frame:Center()
|
||||||
Frame:SetTitle(Metrostroi.GetPhrase("StationList.Title"))
|
Frame:SetTitle(Metrostroi.GetPhrase("StationList.Title"))
|
||||||
|
Frame:SetDeleteOnClose(true)
|
||||||
Frame:MakePopup()
|
Frame:MakePopup()
|
||||||
Frame.OnClose = Frame.Remove
|
|
||||||
|
-- Check ULX
|
||||||
|
if not ulx.tps then
|
||||||
|
local ErrorLabel = vgui.Create("DLabel",Frame)
|
||||||
|
ErrorLabel:SetTextColor(Color(255,50,50))
|
||||||
|
ErrorLabel:SetFont("CloseCaption_Bold")
|
||||||
|
ErrorLabel:SetText(Metrostroi.GetPhrase("StationList.NoULX"))
|
||||||
|
ErrorLabel:SizeToContents()
|
||||||
|
ErrorLabel:Center()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
-- Check stations table
|
-- Check stations table
|
||||||
if not Metrostroi.StationConfigurations then
|
if not Metrostroi.StationConfigurations then
|
||||||
local ErrorLabel = vgui.Create("DLabel",Frame)
|
local ErrorLabel = vgui.Create("DLabel",Frame)
|
||||||
ErrorLabel:Dock(FILL)
|
|
||||||
ErrorLabel:SetTextColor(Color(255,50,50))
|
ErrorLabel:SetTextColor(Color(255,50,50))
|
||||||
ErrorLabel:DockMargin(7,0,0,7)
|
|
||||||
ErrorLabel:SetFont("CloseCaption_Bold")
|
ErrorLabel:SetFont("CloseCaption_Bold")
|
||||||
ErrorLabel:SetText(Metrostroi.GetPhrase("StationList.NoConfig"))
|
ErrorLabel:SetText(Metrostroi.GetPhrase("StationList.NoConfig"))
|
||||||
|
ErrorLabel:SizeToContents()
|
||||||
|
ErrorLabel:Center()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -50,6 +61,10 @@ local function OpenGUI()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
StList:SortByColumn(1)
|
StList:SortByColumn(1)
|
||||||
|
function StList:DoDoubleClick(lineID, line)
|
||||||
|
RunConsoleCommand("ulx","station",tostring(SelectedID)..":"..tostring(SelectedPosID))
|
||||||
|
Frame:Close()
|
||||||
|
end
|
||||||
|
|
||||||
-- Create teleport button
|
-- Create teleport button
|
||||||
local TpBtn = vgui.Create("DButton",Frame)
|
local TpBtn = vgui.Create("DButton",Frame)
|
||||||
@@ -63,6 +78,7 @@ local function OpenGUI()
|
|||||||
end
|
end
|
||||||
function TpBtn:DoClick()
|
function TpBtn:DoClick()
|
||||||
RunConsoleCommand("ulx","station",tostring(SelectedID)..":"..tostring(SelectedPosID))
|
RunConsoleCommand("ulx","station",tostring(SelectedID)..":"..tostring(SelectedPosID))
|
||||||
|
Frame:Close()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
concommand.Add("metrostroi_stations",OpenGUI,nil,"GUI for station list")
|
concommand.Add("metrostroi_stations",OpenGUI,nil,"GUI for station list")
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ StationList.NamePos = Position
|
|||||||
StationList.Select = Select station
|
StationList.Select = Select station
|
||||||
StationList.Teleport = Teleport
|
StationList.Teleport = Teleport
|
||||||
StationList.NoConfig = This map is not configured
|
StationList.NoConfig = This map is not configured
|
||||||
|
StationList.NoULX = ULX not installed
|
||||||
|
|
||||||
#Client settings
|
#Client settings
|
||||||
Panel.Admin = Admin
|
Panel.Admin = Admin
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ StationList.NamePos = Позиция
|
|||||||
StationList.Select = Выберите станцию
|
StationList.Select = Выберите станцию
|
||||||
StationList.Teleport = Телепортироваться!
|
StationList.Teleport = Телепортироваться!
|
||||||
StationList.NoConfig = Эта карта не сконфигурирована
|
StationList.NoConfig = Эта карта не сконфигурирована
|
||||||
|
StationList.NoULX = ULX не установлен
|
||||||
|
|
||||||
#Client settings
|
#Client settings
|
||||||
Panel.Admin = Админ
|
Panel.Admin = Админ
|
||||||
|
|||||||
Reference in New Issue
Block a user