add GGS Support

This commit is contained in:
2026-02-16 00:33:14 -05:00
parent 53b0b4317d
commit 06593805a7
10 changed files with 686 additions and 87 deletions

View File

@@ -3,7 +3,7 @@ id=hrsys_opinionated_firearms_testing
author=Riggs0
modversion=1.0.0
versionMin=42.12.13
require=\guns93,\2788256295/ammomaker,\HBVCEFb42
require=\2788256295/ammomaker,\HBVCEFb42
description=Opinionated Firearms casing and other changes to Guns of 93, Ammomaker and Hot Brass
icon=icon.png
poster=preview.png

View File

@@ -18,6 +18,15 @@ local GUNS93_MOD_IDS = {
"\\guns93",
}
local function isSortingToggleEnabled()
local vars = SandboxVars and SandboxVars.OpinionatedFirearms
if vars and vars.AddSorting ~= nil then
return vars.AddSorting == true
end
return true
end
local function getActivatedModsList()
if type(getActivatedMods) ~= "function" then
return nil
@@ -66,6 +75,11 @@ local function installApplyModsWrapper()
return true
end
if not isSortingToggleEnabled() then
OFBCGuns93ModPackInjector.installed = true
return true
end
local bcState = isBetterContainersActive()
if bcState == false then
OFBCGuns93ModPackInjector.installed = true

View File

@@ -0,0 +1,97 @@
local OFGGSCasingDisablePatch = {
patched = false,
hasDebugStackInfo = type(debug) == "table" and type(debug.getinfo) == "function",
}
local BLOCKED_GGS_CASING_TYPES = {
["Base.pistol_casing"] = true,
["Base.revolver_casing"] = true,
["Base.rifle_casing"] = true,
["Base.shells_casing"] = true,
}
local function isGgsShellEmitterCall()
if not OFGGSCasingDisablePatch.hasDebugStackInfo then
return false
end
for stackLevel = 3, 10 do
local info = debug.getinfo(stackLevel, "S")
if not info then
break
end
local source = info.source
if type(source) == "string" and string.find(source, "GGS_ShellCasingEmitter.lua", 1, true) then
return true
end
end
return false
end
local function isPatchToggleEnabled()
local vars = SandboxVars and SandboxVars.OpinionatedFirearms
if vars and vars.HandleHotBrassCasingSpawnUseAmmoMaker ~= nil then
return vars.HandleHotBrassCasingSpawnUseAmmoMaker == true
end
-- Backward compatibility for existing worlds.
if vars and vars.HBVCEFAmmoMakerPatch ~= nil then
return vars.HBVCEFAmmoMakerPatch == true
end
return true
end
local function applyPatch()
if OFGGSCasingDisablePatch.patched then
return true
end
if not isPatchToggleEnabled() then
OFGGSCasingDisablePatch.patched = true
return true
end
if type(__classmetatables) ~= "table" then
return false
end
if not zombie or not zombie.iso or not zombie.iso.IsoGridSquare or not zombie.iso.IsoGridSquare.class then
return false
end
local squareMetatable = __classmetatables[zombie.iso.IsoGridSquare.class]
if not squareMetatable or type(squareMetatable.__index) ~= "table" then
return false
end
local originalAddWorldInventoryItem = squareMetatable.__index.AddWorldInventoryItem
if type(originalAddWorldInventoryItem) ~= "function" then
return false
end
squareMetatable.__index.AddWorldInventoryItem = function(square, itemType, ...)
if BLOCKED_GGS_CASING_TYPES[itemType] and
(not OFGGSCasingDisablePatch.hasDebugStackInfo or isGgsShellEmitterCall())
then
return nil
end
return originalAddWorldInventoryItem(square, itemType, ...)
end
OFGGSCasingDisablePatch.patched = true
return true
end
local function tryPatchOnTick()
if applyPatch() then
Events.OnTick.Remove(tryPatchOnTick)
end
end
if not applyPatch() then
Events.OnTick.Add(tryPatchOnTick)
end

View File

@@ -2,8 +2,24 @@ local OFHotBrassPatch = {
patched = false,
}
local AMMO_TYPE_ALIAS_BY_ITEM = {
["Base.9x39Bullets"] = "9x39",
["Base.Bullets22LR"] = "22LR",
["Base.Bullets50Magnum"] = "50AE",
["Base.762x54rBullets"] = "762x54R",
["Base.792x57Bullets"] = "792x57Maus",
-- Common spelling variants seen in third-party weapon scripts.
["Base.308Bulets"] = "308Win",
["Base.762x54rBulets"] = "762x54R",
}
local function isPatchToggleEnabled()
local vars = SandboxVars and SandboxVars.OpinionatedFirearms
if vars and vars.HandleHotBrassCasingSpawnUseAmmoMaker ~= nil then
return vars.HandleHotBrassCasingSpawnUseAmmoMaker == true
end
-- Backward compatibility for existing worlds.
if vars and vars.HBVCEFAmmoMakerPatch ~= nil then
return vars.HBVCEFAmmoMakerPatch == true
end
@@ -15,26 +31,49 @@ local function isSessionEligible()
return isPatchToggleEnabled()
end
local function getAmmoMakerFiredCasing(ammoType)
local function getAmmoMakerFiredFromAmmoDataKey(ammoDataKey)
if type(ammoDataKey) ~= "string" or ammoDataKey == "" then
return nil
end
if type(ammoMakerAmmoData) ~= "table" or type(ammoMakerAmmoParts) ~= "table" then
return nil
end
local ammoData = ammoMakerAmmoData[ammoDataKey]
if type(ammoData) ~= "table" then
return nil
end
local casingType = ammoData.casingType
if type(casingType) ~= "string" or casingType == "" then
return nil
end
local partData = ammoMakerAmmoParts[casingType]
if type(partData) ~= "table" then
return nil
end
local firedType = partData.partFired or partData.partOld
if type(firedType) ~= "string" or firedType == "" then
return nil
end
return firedType
end
local function getAmmoMakerFiredFromItemKey(ammoType)
if type(ammoType) ~= "string" or ammoType == "" then
return nil
end
local function getAmmoTypeData()
if type(ammoMakerAmmoTypes) ~= "table" then
return nil
end
local data = ammoMakerAmmoTypes[ammoType]
if type(data) ~= "table" or type(data.ammoTypes) ~= "table" or #data.ammoTypes == 0 then
return nil
end
return data
end
local function getActiveAmmoData(typeData)
if type(typeData) ~= "table" or type(typeData.ammoTypes) ~= "table" or type(ammoMakerAmmoData) ~= "table" then
local typeData = ammoMakerAmmoTypes[ammoType]
if type(typeData) ~= "table" or type(typeData.ammoTypes) ~= "table" or #typeData.ammoTypes == 0 then
return nil
end
@@ -53,53 +92,61 @@ local function getAmmoMakerFiredCasing(ammoType)
end
local activeAmmoKey = typeData.ammoTypes[activeIndex]
if type(activeAmmoKey) == "string" then
local activeAmmoData = ammoMakerAmmoData[activeAmmoKey]
if type(activeAmmoData) == "table" then
return activeAmmoData
end
local activeFiredType = getAmmoMakerFiredFromAmmoDataKey(activeAmmoKey)
if activeFiredType then
return activeFiredType
end
for i = 1, #typeData.ammoTypes do
local ammoKey = typeData.ammoTypes[i]
if type(ammoKey) == "string" then
local ammoData = ammoMakerAmmoData[ammoKey]
if type(ammoData) == "table" then
return ammoData
end
local fallbackFiredType = getAmmoMakerFiredFromAmmoDataKey(typeData.ammoTypes[i])
if fallbackFiredType then
return fallbackFiredType
end
end
return nil
end
local function partDataToFiredType(partData)
if type(partData) ~= "table" then
local function getAmmoMakerFiredCasing(ammoType)
if type(ammoType) ~= "string" or ammoType == "" then
return nil
end
local firedType = partData.partFired or partData.partOld
if type(firedType) ~= "string" or firedType == "" then
return nil
local directFiredType = getAmmoMakerFiredFromItemKey(ammoType)
if directFiredType then
return directFiredType
end
return firedType
local aliasAmmoDataKey = AMMO_TYPE_ALIAS_BY_ITEM[ammoType]
if aliasAmmoDataKey then
local aliasFiredType = getAmmoMakerFiredFromAmmoDataKey(aliasAmmoDataKey)
if aliasFiredType then
return aliasFiredType
end
end
if type(ammoMakerAmmoParts) ~= "table" then
return nil
local lowerAmmoType = string.lower(ammoType)
for aliasItemType, ammoDataKey in pairs(AMMO_TYPE_ALIAS_BY_ITEM) do
if string.lower(aliasItemType) == lowerAmmoType then
local aliasFiredType = getAmmoMakerFiredFromAmmoDataKey(ammoDataKey)
if aliasFiredType then
return aliasFiredType
end
end
end
local ammoTypeData = getAmmoTypeData()
if not ammoTypeData then
return nil
if type(ammoMakerAmmoTypes) == "table" then
for itemType, typeData in pairs(ammoMakerAmmoTypes) do
if type(itemType) == "string" and string.lower(itemType) == lowerAmmoType then
if type(typeData) == "table" and type(typeData.ammoTypes) == "table" then
for i = 1, #typeData.ammoTypes do
local fallbackFiredType = getAmmoMakerFiredFromAmmoDataKey(typeData.ammoTypes[i])
if fallbackFiredType then
return fallbackFiredType
end
end
end
end
local ammoData = getActiveAmmoData(ammoTypeData)
if type(ammoData) == "table" and type(ammoData.casingType) == "string" then
local firedType = partDataToFiredType(ammoMakerAmmoParts[ammoData.casingType])
if firedType then
return firedType
end
end
@@ -141,7 +188,8 @@ local function applyPatch()
SpentCasingPhysics.doSpawnCasing = function(player, weapon, params, racking, optionalItem)
if not optionalItem and weapon and weapon.getAmmoType then
local ammoType = weapon:getAmmoType()
local ammoTypeObj = weapon:getAmmoType()
local ammoType = ammoTypeObj and ammoTypeObj.getItemKey and ammoTypeObj:getItemKey() or ammoTypeObj
if ammoType then
local mappedType = getAmmoMakerFiredCasing(tostring(ammoType))
if mappedType then

View File

@@ -6,6 +6,11 @@ local BLOCKED_AMMOMAKER_COMMANDS = {
local function isPatchToggleEnabled()
local vars = SandboxVars and SandboxVars.OpinionatedFirearms
if vars and vars.HandleHotBrassCasingSpawnUseAmmoMaker ~= nil then
return vars.HandleHotBrassCasingSpawnUseAmmoMaker == true
end
-- Backward compatibility for existing worlds.
if vars and vars.HBVCEFAmmoMakerPatch ~= nil then
return vars.HBVCEFAmmoMakerPatch == true
end

View File

@@ -6,6 +6,15 @@ local OFAmmoMakerDisplayCategoryPatch = {
local SPENT_CASINGS_CATEGORY = "OFSpentCasings"
local AMMO_PART_CATEGORY = "OFAmmoPart"
local function isSortingToggleEnabled()
local vars = SandboxVars and SandboxVars.OpinionatedFirearms
if vars and vars.AddSorting ~= nil then
return vars.AddSorting == true
end
return true
end
local function addAmmoMakerType(typeSet, fullType)
if type(fullType) ~= "string" or fullType == "" then
return
@@ -77,6 +86,11 @@ local function applyPatch()
return true
end
if not isSortingToggleEnabled() then
OFAmmoMakerDisplayCategoryPatch.patched = true
return true
end
local scriptManager = ScriptManager and ScriptManager.instance
if not scriptManager or type(scriptManager.FindItem) ~= "function" then
return false

View File

@@ -9,11 +9,22 @@ local BC_MAGAZINE_CATEGORY = "WepAmmoMag"
local GUNS93_SENTINEL_FIREARM = "Base.83Cheetah"
local GUNS93_SENTINEL_MAGAZINE = "Base.83Mag"
local GAEL_GUNSTORE_SENTINEL_FIREARM = "Base.A91"
local GAEL_GUNSTORE_SENTINEL_MAGAZINE = "Base.545x39Clip30"
local function resolveWeaponCategories()
return BC_FIREARM_CATEGORY, BC_MAGAZINE_CATEGORY
end
local function isSortingToggleEnabled()
local vars = SandboxVars and SandboxVars.OpinionatedFirearms
if vars and vars.AddSorting ~= nil then
return vars.AddSorting == true
end
return true
end
local GUNS93_FIREARMS = {
["Base.83Cheetah"] = true,
["Base.AKM"] = true,
@@ -378,6 +389,381 @@ local GUNS93_MAGAZINES = {
["Base.Win69AMag"] = true,
}
local GAEL_GUNSTORE_FIREARMS = {
["Base.A2000"] = true,
["Base.A91"] = true,
["Base.AA12"] = true,
["Base.ACE21"] = true,
["Base.ACE23"] = true,
["Base.ACE52_CQB"] = true,
["Base.ACE53"] = true,
["Base.ACR"] = true,
["Base.ADS"] = true,
["Base.AEK"] = true,
["Base.AEK919"] = true,
["Base.AK_minidrako"] = true,
["Base.AK101"] = true,
["Base.AK103"] = true,
["Base.AK12"] = true,
["Base.AK19"] = true,
["Base.AK47"] = true,
["Base.AK5C"] = true,
["Base.AK74"] = true,
["Base.AK74u"] = true,
["Base.AK74u_long"] = true,
["Base.AK9"] = true,
["Base.AKM"] = true,
["Base.AKU12"] = true,
["Base.AMD65"] = true,
["Base.AN94"] = true,
["Base.Anaconda"] = true,
["Base.APC9K"] = true,
["Base.AR10"] = true,
["Base.AR15"] = true,
["Base.AR160"] = true,
["Base.AR6951"] = true,
["Base.ASH_12"] = true,
["Base.AssaultRifle"] = true,
["Base.AssaultRifle2"] = true,
["Base.AUG_9mm"] = true,
["Base.AUG_A1"] = true,
["Base.AUG_A2"] = true,
["Base.Automag357"] = true,
["Base.Automag44"] = true,
["Base.Automag50AE"] = true,
["Base.AWS"] = true,
["Base.BAR"] = true,
["Base.Becker_Shotgun"] = true,
["Base.Becker_Shotgun_Short"] = true,
["Base.BenelliM4"] = true,
["Base.Beretta_A400"] = true,
["Base.Beretta_A400_Short"] = true,
["Base.Beretta_PX4"] = true,
["Base.Browning_Auto"] = true,
["Base.Browning_Auto_Short"] = true,
["Base.BrowningHP"] = true,
["Base.Carcano"] = true,
["Base.CBJ"] = true,
["Base.CETME"] = true,
["Base.CircuitJudgeRifle"] = true,
["Base.Colt9mm"] = true,
["Base.ColtNavy1851"] = true,
["Base.ColtNavyExorcist"] = true,
["Base.ColtPeacemaker1873"] = true,
["Base.Coonan357"] = true,
["Base.CS5"] = true,
["Base.CZ75"] = true,
["Base.CZ805"] = true,
["Base.CZScorpion"] = true,
["Base.DB_Condor"] = true,
["Base.DB_Condor_sawn"] = true,
["Base.DDM4"] = true,
["Base.Deagle357_gold"] = true,
["Base.Deagle50AE"] = true,
["Base.DeagleCar14"] = true,
["Base.DeLisle"] = true,
["Base.DoubleBarrelShotgun"] = true,
["Base.DoubleBarrelShotgunSawnoff"] = true,
["Base.DVB15"] = true,
["Base.ENARM_Pentagun"] = true,
["Base.Enfield"] = true,
["Base.FAL"] = true,
["Base.FAL_CQB"] = true,
["Base.FAMAS"] = true,
["Base.FiveSeven"] = true,
["Base.FN2000"] = true,
["Base.FN502_22LR"] = true,
["Base.FNX45"] = true,
["Base.G17"] = true,
["Base.G18"] = true,
["Base.G2"] = true,
["Base.G27"] = true,
["Base.G36C"] = true,
["Base.G3A3"] = true,
["Base.G43"] = true,
["Base.Galil"] = true,
["Base.Glock_tactical"] = true,
["Base.Glock23"] = true,
["Base.Glock43"] = true,
["Base.GOL"] = true,
["Base.Grizzly50AE"] = true,
["Base.Groza"] = true,
["Base.GSH18"] = true,
["Base.HK_121"] = true,
["Base.HK416"] = true,
["Base.HKG28"] = true,
["Base.HKMK23"] = true,
["Base.HoneyBadger"] = true,
["Base.HuntingRifle"] = true,
["Base.IA2"] = true,
["Base.IA2_308"] = true,
["Base.Jackhammer"] = true,
["Base.Jericho941"] = true,
["Base.JNG90"] = true,
["Base.K2"] = true,
["Base.K7"] = true,
["Base.KAC_PDW"] = true,
["Base.Kark98"] = true,
["Base.Kimber1911"] = true,
["Base.Kriss9mm"] = true,
["Base.KrissVector45"] = true,
["Base.KS23"] = true,
["Base.KSG"] = true,
["Base.L115A"] = true,
["Base.L85"] = true,
["Base.L86"] = true,
["Base.L96"] = true,
["Base.LanchesterMK1"] = true,
["Base.Lewis"] = true,
["Base.LR300"] = true,
["Base.LSAT"] = true,
["Base.LVOA"] = true,
["Base.M1"] = true,
["Base.M110"] = true,
["Base.M16A2"] = true,
["Base.M1887"] = true,
["Base.M1887_Short"] = true,
["Base.M1A1"] = true,
["Base.M200"] = true,
["Base.M21"] = true,
["Base.M24"] = true,
["Base.M240B"] = true,
["Base.M249"] = true,
["Base.M39"] = true,
["Base.M4"] = true,
["Base.M40"] = true,
["Base.M60E4"] = true,
["Base.M620"] = true,
["Base.M82A3"] = true,
["Base.M9_Samurai"] = true,
["Base.M93R"] = true,
["Base.M98B"] = true,
["Base.MAB38A"] = true,
["Base.MAC10"] = true,
["Base.MAS36"] = true,
["Base.MAT49"] = true,
["Base.MatebaGrifone"] = true,
["Base.MG131"] = true,
["Base.MG4"] = true,
["Base.MG42"] = true,
["Base.MG710"] = true,
["Base.Micro_UZI"] = true,
["Base.Mini_14"] = true,
["Base.Minimi"] = true,
["Base.MK18"] = true,
["Base.Mosin"] = true,
["Base.Mossber500"] = true,
["Base.Mossber590"] = true,
["Base.MP_R8"] = true,
["Base.MP18"] = true,
["Base.MP1911"] = true,
["Base.MP40"] = true,
["Base.MP5"] = true,
["Base.MP5K"] = true,
["Base.MP5SD"] = true,
["Base.MP7"] = true,
["Base.MP9"] = true,
["Base.MPX"] = true,
["Base.MSST"] = true,
["Base.MTAR"] = true,
["Base.MTS_255"] = true,
["Base.MTS_255_Short"] = true,
["Base.MX4"] = true,
["Base.Nagant_M1895"] = true,
["Base.Negev"] = true,
["Base.OTS_33"] = true,
["Base.P220"] = true,
["Base.P220_Elite"] = true,
["Base.P228"] = true,
["Base.P38"] = true,
["Base.P90"] = true,
["Base.P99"] = true,
["Base.P99_Kilin"] = true,
["Base.PB6P9"] = true,
["Base.Pistol"] = true,
["Base.pistol_shotgun"] = true,
["Base.Pistol2"] = true,
["Base.Pistol3"] = true,
["Base.PKP"] = true,
["Base.PP_Bizon"] = true,
["Base.PP2000"] = true,
["Base.PP93"] = true,
["Base.PPSH41"] = true,
["Base.Python357"] = true,
["Base.QBA"] = true,
["Base.QBB95"] = true,
["Base.QBS09"] = true,
["Base.QBS09_Short"] = true,
["Base.QBZ951"] = true,
["Base.R5"] = true,
["Base.Remington1100"] = true,
["Base.Remington1100_Short"] = true,
["Base.Remington121"] = true,
["Base.Remington870"] = true,
["Base.Remington870_Short"] = true,
["Base.Revolver"] = true,
["Base.Revolver_long"] = true,
["Base.Revolver_short"] = true,
["Base.Revolver38"] = true,
["Base.Revolver666"] = true,
["Base.Rhino20DS"] = true,
["Base.RMB93"] = true,
["Base.RPD"] = true,
["Base.RPK"] = true,
["Base.RPK12"] = true,
["Base.RPK16"] = true,
["Base.RSH12"] = true,
["Base.Ruger10_22"] = true,
["Base.Ruger357"] = true,
["Base.RugerLC"] = true,
["Base.SA58"] = true,
["Base.Saiga12"] = true,
["Base.Saiga9mm"] = true,
["Base.Samurai_aw"] = true,
["Base.Samurai_kendo"] = true,
["Base.SAR21"] = true,
["Base.ScarH"] = true,
["Base.ScarL"] = true,
["Base.Schofield1875"] = true,
["Base.Scout_elite"] = true,
["Base.ScrapRevolver"] = true,
["Base.Shorty"] = true,
["Base.Shotgun"] = true,
["Base.ShotgunSawnoff"] = true,
["Base.SIG_553"] = true,
["Base.SIG516"] = true,
["Base.Silenced_Sten"] = true,
["Base.Sjorgen"] = true,
["Base.Sjorgen_Short"] = true,
["Base.SKS"] = true,
["Base.SKS_carbine"] = true,
["Base.SKS_carbine_short"] = true,
["Base.Snub22LR"] = true,
["Base.SPAS12"] = true,
["Base.SPAS15"] = true,
["Base.Springfield_sniper"] = true,
["Base.SR1M"] = true,
["Base.SR338"] = true,
["Base.SR3M"] = true,
["Base.SR47"] = true,
["Base.SS2V5"] = true,
["Base.Sten_MK5"] = true,
["Base.Striker"] = true,
["Base.SV98"] = true,
["Base.SVD"] = true,
["Base.SVD_short"] = true,
["Base.SVD12"] = true,
["Base.SVDK"] = true,
["Base.SVDK_short"] = true,
["Base.SVT_40"] = true,
["Base.SVU"] = true,
["Base.SW1905"] = true,
["Base.SW1917"] = true,
["Base.SW500"] = true,
["Base.SW629"] = true,
["Base.SWM1854"] = true,
["Base.SWM1894"] = true,
["Base.SWM3"] = true,
["Base.SWM327"] = true,
["Base.SWM629_Deluxe"] = true,
["Base.SWMP_12"] = true,
["Base.Taurus_raging_bull"] = true,
["Base.Taurus_raging_bull460"] = true,
["Base.Taurus_RT85"] = true,
["Base.Taurus606"] = true,
["Base.TEC9"] = true,
["Base.Thompson"] = true,
["Base.TMP"] = true,
["Base.Type81"] = true,
["Base.Type88"] = true,
["Base.UMP45"] = true,
["Base.UMP45_long"] = true,
["Base.USAS12"] = true,
["Base.USP45"] = true,
["Base.UZI"] = true,
["Base.V_M87"] = true,
["Base.ValmetM82"] = true,
["Base.VarmintRifle"] = true,
["Base.VEPR"] = true,
["Base.Veresk"] = true,
["Base.VictorySW22"] = true,
["Base.VP70"] = true,
["Base.VR80"] = true,
["Base.VSK"] = true,
["Base.VSS"] = true,
["Base.VSS_Tactical"] = true,
["Base.VSSK"] = true,
["Base.VZ58"] = true,
["Base.VZ61"] = true,
["Base.WA2000"] = true,
["Base.Webley_MK_snub"] = true,
["Base.Webley_Revolver"] = true,
["Base.Wieger940"] = true,
["Base.Wildey"] = true,
["Base.Winchester1886"] = true,
["Base.Winchester1895"] = true,
["Base.Winchester1897"] = true,
["Base.X86"] = true,
["Base.XD"] = true,
["Base.XM8"] = true,
}
local GAEL_GUNSTORE_MAGAZINES = {
["Base.12GClip"] = true,
["Base.12GClip14"] = true,
["Base.12GDrum24"] = true,
["Base.22LRClip"] = true,
["Base.22LRClip50"] = true,
["Base.22LRDrum100"] = true,
["Base.308Box150"] = true,
["Base.308Clip"] = true,
["Base.308Clip40"] = true,
["Base.308Drum100"] = true,
["Base.308Drum60"] = true,
["Base.357Clip"] = true,
["Base.357Drum45"] = true,
["Base.44Clip"] = true,
["Base.44Clip20"] = true,
["Base.44Drum50"] = true,
["Base.45Clip"] = true,
["Base.45Clip25"] = true,
["Base.45Drum100"] = true,
["Base.45Drum50"] = true,
["Base.50Clip"] = true,
["Base.50Clip18"] = true,
["Base.50MagnumClip"] = true,
["Base.50MagnumClip18"] = true,
["Base.50MagnumDrum40"] = true,
["Base.545x39Clip30"] = true,
["Base.545x39Clip60"] = true,
["Base.545x39Drum100"] = true,
["Base.556Box150"] = true,
["Base.556Clip"] = true,
["Base.556Drum_100rnd"] = true,
["Base.556Drum_60rnd"] = true,
["Base.762x39Clip"] = true,
["Base.762x39Clip45"] = true,
["Base.762x39Drum100"] = true,
["Base.762x39Drum73"] = true,
["Base.762x54rBox150"] = true,
["Base.762x54rClip"] = true,
["Base.762x54rClip40"] = true,
["Base.792x57Box75"] = true,
["Base.792x57Box97"] = true,
["Base.792x57Clip"] = true,
["Base.792x57Clip40"] = true,
["Base.9mmClip"] = true,
["Base.9mmClip30"] = true,
["Base.9mmDrum100"] = true,
["Base.9mmDrum50"] = true,
["Base.9mmDrum75"] = true,
["Base.9x39Clip"] = true,
["Base.9x39Clip40"] = true,
["Base.9x39Drum60"] = true,
["Base.BizonClip64"] = true,
}
local function setDisplayCategory(scriptManager, fullType, category)
local scriptItem = scriptManager:FindItem(fullType)
if not scriptItem then
@@ -397,14 +783,20 @@ local function setDisplayCategory(scriptManager, fullType, category)
return false
end
local function areGuns93ItemsReady(scriptManager)
local function areSupportedItemsReady(scriptManager)
if not scriptManager then
return false
end
local firearm = scriptManager:FindItem(GUNS93_SENTINEL_FIREARM)
local magazine = scriptManager:FindItem(GUNS93_SENTINEL_MAGAZINE)
return firearm ~= nil and magazine ~= nil
local guns93Firearm = scriptManager:FindItem(GUNS93_SENTINEL_FIREARM)
local guns93Magazine = scriptManager:FindItem(GUNS93_SENTINEL_MAGAZINE)
local guns93Ready = guns93Firearm ~= nil and guns93Magazine ~= nil
local gaelFirearm = scriptManager:FindItem(GAEL_GUNSTORE_SENTINEL_FIREARM)
local gaelMagazine = scriptManager:FindItem(GAEL_GUNSTORE_SENTINEL_MAGAZINE)
local gaelReady = gaelFirearm ~= nil and gaelMagazine ~= nil
return guns93Ready or gaelReady
end
local function applyPatch()
@@ -412,6 +804,11 @@ local function applyPatch()
return true
end
if not isSortingToggleEnabled() then
OFGuns93DisplayCategoryPatch.patched = true
return true
end
local scriptManager = ScriptManager and ScriptManager.instance
if not scriptManager or type(scriptManager.FindItem) ~= "function" then
return false
@@ -419,7 +816,7 @@ local function applyPatch()
local firearmCategory, magazineCategory = resolveWeaponCategories()
if not areGuns93ItemsReady(scriptManager) then
if not areSupportedItemsReady(scriptManager) then
return false
end
@@ -436,6 +833,18 @@ local function applyPatch()
end
end
for fullType in pairs(GAEL_GUNSTORE_FIREARMS) do
if setDisplayCategory(scriptManager, fullType, firearmCategory) then
patchedCount = patchedCount + 1
end
end
for fullType in pairs(GAEL_GUNSTORE_MAGAZINES) do
if setDisplayCategory(scriptManager, fullType, magazineCategory) then
patchedCount = patchedCount + 1
end
end
if patchedCount == 0 then
return false
end
@@ -508,3 +917,4 @@ if Events.OnMainMenuEnter and type(Events.OnMainMenuEnter.Add) == "function" the
end
tryInstallBetterContainersRepatchHook()

View File

@@ -1,3 +1,7 @@
Sandbox_EN = {
Sandbox_OpinionatedFirearms = "Opinionated Firearms",
Sandbox_HBVCEFAmmoMakerPatch = "Hot Brass -> Ammo Maker Casings",
Sandbox_HBVCEFAmmoMakerPatch_tooltip = "When enabled, Hot Brass ejects Ammo Maker fired casings with Guns93 and will not eject Guns93 casing.",
Sandbox_HandleHotBrassCasingSpawnUseAmmoMaker = "Handle Hot Brass Casing Spawn - Use Ammomaker",
Sandbox_HandleHotBrassCasingSpawnUseAmmoMaker_tooltip = "When enabled, Hot Brass ejects Ammo Maker empties for supported ammo (including Guns93 and Gael Gun Store) instead of default casings.",
Sandbox_AddSorting = "Add Sorting",
Sandbox_AddSorting_tooltip = "When enabled, apply Opinionated Firearms sorting/display categories for supported weapons, magazines, and ammo parts.",
}

View File

@@ -1,7 +1,14 @@
VERSION = 1,
option OpinionatedFirearms.HBVCEFAmmoMakerPatch {
option OpinionatedFirearms.HandleHotBrassCasingSpawnUseAmmoMaker {
type = boolean,
default = true,
page = OpinionatedFirearms,
translation = HBVCEFAmmoMakerPatch,
translation = HandleHotBrassCasingSpawnUseAmmoMaker,
}
option OpinionatedFirearms.AddSorting {
type = boolean,
default = true,
page = OpinionatedFirearms,
translation = AddSorting,
}

View File

@@ -3,7 +3,7 @@ id=hrsys_opinionated_firearms
author=Riggs0
modversion=1.0.0
versionMin=42.12.13
require=\guns93,\2788256295/ammomaker,\HBVCEFb42
require=\2788256295/ammomaker,\HBVCEFb42
description=Opinionated Firearms casing and other changes to Guns of 93, Ammomaker and Hot Brass
icon=icon.png
poster=preview.png