Carighan Maconar avatar Carighan Maconar committed f1e5edf

* First take at a Tol Barad compatible version
- No longer need localization, using GetWorldPVPAreaInfo

Comments (0)

Files changed (3)

 -- Automatically changes graphics detail depending on zone or instance.
 
 AutoGraph = LibStub("AceAddon-3.0"):NewAddon("AutoGraph", "AceEvent-3.0")
-local L	= LibStub("AceLocale-3.0"):GetLocale("AutoGraph")
 
 -- .-------------------------------------------------------------------------------.
 -- |  Functions                                                                    |
 -- '-------------------------------------------------------------------------------'
 
+local _, lakename, _, _, _, _ = GetWorldPVPAreaInfo(1)
+local _, baradname, _, _, _, _ = GetWorldPvPAreaInfo(2)
+
 function AutoGraph:OnEnable()
 	self:RegisterEvent("PLAYER_ENTERING_WORLD","WereZoned")
 	self:RegisterEvent("ZONE_CHANGED","WereZoned")
 
 function AutoGraph:RaidUpdated()
 	local raidMembers = GetNumRaidMembers()
-	if (GetRealZoneText() == L["Lake Wintergrasp"]) then
+	if ((GetRealZoneText() == lakename) or (GetRealZoneText() == baradname)) then
 		SetCVar("particleDensity", 0.15)
 		return
 	elseif (raidMembers > 25) then
 
 function AutoGraph:WereZoned()
 	local _, instanceType = IsInInstance()
-	if (instanceType == "raid" or instanceType == "pvp" or GetRealZoneText() == L["Lake Wintergrasp"]) then
+	if (instanceType == "raid" or instanceType == "pvp" or (GetRealZoneText() == lakename) or (GetRealZoneText() == baradname)) then
 		self:RegisterEvent("RAID_ROSTER_UPDATE","RaidUpdated")
 		self:RaidUpdated()
 	else

Localization.lua

-
-local AceLocale = LibStub("AceLocale-3.0")
-
--- .-------------------------------------------------------------------------------.
--- |  Locale                                                                       |
--- '-------------------------------------------------------------------------------'
-
-local L = AceLocale:NewLocale("AutoGraph", "enUS", true)
-if L then
-	L["Lake Wintergrasp"] = "Wintergrasp"
-if GetLocale() == "enUS" or GetLocale() == "enGB" then return end
-end
-
-local L = AceLocale:NewLocale("AutoGraph", "deDE")
-if L then
-	L["Lake Wintergrasp"] = "Tausendwintersee"
-return
-end
-
-local L = AceLocale:NewLocale("AutoGraph", "frFR")
-if L then
-	L["Lake Wintergrasp"] = "Joug-d'hiver"
-return
-end
-
-local L = AceLocale:NewLocale("AutoGraph", "esES") or AceLocale:NewLocale("AutoGraph", "esMX")
-if L then
-	L["Lake Wintergrasp"] = "Conquista del Invierno"
-return
-end
   <Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>
   <Include file="Libs\AceAddon-3.0\AceAddon-3.0.xml"/>
   <Include file="Libs\AceEvent-3.0\AceEvent-3.0.xml"/>
-  <Include file="Libs\AceLocale-3.0\AceLocale-3.0.xml"/>
 </Ui>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.