local _G = ShaguTweaks.GetGlobalEnv()
local T = ShaguTweaks.T
local hooksecurefunc = hooksecurefunc or ShaguTweaks.hooksecurefunc

local module = ShaguTweaks:register({
  title = T["Reveal World Map"],
  description = T["Reveals unexplored world map areas and shows exploration hints."],
  expansions = { ["vanilla"] = true, ["tbc"] = false },
  maintainer = "@shagu (GitHub)",
  enabled = true,
  config = {
    ["map.reveal.marker"] = "on",
  }
})

-- Vanilla WoW MapOverlayData
ShaguTweaks.MapOverlayData = {
  ["Teldrassil"] = {"RUTTHERANVILLAGE:128:100:494:548", "STARBREEZEVILLAGE:200:200:561:292", "GNARLPINEHOLD:185:128:368:443", "LAKEALAMETH:256:185:436:380", "WELLSPRINGLAKE:180:256:377:93", "THEORACLEGLADE:170:240:272:127", "BANETHILHOLLOW:160:210:382:281", "DOLANAAR:190:128:462:323", "SHADOWGLEN:225:225:491:153", "POOLSOFARLITHRIEN:128:190:335:313", "DARNASSUS:315:256:101:247",},
  ["DunMorogh"] = {"AMBERSTILLRANCH:128:128:573:280", "FROSTMANEHOLD:125:125:217:287", "ICEFLOWLAKE:128:180:281:167", "THEGRIZZLEDDEN:200:185:314:311", "HELMSBEDLAKE:155:170:694:273", "SHIMMERRIDGE:128:190:347:163", "CHILLBREEZEVALLEY:180:128:274:296", "ANVILMAR:240:185:155:403", "MISTYPINEREFUGE:128:165:502:221", "GOLBOLARQUARRY:165:165:608:291", "KHARANOS:200:200:386:294", "THETUNDRIDHILLS:155:128:522:322", "IRONFORGE:315:200:397:163", "COLDRIDGEPASS:150:128:295:385", "NORTHERNGATEOUTPOST:128:165:759:173", "SOUTHERNGATEOUTPOST:128:120:792:279", "GNOMERAGON:180:165:166:184", "BREWNALLVILLAGE:115:115:252:249",},
  ["Elwynn"] = {"EASTVALELOGGINGCAMP:256:210:704:330", "BRACKWELLPUMPKINPATCH:256:249:577:419", "FORESTSEDGE:256:341:124:327", "FARGODEEPMINE:256:240:238:428", "JERODSLANDING:256:237:425:431", "STORMWIND:485:405:0:0", "GOLDSHIRE:240:220:250:270", "TOWEROFAZORA:255:250:551:292", "CRYSTALLAKE:225:220:422:332", "RIDGEPOINTTOWER:306:233:696:435", "STONECAIRNLAKE:310:256:587:190", "NORTHSHIREVALLEY:256:256:381:147",},
  ["Mulgore"] = {"WINTERHOOFWATERWELL:170:128:458:369", "THUNDERHORNWATERWELL:128:155:379:242", "RAVAGEDCARAVAN:128:120:473:260", "PALEMANEROCK:128:205:303:307", "WINDFURYRIDGE:205:128:395:0", "REDCLOUDMESA:470:243:270:425", "THUNDERBLUFF:280:240:249:59", "BAELDUNDIGSITE:210:180:255:214", "WILDMANEWATERWELL:185:128:291:0", "THEGOLDENPLAINS:215:240:428:80", "REDROCKS:205:230:502:16", "BLOODHOOFVILLAGE:256:200:367:303", "THEROLLINGPLAINS:256:190:523:356", "THEVENTURECOMINE:225:235:532:238",},
  ["Tirisfal"] = {"SCARLETWATCHPOST:175:247:689:104", "SOLLIDENFARMSTEAD:256:156:239:250", "GARRENSHAUNT:174:220:497:145", "VENOMWEBVALE:237:214:757:205", "NIGHTMAREVALE:243:199:363:349", "AGAMANDMILLS:256:210:335:139", "CRUSADEROUTPOST:173:128:694:289", "DEATHKNELL:245:205:227:328", "BALNIRFARMSTEAD:216:179:630:326", "BRIGHTWATERLAKE:201:288:587:139", "BULWARK:230:205:698:362", "RUINSOFLORDAERON:315:235:463:361", "COLDHEARTHMANOR:150:128:474:327", "BRILL:128:158:537:299", "MONASTARY:211:189:746:125", "STILLWATERPOND:186:128:395:277",},
  ["Durotar"] = {"RAZORMANEGROUNDS:230:230:301:189", "VALLEYOFTRIALS:215:215:355:320", "SKULLROCK:128:110:464:33", "DRYGULCHRAVINE:210:160:427:78", "THUNDERRIDGE:190:200:327:60", "ORGRIMMAR:445:160:244:0", "SENJINVILLAGE:160:190:474:384", "TIRAGARDEKEEP:190:180:462:286", "ECHOISLES:200:240:549:427", "RAZORHILL:220:230:432:170", "KOLKARCRAG:160:120:413:476",},
  ["Westfall"] = {"WESTFALLLIGHTHOUSE:280:190:205:467", "FURLBROWSPUMPKINFARM:210:215:387:11", "JANGOLODEMINE:215:215:307:29", "SALDEANSFARM:225:210:459:105", "THEDUSTPLAINS:288:235:523:377", "SENTINELHILL:195:240:442:241", "DEMONTSPLACE:200:185:208:375", "THEMOLSENFARM:225:205:328:148", "THEDEADACRE:200:240:524:252", "THEJANSENSTEAD:165:200:488:0", "THEDAGGERHILLS:256:175:339:418", "GOLDCOASTQUARRY:225:256:220:102", "ALEXSTONFARMSTEAD:305:210:204:260", "MOONBROOK:220:200:317:331",},
  ["Silverpine"] = {"THEDECREPITFERRY:180:185:457:144", "FENRISISLE:250:215:593:74", "THEDEADFIELD:175:165:402:65", "MALDENSORCHARD:256:160:465:0", "OLSENSFARTHING:165:185:382:252", "DEEPELEMMINE:160:170:470:261", "SHADOWFANGKEEP:220:160:364:359", "BERENSPERIL:240:180:491:417", "THESEPULCHER:210:160:352:168", "PYREWOODVILLAGE:140:125:391:446", "AMBERMILL:240:240:494:262", "THESKITTERINGDARK:185:165:286:37", "NORTHTIDESHOLLOW:180:128:323:128", "THEGREYMANEWALL:210:215:379:447", "THESHININGSTRAND:256:220:459:13",},
  ["LochModan"] = {"SILVERSTREAMMINE:235:270:229:11", "MOGROSHSTRONGHOLD:315:235:542:48", "STONESPLINTERVALLEY:255:285:215:348", "IRONBANDSEXCAVATIONSITE:345:256:482:321", "VALLEYOFKINGS:195:250:109:370", "GRIZZLEPAWRIDGE:295:358:309:310", "THELSAMAR:256:230:217:203", "THELOCH:320:410:352:87", "NORTHGATEPASS:230:300:125:12", "STONEWROUGHTDAM:290:175:339:11", "THEFARSTRIDERLODGE:370:295:546:199",},
  ["Darkshore"] = {"RUINSOFMATHYSTRA:195:215:510:0", "TOWEROFALTHALAXX:170:195:468:85", "GROVEOFTHEANCIENTS:200:170:305:412", "BASHALARAN:180:195:365:181", "AMETHARAN:190:205:324:306", "THEMASTERSGLAIVE:175:158:329:510", "REMTRAVELSEXCAVATION:175:183:229:485", "AUBERDINE:150:215:318:162", "CLIFFSPRINGRIVER:230:190:375:94",},
  ["Redridge"] = {"STONEWATCH:255:300:500:215", "GALARDELLVALLEY:250:250:654:161", "ALTHERSMILL:235:270:399:129", "RENDERSVALLEY:465:255:484:361", "LAKEEVERSTILL:535:275:133:240", "REDRIDGECANYONS:365:245:121:72", "STONEWATCHFALLS:320:210:595:320", "LAKESHIRE:340:195:83:197", "RENDERSCAMP:275:256:277:0", "THREECORNERS:365:350:0:284", "LAKERIDGEHIGHWAY:430:290:187:333",},
  ["Wetlands"] = {"ANGERFANGENCAMPMENT:225:185:347:218", "DUNMODR:205:180:401:21", "SUNDOWNMARSH:300:240:92:82", "THELGANROCK:230:190:470:371", "BLACKCHANNELMARSH:240:175:77:245", "BLUEGILLMARSH:225:190:89:142", "MOSSHIDEFEN:205:245:527:264", "IRONBEARDSTOMB:200:185:349:115", "THEGREENBELT:185:240:456:125", "SALTSPRAYGLEN:200:240:237:41", "MENETHILHARBOR:175:128:13:314", "GRIMBATOL:350:360:611:230", "RAPTORRIDGE:190:160:628:176", "DIREFORGEHILL:256:250:507:115", "WHELGARSEXCAVATIONSITE:195:185:247:205",},
  ["Hilsbrad"] = {"DARROWHILL:205:155:414:154", "NETHANDERSTEAD:215:240:541:236", "DURNHOLDEKEEP:384:365:605:75", "SOUTHSHORE:235:270:418:201", "HILLSBRADFIELDS:305:275:198:155", "TARRENMILL:220:310:509:0", "AZURELOADMINE:165:200:175:275", "SOUTHPOINTTOWER:288:225:2:192", "DUNGAROK:240:275:637:294", "EASTERNSTRAND:230:320:524:339", "WESTERNSTRAND:285:155:208:368", "PURGATIONISLE:125:100:109:482",},
  ["Duskwood"] = {"THEYORGENFARMSTEAD:235:250:390:382", "THEROTTINGORCHARD:250:230:539:369", "VULGOLOGREMOUND:255:285:243:348", "TWILIGHTGROVE:360:420:298:79", "ADDLESSTEAD:275:250:55:342", "MANORMISTMANTLE:200:175:653:120", "THEDARKENEDBANK:910:210:89:31", "RAVENHILL:195:145:102:302", "THEHUSHEDBANK:160:330:19:132", "DARKSHIRE:315:280:631:162", "BRIGHTWOODGROVE:220:340:504:117", "TRANQUILGARDENSCEMETARY:220:220:690:353", "RAVENHILLCEMETARY:350:300:85:149",},
  ["Alterac"] = {"LORDAMEREINTERNMENTCAMP:330:265:44:403", "DANDREDSFOLD:285:230:276:0", "MISTYSHORE:220:280:196:131", "CHILLWINDPOINT:350:370:626:253", "GALLOWSCORNER:200:200:406:279", "CORRAHNSDAGGER:195:288:399:380", "CRUSHRIDGEHOLD:280:240:334:162", "THEUPLANDS:235:200:462:77", "GAVINSNAZE:160:175:225:478", "GROWLESSCAVE:190:170:317:372", "RUINSOFALTERAC:255:255:270:197", "STRAHNBRAD:370:300:549:105", "THEHEADLAND:165:197:314:471", "SOFERASNAZE:255:320:462:307", "DALARAN:300:300:26:262",},
  ["Barrens"] = {"THEFORGOTTENPOOLS:120:125:384:115", "THESTAGNANTOASIS:155:128:481:211", "THEMORSHANRAMPART:128:100:412:0", "DREADMISTPEAK:128:105:419:63", "THEDRYHILLS:200:145:317:29", "BOULDERLODEMINE:120:110:555:0", "THESLUDGEFEN:170:120:456:0", "THECROSSROADS:155:155:431:118", "NORTHWATCHFOLD:150:120:527:307", "RAPTORGROUNDS:115:110:507:294", "THORNHILL:140:128:498:119", "THEMERCHANTCOAST:95:100:581:247", "LUSHWATEROASIS:175:185:365:177", "RATCHET:125:125:556:189", "HONORSSTAND:128:128:306:130", "BRAMBLESCAR:125:165:442:298", "BLACKTHORNRIDGE:155:128:335:462", "BAELMODAN:128:128:431:479", "RAZORFENKRAUL:128:128:341:537", "RAZORFENDOWNS:155:115:407:553", "CAMPTAURAJO:145:125:365:350", "GROLDOMFARM:125:115:492:63", "FARWATCHPOST:100:165:564:52", "AGAMAGOR:200:185:340:234", "FIELDOFGIANTS:210:150:355:402",},
  ["Stranglethorn"] = {"NESINGWARYSEXPEDITION:140:110:269:26", "RUINSOFJUBUWAL:110:110:306:301", "ZIATAJAIRUINS:128:125:364:231", "BOOTYBAY:145:128:203:433", "NEKMANIWELLSPRING:90:115:211:359", "RUINSOFABORAZ:95:95:350:335", "CRYSTALVEINMINE:120:120:345:276", "MIZJAHRUINS:105:110:311:131", "WILDSHORE:165:190:229:422", "BLOODSAILCOMPOUND:165:175:194:284", "JAGUEROISLE:125:120:314:493", "GROMGOLBASECAMP:110:105:260:132", "MOSHOGGOGREMOUND:128:175:432:94", "KALAIRUINS:95:95:299:88", "RUINSOFZULMAMWE:170:125:394:212", "MISTVALEVALLEY:125:125:280:368", "THEARENA:200:185:235:189", "ZUULDAIARUINS:115:115:156:42", "BALIAMAHRUINS:110:140:371:129", "LAKENAZFERITI:128:125:331:59", "KURZENSCOMPOUND:155:150:388:0", "RUINSOFZULKUNDA:125:140:196:3", "ZULGURUB:245:220:483:8", "THEVILEREEF:190:175:152:90", "VENTURECOBASECAMP:105:125:387:64", "BALALRUINS:90:80:241:92", "REBELCAMP:170:90:284:0",},
  ["SwampOfSorrows"] = {"SPLINTERSPEARJUNCTION:275:240:129:236", "THEHARBORAGE:235:205:171:145", "FALLOWSANCTUARY:365:305:492:0", "MISTYREEDSTRAND:256:668:746:0", "POOLOFTEARS:300:275:565:218", "THESHIFTINGMIRE:315:235:286:110", "MISTYVALLEY:245:305:0:140", "ITHARIUSSCAVE:240:245:0:262", "STONARD:360:315:279:237", "STAGALBOG:345:250:552:378", "SORROWMURK:215:365:724:120",},
  ["Arathi"] = {"CIRCLEOFINNERBINDING:210:185:286:310", "CIRCLEOFOUTERBINDING:170:155:419:293", "NORTHFOLDMANOR:230:240:192:90", "BOULDERGOR:245:245:232:145", "STROMGARDEKEEP:240:230:108:287", "FALDIRSCOVE:256:215:171:424", "THANDOLSPAN:200:220:355:412", "BOULDERFISTHALL:215:235:432:362", "GOSHEKFARM:230:195:531:276", "HAMMERFALL:205:250:655:120", "WITHERBARKVILLAGE:215:210:559:333", "DABYRIESFARMSTEAD:180:210:472:165", "CIRCLEOFEASTBINDING:160:230:558:112", "REFUGEPOINT:175:225:370:186", "THORADINSWALL:190:240:87:138", "CIRCLEOFWESTBINDING:190:210:138:54",},
  ["Badlands"] = {"CAMPCAGG:255:220:12:428", "KARGATH:240:255:0:148", "CAMPKOSH:220:220:551:48", "LETHLORRAVINE:370:455:611:110", "APOCRYPHANSREST:255:205:17:310", "AGMONDSEND:265:270:345:389", "CAMPBOFF:255:280:501:341", "THEDUSTBOWL:270:275:159:199", "HAMMERTOESDIGSITE:200:195:445:120", "VALLEYOFFANGS:230:230:349:256", "ANGORFORTRESS:195:200:325:148", "MIRAGEFLATS:285:240:148:384", "DUSTWINDGULCH:245:205:498:209", "THEMAKERSTERRACE:245:205:389:7",},
  ["Hinterlands"] = {"JINTHAALOR:235:285:505:333", "THEOVERLOOKCLIFFS:170:310:693:303", "AERIEPEAK:255:205:13:245", "PLAGUEMISTRAVINE:145:220:158:149", "THEALTAROFZUL:200:165:373:365", "HIRIWATHA:225:200:171:306", "QUELDANILLODGE:185:195:237:185", "VALORWINDLAKE:170:170:319:302", "SHADRAALOR:195:185:240:387", "AGOLWATHA:205:195:374:164", "THECREEPINGRUIN:180:170:408:260", "SERADANE:275:275:509:19", "SKULKROCK:160:145:512:232", "SHAOLWATHA:280:205:571:239",},
  ["UngoroCrater"] = {"GOLAKKAHOTSPRINGS:315:345:121:151", "THESLITHERINGSCAR:345:285:367:380", "FIREPLUMERIDGE:295:270:367:178", "TERRORRUN:345:285:158:368", "THEMARSHLANDS:310:355:560:240", "IRONSTONEPLATEAU:285:285:582:67", "LAKKARITARPITS:570:265:160:6",},
  ["Tanaris"] = {"THISTLESHRUBVALLEY:185:250:203:286", "VALLEYOFTHEWATCHERS:150:160:291:434", "LANDSENDBEACH:205:157:445:511", "ABYSSALSANDS:215:180:363:194", "ZALASHJISDEN:110:140:611:147", "CAVERNSOFTIME:155:150:561:256", "EASTMOONRUINS:160:150:395:346", "GADGETZAN:175:165:421:91", "BROKENPILLAR:110:180:473:234", "SOUTHMOONRUINS:195:210:323:359", "ZULFARRAK:210:175:254:0", "THEGAPINGCHASM:220:210:449:372", "SOUTHBREAKSHORE:215:175:499:293", "DUNEMAULCOMPOUND:205:145:325:289", "THENOXIOUSLAIR:180:200:252:199", "WATERSPRINGFIELD:165:180:509:168", "LOSTRIGGERCOVE:160:190:629:220", "STEAMWHEEDLEPORT:155:150:592:75", "NOONSHADERUINS:120:135:533:104", "SANDSORROWWATCH:195:175:299:100",},
  ["Dustwallow"] = {"THEWYRMBOG:285:240:367:381", "ALCAZISLAND:200:195:660:21", "THERAMOREISLE:230:205:534:224", "WITCHHILL:250:315:422:0", "BRACKENWALLVILLAGE:280:270:230:0", "BACKBAYWETLANDS:400:255:239:189", "THEDENOFFLAME:255:250:257:313",},
  ["ThousandNeedles"] = {"THEGREATLIFT:210:180:205:70", "DARKCLOUDPINNACLE:205:195:259:131", "THESHIMMERINGFLATS:320:365:610:300", "SPLITHOOFCRAG:210:195:391:192", "CAMPETHOK:305:310:0:0", "WINDBREAKCANYON:240:220:492:250", "FREEWINDPOST:210:190:357:264", "HIGHPERCH:190:190:31:155", "THESCREECHINGCANYON:250:240:179:200",},
  ["SearingGorge"] = {"GRIMSILTDIGSITE:305:220:494:300", "THESEAOFCINDERS:360:280:247:388", "TANNERCAMP:305:230:545:407", "DUSTFIREVALLEY:460:365:422:8", "FIREWATCHRIDGE:405:430:85:30", "THECAULDRON:425:325:250:170", "BLACKCHARCAVE:275:235:77:366",},
  ["Ashenvale"] = {"THISTLEFURVILLAGE:255:195:203:158", "THESHRINEOFAESSINA:220:195:104:259", "THEZORAMSTRAND:245:245:19:28", "LAKEFALATHIM:128:195:131:137", "MAESTRASPOST:215:305:205:38", "ASTRANAAR:205:185:272:251", "IRISLAKE:200:205:392:218", "THERUINSOFSTARDUST:155:150:260:373", "FIRESCARSHRINE:165:175:189:324", "MYSTRALLAKE:275:240:356:347", "BOUGHSHADOW:146:200:856:151", "THEHOWLINGVALE:210:185:463:141", "FELFIREHILL:245:255:713:344", "NIGHTRUN:225:255:597:258", "WARSONGLUMBERCAMP:200:160:796:311", "RAYNEWOODRETREAT:180:245:520:238", "FALLENSKYLAKE:235:205:547:426", "SATYRNAAR:285:185:694:225",},
  ["Desolace"] = {"SHADOWPREYVILLAGE:230:230:167:389", "THUNDERAXEFORTRESS:190:220:447:102", "ETHELRETHOR:205:250:311:61", "GELKISVILLAGE:195:242:293:426", "VALLEYOFSPEARS:245:285:212:215", "RANAZJARISLE:100:100:241:6", "MAGRAMVILLAGE:205:285:590:365", "MANNOROCCOVEN:285:280:399:380", "SARGERON:285:245:625:33", "KOLKARVILLAGE:220:220:607:215", "KORMEKSHUT:170:160:555:181", "SHADOWBREAKRAVINE:205:195:690:444", "KODOGRAVEYARD:275:250:387:244", "NIJELSPOINT:200:250:554:0", "TETHRISARAN:205:145:431:0",},
  ["BurningSteppes"] = {"DRACODAR:415:315:56:258", "RUINSOFTHAURISSAN:270:285:513:99", "DREADMAULROCK:220:225:707:168", "MORGANSVIGIL:294:270:708:311", "ALTAROFSTORMS:225:220:36:109", "TERRORWINGPATH:280:355:722:46", "BLACKROCKPASS:270:310:589:279", "PILLAROFASH:320:270:377:285", "BLACKROCKSTRONGHOLD:245:265:334:114", "BLACKROCKMOUNTAIN:256:280:173:101",},
  ["BlastedLands"] = {"DREADMAULPOST:245:195:361:195", "THETAINTEDSCAR:384:450:212:178", "DREADMAULHOLD:195:180:361:15", "GARRISONARMORY:170:200:472:9", "ALTAROFSTORMS:185:155:310:133", "SERPENTSCOIL:225:170:501:140", "DARKPORTAL:265:220:453:259", "NETHERGARDEKEEP:185:190:559:30", "RISEOFTHEDEFILER:170:145:405:123",},
  ["Aszhara"] = {"SHADOWSONGSHRINE:225:180:35:422", "TIMBERMAWHOLD:235:270:250:106", "BAYOFSTORMS:270:300:479:201", "THESHATTEREDSTRAND:160:210:404:194", "JAGGEDREEF:570:170:366:0", "BITTERREACHES:245:185:644:40", "TOWEROFELDARA:120:155:818:107", "FORLORNRIDGE:220:255:191:369", "TEMPLEOFARKKORAN:190:200:681:153", "LEGASHENCAMPMENT:235:140:478:44", "URSOLAN:145:215:422:95", "RUINSOFELDARATH:265:280:238:221", "SOUTHRIDGEBEACH:370:220:389:353", "VALORMOK:215:175:84:229", "THALASSIANBASECAMP:240:155:499:119", "RAVENCRESTMONUMENT:240:125:552:499", "HALDARRENCAMPMENT:200:150:77:331", "THERUINEDREACHES:395:128:396:540", "LAKEMENNAR:315:200:296:429",},
  ["Felwood"] = {"RUINSOFCONSTELLAS:235:155:297:381", "EMERALDSANCTUARY:185:160:405:429", "FELPAWVILLAGE:240:145:483:0", "TALONBRANCHGLADE:160:145:548:90", "MORLOSARAN:145:159:496:509", "JADEFIRERUN:195:170:330:29", "SHATTERSCARVALE:235:200:307:123", "JAEDENAR:245:128:271:331", "BLOODVENOMFALLS:235:145:292:263", "DEADWOODVILLAGE:175:135:408:533", "JADEFIREGLEN:165:155:332:465", "IRONTREEWOODS:215:215:420:54",},
  ["EasternPlaguelands"] = {"THENOXIOUSGLADE:225:215:722:166", "QUELLITHIENLODGE:230:150:422:36", "NORTHPASSTOWER:240:195:457:109", "TERRORDALE:190:205:79:98", "BLACKWOODLAKE:230:235:442:199", "EASTWALLTOWER:180:160:592:241", "DARROWSHIRE:210:179:309:489", "CORINSCROSSING:165:160:537:367", "THEMARRISSTEAD:200:205:156:360", "NORTHDALE:190:205:620:128", "PLAGUEWOOD:360:270:169:83", "LAKEMERELDAR:250:175:537:463", "THEINFECTISSCAR:195:275:620:291", "PESTILENTSCAR:205:250:409:345", "ZULMASHAR:205:165:614:30", "CROWNGUARDTOWER:205:165:291:401", "THONDRORILRIVER:220:360:7:231", "LIGHTSHOPECHAPEL:175:245:716:299", "TYRSHAND:245:170:717:471", "STRATHOLME:240:200:194:9", "THEFUNGALVALE:210:210:271:261", "THEUNDERCROFT:185:150:172:477",},
  ["StonetalonMountains"] = {"BOULDERSLIDERAVINE:145:107:572:561", "WEBWINDERPATH:288:355:457:282", "MIRKFALLONLAKE:200:215:390:145", "CAMPAPARAJE:190:97:718:571", "SISHIRCANYON:125:125:475:433", "STONETALONPEAK:270:205:247:0", "GRIMTOTEMPOST:225:120:668:515", "MALAKAJIN:125:86:663:582", "WINDSHEARCRAG:320:275:553:197", "THECHARREDVALE:230:355:210:234", "SUNROCKRETREAT:150:150:389:320",},
  ["WesternPlaguelands"] = {"DARROWMERELAKE:370:270:504:343", "RUINSOFANDORHOL:285:230:260:355", "THEBULWARK:225:185:137:293", "FELSTONEFIELD:160:125:300:311", "THEWEEPINGCAVE:160:200:566:198", "CAERDARROW:170:165:600:412", "SORROWHILL:300:206:355:462", "GAHRRONSWITHERING:180:205:520:250", "HEARTHGLEN:340:288:307:16", "DALSONSTEARS:220:150:381:265", "THEWRITHINGHAUNT:170:190:451:323", "NORTHRIDGELUMBERCAMP:220:180:382:164", "THONDRORILRIVER:205:340:590:86",},
  ["Feralas"] = {"THEFORGOTTENCOAST:145:320:404:256", "FRAYFEATHERHIGHLANDS:110:170:478:386", "RUINSOFRAVENWIND:190:155:305:0", "THETWINCOLOSSALS:285:245:319:75", "DREAMBOUGH:150:125:454:0", "GORDUNNIOUTPOST:140:165:690:141", "ISLEOFDREAD:215:293:192:375", "LOWERWILDS:225:180:751:198", "FERALSCARVALE:115:115:486:329", "RUINSOFISILDIEN:190:250:540:320", "ONEIROS:110:110:493:70", "DIREMAUL:230:195:454:201", "SARDORISLE:180:180:208:234", "CAMPMOJACHE:155:160:689:233", "THEWRITHINGDEEP:240:220:618:298", "GRIMTOTEMCOMPOUND:120:195:623:167",},
  ["Winterspring"] = {"WINTERFALLVILLAGE:145:125:617:158", "ICETHISTLEHILLS:125:165:611:242", "LAKEKELTHERIL:215:185:401:198", "STARFALLVILLAGE:185:160:392:137", "EVERLOOK:165:200:509:107", "FROSTFIREHOTSPRINGS:240:140:222:172", "FROSTWHISPERGORGE:200:160:523:376", "THEHIDDENGROVE:175:185:555:27", "DARKWHISPERGORGE:255:205:447:441", "FROSTSABERROCK:250:180:368:7", "OWLWINGTHICKET:165:140:593:340", "TIMBERMAWPOST:230:120:229:243", "MAZTHORIL:185:180:493:258",},
  ["Silithus"] = {"THESCARABWALL:288:256:116:413", "THECRYSTALVALE:320:289:104:24", "HIVEASHI:512:320:265:12", "SOUTHWINDVILLAGE:384:384:500:65", "TWILIGHTBASECAMP:320:256:344:197", "HIVEZORA:384:512:97:144", "HIVEREGAL:512:384:245:285",},
  ["DeadwindPass"] = {"THEVICE:270:270:426:299", "KARAZHAN:300:245:269:337", "DEADMANSCROSSING:380:365:249:76",},
  ["AlteracValley"] = {"DUNBALDAR:270:240:348:13", "ICEBLOODGARRISON:300:300:335:172",},
  ["Moonglade"] = { "LAKEELUNEARA:555:510:244:89", }
}

-- Turtle WoW MapOverlayData
if TargetHPText and TargetHPPercText then
  ShaguTweaks.MapOverlayData = {
    ["Durotar"] = { "RAZORHILL:220:230:432:170", "VALLEYOFTRIALS:215:215:355:320", "KOLKARCRAG:160:120:413:476", "SENJINVILLAGE:160:190:474:384", "ECHOISLES:200:240:549:427", "THUNDERRIDGE:190:200:327:60", "DRYGULCHRAVINE:210:160:427:78", "TIRAGARDEKEEP:190:180:462:286", "RAZORMANEGROUNDS:230:230:301:189", "SKULLROCK:128:110:464:33", "ORGRIMMAR:445:160:244:0", },
    ["Mulgore"] = { "REDCLOUDMESA:470:243:270:425", "BLOODHOOFVILLAGE:256:200:367:303", "RAVAGEDCARAVAN:128:120:473:260", "REDROCKS:205:230:502:16", "THEVENTURECOMINE:225:235:532:238", "WINTERHOOFWATERWELL:170:128:458:369", "THUNDERHORNWATERWELL:128:155:379:242", "WILDMANEWATERWELL:185:128:291:0", "BAELDUNDIGSITE:210:180:255:214", "PALEMANEROCK:128:205:303:307", "WINDFURYRIDGE:205:128:395:0", "THEGOLDENPLAINS:215:240:428:80", "THEROLLINGPLAINS:256:190:523:356", "THUNDERBLUFF:280:240:249:59", },
    ["Barrens"] = { "BAELMODAN:128:128:431:479", "CAMPTAURAJO:145:125:365:350", "FARWATCHPOST:100:165:564:52", "THECROSSROADS:155:155:431:118", "BOULDERLODEMINE:120:110:555:0", "THESLUDGEFEN:170:120:456:0", "THEDRYHILLS:200:145:317:29", "DREADMISTPEAK:128:105:419:63", "NORTHWATCHFOLD:150:120:527:307", "THEFORGOTTENPOOLS:120:125:384:115", "LUSHWATEROASIS:175:185:365:177", "THESTAGNANTOASIS:155:128:481:211", "FIELDOFGIANTS:210:150:355:402", "THEMERCHANTCOAST:95:100:581:247", "RATCHET:125:125:556:189", "RAZORFENDOWNS:155:115:407:553", "RAPTORGROUNDS:115:110:507:294", "BRAMBLESCAR:125:165:442:298", "THORNHILL:140:128:498:119", "AGAMAGOR:200:185:340:234", "BLACKTHORNRIDGE:155:128:335:462", "HONORSSTAND:128:128:306:130", "THEMORSHANRAMPART:128:100:412:0", "GROLDOMFARM:125:115:492:63", "RAZORFENKRAUL:128:128:341:537", },
    ["Alterac"] = { "LORDAMEREINTERNMENTCAMP:330:265:44:403", "DALARAN:300:300:26:262", "STRAHNBRAD:370:300:549:105", "RUINSOFALTERAC:255:255:270:197", "CRUSHRIDGEHOLD:280:240:334:162", "THEUPLANDS:235:200:462:77", "GALLOWSCORNER:200:200:406:279", "GAVINSNAZE:160:175:225:478", "SOFERASNAZE:255:320:462:307", "CORRAHNSDAGGER:195:288:399:380", "THEHEADLAND:165:197:314:471", "MISTYSHORE:220:280:196:131", "DANDREDSFOLD:285:230:276:0", "GROWLESSCAVE:190:170:317:372", "CHILLWINDPOINT:350:370:626:253", },
    ["Arathi"] = { "NORTHFOLDMANOR:230:240:192:90", "GOSHEKFARM:230:195:531:276", "DABYRIESFARMSTEAD:180:210:472:165", "BOULDERFISTHALL:215:235:432:362", "WITHERBARKVILLAGE:215:210:559:333", "REFUGEPOINT:175:225:370:186", "HAMMERFALL:205:250:655:120", "STROMGARDEKEEP:240:230:108:287", "FALDIRSCOVE:256:215:171:424", "CIRCLEOFEASTBINDING:160:230:558:112", "CIRCLEOFWESTBINDING:190:210:138:54", "CIRCLEOFINNERBINDING:210:185:286:310", "CIRCLEOFOUTERBINDING:170:155:419:293", "THANDOLSPAN:200:220:355:412", "THORADINSWALL:190:240:87:138", "BOULDERGOR:245:245:232:145", },
    ["Badlands"] = { "APOCRYPHANSREST:255:205:17:310", "ANGORFORTRESS:195:200:325:148", "LETHLORRAVINE:370:455:611:110", "KARGATH:240:255:0:148", "CAMPKOSH:220:220:551:48", "CAMPBOFF:255:280:501:341", "CAMPCAGG:255:220:12:428", "AGMONDSEND:265:270:345:389", "HAMMERTOESDIGSITE:200:195:445:120", "VALLEYOFFANGS:230:230:349:256", "THEDUSTBOWL:270:275:159:199", "MIRAGEFLATS:285:240:148:384", "THEMAKERSTERRACE:245:205:389:7", "DUSTWINDGULCH:245:205:498:209", },
    ["BlastedLands"] = { "DARKPORTAL:265:220:453:259", "THETAINTEDSCAR:384:450:212:178", "DREADMAULHOLD:195:180:361:15", "NETHERGARDEKEEP:185:190:559:30", "DREADMAULPOST:245:195:361:195", "SERPENTSCOIL:225:170:501:140", "ALTAROFSTORMS:185:155:310:133", "GARRISONARMORY:170:200:472:9", "RISEOFTHEDEFILER:170:145:405:123", },
    ["Tirisfal"] = { "BULWARK:230:205:698:362", "DEATHKNELL:245:205:227:328", "SOLLIDENFARMSTEAD:256:156:239:250", "AGAMANDMILLS:256:210:335:139", "BRILL:128:158:537:299", "MONASTARY:211:189:746:125", "BRIGHTWATERLAKE:201:288:587:139", "GARRENSHAUNT:174:220:497:145", "BALNIRFARMSTEAD:216:179:630:326", "COLDHEARTHMANOR:150:128:474:327", "CRUSADEROUTPOST:173:128:694:289", "SCARLETWATCHPOST:175:247:689:104", "STILLWATERPOND:186:128:395:277", "NIGHTMAREVALE:243:199:363:349", "VENOMWEBVALE:237:214:757:205", "RUINSOFLORDAERON:315:235:463:361", },
    ["Silverpine"] = { "FENRISISLE:250:215:593:74", "PYREWOODVILLAGE:140:125:391:446", "DEEPELEMMINE:160:170:470:261", "THESKITTERINGDARK:185:165:286:37", "THESEPULCHER:210:160:352:168", "OLSENSFARTHING:165:185:382:252", "THEGREYMANEWALL:210:215:379:447", "BERENSPERIL:240:180:491:417", "AMBERMILL:240:240:494:262", "SHADOWFANGKEEP:220:160:364:359", "THEDECREPITFERRY:180:185:457:144", "MALDENSORCHARD:256:160:465:0", "THEDEADFIELD:175:165:402:65", "THESHININGSTRAND:256:220:459:13", "NORTHTIDESHOLLOW:180:128:323:128", },
    ["WesternPlaguelands"] = { "HEARTHGLEN:340:288:307:16", "NORTHRIDGELUMBERCAMP:220:180:382:164", "RUINSOFANDORHOL:285:230:260:355", "SORROWHILL:300:206:355:462", "THEWEEPINGCAVE:160:200:566:198", "FELSTONEFIELD:160:125:300:311", "DALSONSTEARS:220:150:381:265", "GAHRRONSWITHERING:180:205:520:250", "THEWRITHINGHAUNT:170:190:451:323", "THEBULWARK:225:185:137:293", "DARROWMERELAKE:370:270:504:343", "CAERDARROW:170:165:600:412", "THONDRORILRIVER:205:340:590:86", },
    ["EasternPlaguelands"] = { "THEFUNGALVALE:210:210:271:261", "THEMARRISSTEAD:200:205:156:360", "THEUNDERCROFT:185:150:172:477", "DARROWSHIRE:210:179:309:489", "CROWNGUARDTOWER:205:165:291:401", "CORINSCROSSING:165:160:537:367", "TYRSHAND:245:170:717:471", "LIGHTSHOPECHAPEL:175:245:716:299", "THENOXIOUSGLADE:225:215:722:166", "EASTWALLTOWER:180:160:592:241", "NORTHDALE:190:205:620:128", "ZULMASHAR:205:165:614:30", "NORTHPASSTOWER:240:195:457:109", "QUELLITHIENLODGE:230:150:422:36", "PLAGUEWOOD:360:270:169:83", "STRATHOLME:240:200:194:9", "THONDRORILRIVER:220:360:7:231", "LAKEMERELDAR:250:175:537:463", "THEINFECTISSCAR:195:275:620:291", "PESTILENTSCAR:205:250:409:345", "BLACKWOODLAKE:230:235:442:199", "TERRORDALE:190:205:79:98", },
    ["Hilsbrad"] = { "SOUTHSHORE:235:270:418:201", "TARRENMILL:220:310:509:0", "DURNHOLDEKEEP:384:365:605:75", "SOUTHPOINTTOWER:288:225:2:192", "HILLSBRADFIELDS:305:275:198:155", "AZURELOADMINE:165:200:175:275", "NETHANDERSTEAD:215:240:541:236", "DUNGAROK:240:275:637:294", "EASTERNSTRAND:230:320:524:339", "WESTERNSTRAND:285:155:208:368", "PURGATIONISLE:125:100:109:482", "DARROWHILL:205:155:414:154", },
    ["Hinterlands"] = { "THEOVERLOOKCLIFFS:170:310:693:303", "AERIEPEAK:255:205:13:245", "QUELDANILLODGE:185:195:237:185", "SKULKROCK:160:145:512:232", "SHADRAALOR:195:185:240:387", "JINTHAALOR:235:285:505:333", "THEALTAROFZUL:200:165:373:365", "SERADANE:275:275:509:19", "PLAGUEMISTRAVINE:145:220:158:149", "VALORWINDLAKE:170:170:319:302", "AGOLWATHA:205:195:374:164", "HIRIWATHA:225:200:171:306", "THECREEPINGRUIN:180:170:408:260", "SHAOLWATHA:280:205:571:239", },
    ["DunMorogh"] = { "KHARANOS:200:200:386:294", "ANVILMAR:240:185:155:403", "GNOMERAGON:180:165:166:184", "GOLBOLARQUARRY:165:165:608:291", "FROSTMANEHOLD:125:125:217:287", "THEGRIZZLEDDEN:200:185:314:311", "BREWNALLVILLAGE:115:115:252:249", "MISTYPINEREFUGE:128:165:502:221", "ICEFLOWLAKE:128:180:281:167", "HELMSBEDLAKE:155:170:694:273", "COLDRIDGEPASS:150:128:295:385", "CHILLBREEZEVALLEY:180:128:274:296", "SHIMMERRIDGE:128:190:347:163", "AMBERSTILLRANCH:128:128:573:280", "THETUNDRIDHILLS:155:128:522:322", "SOUTHERNGATEOUTPOST:128:120:792:279", "NORTHERNGATEOUTPOST:128:165:759:173", "IRONFORGE:315:200:397:163", },
    ["SearingGorge"] = { "THECAULDRON:425:325:250:170", "GRIMSILTDIGSITE:305:220:494:300", "FIREWATCHRIDGE:405:430:85:30", "THESEAOFCINDERS:360:280:247:388", "BLACKCHARCAVE:275:235:77:366", "TANNERCAMP:305:230:545:407", "DUSTFIREVALLEY:460:365:422:8", },
    ["BurningSteppes"] = { "DREADMAULROCK:220:225:707:168", "RUINSOFTHAURISSAN:270:285:513:99", "BLACKROCKSTRONGHOLD:245:265:334:114", "PILLAROFASH:320:270:377:285", "BLACKROCKMOUNTAIN:256:280:173:101", "ALTAROFSTORMS:225:220:36:109", "BLACKROCKPASS:270:310:589:279", "MORGANSVIGIL:294:270:708:311", "TERRORWINGPATH:280:355:722:46", "DRACODAR:415:315:56:258", },
    ["Elwynn"] = { "NORTHSHIREVALLEY:256:256:381:147", "CRYSTALLAKE:225:220:422:332", "FARGODEEPMINE:256:240:238:428", "FORESTSEDGE:256:341:124:327", "BRACKWELLPUMPKINPATCH:256:249:577:419", "STONECAIRNLAKE:310:256:587:190", "GOLDSHIRE:240:220:250:270", "EASTVALELOGGINGCAMP:256:210:704:330", "TOWEROFAZORA:255:250:551:292", "JERODSLANDING:256:237:425:431", "RIDGEPOINTTOWER:306:233:696:435", "STORMWIND:485:405:0:0", },
    ["DeadwindPass"] = { "THEVICE:270:270:426:299", "KARAZHAN:300:245:269:337", "DEADMANSCROSSING:380:365:249:76", },
    ["Duskwood"] = { "DARKSHIRE:315:280:631:162", "VULGOLOGREMOUND:255:285:243:348", "RAVENHILL:195:145:102:302", "TRANQUILGARDENSCEMETARY:220:220:690:353", "THEROTTINGORCHARD:250:230:539:369", "BRIGHTWOODGROVE:220:340:504:117", "THEYORGENFARMSTEAD:235:250:390:382", "RAVENHILLCEMETARY:350:300:85:149", "ADDLESSTEAD:275:250:55:342", "THEDARKENEDBANK:910:210:89:31", "TWILIGHTGROVE:360:420:298:79", "THEHUSHEDBANK:160:330:19:132", "MANORMISTMANTLE:200:175:653:120", },
    ["LochModan"] = { "IRONBANDSEXCAVATIONSITE:345:256:482:321", "MOGROSHSTRONGHOLD:315:235:542:48", "THELSAMAR:256:230:217:203", "STONEWROUGHTDAM:290:175:339:11", "THEFARSTRIDERLODGE:370:295:546:199", "SILVERSTREAMMINE:235:270:229:11", "THELOCH:320:410:352:87", "NORTHGATEPASS:230:300:125:12", "STONESPLINTERVALLEY:255:285:215:348", "VALLEYOFKINGS:195:250:109:370", "GRIZZLEPAWRIDGE:295:358:309:310", },
    ["Redridge"] = { "LAKEEVERSTILL:535:275:133:240", "LAKESHIRE:340:195:83:197", "STONEWATCH:255:300:500:215", "STONEWATCHFALLS:320:210:595:320", "REDRIDGECANYONS:365:245:121:72", "ALTHERSMILL:235:270:399:129", "RENDERSCAMP:275:256:277:0", "RENDERSVALLEY:465:255:484:361", "GALARDELLVALLEY:250:250:654:161", "LAKERIDGEHIGHWAY:430:290:187:333", "THREECORNERS:365:350:0:284", },
    ["Stranglethorn"] = { "ZULGURUB:245:220:483:8", "BOOTYBAY:145:128:203:433", "LAKENAZFERITI:128:125:331:59", "WILDSHORE:165:190:229:422", "REBELCAMP:170:90:284:0", "NESINGWARYSEXPEDITION:140:110:269:26", "KURZENSCOMPOUND:155:150:388:0", "RUINSOFZULKUNDA:125:140:196:3", "RUINSOFZULMAMWE:170:125:394:212", "THEVILEREEF:190:175:152:90", "MOSHOGGOGREMOUND:128:175:432:94", "GROMGOLBASECAMP:110:105:260:132", "ZUULDAIARUINS:115:115:156:42", "BALALRUINS:90:80:241:92", "KALAIRUINS:95:95:299:88", "BALIAMAHRUINS:110:140:371:129", "ZIATAJAIRUINS:128:125:364:231", "MIZJAHRUINS:105:110:311:131", "JAGUEROISLE:125:120:314:493", "CRYSTALVEINMINE:120:120:345:276", "RUINSOFABORAZ:95:95:350:335", "RUINSOFJUBUWAL:110:110:306:301", "MISTVALEVALLEY:125:125:280:368", "NEKMANIWELLSPRING:90:115:211:359", "BLOODSAILCOMPOUND:165:175:194:284", "VENTURECOBASECAMP:105:125:387:64", "THEARENA:200:185:235:189", },
    ["SwampOfSorrows"] = { "POOLOFTEARS:300:275:565:218", "STONARD:360:315:279:237", "FALLOWSANCTUARY:365:305:492:0", "MISTYVALLEY:245:305:0:140", "MISTYREEDSTRAND:256:668:746:0", "THEHARBORAGE:235:205:171:145", "ITHARIUSSCAVE:240:245:0:262", "SORROWMURK:215:365:724:120", "SPLINTERSPEARJUNCTION:275:240:129:236", "STAGALBOG:345:250:552:378", "THESHIFTINGMIRE:315:235:286:110", },
    ["Westfall"] = { "MOONBROOK:220:200:317:331", "SALDEANSFARM:225:210:459:105", "SENTINELHILL:195:240:442:241", "FURLBROWSPUMPKINFARM:210:215:387:11", "JANGOLODEMINE:215:215:307:29", "GOLDCOASTQUARRY:225:256:220:102", "WESTFALLLIGHTHOUSE:280:190:205:467", "ALEXSTONFARMSTEAD:305:210:204:260", "THEJANSENSTEAD:165:200:488:0", "THEDEADACRE:200:240:524:252", "THEMOLSENFARM:225:205:328:148", "THEDAGGERHILLS:256:175:339:418", "DEMONTSPLACE:200:185:208:375", "THEDUSTPLAINS:288:235:523:377", },
    ["Wetlands"] = { "WHELGARSEXCAVATIONSITE:195:185:247:205", "MENETHILHARBOR:175:128:13:314", "DUNMODR:205:180:401:21", "IRONBEARDSTOMB:200:185:349:115", "DIREFORGEHILL:256:250:507:115", "RAPTORRIDGE:190:160:628:176", "BLACKCHANNELMARSH:240:175:77:245", "MOSSHIDEFEN:205:245:527:264", "THELGANROCK:230:190:470:371", "BLUEGILLMARSH:225:190:89:142", "SALTSPRAYGLEN:200:240:237:41", "SUNDOWNMARSH:300:240:92:82", "THEGREENBELT:185:240:456:125", "ANGERFANGENCAMPMENT:225:185:347:218", "GRIMBATOL:350:360:611:230", },
    ["Teldrassil"] = { "DOLANAAR:190:128:462:323", "SHADOWGLEN:225:225:491:153", "LAKEALAMETH:256:185:436:380", "STARBREEZEVILLAGE:200:200:561:292", "GNARLPINEHOLD:185:128:368:443", "THEORACLEGLADE:170:240:272:127", "WELLSPRINGLAKE:180:256:377:93", "POOLSOFARLITHRIEN:128:190:335:313", "RUTTHERANVILLAGE:128:100:494:548", "BANETHILHOLLOW:160:210:382:281", "DARNASSUS:315:256:101:247", },
    ["Darkshore"] = { "AUBERDINE:150:215:318:162", "RUINSOFMATHYSTRA:195:215:510:0", "TOWEROFALTHALAXX:170:195:468:85", "BASHALARAN:180:195:365:181", "AMETHARAN:190:205:324:306", "GROVEOFTHEANCIENTS:200:170:305:412", "THEMASTERSGLAIVE:175:158:329:510", "REMTRAVELSEXCAVATION:175:183:229:485", "CLIFFSPRINGRIVER:230:190:375:94", },
    ["Ashenvale"] = { "MAESTRASPOST:215:305:205:38", "THEZORAMSTRAND:245:245:19:28", "ASTRANAAR:205:185:272:251", "THESHRINEOFAESSINA:220:195:104:259", "FIRESCARSHRINE:165:175:189:324", "THERUINSOFSTARDUST:155:150:260:373", "THEHOWLINGVALE:210:185:463:141", "MYSTRALLAKE:275:240:356:347", "FALLENSKYLAKE:235:205:547:426", "IRISLAKE:200:205:392:218", "RAYNEWOODRETREAT:180:245:520:238", "NIGHTRUN:225:255:597:258", "SATYRNAAR:285:185:694:225", "FELFIREHILL:245:255:713:344", "WARSONGLUMBERCAMP:200:160:796:311", "BOUGHSHADOW:146:200:856:151", "LAKEFALATHIM:128:195:131:137", "THISTLEFURVILLAGE:255:195:203:158", },
    ["ThousandNeedles"] = { "THESHIMMERINGFLATS:320:365:610:300", "CAMPETHOK:305:310:0:0", "SPLITHOOFCRAG:210:195:391:192", "HIGHPERCH:190:190:31:155", "THESCREECHINGCANYON:250:240:179:200", "FREEWINDPOST:210:190:357:264", "THEGREATLIFT:210:180:205:70", "DARKCLOUDPINNACLE:205:195:259:131", "WINDBREAKCANYON:240:220:492:250", },
    ["StonetalonMountains"] = { "SUNROCKRETREAT:512:256:256:256", "WINDSHEARCRAG:256:256:512:256", "MIRKFALLONLAKE:512:512:256:0", "THECHARREDVALE:256:512:256:256", "STONETALONPEAK:256:256:256:0", "WEBWINDERPATH:256:512:512:256", "AMANIALOR:512:256:0:0", "GRIMTOTEMPOST:512:256:512:512", "CAMPAPARAJE:512:256:512:512", "MALAKAJIN:512:256:512:512", "BOULDERSLIDERAVINE:256:256:512:512", "SISHIRCANYON:256:512:512:256", "VENTURECOMPANYCAMP:256:512:256:0", "BLACKSANDOILFIELDS:512:512:0:0", "POWDERTOWN:256:256:256:256", "BRAMBLETHORNPASS:512:512:512:256", "BAELHARDUL:512:256:512:256", "BROKENCLIFFMINE:256:512:256:0", "THEEARTHENRING:512:256:256:256", },
    ["Desolace"] = { "KODOGRAVEYARD:275:250:387:244", "THUNDERAXEFORTRESS:190:220:447:102", "MANNOROCCOVEN:285:280:399:380", "SARGERON:285:245:625:33", "MAGRAMVILLAGE:205:285:590:365", "GELKISVILLAGE:195:242:293:426", "VALLEYOFSPEARS:245:285:212:215", "NIJELSPOINT:200:250:554:0", "KOLKARVILLAGE:220:220:607:215", "SHADOWBREAKRAVINE:205:195:690:444", "TETHRISARAN:205:145:431:0", "ETHELRETHOR:205:250:311:61", "RANAZJARISLE:100:100:241:6", "KORMEKSHUT:170:160:555:181", "SHADOWPREYVILLAGE:230:230:167:389", },
    ["Feralas"] = { "CAMPMOJACHE:155:160:689:233", "GRIMTOTEMCOMPOUND:120:195:623:167", "THEWRITHINGDEEP:240:220:618:298", "GORDUNNIOUTPOST:140:165:690:141", "FERALSCARVALE:115:115:486:329", "FRAYFEATHERHIGHLANDS:110:170:478:386", "THEFORGOTTENCOAST:145:320:404:256", "DREAMBOUGH:150:125:454:0", "ONEIROS:110:110:493:70", "RUINSOFRAVENWIND:190:155:305:0", "THETWINCOLOSSALS:285:245:319:75", "SARDORISLE:180:180:208:234", "ISLEOFDREAD:215:293:192:375", "LOWERWILDS:225:180:751:198", "RUINSOFISILDIEN:190:250:540:320", "DIREMAUL:230:195:454:201", },
    ["Dustwallow"] = { "BRACKENWALLVILLAGE:280:270:230:0", "WITCHHILL:250:315:422:0", "THEDENOFFLAME:255:250:257:313", "THEWYRMBOG:285:240:367:381", "THERAMOREISLE:230:205:534:224", "ALCAZISLAND:200:195:660:21", "BACKBAYWETLANDS:400:255:239:189", },
    ["Tanaris"] = { "GADGETZAN:175:165:421:91", "STEAMWHEEDLEPORT:155:150:592:75", "ZULFARRAK:210:175:254:0", "SANDSORROWWATCH:195:175:299:100", "THISTLESHRUBVALLEY:185:250:203:286", "THEGAPINGCHASM:220:210:449:372", "THENOXIOUSLAIR:180:200:252:199", "DUNEMAULCOMPOUND:205:145:325:289", "EASTMOONRUINS:160:150:395:346", "WATERSPRINGFIELD:165:180:509:168", "ZALASHJISDEN:110:140:611:147", "LANDSENDBEACH:205:157:445:511", "VALLEYOFTHEWATCHERS:150:160:291:434", "SOUTHMOONRUINS:195:210:323:359", "LOSTRIGGERCOVE:160:190:629:220", "NOONSHADERUINS:120:135:533:104", "BROKENPILLAR:110:180:473:234", "ABYSSALSANDS:215:180:363:194", "SOUTHBREAKSHORE:215:175:499:293", "CAVERNSOFTIME:155:150:561:256", },
    ["Aszhara"] = { "TIMBERMAWHOLD:235:270:250:106", "LEGASHENCAMPMENT:235:140:478:44", "THALASSIANBASECAMP:240:155:499:119", "RUINSOFELDARATH:265:280:238:221", "URSOLAN:145:215:422:95", "TEMPLEOFARKKORAN:190:200:681:153", "BAYOFSTORMS:270:300:479:201", "THESHATTEREDSTRAND:160:210:404:194", "TOWEROFELDARA:120:155:818:107", "JAGGEDREEF:570:170:366:0", "SOUTHRIDGEBEACH:370:220:389:353", "RAVENCRESTMONUMENT:240:125:552:499", "FORLORNRIDGE:220:255:191:369", "LAKEMENNAR:315:200:296:429", "SHADOWSONGSHRINE:225:180:35:422", "HALDARRENCAMPMENT:200:150:77:331", "VALORMOK:215:175:84:229", "THERUINEDREACHES:395:128:396:540", "BITTERREACHES:245:185:644:40", },
    ["Felwood"] = { "DEADWOODVILLAGE:175:135:408:533", "FELPAWVILLAGE:240:145:483:0", "JAEDENAR:245:128:271:331", "BLOODVENOMFALLS:235:145:292:263", "SHATTERSCARVALE:235:200:307:123", "IRONTREEWOODS:215:215:420:54", "TALONBRANCHGLADE:160:145:548:90", "MORLOSARAN:145:159:496:509", "EMERALDSANCTUARY:185:160:405:429", "JADEFIREGLEN:165:155:332:465", "RUINSOFCONSTELLAS:235:155:297:381", "JADEFIRERUN:195:170:330:29", },
    ["UngoroCrater"] = { "FIREPLUMERIDGE:295:270:367:178", "LAKKARITARPITS:570:265:160:6", "TERRORRUN:345:285:158:368", "THESLITHERINGSCAR:345:285:367:380", "GOLAKKAHOTSPRINGS:315:345:121:151", "THEMARSHLANDS:310:355:560:240", "IRONSTONEPLATEAU:285:285:582:67", },
    ["Moonglade"] = { "LAKEELUNEARA:555:510:244:89", },
    ["Silithus"] = { "THESCARABWALL:288:256:116:413", "SOUTHWINDVILLAGE:384:384:500:65", "THECRYSTALVALE:320:289:104:24", "HIVEASHI:512:320:265:12", "HIVEZORA:384:512:97:144", "HIVEREGAL:512:384:245:285", "TWILIGHTBASECAMP:320:256:344:197", },
    ["Winterspring"] = { "FROSTSABERROCK:250:180:368:7", "THEHIDDENGROVE:175:185:555:27", "TIMBERMAWPOST:230:120:229:243", "WINTERFALLVILLAGE:145:125:617:158", "MAZTHORIL:185:180:493:258", "FROSTFIREHOTSPRINGS:240:140:222:172", "ICETHISTLEHILLS:125:165:611:242", "FROSTWHISPERGORGE:200:160:523:376", "OWLWINGTHICKET:165:140:593:340", "LAKEKELTHERIL:215:185:401:198", "STARFALLVILLAGE:185:160:392:137", "EVERLOOK:165:200:509:107", "DARKWHISPERGORGE:255:205:447:441", },
    ["AlteracValley"] = { "DUNBALDAR:270:240:348:13", "ICEBLOODGARRISON:300:300:335:172", "FROSTWOLFKEEP:235:290:399:375", },
    ["Hyjal"] = { "BLEAKHOLLOWCRATER:512:512:256:0", "NORDRASSILGLADE:512:512:512:0", "NORDANAAR:256:512:768:0", "BARKSKINPLATEAU:512:256:256:256", "BARKSKINVILLAGE:768:512:256:256", "CIRCLEOFPOWER:512:512:0:0", "RUINSOFTELENNAS:512:512:0:0", "ZULHATHA:256:512:0:0", "DARKHOLLOWPASS:512:512:256:256", "THEEMERALDGATEWAY:512:512:0:256", },
    ["Lapidis"] = { "SHANKSREEF:512:256:256:0", "CROWNISLAND:256:256:512:0", "THEROCK:256:256:512:0", "BRIGHTCOAST:768:512:0:0", "ZULHAZU:512:512:256:256", "WALLOWINGCOAST:512:256:256:256", "HAZURRIGLADE:512:256:256:256", "GORDOSHHEIGHTS:256:512:256:0", "CAELANSREST:256:512:512:0", "TOWEROFLAPIDIS:512:512:256:0", },
    ["Gillijim"] = { "DEEPTIDESANCTUM:512:256:0:512", "SILVERCOAST:512:512:256:256", "SILVERSANDBAR:256:512:256:256", "ZULRAZAR:256:256:256:256", "TANGLEWOOD:256:256:512:256", "JADEMINE:512:256:256:256", "RUINSOFZULRAZAR:512:512:256:256", "GILLIJIMSTRAND:256:512:512:0", "MAULOGGREFUGE:512:512:512:256", "MAULOGGPOST:256:512:512:256", "KALKORPOINT:512:512:256:0", "KAZONISLAND:512:256:256:0", "SOUTHSEASANDBAR:512:256:0:0", "DISTILLERYISLE:512:512:0:0", "FAELONSFOLLY:256:256:256:256", },
    ["TelAbim"] = { "TELCOBASECAMP:512:512:256:256", "BIXXLESSTOREHOUSE:512:512:256:0", "HIGHVALERISE:512:512:256:0", "THEDERELICTCAMP:512:256:256:256", "TAZZOSSHACK:512:512:256:256", "THEJAGGEDISLES:512:512:256:0", },
    ["Gilneas"] = { "GILNEASCITY:512:512:0:0", "RAVENSHIRE:512:512:256:256", "RAVENWOODKEEP:512:512:256:256", "BROLOKMOUND:512:256:256:256", "SOUTHMIREORCHARD:256:256:256:256", "HOLLOWWEBWOODS:256:512:256:256", "HOLLOWWEBCEMETARY:512:512:0:256", "SHADEMORETAVERN:256:256:256:256", "RUINSOFGREYSHIRE:512:256:0:256", "NORTHGATETOWER:512:512:256:0", "ROSEWICKPLANTATION:256:512:256:0", "GLAYMORESTEAD:512:256:256:0", "THEOVERGROWNACRE:512:256:256:256", "THEDRYROCKPIT:512:256:0:256", "THEDRYROCKMINE:512:256:0:256", "FREYSHEARKEEP:256:256:512:256", "GREYMANESWATCH:256:256:512:256", "OLDROCKPASS:256:256:256:0", "STILLWARDCHURCH:512:512:256:0", "THEGREYMANEWALL:512:256:256:0", "BLACKTHORNSCAMP:256:512:0:0", "DAWNSTONEMINE:256:512:256:0", },
    ["Icepoint"] = { "KANEQNUUN:1024:768:0:0", },
    ["BlackstoneIsland"] = { "RUSTGATERIDGE:512:512:256:256", "BLACKASHCOALPITS:512:768:0:0", "BLACKASHMINE:512:512:256:0", "THEWATERHOLE:512:512:256:0", "GAZZIKSWORKSHOP:512:512:256:256", "VENTURECOSLUMS:512:512:256:0", "RUSTGATELUMBERYARD:256:512:512:0", },
    ["ThalassianHighlands"] = { "ALAHTHALAS:768:512:256:0", "SILVERSUNMINE:256:512:256:256", "FELSTRIDERRETREAT:512:512:0:256", "THEFARSTRIDE:512:512:0:0", "ISLEOFETERNALAUTUMN:512:512:0:0", "ANASTERIANPARK:512:512:256:0", "BRINTHILIEN:512:512:256:256", "RUINSOFNASHALARAN:512:512:0:0", "THELASTRUNESTONE:512:512:256:256", },
    ["UpperKarazhan2f"] = { "OUTLAND:1024:768:0:0", },
    ["GrimReaches"] = { "DUNKITHAS:512:256:256:256", "THEGRIMHOLLOW:512:512:256:256", "LAKEKITHAS:512:256:256:256", "SLATEBEARDSFORGE:512:256:256:256", "THEHIGHPASS:256:256:256:256", "SALGAZMINES:256:256:512:256", "EASTRIDGEOUTPOST:512:512:256:0", "BAGGOTHSRAMPART:256:512:256:0", "RUINSOFSTOLGAZKEEP:256:256:256:0", "GROLDANSEXCAVATION:256:512:512:0", "ZARMGETHSTRONGHOLD:512:256:256:0", "GETHKAR:512:256:256:0", "ZARMGETHPOINT:512:256:256:0", "SHATTERBLADEPOST:256:256:512:0", "BRANGARSFOLLY:256:256:512:0", "BARLEYCRESTFARMSTEAD:512:512:256:0", },
    ["Balor"] = { "GULLWINGWRECKAGE:512:256:0:0", "BILGERATCOMPOUND:256:256:256:0", "SIOUTPOST:256:512:512:256", "RUINSOFBREEZEHAVEN:512:256:256:256", "CROAKINGPLATEAU:512:512:256:0", "LANGSTONORCHARD:256:256:256:256", "SORROWMORELAKE:256:256:256:256", "SCURRYINGTHICKET:256:512:256:0", "STORMWROUGHTCASTLE:512:256:256:256", "STORMREAVERSPIRE:512:512:256:256", "WINDROCKCLIFFS:256:512:256:256", "TREACHEROUSCRAGS:512:512:256:256", "VANDERFARMSTEAD:256:256:256:256", "GRAHANESTATE:256:256:256:256", "STORMBREAKERPOINT:512:512:512:0", },
    ["Northwind"] = { "MERCHANTSHIGHROAD:512:512:256:256", "AMBERSHIRE:512:256:256:256", "AMBERWOODKEEP:512:256:0:256", "CRYSTALFALLS:512:512:512:256", "CRAWFORDWINERY:256:256:512:256", "NORTHWINDLOGGINGCAMP:256:512:256:0", "WITCHCOVEN:256:256:256:0", "RUINSOFBIRKHAVEN:512:512:512:0", "SHERWOODQUARRY:512:512:512:0", "BLACKROCKBREACH:512:512:512:0", "GRIMMENLAKE:256:512:512:256", "ABBEYGARDENS:256:256:512:0", "STILLHEARTPORT:512:512:0:0", "TOWEROFMAGILOU:512:512:0:0", "BRISTLEWHISKERCAVERN:256:512:512:0", "NORTHRIDGEPOINT:512:512:256:0", "CINDERFALLPASS:512:512:512:256", },
  }
end

module.enable = function(self)
  -- do not load if other map addon is loaded
  if Cartographer then return end
  if METAMAP_TITLE then return end

  local enabled = true

  local mapreveal = {}
  mapreveal.onmap = CreateFrame("CheckButton", "shagutweaks_mapreveal_onmap", WorldMapFrame, "UICheckButtonTemplate")
  mapreveal.onmap.text = _G["shagutweaks_mapreveal_onmapText"]
  mapreveal.onmap:SetWidth(14)
  mapreveal.onmap:SetHeight(14)
  mapreveal.onmap:SetPoint("TOPLEFT", WorldMapButton, "TOPLEFT", 1, 19)
  mapreveal.onmap.text:SetPoint("LEFT", mapreveal.onmap, "RIGHT", 2, 0)
  mapreveal.onmap.text:SetText(T["Reveal Unexplored"])
  mapreveal.onmap:SetScript("OnShow", function()
    this:SetChecked(enabled)
  end)

  mapreveal.onmap:SetScript("OnClick", function ()
    if this:GetChecked() then
      enabled = true
    else
      enabled = false
    end

    WorldMapFrame_Update()
  end)

  local errata = {
    ["Interface\\WorldMap\\Tirisfal\\BRIGHTWATERLAKE"] = {offsetX={587,584}},
    ["Interface\\WorldMap\\Silverpine\\BERENSPERIL"] = {offsetY={417,415}},
  }

  local function create_hash(prefix, textureName, textureWidth, textureHeight, offsetX, offsetY, mapPointX, mapPointY)
    local hash = string.format(":%s:%s:%s:%s",textureWidth,textureHeight,offsetX,offsetY)
    if (mapPointX ~= 0 or mapPointY ~= 0) then
      hash = string.format("%s:%s:%s",hash,tostring(mapPointX),tostring(mapPointY))
    end
    if string.sub(textureName, 0, string.len(prefix)) == prefix then
      return string.format("%s%s",string.sub(textureName, string.len(prefix) + 1),hash)
    end
    return string.format("|%s",hash)
  end

  local function unpack_hash(prefix, hash)
    local _, stored_prefix, textureName, textureWidth, textureHeight, offsetX, offsetY, mapPointX, mapPointY, name
    _, _, stored_prefix, textureName, textureWidth, textureHeight, offsetX, offsetY = string.find(hash, "^([|]?)([^:]+):([^:]+):([^:]+):([^:]+):([^:]+)")
    if (not textureName or not offsetY) then
      return
    end
    if (offsetY) then
      _, _, mapPointX, mapPointY = string.find(hash,"^[|]?[^:]+:[^:]+:[^:]+:[^:]+:[^:]+:([^:]+):([^:]+)")
    end
    if (not mapPointY) then
      mapPointX = 0 mapPointY = 0
    end
    if (stored_prefix ~= "|") then
      name = textureName
      textureName = string.format("%s%s",prefix,textureName)
    end
    -- coerce to number by addition; cheaper than tonumber()
    return textureName, textureWidth + 0, textureHeight + 0, offsetX + 0, offsetY + 0, mapPointX + 0, mapPointY + 0, name
  end

  local explores = {}
  local explorecaches = {}

  local exploreEnter = function()
    WorldMapTooltip:ClearLines()
    WorldMapTooltip:SetOwner(this, "ANCHOR_TOP")
    WorldMapTooltip:AddLine(T["Exploration Point"]..":", .3, 1, .8)
    WorldMapTooltip:AddLine(this.name, 1, 1, 1)
    WorldMapTooltip:Show()
  end

  local exploreLeave = function()
    WorldMapTooltip:Hide()
  end

  local function ShaguTweaksWorldMapFrame_Update()
    -- create metatable if not yet created
    this.overlayData = this.overlayData or setmetatable(ShaguTweaks.MapOverlayData, {__index = function(t,k)
      local v = {}
      rawset(t,k,v)
      return v
    end})

    local mapFileName, textureHeight, textureWidth = GetMapInfo()

    if (not mapFileName) then mapFileName = "World" end

    local prefix = string.format("Interface\\WorldMap\\%s\\",mapFileName)
    local numOverlays = GetNumMapOverlays()

    local alreadyknown = {}
    for i=1, numOverlays do
      local textureName, textureWidth, textureHeight, offsetX, offsetY, mapPointX, mapPointY = GetMapOverlayInfo(i)
      local overlayHash = create_hash(textureName, textureWidth, textureHeight, offsetX, offsetY, mapPointX, mapPointY)
      alreadyknown[textureName] = overlayHash
    end

    -- hide all exploration points
    for k, frame in pairs(explores) do
      frame:Hide()
    end

    local zoneData = this.overlayData[mapFileName]
    local textureCount = 0
    local texturePixelWidth, textureFileWidth, texturePixelHeight, textureFileHeight
    for i, hash in ipairs(zoneData) do
      local textureName, textureWidth, textureHeight, offsetX, offsetY, mapPointX, mapPointY, name = unpack_hash(prefix, hash)

      explores[i] = explores[i] or CreateFrame("Frame", nil, WorldMapDetailFrame)
      local explore = explores[i]
      explore:SetWidth(16)
      explore:SetHeight(16)
      explore:SetPoint("TOPLEFT", "WorldMapDetailFrame", "TOPLEFT", offsetX+textureWidth/2, -offsetY-textureHeight/2)
      explore:SetScript("OnEnter", exploreEnter)
      explore:SetScript("OnLeave", exploreLeave)
      explore:EnableMouse(true)
      explore:SetFrameLevel(255)
      explore.name = mapFileName .. " (" .. name .. ")"
      explore.tex = explore.tex or explore:CreateTexture("", "OVERLAY")
      explore.tex:SetBlendMode("ADD")
      explore.tex:SetTexCoord(.08, .92, .08, .92)
      explore.tex:SetAllPoints()

      -- show exploration points
      if self.config["map.reveal.marker"] == "on" and enabled and not alreadyknown[textureName] then
        explore.tex:SetTexture("Interface\\WorldMap\\WorldMap-MagnifyingGlass")
        explore:Show()
      else
        explore:Hide()
      end

      if enabled or alreadyknown[textureName] then
        if errata[textureName] and errata[textureName].offsetX and errata[textureName].offsetX[1] == offsetX then
          offsetX = errata[textureName].offsetX[2]
        end
        if errata[textureName] and errata[textureName].offsetY and errata[textureName].offsetY[1] == offsetY then
          offsetY = errata[textureName].offsetY[2]
        end
        local numTexturesHorz = math.ceil(textureWidth / 256)
        local numTexturesVert = math.ceil(textureHeight / 256)
        local neededTextures = textureCount + (numTexturesHorz * numTexturesVert)
        local texture, texturePixelWidth, textureFileWidth, texturePixelHeight, textureFileHeight
        if (neededTextures > NUM_WORLDMAP_OVERLAYS) then
          for j = NUM_WORLDMAP_OVERLAYS + 1, neededTextures do
            _G.WorldMapDetailFrame:CreateTexture(string.format("%s%s","WorldMapOverlay",j), "ARTWORK")
          end
          NUM_WORLDMAP_OVERLAYS = neededTextures
        end
        for j = 1, numTexturesVert do
          if (j < numTexturesVert) then
            texturePixelHeight,textureFileHeight = 256,256
          else
            texturePixelHeight = mod(textureHeight, 256)
            if (texturePixelHeight == 0) then texturePixelHeight = 256 end
            textureFileHeight = 16
            while (textureFileHeight < texturePixelHeight) do
              textureFileHeight = textureFileHeight * 2
            end
          end
          for k = 1, numTexturesHorz do
            if (textureCount > NUM_WORLDMAP_OVERLAYS) then
              return
            end
            texture = _G[string.format("%s%s","WorldMapOverlay",(textureCount + 1))]
            if (k < numTexturesHorz) then
              texturePixelWidth, textureFileWidth = 256,256
            else
              texturePixelWidth = mod(textureWidth, 256)
              if (texturePixelWidth == 0) then texturePixelWidth = 256 end
              textureFileWidth = 16
              while (textureFileWidth < texturePixelWidth) do
                textureFileWidth = textureFileWidth * 2
              end
            end
            texture:SetWidth(texturePixelWidth)
            texture:SetHeight(texturePixelHeight)
            texture:SetTexCoord(0, texturePixelWidth / textureFileWidth, 0, texturePixelHeight / textureFileHeight)
            texture:ClearAllPoints()
            texture:SetPoint("TOPLEFT", "WorldMapDetailFrame", "TOPLEFT", offsetX + (256 *(k - 1)), -(offsetY +(256 *(j - 1))))
            texture:SetTexture(string.format("%s%s",textureName,(((j - 1) * numTexturesHorz) + k)))

            explorecaches[name] = explorecaches[name] or {}
            explorecaches[name][texture] = true

            if not alreadyknown[textureName] then
              texture:SetVertexColor(.4,.4,.4,1)
            else
              texture:SetVertexColor(1,1,1,1)
            end
            texture:Show()
            textureCount = textureCount + 1
          end
        end
      end
    end
  end

  -- hook map reveal functions before and after the actual call
  local ShaguTweaksHookWorldMapFrame_Update = _G.WorldMapFrame_Update
  _G.WorldMapFrame_Update = function(self)
    -- hide all previously set textures
    for i = 1, NUM_WORLDMAP_OVERLAYS do
      _G[string.format("%s%s","WorldMapOverlay",i)]:Hide()
    end

    -- let the game put its explored tiles on the map
    ShaguTweaksHookWorldMapFrame_Update(self)

    -- let the addon extend it with its own data
    ShaguTweaksWorldMapFrame_Update()
  end
end
