Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit c689d74

Browse files
committed
- Added custom icon for float planes
- 1% chance the map says FiB Spy Satellite as its title - Add view on map button to logs and player page - Some map bugfixes
1 parent 4c36882 commit c689d74

File tree

6 files changed

+36
-7
lines changed

6 files changed

+36
-7
lines changed
1.39 KB
Loading

resources/js/Pages/Logs/Index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@
106106
</inertia-link>
107107
</td>
108108
<td class="px-6 py-3 border-t mobile:block" :title="t('global.server_timeout')">
109-
<span class="font-semibold" v-if="log.status.status === 'online'">
109+
<a class="font-semibold" :href="'/map#server_' + log.status.serverId" :title="t('global.view_map')" v-if="log.status.status === 'online'">
110110
{{ log.status.serverId }}
111-
</span>
111+
</a>
112112
<span class="font-semibold" v-else>
113113
{{ t('global.status.' + log.status.status) }}
114114
</span>

resources/js/Pages/Map/Index.vue

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<portal to="title">
55
<h1 class="dark:text-white !mb-2">
6-
{{ t('map.title') }}
6+
<span id="map_title">{{ t('map.title') }}</span>
77
<select class="inline-block w-90 ml-4 px-4 py-2 bg-gray-200 dark:bg-gray-600 border rounded"
88
id="server">
99
<option v-for="server in servers" :key="server.name" :value="server.name">{{ server.name }}</option>
@@ -17,7 +17,7 @@
1717
<portal to="actions">
1818
<div>
1919
<!-- 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">
2121
<i class="fas fa-stop mr-1"></i>
2222
{{ t('map.stop_track') }}
2323
</button>
@@ -182,6 +182,10 @@ export default {
182182
lng: coords.x
183183
}
184184
},
185+
stopTracking() {
186+
this.trackedPlayer = null;
187+
window.location.hash = '';
188+
},
185189
hostname(isSocket) {
186190
const isDev = window.location.hostname === 'localhost';
187191
@@ -371,7 +375,7 @@ export default {
371375
isPassenger = 'vehicle' in player && player.vehicle && !player.vehicle.driving,
372376
isInvisible = 'invisible' in player && player.invisible,
373377
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,
375379
icon = _this.getIcon(player, isDriving, isPassenger, isInvisible, isDead),
376380
vehicle = _this.getVehicleType(player.vehicle),
377381
isStaff = _this.staff.includes(player.steamIdentifier);
@@ -459,6 +463,11 @@ export default {
459463
</tr>`.replace(/\r?\n(\s{4})?/gm, ''));
460464
}
461465
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+
462471
if (_this.trackedPlayer === id) {
463472
extra += '<br><br><a href="#" class="track-cid" data-trackid="stop">' + _this.t('map.stop_track') + '</a>';
464473
@@ -649,11 +658,19 @@ export default {
649658
650659
$(document).ready(function () {
651660
$('#server').on('change', function () {
661+
_this.firstRefresh = true;
662+
652663
_this.doMapRefresh($(this).val());
653664
});
654665
$('#server').trigger('change');
655666
});
656667
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+
657674
VueInstance = this;
658675
}
659676
};

resources/js/Pages/Players/Show.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535

3636
<portal to="actions">
3737
<div>
38+
<!-- View on Map -->
39+
<inertia-link class="px-5 py-2 mr-3 font-semibold text-white rounded bg-blue-600 dark:bg-blue-500 mobile:block mobile:w-full mobile:m-0 mobile:mb-3" :href="'/map#' + player.steamIdentifier" v-if="player.status.status === 'online'">
40+
<i class="fas fa-envelope-open-text"></i>
41+
{{ t('global.view_map') }}
42+
</inertia-link>
3843
<!-- StaffPM -->
3944
<button class="px-5 py-2 mr-3 font-semibold text-white rounded bg-blue-600 dark:bg-blue-500 mobile:block mobile:w-full mobile:m-0 mobile:mb-3" @click="isStaffPM = true" v-if="player.status.status === 'online'">
4045
<i class="fas fa-envelope-open-text"></i>

resources/js/data/vehicles.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,17 @@
6363
"predator"
6464
]
6565
},
66+
"float_plane": {
67+
"size": 28,
68+
"models": [
69+
"dodo"
70+
]
71+
},
6672
"light_plane": {
6773
"size": 28,
6874
"models": [
6975
"alphaz1",
7076
"cuban800",
71-
"dodo",
7277
"duster",
7378
"howard",
7479
"mammatus",

resources/js/locales/en-us.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"view": "View",
1212
"refresh": "Refresh",
1313
"delete": "Delete",
14+
"view_map": "View on Live-Map",
1415
"status": {
1516
"online": "Online",
1617
"offline": "Offline",
@@ -63,7 +64,8 @@
6364
"track": "Track character",
6465
"stop_track": "Stop tracking character",
6566
"afk_title": "AFK Players",
66-
"command": "tp"
67+
"command": "tp",
68+
"spy_satellite": "FiB Spy Satellite Map"
6769
},
6870
"nav": {
6971
"dark": "Dark",

0 commit comments

Comments
 (0)