Update zz_Coords
This commit is contained in:
parent
fb047c9746
commit
67ce6f154c
|
@ -1,4 +1,4 @@
|
|||
local lib = LibStub:NewLibrary("zzAddOn", 7)
|
||||
local lib = LibStub:NewLibrary("zzAddOn", 8)
|
||||
if not lib then return end
|
||||
local config = LibStub:GetLibrary("zzConfig")
|
||||
lib['callbacks'] = lib['callbacks'] or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib)
|
||||
|
@ -42,12 +42,23 @@ local function joinTables(tab1, tab2, prefix)
|
|||
end
|
||||
end
|
||||
end
|
||||
function lib:AddChild(child)
|
||||
child['parent'] = self
|
||||
self['children'] = self['children'] or {}
|
||||
self['children'][#self['children'] + 1] = child
|
||||
if(child['specs']['defaults']) then
|
||||
joinTables(self['specs']['defaults'], child['specs']['defaults'])
|
||||
local function childExists(parent, child)
|
||||
if(parent['children']) then
|
||||
for i = 1, #parent['children'] do
|
||||
if(parent['children'][i]['specs']['name'] == child['specs']['name']) then return true end
|
||||
end
|
||||
end
|
||||
end
|
||||
function lib:AddChild(parentName, child)
|
||||
local parent = self:GetAddOn(parentName)
|
||||
if(parent) then
|
||||
parent['children'] = parent['children'] or {}
|
||||
if(childExists(parent, child)) then return end
|
||||
child['parent'] = parent
|
||||
parent['children'][#parent['children'] + 1] = child
|
||||
if(child['specs']['defaults']) then
|
||||
joinTables(parent['specs']['defaults'], child['specs']['defaults'])
|
||||
end
|
||||
end
|
||||
end
|
||||
function lib:RegisterEvent(event, globalfunc)
|
||||
|
@ -88,23 +99,14 @@ end
|
|||
function lib:NewAddOn(addonName, addonTable)
|
||||
local specs = self['specs']
|
||||
local childName = specs['name']
|
||||
--[[ if(lib['addons'][childName]) then
|
||||
local oldchild = lib['addons'][childName]
|
||||
local parent = oldchild:GetParent()
|
||||
if(parent) then
|
||||
errormsg(format("%s already loaded by %s", childName, parent['specs']['name']))
|
||||
else
|
||||
errormsg(format("|%s already loaded", childName))
|
||||
end
|
||||
return
|
||||
end ]]
|
||||
if(type(childName) == 'string') then
|
||||
self.GetAddOnTable = function() return addonTable end
|
||||
lib['addons'][childName] = self
|
||||
local child = lib['addons'][childName]
|
||||
lib:Embed(self)
|
||||
if(childName ~= addonName) then
|
||||
local parent = lib['addons'][addonName]
|
||||
parent:AddChild(self)
|
||||
parent:AddChild(parent['specs']['name'], self)
|
||||
end
|
||||
if(self['events']) then
|
||||
for ev, func in pairs(self['events']) do
|
||||
|
|
|
@ -60,7 +60,7 @@ local function OnDataUpdate()
|
|||
end
|
||||
end
|
||||
|
||||
function zzCoords_MinimapToggle()
|
||||
local function zzCoords_MinimapToggle()
|
||||
if(MinimapCluster:IsVisible()) then
|
||||
MinimapCluster:Hide()
|
||||
else
|
||||
|
@ -122,8 +122,11 @@ child['specs'] = {
|
|||
}
|
||||
function events:PLAYER_ENTERING_WORLD(event)
|
||||
child:UnregisterEvent('PLAYER_ENTERING_WORLD')
|
||||
BINDING_HEADER_COORDS = childName
|
||||
BINDING_NAME_COORDS_TOGGLE = L["Toggle Minimap"]
|
||||
local m = CreateFrame("BUTTON", "zzCoords_MinimapToggleFrame")
|
||||
m:SetScript("OnClick", zzCoords_MinimapToggle)
|
||||
if(db['toggleMap'] and db['toggleMap'] ~= '') then
|
||||
SetBinding(db['toggleMap'], "CLICK zzCoords_MinimapToggleFrame:LeftButton")
|
||||
end
|
||||
child:RegisterEvent({"ZONE_CHANGED_NEW_AREA","ZONE_CHANGED","ZONE_CHANGED_INDOORS","NEW_WMO_CHUNK"}, child.ZoneEvent)
|
||||
child:RegisterEvent({"PLAYER_STARTED_MOVING", "PLAYER_STOPPED_MOVING"}, child.MoveEvent)
|
||||
end
|
||||
|
|
|
@ -17,7 +17,7 @@ if L then
|
|||
L['HINT4'] = "|c0000ff00Shift-Rechtsklick|r |c00ffffffschaltet Minimap an/aus|r"
|
||||
L['Show Zone'] = "Zeige Zone"
|
||||
L['Show Subzone'] = "Zeige Subzone"
|
||||
L["Toggle Minimap"] = "Minimap ein-/ausschalten"
|
||||
L["Toggle Minimap"] = "Minimap ein-/ausblenden"
|
||||
L['Max Length'] = "Max. L\195\164nge"
|
||||
L['Limits the maximum length of the zone'] = "Limitiert die Anzeigel\195\164nge der Zone"
|
||||
L['Mapcoords Screen'] = "Kartenkoordinaten Vollbild"
|
||||
|
@ -34,10 +34,11 @@ if L then
|
|||
L['This hides the coords-display in your broker display'] = "Zeigt die Koordinaten im Display-Broker nicht an"
|
||||
L['Colorized Zone'] = "Farbige Zone"
|
||||
L['Show PvP informations about current area'] = "Zeigt PvP Informationen zur Zone farblich an"
|
||||
L['Set keybind'] = "Setze Tastaturbelegung"
|
||||
end
|
||||
|
||||
-- ö \195\182 ß \195\159
|
||||
-- ü \195\188 ä \195\164
|
||||
-- Ä \195\132
|
||||
-- ö \195\182
|
||||
-- Ü \195\156
|
||||
-- <EFBFBD> \195\182 <20> \195\159
|
||||
-- <EFBFBD> \195\188 <20> \195\164
|
||||
-- <EFBFBD> \195\132
|
||||
-- <EFBFBD> \195\182
|
||||
-- <EFBFBD> \195\156
|
|
@ -34,4 +34,5 @@ if L then
|
|||
L['This hides the coords-display in your broker display'] = true
|
||||
L['Colorized Zone'] = true
|
||||
L['Show PvP informations about current area'] = true
|
||||
L['Set keybind'] = true
|
||||
end
|
|
@ -2,7 +2,10 @@ local addonName, addon = ...
|
|||
local childName = addon['childName']
|
||||
local child = addon[childName]
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale(childName, true)
|
||||
function child:PrefChanged()
|
||||
function child:PrefChanged(info, value, oldvalue)
|
||||
if(info[#info] == 'toggleMap' and value ~= oldvalue) then
|
||||
SetBinding(value, "CLICK zzCoords_MinimapToggleFrame:LeftButton")
|
||||
end
|
||||
child:ZoneEvent()
|
||||
end
|
||||
local init = {
|
||||
|
@ -20,6 +23,7 @@ local init = {
|
|||
config:AddConfigEntry(main,'windowXY',"header",L['Mapcoords Window'],nil,6)
|
||||
config:AddConfigEntry(main,"windowX","range",L['Window X'],L['Adjusts the X-Offset on windowed map'],7,-512,512,1)
|
||||
config:AddConfigEntry(main,"windowY","range",L['Window Y'],L['Adjusts the Y-Offset on windowed map'],8,-512,512,1)
|
||||
config:AddConfigEntry(main,"toggleMap","keybinding",L['Toggle Minimap'],L['Set keybind'],5)
|
||||
end
|
||||
}
|
||||
addon.RegisterCallback(init, format("Init%s", childName), 'Setup')
|
Loading…
Reference in New Issue