Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Gas Stations + Fixed Lua #3

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion levels/east_coast_usa/fuelstations.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
{ "location": [ 625.651, -183.448, 53.2 ], "type":"ev" },
{ "location": [ 622.667, -186.129, 53.2 ], "type":"ev" },
{ "location": [ 619.97, -189.098, 53.2 ], "type":"ev" },
{ "location": [ 617.164, -192.107, 53.2 ], "type":"ev" },
{ "location": [ 617.164, -192.107, 53.2 ], "type":"ev" }
]
2 changes: 1 addition & 1 deletion levels/hirochi_raceway/fuelstations.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[
{ "location": [ -423.444, 327.058, 24.7 ], "type":"any" },
{ "location": [ -313.5 , 62.4 , 31.9 ], "type":"any" },
{ "location": [ -311 , 60 , 31.9 ], "type":"any" },
{ "location": [ -311 , 60 , 31.9 ], "type":"any" }
]
10 changes: 10 additions & 0 deletions levels/johnson_valley/fuelstations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{ "location": [ 1368.578, 1355.079, 118.200], "type":"gas" },
{ "location": [ 1368.578, 1346.765, 118.200], "type":"gas" },
{ "location": [ 1372.497, 1346.765, 118.200], "type":"gas" },
{ "location": [ 1372.489, 1355.141, 118.200], "type":"gas" },
{ "location": [ 1382.309, 1355.141, 118.200], "type":"gas" },
{ "location": [ 1382.309, 1346.767, 118.200], "type":"gas" },
{ "location": [ 1386.066, 1346.767, 118.200], "type":"gas" },
{ "location": [ 1386.066, 1355.116, 118.200], "type":"gas" }
]
14 changes: 13 additions & 1 deletion levels/west_coast_usa/fuelstations.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,17 @@
{ "location": [ -190.027, 522.874, 74.800 ], "type":"any"},
{ "location": [ -190.019, 515.983, 74.800 ], "type":"any"},
{ "location": [ -193.976, 515.983, 74.800 ], "type":"any"},
{ "location": [ 417.285, -229.916, 145.06 ], "type":"any"}
{ "location": [ 417.285, -229.916, 145.06 ], "type":"any"},
{ "location": [ 911.720, -478.980, 162.200], "type":"gas"},
{ "location": [ 910.511, -484.708, 162.200], "type":"gas"},
{ "location": [ 914.614, -485.808, 162.200], "type":"gas"},
{ "location": [ 915.821, -480.193, 162.200], "type":"gas"},
{ "location": [ 919.287, -480.880, 162.200], "type":"gas"},
{ "location": [ 918.268, -486.388, 162.200], "type":"gas"},
{ "location": [ 922.523, -487.425, 162.200], "type":"gas"},
{ "location": [ 923.666, -481.806, 162.200], "type":"gas"},
{ "location": [ 927.410, -482.584, 162.200], "type":"gas"},
{ "location": [ 926.139, -488.050, 162.200], "type":"gas"},
{ "location": [ 930.094, -488.996, 162.200], "type":"gas"},
{ "location": [ 931.128, -483.548, 162.200], "type":"gas"}
]
4 changes: 2 additions & 2 deletions lua/ge/extensions/fuelStations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ local fuelTypeMap = {}
local ePressed = false
local debug = false

local inactiveColorMap = { gas = ColorF(1,1,0,0.3), ev = ColorF(0,1,0,0.3), any = ColorF(0,0,1,0.3) }
local activeColorMap = { gas = ColorF(1,1,0,0.5), ev = ColorF(0,1,0,0.5), any = ColorF(0,0,1,0.5) }
local inactiveColorMap = { gas = ColorF(1,0,0,0.3), ev = ColorF(0,1,0,0.3), any = ColorF(0,0,1,0.3) }
local activeColorMap = { gas = ColorF(1,0,0,0.5), ev = ColorF(0,1,0,0.5), any = ColorF(0,0,1,0.5) }

local function loadMapStations(infopath)
infopath = infopath or getMissionFilename()
Expand Down
30 changes: 30 additions & 0 deletions ui/modules/apps/MapDevAddStation/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//MapDevAddStation has been started by Sky777, part of the FuelStations Team,
//making it easy to add Fuel Stations to BeamNG maps!

angular.module('beamng.apps')

.directive('addStation', ['StreamsManager', function(StreamsManager) {
return {
template:
'<object style="width:100%; height:100%;" type="image/svg+xml" data="/ui/modules/apps/MapDevAddStation/tool.svg"></object>',
replace: true,
restrict: 'EA',
scope: true,
link: function(scope, element, attrs) {

//Optional list of streams used in app
var streamsList=[/*Streams here*/];
//Make needed streams available
StreamsManager.add(streamsList);
//Clean up after closing app
scope.$on('$destroy', function(){
StreamsManager.remove(streamsList);
}
);
scope.$on('streamsUpdate', function(event, streams){
//Code using streams' values
}
);
}
};
}]);
18 changes: 18 additions & 0 deletions ui/modules/apps/MapDevAddStation/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name" : "Map Dev Add Stations (WIP)",
"author": "FuelStations Team",
"version": "0.1",
"description": "Use this UI app to add Fuel Stations to your map with ease!",
"types":[
"ui.apps.categories.utility"
],
"directive": "addStation",
"domElement": "<add-station></add-station>",
"css": {
"width": "500px",
"height": "300px",
"top": "350px",
"left": "350px"
},
"preserveAspectRatio": true
}
Binary file added ui/modules/apps/MapDevAddStation/app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ui/modules/apps/MapDevAddStation/tool.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
190 changes: 190 additions & 0 deletions ui/modules/apps/MapDevAddStation/tool.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.