Skip to content

Commit e625b5e

Browse files
committed
fix: 'show blips' button breaks
The toggle was using the old structure for the blips, forgot to update it. Now it works :) closes #8
1 parent e9f0ddf commit e625b5e

File tree

5 files changed

+31
-10
lines changed

5 files changed

+31
-10
lines changed

CHANGELOG.rst

+13
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,23 @@ Changelog
22
=========
33

44

5+
v2.2.1 (02-11-2017)
6+
-------------------
7+
- Fix #8 "Show blips toggle breaks" [Jordan Dalton]
8+
9+
The toggle was using the old structure for the blips, forgot to update it. Now it works :)
10+
- Merge branch 'develop' [Jordan Dalton]
11+
12+
513
v2.2.0 (30-10-2017)
614
-------------------
715

816
Changes
917
~~~~~~~
18+
- Update version.json. [Jordan Dalton]
19+
20+
Don't know why socket.js is in here but, apparently I foorgot to commit some changes.
21+
- Update changelog. [Jordan Dalton]
1022
- Update coordinates to 2dp. [Jordan Dalton]
1123

1224
Player coordinates are now 2dp like other markers.
@@ -29,6 +41,7 @@ Changes
2941

3042
Other
3143
~~~~~
44+
- Merge branch 'feature/live_blips' into develop. [Jordan Dalton]
3245
- Add blip socket commands. [Jordan Dalton]
3346

3447
Blips can now be added/updated and removed from the map from the socket server.

js/src/controls.js

+13-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,19 @@
1919
function toggleBlips(){
2020
console.log("showing local blips");
2121
if (_showBlips){
22-
_blips.forEach(function(blip){
23-
var desc = blip.description == undefined ? "" : blip.description;
24-
var obj = new MarkerObject(blip.name, new Coordinates(blip.x, blip.y, blip.z), MarkerTypes[blip.type], desc, "", "");
25-
createMarker(false, false, obj, "");
26-
});
22+
23+
for(var spriteId in _blips){
24+
var blipArray = _blips[spriteId];
25+
26+
for(var i in blipArray){
27+
var blip = blipArray[i];
28+
29+
var obj = new MarkerObject(blip.name, new Coordinates(blip.pos.x, blip.pos.y, blip.pos.z), MarkerTypes[blip.type], blip.description, "", "");
30+
blip.markerId = createMarker(false, false, obj, "") - 1;
31+
32+
}
33+
}
34+
2735
}else{
2836
clearAllMarkers();
2937
}

js/src/init.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function createBlip(blip){
9393
}
9494

9595
blip.markerId = createMarker(false, false, obj, "") - 1;
96-
96+
9797
_blips[blip.type].push(blip);
9898
_blipCount++;
9999
}
@@ -113,7 +113,7 @@ function blipSuccess(data, textStatus){
113113
for (var i in blipArray) {
114114
var blip = blipArray[i];
115115
var fallbackName = (MarkerTypes[spriteId] != undefined && MarkerTypes[spriteId].hasOwnProperty("name")) ? MarkerTypes[spriteId].name : "Unknown Name... Please make sure the sprite exists.";
116-
116+
117117
blip.name = (blip.hasOwnProperty("name") || blip.name != null) ? blip.name : fallbackName;
118118
blip.description = (blip.hasOwnProperty("description") || blip.description != null) ? blip.description : "";
119119

js/src/socket.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ function onMessage(e){
8080
updateBlip(data.payload);
8181

8282
}else if (data.type == "playerData") {
83-
console.log("updating players: " + JSON.stringify(data));
83+
//console.log("updating players: " + JSON.stringify(data));
8484
doPlayerUpdate(data.payload);
8585

8686
}else if(data.type == "playerLeft"){
87-
console.log("player left:" + data.payload);
87+
//console.log("player left:" + data.payload);
8888
playerLeft(data.payload);
8989
}
9090
}

version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"interface" : "2.2.0"
2+
"interface" : "2.2.1"
33
}

0 commit comments

Comments
 (0)