2018-05-02 06:32:59 +08:00
|
|
|
INC_CLIENT()
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
SWEP.DrawCrosshair = false
|
|
|
|
|
|
|
|
function SWEP:Deploy()
|
2018-05-02 06:32:59 +08:00
|
|
|
gamemode.Call("WeaponDeployed", self:GetOwner(), self)
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:DrawHUD()
|
2018-05-02 06:32:59 +08:00
|
|
|
if GetConVar("crosshair"):GetInt() ~= 1 then return end
|
2014-10-02 08:49:54 +08:00
|
|
|
self:DrawCrosshairDot()
|
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:PrimaryAttack()
|
|
|
|
end
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
function SWEP:DrawWeaponSelection(x, y, w, h, alpha)
|
|
|
|
self:BaseDrawWeaponSelection(x, y, w, h, alpha)
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:Think()
|
|
|
|
end
|
|
|
|
|
|
|
|
local function okclick(self)
|
|
|
|
RunConsoleCommand("setmessagebeaconmessage", self:GetParent().Choice)
|
|
|
|
self:GetParent():Close()
|
|
|
|
end
|
|
|
|
|
|
|
|
local function onselect(self, index, value, data)
|
|
|
|
self:GetParent().Choice = data
|
|
|
|
end
|
|
|
|
|
|
|
|
local Menu
|
|
|
|
function SWEP:SecondaryAttack()
|
2018-05-02 06:32:59 +08:00
|
|
|
if Menu and Menu:IsValid() then
|
2014-10-02 08:49:54 +08:00
|
|
|
Menu:SetVisible(true)
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
Menu = vgui.Create("DFrame")
|
|
|
|
Menu:SetDeleteOnClose(false)
|
|
|
|
Menu:SetSize(200, 100)
|
|
|
|
Menu:SetTitle("Select a message")
|
|
|
|
Menu:Center()
|
|
|
|
Menu.Choice = 1
|
|
|
|
|
|
|
|
local choice = vgui.Create("DComboBox", Menu)
|
|
|
|
for k, v in ipairs(GAMEMODE.ValidBeaconMessages) do
|
|
|
|
choice:AddChoice(translate.Get(v), k)
|
|
|
|
end
|
|
|
|
choice:ChooseOption(GAMEMODE.ValidBeaconMessages[1], 1)
|
|
|
|
choice:SizeToContents()
|
|
|
|
choice:SetWide(Menu:GetWide() - 16)
|
|
|
|
choice:Center()
|
|
|
|
choice.OnSelect = onselect
|
|
|
|
|
|
|
|
local ok = EasyButton(Menu, "OK", 8, 4)
|
|
|
|
ok:AlignBottom(8)
|
|
|
|
ok:CenterHorizontal()
|
|
|
|
ok.DoClick = okclick
|
|
|
|
|
|
|
|
Menu:MakePopup()
|
|
|
|
end
|