Skip to content

Commit

Permalink
Hide quests if older than last midnight
Browse files Browse the repository at this point in the history
  • Loading branch information
jepke committed Feb 13, 2019
1 parent b52913f commit e330f3a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 37 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ config/*
cron/*
!cron/example.PMSF
!cron/nest_cron.php
!cron/quest_cron.php
!cron/quest_rdm_cron.php
!cron/raid_cron.php
!cron/silph.php
/static/dist/
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ $fork = "default" OR $fork = "beta";

* MAD Map a Droid
```
Free version:
$map = "monocle";
$fork = "pmsf";
MITM version:
$map = "monocle";
$fork = "mad";
Expand Down
11 changes: 0 additions & 11 deletions cron/quest_cron.php

This file was deleted.

7 changes: 0 additions & 7 deletions cron/quest_rdm_cron.php

This file was deleted.

22 changes: 10 additions & 12 deletions static/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1145,13 +1145,16 @@ function pokestopLabel(item) {
'<center>' + '<div class="pokestop-label">' +
'<b>' + item['pokestop_name'] + '</b>' +
'</div>'
if (!noQuests && item['quest_type'] !== 0) {
var d = new Date()
var lastMidnight = d.setHours(0,0,0,0) / 1000
if (!noQuests && item['quest_type'] !== null && lastMidnight < Number(item['quest_timestamp'])) {
str +=
'<div><center>' +
'<img height="70px" style="padding: 5px;" src="static/forts/Pstop-quest-large.png">' +
stopImage +
getReward(item) +
'</center></div>'
'</center></div>' +
getQuest(item)
} else {
str =
'<div class="pokestop-label">' +
Expand All @@ -1166,9 +1169,6 @@ function pokestopLabel(item) {
'</center>' +
'</div>'
}
if (!noQuests && item['quest_type'] !== 0) {
str += getQuest(item)
}
if (!noDeletePokestops) {
str += '<i class="fa fa-trash-o delete-pokestop" onclick="deletePokestop(event);" data-id="' + item['pokestop_id'] + '"></i>'
}
Expand Down Expand Up @@ -1691,7 +1691,9 @@ function updateGymIcons() {
function getPokestopMarkerIcon(item) {
var stopMarker = ''
var html = ''
if (!noQuests && item['quest_reward_type'] !== null) {
var d = new Date()
var lastMidnight = d.setHours(0,0,0,0) / 1000
if (!noQuests && item['quest_reward_type'] !== null && lastMidnight < Number(item['quest_timestamp'])) {
if (item['quest_reward_type'] === 7) {
var pokemonIdStr = ''
if (item['quest_pokemon_id'] <= 9) {
Expand Down Expand Up @@ -1774,12 +1776,8 @@ function getPokestopMarkerIcon(item) {
function setupPokestopMarker(item) {
var pokestopMarkerIcon = getPokestopMarkerIcon(item)
var marker
if (!noQuests && item['quest_reward_type'] !== null) {
if (item['quest_pokemon_shiny'] === 'true') {
marker = L.marker([item['latitude'], item['longitude']], {icon: pokestopMarkerIcon, zIndexOffset: 1050}).bindPopup(pokestopLabel(item), {className: 'leaflet-popup-content-wrapper shiny', autoPan: false, closeOnClick: false, autoClose: false})
} else {
marker = L.marker([item['latitude'], item['longitude']], {icon: pokestopMarkerIcon, zIndexOffset: 1050}).bindPopup(pokestopLabel(item), {className: 'leaflet-popup-content-wrapper normal', autoPan: false, closeOnClick: false, autoClose: false})
}
if (item['quest_pokemon_shiny'] === 'true') {
marker = L.marker([item['latitude'], item['longitude']], {icon: pokestopMarkerIcon, zIndexOffset: 1050}).bindPopup(pokestopLabel(item), {className: 'leaflet-popup-content-wrapper shiny', autoPan: false, closeOnClick: false, autoClose: false})
} else {
marker = L.marker([item['latitude'], item['longitude']], {icon: pokestopMarkerIcon, zIndexOffset: 1050}).bindPopup(pokestopLabel(item), {className: 'leaflet-popup-content-wrapper normal', autoPan: false, closeOnClick: false, autoClose: false})
}
Expand Down

0 comments on commit e330f3a

Please sign in to comment.