Working yet too close

This commit is contained in:
2026-02-07 16:34:43 -05:00
parent 36b6c697e3
commit ada75f8479
2 changed files with 35 additions and 34 deletions

View File

@@ -126,23 +126,6 @@ function TowBarMod.UI.addUnhookOptionToMenu(playerObj, vehicle)
)
end
function TowBarMod.UI.addDriverReattachOptionToMenu(playerObj, towingVehicle)
local menu = getPlayerRadialMenu(playerObj:getPlayerNum())
if menu == nil then return end
if not towingVehicle then return end
if not towingVehicle:isDriver(playerObj) then return end
if not towingVehicle:getVehicleTowing() then return end
if not towingVehicle:getModData()["isTowingByTowBar"] then return end
menu:addSlice(
"Reattach Towbar (Debug)",
getTexture("media/textures/tow_bar_attach.png"),
TowBarMod.Hook.reattachTowBarFromDriverSeat,
playerObj,
towingVehicle
)
end
---------------------------------------------------------------------------
--- Mod compability
---------------------------------------------------------------------------
@@ -163,17 +146,9 @@ end
function ISVehicleMenu.showRadialMenu(playerObj)
TowBarMod.UI.defaultShowRadialMenu(playerObj)
local vehicle = playerObj:getVehicle()
if vehicle then
if vehicle:isDriver(playerObj) and vehicle:getVehicleTowing() and vehicle:getModData()["isTowingByTowBar"] then
TowBarMod.UI.removeDefaultDetachOption(playerObj)
TowBarMod.UI.addUnhookOptionToMenu(playerObj, vehicle)
TowBarMod.UI.addDriverReattachOptionToMenu(playerObj, vehicle)
end
return
end
if playerObj:getVehicle() then return end
vehicle = ISVehicleMenu.getVehicleToInteractWith(playerObj)
local vehicle = ISVehicleMenu.getVehicleToInteractWith(playerObj)
if vehicle == nil then return end
if vehicle:getModData()["isTowingByTowBar"] then