This commit is contained in:
lifestorm
2024-08-04 23:54:45 +03:00
parent 0e770b2b49
commit df294d03aa
7526 changed files with 4011945 additions and 15 deletions

View File

@@ -0,0 +1,246 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
surface.CreateFont("UCWepSel", {
font = "Bahnschrift",
size = 36,
weight = 0,
blursize = 0,
antialias = true,
})
surface.CreateFont("UCWepSel2", {
font = "Bahnschrift Light",
size = 17,
weight = 0,
blursize = 0,
antialias = true,
})
surface.CreateFont("UCWepSel3", {
font = "Bahnschrift Light",
size = 13,
weight = 0,
blursize = 0,
antialias = true,
})
local PANEL = {}
local matOverlay_AdminOnly = Material("icon16/shield.png")
local matOverlay_NPCWeapon = Material("icon16/monkey.png")
local matOverlay_NPCWeaponSelected = Material("icon16/monkey_tick.png")
AccessorFunc(PANEL, "m_Color", "Color")
AccessorFunc(PANEL, "m_Type", "ContentType")
AccessorFunc(PANEL, "m_SpawnName", "SpawnName")
AccessorFunc(PANEL, "m_NPCWeapon", "NPCWeapon")
AccessorFunc(PANEL, "m_bAdminOnly", "AdminOnly")
AccessorFunc(PANEL, "m_bIsNPCWeapon", "IsNPCWeapon")
function PANEL:Init()
self:SetPaintBackground(false)
-- local sw, sh = self:GetParent():GetParent():GetParent():GetSize()
self:SetSize(384*0.9, 128) -- TODO: get real long n har. nvm
self:SetText("")
self:SetDoubleClickingEnabled(false)
self.Image = self:Add("DImage")
self.Image:SetPos(3, 3)
self.Image:SetSize(128 - 6, 128 - 6)
self.Image:SetVisible(false)
self.Border = 0
end
function PANEL:SetName(name, spname, other)
self:SetTooltip(name .. "\n" .. spname)
self.WEP_NAME = name
self.WEP_MANU = other.manu
self.WEP_YEAR = other.year
self.WEP_CALI = other.cali
--self.Label:SetText( name )
--self.Label2:SetText( name )
self.m_NiceName = name
end
function PANEL:SetMaterial(name)
self.m_MaterialName = name
local mat = Material(name)
-- Look for the old style material
if not mat or mat:IsError() then
name = name:Replace("entities/", "VGUI/entities/")
name = name:Replace(".png", "")
mat = Material(name)
end
-- Couldn't find any material.. just return
if not mat or mat:IsError() then
mat = Material("entities/ucepicfail.png")
end
self.Image:SetMaterial(mat)
end
function PANEL:DoRightClick()
local pCanvas = self:GetSelectionCanvas()
if IsValid(pCanvas) and pCanvas:NumSelectedChildren() > 0 and self:IsSelected() then return hook.Run("SpawnlistOpenGenericMenu", pCanvas) end
self:OpenMenu()
end
function PANEL:DoClick()
end
function PANEL:OpenMenu()
end
function PANEL:OnDepressionChanged(b)
end
function PANEL:Paint(w, h)
if self.Depressed and not self.Dragging then
if self.Border ~= 8 then
self.Border = 8
self:OnDepressionChanged(true)
end
else
if self.Border ~= 0 then
self.Border = 0
self:OnDepressionChanged(false)
end
end
surface.SetDrawColor(255, 255, 255, 255)
if not dragndrop.IsDragging() and (self:IsHovered() or self.Depressed or self:IsChildHovered()) then
surface.SetMaterial(Material("entities/uchover.png"))
surface.DrawTexturedRect(self.Border, self.Border, w, h)
end
--surface.SetMaterial( matOverlay_Normal )
--self.Label:Show()
local c_w, c_s = Color(255, 255, 255, 200), Color(0, 0, 0, 127)
-- Name
if assert(self.WEP_NAME, "Holy balls no weapon name??") then
surface.SetFont("UCWepSel")
surface.SetTextPos((128 + 16) + 2, (50 - 24) + 2)
surface.SetTextColor(c_s)
surface.DrawText(self.WEP_NAME or "idk")
surface.SetTextPos(128 + 16, 50 - 24)
surface.SetTextColor(color_white)
surface.DrawText(self.WEP_NAME or "idk")
end
local ya = false
if self.WEP_MANU then
-- Manufacturer
surface.SetFont("UCWepSel2")
surface.SetTextPos((128 + 16) + 2, (50 - 24 + 32) + 2)
surface.SetTextColor(c_s)
surface.DrawText(self.WEP_MANU or "idk")
surface.SetTextPos(128 + 16, 50 - 24 + 32)
surface.SetTextColor(c_w)
surface.DrawText(self.WEP_MANU or "idk")
ya = true
end
if self.WEP_CALI then
-- Caliber
surface.SetFont("UCWepSel3")
surface.SetTextPos((128 + 16) + 2, (50 - 24 + 32 + (ya and 16 or 0)) + 2)
surface.SetTextColor(c_s)
surface.DrawText(self.WEP_CALI or "idk")
surface.SetTextPos(128 + 16, 50 - 24 + 32 + (ya and 16 or 0))
surface.SetTextColor(c_w)
surface.DrawText(self.WEP_CALI or "idk")
end
if self.WEP_YEAR then
-- Year
surface.SetFont("UCWepSel3")
surface.SetTextPos((128 + 16) + 2, (50 - 31) + 2)
surface.SetTextColor(c_s)
surface.DrawText(self.WEP_YEAR or "9999")
surface.SetTextPos(128 + 16, 50 - 31)
surface.SetTextColor(c_w)
surface.DrawText(self.WEP_YEAR or "9999")
end
render.PushFilterMag(TEXFILTER.ANISOTROPIC)
render.PushFilterMin(TEXFILTER.ANISOTROPIC)
self.Image:PaintAt(3 + self.Border, 3 + self.Border, 128 - 8 - self.Border * 2, 128 - 8 - self.Border * 2)
render.PopFilterMin()
render.PopFilterMag()
--surface.DrawTexturedRect( self.Border, self.Border, w-self.Border*2, h-self.Border*2 )
if self:GetAdminOnly() then
surface.SetMaterial(matOverlay_AdminOnly)
surface.DrawTexturedRect(self.Border + 8, self.Border + 8, 16, 16)
end
-- This whole thing could be more dynamic
if self:GetIsNPCWeapon() then
surface.SetMaterial(matOverlay_NPCWeapon)
if self:GetSpawnName() == GetConVar("gmod_npcweapon"):GetString() then
surface.SetMaterial(matOverlay_NPCWeaponSelected)
end
surface.DrawTexturedRect(w - self.Border - 24, self.Border + 8, 16, 16)
end
self:ScanForNPCWeapons()
end
function PANEL:ScanForNPCWeapons()
if self.HasScanned then return end
self.HasScanned = true
for _, v in pairs(list.Get("NPCUsableWeapons")) do
if v.class == self:GetSpawnName() then
self:SetIsNPCWeapon(true)
break
end
end
end
function PANEL:PaintOver(w, h)
self:DrawSelections()
end
function PANEL:ToTable(bigtable)
local tab = {}
tab.type = self:GetContentType()
tab.nicename = self.m_NiceName
tab.material = self.m_MaterialName
tab.admin = self:GetAdminOnly()
tab.spawnname = self:GetSpawnName()
tab.weapon = self:GetNPCWeapon()
table.insert(bigtable, tab)
end
function PANEL:Copy()
local copy = vgui.Create("UCWepSel", self:GetParent())
copy:SetContentType(self:GetContentType())
copy:SetSpawnName(self:GetSpawnName())
copy:SetName(self.m_NiceName, self:GetSpawnName())
copy:SetMaterial(self.m_MaterialName)
copy:SetNPCWeapon(self:GetNPCWeapon())
copy:SetAdminOnly(self:GetAdminOnly())
copy:CopyBase(self)
copy.DoClick = self.DoClick
copy.OpenMenu = self.OpenMenu
copy.OpenMenuExtra = self.OpenMenuExtra
return copy
end
vgui.Register("UCWepSel", PANEL, "DButton")

View File

@@ -0,0 +1,276 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local tbl = table
local tbl_add = tbl.Add
local tbl_ins = tbl.insert
local tostr = tostring
local translate = ArcCW.GetTranslation
-- ["buff"] = {"desc", string mode (mult, add, override, func), bool lowerbetter or function(val), number priority, bool flipsigns }
ArcCW.AutoStats = {
-- Attachments
["MagExtender"] = { "autostat.magextender", "override", false, pr = 317 },
["MagReducer"] = { "autostat.magreducer", "override", true, pr = 316 },
["Bipod"] = { "autostat.bipod", false, false, pr = 313 },
["ScopeGlint"] = { "autostat.glint", "override", true, pr = 255 },
["Silencer"] = { "autostat.silencer", "override", false, pr = 254 },
["Override_NoRandSpread"] = { "autostat.norandspr", "override", false, pr = 253 },
["Override_CanFireUnderwater"] = { "autostat.underwater", "override", false, pr = 252 },
["Override_ShootWhileSprint"] = { "autostat.sprintshoot", "override", false, pr = 251 },
-- Multipliers
["Mult_BipodRecoil"] = { "autostat.bipodrecoil", false, true, pr = 312 },
["Mult_BipodDispersion"] = { "autostat.bipoddisp", false, true, pr = 311 },
["Mult_Damage"] = { "autostat.damage", "mult", false, pr = 215 },
["Mult_DamageMin"] = { "autostat.damagemin", "mult", false, pr = 214 },
["Mult_Range"] = { "autostat.range", "mult", false, pr = 185 },
["Mult_RangeMin"] = { "autostat.rangemin", "mult", false, pr = 184 },
["Mult_Penetration"] = { "autostat.penetration", "mult", false, pr = 213 },
["Mult_MuzzleVelocity"] = { "autostat.muzzlevel", "mult", false, pr = 212 },
["Mult_PhysBulletMuzzleVelocity"] = { "autostat.muzzlevel", "mult", false, pr = 211 },
["Mult_MeleeTime"] = { "autostat.meleetime", "mult", true, pr = 145 },
["Mult_MeleeDamage"] = { "autostat.meleedamage", "mult", false, pr = 144 },
["Add_MeleeRange"] = { "autostat.meleerange", false, false, pr = 143 },
["Mult_Recoil"] = { "autostat.recoil", "mult", true, pr = 195 },
["Mult_RecoilSide"] = { "autostat.recoilside", "mult", true, pr = 194 },
["Mult_RPM"] = { "autostat.firerate", "mult", false, pr = 216 },
["Mult_AccuracyMOA"] = { "autostat.precision", "mult", true, pr = 186 },
["Mult_HipDispersion"] = { "autostat.hipdisp", "mult", true, pr = 155 },
["Mult_SightsDispersion"] = { "autostat.sightdisp", "mult", true, pr = 154 },
["Mult_MoveDispersion"] = { "autostat.movedisp", "mult", true, pr = 153 },
["Mult_JumpDispersion"] = { "autostat.jumpdisp", "mult", true, pr = 152 },
["Mult_ShootVol"] = { "autostat.shootvol", "mult", true, pr = 115 },
["Mult_SpeedMult"] = { "autostat.speedmult", "mult", false, pr = 114 },
["Mult_MoveSpeed"] = { "autostat.speedmult", "mult", false, pr = 105 },
["Mult_SightedSpeedMult"] = { "autostat.sightspeed", "mult", false, pr = 104 },
["Mult_SightedMoveSpeed"] = { "autostat.sightspeed", "mult", false, pr = 103 },
["Mult_ShootSpeedMult"] = { "autostat.shootspeed", "mult", false, pr = 102 },
["Mult_ReloadTime"] = { "autostat.reloadtime", "mult", true, pr = 125 },
["Add_BarrelLength"] = { "autostat.barrellength","add", true, pr = 915 },
["Mult_DrawTime"] = { "autostat.drawtime", "mult", true, pr = 14 },
["Mult_SightTime"] = { "autostat.sighttime", "mult", true, pr = 335, flipsigns = true },
["Mult_CycleTime"] = { "autostat.cycletime", "mult", true, pr = 334 },
["Mult_Sway"] = { "autostat.sway", "mult", true, pr = 353 },
["Mult_HeatCapacity"] = { "autostat.heatcap", "mult", false, pr = 10 },
["Mult_HeatDissipation"] = { "autostat.heatdrain", "mult", false, pr = 9 },
["Mult_FixTime"] = { "autostat.heatfix", "mult", true, pr = 8 },
["Mult_HeatDelayTime"] = { "autostat.heatdelay", "mult", true, pr = 7 },
["Mult_MalfunctionMean"] = { "autostat.malfunctionmean", "mult", false, pr = 6 },
["Add_ClipSize"] = { "autostat.clipsize.mod", "add", false, pr = 315 },
["Mult_ClipSize"] = { "autostat.clipsize.mod", "mult", false, pr = 314 },
["Mult_TriggerDelayTime"] = { "autostat.triggerdelay", "mult", true, pr = 200 },
["Override_Ammo"] = {"autostat.ammotype", "func", function(wep, val, att)
-- have to use the weapons table here because Primary.Ammo *is* modified when attachments are used
if !IsValid(wep) or !weapons.Get(wep:GetClass()) or weapons.Get(wep:GetClass()).Primary.Ammo == val then return end
return string.format(translate("autostat.ammotype"), string.lower(ArcCW.TranslateAmmo(val))), "infos"
end, pr = 316},
["Override_ClipSize"] = {"autostat.clipsize", "func", function(wep, val, att)
if !IsValid(wep) then return end
local ogclip = wep:GetBuff_Override("BaseClipSize") or (wep.RegularClipSize or (wep.Primary and wep.Primary.ClipSize) or 0)
if ogclip < val then
return string.format(translate("autostat.clipsize"), val), "pros"
else
return string.format(translate("autostat.clipsize"), val), "cons"
end
end, pr = 317},
["Bipod"] = {"autostat.bipod2", "func", function(wep, val, att)
if val then
local recoil = 100 - math.Round((att.Mult_BipodRecoil or (IsValid(wep) and wep.BipodRecoil) or 1) * 100)
local disp = 100 - math.Round((att.Mult_BipodDispersion or (IsValid(wep) and wep.BipodDispersion) or 1) * 100)
return string.format(translate("autostat.bipod2"), disp, recoil), "pros"
else
return translate("autostat.nobipod"), "cons"
end
end, pr = 314},
["UBGL"] = { "autostat.ubgl", "override", false, pr = 950 },
["UBGL_Ammo"] = {"autostat.ammotypeubgl", "func", function(wep, val, att)
-- have to use the weapons table here because Primary.Ammo *is* modified when attachments are used
if !IsValid(wep) then return end
return string.format(translate("autostat.ammotypeubgl"), string.lower(ArcCW.TranslateAmmo(val))), "infos"
end, pr = 949},
["Add_AccuracyMOA"] = { "autostat.precision", "func", function(wep, val, att)
if val > 0 then
return "+" .. math.Round(val, 2) .. " " .. translate("unit.moa") .. " " .. translate("autostat.precision"), "cons"
else
return "-" .. math.Round(val, 2) .. " " .. translate("unit.moa") .. " " .. translate("autostat.precision"), "pros"
end
end, pr = 187 },
}
local function getsimpleamt(stat)
if stat > 1 then
return stat >= 2 and "++++ " or stat >= 1.5 and "+++ " or stat >= 1.25 and "++ " or "+ "
elseif stat < 1 then
return stat <= 0.75 and "---- " or stat <= 0.5 and "--- " or stat <= 0.25 and "-- " or "- "
end
end
local function stattext(wep, att, i, k, dmgboth, flipsigns)
if !ArcCW.AutoStats[i] then return end
if i == "Mult_DamageMin" and dmgboth then return end
local stat = ArcCW.AutoStats[i]
local simple = ArcCW.ConVars["attinv_simpleproscons"]:GetBool()
local txt = ""
local str, eval = ArcCW.GetTranslation(stat[1]) or stat[1], stat[3]
if i == "Mult_Damage" and dmgboth then
str = ArcCW.GetTranslation("autostat.damageboth") or stat[1]
end
local tcon, tpro = eval and "cons" or "pros", eval and "pros" or "cons"
if stat[3] == "infos" then
tcon = "infos"
end
if stat[2] == "mult" and k != 1 then
local sign, percent = k > 1 and (flipsigns and "-" or "+") or (flipsigns and "+" or "-"), k > 1 and (k - 1) or (1 - k)
txt = simple and getsimpleamt(k) or sign .. tostr(math.Round(percent * 100, 2)) .. "% "
return txt .. str, k > 1 and tcon or tpro
elseif stat[2] == "add" and k != 0 then
local sign, state = k > 0 and (flipsigns and "-" or "+") or (flipsigns and "+" or "-"), k > 0 and k or -k
txt = simple and "+ " or sign .. tostr(state) .. " "
return txt .. str, k > 0 and tcon or tpro
elseif stat[2] == "override" and k == true then
return str, tcon
elseif stat[2] == "func" then
local a, b = stat[3](wep, k, att)
if a and b then return a, b end
end
end
function ArcCW:GetProsCons(wep, att, toggle)
local pros = {}
local cons = {}
local infos = {}
tbl_add(pros, att.Desc_Pros or {})
tbl_add(cons, att.Desc_Cons or {})
tbl_add(infos, att.Desc_Neutrals or {})
local override = hook.Run("ArcCW_PreAutoStats", wep, att, pros, cons, infos, toggle)
if override then return pros, cons, infos end
-- Localize attachment-specific text
local hasmaginfo = false
for i, v in pairs(pros) do
if v == "pro.magcap" then hasmaginfo = true end
pros[i] = ArcCW.TryTranslation(v)
end
for i, v in pairs(cons) do
if v == "con.magcap" then hasmaginfo = true end
cons[i] = ArcCW.TryTranslation(v)
end
for i, v in pairs(infos) do infos[i] = ArcCW.TryTranslation(v) end
if !att.AutoStats then return pros, cons, infos end
-- Process togglable stats
if att.ToggleStats then
--local toggletbl = att.ToggleStats[toggle or 1]
for ti, toggletbl in pairs(att.ToggleStats) do
-- show the first stat block (unless NoAutoStats), and all blocks with AutoStats
if toggletbl.AutoStats or (ti == (toggle or 1) and !toggletbl.NoAutoStats) then
local dmgboth = toggletbl.Mult_DamageMin and toggletbl.Mult_Damage and toggletbl.Mult_DamageMin == toggletbl.Mult_Damage
for i, stat in SortedPairsByMemberValue(ArcCW.AutoStats, "pr", true) do
if !toggletbl[i] or toggletbl[i .. "_SkipAS"] then continue end
local val = toggletbl[i]
--[[]
-- makes the stat show as a sum and not an additional modifier
-- feels more confusing though
if att[i] then
if stat[2] == "add" then
val = val + att[i]
elseif stat[2] == "mult" then
val = val * att[i]
end
end
]]
local txt, typ = stattext(wep, toggletbl, i, val, dmgboth, ArcCW.AutoStats[i].flipsigns )
if !txt then continue end
local prefix = (stat[2] == "override" and k == true) and "" or ("[" .. (toggletbl.AutoStatName or toggletbl.PrintName or ti) .. "] ")
if typ == "pros" then
tbl_ins(pros, prefix .. txt)
elseif typ == "cons" then
tbl_ins(cons, prefix .. txt)
elseif typ == "infos" then
tbl_ins(infos, prefix .. txt)
end
end
end
end
end
local dmgboth = att.Mult_DamageMin and att.Mult_Damage and att.Mult_DamageMin == att.Mult_Damage
for i, stat in SortedPairsByMemberValue(ArcCW.AutoStats, "pr", true) do
if !att[i] or att[i .. "_SkipAS"] then continue end
-- Legacy support: If "Increased/Decreased magazine capacity" line exists, don't do our autostats version
if hasmaginfo and i == "Override_ClipSize" then continue end
if i == "UBGL" then
tbl_ins(infos, translate("autostat.ubgl2"))
end
local txt, typ = stattext(wep, att, i, att[i], dmgboth, ArcCW.AutoStats[i].flipsigns )
if !txt then continue end
if typ == "pros" then
tbl_ins(pros, txt)
elseif typ == "cons" then
tbl_ins(cons, txt)
elseif typ == "infos" then
tbl_ins(infos, txt)
end
--[[]
if i == "Mult_DamageMin" and dmgboth then continue end
local k, txt = att[i], ""
local str, st = ArcCW.GetTranslation(stat[1]) or stat[1], stat[3]
if i == "Mult_Damage" and dmgboth then
str = ArcCW.GetTranslation("autostat.damageboth") or stat[1]
end
local tcon, tpro = st and cons or pros, st and pros or cons
if stat[2] == "mult" and k != 1 then
local sign, percent = k > 1 and "+" or "-", k > 1 and (k - 1) or (1 - k)
txt = simple and getsimpleamt(k) or sign .. tostr(math.Round(percent * 100, 2)) .. "% "
tbl_ins(k > 1 and tcon or tpro, txt .. str)
elseif stat[2] == "add" and k != 0 then
local sign, state = k > 0 and "+" or "-", k > 0 and k or -k
txt = simple and "+ " or sign .. tostr(state) .. " "
tbl_ins(k > 1 and tpro or tcon, txt .. str)
elseif stat[2] == "override" and k == true then
tbl_ins(st and cons or pros, 1, str)
end
]]
end
hook.Run("ArcCW_PostAutoStats", wep, att, pros, cons, infos, toggle)
return pros, cons, infos
end

View File

@@ -0,0 +1,208 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ArcCW.KEY_FIREMODE = "+zoom"
ArcCW.KEY_FIREMODE_ALT = "arccw_firemode"
ArcCW.KEY_ZOOMIN = "invnext"
ArcCW.KEY_ZOOMIN_ALT = "arccw_zoom_in"
ArcCW.KEY_ZOOMOUT = "invprev"
ArcCW.KEY_ZOOMOUT_ALT = "arccw_zoom_out"
ArcCW.KEY_TOGGLEINV = "+menu_context"
ArcCW.KEY_TOGGLEINV_ALT = "arccw_toggle_inv"
ArcCW.KEY_SWITCHSCOPE = "+use"
ArcCW.KEY_SWITCHSCOPE_ALT = "arccw_switch_scope"
ArcCW.KEY_TOGGLEUBGL = "arccw_toggle_ubgl"
ArcCW.KEY_TOGGLEATT = "arccw_toggle_att"
ArcCW.KEY_MELEE = "arccw_melee"
ArcCW.BindToEffect = {
[ArcCW.KEY_FIREMODE] = "firemode",
[ArcCW.KEY_ZOOMIN] = "zoomin",
[ArcCW.KEY_ZOOMOUT] = "zoomout",
[ArcCW.KEY_TOGGLEINV] = "inv",
[ArcCW.KEY_SWITCHSCOPE] = "switchscope_dtap",
}
ArcCW.BindToEffect_Unique = {
[ArcCW.KEY_TOGGLEUBGL] = "ubgl",
[ArcCW.KEY_SWITCHSCOPE_ALT] = "switchscope",
[ArcCW.KEY_FIREMODE_ALT] = "firemode",
[ArcCW.KEY_ZOOMIN_ALT] = "zoomin",
[ArcCW.KEY_ZOOMOUT_ALT] = "zoomout",
[ArcCW.KEY_TOGGLEINV_ALT] = "inv",
[ArcCW.KEY_TOGGLEATT] = "toggleatt",
[ArcCW.KEY_MELEE] = "melee",
}
local lastpressZ = 0
local lastpressE = 0
function ArcCW:GetBind(bind)
local button = input.LookupBinding(bind)
return button == "no value" and bind .. " unbound" or button
end
local function ArcCW_TranslateBindToEffect(bind)
local alt = ArcCW.ConVars["altbindsonly"]:GetBool()
if alt then
return ArcCW.BindToEffect_Unique[bind], true
else
return ArcCW.BindToEffect_Unique[bind] or ArcCW.BindToEffect[bind] or bind, ArcCW.BindToEffect_Unique[bind] != nil
end
end
local function SendNet(string, bool)
net.Start(string)
if bool != nil then net.WriteBool(bool) end
net.SendToServer()
end
local function DoUbgl(wep)
if wep:GetInUBGL() then
SendNet("arccw_ubgl", false)
wep:DeselectUBGL()
else
SendNet("arccw_ubgl", true)
wep:SelectUBGL()
end
end
local debounce = 0
local function ToggleAtts(wep)
if debounce > CurTime() then return end -- ugly hack for double trigger
debounce = CurTime() + 0.15
local sounds = {}
for k, v in pairs(wep.Attachments) do
local atttbl = v.Installed and ArcCW.AttachmentTable[v.Installed]
if atttbl and atttbl.ToggleStats and !v.ToggleLock then
if atttbl.ToggleSound then sounds[atttbl.ToggleSound] = true
else sounds["weapons/arccw/firemode.wav"] = true end
wep:ToggleSlot(k, nil, true)
end
end
for snd, _ in pairs(sounds) do
surface.PlaySound(snd)
end
end
local function ArcCW_PlayerBindPress(ply, bind, pressed)
if !(ply:IsValid() and pressed) then return end
local wep = ply:GetActiveWeapon()
if !wep.ArcCW then return end
local block = false
if GetConVar("arccw_nohl2flash"):GetBool() and bind == "impulse 100" then
ToggleAtts(wep)
if ply:FlashlightIsOn() then return false end -- if hl2 flahslight is on we will turn it off as expected
return true -- we dont want hl2 flashlight
end
local alt
bind, alt = ArcCW_TranslateBindToEffect(bind)
if bind == "firemode" and (alt or true) and !ply:KeyDown(IN_USE) then
SendNet("arccw_firemode")
wep:ChangeFiremode()
block = true
elseif bind == "inv" and !ply:KeyDown(IN_USE) and ArcCW.ConVars["enable_customization"]:GetInt() > -1 then
local state = wep:GetState() != ArcCW.STATE_CUSTOMIZE
SendNet("arccw_togglecustomize", state)
wep:ToggleCustomizeHUD(state)
block = true
elseif bind == "ubgl" then
DoUbgl(wep)
elseif bind == "toggleatt" then
ToggleAtts(wep)
end
if wep:GetState() == ArcCW.STATE_SIGHTS then
if bind == "zoomin" then
wep:Scroll(1)
block = true
elseif bind == "zoomout" then
wep:Scroll(-1)
block = true
elseif bind == "switchscope_dtap" then
if lastpressE >= CurTime() - 0.25 then
wep:SwitchActiveSights()
lastpressE = 0
else
lastpressE = CurTime()
end
elseif bind == "switchscope" then
wep:SwitchActiveSights()
block = true
end
end
if bind == "melee" and wep:GetState() != ArcCW.STATE_SIGHTS then
wep:Bash()
end
if block then return true end
end
hook.Add("PlayerBindPress", "ArcCW_PlayerBindPress", ArcCW_PlayerBindPress)
-- Actually register the damned things so they can be bound
for k, v in pairs(ArcCW.BindToEffect_Unique) do
concommand.Add(k, function(ply) ArcCW_PlayerBindPress(ply, k, true) end, nil, v, 0)
end
-- ArcCW.CaptureKeys = {
-- KEY_G
-- }
-- ArcCW.LastInputs = {}
-- ArcCW.Inputs = {}
-- local function ArcCW_CustomInputs()
-- local inputs = {}
-- for _, i in pairs(ArcCW.CaptureKeys) do
-- -- local conv = GetConVar(i)
-- -- if !conv then continue end
-- -- if !IsValid(conv) then continue end
-- local kc = i
-- inputs[kc] = input.IsKeyDown(kc)
-- end
-- ArcCW.LastInputs = ArcCW.Inputs
-- ArcCW.Inputs = inputs
-- if ArcCW:KeyPressed(KEY_G) then
-- ArcCW:QuickNade("frag")
-- end
-- end
-- hook.Add("Think", "ArcCW_CustomInputs", ArcCW_CustomInputs)
-- function ArcCW:KeyPressed(key)
-- if !ArcCW.LastInputs[key] and ArcCW.Inputs[key] then
-- return true
-- end
-- return false
-- end

View File

@@ -0,0 +1,297 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local srf = surface
local function ScreenScaleMulti(input)
return ScreenScale(input) * ArcCW.ConVars["hud_size"]:GetFloat()
end
local blacklistWindow = nil
local blacklistTbl = {}
local filter = ""
local onlyblacklisted = false
local internalName = false
local dragMode = nil
local color_arccwbred = Color(150, 50, 50, 255)
local color_arccwlred = Color(125, 25, 25, 150)
local color_arccwdred = Color(75, 0, 0, 150)
local color_arccwdtbl = Color(0, 0, 0, 200)
local function SaveBlacklist()
-- We send ID over instead of strings to save on network costs
-- optimization_is_optimization.png
local blacklistAmt = 0
for attName, bStatus in pairs(blacklistTbl) do
if bStatus then blacklistAmt = blacklistAmt + 1 end
end
net.Start("arccw_blacklist")
net.WriteBool(false)
net.WriteUInt(blacklistAmt, ArcCW.GetBitNecessity())
for attName, bStatus in pairs(blacklistTbl) do
if bStatus then
net.WriteUInt(ArcCW.AttachmentTable[attName].ID, ArcCW.GetBitNecessity())
end
end
net.SendToServer()
blacklistTbl = {}
end
local function CreateAttButton(parent, attName, attTbl)
local attBtn = vgui.Create("DButton", parent)
attBtn:SetFont("ArcCW_8")
attBtn:SetText("")
attBtn:SetSize(ScreenScaleMulti(256), ScreenScaleMulti(16))
attBtn:Dock(TOP)
attBtn:DockMargin(ScreenScaleMulti(36), ScreenScaleMulti(1), ScreenScaleMulti(36), ScreenScaleMulti(1))
attBtn:SetContentAlignment(5)
attBtn.Paint = function(spaa, w, h)
local blisted = blacklistTbl[attName]
if blisted == nil then blisted = attTbl.Blacklisted end
local hovered = spaa:IsHovered()
local blackhov = blisted and hovered
local Bfg_col = blackhov and color_arccwbred or blisted and color_arccwbred or hovered and color_black or color_white
local Bbg_col = blackhov and color_arccwlred or blisted and color_arccwdred or hovered and color_white or color_arccwdtbl
srf.SetDrawColor(Bbg_col)
srf.DrawRect(0, 0, w, h)
local img = attTbl.Icon
if img then
srf.SetDrawColor(Bfg_col)
srf.SetMaterial(img)
srf.DrawTexturedRect(ScreenScaleMulti(2), 0, h, h)
end
local txt = attTbl.PrintName
if internalName then txt = attName end
srf.SetTextColor(Bfg_col)
srf.SetTextPos(ScreenScaleMulti(20), ScreenScaleMulti(2))
srf.SetFont("ArcCW_12")
srf.DrawText(txt)
local listed = (blacklistTbl[attName] and !attTbl.Blacklisted)
local unlisted = (attTbl.Blacklisted and !blacklistTbl[attName])
local saved = (listed or unlisted) and " [not saved]" or ""
srf.SetTextColor(Bfg_col)
srf.SetTextPos(spaa:GetWide() - ScreenScaleMulti(36), ScreenScaleMulti(4))
srf.SetFont("ArcCW_8")
srf.DrawText(saved)
end
-- In addition to clicking on a button, you can drag over all of them!
attBtn.OnMousePressed = function(spaa, kc)
blacklistTbl[attName] = !blacklistTbl[attName] and !attTbl.Blacklisted or !blacklistTbl[attName]
dragMode = blacklistTbl[attName]
hook.Add("Think", "ArcCW_Blacklist", function()
if !input.IsMouseDown(MOUSE_LEFT) then
dragMode = nil
hook.Remove("Think", "ArcCW_Blacklist")
end
end)
end
attBtn.OnCursorEntered = function(spaa, kc)
if dragMode != nil and input.IsMouseDown(MOUSE_LEFT) then
blacklistTbl[attName] = dragMode
end
end
return attBtn
end
function ArcCW.MakeBlacklistWindow()
if blacklistWindow then blacklistWindow:Remove() end
blacklistTbl = {}
blacklistWindow = vgui.Create("DFrame")
blacklistWindow:SetSize(ScrW() * 0.5, ScrH() * 0.75)
blacklistWindow:Center()
blacklistWindow:SetTitle("")
blacklistWindow:SetDraggable(false)
blacklistWindow:SetVisible(true)
blacklistWindow:ShowCloseButton(true)
blacklistWindow:MakePopup()
blacklistWindow.Paint = function(self, w, h)
srf.SetDrawColor(color_arccwdtbl)
srf.DrawRect(0, 0, w, h)
end
local title = vgui.Create("DLabel", blacklistWindow)
title:SetSize(ScreenScaleMulti(256), ScreenScaleMulti(26))
title:Dock(TOP)
title:SetFont("ArcCW_24")
title:SetText("ArcCW Blacklist")
title:DockMargin(ScreenScaleMulti(16), 0, ScreenScaleMulti(16), ScreenScaleMulti(8))
local desc = vgui.Create("DLabel", blacklistWindow)
desc:SetSize(ScreenScaleMulti(256), ScreenScaleMulti(12))
desc:Dock(TOP)
desc:DockMargin(ScreenScaleMulti(4), 0, ScreenScaleMulti(4), ScreenScaleMulti(4))
desc:SetFont("ArcCW_12")
desc:SetText("Attachments checked here will stop showing up at all.")
desc:SetContentAlignment(5)
local attList = vgui.Create("DScrollPanel", blacklistWindow)
attList:SetText("")
attList:Dock(FILL)
attList:SetContentAlignment(5)
attList.Paint = function(span, w, h) end
local sbar = attList:GetVBar()
sbar.Paint = function() end
sbar.btnUp.Paint = function(span, w, h) end
sbar.btnDown.Paint = function(span, w, h) end
sbar.btnGrip.Paint = function(span, w, h)
srf.SetDrawColor(color_white)
srf.DrawRect(0, 0, w, h)
end
local FilterPanel = vgui.Create("DPanel", blacklistWindow)
FilterPanel:Dock(TOP)
FilterPanel:DockMargin(ScreenScaleMulti(16), ScreenScaleMulti(2), ScreenScaleMulti(16), ScreenScaleMulti(2))
FilterPanel:SetSize(ScreenScaleMulti(256), ScreenScaleMulti(12))
FilterPanel:SetPaintBackground(false)
local FilterLabel = vgui.Create("DLabel", FilterPanel)
FilterLabel:Dock(LEFT)
FilterLabel:SetWidth(ScreenScaleMulti(36))
FilterLabel:DockMargin(ScreenScaleMulti(2), ScreenScaleMulti(2), ScreenScaleMulti(2), ScreenScaleMulti(2))
FilterLabel:SetFont("ArcCW_12")
FilterLabel:SetText("FILTER")
local FilterButton = vgui.Create("DButton", FilterPanel)
FilterButton:SetFont("ArcCW_8")
FilterButton:SetText("")
FilterButton:SetSize(ScreenScaleMulti(48), ScreenScaleMulti(12))
FilterButton:Dock(RIGHT)
FilterButton:DockMargin(ScreenScaleMulti(1), 0, 0, 0)
FilterButton:SetContentAlignment(5)
FilterButton.OnMousePressed = function(spaa, kc)
onlyblacklisted = !onlyblacklisted
attList:GenerateButtonsToList()
end
FilterButton.Paint = function(spaa, w, h)
local hovered = spaa:IsHovered()
local Bfg_col = hovered and color_black or color_white
local Bbg_col = hovered and color_white or color_arccwdtbl
srf.SetDrawColor(Bbg_col)
srf.DrawRect(0, 0, w, h)
spaa:SetTextColor(Bfg_col)
spaa:SetText(onlyblacklisted and "BLACKLISTED" or "ALL")
end
local NameButton = vgui.Create("DButton", FilterPanel)
NameButton:SetFont("ArcCW_8")
NameButton:SetText("")
NameButton:SetSize(ScreenScaleMulti(24), ScreenScaleMulti(12))
NameButton:Dock(RIGHT)
NameButton:DockMargin(ScreenScaleMulti(1), 0, 0, 0)
NameButton:SetContentAlignment(5)
NameButton.OnMousePressed = function(spaa, kc)
internalName = !internalName
attList:GenerateButtonsToList()
end
NameButton.Paint = function(spaa, w, h)
local hovered = spaa:IsHovered()
local Bfg_col = hovered and color_black or color_white
local Bbg_col = hovered and color_white or color_arccwdtbl
srf.SetDrawColor(Bbg_col)
srf.DrawRect(0, 0, w, h)
spaa:SetTextColor(Bfg_col)
spaa:SetText(internalName and "ID" or "NAME")
end
local FilterEntry = vgui.Create("DTextEntry", FilterPanel)
FilterEntry:Dock(FILL)
FilterEntry:SetValue(filter)
FilterEntry:SetFont("ArcCW_12")
FilterEntry.OnChange = function( self )
filter = self:GetValue():lower()
attList:GenerateButtonsToList()
end
local accept = vgui.Create("DButton", blacklistWindow)
accept:SetSize(ScreenScaleMulti(256), ScreenScaleMulti(20))
accept:SetText("")
accept:Dock(BOTTOM)
accept:DockMargin(ScreenScaleMulti(48), ScreenScaleMulti(2), ScreenScaleMulti(48), ScreenScaleMulti(2))
accept:SetContentAlignment(5)
accept.OnMousePressed = function(spaa, kc)
SaveBlacklist()
blacklistWindow:Close()
blacklistWindow:Remove()
end
accept.Paint = function(spaa, w, h)
local hovered = spaa:IsHovered()
local Bfg_col = hovered and color_black or color_white
local Bbg_col = hovered and color_white or color_arccwdtbl
srf.SetDrawColor(Bbg_col)
srf.DrawRect(0, 0, w, h)
srf.SetTextColor(Bfg_col)
srf.SetTextPos(ScreenScaleMulti(4), ScreenScaleMulti(4))
srf.SetFont("ArcCW_12")
srf.DrawText("Save")
end
-- Perhaps unoptimized, but it's client
-- client_side_calculations_is_not_expensive.png
function attList:GenerateButtonsToList()
self:GetCanvas():Clear()
for attName, attTbl in SortedPairsByMemberValue(ArcCW.AttachmentTable, "PrintName") do
if attTbl.Hidden then continue end
if attTbl.Blacklisted then blacklistTbl[attName] = true end
if onlyblacklisted and !(attTbl.Blacklisted or blacklistTbl[attName]) then continue end
if filter != "" and !(string.find((attTbl.PrintName):lower(), filter) or string.find((attName):lower(), filter)) then continue end
--if attTbl.Slot == "charm" then continue end why the fuck would you do this
CreateAttButton(self, attName, attTbl)
end
end
attList:GenerateButtonsToList()
end
concommand.Add("arccw_blacklist", function()
if LocalPlayer():IsAdmin() then ArcCW.MakeBlacklistWindow() end
end)

View File

@@ -0,0 +1,162 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
--[[
ClientConVars table doc:
name = data:
def - default value
desc - description of var
min - minimum value
max - maximum value
usri - userinfo
save - whether to save (default true)
]]
ArcCW.ClientConVars = {
["arccw_bullet_imaginary"] = { def = 1 },
["arccw_crosshair"] = { def = 1 },
["arccw_crosshair_clr_r"] = { def = 255 },
["arccw_crosshair_clr_g"] = { def = 255 },
["arccw_crosshair_clr_b"] = { def = 255 },
["arccw_crosshair_clr_a"] = { def = 255 },
["arccw_crosshair_length"] = { def = 4 },
["arccw_crosshair_thickness"] = { def = 1 },
["arccw_crosshair_gap"] = { def = 1 },
["arccw_crosshair_static"] = { def = 0 },
["arccw_crosshair_clump"] = { def = 0 },
["arccw_crosshair_clump_outline"] = { def = 0 },
["arccw_crosshair_clump_always"] = { def = 0 },
["arccw_crosshair_outline"] = { def = 2 },
["arccw_crosshair_outline_r"] = { def = 0 },
["arccw_crosshair_outline_g"] = { def = 0 },
["arccw_crosshair_outline_b"] = { def = 0 },
["arccw_crosshair_outline_a"] = { def = 255 },
["arccw_crosshair_dot"] = { def = 1 },
["arccw_crosshair_shotgun"] = { def = 1 },
["arccw_crosshair_equip"] = { def = 1 },
["arccw_crosshair_aa"] = { def = 1 },
["arccw_crosshair_trueaim"] = { def = 0 },
["arccw_crosshair_prong_top"] = { def = 1 },
["arccw_crosshair_prong_left"] = { def = 1 },
["arccw_crosshair_prong_right"] = { def = 1 },
["arccw_crosshair_prong_bottom"] = { def = 1 },
["arccw_crosshair_tilt"] = { def = 0 },
["arccw_attinv_simpleproscons"] = { def = 0 },
["arccw_attinv_onlyinspect"] = { def = 0 },
["arccw_attinv_hideunowned"] = { def = 0 },
["arccw_attinv_darkunowned"] = { def = 0 },
["arccw_attinv_closeonhurt"] = { def = 0, usri = true },
["arccw_attinv_gamemodebuttons"] = { def = 1 },
["arccw_language"] = { def = "", usri = true },
["arccw_font"] = { def = "", usri = true },
["arccw_ammonames"] = { def = 0 },
["arccw_cheapscopes"] = { def = 1 },
["arccw_cheapscopesv2_ratio"] = { def = 0.05 },
["arccw_scopepp"] = { def = 1 },
["arccw_thermalpp"] = { def = 1 },
["arccw_scopepp_refract"] = { def = 0 },
["arccw_scopepp_refract_ratio"] = { def = 0.75 },
["arccw_cheapscopesautoconfig"] = { def = 0 }, -- what this for
--["arccw_flatscopes"] = { def = 0 },
["arccw_shake"] = { def = 1 },
["arccw_shakevm"] = { def = 1 },
["arccw_muzzleeffects"] = { def = 1 },
["arccw_shelleffects"] = { def = 1 },
["arccw_shelltime"] = { def = 0 },
["arccw_att_showothers"] = { def = 1 },
["arccw_att_showground"] = { def = 1 },
["arccw_visibility"] = { def = 8000 },
["arccw_fastmuzzles"] = { def = 0 },
["arccw_fasttracers"] = { def = 0 },
["arccw_2d3d"] = { def = 1, min = 0, max = 2},
["arccw_hud_3dfun"] = { def = 0, usri = true },
["arccw_hud_3dfun_lite"] = { def = 0 },
["arccw_hud_3dfun_ammotype"] = { def = 0 },
["arccw_hud_forceshow"] = { def = 0 },
["arccw_hud_fcgbars"] = { def = 1, desc = "Draw firemode bars on ammo HUD." },
["arccw_hud_fcgabbrev"] = { def = 0, desc = "Use shortened firemode names."},
["arccw_hud_minimal"] = { def = 1, desc = "Backup HUD if we cannot draw the ammo HUD." },
["arccw_hud_embracetradition"] = { def = 0, desc = "Use the classic customization HUD." },
["arccw_hud_deadzone_x"] = { def = 0 },
["arccw_hud_deadzone_y"] = { def = 0 },
["arccw_hud_3dfun_decaytime"] = { def = 3 },
["arccw_hud_3dfun_right"] = { def = 2 },
["arccw_hud_3dfun_up"] = { def = 1 },
["arccw_hud_3dfun_forward"] = { def = 0 },
["arccw_hud_size"] = { def = 1 },
["arccw_cust_sounds"] = { def = 1, desc = "Play sounds when opening and closing the customization menu." },
["arccw_scope_r"] = { def = 255 },
["arccw_scope_g"] = { def = 0 },
["arccw_scope_b"] = { def = 0 },
["arccw_blur"] = { def = 0 },
["arccw_blur_toytown"] = { def = 1 },
["arccw_adjustsensthreshold"] = { def = 0 },
["arccw_drawbarrel"] = { def = 0 },
["arccw_glare"] = { def = 1 },
["arccw_autosave"] = { def = 1 },
["arccw_vm_right"] = { def = 0 },
["arccw_vm_up"] = { def = 0 },
["arccw_vm_forward"] = { def = 0 },
["arccw_vm_pitch"] = { def = 0 },
["arccw_vm_yaw"] = { def = 0 },
["arccw_vm_roll"] = { def = 0 },
["arccw_vm_fov"] = { def = 0, usri = true },
["arccw_vm_add_ads"] = { def = 0},
["arccw_vm_coolsway"] = { def = 1 },
["arccw_vm_coolview"] = { def = 1 },
["arccw_vm_coolview_mult"] = { def = 1 },
["arccw_vm_look_xmult"] = { def = 1 },
["arccw_vm_look_ymult"] = { def = 1 },
["arccw_vm_sway_xmult"] = { def = 1 },
["arccw_vm_sway_ymult"] = { def = 1 },
["arccw_vm_sway_zmult"] = { def = 1 },
["arccw_vm_sway_speedmult"] = { def = 1 },
["arccw_vm_nearwall"] = { def = 1 },
["arccw_toggleads"] = { def = 0, usri = true },
["arccw_altbindsonly"] = { def = 0, usri = true },
["arccw_altsafety"] = { def = 0, usri = true },
["arccw_automaticreload"] = { def = 0, usri = true },
["arccw_nohl2flash"] = { def = 0, usri = true },
["arccw_aimassist_cl"] = { def = 0, usri = true },
["arccw_dev_benchgun"] = { def = 0, save = false },
["arccw_dev_benchgun_custom"] = { def = "", save = false },
["arccw_dev_removeonclose"] = { def = 0, desc = "Remove the hud when closing instead of fading out, allowing easy reloading of the hud.", save = false },
["arccw_noinspect"] = { def = 0, usri = true },
["arccw_dev_crosshair"] = { def = 0, save = false },
}
for name, data in pairs(ArcCW.ClientConVars) do
ArcCW.ConVars[string.sub(name, 7)] = CreateClientConVar(name, data.def, data.save == nil and true or data.save, data.usri or false, data.desc, data.min, data.max)
end
-- CreateClientConVar("arccw_quicknade", KEY_G)

View File

@@ -0,0 +1,100 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ArcCW.CSModels = {} -- [entid] = { Weapon = NULL, WModels = {}, VModels = {} }
ArcCW.CSModelPile = {} -- { {Model = NULL, Weapon = NULL} }
ArcCW.FlashlightPile = {} -- { {Weapon = NULL, ProjectedTexture = NULL}}
ArcCW.ReferenceModel = NULL
local function ArcCW_CollectGarbage()
local removed, removedents = 0, {}
for i, k in pairs(ArcCW.CSModels) do
if !IsValid(k.Weapon) then
removed = removed + 1
table.insert(removedents, i)
if k.WModels then for _, m in pairs(k.WModels) do SafeRemoveEntity(m.Model) end end
if k.VModels then for _, m in pairs(k.VModels) do SafeRemoveEntity(m.Model) end end
end
end
for _, i in pairs(removedents) do ArcCW.CSModels[i] = nil end
local newpile = {}
for _, k in pairs(ArcCW.CSModelPile) do
if IsValid(k.Weapon) then
table.insert(newpile, k)
continue
end
SafeRemoveEntity(k.Model)
removed = removed + 1
end
ArcCW.CSModelPile = newpile
if GetConVar("developer"):GetBool() and removed > 0 then
print("Removed " .. tostring(removed) .. " CSModels")
end
end
hook.Add("PostCleanupMap", "ArcCW_CleanGarbage", function()
ArcCW_CollectGarbage()
end)
timer.Create("ArcCW CSModel Garbage Collector", 5, 0, ArcCW_CollectGarbage)
hook.Add("PostDrawEffects", "ArcCW_CleanFlashlights", function()
local newflashlightpile = {}
for _, k in pairs(ArcCW.FlashlightPile) do
if IsValid(k.Weapon) and k.Weapon == LocalPlayer():GetActiveWeapon() then
table.insert(newflashlightpile, k)
continue
end
if k.ProjectedTexture and k.ProjectedTexture:IsValid() then
k.ProjectedTexture:Remove()
end
end
ArcCW.FlashlightPile = newflashlightpile
local wpn = LocalPlayer():GetActiveWeapon()
if !wpn then return end
if !IsValid(wpn) then return end
if !wpn.ArcCW then return end
if GetViewEntity() == LocalPlayer() then return end
wpn:KillFlashlightsVM()
end)
concommand.Add("arccw_dev_loadallattmodels", function()
local e = ClientsideModel("models/weapons/v_pistol.mdl")
print("created subject", e)
for i, v in pairs(ArcCW.AttachmentTable) do
if v.Model then
print("\t- " .. v.Model)
e:SetModel(v.Model)
end
end
print("removed subject", e)
e:Remove()
end)

View File

@@ -0,0 +1,72 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local rnd = render
local r_lightcol = rnd.GetLightColor
local glintmat = Material("effects/blueflare1")
local players
local playerssaver = {}
hook.Add("PostDrawEffects", "ArcCW_ScopeGlint", function()
if playerssaver != players then -- less calls on GetAll
players = player.GetAll()
playerssaver = players
end
cam.Start3D()
for _, ply in ipairs(players) do
if !IsValid(ply) then continue end
if ply == LocalPlayer() and !ply:ShouldDrawLocalPlayer() then continue end
local wep = ply:GetActiveWeapon()
if !(IsValid(wep) and wep.ArcCW) then continue end
if !wep:GetBuff_Override("ScopeGlint") then continue end
if wep:GetState() != ArcCW.STATE_SIGHTS then continue end
local vec = (ply:EyePos() - EyePos()):GetNormalized()
local dot = vec:Dot(-ply:EyeAngles():Forward())
dot = (dot * dot * 1.75) - 0.75
dot = dot * (0.5 + (1 - wep:GetSightDelta()) * 0.5)
if dot < 0 then continue end
local pos = ply:EyePos() + (ply:EyeAngles():Forward() * 16) + (ply:EyeAngles():Right() * 8)
local _, scope_i = wep:GetBuff_Override("ScopeGlint")
if scope_i then
local world = (wep.Attachments[scope_i].WElement or {}).Model
if world and IsValid(world) then
local att = world:LookupAttachment("holosight") or world:LookupAttachment("scope")
if att then pos = world:GetAttachment(att).Pos end
end
end
local lcolpos = r_lightcol(pos):Length()
local lcoleye = r_lightcol(EyePos()):Length()
local mag = wep:GetBuff_Mult("Mult_GlintMagnitude") or 1
local intensity = math.min(0.2 + (lcolpos + lcoleye) / 2 * 1, 1) * mag
local col = 255 * intensity
rnd.SetMaterial(glintmat)
rnd.DrawSprite(pos, 96 * dot, 96 * dot, Color(col, col, col))
end
cam.End3D()
end)

290
lua/arccw/client/cl_hud.lua Normal file
View File

@@ -0,0 +1,290 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local hide = {
["CHudHealth"] = true,
["CHudBattery"] = true,
["CHudAmmo"] = true,
["CHudSecondaryAmmo"] = true,
}
CreateClientConVar("arccw_hud_togglestats", "0")
ArcCW.HUDElementConVars = {
["CHudHealth"] = CreateClientConVar("arccw_hud_showhealth", "1"),
["CHudBattery"] = ArcCW.ConVars["hud_showhealth"],
["CHudAmmo"] = CreateClientConVar("arccw_hud_showammo", "1"),
["CHudSecondaryAmmo"] = ArcCW.ConVars["hud_showammo"],
}
local grad = Material("arccw/hud/grad.png", "mips smooth")
hook.Add("PreDrawViewModels", "ArcCW_PreDrawViewmodels_Grad", function()
if ArcCW.InvHUD and !grad:IsError() then
render.SetViewPort( 0, 0, ScrW(), ScrH() )
cam.Start2D()
surface.SetDrawColor(Color(255, 255, 255, Lerp(ArcCW.Inv_Fade-0.01, 0, 255)))
surface.SetMaterial(grad)
surface.DrawTexturedRect(0, 0, ScrW(), ScrH())
cam.End2D()
end
end)
hook.Add("HUDShouldDraw", "ArcCW_HideHUD", function(name)
if !hide[name] then return end
if !LocalPlayer():IsValid() then return end
if !LocalPlayer():GetActiveWeapon().ArcCW then return end
if ArcCW.ConVars["override_hud_off"]:GetBool() then return end
if ArcCW.PollingDefaultHUDElements then return end
if ArcCW.HUDElementConVars[name] and ArcCW.HUDElementConVars[name]:GetBool() == false then return end
if engine.ActiveGamemode() == "terrortown" then return end
return false
end)
hook.Add("RenderScreenspaceEffects", "ArcCW_ToyTown", function()
if !LocalPlayer():IsValid() then return end
local wpn = LocalPlayer():GetActiveWeapon()
if !IsValid(wpn) then return end
if !wpn.ArcCW then return end
local delta = wpn:GetSightDelta()
if delta < 1 then
wpn:DoToyTown()
end
end)
ArcCW.PollingDefaultHUDElements = false
function ArcCW:ShouldDrawHUDElement(ele)
if !GetConVar("cl_drawhud"):GetBool() then return false end
if ArcCW.ConVars["override_hud_off"]:GetBool() then return false end
if engine.ActiveGamemode() == "terrortown" and (ele != "CHudAmmo") then return false end
if ArcCW.HUDElementConVars[ele] and !ArcCW.HUDElementConVars[ele]:GetBool() then
return false
end
ArcCW.PollingDefaultHUDElements = true
if !ArcCW.ConVars["hud_forceshow"]:GetBool() and hook.Call("HUDShouldDraw", nil, ele) == false then
ArcCW.PollingDefaultHUDElements = false
return false
end
ArcCW.PollingDefaultHUDElements = false
return true
end
local function GetFont()
local font = "Bahnschrift"
if ArcCW.GetTranslation("default_font") then
font = ArcCW.GetTranslation("default_font")
end
if ArcCW.ConVars["font"]:GetString() != "" then
font = ArcCW.ConVars["font"]:GetString()
end
return font
end
-- Yes. Yes. Yes. Yes. Yes. Yes. Yes. Yes. Yes. Yes. Yes. Yes. Yes. Yes.
-- What is the size of your ass. What is it. Tell me.
local ScreenScale_CacheC2 = {}
ArcCW.AugmentedScreenScale = function(size)
if ScreenScale_CacheC2[size] then return ScreenScale_CacheC2[size] end
local scrw, scrh = ScrW(), ScrH()
if vrmod and vrmod.IsPlayerInVR(LocalPlayer()) then
-- Other resolutions seem to cause stretching issues
scrw = 1366
scrh = 768
end
local scrwmult = ArcCW.ConVars["hud_deadzone_x"]:GetFloat() * scrw
local scrhmult = ArcCW.ConVars["hud_deadzone_y"]:GetFloat() * scrh
scrw, scrh = scrw - scrwmult, scrh - scrhmult
local r = size
r = r * (math.max(scrw, scrh) / 800)
r = r * ArcCW.ConVars["hud_size"]:GetFloat()
ScreenScale_CacheC2[size] = r
return r
end
local sizes_to_make = {
6,
8,
10,
12,
14,
16,
20,
24,
26,
32
}
local sizes_to_make_cust2 = {
8,
10,
12,
14,
16,
24,
32
}
local unscaled_sizes_to_make = {
32,
24
}
local function generatefonts()
for _, i in pairs(sizes_to_make) do
surface.CreateFont( "ArcCW_" .. tostring(i), {
font = GetFont(),
size = ScreenScale(i) * ArcCW.ConVars["hud_size"]:GetFloat(),
weight = 0,
antialias = true,
extended = true, -- Required for non-latin fonts
} )
surface.CreateFont( "ArcCW_" .. tostring(i) .. "_Glow", {
font = GetFont(),
size = ScreenScale(i) * ArcCW.ConVars["hud_size"]:GetFloat(),
weight = 0,
antialias = true,
blursize = 6,
extended = true,
} )
end
for _, i in pairs(sizes_to_make_cust2) do
surface.CreateFont( "ArcCWC2_" .. tostring(i), {
font = GetFont(),
size = ArcCW.AugmentedScreenScale(i) * ArcCW.ConVars["hud_size"]:GetFloat(),
weight = 0,
antialias = true,
extended = true, -- Required for non-latin fonts
} )
surface.CreateFont( "ArcCWC2_" .. tostring(i) .. "_Glow", {
font = GetFont(),
size = ArcCW.AugmentedScreenScale(i) * ArcCW.ConVars["hud_size"]:GetFloat(),
weight = 0,
antialias = true,
blursize = 6,
extended = true,
} )
end
for _, i in pairs(unscaled_sizes_to_make) do
surface.CreateFont( "ArcCW_" .. tostring(i) .. "_Unscaled", {
font = GetFont(),
size = i,
weight = 0,
antialias = true,
extended = true,
} )
end
end
local og_ScreenScale = ScreenScale
local ScreenScale_Cache = {}
function ScreenScale(a)
if ScreenScale_Cache[a] then return ScreenScale_Cache[a] end
ScreenScale_Cache[a] = og_ScreenScale(a)
return ScreenScale_Cache[a]
end
language.Add("SniperPenetratedRound_ammo", "Sniper Ammo")
generatefonts()
function ArcCW_Regen(full)
if full then
generatefonts()
ScreenScale_Cache = {}
ScreenScale_CacheC2 = {}
end
if IsValid(ArcCW.InvHUD) then
ArcCW.InvHUD:Clear()
ArcCW.InvHUD:Remove()
end
end
--cvars.AddChangeCallback("arccw_dev_cust2beta", function() ArcCW_Regen(true) end)
cvars.AddChangeCallback("arccw_hud_deadzone_x", function() ArcCW_Regen(true) end)
cvars.AddChangeCallback("arccw_hud_deadzone_y", function() ArcCW_Regen(true) end)
cvars.AddChangeCallback("arccw_hud_size", function() ArcCW_Regen(true) end)
cvars.AddChangeCallback("arccw_font", function() ArcCW_Regen(true) end)
hook.Add( "OnScreenSizeChanged", "ArcCW_Regen", function() ArcCW_Regen(true) end)
-- surface.CreateFont( "ArcCW_12", {
-- font = font,
-- size = ScreenScale(12),
-- weight = 0,
-- antialias = true,
-- } )
-- surface.CreateFont( "ArcCW_12_Glow", {
-- font = font,
-- size = ScreenScale(12),
-- weight = 0,
-- antialias = true,
-- blursize = 8,
-- } )
-- surface.CreateFont( "ArcCW_16", {
-- font = font,
-- size = ScreenScale(16),
-- weight = 0,
-- antialias = true,
-- } )
-- surface.CreateFont( "ArcCW_16_Glow", {
-- font = font,
-- size = ScreenScale(16),
-- weight = 0,
-- antialias = true,
-- blursize = 8,
-- } )
-- surface.CreateFont( "ArcCW_26", {
-- font = font,
-- size = ScreenScale(26),
-- weight = 0,
-- antialias = true,
-- } )
-- surface.CreateFont( "ArcCW_26_Glow", {
-- font = font,
-- size = ScreenScale(26),
-- weight = 0,
-- antialias = true,
-- blursize = 8,
-- } )

View File

@@ -0,0 +1,424 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
-- These strings are loaded into GMod's language library instead of our custom one.
-- They are only to be used in the options menu.
L = {}
-- Generic
L["arccw.adminonly"] = "These options require admin privileges to change. They are automatically networked in multiplayer games."
L["arccw.clientcfg"] = "All options in this menu can be customized by players, and do not need admin privileges."
-- Menus
L["arccw.menus.hud"] = "HUD"
L["arccw.menus.client"] = "Client"
L["arccw.menus.vmodel"] = "Viewmodel"
L["arccw.menus.perf"] = "Performance"
L["arccw.menus.server"] = "Server"
L["arccw.menus.mults"] = "Modifiers"
L["arccw.menus.npcs"] = "NPCs"
L["arccw.menus.atts"] = "Attachments"
L["arccw.menus.ammo"] = "Ammo"
L["arccw.menus.dev"] = "Developer"
L["arccw.menus.xhair"] = "Crosshair"
L["arccw.menus.bullet"] = "Bullet Physics"
L["arccw.menus.scopes"] = "Scopes"
L["arccw.bullet_help"] = "\nEnabling physical bullets in multiplayer may reduce the reliability of hit detection."
-- ArcCW_Options_Ammo
L["arccw.cvar.ammo_detonationmode"] = "Ammo Detonation"
L["arccw.cvar.ammo_detonationmode.desc"] = "-1 - don't explode\n 0 - simple explosion\n 1 - fragmentation\n 2 - frag + burning"
L["arccw.cvar.ammo_autopickup"] = "Auto Pickup"
L["arccw.cvar.ammo_largetrigger"] = "Large Pickup Trigger"
L["arccw.cvar.ammo_rareskin"] = "Rare Skin Chance"
L["arccw.cvar.ammo_chaindet"] = "Chain Detonation"
L["arccw.cvar.mult_ammohealth"] = "Ammo Health (-1 for indestructible)"
L["arccw.cvar.mult_ammoamount"] = "Ammo Amount"
-- ArcCW_Options_HUD
L["arccw.cvar.hud_showhealth"] = "Show Health"
L["arccw.cvar.hud_showhealth.desc"] = "Draw a custom health & armor counter."
L["arccw.cvar.hud_showammo"] = "Show Ammo"
L["arccw.cvar.hud_showammo.desc"] = "Custom ammo counter with firemode info and weapon name."
L["arccw.3d2d"] = "\n3D2D HUD" -- Obsolete
L["arccw.cvar.hud_3dfun"] = "Use 3D2D Ammo HUD"
L["arccw.cvar.hud_3dfun.desc"] = "Use a 3D2D ammo counter."
L["arccw.cvar.hud_3dfun_decay"] = "HUD Decay Time"
L["arccw.cvar.hud_3dfun_decay.desc"] = "Time until the HUD starts fading away.\nSet to 0 to always stay visible."
L["arccw.cvar.hud_minimal"] = "Allow Backup Ammo HUD"
L["arccw.cvar.hud_minimal.desc"] = "If we can't draw our own HUD, use a minimal one."
L["arccw.cvar.hud_forceshow"] = "Force HUD On"
L["arccw.cvar.hud_forceshow.desc"] = "Don't play by the rules and draw our HUD anyways."
L["arccw.cvar.hudpos_deadzone_x"] = "Deadzone X"
L["arccw.cvar.hudpos_deadzone_y"] = "Deadzone Y"
L["arccw.cvar.hudpos_deadzone.desc"] = "Use ArcCW on your HDTV!"
L["arccw.cvar.hudpos_size"] = "HUD and Font Size"
L["arccw.cvar.hudpos_size.desc"] = "Custom HUD scaling."
-- ArcCW_Options_Bullet
L["arccw.cvar.bullet_enable"] = "Physical Bullets"
L["arccw.cvar.enable_penetration"] = "Enable Penetration"
L["arccw.cvar.enable_ricochet"] = "Enable Ricochet"
L["arccw.cvar.bullet_gravity"] = "Gravity"
L["arccw.cvar.bullet_drag"] = "Drag"
L["arccw.cvar.bullet_lifetime"] = "Despawn Time"
L["arccw.cvar.bullet_velocity"] = "Multiply Velocity"
L["arccw.cvar.bullet_imaginary"] = "Imaginary Bullets"
L["arccw.cvar.bullet_imaginary.desc"] = "Bullets will appear to continue to travel through the 3D skybox."
-- ArcCW_Options_Client
L["arccw.cvar.automaticreload"] = "Automatic Reload"
L["arccw.cvar.automaticreload.desc"] = "Automatically reload when your clip is empty."
L["arccw.cvar.toggleads"] = "Toggle Aim"
L["arccw.cvar.altfcgkey"] = "USE + RELOAD Toggles Firemode"
L["arccw.cvar.altubglkey"] = "USE + RMB Toggles Underbarrel"
L["arccw.cvar.altsafety"] = "Hold Walk to Toggle Safety"
L["arccw.cvar.altlaserkey"] = "E+WALK To Toggle Laser (Default WALK+E)"
L["arccw.cvar.autosave"] = "Autosave Attachments"
L["arccw.cvar.autosave.desc"] = "Attempt to re-equip the last equipped set of attachments on weapon pickup."
L["arccw.cvar.embracetradition"] = "Classic Customization HUD"
L["arccw.cvar.embracetradition.desc"] = "Use the classic bulky customization HUD. Embrace tradition. Good on 4:3."
L["arccw.cvar.glare"] = "Scope Glare"
L["arccw.cvar.glare.desc"] = "Glare visible on your scope lens when aiming."
L["arccw.cvar.shake"] = "Screen Shake"
L["arccw.cvar.shakevm"] = "Viewmodel Shake"
L["arccw.cvar.shake_info"] = "Aggressive snap when you shoot a weapon."
L["arccw.cvar.2d3d"] = "Draw Help Text"
L["arccw.cvar.2d3d_info"] = "Draw name of weapons, ammo and attachments on the ground."
L["arccw.cvar.attinv_hideunowned"] = "Hide Unowned Attachments"
L["arccw.cvar.attinv_darkunowned"] = "Grey Out Unowned Attachments"
L["arccw.cvar.attinv_onlyinspect"] = "Hide Customization UI"
L["arccw.cvar.attinv_simpleproscons"] = "Simple Pros And Cons"
L["arccw.cvar.attinv_closeonhurt"] = "Close menu on damage taken"
L["arccw.cvar.language"] = "Language"
L["arccw.cvar.language_info"] = "Override the language. Leave blank for gmod_language."
L["arccw.cvar.font"] = "Font"
L["arccw.cvar.font_info"] = "Override the font. Leave blank for default."
-- ArcCW_Options_Perf
L["arccw.performance"] = "The options below may change performance."
L["arccw.cvar.cheapscopes"] = "Cheap Scopes"
L["arccw.cvar.cheapscopes.desc"] = "A cheaper PIP scope implementation like in modern games. Saves a significant amount of performance on big maps. \nYou can configure it in 'Scopes' tab."
L["arccw.cvar.cheapscopesv2_ratio"] = "FOV Boost"
L["arccw.cvar.cheapscopesv2_ratio.desc"] = "Cheap Scope field of view boost ratio. 0 is full FOV and full quality scope, 1 is default FOV with low quality scope."
L["arccw.cvar.cheapscopesv2.desc"] = "A cheaper PIP scope implementation like in modern games."
L["arccw.cvar.scopepp"] = "Scope chromatic aberration"
L["arccw.cvar.thermalpp"] = "Thermal scope post-processing effects"
L["arccw.cvar.scopepp_refract"] = "Scope lense refract effect (experimental)"
L["arccw.cvar.scopepp_refract_ratio"] = "Refract ratio"
--["arccw.cvar.flatscopes"] = "Flat Scopes"
--L["arccw.cvar.flatscopes.desc"] = "For the ultimate performance gain.\nUse a traditional-style scope implementation that's not very impressive, but actually saves performance relative to even being unscoped."
L["arccw.cvar.muzzleeffects"] = "Enable World Muzzle Effects"
L["arccw.cvar.fastmuzzles"] = "Low Performance Muzzle Effects"
L["arccw.cvar.fasttracers"] = "Low Performance Tracer Effects"
L["arccw.cvar.shelleffects"] = "Enable World Case Effects"
L["arccw.cvar.att_showothers"] = "Show Others' Attachments"
L["arccw.cvar.shelltime"] = "Case Lifetime"
L["arccw.cvar.blur"] = "Customization Blur"
L["arccw.cvar.blur_toytown"] = "Aim Blur"
L["arccw.cvar.visibility"] = "Worldmodel Visibility"
L["arccw.cvar.visibility.desc"] = "Attachments will not render past this distance. -1 for always render."
-- ArcCW_Options_Viewmodel
L["arccw.cvar.vm_coolsway"] = "Custom Swaying"
L["arccw.cvar.vm_coolview"] = "Custom Camera Movement"
L["arccw.cvar.drawbarrel"] = "Draw barrel in RT scopes (experimental)"
L["arccw.cvar.vm_addads"] = "Viewmodel FOV in ADS"
L["arccw.cvar.vm_right"] = "Viewmodel Right"
L["arccw.cvar.vm_forward"] = "Viewmodel Forward"
L["arccw.cvar.vm_up"] = "Viewmodel Up"
L["arccw.cvar.vm_pitch"] = "Viewmodel Pitch"
L["arccw.cvar.vm_yaw"] = "Viewmodel Yaw"
L["arccw.cvar.vm_roll"] = "Viewmodel Roll"
L["arccw.cvar.vm_fov"] = "Viewmodel FOV"
L["arccw.cvar.vm_offsetwarn"] = "Warning! Viewmodel offset settings may cause clipping or other undesired effects!"
L["arccw.cvar.vm_sway_sprint"] = "Sprint Bob" -- This is intentionally flipped
L["arccw.cvar.vm_bob_sprint"] = "Sprint Sway" -- Ditto
L["arccw.cvar.vm_swaywarn"] = "The following only applies when Custom Swaying is enabled"
L["arccw.cvar.vm_look_ymult"] = "Horizontal Look Sway"
L["arccw.cvar.vm_look_xmult"] = "Vertical Look Sway"
L["arccw.cvar.vm_sway_xmult"] = "Bob Right"
L["arccw.cvar.vm_sway_ymult"] = "Bob Forward"
L["arccw.cvar.vm_sway_zmult"] = "Bob Up"
L["arccw.cvar.vm_sway_wigglemult"] = "Bob Wiggle"
L["arccw.cvar.vm_sway_speedmult"] = "Bob Speed"
L["arccw.cvar.vm_sway_rotatemult"] = "Bob Rotate"
L["arccw.cvar.vm_accelmult"] = "Sway Tightness"
L["arccw.cvar.vm_viewwarn"] = "The following only applies when Custom Camera Movement is enabled"
L["arccw.cvar.vm_coolviewmult"] = "View Move Multiplier"
-- ArcCW_Options_Crosshair
L["arccw.crosshair.tfa"] = "TFA"
L["arccw.crosshair.cw2"] = "CW 2.0"
L["arccw.crosshair.cs"] = "Counter-Strike"
L["arccw.crosshair.light"] = "Lightweight"
L["arccw.cvar.crosshair"] = "Enable Crosshair"
L["arccw.cvar.crosshair_length"] = "Crosshair Length"
L["arccw.cvar.crosshair_thickness"] = "Crosshair Thickness"
L["arccw.cvar.crosshair_gap"] = "Crosshair Gap Scale"
L["arccw.cvar.crosshair_dot"] = "Show Center Dot"
L["arccw.cvar.crosshair_shotgun"] = "Use Shotgun Prongs"
L["arccw.cvar.crosshair_equip"] = "Use Equipment Prongs"
L["arccw.cvar.crosshair_static"] = "Static Crosshair"
L["arccw.cvar.crosshair_trueaim"] = "Accurate Crosshair"
L["arccw.cvar.crosshair_clump"] = "Use CW2-Style Clump Circle"
L["arccw.cvar.crosshair_clump_outline"] = "Clump Circle Outline"
L["arccw.cvar.crosshair_clump_always"] = "Clump Circle Always On"
L["arccw.cvar.crosshair_clr"] = "Crosshair Color"
L["arccw.cvar.crosshair_outline"] = "Outline Size"
L["arccw.cvar.crosshair_outline_clr"] = "Outline Color"
L["arccw.cvar.scope_clr"] = "Sight Color"
-- ArcCW_Options_Mults
L["arccw.cvar.mult_damage"] = "Damage"
L["arccw.cvar.mult_npcdamage"] = "NPC Damage"
L["arccw.cvar.mult_range"] = "Range"
L["arccw.cvar.mult_recoil"] = "Recoil"
L["arccw.cvar.mult_penetration"] = "Penetration"
L["arccw.cvar.mult_accuracy"] = "Precision"
L["arccw.cvar.mult_hipfire"] = "Hip Dispersion"
L["arccw.cvar.mult_movedisp"] = "Move Dispersion"
L["arccw.cvar.mult_reloadtime"] = "Reload Time"
L["arccw.cvar.mult_sighttime"] = "ADS Time"
L["arccw.cvar.mult_defaultclip"] = "Default Clip"
L["arccw.cvar.mult_attchance"] = "Random Att. Chance"
L["arccw.cvar.mult_heat"] = "Heat Gain"
L["arccw.cvar.mult_shootwhilesprinting"] = "Shoot While Sprinting"
-- ArcCW_Options_Atts
L["arccw.attdesc1"] = "ArcCW supports attachment inventory style behaviour (Like ACT3) as well as attachment locking style behaviour (Like CW2.0) as well as giving everyone all attachments for free (Like TFA Base)."
L["arccw.attdesc2"] = "Leave all options off for ACT3 style attachment inventory behaviour."
L["arccw.cvar.attinv_free"] = "Free Attachments"
L["arccw.cvar.attinv_lockmode"] = "Attachment Locking"
L["arccw.cvar.attinv_loseondie.desc"] = "Lose Attachments Modes:\n0 - Disable\n1 = Removed on death\n2 = Drop Attachment Box on death"
L["arccw.cvar.attinv_loseondie"] = "Lose Atts. On Death"
L["arccw.cvar.atts_pickx.desc"] = "Pick X behaviour allows you to set a limit on attachments that can be placed on any weapon.\n0 = unlimited."
L["arccw.cvar.atts_pickx"] = "Pick X"
L["arccw.cvar.enable_dropping"] = "Attachment Dropping"
L["arccw.cvar.atts_spawnrand"] = "Random Attachments on Spawn"
L["arccw.cvar.atts_ubglautoload"] = "Underbarrel Weapons Automatically Loaded"
L["arccw.blacklist"] = "Blacklist Menu"
-- ArcCW_Options_Server
L["arccw.cvar.enable_customization"] = "Enable Customization"
L["arccw.cvar.enable_customization.desc"] = "-1 will disable both customization and the entirety of the Customization UI.\n0 will not allow users to customize their weapons.\n1 will allow customization, the default."
L["arccw.cvar.truenames"] = "True Names (Requires Restart)"
L["arccw.cvar.equipmentammo.desc"] = "There is a limit of 255 ammo types, and enabling this option can cause problems related to this. Requires restart."
L["arccw.cvar.equipmentammo"] = "Equipment Unique Ammo Types"
L["arccw.cvar.equipmentsingleton.desc"] = "Singletons can be used once and then remove themselves from your inventory. Requires restart."
L["arccw.cvar.equipmentsingleton"] = "Grenade/Equipment Singleton"
L["arccw.cvar.equipmenttime"] = "Equipment Self-Destruct Time"
L["arccw.cvar.throwinertia"] = "Grenade Inherit Velocity"
L["arccw.cvar.limityear_enable"] = "Enable Year Limit"
L["arccw.cvar.limityear"] = "Year Limit"
L["arccw.cvar.override_crosshair_off"] = "Force Disable Crosshair"
L["arccw.cvar.override_barrellength"] = "Enable Near-Walling"
L["arccw.cvar.doorbust"] = "Enable Door-Busting"
L["arccw.cvar.desync"] = "Desync Bullets"
L["arccw.cvar.desync.desc"] = "Desync bullets between the server and the client, making the nospread cheat useless."
L["arccw.cvar.weakensounds"] = "Weaken Sounds"
L["arccw.cvar.weakensounds.desc"] = "Reduce all weapons' firing volume by this much decibels, making it easier to hide shooting sounds. Clamped to 60-150dB."
-- ArcCW_Options_Dev
L["arccw.dev_info1"] = "These are primarily related to attachments and are of use to developers only."
L["arccw.dev_info2"] = "Settings will not save."
L["arccw.cvar.dev_reloadonadmincleanup"] = "Reload on Admin Cleanup"
L["arccw.cvar.dev_reloadonadmincleanup.desc"] = "Disabled by default.\nDoing an admin cleanup will reload all attachment data."
L["arccw.cvar.dev_registerentities"] = "Register Att. Entities"
L["arccw.cvar.dev_registerentities.desc"] = "Enabled by default.\nCreates entities for ArcCW attachments. Increases time to reload attachment data."
L["arccw.cvar.dev_reloadatts"] = "Reload Attachment Data"
L["arccw.cvar.dev_reloadatts.desc"] = "Reloads attachment data. Use after making a change to an attachment."
L["arccw.cvar.dev_reloadlangs"] = "Reload Languages"
L["arccw.cvar.dev_reloadlangs.desc"] = "Reloads all language files."
L["arccw.cvar.dev_spawnmenureload"] = "Reload Spawnmenu"
L["arccw.cvar.dev_spawnmenureload.desc"] = "Not exactly an ArcCW specific command, but here for the sake of convenience."
-- TTT Menus
L["arccw.cvar.attinv_loseondie.help"] = "If enabled, players lose attachment on death and round end."
L["arccw.cvar.ammo_detonationmode.help"] = "Determines what happens if ammo boxes are destroyed."
L["arccw.cvar.equipmenttime.help"] = "Applies to deployable equipment like Claymores, in seconds."
L["arccw.cvar.ttt_bodyattinfo"] = "Body Attachment Info"
L["arccw.cvar.ttt_bodyattinfo.help"] = "If enabled, searching a body will reveal the attachments on the weapon used to kill someone."
L["arccw.cvar.ttt_bodyattinfo.desc"] = "0 - Off; 1 - Detectives can see; 2 - Everyone can see"
L["arccw.cvar.attinv_free.help"] = "If enabled, players have access to all attachments.\nCustomization mode may still restrict them from using them."
L["arccw.cvar.attinv_lockmode.help"] = "If enabled, picking up one attachment unlocks it for every weapon, a-la CW2."
L["arccw.cvar.enable_customization.help"] = "If disabled, nobody can customize. This overrides Customization Mode."
L["arccw.cvar.ttt_replace"] = "Auto-replace Weapons"
L["arccw.cvar.ttt_replaceammo"] = "Auto-replace Ammo"
L["arccw.cvar.ttt_atts"] = "Randomize Attachments"
L["arccw.cvar.ttt_customizemode"] = "Customization Mode"
L["arccw.cvar.ttt_customizemode.desc"] = "0 - No restrictions; 1 - Restricted; 2 - Pregame only; 3 - Traitor/Detective only"
L["arccw.cvar.ttt_rolecrosshair"] = "Enable role-based crosshair color"
L["arccw.cvar.ttt_inforoundstart"] = "Enable round startup info"
-- 2020-11-22
L["arccw.cvar.ammo_replace"] = "Replace HL2 Ammo Entities"
-- 2020-11-25
L["arccw.cvar.hud_3dfun_lite"] = "Minimal Mode"
L["arccw.cvar.hud_3dfun_lite.desc"] = "HUD will only show up when pressing RELOAD. Hold WALK to not reload when doing so."
L["arccw.cvar.hud_3dfun_right"] = "3D2D Offset Right"
L["arccw.cvar.hud_3dfun_forward"] = "3D2D Offset Forward"
L["arccw.cvar.hud_3dfun_up"] = "3D2D Offset Up"
L["arccw.cvar.hud_3dfun_ammotype"] = "Show Ammo Type"
L["arccw.cvar.hud_3dfun_ammotype.desc"] = "Ammo HUD will also show weapon's current ammo type."
-- 2021-01-03
L["arccw.combobox.disabled"] = "0 - Disabled"
L["arccw.cvar.attinv_loseondie.1"] = "1 - Removed on death"
L["arccw.cvar.attinv_loseondie.2"] = "2 - Drop attachment box on death"
L["arccw.cvar.ammo_detonationmode.-1"] = "-1 - Don't explode"
L["arccw.cvar.ammo_detonationmode.0"] = "0 - Simple explosion"
L["arccw.cvar.ammo_detonationmode.1"] = "1 - Fragmentation"
L["arccw.cvar.ammo_detonationmode.2"] = "2 - Frag + Burning"
L["arccw.cvar.enable_customization.-1"] = "-1 - Disable UI and all customization"
L["arccw.cvar.enable_customization.0"] = "0 - Players cannot customize"
L["arccw.cvar.enable_customization.1"] = "1 - Enabled"
L["arccw.cvar.limityear.desc"] = "If enabled, weapons with a trivia year later than the limit cannot be spawned.\nGood for gmod realism."
-- 2021-01-05
L["arccw.menus.binds"] = "Binds"
L["arccw.bindhelp"] = "All players can use this panel to set custom bindings for ArcCW features.\n\nBecause of a Garry's Mod limitation, for custom binds you must input the command provided in chat into the console yourself."
L["arccw.cvar.altbindsonly"] = "Custom Binds Only"
L["arccw.cvar.altbindsonly.desc"] = "If enabled, default controls will no longer work with ArcCW weapons. Please ensure all of the below buttons are bound so you have access to them."
L["arccw.bind.firemode"] = "Change Firemode"
L["arccw.bind.zoom_in"] = "Scope Zoom In"
L["arccw.bind.zoom_out"] = "Scope Zoom Out"
L["arccw.bind.toggle_inv"] = "Customize Menu"
L["arccw.bind.switch_scope"] = "Toggle Sights"
L["arccw.bind.toggle_ubgl"] = "Toggle Underbarrel"
L["arccw.bind.melee"] = "Melee"
L["arccw.bind.msg"] = "Type into console: "
-- 2021-01-14
L["arccw.cvar.mult_startunloaded"] = "Start Unloaded"
L["arccw.cvar.mult_defaultammo"] = "Default Ammo"
-- 2021-01-18
L["arccw.cvar.dev_showignored"] = "Load Ignored Atts"
L["arccw.cvar.dev_showignored.desc"] = "Disabled by default.\nLoad attachments that have att.Ignore set to true. These attachments may be broken or unimplemented.\nThey will be highlighted in light yellow."
L["arccw.cvar.aimassist"] = "Enable Aim Assist"
L["arccw.cvar.aimassist.desc"] = "Allow players to snap their view to NPCs and players near their aim."
L["arccw.cvar.aimassist_cl.desc"] = "Snap your view to nearby NPCs and players. Only usable if enabled serverside!"
L["arccw.cvar.aimassist_head"] = "Aim Assist Seeks Head"
L["arccw.cvar.aimassist_cone"] = "Aim Assist Cone"
L["arccw.cvar.aimassist_distance"] = "Aim Assist Distance"
L["arccw.cvar.aimassist_intensity"] = "Aim Assist Intensity"
-- 2021-01-19
L["arccw.cvar.adjustsensthreshold"] = "Adjust Sensitivity Threshold"
L["arccw.cvar.adjustsensthreshold.desc"] = "If your total magnification is less than this, your sensitivity will not be adjusted while in sights."
-- 2021-01-20
L["arccw.cvar.crosshair_aa"] = "Aim Assist Indicator"
-- 2021-1-25
L["arccw.menus.ttt_client"] = "TTT (Client)"
L["arccw.menus.ttt_server"] = "TTT (Server)"
L["arccw.ttt_clienthelp"] = "These options are TTT-specific, and can be changed by all players. Other tabs may contain non-TTT-specific configurations."
L["arccw.ttt_serverhelp"] = "These options are TTT-specific, and require admin privileges to change. They are automatically networked in multiplayer games."
L["arccw.cvar.ttt_customizemode.0"] = "0 - Unrestricted"
L["arccw.cvar.ttt_customizemode.1"] = "1 - Restricted"
L["arccw.cvar.ttt_customizemode.2"] = "2 - Pre-game only"
L["arccw.cvar.ttt_customizemode.3"] = "3 - Detectives/Traitors only"
L["arccw.cvar.ttt_bodyattinfo.1"] = "1 - Detectives can see"
L["arccw.cvar.ttt_bodyattinfo.2"] = "2 - Everyone can see"
L["arccw.cvar.mult_crouchdisp"] = "Crouched Dispersion"
L["arccw.cvar.mult_crouchrecoil"] = "Crouched Recoil"
-- 2021-2-19
L["arccw.cvar.dev_debug"] = "Debug Menu"
L["arccw.cvar.dev_debug.desc"] = "Disabled by default.\nDraws a debug menu over your screen where you can view certain elements blah blah?"
L["arccw.cvar.attinv_sound"] = "Customization Menu Sounds"
L["arccw.cvar.attinv_sound.desc"] = "Enable or disable sounds for the customization menu."
-- 2021-3-2
L["arccw.ammohud"] = "\nAmmo HUD" -- Obsoletes "3D2D HUD" since they're basically the same now"
L["arccw.cvar.hud_fcgbars"] = "Show Firemode Bars"
L["arccw.bind.toggle_att"] = "Toggle Attachments"
-- 2021-05-05
L["arccw.cvar.attinv_gamemodebuttons"] = "Gamemode-specific buttons"
L["arccw.cvar.attinv_gamemodebuttons.desc"] = "Shows helpful functions for gamemodes like TTT and DarkRP.\nIn addition to using these, you can hold USE to access original keybinds as well."
-- 2021-05-13
L["arccw.cvar.mult_malfunction"] = "Malfunction Chance"
L["arccw.cvar.malfunction"] = "Malfunction Mode"
L["arccw.cvar.malfunction.0"] = "0 - Force disable on all guns"
L["arccw.cvar.malfunction.1"] = "1 - Enabled"
L["arccw.cvar.malfunction.2"] = "2 - Force enable on all guns"
-- 2021-05-26
L["arccw.cvar.mult_meleedamage"] = "Melee Damage"
L["arccw.cvar.mult_meleetime"] = "Melee Time"
-- 2021-05-27
L["arccw.cvar.ammonames"] = "Custom Ammo Names"
L["arccw.cvar.ammonames.desc"] = "Replaces default ammo type names with custom ones that are a bit more realistic (such as Pulse Ammo to Rifle Ammo). Also replaces references everywhere else!"
L["arccw.cvar.att_showground"] = "Show Ground Attachments"
-- 2021-06-02
L["arccw.cvar.mult_bottomlessclip"] = "Bottomless Clip"
L["arccw.cvar.mult_infiniteammo"] = "Infinite Ammo"
-- 2021-06-07
L["arccw.cvar.bodydamagecancel"] = "Cancel Body Damage"
L["arccw.cvar.bodydamagecancel.desc"] = "When a weapon specifies limb damage modifiers, cancel Gmod's default multipliers. Disable when you have another mod that does this."
L["arccw.cvar.enable_sway"] = "Enable Sway"
L["arccw.cvar.enable_sway.desc"] = "Most weapons do not specify a sway value. If you wish to give sway to all weapons, use the 'Add Sway' slider."
L["arccw.cvar.add_sway"] = "Add Sway"
L["arccw.cvar.mult_sway"] = "Multiply Sway"
-- 2021-08-15
L["arccw.cvar.mult_rpm"] = "Fire Rate"
L["arccw.cvar.mult_rpm.desc"] = "May be disastrous on performance. May also be a ton of fun."
-- 2021-08-16
L["arccw.cvar.dev_benchgun"] = "Benchgun"
L["arccw.cvar.dev_benchgun.desc"] = "Places the viewmodel in a stationary position, usually at world origin."
L["arccw.cvar.dev_benchgun_custom"] = "Benchgun Custom"
L["arccw.cvar.dev_benchgun_custom.desc"] = "Custom location to place the viewmodel at. Use getpos and place the result here.\nExample:\nsetpos 61 -397 -63;setang 0 96 0"
-- 2021-08-18
L["arccw.cvar.crosshair_prong_top"] = "Show Top Prong"
L["arccw.cvar.crosshair_prong_left"] = "Show Left Prong"
L["arccw.cvar.crosshair_prong_right"] = "Show Right Prong"
L["arccw.cvar.crosshair_prong_bottom"] = "Show Bottom Prong"
L["arccw.cvar.crosshair_tilt"] = "Tilted Crosshair"
L["arccw.cvar.attinv_giveonspawn"] = "Give Atts. On Spawn"
-- 2021-10-10
L["arccw.cvar.hud_fcgabbrev"] = "Abbreviate Firemode Names"
-- 2021-10-31
L["arccw.cvar.reloadincust"] = "Reloading In Customize Menu"
L["arccw.cvar.reloadincust.desc"] = "May allow players to cheese reload times by swapping magazine attachments.\nWill also disable left hand lowering in the customize menu."
-- 2021-11-11
L["arccw.cvar.freeaim"] = "Free Aim"
L["arccw.cvar.freeaim.1"] = "1 - Enabled"
L["arccw.cvar.freeaim.2"] = "2 - No Dispersion Tweak"
-- 2021-11-24
L["arccw.cvar.override_lunge_off"] = "Disable Melee Lunging"
L["arccw.cvar.override_lunge_off.desc"] = "Bashing with a weapon can allow you to dash a short distance if there is a target in front. This option disables that momentum for all weapons."
-- 2021-11-27
L["arccw.cvar.mult_movespeed"] = "Speed"
L["arccw.cvar.mult_movespeedads"] = "Speed in ADS"
L["arccw.cvar.mult_movespeedfire"] = "Speed while firing"
-- 2022-02-14
L["arccw.cvar.vm_nearwall"] = "Near-wall Movement"
L["arccw.cvar.nohl2flash"] = "Toggle attachments modes through flashlight bind"
-- 2022-03-24
L["arccw.cvar.dev_alwaysready"] = "Always Use Ready Animation"
L["arccw.cvar.dev_alwaysready.desc"] = "Always use the ready animation while drawing when available."
L["arccw.cvar.noinspect"] = "Disable inspect animations"
-- 2022-07-10
L["arccw.cvar.override_hud_off"] = "Force Disable HUD"
L["arccw.hud_svwarning"] = "The HUD can be disabled serverside by a server administrator."
-- 2023-10-10
L["arccw.cvar.2d3d.1"] = "1 - When Pointed At"
L["arccw.cvar.2d3d.2"] = "2 - Always"

View File

@@ -0,0 +1,798 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
--[[
Panel table doc:
id (any number) = data:
type
type args
types:
h - header text
c - control help text
b - checkbox text var
i - integer slider text var min max
f - float slider (2 nums after .) text var min max
m - color mixer text r g b a
p - press or button text func
t - textbox text string
o - combo box text var choices (key - cvar, value - text)
d - binder text var
(you can add custom types in ArcCW.GeneratePanelElements's AddControl table)
Generate elements via ArcCW.GeneratePanelElements:
panel, panel table with data
Add menu generation to ArcCW.ClientMenus:
name = data:
text - header text
func - generator function
]]
local BulletPanel = {
{ type = "h", text = "#arccw.adminonly" },
{ type = "c", text = "#arccw.bullet_help" },
{ type = "b", text = "#arccw.cvar.bullet_enable", var = "arccw_bullet_enable", sv = true },
{ type = "b", text = "#arccw.cvar.enable_penetration", var = "arccw_enable_penetration", sv = true },
{ type = "b", text = "#arccw.cvar.enable_ricochet", var = "arccw_enable_ricochet", sv = true },
{ type = "f", text = "#arccw.cvar.bullet_velocity", var = "arccw_bullet_velocity", min = 0, max = 3, sv = true },
{ type = "f", text = "#arccw.cvar.bullet_gravity", var = "arccw_bullet_gravity", min = 0, max = 1200, sv = true },
{ type = "f", text = "#arccw.cvar.bullet_drag", var = "arccw_bullet_drag", min = 0, max = 10, sv = true },
{ type = "f", text = "#arccw.cvar.bullet_lifetime", var = "arccw_bullet_lifetime", min = 1, max = 20, sv = true},
}
local ClientPanel = {
{ type = "h", text = "#arccw.clientcfg" },
{ type = "b", text = "#arccw.cvar.automaticreload", var = "arccw_automaticreload" },
{ type = "c", text = "#arccw.cvar.automaticreload.desc" },
{ type = "f", text = "#arccw.cvar.adjustsensthreshold", var = "arccw_adjustsensthreshold", min = 0, max = 50, sv = true },
{ type = "c", text = "#arccw.cvar.adjustsensthreshold.desc" },
{ type = "b", text = "#arccw.cvar.toggleads", var = "arccw_toggleads" },
{ type = "b", text = "#arccw.cvar.autosave", var = "arccw_autosave" },
{ type = "c", text = "#arccw.cvar.autosave.desc" },
--{ type = "b", text = "#arccw.cvar.embracetradition", var = "arccw_hud_embracetradition" },
--{ type = "c", text = "#arccw.cvar.embracetradition.desc" },
{ type = "b", text = "#arccw.cvar.glare", var = "arccw_glare" },
{ type = "c", text = "#arccw.cvar.glare.desc" },
{ type = "b", text = "#arccw.cvar.shake", var = "arccw_shake" },
{ type = "b", text = "#arccw.cvar.shakevm", var = "arccw_shakevm" },
{ type = "c", text = "#arccw.cvar.shake_info" },
{ type = "b", text = "#arccw.cvar.aimassist", var = "arccw_aimassist_cl" },
{ type = "c", text = "#arccw.cvar.aimassist_cl.desc" },
-- { type = "b", text = "#arccw.cvar.2d3d", var = "arccw_2d3d" },
{ type = "o", text = "#arccw.cvar.2d3d", var = "arccw_2d3d",
choices = {[0] = "#arccw.combobox.disabled", [1] = "#arccw.cvar.2d3d.1", [2] = "#arccw.cvar.2d3d.2"}},
{ type = "c", text = "#arccw.cvar.2d3d_info" },
{ type = "t", text = "#arccw.cvar.language", var = "arccw_language" },
{ type = "c", text = "#arccw.cvar.language_info" },
{ type = "b", text = "#arccw.cvar.ammonames", var = "arccw_ammonames" },
{ type = "c", text = "#arccw.cvar.ammonames.desc" },
{ type = "b", text = "#arccw.cvar.noinspect", var = "arccw_noinspect" },
}
local PerformancePanel = {
--{ type = "h", text = "#arccw.clientcfg" },
{ type = "h", text = "#arccw.performance" },
{ type = "b", text = "#arccw.cvar.cheapscopes", var = "arccw_cheapscopes" },
{ type = "c", text = "#arccw.cvar.cheapscopes.desc" },
-- { type = "b", text = "#arccw.cvar.flatscopes", var = "arccw_flatscopes" },
-- { type = "c", text = "#arccw.cvar.flatscopes.desc" },
{ type = "b", text = "#arccw.cvar.muzzleeffects", var = "arccw_muzzleeffects" },
{ type = "b", text = "#arccw.cvar.fastmuzzles", var = "arccw_fastmuzzles" },
{ type = "b", text = "#arccw.cvar.fasttracers", var = "arccw_fasttracers" },
{ type = "b", text = "#arccw.cvar.shelleffects", var = "arccw_shelleffects" },
{ type = "b", text = "#arccw.cvar.att_showothers", var = "arccw_att_showothers" },
{ type = "b", text = "#arccw.cvar.att_showground", var = "arccw_att_showground" },
{ type = "i", text = "#arccw.cvar.visibility", var = "arccw_visibility", min = -1, max = 32000},
{ type = "c", text = "#arccw.cvar.visibility.desc" },
{ type = "b", text = "#arccw.cvar.blur", var = "arccw_blur" },
{ type = "b", text = "#arccw.cvar.blur_toytown", var = "arccw_blur_toytown" },
{ type = "b", text = "#arccw.cvar.bullet_imaginary", var = "arccw_bullet_imaginary" },
{ type = "c", text = "#arccw.cvar.bullet_imaginary.desc" },
{ type = "f", text = "#arccw.cvar.shelltime", var = "arccw_shelltime", min = 0, max = 180 },
}
local ViewmodelPanel = {
{ type = "b", text = "#arccw.cvar.vm_coolsway", var = "arccw_vm_coolsway" },
{ type = "b", text = "#arccw.cvar.vm_coolview", var = "arccw_vm_coolview" },
{ type = "h", text = "" },
{ type = "c", text = "#arccw.cvar.vm_offsetwarn" },
{ type = "f", text = "#arccw.cvar.vm_fov", var = "arccw_vm_fov", min = -15, max = 15 },
{ type = "f", text = "#arccw.cvar.vm_right", var = "arccw_vm_right", min = -5, max = 5 },
{ type = "f", text = "#arccw.cvar.vm_forward", var = "arccw_vm_forward", min = -5, max = 5 },
{ type = "f", text = "#arccw.cvar.vm_up", var = "arccw_vm_up", min = -5, max = 5 },
{ type = "f", text = "#arccw.cvar.vm_pitch", var = "arccw_vm_pitch", min = -15, max = 15 },
{ type = "f", text = "#arccw.cvar.vm_yaw", var = "arccw_vm_yaw", min = -15, max = 15 },
{ type = "f", text = "#arccw.cvar.vm_roll", var = "arccw_vm_roll", min = -15, max = 15 },
{ type = "c", text = "" },
{ type = "c", text = "#arccw.cvar.vm_swaywarn" },
{ type = "f", text = "#arccw.cvar.vm_look_xmult", var = "arccw_vm_look_xmult", min = -10, max = 10 },
{ type = "f", text = "#arccw.cvar.vm_look_ymult", var = "arccw_vm_look_ymult", min = -10, max = 10 },
{ type = "f", text = "#arccw.cvar.vm_sway_xmult", var = "arccw_vm_sway_xmult", min = -5, max = 5 },
{ type = "f", text = "#arccw.cvar.vm_sway_ymult", var = "arccw_vm_sway_ymult", min = -5, max = 5 },
{ type = "f", text = "#arccw.cvar.vm_sway_zmult", var = "arccw_vm_sway_zmult", min = -5, max = 5 },
{ type = "f", text = "#arccw.cvar.vm_sway_speedmult", var = "arccw_vm_sway_speedmult", min = 0, max = 2 },
{ type = "h", text = "" },
{ type = "c", text = "#arccw.cvar.vm_viewwarn" },
{ type = "f", text = "#arccw.cvar.vm_coolviewmult", var = "arccw_vm_coolview_mult", min = -5, max = 5 },
{ type = "b", text = "#arccw.cvar.vm_nearwall", var = "arccw_vm_nearwall" },
}
local HudPanel = {
{ type = "h", text = "#arccw.clientcfg" },
{ type = "h", text = "#arccw.hud_svwarning" },
{ type = "b", text = "#arccw.cvar.hud_showhealth", var = "arccw_hud_showhealth" },
{ type = "c", text = "#arccw.cvar.hud_showhealth.desc" },
{ type = "b", text = "#arccw.cvar.hud_showammo", var = "arccw_hud_showammo" },
{ type = "c", text = "#arccw.cvar.hud_showammo.desc" },
{ type = "i", text = "#arccw.cvar.hud_3dfun_decay", var = "arccw_hud_3dfun_decaytime", min = 0, max = 5 },
{ type = "c", text = "#arccw.cvar.hud_3dfun_decay.desc" },
{ type = "b", text = "#arccw.cvar.hud_minimal", var = "arccw_hud_minimal" },
{ type = "c", text = "#arccw.cvar.hud_minimal.desc" },
{ type = "b", text = "#arccw.cvar.hud_forceshow", var = "arccw_hud_forceshow" },
{ type = "c", text = "#arccw.cvar.hud_forceshow.desc" },
{ type = "b", text = "#arccw.cvar.attinv_closeonhurt", var = "arccw_attinv_closeonhurt" },
{ type = "f", text = "#arccw.cvar.hudpos_deadzone_x", var = "arccw_hud_deadzone_x", min = 0, max = 0.5 },
{ type = "f", text = "#arccw.cvar.hudpos_deadzone_y", var = "arccw_hud_deadzone_y", min = 0, max = 0.5 },
{ type = "c", text = "#arccw.cvar.hudpos_deadzone.desc" },
{ type = "f", text = "#arccw.cvar.hudpos_size", var = "arccw_hud_size", min = 0.67, max = 1.5 },
{ type = "c", text = "#arccw.cvar.hudpos_size.desc" },
{ type = "t", text = "#arccw.cvar.font", var = "arccw_font" },
{ type = "c", text = "#arccw.cvar.font_info" },
{ type = "b", text = "#arccw.cvar.attinv_sound", var = "arccw_cust_sounds" },
{ type = "c", text = "#arccw.cvar.attinv_sound.desc" },
{ type = "b", text = "#arccw.cvar.attinv_hideunowned", var = "arccw_attinv_hideunowned" },
{ type = "b", text = "#arccw.cvar.attinv_darkunowned", var = "arccw_attinv_darkunowned" },
{ type = "b", text = "#arccw.cvar.attinv_onlyinspect", var = "arccw_attinv_onlyinspect" },
{ type = "b", text = "#arccw.cvar.attinv_simpleproscons", var = "arccw_attinv_simpleproscons" },
--{ type = "b", text = "#arccw.cvar.attinv_gamemodebuttons", var = "arccw_attinv_gamemodebuttons" },
--{ type = "c", text = "#arccw.cvar.attinv_gamemodebuttons.desc" },
{ type = "h", text = "#arccw.ammohud" },
{ type = "b", text = "#arccw.cvar.hud_3dfun", var = "arccw_hud_3dfun" },
{ type = "c", text = "#arccw.cvar.hud_3dfun.desc" },
{ type = "b", text = "#arccw.cvar.hud_3dfun_lite", var = "arccw_hud_3dfun_lite" },
{ type = "c", text = "#arccw.cvar.hud_3dfun_lite.desc" },
{ type = "b", text = "#arccw.cvar.hud_fcgbars", var = "arccw_hud_fcgbars" },
{ type = "b", text = "#arccw.cvar.hud_fcgabbrev", var = "arccw_hud_fcgabbrev" },
{ type = "b", text = "#arccw.cvar.hud_3dfun_ammotype", var = "arccw_hud_3dfun_ammotype" },
{ type = "c", text = "#arccw.cvar.hud_3dfun_ammotype.desc" },
{ type = "f", text = "#arccw.cvar.hud_3dfun_right", var = "arccw_hud_3dfun_right", min = -5, max = 5 },
{ type = "f", text = "#arccw.cvar.hud_3dfun_up", var = "arccw_hud_3dfun_up", min = -5, max = 5 },
{ type = "f", text = "#arccw.cvar.hud_3dfun_forward", var = "arccw_hud_3dfun_forward", min = -5, max = 5 },
}
local CrosshairPanel = {
{ type = "h", text = "#arccw.clientcfg" },
{ type = "b", text = "#arccw.cvar.crosshair", var = "arccw_crosshair" },
{ type = "f", text = "#arccw.cvar.crosshair_length", var = "arccw_crosshair_length", min = 0, max = 10 },
{ type = "f", text = "#arccw.cvar.crosshair_thickness", var = "arccw_crosshair_thickness", min = 0, max = 2 },
{ type = "f", text = "#arccw.cvar.crosshair_gap", var = "arccw_crosshair_gap", min = 0, max = 2 },
{ type = "b", text = "#arccw.cvar.crosshair_dot", var = "arccw_crosshair_dot" },
{ type = "b", text = "#arccw.cvar.crosshair_shotgun", var = "arccw_crosshair_shotgun" },
{ type = "b", text = "#arccw.cvar.crosshair_equip", var = "arccw_crosshair_equip" },
{ type = "b", text = "#arccw.cvar.crosshair_static", var = "arccw_crosshair_static" },
{ type = "b", text = "#arccw.cvar.crosshair_trueaim", var = "arccw_crosshair_trueaim" },
{ type = "b", text = "#arccw.cvar.crosshair_clump", var = "arccw_crosshair_clump" },
{ type = "b", text = "#arccw.cvar.crosshair_clump_outline", var = "arccw_crosshair_clump_outline" },
{ type = "b", text = "#arccw.cvar.crosshair_clump_always", var = "arccw_crosshair_clump_always" },
{ type = "b", text = "#arccw.cvar.crosshair_aa", var = "arccw_crosshair_aa" },
{ type = "b", text = "#arccw.cvar.crosshair_tilt", var = "arccw_crosshair_tilt" },
{ type = "b", text = "#arccw.cvar.crosshair_prong_top", var = "arccw_crosshair_prong_top" },
{ type = "b", text = "#arccw.cvar.crosshair_prong_left", var = "arccw_crosshair_prong_left" },
{ type = "b", text = "#arccw.cvar.crosshair_prong_right", var = "arccw_crosshair_prong_right" },
{ type = "b", text = "#arccw.cvar.crosshair_prong_bottom", var = "arccw_crosshair_prong_bottom" },
{ type = "m", text = "#arccw.cvar.crosshair_clr", r = "arccw_crosshair_clr_r", g = "arccw_crosshair_clr_g", b = "arccw_crosshair_clr_b", a = "arccw_crosshair_clr_a" },
{ type = "f", text = "#arccw.cvar.crosshair_outline", var = "arccw_crosshair_outline", min = 0, max = 4 },
{ type = "m", text = "#arccw.cvar.crosshair_outline_clr", r = "arccw_crosshair_outline_r", g = "arccw_crosshair_outline_g", b = "arccw_crosshair_outline_b", a = "arccw_crosshair_outline_a" },
}
local BindsPanel = {
{ type = "h", text = "#arccw.bindhelp" },
{ type = "b", text = "#arccw.cvar.nohl2flash", var = "arccw_nohl2flash" },
{ type = "b", text = "#arccw.cvar.altsafety", var = "arccw_altsafety" },
{ type = "b", text = "#arccw.cvar.altbindsonly", var = "arccw_altbindsonly" },
{ type = "c", text = "#arccw.cvar.altbindsonly.desc" },
{ type = "d", text = "#arccw.bind.firemode", var = "arccw_firemode" },
{ type = "d", text = "#arccw.bind.zoom_in", var = "arccw_zoom_in" },
{ type = "d", text = "#arccw.bind.zoom_out", var = "arccw_zoom_out" },
{ type = "d", text = "#arccw.bind.toggle_inv", var = "arccw_toggle_inv" },
{ type = "d", text = "#arccw.bind.switch_scope", var = "arccw_switch_scope" },
{ type = "d", text = "#arccw.bind.toggle_ubgl", var = "arccw_toggle_ubgl" },
{ type = "d", text = "#arccw.bind.melee", var = "arccw_melee" },
{ type = "d", text = "#arccw.bind.toggle_att", var = "arccw_toggle_att" },
}
local ServerPanel = {
{ type = "h", text = "#arccw.adminonly" },
{ type = "o", text = "#arccw.cvar.enable_customization", var = "arccw_enable_customization", sv = true,
choices = {[-1] = "#arccw.cvar.enable_customization.-1", [0] = "#arccw.cvar.enable_customization.0", [1] = "#arccw.cvar.enable_customization.1"}},
{ type = "c", text = "#arccw.cvar.enable_customization.desc" },
{ type = "b", text = "#arccw.cvar.truenames", var = "arccw_truenames", sv = true },
{ type = "b", text = "#arccw.cvar.equipmentammo", var = "arccw_equipmentammo", sv = true },
{ type = "c", text = "#arccw.cvar.equipmentammo.desc" },
{ type = "b", text = "#arccw.cvar.equipmentsingleton", var = "arccw_equipmentsingleton", sv = true },
{ type = "c", text = "#arccw.cvar.equipmentsingleton.desc" },
{ type = "i", text = "#arccw.cvar.equipmenttime", var = "arccw_equipmenttime", min = 15, max = 3600, sv = true },
{ type = "b", text = "#arccw.cvar.throwinertia", var = "arccw_throwinertia", sv = true },
{ type = "o", text = "#arccw.cvar.freeaim", var = "arccw_freeaim", sv = true,
choices = {[0] = "#arccw.combobox.disabled", [1] = "#arccw.cvar.freeaim.1", [2] = "#arccw.cvar.freeaim.2"}},
{ type = "b", text = "#arccw.cvar.override_crosshair_off", var = "arccw_override_crosshair_off", sv = true },
{ type = "b", text = "#arccw.cvar.override_hud_off", var = "arccw_override_hud_off", sv = true },
{ type = "b", text = "#arccw.cvar.override_barrellength", var = "arccw_override_nearwall", sv = true },
{ type = "b", text = "#arccw.cvar.doorbust", var = "arccw_doorbust", sv = true },
{ type = "b", text = "#arccw.cvar.override_lunge_off", var = "arccw_override_lunge_off", sv = true },
{ type = "c", text = "#arccw.cvar.override_lunge_off.desc" },
--[[]
{ type = "b", text = "#arccw.cvar.limityear_enable", var = "arccw_limityear_enable", sv = true },
{ type = "i", text = "#arccw.cvar.limityear", var = "arccw_limityear", min = 1800, max = 2100, sv = true },
{ type = "c", text = "#arccw.cvar.limityear.desc"},
]]
{ type = "b", text = "#arccw.cvar.bodydamagecancel", var = "arccw_bodydamagemult_cancel", sv = true},
{ type = "c", text = "#arccw.cvar.bodydamagecancel.desc"},
{ type = "b", text = "#arccw.cvar.desync", var = "arccw_desync", sv = true },
{ type = "c", text = "#arccw.cvar.desync.desc" },
{ type = "f", text = "#arccw.cvar.weakensounds", var = "arccw_weakensounds", min = -20, max = 30, sv = true},
{ type = "c", text = "#arccw.cvar.weakensounds.desc" },
{ type = "b", text = "#arccw.cvar.reloadincust", var = "arccw_reloadincust", sv = true },
{ type = "c", text = "#arccw.cvar.reloadincust.desc" },
{ type = "b", text = "#arccw.cvar.aimassist", var = "arccw_aimassist", sv = true },
{ type = "c", text = "#arccw.cvar.aimassist.desc" },
{ type = "b", text = "#arccw.cvar.aimassist_head", var = "arccw_aimassist_head", sv = true },
{ type = "f", text = "#arccw.cvar.aimassist_cone", var = "arccw_aimassist_cone", min = 0, max = 360, sv = true},
{ type = "f", text = "#arccw.cvar.aimassist_distance", var = "arccw_aimassist_distance", min = 128, max = 4096, sv = true},
{ type = "f", text = "#arccw.cvar.aimassist_intensity", var = "arccw_aimassist_intensity", min = 0, max = 10, sv = true},
}
local AmmoPanel = {
{ type = "h", text = "#arccw.adminonly" },
{ type = "o", text = "#arccw.cvar.ammo_detonationmode", var = "arccw_ammo_detonationmode", sv = true,
choices = {[-1] = "#arccw.cvar.ammo_detonationmode.-1", [0] = "#arccw.cvar.ammo_detonationmode.0", [1] = "#arccw.cvar.ammo_detonationmode.1", [2] = "#arccw.cvar.ammo_detonationmode.2"}},
{ type = "b", text = "#arccw.cvar.ammo_autopickup", var = "arccw_ammo_autopickup", sv = true },
{ type = "b", text = "#arccw.cvar.ammo_largetrigger", var = "arccw_ammo_largetrigger", sv = true },
{ type = "f", text = "#arccw.cvar.ammo_rareskin", var = "arccw_ammo_rareskin", min = 0, max = 1, sv = true },
{ type = "b", text = "#arccw.cvar.ammo_chaindet", var = "arccw_ammo_chaindet", sv = true },
{ type = "b", text = "#arccw.cvar.ammo_replace", var = "arccw_ammo_replace", sv = true },
{ type = "f", text = "#arccw.cvar.mult_ammohealth", var = "arccw_mult_ammohealth", min = -1, max = 10, sv = true },
{ type = "f", text = "#arccw.cvar.mult_ammoamount", var = "arccw_mult_ammoamount", min = 0.1, max = 10, sv = true },
}
local AttsPanel = {
{ type = "h", text = "#arccw.adminonly" },
{ type = "h", text = "#arccw.attdesc1" },
{ type = "h", text = "#arccw.attdesc2" },
{ type = "b", text = "#arccw.cvar.attinv_free", var = "arccw_attinv_free", sv = true },
{ type = "b", text = "#arccw.cvar.attinv_lockmode", var = "arccw_attinv_lockmode", sv = true },
{ type = "o", text = "#arccw.cvar.attinv_loseondie", var = "arccw_attinv_loseondie", sv = true,
choices = {[0] = "#arccw.combobox.disabled", [1] = "#arccw.cvar.attinv_loseondie.1", [2] = "#arccw.cvar.attinv_loseondie.2"}},
{ type = "i", text = "#arccw.cvar.attinv_giveonspawn", var = "arccw_attinv_giveonspawn", min = 0, max = 100, sv = true },
{ type = "i", text = "#arccw.cvar.atts_pickx", var = "arccw_atts_pickx", min = 0, max = 10, sv = true },
{ type = "c", text = "#arccw.cvar.atts_pickx.desc", sv = true },
{ type = "b", text = "#arccw.cvar.enable_dropping", var = "arccw_enable_dropping", sv = true },
{ type = "b", text = "#arccw.cvar.atts_spawnrand", var = "arccw_atts_spawnrand", sv = true },
{ type = "b", text = "#arccw.cvar.atts_ubglautoload", var = "arccw_atts_ubglautoload", sv = true },
{ type = "p", text = "#arccw.blacklist", func = function() RunConsoleCommand("arccw_blacklist") end },
}
local DevPanel = {
{ type = "h", text = "#arccw.adminonly" },
{ type = "h", text = "#arccw.dev_info1" },
{ type = "h", text = "#arccw.dev_info2" },
{ type = "b", text = "#arccw.cvar.dev_reloadonadmincleanup", var = "arccw_reloadatts_mapcleanup", sv = true },
{ type = "c", text = "#arccw.cvar.dev_reloadonadmincleanup.desc" },
{ type = "b", text = "#arccw.cvar.dev_registerentities", var = "arccw_reloadatts_registerentities", sv = true },
{ type = "c", text = "#arccw.cvar.dev_registerentities.desc" },
{ type = "b", text = "#arccw.cvar.dev_showignored", var = "arccw_reloadatts_showignored", sv = true },
{ type = "c", text = "#arccw.cvar.dev_showignored.desc" },
{ type = "b", text = "#arccw.cvar.dev_debug", var = "arccw_dev_debug", sv = true },
{ type = "c", text = "#arccw.cvar.dev_debug.desc" },
--{ type = "b", text = "Customization Menu Overhaul beta", var = "arccw_dev_cust2beta", sv = true },
--{ type = "c", text = "Enable the customization menu overhaul. Remove this convar when we done doe" },
{ type = "b", text = "#arccw.cvar.dev_alwaysready", var = "arccw_dev_alwaysready", sv = true },
{ type = "c", text = "#arccw.cvar.dev_alwaysready.desc" },
{ type = "b", text = "#arccw.cvar.dev_benchgun", var = "arccw_dev_benchgun", sv = true },
{ type = "c", text = "#arccw.cvar.dev_benchgun.desc" },
{ type = "t", text = "#arccw.cvar.dev_benchgun_custom", var = "arccw_dev_benchgun_custom", sv = true },
{ type = "c", text = "#arccw.cvar.dev_benchgun_custom.desc" },
{ type = "o", text = "Firing Info", var = "arccw_dev_shootinfo", sv = true,
choices = {[0] = "#arccw.combobox.disabled", [1] = "1 - Damage", [2] = "2 - Penetration", [3] = "3 - Dispersion"}},
{ type = "c", text = "Show information when shooting the weapon. Requires 'developer' ConVar to be enabled." },
{ type = "p", text = "#arccw.cvar.dev_reloadatts", func = function() RunConsoleCommand("arccw_reloadatts") end },
{ type = "h", text = "#arccw.cvar.dev_reloadatts.desc" },
{ type = "p", text = "#arccw.cvar.dev_reloadlangs", func = function() RunConsoleCommand("arccw_reloadlangs") end },
{ type = "h", text = "#arccw.cvar.dev_reloadlangs.desc" },
{ type = "p", text = "#arccw.cvar.dev_spawnmenureload", func = function() RunConsoleCommand("spawnmenu_reload") end },
{ type = "h", text = "#arccw.cvar.dev_spawnmenureload.desc" },
}
local ScopesPanel = {
{ type = "h", text = "#arccw.clientcfg" },
{ type = "b", text = "#arccw.cvar.cheapscopes", var = "arccw_cheapscopes" },
{ type = "c", text = "#arccw.cvar.cheapscopesv2.desc" },
{ type = "f", text = "#arccw.cvar.cheapscopesv2_ratio", var = "arccw_cheapscopesv2_ratio", min = 0, max = 1},
{ type = "c", text = "#arccw.cvar.cheapscopesv2_ratio.desc" },
{ type = "b", text = "#arccw.cvar.drawbarrel", var = "arccw_drawbarrel" },
{ type = "f", text = "#arccw.cvar.vm_addads", var = "arccw_vm_add_ads", min = -0.5, max = 9 },
{ type = "b", text = "#arccw.cvar.scopepp", var = "arccw_scopepp" },
{ type = "b", text = "#arccw.cvar.thermalpp", var = "arccw_thermalpp" },
{ type = "b", text = "#arccw.cvar.scopepp_refract", var = "arccw_scopepp_refract" },
{ type = "f", text = "#arccw.cvar.scopepp_refract_ratio", var = "arccw_scopepp_refract_ratio", min = -1, max = 2 },
{ type = "m", text = "#arccw.cvar.scope_clr", r = "arccw_scope_r", g = "arccw_scope_g", b = "arccw_scope_b" },
}
local MultsPanel = {
{ type = "h", text = "#arccw.adminonly" },
{ type = "f", text = "#arccw.cvar.mult_damage", var = "arccw_mult_damage", min = 0, max = 10, sv = true },
{ type = "f", text = "#arccw.cvar.mult_npcdamage", var = "arccw_mult_npcdamage", min = 0, max = 5, sv = true },
{ type = "f", text = "#arccw.cvar.mult_range", var = "arccw_mult_range", min = 0.1, max = 5, sv = true },
{ type = "f", text = "#arccw.cvar.mult_recoil", var = "arccw_mult_recoil", min = 0, max = 5, sv = true },
{ type = "f", text = "#arccw.cvar.mult_penetration", var = "arccw_mult_penetration", min = 0, max = 5, sv = true },
{ type = "f", text = "#arccw.cvar.mult_hipfire", var = "arccw_mult_hipfire", min = 0, max = 3, sv = true },
{ type = "f", text = "#arccw.cvar.mult_accuracy", var = "arccw_mult_accuracy", min = 0, max = 3, sv = true },
{ type = "f", text = "#arccw.cvar.mult_movedisp", var = "arccw_mult_movedisp", min = 0, max = 3, sv = true },
{ type = "f", text = "#arccw.cvar.mult_reloadtime", var = "arccw_mult_reloadtime", min = 0.2, max = 3, sv = true },
{ type = "f", text = "#arccw.cvar.mult_sighttime", var = "arccw_mult_sighttime", min = 0.25, max = 3, sv = true },
{ type = "i", text = "#arccw.cvar.mult_defaultammo", var = "arccw_mult_defaultammo", min = 0, max = 10, sv = true },
{ type = "f", text = "#arccw.cvar.mult_attchance", var = "arccw_mult_attchance", min = 0, max = 10, sv = true },
{ type = "f", text = "#arccw.cvar.mult_heat", var = "arccw_mult_heat", min = 0, max = 3, sv = true },
{ type = "f", text = "#arccw.cvar.mult_crouchdisp", var = "arccw_mult_crouchdisp", min = 0, max = 1, sv = true },
{ type = "f", text = "#arccw.cvar.mult_crouchrecoil", var = "arccw_mult_crouchrecoil", min = 0, max = 1, sv = true },
{ type = "f", text = "#arccw.cvar.mult_movespeed", var = "arccw_mult_movespeed", min = 0, max = 1, sv = true },
{ type = "f", text = "#arccw.cvar.mult_movespeedads", var = "arccw_mult_movespeedads", min = 0, max = 1, sv = true },
{ type = "f", text = "#arccw.cvar.mult_movespeedfire", var = "arccw_mult_movespeedfire", min = 0, max = 1, sv = true },
{ type = "f", text = "#arccw.cvar.mult_meleedamage", var = "arccw_mult_meleedamage", min = 0, max = 4, sv = true },
{ type = "f", text = "#arccw.cvar.mult_meleetime", var = "arccw_mult_meleetime", min = 0, max = 3, sv = true },
{ type = "f", text = "#arccw.cvar.mult_malfunction", var = "arccw_mult_malfunction", min = 0, max = 10, sv = true },
{ type = "f", text = "#arccw.cvar.mult_rpm", var = "arccw_mult_rpm", min = 0.1, max = 5, sv = true },
{ type = "c", text = "#arccw.cvar.mult_rpm.desc" },
{ type = "b", text = "#arccw.cvar.mult_startunloaded", var = "arccw_mult_startunloaded", sv = true },
{ type = "b", text = "#arccw.cvar.mult_shootwhilesprinting", var = "arccw_mult_shootwhilesprinting", sv = true },
{ type = "o", text = "#arccw.cvar.malfunction", var = "arccw_malfunction", sv = true,
choices = {[0] = "#arccw.cvar.malfunction.0", [1] = "#arccw.cvar.malfunction.1", [2] = "#arccw.cvar.malfunction.2"}},
{ type = "b", text = "#arccw.cvar.mult_bottomlessclip", var = "arccw_mult_bottomlessclip", sv = true },
{ type = "c", text = "Weapon feeds from reserve." },
{ type = "b", text = "#arccw.cvar.mult_infiniteammo", var = "arccw_mult_infiniteammo", sv = true },
{ type = "c", text = "Infinite reserve ammo." },
{ type = "b", text = "#arccw.cvar.enable_sway", var = "arccw_enable_sway", sv = true },
{ type = "c", text = "#arccw.cvar.enable_sway.desc" },
{ type = "f", text = "#arccw.cvar.add_sway", var = "arccw_add_sway", min = 0, max = 5, sv = true },
{ type = "f", text = "#arccw.cvar.mult_sway", var = "arccw_mult_sway", min = 0, max = 10, sv = true },
}
local HelpPanel = {
{ type = "h", text = "Links to the ArcCW online wiki." },
{ type = "url", text = "Checking for Addon Conflicts",
url = "https://github.com/HaodongMo/ArcCW/wiki/Help-&-Troubleshooting#checking-for-addon-conflicts", },
{ type = "c", text = "Check for addon conflicts that may be causing issues with ArcCW weapons." },
{ type = "url", text = "Cheap Scopes",
url = "https://github.com/HaodongMo/ArcCW/wiki/Help-&-Troubleshooting#cheap-scopes", },
{ type = "c", text = "'Why are my scopes so blurry?'" },
{ type = "url", text = "Underbarrel Weapons",
url = "https://github.com/HaodongMo/ArcCW/wiki/Help-&-Troubleshooting#underbarrel-weapons", },
{ type = "c", text = "'Why aren't my underbarrels weapons working?'" },
{ type = "c", text = "'How do I use my underbarrel weapons?'" },
{ type = "url", text = "Free Attachments",
url = "https://github.com/HaodongMo/ArcCW/wiki/Help-&-Troubleshooting#free-attachments", },
{ type = "c", text = "'Why are my attachments red?'" },
{ type = "url", text = "cam.End3D errors",
url = "https://github.com/HaodongMo/ArcCW/wiki/Help-&-Troubleshooting#camend3d-errors", },
{ type = "c", text = "'Warning: Calling cam.End3D because someone forgot to!'" },
}
local MultPresets = {
["#preset.default"] = { -- this needs fills
arccw_mult_damage = "1",
arccw_mult_npcdamage = "1",
arccw_mult_range = "1",
arccw_mult_recoil = "1",
arccw_mult_penetration = "1",
arccw_mult_hipfire = "1",
arccw_mult_movedisp = "1",
arccw_mult_reloadtime = "1",
arccw_mult_sighttime = "1",
arccw_mult_defaultclip = "1",
arccw_mult_attchance = "1",
arccw_mult_crouchdisp = "1",
arccw_mult_crouchrecoil = "1",
arccw_mult_movespeed = "1",
arccw_mult_movespeedads = "1",
arccw_mult_movespeedfire = "1",
arccw_mult_heat = "1",
arccw_mult_meleetime = "1",
arccw_mult_meleedamage = "1",
arccw_mult_malfunction = "1",
arccw_mult_startunloaded = "0",
arccw_mult_shootwhilesprinting = "0",
arccw_mult_bottomlessclip = "0",
arccw_mult_infiniteammo = "0",
}
}
local NPCsPanel = {
{ type = "h", text = "#arccw.adminonly" },
{ type = "b", text = "Replace NPC Weapons", var = "arccw_npc_replace", sv = true },
{ type = "b", text = "NPC Attachments", var = "arccw_npc_atts", sv = true },
}
function ArcCW.NetworkConvar(convar, value, p)
if IsValid(LocalPlayer()) and !LocalPlayer():IsAdmin() then return end
if (p.TickCreated or 0) == UnPredictedCurTime() then return end
if value == true or value == false then
value = value and 1 or 0
end
if IsColor(value) then
value = tostring(value.r) .. " " .. tostring(value.g) .. " " .. tostring(value.b) .. " " .. tostring(value.a)
end
local command = convar .. " " .. tostring(value)
local timername = "change" .. convar
if timer.Exists(timername) then
timer.Remove(timername)
end
timer.Create(timername, 0.25, 1, function()
net.Start("arccw_sendconvar")
net.WriteString(command)
net.SendToServer()
end)
end
function ArcCW.GeneratePanelElements(panel, table)
local AddControl = {
["h"] = function(p, d) return p:Help(d.text) end,
["c"] = function(p, d) return p:ControlHelp(d.text) end,
["b"] = function(p, d) return p:CheckBox(d.text, d.var) end,
["i"] = function(p, d) return p:NumSlider(d.text, d.var, d.min, d.max, 0) end,
["f"] = function(p, d) return p:NumSlider(d.text, d.var, d.min, d.max, 2) end,
["m"] = function(p, d) --return p:AddControl("color", { Label = d.text, Red = d.r, Green = d.g, Blue = d.b, Alpha = d.a })
local ctrl = vgui.Create("DColorMixer", p)
ctrl:SetLabel( d.text ) ctrl:SetConVarR( d.r ) ctrl:SetConVarG( d.g ) ctrl:SetConVarB( d.b ) ctrl:SetConVarA( d.a )
p:AddItem( ctrl ) return ctrl
end,
["p"] = function(p, d) local b = p:Button(d.text) b.DoClick = d.func return b end,
["url"] = function(p, d) local b = p:Button(d.text) b.DoClick = function() gui.OpenURL(d.url) end return b end,
["t"] = function(p, d) return p:TextEntry(d.text, d.var) end,
["o"] = function(p, d) local cb = p:ComboBox(d.text, d.var) for k, v in pairs(d.choices) do cb:AddChoice(v, k) end return cb end,
["d"] = function(p, d)
local s = vgui.Create("DSizeToContents", p) s:SetSizeX(false) s:Dock(TOP) s:InvalidateLayout()
local l = vgui.Create("DLabel", s) l:SetText(d.text) l:SetTextColor(Color(0, 0, 0)) l:Dock(TOP) l:SetContentAlignment(5)
local bd = vgui.Create("DBinder", s)
if input.LookupBinding(d.var) then bd:SetValue(input.GetKeyCode(input.LookupBinding(d.var))) end
bd.OnChange = function(b, k)
if k and input.GetKeyName(k) then
local str = input.LookupKeyBinding(k)
if str then
str = string.Replace(str, d.var .. "; ", "")
str = string.Replace(str, d.var, "")
chat.AddText(Color(255, 255, 255), language.GetPhrase("arccw.bind.msg"), Color(255, 128, 0), "bind " .. input.GetKeyName(k) .. " \"" .. str .. "; " .. d.var .. "\"")
else
chat.AddText(Color(255, 255, 255), language.GetPhrase("arccw.bind.msg"), Color(255, 128, 0), "bind " .. input.GetKeyName(k) .. " " .. d.var .. "")
end
end
end
bd:Dock(TOP) p:AddItem(s) return s end
}
local concommands = {
["b"] = true,
["i"] = true,
["f"] = true,
["m"] = true,
["t"] = true,
}
for _, data in SortedPairs(table) do
local p = AddControl[data.type](panel, data)
if concommands[data.type] and data.sv then
p.TickCreated = UnPredictedCurTime()
if data.type == "b" then
p.OnChange = function(self, bval)
ArcCW.NetworkConvar(data.var, bval, self)
end
elseif data.type == "i" or data.type == "f" or data.type == "m" or data.type == "t" then
p.OnValueChanged = function(self, bval)
ArcCW.NetworkConvar(data.var, bval, self)
end
end
end
end
end
local CrosshairPresets = {
["#preset.default"] = {
arccw_crosshair_length = "4",
arccw_crosshair_thickness = "1",
arccw_crosshair_gap = "1",
arccw_crosshair_dot = "1",
arccw_crosshair_shotgun = "1",
arccw_crosshair_equip = "1",
arccw_crosshair_static = "0",
arccw_crosshair_clump = "0",
arccw_crosshair_clump_outline = "0",
arccw_crosshair_clump_always = "0",
arccw_crosshair_clr_r = "255",
arccw_crosshair_clr_g = "255",
arccw_crosshair_clr_b = "255",
arccw_crosshair_clr_a = "255",
arccw_crosshair_outline = "2",
arccw_crosshair_outline_r = "0",
arccw_crosshair_outline_g = "0",
arccw_crosshair_outline_b = "0",
arccw_crosshair_outline_a = "255",
arccw_scope_r = "255",
arccw_scope_g = "0",
arccw_scope_b = "0",
},
["#arccw.crosshair.tfa"] = {
arccw_crosshair_length = "8",
arccw_crosshair_thickness = "0.4",
arccw_crosshair_gap = "1",
arccw_crosshair_dot = "0",
arccw_crosshair_shotgun = "0",
arccw_crosshair_equip = "0",
arccw_crosshair_static = "0",
arccw_crosshair_clump = "0",
arccw_crosshair_clump_outline = "0",
arccw_crosshair_clump_always = "0",
arccw_crosshair_clr_r = "255",
arccw_crosshair_clr_g = "255",
arccw_crosshair_clr_b = "255",
arccw_crosshair_clr_a = "255",
arccw_crosshair_outline = "2",
arccw_crosshair_outline_r = "0",
arccw_crosshair_outline_g = "0",
arccw_crosshair_outline_b = "0",
arccw_crosshair_outline_a = "255",
arccw_scope_r = "255",
arccw_scope_g = "0",
arccw_scope_b = "0",
},
["#arccw.crosshair.cw2"] = {
arccw_crosshair_length = "3.5",
arccw_crosshair_thickness = "0.4",
arccw_crosshair_gap = "1",
arccw_crosshair_dot = "0",
arccw_crosshair_shotgun = "0",
arccw_crosshair_equip = "0",
arccw_crosshair_static = "0",
arccw_crosshair_clump = "1",
arccw_crosshair_clump_outline = "1",
arccw_crosshair_clump_always = "0",
arccw_crosshair_clr_r = "255",
arccw_crosshair_clr_g = "255",
arccw_crosshair_clr_b = "255",
arccw_crosshair_clr_a = "200",
arccw_crosshair_outline = "2",
arccw_crosshair_outline_r = "0",
arccw_crosshair_outline_g = "0",
arccw_crosshair_outline_b = "0",
arccw_crosshair_outline_a = "200",
arccw_scope_r = "255",
arccw_scope_g = "0",
arccw_scope_b = "0",
},
["#arccw.crosshair.cs"] = {
arccw_crosshair_length = "3",
arccw_crosshair_thickness = "0.4",
arccw_crosshair_gap = "0.4",
arccw_crosshair_dot = "0",
arccw_crosshair_shotgun = "0",
arccw_crosshair_equip = "0",
arccw_crosshair_static = "1",
arccw_crosshair_clump = "0",
arccw_crosshair_clump_outline = "0",
arccw_crosshair_clump_always = "0",
arccw_crosshair_clr_r = "0",
arccw_crosshair_clr_g = "255",
arccw_crosshair_clr_b = "0",
arccw_crosshair_clr_a = "255",
arccw_crosshair_outline = "0",
arccw_crosshair_outline_r = "0",
arccw_crosshair_outline_g = "0",
arccw_crosshair_outline_b = "0",
arccw_crosshair_outline_a = "0",
arccw_scope_r = "255",
arccw_scope_g = "0",
arccw_scope_b = "0",
},
["#arccw.crosshair.light"] = {
arccw_crosshair_length = "4",
arccw_crosshair_thickness = "0.8",
arccw_crosshair_gap = "1",
arccw_crosshair_dot = "0",
arccw_crosshair_shotgun = "1",
arccw_crosshair_equip = "1",
arccw_crosshair_static = "0",
arccw_crosshair_clump = "1",
arccw_crosshair_clump_outline = "1",
arccw_crosshair_clump_always = "0",
arccw_crosshair_clr_r = "255",
arccw_crosshair_clr_g = "255",
arccw_crosshair_clr_b = "255",
arccw_crosshair_clr_a = "200",
arccw_crosshair_outline = "2",
arccw_crosshair_outline_r = "0",
arccw_crosshair_outline_g = "0",
arccw_crosshair_outline_b = "0",
arccw_crosshair_outline_a = "200",
arccw_scope_r = "255",
arccw_scope_g = "0",
arccw_scope_b = "0",
},
}
local ViewmodelPresets = {
["#preset.default"] = {
arccw_vm_coolsway = "1",
arccw_vm_coolview = "1",
arccw_vm_right = "0",
arccw_vm_forward = "0",
arccw_vm_up = "0",
arccw_vm_look_xmult = "1",
arccw_vm_look_ymult = "1",
arccw_vm_sway_xmult = "1",
arccw_vm_sway_ymult = "1",
arccw_vm_sway_zmult = "1",
arccw_vm_sway_speedmult = "1",
arccw_vm_coolview_mult = "1",
}
}
function ArcCW_Options_Bullet(panel)
ArcCW.GeneratePanelElements(panel, BulletPanel)
end
function ArcCW_Options_Client(panel)
ArcCW.GeneratePanelElements(panel, ClientPanel)
end
function ArcCW_Options_Perf(panel)
ArcCW.GeneratePanelElements(panel, PerformancePanel)
end
function ArcCW_Options_Viewmodel(panel, no_preset)
if !no_preset then
panel:AddControl("ComboBox", {
MenuButton = "1",
Label = "#Presets",
Folder = "arccw_vm",
CVars = { "" },
Options = ViewmodelPresets
})
end
ArcCW.GeneratePanelElements(panel, ViewmodelPanel)
end
function ArcCW_Options_HUD(panel)
ArcCW.GeneratePanelElements(panel, HudPanel)
end
function ArcCW_Options_Dev(panel)
ArcCW.GeneratePanelElements(panel, DevPanel)
end
function ArcCW_Options_Crosshair(panel, no_preset)
if !no_preset then
panel:AddControl("ComboBox", {
MenuButton = "1",
Label = "#Presets",
Folder = "arccw_crosshair",
CVars = { "" },
Options = CrosshairPresets
})
end
ArcCW.GeneratePanelElements(panel, CrosshairPanel)
end
function ArcCW_Options_Server(panel)
ArcCW.GeneratePanelElements(panel, ServerPanel)
end
function ArcCW_Options_Ammo(panel)
ArcCW.GeneratePanelElements(panel, AmmoPanel)
end
function ArcCW_Options_Mults(panel, no_preset)
if !no_preset then
panel:AddControl("ComboBox", {
MenuButton = "1",
Label = "#Presets",
Folder = "arccw_mults",
CVars = { "" },
Options = MultPresets
})
end
ArcCW.GeneratePanelElements(panel, MultsPanel)
end
function ArcCW_Options_Atts(panel)
ArcCW.GeneratePanelElements(panel, AttsPanel)
end
function ArcCW_Options_NPC(panel)
ArcCW.GeneratePanelElements(panel, NPCsPanel)
end
function ArcCW_Options_Binds(panel)
ArcCW.GeneratePanelElements(panel, BindsPanel)
end
function ArcCW_Options_Scopes(panel)
ArcCW.GeneratePanelElements(panel, ScopesPanel)
end
function ArcCW_Options_Help(panel)
ArcCW.GeneratePanelElements(panel, HelpPanel)
end
ArcCW.ClientMenus = {
["ArcCW_Options_Client"] = { text = "#arccw.menus.client", func = ArcCW_Options_Client, tbl = ClientPanel },
["ArcCW_Options_Help"] = { text = "Help & Troubleshooting", func = ArcCW_Options_Help, tbl = HelpPanel },
["ArcCW_Options_Bullet"] = { text = "#arccw.menus.bullet", func = ArcCW_Options_Bullet, tbl = BulletPanel },
["ArcCW_Options_Perf"] = { text = "#arccw.menus.perf", func = ArcCW_Options_Perf, tbl = PerformancePanel },
["ArcCW_Options_Viewmodel"] = { text = "#arccw.menus.vmodel", func = ArcCW_Options_Viewmodel, tbl = ViewmodelPanel },
["ArcCW_Options_HUD"] = { text = "#arccw.menus.hud", func = ArcCW_Options_HUD, tbl = HudPanel },
["ArcCW_Options_Crosshair"] = { text = "#arccw.menus.xhair", func = ArcCW_Options_Crosshair, tbl = CrosshairPanel },
["ArcCW_Options_Server"] = { text = "#arccw.menus.server", func = ArcCW_Options_Server, tbl = ServerPanel },
["ArcCW_Options_Ammo"] = { text = "#arccw.menus.ammo", func = ArcCW_Options_Ammo, tbl = AmmoPanel },
["ArcCW_Options_Atts"] = { text = "#arccw.menus.atts", func = ArcCW_Options_Atts, tbl = AttsPanel },
["ArcCW_Options_Mults"] = { text = "#arccw.menus.mults", func = ArcCW_Options_Mults, tbl = MultsPanel },
["ArcCW_Options_Dev"] = { text = "#arccw.menus.dev", func = ArcCW_Options_Dev, tbl = DevPanel },
["ArcCW_Options_NPC"] = { text = "#arccw.menus.npcs", func = ArcCW_Options_NPC, tbl = NPCsPanel },
["ArcCW_Options_Binds"] = { text = "#arccw.menus.binds", func = ArcCW_Options_Binds, tbl = BindsPanel },
["ArcCW_Options_Scopes"] = { text = "#arccw.menus.scopes", func = ArcCW_Options_Scopes, tbl = ScopesPanel },
}
hook.Add("PopulateToolMenu", "ArcCW_Options", function()
for menu, data in pairs(ArcCW.ClientMenus) do
spawnmenu.AddToolMenuOption("Options", "ArcCW", menu, data.text, "", "", data.func)
end
end)
-- As of 2023-11-12, this feature is only available on dev branch.
-- Won't break anything on release branch though.
list.Set("ContentCategoryIcons", "ArcCW - Ammo", "arccw/icon_16.png")
list.Set("ContentCategoryIcons", "ArcCW - Attachments", "arccw/icon_16.png")
-- Give all categories with ArcCW weapons our icon unless one is already set
local first_populate = true
hook.Add("PopulateWeapons", "ArcCW_ContentCategoryIcons", function()
if !first_populate then return end
for i, wep in pairs(weapons.GetList()) do
local weap = weapons.Get(wep.ClassName)
if weap and weap.ArcCW then
local cat = weap.Category
if cat and !list.HasEntry("ContentCategoryIcons", cat) then
list.Set("ContentCategoryIcons", cat, "arccw/icon_16.png")
end
end
end
first_populate = false
end)

View File

@@ -0,0 +1,41 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
hook.Add("PopulateMenuBar", "ArcCW_NPCWeaponMenu", function (menubar)
local menu = menubar:AddOrGetMenu("ArcCW NPC Weapons")
menu:AddCVar("None", "gmod_npcweapon", "none")
menu:AddSpacer()
local weaponlist = weapons.GetList()
table.SortByMember(weaponlist, "PrintName", true)
local cats = {}
for _, k in pairs(weaponlist) do
if weapons.IsBasedOn(k.ClassName, "arccw_base") and !k.NotForNPCs and !k.PrimaryBash and k.Spawnable then
local cat = k.Category or "Other"
if !cats[cat] then cats[cat] = menu:AddSubMenu(cat) end
cats[cat]:SetDeleteSelf(false)
cats[cat]:AddCVar(k.PrintName, "gmod_npcweapon", k.ClassName)
end
end
end)
net.Receive("arccw_npcgiverequest", function(len, ply)
local class = GetConVar("gmod_npcweapon"):GetString()
net.Start("arccw_npcgivereturn")
net.WriteString(class)
net.SendToServer()
end)

View File

@@ -0,0 +1,139 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
net.Receive("arccw_sp_anim", function(len, ply)
local wep = LocalPlayer():GetActiveWeapon()
local key = net.ReadString()
local mul = net.ReadFloat()
local start = net.ReadFloat()
local time = net.ReadBool()
--local skip = net.ReadBool() Unused
local ignore = net.ReadBool()
if !wep.ArcCW then return end
wep:PlayAnimation(key, mul, false, start, time, false, ignore)
end)
net.Receive("arccw_sp_checkpoints", function(len, ply)
local wep = LocalPlayer():GetActiveWeapon()
if !wep.ArcCW then return end
wep.CheckpointAnimation = nil
end)
net.Receive("arccw_sp_lhikanim", function(len, ply)
local wep = LocalPlayer():GetActiveWeapon()
local key = net.ReadString()
local time = net.ReadFloat() or -1
if !wep.ArcCW then return end
wep:DoLHIKAnimation(key, time)
end)
net.Receive("arccw_sp_health", function(len, ply)
local ent = net.ReadEntity()
if !IsValid(ent) then return end
ent:SetHealth(0)
ent.ArcCWCLHealth = 0
end)
local clr_b = Color(160, 190, 255)
local clr_r = Color(255, 190, 190)
concommand.Add("arccw_listvmanims", function()
local wep = LocalPlayer():GetActiveWeapon()
if !wep then return end
local vm = LocalPlayer():GetViewModel()
if !vm then return end
local alist = vm:GetSequenceList()
for i = 0, #alist do
MsgC(clr_b, i, " --- ")
MsgC(color_white, "\t", alist[i], "\n [")
MsgC(clr_r, "\t", vm:SequenceDuration(i), "\n")
end
end)
concommand.Add("arccw_listvmbones", function()
local wep = LocalPlayer():GetActiveWeapon()
if !wep then return end
local vm = LocalPlayer():GetViewModel()
if !vm then return end
for i = 0, (vm:GetBoneCount() - 1) do
print(i .. " - " .. vm:GetBoneName(i))
end
end)
concommand.Add("arccw_listvmatts", function()
local wep = LocalPlayer():GetActiveWeapon()
if !wep then return end
local vm = LocalPlayer():GetViewModel()
if !vm then return end
local alist = vm:GetAttachments()
for i = 1, #alist do
MsgC(clr_b, i, " --- ")
MsgC(color_white, "\tindex : ", alist[i].id, "\n [")
MsgC(clr_r, "\tname: ", alist[i].name, "\n")
end
end)
concommand.Add("arccw_listvmbgs", function()
local wep = LocalPlayer():GetActiveWeapon()
if !wep then return end
local vm = LocalPlayer():GetViewModel()
if !vm then return end
local alist = vm:GetBodyGroups()
for i = 1, #alist do
local alistsm = alist[i].submodels
local active = vm:GetBodygroup(alist[i].id)
MsgC(clr_b, alist[i].id, " -- ")
MsgC(color_white, "\t", alist[i].name, "\n")
if alistsm then
for j = 0, #alistsm do
MsgC(active == j and color_white or clr_b, "\t" .. j, " - ")
MsgC(active == j and color_white or clr_r, alistsm[j], "\n")
end
end
end
end)
local lastwpn = nil
hook.Add("Think", "ArcCW_FixDeploy", function()
--if !game.SinglePlayer() then return end
local wep = LocalPlayer():GetActiveWeapon()
if wep.ArcCW and wep != lastwpn then wep:Deploy() end
lastwpn = wep
end)

View File

@@ -0,0 +1,47 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local enabled = ArcCW.ConVars["enable_sway"]
local mult = ArcCW.ConVars["mult_sway"]
ArcCW.SwayDir = 0
function ArcCW.Sway(cmd)
local ply = LocalPlayer()
local wpn = ply:GetActiveWeapon()
if !wpn.ArcCW then return end
local ang = cmd:GetViewAngles()
if wpn:GetState() == ArcCW.STATE_SIGHTS and !wpn.NoSway and enabled:GetBool() then
local sway = mult:GetFloat() * wpn:GetBuff("Sway")
--sway = sway * math.Clamp(1 / (wpn:GetActiveSights().ScopeMagnification or 1), 0.1, 1)
if wpn:InBipod() then
sway = sway * (wpn.BipodDispersion * wpn:GetBuff_Mult("Mult_BipodDispersion"))
end
if sway > 0.05 then
ang.p = math.Clamp(ang.p + math.sin(CurTime() * 1.25) * FrameTime() * sway, -89, 89)
ArcCW.SwayDir = ArcCW.SwayDir + math.Rand(-360, 360) * FrameTime() / math.min(sway, 1)
ang.p = ang.p + math.sin(ArcCW.SwayDir) * FrameTime() * sway
ang.y = ang.y + math.cos(ArcCW.SwayDir) * FrameTime() * sway
-- ang.p = ang.p + math.Rand(-1, 1) * FrameTime() * sway
-- ang.y = ang.y + math.Rand(-1, 1) * FrameTime() * sway
cmd:SetViewAngles(ang)
end
end
end
hook.Add("CreateMove", "ArcCW_Sway", ArcCW.Sway)

377
lua/arccw/client/cl_ttt.lua Normal file
View File

@@ -0,0 +1,377 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
if engine.ActiveGamemode() != "terrortown" then return end
ArcCW.ConVars["ttt_inforoundstart"] = CreateClientConVar("arccw_ttt_inforoundstart", "1", true, false, "Whether to show ArcCW config every round.")
ArcCW.ConVars["ttt_rolecrosshair"] = CreateClientConVar("arccw_ttt_rolecrosshair", "1", true, false, "Whether to color your crosshair according to your role.")
ArcCW.TTT_AttInfo = ArcCW.TTT_AttInfo or {}
local TTTPanel = {
{ type = "h", text = "#arccw.ttt_serverhelp" },
{ type = "b", text = "#arccw.cvar.ttt_replace", var = "arccw_ttt_replace", sv = true },
{ type = "b", text = "#arccw.cvar.ammo_replace", var = "arccw_ttt_ammo", sv = true },
{ type = "b", text = "#arccw.cvar.ttt_atts", var = "arccw_ttt_atts", sv = true },
{ type = "o", text = "#arccw.cvar.ttt_customizemode", var = "arccw_ttt_customizemode", sv = true,
choices = {[0] = "#arccw.cvar.ttt_customizemode.0", [1] = "#arccw.cvar.ttt_customizemode.1", [2] = "#arccw.cvar.ttt_customizemode.2", [3] = "#arccw.cvar.ttt_customizemode.3"}},
{ type = "o", text = "#arccw.cvar.ttt_bodyattinfo", var = "arccw_ttt_bodyattinfo", sv = true,
choices = {[0] = "#arccw.combobox.disabled", [1] = "#arccw.cvar.ttt_bodyattinfo.1", [2] = "#arccw.cvar.ttt_bodyattinfo.2"}},
{ type = "c", text = "#arccw.cvar.ttt_bodyattinfo.help"},
}
net.Receive("arccw_ttt_bodyattinfo", function()
local rag = net.ReadEntity()
rag = rag:EntIndex()
ArcCW.TTT_AttInfo[rag] = {}
local atts = net.ReadUInt(8)
for i = 1, atts do
local id = net.ReadUInt(ArcCW.GetBitNecessity())
if id != 0 then
--ArcCW.TTT_AttInfo[rag][i] = ArcCW.AttachmentIDTable[id]
table.insert(ArcCW.TTT_AttInfo[rag], ArcCW.AttachmentIDTable[id])
end
end
end)
hook.Add("TTTBodySearchPopulate", "ArcCW_PopulateHUD", function(processed, raw)
-- Attachment Info
local mode = ArcCW.ConVars["ttt_bodyattinfo"]:GetInt()
local attTbl = ArcCW.TTT_AttInfo[raw.eidx]
if attTbl and !table.IsEmpty(attTbl) and (mode == 2 or (mode == 1 and raw.detective_search)) then
local finalTbl = {
img = "arccw/ttticons/arccw_dropattinfo.png",
p = 10.5, -- Right after the murder weapon
text = ArcCW.GetTranslation(mode == 1 and "ttt.bodyatt.founddet" or "ttt.bodyatt.found")
}
local count = table.Count(attTbl)
if count == 1 then
if !ArcCW.AttachmentTable[attTbl[1]] then return end
local printName = ArcCW.GetTranslation("name." .. attTbl[1]) or ArcCW.AttachmentTable[attTbl[1]].PrintName
finalTbl.text = finalTbl.text .. ArcCW.GetTranslation("ttt.bodyatt.att1", {att = printName})
elseif count == 2 then
if !ArcCW.AttachmentTable[attTbl[1]] or !ArcCW.AttachmentTable[attTbl[2]] then return end
local printName1 = ArcCW.GetTranslation("name." .. attTbl[1]) or ArcCW.AttachmentTable[attTbl[1]].PrintName
local printName2 = ArcCW.GetTranslation("name." .. attTbl[2]) or ArcCW.AttachmentTable[attTbl[2]].PrintName
finalTbl.text = finalTbl.text .. ArcCW.GetTranslation("ttt.bodyatt.att2", {att1 = printName1, att2 = printName2})
else
finalTbl.text = finalTbl.text .. ArcCW.GetTranslation("ttt.bodyatt.att3")
local comma = false
for i, v in pairs(attTbl) do
if v and ArcCW.AttachmentTable[v] then
local printName = ArcCW.GetTranslation("name." .. v) or ArcCW.AttachmentTable[v].PrintName
finalTbl.text = finalTbl.text .. (comma and ", " or "") .. printName
comma = true
end
end
finalTbl.text = finalTbl.text .. "."
end
processed.arccw_atts = finalTbl
end
-- kill info
if bit.band(raw.dmg, DMG_BUCKSHOT) == DMG_BUCKSHOT then
processed.dmg.text = LANG.GetTranslation("search_dmg_buckshot")
processed.dmg.img = "arccw/ttticons/kill_buckshot.png"
elseif bit.band(raw.dmg, DMG_NERVEGAS) == DMG_NERVEGAS then
processed.dmg.text = LANG.GetTranslation("search_dmg_nervegas")
processed.dmg.img = "arccw/ttticons/kill_nervegas.png"
end
end)
local function AddLine(parent, str)
local pw, ph = parent:GetSize()
local label = vgui.Create("DLabel", parent)
label:SetSize(pw, ScreenScale(8))
label:Dock(TOP)
label:DockMargin(ScreenScale(4), ScreenScale(1), ScreenScale(4), ScreenScale(1))
label:SetFont("ArcCW_8")
label:SetTextColor(Color(255,255,255,255))
label:SetText(str)
return label
end
local infoBox = nil
local function CreateInfoBox(t)
if infoBox then
infoBox:Remove()
timer.Remove("ArcCW_TTT_InfoBox")
end
local totalw, totalh = ScrW() * 0.25, ScrH() * 0.2
infoBox = vgui.Create("DPanel")
infoBox:SetSize(totalw, totalh)
infoBox:SetPos(ScreenScale(2), ScrH() * 0.5)
infoBox.Paint = function(span, w, h)
surface.SetDrawColor(Color(0, 0, 0, 150))
surface.DrawRect(0, 0, w, h)
end
local label = vgui.Create("DLabel", infoBox)
label:SetSize(totalw, ScreenScale(12))
label:Dock(TOP)
label:DockMargin(ScreenScale(4), ScreenScale(2), ScreenScale(4), ScreenScale(2))
label:SetTextColor(Color(255,255,255,255))
label:SetFont("ArcCW_12")
label:SetText(ArcCW.GetTranslation("ttt.roundinfo"))
if ArcCW.ConVars["ttt_replace"]:GetBool() then
AddLine(infoBox, ArcCW.GetTranslation("ttt.roundinfo.replace"))
end
local cmode_str = "ttt.roundinfo.cmode" .. ArcCW.ConVars["ttt_customizemode"]:GetInt()
AddLine(infoBox, ArcCW.GetTranslation("ttt.roundinfo.cmode") .. " " .. ArcCW.GetTranslation(cmode_str))
local att_str = ""
local att_cvar = ArcCW.ConVars["attinv_free"]:GetBool()
local att_cvar2 = ArcCW.ConVars["attinv_lockmode"]:GetBool()
local att_cvar3 = ArcCW.ConVars["attinv_loseondie"]:GetBool()
if att_cvar then
att_str = "ttt.roundinfo.free"
elseif att_cvar2 then
att_str = "ttt.roundinfo.locking"
else
att_str = "ttt.roundinfo.inv"
end
att_str = ArcCW.GetTranslation(att_str)
if att_cvar3 == 0 then
att_str = att_str .. ", " .. ArcCW.GetTranslation("ttt.roundinfo.persist")
elseif !att_cvar and !att_cvar2 and att_cvar3 == 2 then
att_str = att_str .. ", " .. ArcCW.GetTranslation("ttt.roundinfo.drop")
end
if ArcCW.ConVars["atts_pickx"]:GetInt() > 0 then
att_str = att_str .. ", " .. ArcCW.GetTranslation("ttt.roundinfo.pickx") .. " " .. ArcCW.ConVars["atts_pickx"]:GetInt()
end
AddLine(infoBox, ArcCW.GetTranslation("ttt.roundinfo.attmode") .. " " .. att_str)
local binfo_cvar = ArcCW.ConVars["ttt_bodyattinfo"]:GetInt()
AddLine(infoBox, ArcCW.GetTranslation("ttt.roundinfo.bmode") .. " " .. ArcCW.GetTranslation("ttt.roundinfo.bmode" .. binfo_cvar))
if ArcCW.ConVars["ammo_replace"]:GetBool() and ArcCW.ConVars["mult_ammohealth"]:GetFloat() > 0 then
local ainfo_cvar = ArcCW.ConVars["ammo_detonationmode"]:GetInt()
local ainfo_str = ArcCW.GetTranslation("ttt.roundinfo.amode" .. ainfo_cvar)
if ArcCW.ConVars["ammo_chaindet"]:GetBool() then
ainfo_str = ainfo_str .. ", " .. ArcCW.GetTranslation("ttt.roundinfo.achain")
end
AddLine(infoBox, ArcCW.GetTranslation("ttt.roundinfo.amode") .. " " .. ainfo_str)
end
timer.Create("ArcCW_TTT_InfoBox", t, 1, function()
if infoBox then infoBox:Remove() end
end)
end
concommand.Add("arccw_ttt_info", function()
CreateInfoBox(20)
end, nil, "Shows a panel detailing current ArcCW settings.")
local turnoff = true
hook.Add("TTTPrepareRound", "ArcCW_TTT_Info", function()
if ArcCW.ConVars["ttt_inforoundstart"]:GetBool() then
CreateInfoBox(15)
if turnoff then
turnoff = false
chat.AddText(Color(255,255,255), "To turn off ArcCW config info, type 'arccw_ttt_inforoundstart 0' in console.")
end
end
ArcCW.TTT_AttInfo = {}
end)
if !TTT2 then
hook.Add("TTTSettingsTabs", "ArcCW_TTT", function(dtabs)
local padding = dtabs:GetPadding() * 2
local panellist = vgui.Create("DPanelList", dtabs)
panellist:StretchToParent(0,0,padding,0)
panellist:EnableVerticalScrollbar(true)
panellist:SetPadding(10)
panellist:SetSpacing(10)
local dgui = vgui.Create("DForm", panellist)
dgui:SetName("#arccw.menus.ttt_client")
dgui:Help("#arccw.ttt_clienthelp")
dgui:CheckBox("#arccw.cvar.ttt_inforoundstart", "arccw_ttt_inforoundstart")
dgui:CheckBox("#arccw.cvar.ttt_rolecrosshair", "arccw_ttt_rolecrosshair")
panellist:AddItem(dgui)
local dgui2 = vgui.Create("DForm", panellist)
dgui2:SetName("#arccw.menus.ttt_server")
ArcCW.GeneratePanelElements(dgui2, TTTPanel)
panellist:AddItem(dgui2)
for menu, data in SortedPairs(ArcCW.ClientMenus) do
local form = vgui.Create("DForm", panellist)
form:SetName(data.text)
data.func(form, true)
form:SetExpanded(false)
panellist:AddItem(form)
end
dtabs:AddSheet("ArcCW", panellist, "icon16/gun.png", false, false, "ArcCW")
end)
end
-----------------------------
-- TTT2-specific support
-----------------------------
hook.Add("TTTRenderEntityInfo", "ArcCW_TTT2_Weapons", function(tData)
local client = LocalPlayer()
local ent = tData:GetEntity()
if !IsValid(client) or !client:IsTerror() or !client:Alive()
or !IsValid(ent) or tData:GetEntityDistance() > 100 or !ent:IsWeapon()
or !ent.ArcCW or ent.Throwing then
return
end
if tData:GetAmountDescriptionLines() > 0 then
tData:AddDescriptionLine()
end
local pickx = ArcCW.ConVars["atts_pickx"]:GetInt()
if !ent.CertainAboutAtts then
tData:AddDescriptionLine("??? Attachments")
elseif ent.Attachments and ent:CountAttachments() > 0 then
tData:AddDescriptionLine(tostring(ent:CountAttachments()) .. (pickx > 0 and ("/" .. pickx) or "") .. ArcCW.GetTranslation("ttt.attachments"), nil)
for i, v in pairs(ent.Attachments) do
local attName = v.Installed
if !attName and !v.MergeSlots then
continue
elseif v.MergeSlots and !attName then
for _, s in pairs(v.MergeSlots) do
if ent.Attachments[s] and ent.Attachments[s].Installed then
attName = ent.Attachments[s].Installed
break
end
end
if !attName then continue end
end
local attTbl = ArcCW.AttachmentTable[attName]
if attTbl and v.PrintName and attTbl.PrintName then
local printName = ArcCW.GetTranslation("name." .. attName) or attTbl.PrintName
tData:AddDescriptionLine(ArcCW.TryTranslation(v.PrintName) .. ": " .. printName, nil, {attTbl.Icon})
end
end
end
end)
hook.Add("TTTRenderEntityInfo", "ArcCW_TTT2_Ammo", function(tData)
local client = LocalPlayer()
local ent = tData:GetEntity()
if !IsValid(client) or !client:IsTerror() or !client:Alive()
or !IsValid(ent) or tData:GetEntityDistance() > 100 or !scripted_ents.IsBasedOn(ent:GetClass(), "arccw_ammo") then
return
end
-- enable targetID rendering
tData:EnableText()
tData:EnableOutline()
tData:SetOutlineColor(client:GetRoleColor())
tData:SetTitle(ent.PrintName)
tData:SetSubtitle(ArcCW.GetTranslation("ttt.ammo") .. ent:GetNWInt("truecount", ent.AmmoCount))
end)
function ArcCW.TTT2_PopulateSettings(parent, title, tbl)
local form = vgui.CreateTTT2Form(parent, title)
for _, data in pairs(tbl) do
local name = data.text
if string.Left(name, 1) == "#" then name = string.sub(name, 2) end
if data.type == "h" or data.type == "c" then
form:MakeHelp({
label = name
})
end
local cvar = GetConVar(data.var or "")
if !cvar then continue end
local option
if data.type == "b" then
option = form:MakeCheckBox({
label = name,
default = tobool(cvar:GetDefault()),
initial = cvar:GetBool(),
OnChange = function(self, value)
ArcCW.NetworkConvar(data.var, value, self)
end,
})
option.TickCreated = UnPredictedCurTime()
elseif data.type == "i" or data.type == "f" then
option = form:MakeSlider({
label = name,
min = data.min,
max = data.max,
decimal = data.type == "i" and 0 or 2,
default = tonumber(cvar:GetDefault()),
initial = data.type == "i" and cvar:GetInt() or cvar:GetFloat(),
OnChange = function(self, value)
ArcCW.NetworkConvar(data.var, value, self)
end,
})
option.TickCreated = UnPredictedCurTime()
elseif data.type == "o" then
option = form:MakeComboBox({
label = name,
default = tonumber(cvar:GetDefault()),
initial = cvar:GetInt(),
--choices = data.choices,
OnChange = function(self, _, _, value)
ArcCW.NetworkConvar(data.var, value, self)
end,
})
option.TickCreated = UnPredictedCurTime()
for k, v in pairs(data.choices) do
option:AddChoice(v, k)
end
end
end
end
-- In almost all cases TTT2 lang names are identical to ISO 639-1; except for simplified / traditional Chinese
local ttt_langtranslate = {
["zh-cn"] = "zh_hans", -- i find it funny the original ttt's lang name for this is "simpchinese". haha simp
["zh-tw"] = "zh_tw",
}
-- This is only necessary in TTT2, where we use its interface for convars
function ArcCW.TTT2_LoadClientLangs()
if !TTT2 then return end
local files = file.Find("arccw/client/cl_languages/*", "LUA")
for _, v in pairs(files) do
local exp = string.Explode("_", string.lower(string.Replace(v, ".lua", "")))
local lang = exp[#exp]
lang = ttt_langtranslate[lang] or LANG.GetNameFromAlias(lang)
-- cannot add to languages that do not exist
if !LANG.IsLanguage(lang) then
continue
end
include("arccw/client/cl_languages/" .. v)
for phrase, str in pairs(L) do
LANG.AddToLanguage(lang, phrase, str)
end
print("Loaded ArcCW cl_language file " .. v .. " with " .. table.Count(L) .. " strings for TTT2.")
L = nil
end
end
hook.Add("PostGamemodeLoaded", "ArcCW_TTT2_Localization", ArcCW.TTT2_LoadClientLangs)

View File

@@ -0,0 +1,167 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local function DoGenericSpawnmenuRightclickMenu(self)
local clickmenu = DermaMenu()
clickmenu:AddOption("#spawnmenu.menu.copy", function()
SetClipboardText(self:GetSpawnName())
end):SetIcon("icon16/page_copy.png")
if isfunction(self.OpenMenuExtra) then
self:OpenMenuExtra(clickmenu)
end
clickmenu:Open()
end
CreateClientConVar("arccw_uc_menu", 1, true, false, "Cool menu!", 0, 1) -- extra safety cause people say it not work
hook.Add( "PopulateWeapons", "UC_AddWeaponContent", function( pnlContent, tree, node )
if !GetConVar("arccw_uc_menu"):GetBool() then return end
local AllUCWeapons = {}
local AllUCWeaponsByPack = {}
for classname, _ in pairs( weapons.GetList() ) do
local wep = weapons.Get(_.ClassName)
if wep.Spawnable and wep.Category == "ArcCW - Urban Coalition" then
AllUCWeapons[_.ClassName] = wep
end
end
for classname, weapondata in pairs( AllUCWeapons ) do
local pack = weapondata.UC_CategoryPack or "_Unknown"
if pack then
if !AllUCWeaponsByPack[pack] then AllUCWeaponsByPack[pack] = {} end
table.insert(AllUCWeaponsByPack[pack], classname)
end
end
-- PrintTable(AllUCWeapons)
-- PrintTable(AllUCWeaponsByPack)
local NodeToUse = nil
-- MW base devs, I tried to recreate this spawnmenu stuff without looking at the code for yours
-- BUT I WAS FUCKING BAWLING MY EYES OUT TRYING TO GET HOW TO DO THIS NEXT LINE
-- anyways you guys probably are not reading this so i will end it here thank you
-- ( i had the idea to do this kinda shit like. 2 days before smgs were pushed. i'm fucking crying i crode 😭😭😭 )
for _, UCNode in pairs(tree:Root():GetChildNodes()) do
if UCNode:GetText() == "ArcCW - Urban Coalition" then
NodeToUse = UCNode
break
end
end
if !NodeToUse then return end
NodeToUse.DoPopulate = function(self)
-- If we've already populated it - forget it.
if (self.PropPanel) then return end
-- Create the container panel
self.PropPanel = vgui.Create("ContentContainer", pnlContent)
self.PropPanel:SetVisible(false)
self.PropPanel:SetTriggerSpawnlistChange(false)
for pack, class in SortedPairs( AllUCWeaponsByPack ) do
local label = vgui.Create("ContentHeader", NodeToUse)
label:SetText( string.Right( pack, #pack-1 ) )
self.PropPanel:Add(label)
local alphabeticallist = {}
for _, k in pairs(class) do table.insert(alphabeticallist, {AllUCWeapons[k], PrintName = AllUCWeapons[k].PrintName}) end
for k, e in SortedPairsByMemberValue( alphabeticallist, "PrintName" ) do
local ent = e[1]
CreateUCWeapon( self.PropPanel, {
nicename = ent.PrintName or ent.ClassName,
spawnname = ent.ClassName,
material = ent.IconOverride or "entities/" .. ent.ClassName .. ".png",
admin = ent.AdminOnly,
uc_manu = ent.Trivia_Manufacturer,
uc_year = ent.Trivia_Year,
uc_cali = ent.Trivia_Calibre,
} )
end
end
end
-- InternalDoClick is called on the first child node before our function override.
-- Remove its results and regenerate our cool tab
if tree:Root():GetChildNode(0) == NodeToUse then
NodeToUse.PropPanel:Remove()
NodeToUse.PropPanel = nil
NodeToUse:InternalDoClick()
end
end )
function CreateUCWeapon(container, obj)
if !obj.material then return end
if !obj.nicename then return end
if !obj.spawnname then return end
local icon = vgui.Create("UCWepSel", container)
icon:SetContentType("weapon")
icon:SetSpawnName(obj.spawnname)
icon:SetName(obj.nicename, obj.spawnname, {
manu = obj.uc_manu,
year = obj.uc_year,
cali = obj.uc_cali
})
icon:SetMaterial(obj.material)
icon:SetAdminOnly(obj.admin)
icon:SetColor(Color(135, 206, 250, 255))
icon.DoClick = function()
RunConsoleCommand("gm_giveswep", obj.spawnname)
surface.PlaySound("ui/buttonclickrelease.wav")
end
icon.DoMiddleClick = function()
RunConsoleCommand("gm_spawnswep", obj.spawnname)
surface.PlaySound("ui/buttonclickrelease.wav")
end
icon.OpenMenuExtra = function(self, menu)
menu:AddOption("#spawnmenu.menu.spawn_with_toolgun", function()
RunConsoleCommand("gmod_tool", "creator")
RunConsoleCommand("creator_type", "3")
RunConsoleCommand("creator_name", obj.spawnname)
end):SetIcon("icon16/brick_add.png")
local opt = menu:AddOption("#spawnmenu.menu.use_as_npc_gun", function()
RunConsoleCommand("gmod_npcweapon", self:GetSpawnName())
end)
if self:GetSpawnName() == GetConVar("gmod_npcweapon"):GetString() then
opt:SetIcon("icon16/monkey_tick.png")
else
opt:SetIcon("icon16/monkey.png")
end
end
icon.OpenMenu = DoGenericSpawnmenuRightclickMenu
if IsValid(container) then
container:Add(icon)
end
return icon
end
-- fixed
-- timer.Simple(2, function()
-- ArcCW.IncompatibleAddons["2654687324"] = "Prevents Urban Decay's M16 from properly loading."
-- end)

View File

@@ -0,0 +1,23 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local function addmenu()
if !vrmod then return end
vrmod.AddInGameMenuItem("ArcCW Customize", 3, 1, function()
local wep = LocalPlayer():GetActiveWeapon()
if !IsValid(wep) or !wep.ArcCW then return end
wep:ToggleCustomizeHUD(!IsValid(ArcCW.InvHUD))
end)
end
hook.Add("VRMod_Start", "ArcCW", addmenu)

View File

@@ -0,0 +1,216 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ArcCW.IncompatibleAddons = {
-- My Hands 8.1
["847269692"] = "Causes viewmodel flickering, double viewmodel, may crash when customization menu opens",
-- My Hands 8
["1890577397"] = "Causes viewmodel flickering, double viewmodel, may crash when customization menu opens",
-- Quick Weapon Menu
["306149085"] = "Makes the customize menu mouse unable to appear.",
-- Neurotec
["541434990"] = "Neurotec is ancient, half the base is missing, and it flat-out doesn't work. Causes all sorts of problems. For the love of god, let go.",
-- Improved Combine NPCs
["476997621"] = "Causes issues with arms.",
-- Realistic Bullet Overhaul
["1588705429"] = "Causes damage calculation to not work properly.",
-- Quake/Half Life View bobbing
["378401390"] = "Causes most animations to not play properly.",
-- Thirteen's Physgun Glow
["111249028"] = "Causes LHIK animations to flicker and not work properly.",
-- Viewmodel Lagger
["1146104662"] = "Misaligns viewmodel in sights.",
-- Viewmodel Lagger (fixed)
["2566560460"] = "Misaligns viewmodel in sights.",
-- VTools
["DisplayDistancePlane"] = "Tool contains faulty hook, which has been removed to keep ArcCW functional.",
}
local t = ArcCW.GetTranslation
local function ScreenScaleMulti(input)
return ScreenScale(input) * ArcCW.ConVars["hud_size"]:GetFloat()
end
function ArcCW.MakeIncompatibleWindow(tbl)
local startTime = CurTime()
local window = vgui.Create( "DFrame" )
window:SetSize( ScrW() * 0.6, ScrH() * 0.6)
window:Center()
window:SetTitle("")
window:SetDraggable(false)
window:SetVisible(true)
window:ShowCloseButton(false)
window:MakePopup()
window.Paint = function(self, w, h)
surface.SetDrawColor(0, 0, 0, 200)
surface.DrawRect(0, 0, w, h)
end
local title = vgui.Create("DLabel", window)
title:SetSize(ScreenScaleMulti(256), ScreenScaleMulti(26))
title:Dock(TOP)
title:SetFont("ArcCW_24")
title:SetText(t("incompatible.title"))
title:DockMargin(ScreenScaleMulti(16), 0, ScreenScaleMulti(16), ScreenScaleMulti(8))
local desc = vgui.Create("DLabel", window)
desc:SetSize(ScreenScaleMulti(256), ScreenScaleMulti(12))
desc:Dock(TOP)
desc:DockMargin(ScreenScaleMulti(4), 0, ScreenScaleMulti(4), 0)
desc:SetFont("ArcCW_12")
desc:SetText(t("incompatible.line1"))
desc:SetContentAlignment(5)
local desc2 = vgui.Create("DLabel", window)
desc2:SetSize(ScreenScaleMulti(256), ScreenScaleMulti(12))
desc2:Dock(TOP)
desc2:DockMargin(ScreenScaleMulti(4), 0, ScreenScaleMulti(4), ScreenScaleMulti(4))
desc2:SetFont("ArcCW_12")
desc2:SetText(t("incompatible.line2"))
desc2:SetContentAlignment(5)
local neverAgain = vgui.Create("DButton", window)
neverAgain:SetSize(ScreenScaleMulti(256), ScreenScaleMulti(20))
neverAgain:SetText("")
neverAgain:Dock(BOTTOM)
neverAgain:DockMargin(ScreenScaleMulti(48), ScreenScaleMulti(2), ScreenScaleMulti(48), ScreenScaleMulti(2))
neverAgain.OnMousePressed = function(spaa, kc)
if CurTime() > startTime + 10 then
local simpleTbl = {}
for _, v in pairs(tbl) do simpleTbl[tostring(v.wsid)] = true end
file.Write("arccw_incompatible.txt", util.TableToJSON(simpleTbl))
window:Close()
window:Remove()
chat.AddText(Color(255,0,0),t("incompatible.never.confirm"))
end
end
neverAgain.Paint = function(spaa, w, h)
local Bfg_col = Color(255, 255, 255, 255)
local Bbg_col = Color(0, 0, 0, 200)
if CurTime() > startTime + 10 and spaa:IsHovered() then
Bbg_col = Color(255, 100, 100, 100)
Bfg_col = Color(255, 255, 255, 255)
end
surface.SetDrawColor(Bbg_col)
surface.DrawRect(0, 0, w, h)
local txt = (CurTime() > startTime + 10) and (spaa:IsHovered() and t("incompatible.never.hover") or t("incompatible.never")) or t("incompatible.wait", {time = math.ceil(startTime + 10 - CurTime())})
surface.SetTextColor(Bfg_col)
surface.SetTextPos(ScreenScaleMulti(8), ScreenScaleMulti(2))
surface.SetFont("ArcCW_12")
surface.DrawText(txt)
end
local addonList = vgui.Create("DScrollPanel", window)
addonList:SetText("")
addonList:Dock(FILL)
addonList.Paint = function(span, w, h) end
local sbar = addonList:GetVBar()
sbar.Paint = function() end
sbar.btnUp.Paint = function(span, w, h) end
sbar.btnDown.Paint = function(span, w, h) end
sbar.btnGrip.Paint = function(span, w, h)
surface.SetDrawColor(255, 255, 255, 255)
surface.DrawRect(0, 0, w, h)
end
local accept = vgui.Create("DButton", window)
accept:SetSize(ScreenScaleMulti(256), ScreenScaleMulti(20))
accept:SetText("")
accept:Dock(BOTTOM)
accept:DockMargin(ScreenScaleMulti(48), ScreenScaleMulti(2), ScreenScaleMulti(48), ScreenScaleMulti(2))
accept.OnMousePressed = function(spaa, kc)
if CurTime() > startTime + 5 then
window:Close()
window:Remove()
end
end
accept.Paint = function(spaa, w, h)
local Bfg_col = Color(255, 255, 255, 255)
local Bbg_col = Color(0, 0, 0, 200)
if CurTime() > startTime + 5 and spaa:IsHovered() then
Bbg_col = Color(255, 255, 255, 100)
Bfg_col = Color(0, 0, 0, 255)
end
surface.SetDrawColor(Bbg_col)
surface.DrawRect(0, 0, w, h)
local txt = t("incompatible.confirm") .. ((CurTime() > startTime + 5) and "" or (" - " .. t("incompatible.wait", {time = math.ceil(startTime + 5 - CurTime())})))
surface.SetTextColor(Bfg_col)
surface.SetTextPos(ScreenScaleMulti(8), ScreenScaleMulti(2))
surface.SetFont("ArcCW_12")
surface.DrawText(txt)
end
for _, addon in pairs(tbl) do
local addonBtn = vgui.Create("DButton", window)
addonBtn:SetSize(ScreenScaleMulti(256), ScreenScaleMulti(28))
addonBtn:Dock(TOP)
addonBtn:DockMargin(ScreenScaleMulti(36), ScreenScaleMulti(2), ScreenScaleMulti(36), ScreenScaleMulti(2))
addonBtn:SetFont("ArcCW_12")
addonBtn:SetText("")
addonBtn:SetContentAlignment(5)
addonBtn.Paint = function(spaa, w, h)
local Bfg_col = Color(255, 255, 255, 255)
local Bbg_col = Color(0, 0, 0, 200)
if spaa:IsHovered() then
Bbg_col = Color(255, 255, 255, 100)
Bfg_col = Color(0, 0, 0, 255)
end
surface.SetDrawColor(Bbg_col)
surface.DrawRect(0, 0, w, h)
local txt = addon.title
surface.SetTextColor(Bfg_col)
surface.SetTextPos(ScreenScaleMulti(18), ScreenScaleMulti(2))
surface.SetFont("ArcCW_12")
surface.DrawText(txt)
local txt2 = ArcCW.IncompatibleAddons[tostring(addon.wsid)]
surface.SetTextColor(Bfg_col)
surface.SetTextPos(ScreenScaleMulti(18), ScreenScaleMulti(16))
surface.SetFont("ArcCW_8")
surface.DrawText(txt2)
end
addonBtn.OnMousePressed = function(spaa, kc)
if addon.nourl then return end
gui.OpenURL("https://steamcommunity.com/sharedfiles/filedetails/?id=" .. tostring(addon.wsid))
end
end
end
hook.Add("InitPostEntity", "ArcCW_CheckContent", function()
for _, k in pairs(weapons.GetList()) do
if weapons.IsBasedOn(k.ClassName, "arccw_base") and k.ClassName != "arccw_base" then
return
end
end
chat.AddText(Color(255,255,255), "You have installed the ArcCW base but have no weapons installed. Search the workshop for some!") -- Perhaps you want to install the CS+ pack?")
--chat.AddText(Color(255,255,255), "https://steamcommunity.com/sharedfiles/filedetails/?id=2131058270")
end)

View File

@@ -0,0 +1,25 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
-- Now I stole yo shit
hook.Add( "PopulateToolMenu", "ArcCW_HLA_Options", function()
spawnmenu.AddToolMenuOption( "Options", "ArcCW", "ArcCW_HLA_Options", "HL:A", "", "", ArcCW_HLA_Options)
end )
function ArcCW_HLA_Options( CPanel )
CPanel:AddControl("Header", {Description = "Balancing options"})
CPanel:AddControl("Checkbox", {Label = "Buffs the AR1", Command = "ordinal_buff" })
CPanel:AddControl("Label", {Text = "This option require a restart to take effect."})
end