|
3 | 3 |
|
4 | 4 | <portal to="title"> |
5 | 5 | <h1 class="dark:text-white !mb-2"> |
6 | | - {{ t('map.title') }} |
| 6 | + <span id="map_title">{{ t('map.title') }}</span> |
7 | 7 | <select class="inline-block w-90 ml-4 px-4 py-2 bg-gray-200 dark:bg-gray-600 border rounded" |
8 | 8 | id="server"> |
9 | 9 | <option v-for="server in servers" :key="server.name" :value="server.name">{{ server.name }}</option> |
|
17 | 17 | <portal to="actions"> |
18 | 18 | <div> |
19 | 19 | <!-- Stop tracking --> |
20 | | - <button class="px-5 py-2 mr-3 font-semibold text-white rounded bg-danger dark:bg-dark-danger mobile:block mobile:w-full mobile:m-0 mobile:mb-3" @click="trackedPlayer = null" v-if="trackedPlayer"> |
| 20 | + <button class="px-5 py-2 mr-3 font-semibold text-white rounded bg-danger dark:bg-dark-danger mobile:block mobile:w-full mobile:m-0 mobile:mb-3" @click="stopTracking()" v-if="trackedPlayer"> |
21 | 21 | <i class="fas fa-stop mr-1"></i> |
22 | 22 | {{ t('map.stop_track') }} |
23 | 23 | </button> |
@@ -182,6 +182,10 @@ export default { |
182 | 182 | lng: coords.x |
183 | 183 | } |
184 | 184 | }, |
| 185 | + stopTracking() { |
| 186 | + this.trackedPlayer = null; |
| 187 | + window.location.hash = ''; |
| 188 | + }, |
185 | 189 | hostname(isSocket) { |
186 | 190 | const isDev = window.location.hostname === 'localhost'; |
187 | 191 |
|
@@ -371,7 +375,7 @@ export default { |
371 | 375 | isPassenger = 'vehicle' in player && player.vehicle && !player.vehicle.driving, |
372 | 376 | isInvisible = 'invisible' in player && player.invisible, |
373 | 377 | isDead = player.character && 'dead' in player.character && player.character.dead, |
374 | | - speed = 'vehicle' in player && player.vehicle && 'speed' in player.vehicle ? player.vehicle.speed : null, |
| 378 | + speed = 'speed' in player ? player.speed : null, |
375 | 379 | icon = _this.getIcon(player, isDriving, isPassenger, isInvisible, isDead), |
376 | 380 | vehicle = _this.getVehicleType(player.vehicle), |
377 | 381 | isStaff = _this.staff.includes(player.steamIdentifier); |
@@ -459,6 +463,11 @@ export default { |
459 | 463 | </tr>`.replace(/\r?\n(\s{4})?/gm, '')); |
460 | 464 | } |
461 | 465 |
|
| 466 | + if (_this.trackedPlayer && (_this.trackedPlayer === 'server_' + player.source || (_this.trackedPlayer.startsWith('steam:') && _this.trackedPlayer === player.steamIdentifier))) { |
| 467 | + _this.trackedPlayer = id; |
| 468 | + window.location.hash = id; |
| 469 | + } |
| 470 | +
|
462 | 471 | if (_this.trackedPlayer === id) { |
463 | 472 | extra += '<br><br><a href="#" class="track-cid" data-trackid="stop">' + _this.t('map.stop_track') + '</a>'; |
464 | 473 |
|
@@ -649,11 +658,19 @@ export default { |
649 | 658 |
|
650 | 659 | $(document).ready(function () { |
651 | 660 | $('#server').on('change', function () { |
| 661 | + _this.firstRefresh = true; |
| 662 | +
|
652 | 663 | _this.doMapRefresh($(this).val()); |
653 | 664 | }); |
654 | 665 | $('#server').trigger('change'); |
655 | 666 | }); |
656 | 667 |
|
| 668 | + if (Math.round(Math.random() * 100) === 1) { // 1% chance it says fib spy satellite map |
| 669 | + $(document).ready(function() { |
| 670 | + $('#map_title').text(_this.t('map.spy_satellite')); |
| 671 | + }); |
| 672 | + } |
| 673 | +
|
657 | 674 | VueInstance = this; |
658 | 675 | } |
659 | 676 | }; |
|
0 commit comments