mirror of
https://github.com/BeamMP/BeamNG-FuelStations.git
synced 2026-04-18 06:10:03 +00:00
Better Compat For MP
This commit is contained in:
@@ -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))
|
||||
end
|
||||
map = getMissionFilename()
|
||||
for k = 1, #stations[map] do
|
||||
--print("Using Map: "..tostring(stations[map][k][3]))
|
||||
local color = 0
|
||||
if stations[map][k][3] == "EV" then
|
||||
color = ColorF(0.1,0.9,0.1,0.5)
|
||||
elseif stations[map][k][3] == "Gas/EV" then
|
||||
color = ColorF(0.1,0.8,1.0,0.5)
|
||||
else
|
||||
color = ColorF(0.9,0.1,0.1,0.5)
|
||||
end
|
||||
debugDrawer:drawCylinder(stations[map][k][1]:toPoint3F(), stations[map][k][2]:toPoint3F(), 1, color)
|
||||
for i = 0, be:getObjectCount() -1 do -- For each vehicle
|
||||
local veh = be:getObject(i) -- Get vehicle
|
||||
if string.match(map, "info.json") or string.match(map, "level.json") then
|
||||
for k = 1, #stations[map] do
|
||||
--print("Using Map: "..tostring(stations[map][k][3]))
|
||||
local color = 0
|
||||
if stations[map][k][3] == "EV" then
|
||||
color = ColorF(0.1,0.9,0.1,0.5)
|
||||
elseif stations[map][k][3] == "Gas/EV" then
|
||||
color = ColorF(0.1,0.8,1.0,0.5)
|
||||
else
|
||||
color = ColorF(0.9,0.1,0.1,0.5)
|
||||
end
|
||||
debugDrawer:drawCylinder(stations[map][k][1]:toPoint3F(), stations[map][k][2]:toPoint3F(), 1, color)
|
||||
--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 stations[map][k][3] == "Gas/EV" or stations[map][k][3] == fuelType then
|
||||
-- we are inside one of the filling areas of the map
|
||||
@@ -228,10 +230,11 @@ local function onUpdate()
|
||||
break
|
||||
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
|
||||
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
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<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">
|
||||
.Background {
|
||||
.FuelBackground {
|
||||
position: absolute;
|
||||
overflow: visible;
|
||||
width: 470px;
|
||||
@@ -73,7 +73,7 @@
|
||||
font-size: 30px;
|
||||
}
|
||||
</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>
|
||||
</svg>
|
||||
|
||||
Reference in New Issue
Block a user