1. Carighan Maconar
  2. AutoGraph

Commits

Carighan Maconar  committed f1e5edf

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

  • Participants
  • Parent commits 8a20767
  • Branches default

Comments (0)

Files changed (3)

File AutoGraph.lua

View file
 -- 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

File 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

File embeds.xml

View file
   <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>