Working MP
This commit is contained in:
@@ -126,6 +126,23 @@ 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
|
||||
---------------------------------------------------------------------------
|
||||
@@ -146,9 +163,17 @@ end
|
||||
function ISVehicleMenu.showRadialMenu(playerObj)
|
||||
TowBarMod.UI.defaultShowRadialMenu(playerObj)
|
||||
|
||||
if playerObj:getVehicle() then return end
|
||||
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
|
||||
|
||||
local vehicle = ISVehicleMenu.getVehicleToInteractWith(playerObj)
|
||||
vehicle = ISVehicleMenu.getVehicleToInteractWith(playerObj)
|
||||
if vehicle == nil then return end
|
||||
|
||||
if vehicle:getModData()["isTowingByTowBar"] then
|
||||
|
||||
Reference in New Issue
Block a user