Better Compat For MP

This commit is contained in:
Starystars67 committed 2020-05-19 03:01:28 +01:00
1 parent 597b11e023
commit b9ac5b1809
2 files changed
+21 -18

No files matched your search

+19 -16
View File
@@ -206,19 +206,21 @@ local function onUpdate()
debugDrawer:drawTextAdvanced(be:getObject(0):getPosition(), String(" "..tostring(be:getObject(0):getPosition())), ColorF(194/255, 55/255, 55/255, 255/255), true, false, ColorI(0,0,0,127)) debugDrawer:drawTextAdvanced(be:getObject(0):getPosition(), String(" "..tostring(be:getObject(0):getPosition())), ColorF(194/255, 55/255, 55/255, 255/255), true, false, ColorI(0,0,0,127))
end end
map = getMissionFilename() map = getMissionFilename()
for k = 1, #stations[map] do if string.match(map, "info.json") or string.match(map, "level.json") then
--print("Using Map: "..tostring(stations[map][k][3])) for k = 1, #stations[map] do
local color = 0 --print("Using Map: "..tostring(stations[map][k][3]))
if stations[map][k][3] == "EV" then local color = 0
color = ColorF(0.1,0.9,0.1,0.5) if stations[map][k][3] == "EV" then
elseif stations[map][k][3] == "Gas/EV" then color = ColorF(0.1,0.9,0.1,0.5)
color = ColorF(0.1,0.8,1.0,0.5) elseif stations[map][k][3] == "Gas/EV" then
else color = ColorF(0.1,0.8,1.0,0.5)
color = ColorF(0.9,0.1,0.1,0.5) else
end color = ColorF(0.9,0.1,0.1,0.5)
debugDrawer:drawCylinder(stations[map][k][1]:toPoint3F(), stations[map][k][2]:toPoint3F(), 1, color) end
for i = 0, be:getObjectCount() -1 do -- For each vehicle debugDrawer:drawCylinder(stations[map][k][1]:toPoint3F(), stations[map][k][2]:toPoint3F(), 1, color)
local veh = be:getObject(i) -- Get vehicle --for i = 0, be:getObjectCount() -1 do -- For each vehicle
--local veh = be:getObject(i) -- Get vehicle
local veh = be:getObjectByID(cVeh)
if IsEntityInsideArea(veh:getPosition(), stations[map][k][1]) then if IsEntityInsideArea(veh:getPosition(), stations[map][k][1]) then
if stations[map][k][3] == "Gas/EV" or stations[map][k][3] == fuelType then if stations[map][k][3] == "Gas/EV" or stations[map][k][3] == fuelType then
-- we are inside one of the filling areas of the map -- we are inside one of the filling areas of the map
@@ -228,10 +230,11 @@ local function onUpdate()
break break
end end
end end
--end
end
if not atStation then -- We are not in a spot for filling then we should force the UI to be hidden
be:executeJS('fuelUIShowHide("false")')
end end
end
if not atStation then -- We are not in a spot for filling then we should force the UI to be hidden
be:executeJS('fuelUIShowHide("false")')
end end
end end
+2 -2
View File
@@ -1,6 +1,6 @@
<div ng-controller="fuelstation" id="fuelstation" class="fuelstation" ng-style="{'width': '100%', 'height': '100%'}" ng-init="init()" style="display: none"> <div ng-controller="fuelstation" id="fuelstation" class="fuelstation" ng-style="{'width': '100%', 'height': '100%'}" ng-init="init()" style="display: none">
<style id="applicationStylesheet" type="text/css"> <style id="applicationStylesheet" type="text/css">
.Background { .FuelBackground {
position: absolute; position: absolute;
overflow: visible; overflow: visible;
width: 470px; width: 470px;
@@ -73,7 +73,7 @@
font-size: 30px; font-size: 30px;
} }
</style> </style>
<svg class="Background"> <svg class="FuelBackground">
<rect fill="rgba(113,113,113,1)" stroke="rgba(255,255,255,1)" stroke-width="1px" stroke-linejoin="miter" stroke-linecap="butt" stroke-miterlimit="4" shape-rendering="auto" id="Background" rx="26" ry="26" x="0" y="0" width="470" height="309"> <rect fill="rgba(113,113,113,1)" stroke="rgba(255,255,255,1)" stroke-width="1px" stroke-linejoin="miter" stroke-linecap="butt" stroke-miterlimit="4" shape-rendering="auto" id="Background" rx="26" ry="26" x="0" y="0" width="470" height="309">
</rect> </rect>
</svg> </svg>