Skip to content

Commit 7b79b11

Browse files
committed
Updated quest icons, added toggle for quests to config and separate DB config for split bot
1 parent 5d22efc commit 7b79b11

22 files changed

+46
-9
lines changed

config.php.example

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
//DB connection details - same details as raidbot
2+
//Database connection details for raids
33
define('DB_HOST', 'localhost');
44
define('DB_NAME', 'your_database_name');
55
define('DB_USER', 'your_database_user');
@@ -15,5 +15,17 @@ define('MAP_EX_IDENT', 'none'); //Do you have anything added to gym name to indi
1515
define('MAP_SHOW_GYMS', true); //Enable optional gym layers on the map to show all gyms / EX gyms (if gyms are tagged with an identifier)
1616
define('MAP_ICONPACK', 'numbers'); //Choose icons for the map - add folders of icons named id_x.png and set folder name here to switch icon pack
1717
define('LANGUAGE', 'EN'); // set the language to NL,DE,EN,PT-BR.
18-
define('LOCATION_QUEST_REWARD_JSON', '../raidbot/quests-rewards.json'); //select the folder where the quest-reward.json is located.
18+
19+
20+
//Quests - Optional settings for adding QuestBot data to your map
21+
define('MAP_SHOW_QUESTS', false); //set to true to offer quest data on the map from your QuestBot.
22+
define('LOCATION_QUEST_REWARD_JSON', 'https://your-bot-url.com/questbot/quests-rewards.json'); //select the folder where the quest-reward.json is located.
23+
24+
//Database connection details for quests
25+
define('QUEST_DB_HOST', 'localhost');
26+
define('QUEST_DB_NAME', 'your_database_name');
27+
define('QUEST_DB_USER', 'your_database_user');
28+
define('QUEST_DB_PASSWORD', 'your_database_password');
29+
30+
1931
?>

getquest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require_once("config.php");
44

55
// Establish mysql connection.
6-
$db = new PDO("mysql:host=" . DB_HOST . ";dbname=" . DB_NAME . ";charset=utf8mb4", DB_USER, DB_PASSWORD);
6+
$db = new PDO("mysql:host=" . QUEST_DB_HOST . ";dbname=" . QUEST_DB_NAME . ";charset=utf8mb4", QUEST_DB_USER, QUEST_DB_PASSWORD);
77

88
// Error connecting to db.
99
if ($db->connect_errno) {
@@ -39,7 +39,7 @@
3939
ORDER BY pokestops.pokestop_name
4040
";
4141

42-
$json = file_get_contents( LOCATION_QUEST_REWARD_JSON);
42+
$json = file_get_contents(LOCATION_QUEST_REWARD_JSON);
4343
$translations = json_decode($json,true);
4444

4545
$result = $db->query($sql);

icons/quests/pokestop.png

5.09 KB
Loading

icons/quests/reward_type_10.png

5.67 KB
Loading

icons/quests/reward_type_2.png

6.08 KB
Loading

icons/quests/reward_type_3.png

7.69 KB
Loading

icons/quests/reward_type_4.png

7.16 KB
Loading

icons/quests/reward_type_5.png

6.8 KB
Loading

icons/quests/reward_type_6.png

4.92 KB
Loading

icons/quests/reward_type_7.png

5.21 KB
Loading

icons/quests/reward_type_8.png

6.2 KB
Loading

icons/quests/reward_type_9.png

6.31 KB
Loading

icons/reward_type_10.png

-12.6 KB
Binary file not shown.

icons/reward_type_2.png

-2.65 KB
Binary file not shown.

icons/reward_type_3.png

-2.65 KB
Binary file not shown.

icons/reward_type_4.png

-1.76 KB
Binary file not shown.

icons/reward_type_5.png

-24.8 KB
Binary file not shown.

icons/reward_type_6.png

-20.2 KB
Binary file not shown.

icons/reward_type_7.png

-20.2 KB
Binary file not shown.

icons/reward_type_8.png

-10.4 KB
Binary file not shown.

icons/reward_type_9.png

-6.99 KB
Binary file not shown.

index.php

+30-5
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,30 @@
6969
iconAnchor: [10, 17],
7070
popupAnchor: [-3, -10],
7171
iconUrl: 'icons/gymEX.png'
72-
});
72+
});
73+
74+
var questPokeIcon = L.Icon.extend({
75+
options: {
76+
iconSize: [32, 32],
77+
iconAnchor: [8, 8],
78+
popupAnchor: [-3, -10],
79+
shadowUrl: 'icons/quests/pokestop.png',
80+
shadowSize: [48, 48],
81+
shadowAnchor: [24, 24]
82+
}
83+
});
84+
85+
var questItemIcon = L.Icon.extend({
86+
options: {
87+
iconSize: [32, 32],
88+
iconAnchor: [8, 8],
89+
popupAnchor: [-3, -10],
90+
shadowUrl: 'icons/quests/pokestop.png',
91+
shadowSize: [48, 48],
92+
shadowAnchor: [24, 24]
93+
}
94+
});
7395

74-
7596
(function () {
7697
//Separate layers for raid levels to allow toggle on/off of levels
7798
gyms = new L.FeatureGroup();
@@ -138,8 +159,12 @@
138159
"Level 3": raids3,
139160
"Level 2": raids2,
140161
"Level 1": raids1,
141-
"Quest": quest,
142162
<?php
163+
if (MAP_SHOW_QUESTS) {
164+
echo('"Quests": quest,
165+
');
166+
}
167+
143168
if (MAP_SHOW_GYMS) {
144169
if (MAP_EX_IDENT != 'none') {
145170
echo('"EX Gyms": gymsEX,
@@ -362,9 +387,9 @@ function getQuest() {
362387
var details = "<div style='text-align: center; margin-left: auto; margin-right: auto;'>"+ pokestop_info + quest_info + "</div>";
363388

364389
if( pokedex_id && reward_type == 1 ){
365-
pokemonIcon[i] = new raidIcon({iconUrl: 'icons<?php echo("/" . MAP_ICONPACK); ?>/id_' + pokedex_id +'.png'});
390+
pokemonIcon[i] = new questPokeIcon({iconUrl: 'icons<?php echo("/" . MAP_ICONPACK); ?>/id_' + pokedex_id +'.png'});
366391
}else{
367-
pokemonIcon[i] = new raidIcon({iconUrl: 'icons/reward_type_' + reward_type + '.png'});
392+
pokemonIcon[i] = new questItemIcon({iconUrl: 'icons/quests/reward_type_' + reward_type + '.png'});
368393
}
369394

370395

0 commit comments

Comments
 (0)