-- See LICENSE for terms

if not g_AvailableDlc.picard then
	print(CurrentModDef.title, ": Below & Beyond DLC not installed! Abort!")
	return
end

local T = T
ChoGGi_AsteroidNames = {
	T(0000, "Absolutno"),
	T(0000, "Acamar"),
	T(0000, "Achernar"),
	T(0000, "Achird"),
	T(0000, "Acrab"),
	T(0000, "Acrux"),
	T(0000, "Acubens"),
	T(0000, "Adara"),
	T(0000, "Adhafera"),
	T(0000, "Adhara"),
	T(0000, "Adhil"),
	T(0000, "Agena"),
	T(0000, "Ain"),
	T(0000, "Ain Al Rami"),
	T(0000, "Al Anz"),
	T(0000, "Al Ashfar"),
	T(0000, "Al Kalb Al Rai"),
	T(0000, "Al Minliar Al Asad"),
	T(0000, "Al Minliar Al Shuja"),
	T(0000, "Aladfar"),
	T(0000, "Alathfar"),
	T(0000, "Albaldah"),
	T(0000, "Albali"),
	T(0000, "Albireo"),
	T(0000, "Alchiba"),
	T(0000, "Alcor"),
	T(0000, "Alcyone"),
	T(0000, "Aldebaran"),
	T(0000, "Alderamin"),
	T(0000, "Aldhibah"),
	T(0000, "Alfecca Meridiana"),
	T(0000, "Alfirk"),
	T(0000, "Algedi"),
	T(0000, "Algenib"),
	T(0000, "Algenubi"),
	T(0000, "Algieba"),
	T(0000, "Algol"),
	T(0000, "Algorab"),
	T(0000, "Alhena"),
	T(0000, "Alioth"),
	T(0000, "Alkaid"),
	T(0000, "Alkalurops"),
	T(0000, "Alkes"),
	T(0000, "Alkurhah"),
	T(0000, "Almaak"),
	T(0000, "Almach"),
	T(0000, "Alnair"),
	T(0000, "Alnasl"),
	T(0000, "Alnath"),
	T(0000, "Alnilam"),
	T(0000, "Alnitak"),
	T(0000, "Alniyat"),
	T(0000, "Alphard"),
	T(0000, "Alphecca"),
	T(0000, "Alphekka"),
	T(0000, "Alpheratz"),
	T(0000, "Alrai"),
	T(0000, "Alrescha"),
	T(0000, "Alrisha"),
	T(0000, "Alsafi"),
	T(0000, "Alsciaukat"),
	T(0000, "Alshain"),
	T(0000, "Alshat"),
	T(0000, "Alsuhail"),
	T(0000, "Altair"),
	T(0000, "Altarf"),
	T(0000, "Alterf"),
	T(0000, "Aludra"),
	T(0000, "Alya"),
	T(0000, "Alzirr"),
	T(0000, "Ancha"),
	T(0000, "Andromedae"),
	T(0000, "Angetenar"),
	T(0000, "Ankaa"),
	T(0000, "Anser"),
	T(0000, "Antares"),
	T(0000, "Aquarii"),
	T(0000, "Aquilae"),
	T(0000, "Arcturus"),
	T(0000, "Arietis"),
	T(0000, "Arkab Posterior"),
	T(0000, "Arkab Prior"),
	T(0000, "Arneb"),
	T(0000, "Arrakis"),
	T(0000, "Ascella"),
	T(0000, "Aspidiske"),
	T(0000, "Asterope"),
	T(0000, "Atik"),
	T(0000, "Atlas"),
	T(0000, "Atria"),
	T(0000, "Aurigae"),
	T(0000, "Australis"),
	T(0000, "Auva"),
	T(0000, "Avior"),
	T(0000, "Azelfafage"),
	T(0000, "Azha"),
	T(0000, "Azmidiske"),
	T(0000, "Baham"),
	T(0000, "Baten Kaitos"),
	T(0000, "Becrux"),
	T(0000, "Beid"),
	T(0000, "Bellatrix"),
	T(0000, "Betelgeuse"),
	T(0000, "Bootis"),
	T(0000, "Botis"),
	T(0000, "Borealis"),
	T(0000, "Botein"),
	T(0000, "Brachium"),
	T(0000, "Cancri"),
	T(0000, "Canopus"),
	T(0000, "Canum Venaticorum"),
	T(0000, "Capella"),
	T(0000, "Caph"),
	T(0000, "Capricorni"),
	T(0000, "Carinae"),
	T(0000, "Cassiopeiae"),
	T(0000, "Castor"),
	T(0000, "Cebalrai"),
	T(0000, "Celaeno"),
	T(0000, "Centauri"),
	T(0000, "Cephei"),
	T(0000, "Ceti"),
	T(0000, "Chara"),
	T(0000, "Chort"),
	T(0000, "Columbae"),
	T(0000, "Cor Caroli"),
	T(0000, "Coronae Borealis"),
	T(0000, "Corvi"),
	T(0000, "Crucis"),
	T(0000, "Cursa"),
	T(0000, "Cygni"),
	T(0000, "Dabih"),
	T(0000, "Deneb"),
	T(0000, "Denebola"),
	T(0000, "Dheneb"),
	T(0000, "Diadem"),
	T(0000, "Diphda"),
	T(0000, "Double Double"),
	T(0000, "Draconis"),
	T(0000, "Dschubba"),
	T(0000, "Dsiban"),
	T(0000, "Dubhe"),
	T(0000, "Dulfim"),
	T(0000, "Ed Asich"),
	T(0000, "Edasich"),
	T(0000, "El Okab"),
	T(0000, "Electra"),
	T(0000, "Elnath"),
	T(0000, "Eltanin"),
	T(0000, "Enif"),
	T(0000, "Equulei"),
	T(0000, "Eridani"),
	T(0000, "Errai"),
	T(0000, "Etamin"),
	T(0000, "Fomalhaut"),
	T(0000, "Fornacis"),
	T(0000, "Fum Al Samakah"),
	T(0000, "Furud"),
	T(0000, "Gacrux"),
	T(0000, "Garnet Star"),
	T(0000, "Geminorum"),
	T(0000, "Gianfar"),
	T(0000, "Gienah"),
	T(0000, "Gomeisa"),
	T(0000, "Gorgonea"),
	T(0000, "Graffias"),
	T(0000, "Grafias"),
	T(0000, "Gruis"),
	T(0000, "Grumium"),
	T(0000, "Hadar"),
	T(0000, "Haedi"),
	T(0000, "Hamal"),
	T(0000, "Hassaleh"),
	T(0000, "Head Of Hydrus"),
	T(0000, "Herculis"),
	T(0000, "Heze"),
	T(0000, "Hoedus"),
	T(0000, "Homam"),
	T(0000, "Hyadum"),
	T(0000, "Hydrae"),
	T(0000, "Iota"),
	T(0000, "Izar"),
	T(0000, "Jabbah"),
	T(0000, "Kaffaljidhma"),
	T(0000, "Kaitos Shemali"),
	T(0000, "Kajam"),
	T(0000, "Kappa Orionis"),
	T(0000, "Keid"),
	T(0000, "Kitalpha"),
	T(0000, "Kocab"),
	T(0000, "Kochab"),
	T(0000, "Kornephoros"),
	T(0000, "Kraz"),
	T(0000, "Kuma"),
	T(0000, "Leonis"),
	T(0000, "Leporis"),
	T(0000, "Lesath"),
	T(0000, "Librae"),
	T(0000, "Lyrae"),
	T(0000, "Maasym"),
	T(0000, "Maia"),
	T(0000, "Majoris"),
	T(0000, "Marfak"),
	T(0000, "Marfic"),
	T(0000, "Marfik"),
	T(0000, "Markab"),
	T(0000, "Matar"),
	T(0000, "Mebsuta"),
	T(0000, "Media"),
	T(0000, "Megrez"),
	T(0000, "Meissa"),
	T(0000, "Mekbuda"),
	T(0000, "Menkalinan"),
	T(0000, "Menkar"),
	T(0000, "Menkent"),
	T(0000, "Menkib"),
	T(0000, "Merak"),
	T(0000, "Merga"),
	T(0000, "Meridionalis"),
	T(0000, "Merope"),
	T(0000, "Mesarthim"),
	T(0000, "Metallah"),
	T(0000, "Miaplacidus"),
	T(0000, "Mimosa"),
	T(0000, "Minkar"),
	T(0000, "Minoris"),
	T(0000, "Mintaka"),
	T(0000, "Mira"),
	T(0000, "Mirach"),
	T(0000, "Miram"),
	T(0000, "Mirfak"),
	T(0000, "Mirphak"),
	T(0000, "Mirzam"),
	T(0000, "Mizar"),
	T(0000, "Mothallah"),
	T(0000, "Mu Botis"),
	T(0000, "Mu Pegasi"),
	T(0000, "Mufrid"),
	T(0000, "Muliphein"),
	T(0000, "Muliphen"),
	T(0000, "Muphrid"),
	T(0000, "Murzim"),
	T(0000, "Muscida"),
	T(0000, "Nair Al Saif"),
	T(0000, "Naos"),
	T(0000, "Nash"),
	T(0000, "Nashira"),
	T(0000, "Nekkar"),
	T(0000, "Nihal"),
	T(0000, "Nodus Secundus"),
	T(0000, "Nunki"),
	T(0000, "Nusakan"),
	T(0000, "Omicron Ceti"),
	T(0000, "Omicron Ursae Majoris"),
	T(0000, "Ophiuchi"),
	T(0000, "Orionis"),
	T(0000, "Pavonis"),
	T(0000, "Peacock"),
	T(0000, "Pegasi"),
	T(0000, "Persei"),
	T(0000, "Phact"),
	T(0000, "Phad"),
	T(0000, "Phaet"),
	T(0000, "Phecda"),
	T(0000, "Pherkad"),
	T(0000, "Pherkad Minor"),
	T(0000, "Phoenicis"),
	T(0000, "Piscis Austrini"),
	T(0000, "Piscium"),
	T(0000, "Pleione"),
	T(0000, "Polaris"),
	T(0000, "Polaris Australis"),
	T(0000, "Pollux"),
	T(0000, "Porrima"),
	T(0000, "Praecipua"),
	T(0000, "Prima Giedi"),
	T(0000, "Primus"),
	T(0000, "Procyon"),
	T(0000, "Propus"),
	T(0000, "Puppis"),
	T(0000, "Rana"),
	T(0000, "Ras Elased Borealis"),
	T(0000, "Rasalgethi"),
	T(0000, "Rasalhague"),
	T(0000, "Rastaban"),
	T(0000, "Regulus"),
	T(0000, "Rigel"),
	T(0000, "Rijl Al Awwa"),
	T(0000, "Rotanev"),
	T(0000, "Ruchba"),
	T(0000, "Ruchbah"),
	T(0000, "Rukbat"),
	T(0000, "Sabik"),
	T(0000, "Sadachbia"),
	T(0000, "Sadalachbia"),
	T(0000, "Sadalbari"),
	T(0000, "Sadalmelik"),
	T(0000, "Sadalsuud"),
	T(0000, "Sadr"),
	T(0000, "Sagittarii"),
	T(0000, "Saiph"),
	T(0000, "Salm"),
	T(0000, "Sargas"),
	T(0000, "Sarin"),
	T(0000, "Sceptrum"),
	T(0000, "Scheat"),
	T(0000, "Schedar"),
	T(0000, "Scorpii"),
	T(0000, "Secondus"),
	T(0000, "Secunda Giedi"),
	T(0000, "Segin"),
	T(0000, "Seginus"),
	T(0000, "Serpentis"),
	T(0000, "Sham"),
	T(0000, "Sharatan"),
	T(0000, "Shaula"),
	T(0000, "Shedir"),
	T(0000, "Sheliak"),
	T(0000, "Sheratan"),
	T(0000, "Sigma"),
	T(0000, "Sirius"),
	T(0000, "Situla"),
	T(0000, "Skat"),
	T(0000, "Spica"),
	T(0000, "Sterope Ii"),
	T(0000, "Sualocin"),
	T(0000, "Subra"),
	T(0000, "Suhail"),
	T(0000, "Suhail Al Muhlif"),
	T(0000, "Sulafat"),
	T(0000, "Syrma"),
	T(0000, "Tabit"),
	T(0000, "Talitha"),
	T(0000, "Tania"),
	T(0000, "Tarazed"),
	T(0000, "Tauri"),
	T(0000, "Taygeta"),
	T(0000, "Tegmen"),
	T(0000, "Tejat Posterior"),
	T(0000, "Terebellum"),
	T(0000, "Tertius"),
	T(0000, "Thabit"),
	T(0000, "ThCentauri"),
	T(0000, "Theemim"),
	T(0000, "Thuban"),
	T(0000, "Torcularis Septentrionalis"),
	T(0000, "Trianguli"),
	T(0000, "Turais"),
	T(0000, "Tyl"),
	T(0000, "Unukalhai"),
	T(0000, "Upsilon Scorpii"),
	T(0000, "Ursae"),
	T(0000, "Vega"),
	T(0000, "Velorum"),
	T(0000, "Vindemiatrix"),
	T(0000, "Virginis"),
	T(0000, "Wasat"),
	T(0000, "Wazn"),
	T(0000, "Wezen"),
	T(0000, "Wezn"),
	T(0000, "Xi Draconis"),
	T(0000, "Yed Posterior"),
	T(0000, "Yed Prior"),
	T(0000, "Yildun"),
	T(0000, "Zaniah"),
	T(0000, "Zarijan"),
	T(0000, "Zaurak"),
	T(0000, "Zavijah"),
	T(0000, "Zavijava"),
	T(0000, "Zibal"),
	T(0000, "Zosma"),
	T(0000, "Zubenelakrab"),
	T(0000, "Zubenelakribi"),
	T(0000, "Zubenelgenubi"),
	T(0000, "Zubenelschemali"),
	T(0000, "Zubeneschamali"),
}

-- Some tool decided to make AsteroidReusableNames a local var instead of global unlike the other names...
-- Thanks buddy (next time look at those that came before you).
-- I made ChoGGi_AsteroidNames global for other people to be able to add more names.

local AsteroidNames_updated
-- Replace local func
function OnMsg.ChoGGi_UpdateBlacklistFuncs(env)
	-- You can use examine from my lib mod to find upvalue to use
	-- OpenExamine(GenerateAsteroidName) will show AsteroidReusableNames as (4)
	local parent_func = GenerateAsteroidName
	local _, ChoOrig_AsteroidReusableNames = env.debug.getupvalue(parent_func, 4)
	-- update with orig names
	if not AsteroidNames_updated then
		table.iappend(ChoGGi_AsteroidNames, ChoOrig_AsteroidReusableNames)
		AsteroidNames_updated = true
	end
	-- then replace with ours
	env.debug.setupvalue(parent_func, 4, ChoGGi_AsteroidNames)
end
