天赋修改更直接展示预览时天赋变更信息
世界地图揭示迷雾全修复
This commit is contained in:
14
ConfigUI.lua
14
ConfigUI.lua
@@ -2681,7 +2681,15 @@ function SFrames.ConfigUI:BuildMinimapPage()
|
|||||||
end)
|
end)
|
||||||
CreateDesc(wmSection, "遍历所有大陆区域,发现新地图并自动补充迷雾数据", 292, -174, font)
|
CreateDesc(wmSection, "遍历所有大陆区域,发现新地图并自动补充迷雾数据", 292, -174, font)
|
||||||
|
|
||||||
CreateButton(wmSection, "导出扫描数据", 400, -148, 100, 24, function()
|
CreateButton(wmSection, "查看统计", 400, -148, 80, 24, function()
|
||||||
|
if SFrames.MapReveal and SFrames.MapReveal.ShowStats then
|
||||||
|
SFrames.MapReveal:ShowStats()
|
||||||
|
else
|
||||||
|
SFrames:Print("MapReveal 模块不可用")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
CreateButton(wmSection, "导出数据", 488, -148, 80, 24, function()
|
||||||
if SFrames.MapReveal and SFrames.MapReveal.ExportScannedData then
|
if SFrames.MapReveal and SFrames.MapReveal.ExportScannedData then
|
||||||
SFrames.MapReveal:ExportScannedData()
|
SFrames.MapReveal:ExportScannedData()
|
||||||
else
|
else
|
||||||
@@ -2689,8 +2697,8 @@ function SFrames.ConfigUI:BuildMinimapPage()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
CreateLabel(wmSection, "版本更新后建议先扫描地图,再重新打开世界地图查看效果。", 14, -200, font, 10, 0.6, 0.6, 0.65)
|
CreateLabel(wmSection, "浏览世界地图时自动发现并持久化覆盖层数据,扫描可批量发现已探索区域。", 14, -200, font, 10, 0.6, 0.6, 0.65)
|
||||||
CreateDesc(wmSection, "命令: /nui mapscan | /nui mapexport | /nui mapreveal 切换", 14, -216, font)
|
CreateDesc(wmSection, "命令: /nui mapscan | /nui mapstats | /nui mapreveal 切换", 14, -216, font)
|
||||||
|
|
||||||
-- ══════════════════════════════════════════════════════════════
|
-- ══════════════════════════════════════════════════════════════
|
||||||
-- 小地图 (移至下方)
|
-- 小地图 (移至下方)
|
||||||
|
|||||||
14
Core.lua
14
Core.lua
@@ -392,7 +392,9 @@ function SFrames:InitSlashCommands()
|
|||||||
SFrames:Print("/nui pin - 地图标记 (clear/share)")
|
SFrames:Print("/nui pin - 地图标记 (clear/share)")
|
||||||
SFrames:Print("/nui nav - 切换导航地图")
|
SFrames:Print("/nui nav - 切换导航地图")
|
||||||
SFrames:Print("/nui mapscan - 扫描所有地图更新迷雾揭示数据")
|
SFrames:Print("/nui mapscan - 扫描所有地图更新迷雾揭示数据")
|
||||||
|
SFrames:Print("/nui mapstats - 查看地图覆盖层数据统计")
|
||||||
SFrames:Print("/nui mapexport - 导出扫描到的地图数据")
|
SFrames:Print("/nui mapexport - 导出扫描到的地图数据")
|
||||||
|
SFrames:Print("/nui mapclear - 清除已保存的扫描数据")
|
||||||
SFrames:Print("/nui layout - 布局模式(拖拽调整所有框体位置)")
|
SFrames:Print("/nui layout - 布局模式(拖拽调整所有框体位置)")
|
||||||
SFrames:Print("/nui bind - 按键绑定模式(悬停按钮+按键)")
|
SFrames:Print("/nui bind - 按键绑定模式(悬停按钮+按键)")
|
||||||
SFrames:Print("/nui talentdb - 天赋默认数据库管理/导出")
|
SFrames:Print("/nui talentdb - 天赋默认数据库管理/导出")
|
||||||
@@ -453,6 +455,18 @@ function SFrames:InitSlashCommands()
|
|||||||
else
|
else
|
||||||
SFrames:Print("MapReveal module unavailable.")
|
SFrames:Print("MapReveal module unavailable.")
|
||||||
end
|
end
|
||||||
|
elseif cmd == "mapstats" then
|
||||||
|
if SFrames.MapReveal and SFrames.MapReveal.ShowStats then
|
||||||
|
SFrames.MapReveal:ShowStats()
|
||||||
|
else
|
||||||
|
SFrames:Print("MapReveal module unavailable.")
|
||||||
|
end
|
||||||
|
elseif cmd == "mapclear" then
|
||||||
|
if SFrames.MapReveal and SFrames.MapReveal.ClearSavedData then
|
||||||
|
SFrames.MapReveal:ClearSavedData()
|
||||||
|
else
|
||||||
|
SFrames:Print("MapReveal module unavailable.")
|
||||||
|
end
|
||||||
elseif cmd == "layout" or cmd == "movers" then
|
elseif cmd == "layout" or cmd == "movers" then
|
||||||
if SFrames.Movers and SFrames.Movers.ToggleLayoutMode then
|
if SFrames.Movers and SFrames.Movers.ToggleLayoutMode then
|
||||||
SFrames.Movers:ToggleLayoutMode()
|
SFrames.Movers:ToggleLayoutMode()
|
||||||
|
|||||||
289
MapReveal.lua
289
MapReveal.lua
@@ -2,6 +2,7 @@
|
|||||||
-- Nanami-UI: MapReveal -- Reveal unexplored world map areas
|
-- Nanami-UI: MapReveal -- Reveal unexplored world map areas
|
||||||
-- Adapted from ShaguTweaks-extras worldmap-reveal approach
|
-- Adapted from ShaguTweaks-extras worldmap-reveal approach
|
||||||
-- Uses LibMapOverlayData (from !Libs) supplemented with Turtle WoW zones
|
-- Uses LibMapOverlayData (from !Libs) supplemented with Turtle WoW zones
|
||||||
|
-- Features persistent overlay discovery via GetMapOverlayInfo() API
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
SFrames.MapReveal = SFrames.MapReveal or {}
|
SFrames.MapReveal = SFrames.MapReveal or {}
|
||||||
@@ -15,58 +16,14 @@ local errata = {
|
|||||||
["Interface\\WorldMap\\Silverpine\\BERENSPERIL"] = { offsetY = { 417, 415 } },
|
["Interface\\WorldMap\\Silverpine\\BERENSPERIL"] = { offsetY = { 417, 415 } },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Turtle WoW new/modified zones not present in LibMapOverlayData
|
-- Zones only in TurtleWoW_Zones: not in patched WorldMapOverlay.dbc but needed for fog reveal
|
||||||
-- Updated for latest Turtle WoW version
|
|
||||||
local TurtleWoW_Zones = {
|
local TurtleWoW_Zones = {
|
||||||
["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",
|
|
||||||
},
|
|
||||||
["UpperKarazhan2f"] = {
|
["UpperKarazhan2f"] = {
|
||||||
"OUTLAND:1024:768:0:0",
|
"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",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Runtime-discovered overlay data (populated by ScanAllMaps)
|
-- Runtime-discovered overlay data (populated by scanning and passive collection)
|
||||||
local scannedOverlays = {}
|
local scannedOverlays = {}
|
||||||
|
|
||||||
local function IsTurtleWoW()
|
local function IsTurtleWoW()
|
||||||
@@ -77,6 +34,81 @@ local function GetOverlayDB()
|
|||||||
return MapOverlayData or LibMapOverlayData or zMapOverlayData or mapOverlayData
|
return MapOverlayData or LibMapOverlayData or zMapOverlayData or mapOverlayData
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Persistence: save/load discovered overlay data to SFramesDB
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
local function GetGlobalDB()
|
||||||
|
if not SFramesGlobalDB then SFramesGlobalDB = {} end
|
||||||
|
return SFramesGlobalDB
|
||||||
|
end
|
||||||
|
|
||||||
|
local function LoadPersistedData()
|
||||||
|
local gdb = GetGlobalDB()
|
||||||
|
local saved = gdb.MapRevealScanData
|
||||||
|
if type(saved) ~= "table" then return end
|
||||||
|
|
||||||
|
local count = 0
|
||||||
|
for zone, overlays in pairs(saved) do
|
||||||
|
if type(overlays) == "table" and table.getn(overlays) > 0 then
|
||||||
|
if not scannedOverlays[zone] or table.getn(scannedOverlays[zone]) < table.getn(overlays) then
|
||||||
|
scannedOverlays[zone] = overlays
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return count
|
||||||
|
end
|
||||||
|
|
||||||
|
local function SavePersistedData()
|
||||||
|
local gdb = GetGlobalDB()
|
||||||
|
if type(gdb.MapRevealScanData) ~= "table" then
|
||||||
|
gdb.MapRevealScanData = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
for zone, overlays in pairs(scannedOverlays) do
|
||||||
|
local existing = gdb.MapRevealScanData[zone]
|
||||||
|
if not existing or table.getn(existing) < table.getn(overlays) then
|
||||||
|
gdb.MapRevealScanData[zone] = overlays
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Overlay name index for deduplication when merging
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
local function BuildOverlayIndex(overlayList)
|
||||||
|
local idx = {}
|
||||||
|
if not overlayList then return idx end
|
||||||
|
for i = 1, table.getn(overlayList) do
|
||||||
|
local entry = overlayList[i]
|
||||||
|
local _, _, name = string.find(entry, "^([^:]+):")
|
||||||
|
if name then
|
||||||
|
idx[string.upper(name)] = i
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return idx
|
||||||
|
end
|
||||||
|
|
||||||
|
local function MergeScannedDataIntoDB()
|
||||||
|
local db = GetOverlayDB()
|
||||||
|
if not db then return end
|
||||||
|
|
||||||
|
for zone, data in pairs(scannedOverlays) do
|
||||||
|
if not db[zone] then
|
||||||
|
db[zone] = data
|
||||||
|
else
|
||||||
|
local existingIdx = BuildOverlayIndex(db[zone])
|
||||||
|
for i = 1, table.getn(data) do
|
||||||
|
local _, _, newName = string.find(data[i], "^([^:]+):")
|
||||||
|
if newName and not existingIdx[string.upper(newName)] then
|
||||||
|
table.insert(db[zone], data[i])
|
||||||
|
existingIdx[string.upper(newName)] = table.getn(db[zone])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function PatchOverlayDB()
|
local function PatchOverlayDB()
|
||||||
if overlayDBPatched then return end
|
if overlayDBPatched then return end
|
||||||
overlayDBPatched = true
|
overlayDBPatched = true
|
||||||
@@ -87,25 +119,80 @@ local function PatchOverlayDB()
|
|||||||
if not db then return end
|
if not db then return end
|
||||||
|
|
||||||
for zone, data in pairs(TurtleWoW_Zones) do
|
for zone, data in pairs(TurtleWoW_Zones) do
|
||||||
db[zone] = data
|
if table.getn(data) > 0 then
|
||||||
|
db[zone] = data
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for zone, data in pairs(scannedOverlays) do
|
MergeScannedDataIntoDB()
|
||||||
if not db[zone] then
|
end
|
||||||
db[zone] = data
|
|
||||||
|
local function MergeOverlaysForZone(zone)
|
||||||
|
local db = GetOverlayDB()
|
||||||
|
if not db or not scannedOverlays[zone] then return end
|
||||||
|
|
||||||
|
if not db[zone] then
|
||||||
|
db[zone] = scannedOverlays[zone]
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local existingIdx = BuildOverlayIndex(db[zone])
|
||||||
|
local data = scannedOverlays[zone]
|
||||||
|
for i = 1, table.getn(data) do
|
||||||
|
local _, _, newName = string.find(data[i], "^([^:]+):")
|
||||||
|
if newName and not existingIdx[string.upper(newName)] then
|
||||||
|
table.insert(db[zone], data[i])
|
||||||
|
existingIdx[string.upper(newName)] = table.getn(db[zone])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function MergeScannedData()
|
--------------------------------------------------------------------------------
|
||||||
local db = GetOverlayDB()
|
-- Passive overlay discovery: captures explored overlay data from the API
|
||||||
if not db then return end
|
-- every time the world map updates, discovering new overlays automatically
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
local function PassiveCollectOverlays()
|
||||||
|
local mapFile = GetMapInfo and GetMapInfo()
|
||||||
|
if not mapFile or mapFile == "" or mapFile == "World" then return end
|
||||||
|
|
||||||
for zone, data in pairs(scannedOverlays) do
|
local numOverlays = GetNumMapOverlays and GetNumMapOverlays() or 0
|
||||||
if not db[zone] or table.getn(db[zone]) < table.getn(data) then
|
if numOverlays == 0 then return end
|
||||||
db[zone] = data
|
|
||||||
|
local currentOverlays = {}
|
||||||
|
local hasNew = false
|
||||||
|
|
||||||
|
for i = 1, numOverlays do
|
||||||
|
local texName, texW, texH, offX, offY = GetMapOverlayInfo(i)
|
||||||
|
if texName and texName ~= "" then
|
||||||
|
local _, _, name = string.find(texName, "\\([^\\]+)$")
|
||||||
|
if name then
|
||||||
|
name = string.upper(name)
|
||||||
|
table.insert(currentOverlays, name .. ":" .. texW .. ":" .. texH .. ":" .. offX .. ":" .. offY)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if table.getn(currentOverlays) == 0 then return end
|
||||||
|
|
||||||
|
if not scannedOverlays[mapFile] then
|
||||||
|
scannedOverlays[mapFile] = currentOverlays
|
||||||
|
hasNew = true
|
||||||
|
else
|
||||||
|
local existingIdx = BuildOverlayIndex(scannedOverlays[mapFile])
|
||||||
|
for i = 1, table.getn(currentOverlays) do
|
||||||
|
local _, _, newName = string.find(currentOverlays[i], "^([^:]+):")
|
||||||
|
if newName and not existingIdx[string.upper(newName)] then
|
||||||
|
table.insert(scannedOverlays[mapFile], currentOverlays[i])
|
||||||
|
existingIdx[string.upper(newName)] = table.getn(scannedOverlays[mapFile])
|
||||||
|
hasNew = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if hasNew then
|
||||||
|
MergeOverlaysForZone(mapFile)
|
||||||
|
SavePersistedData()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function GetConfig()
|
local function GetConfig()
|
||||||
@@ -251,8 +338,13 @@ function MapReveal:Initialize()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local loadedCount = LoadPersistedData()
|
||||||
PatchOverlayDB()
|
PatchOverlayDB()
|
||||||
|
|
||||||
|
if loadedCount and loadedCount > 0 then
|
||||||
|
MergeScannedDataIntoDB()
|
||||||
|
end
|
||||||
|
|
||||||
if not origWorldMapFrame_Update and WorldMapFrame_Update then
|
if not origWorldMapFrame_Update and WorldMapFrame_Update then
|
||||||
origWorldMapFrame_Update = WorldMapFrame_Update
|
origWorldMapFrame_Update = WorldMapFrame_Update
|
||||||
WorldMapFrame_Update = function()
|
WorldMapFrame_Update = function()
|
||||||
@@ -263,6 +355,8 @@ function MapReveal:Initialize()
|
|||||||
|
|
||||||
origWorldMapFrame_Update()
|
origWorldMapFrame_Update()
|
||||||
|
|
||||||
|
PassiveCollectOverlays()
|
||||||
|
|
||||||
local cfg = GetConfig()
|
local cfg = GetConfig()
|
||||||
if cfg.enabled then
|
if cfg.enabled then
|
||||||
DoMapRevealUpdate()
|
DoMapRevealUpdate()
|
||||||
@@ -358,16 +452,30 @@ local function ProcessScanZone()
|
|||||||
if table.getn(overlays) > 0 then
|
if table.getn(overlays) > 0 then
|
||||||
local db = GetOverlayDB()
|
local db = GetOverlayDB()
|
||||||
local existing = db and db[mapFile]
|
local existing = db and db[mapFile]
|
||||||
local existingCount = existing and table.getn(existing) or 0
|
|
||||||
|
|
||||||
if not existing then
|
if not existing then
|
||||||
scanNewZones[mapFile] = overlays
|
scanNewZones[mapFile] = overlays
|
||||||
scanResults[mapFile] = { overlays = overlays, status = "new", count = table.getn(overlays) }
|
scanResults[mapFile] = { overlays = overlays, status = "new", count = table.getn(overlays) }
|
||||||
elseif table.getn(overlays) > existingCount then
|
|
||||||
scanUpdatedZones[mapFile] = overlays
|
|
||||||
scanResults[mapFile] = { overlays = overlays, status = "updated", count = table.getn(overlays), oldCount = existingCount }
|
|
||||||
else
|
else
|
||||||
scanResults[mapFile] = { status = "ok", count = existingCount }
|
local existingIdx = BuildOverlayIndex(existing)
|
||||||
|
local newEntries = 0
|
||||||
|
for i = 1, table.getn(overlays) do
|
||||||
|
local _, _, oName = string.find(overlays[i], "^([^:]+):")
|
||||||
|
if oName and not existingIdx[string.upper(oName)] then
|
||||||
|
newEntries = newEntries + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if newEntries > 0 then
|
||||||
|
scanUpdatedZones[mapFile] = overlays
|
||||||
|
scanResults[mapFile] = {
|
||||||
|
overlays = overlays, status = "updated",
|
||||||
|
count = table.getn(existing) + newEntries,
|
||||||
|
oldCount = table.getn(existing)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
scanResults[mapFile] = { status = "ok", count = table.getn(existing) }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -392,6 +500,7 @@ function MapReveal:FinishScan()
|
|||||||
local cf = DEFAULT_CHAT_FRAME
|
local cf = DEFAULT_CHAT_FRAME
|
||||||
local newCount = 0
|
local newCount = 0
|
||||||
local updCount = 0
|
local updCount = 0
|
||||||
|
local newOverlayCount = 0
|
||||||
|
|
||||||
for zone, overlays in pairs(scanNewZones) do
|
for zone, overlays in pairs(scanNewZones) do
|
||||||
newCount = newCount + 1
|
newCount = newCount + 1
|
||||||
@@ -399,10 +508,23 @@ function MapReveal:FinishScan()
|
|||||||
end
|
end
|
||||||
for zone, overlays in pairs(scanUpdatedZones) do
|
for zone, overlays in pairs(scanUpdatedZones) do
|
||||||
updCount = updCount + 1
|
updCount = updCount + 1
|
||||||
scannedOverlays[zone] = overlays
|
if not scannedOverlays[zone] then
|
||||||
|
scannedOverlays[zone] = overlays
|
||||||
|
else
|
||||||
|
local existingIdx = BuildOverlayIndex(scannedOverlays[zone])
|
||||||
|
for i = 1, table.getn(overlays) do
|
||||||
|
local _, _, oName = string.find(overlays[i], "^([^:]+):")
|
||||||
|
if oName and not existingIdx[string.upper(oName)] then
|
||||||
|
table.insert(scannedOverlays[zone], overlays[i])
|
||||||
|
existingIdx[string.upper(oName)] = table.getn(scannedOverlays[zone])
|
||||||
|
newOverlayCount = newOverlayCount + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
MergeScannedData()
|
MergeScannedDataIntoDB()
|
||||||
|
SavePersistedData()
|
||||||
|
|
||||||
cf:AddMessage("|cffffb3d9[Nanami-UI]|r 地图扫描完成!")
|
cf:AddMessage("|cffffb3d9[Nanami-UI]|r 地图扫描完成!")
|
||||||
cf:AddMessage(string.format(" 扫描了 |cff00ff00%d|r 个区域", table.getn(scanQueue)))
|
cf:AddMessage(string.format(" 扫描了 |cff00ff00%d|r 个区域", table.getn(scanQueue)))
|
||||||
@@ -427,6 +549,7 @@ function MapReveal:FinishScan()
|
|||||||
cf:AddMessage(" 所有区域数据已是最新,未发现变动。")
|
cf:AddMessage(" 所有区域数据已是最新,未发现变动。")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
cf:AddMessage(" 数据已自动保存,下次登录无需重新扫描。")
|
||||||
cf:AddMessage(" 提示: 新发现的区域仅记录已探索区域的覆盖层,完全探索后再次扫描可获取完整数据。")
|
cf:AddMessage(" 提示: 新发现的区域仅记录已探索区域的覆盖层,完全探索后再次扫描可获取完整数据。")
|
||||||
|
|
||||||
if WorldMapFrame and WorldMapFrame:IsShown() then
|
if WorldMapFrame and WorldMapFrame:IsShown() then
|
||||||
@@ -510,3 +633,43 @@ function MapReveal:ExportScannedData()
|
|||||||
cf:AddMessage("|cffffb3d9[MapReveal]|r 没有扫描到的新数据可导出。先运行 /nui mapscan")
|
cf:AddMessage("|cffffb3d9[MapReveal]|r 没有扫描到的新数据可导出。先运行 /nui mapscan")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function MapReveal:ShowStats()
|
||||||
|
local cf = DEFAULT_CHAT_FRAME
|
||||||
|
local db = GetOverlayDB()
|
||||||
|
cf:AddMessage("|cffffb3d9[MapReveal]|r 覆盖层数据统计:")
|
||||||
|
|
||||||
|
local dbZones, dbOverlays = 0, 0
|
||||||
|
if db then
|
||||||
|
for zone, data in pairs(db) do
|
||||||
|
dbZones = dbZones + 1
|
||||||
|
dbOverlays = dbOverlays + table.getn(data)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
cf:AddMessage(string.format(" 数据库: |cff00ff00%d|r 个区域, |cff00ff00%d|r 个覆盖层", dbZones, dbOverlays))
|
||||||
|
|
||||||
|
local scanZones, scanOverlays = 0, 0
|
||||||
|
for zone, data in pairs(scannedOverlays) do
|
||||||
|
scanZones = scanZones + 1
|
||||||
|
scanOverlays = scanOverlays + table.getn(data)
|
||||||
|
end
|
||||||
|
cf:AddMessage(string.format(" 已发现: |cff00ff00%d|r 个区域, |cff00ff00%d|r 个覆盖层 (通过扫描/浏览)", scanZones, scanOverlays))
|
||||||
|
|
||||||
|
local savedZones = 0
|
||||||
|
local gdb = GetGlobalDB()
|
||||||
|
if type(gdb.MapRevealScanData) == "table" then
|
||||||
|
for _ in pairs(gdb.MapRevealScanData) do
|
||||||
|
savedZones = savedZones + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
cf:AddMessage(string.format(" 已持久化: |cff00ff00%d|r 个区域", savedZones))
|
||||||
|
|
||||||
|
cf:AddMessage(" 提示: 打开世界地图浏览各区域可自动发现新覆盖层数据")
|
||||||
|
end
|
||||||
|
|
||||||
|
function MapReveal:ClearSavedData()
|
||||||
|
local gdb = GetGlobalDB()
|
||||||
|
gdb.MapRevealScanData = nil
|
||||||
|
scannedOverlays = {}
|
||||||
|
SFrames:Print("地图扫描数据已清除。重新加载UI后生效。")
|
||||||
|
end
|
||||||
|
|||||||
@@ -881,7 +881,7 @@ local function BuildExtras(page)
|
|||||||
|
|
||||||
local ptex = sb:CreateTexture(nil, "ARTWORK")
|
local ptex = sb:CreateTexture(nil, "ARTWORK")
|
||||||
ptex:SetTexture(style.tex)
|
ptex:SetTexture(style.tex)
|
||||||
ptex:SetPoint("CENTER")
|
ptex:SetPoint("CENTER", sb, "CENTER", 0, 0)
|
||||||
ptex:SetWidth(CS - 4); ptex:SetHeight(CS - 4)
|
ptex:SetWidth(CS - 4); ptex:SetHeight(CS - 4)
|
||||||
|
|
||||||
sb.styleKey = style.key
|
sb.styleKey = style.key
|
||||||
|
|||||||
2253
TalentDefaultDB.lua
2253
TalentDefaultDB.lua
File diff suppressed because it is too large
Load Diff
@@ -800,36 +800,9 @@ function SFrames.TalentTree:BuildTrees()
|
|||||||
btn.maxRank = maxRank
|
btn.maxRank = maxRank
|
||||||
btn.talentName = tName
|
btn.talentName = tName
|
||||||
|
|
||||||
local cachedDesc = nil
|
btn:SetScript("OnEnter", function()
|
||||||
if not IsViewingOwnClass(self) then
|
SFrames.TalentTree:ShowTalentTooltip(this)
|
||||||
local cd = GetCache()[self.viewingClass]
|
end)
|
||||||
if cd and cd[t] and cd[t].talents[i] then
|
|
||||||
cachedDesc = cd[t].talents[i].desc
|
|
||||||
end
|
|
||||||
end
|
|
||||||
btn.cachedDesc = cachedDesc
|
|
||||||
|
|
||||||
if IsViewingOwnClass(self) then
|
|
||||||
btn:SetScript("OnEnter", function()
|
|
||||||
GameTooltip_SetDefaultAnchor(GameTooltip, this)
|
|
||||||
GameTooltip:SetTalent(this.tab, this.index)
|
|
||||||
GameTooltip:Show()
|
|
||||||
end)
|
|
||||||
else
|
|
||||||
btn:SetScript("OnEnter", function()
|
|
||||||
GameTooltip:SetOwner(this, "ANCHOR_RIGHT")
|
|
||||||
GameTooltip:AddLine(this.talentName or "?", 1, 1, 1)
|
|
||||||
local vr = SFrames.TalentTree:GetVirtualRank(this.tab, this.index)
|
|
||||||
GameTooltip:AddLine("等级 " .. vr .. "/" .. (this.maxRank or "?"), 0.7, 0.7, 0.7)
|
|
||||||
if this.cachedDesc then
|
|
||||||
GameTooltip:AddLine(" ")
|
|
||||||
for _, line in ipairs(this.cachedDesc) do
|
|
||||||
GameTooltip:AddLine(line, 1, 0.82, 0, 1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
GameTooltip:Show()
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
btn:SetScript("OnLeave", function() GameTooltip:Hide() end)
|
btn:SetScript("OnLeave", function() GameTooltip:Hide() end)
|
||||||
|
|
||||||
btn:RegisterForClicks("LeftButtonUp", "RightButtonUp")
|
btn:RegisterForClicks("LeftButtonUp", "RightButtonUp")
|
||||||
@@ -964,6 +937,62 @@ function SFrames.TalentTree:HookVanillaUI()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Talent tooltip (shared by OnEnter and post-click refresh)
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
function SFrames.TalentTree:ShowTalentTooltip(btn)
|
||||||
|
if IsViewingOwnClass(self) and not self.simMode then
|
||||||
|
GameTooltip_SetDefaultAnchor(GameTooltip, btn)
|
||||||
|
GameTooltip:SetTalent(btn.tab, btn.index)
|
||||||
|
GameTooltip:Show()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
GameTooltip:SetOwner(btn, "ANCHOR_RIGHT")
|
||||||
|
GameTooltip:AddLine(btn.talentName or "?", 1, 1, 1)
|
||||||
|
local vr = self:GetVirtualRank(btn.tab, btn.index)
|
||||||
|
local mr = btn.maxRank or 1
|
||||||
|
GameTooltip:AddLine("等级 " .. vr .. "/" .. mr, 0.7, 0.7, 0.7)
|
||||||
|
|
||||||
|
local desc = nil
|
||||||
|
local classKey = self.viewingClass or self.playerClass
|
||||||
|
if NanamiTalentDefaultDB and NanamiTalentDefaultDB[classKey] then
|
||||||
|
local tabData = NanamiTalentDefaultDB[classKey][btn.tab]
|
||||||
|
if tabData and tabData.talents and tabData.talents[btn.index] then
|
||||||
|
desc = tabData.talents[btn.index].desc
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not desc then
|
||||||
|
local cd = GetCache()[classKey]
|
||||||
|
if cd and cd[btn.tab] and cd[btn.tab].talents[btn.index] then
|
||||||
|
desc = cd[btn.tab].talents[btn.index].desc
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if desc then
|
||||||
|
local n = table.getn(desc)
|
||||||
|
if n == mr and desc[1] then
|
||||||
|
GameTooltip:AddLine(" ")
|
||||||
|
if vr == 0 then
|
||||||
|
GameTooltip:AddLine(desc[1], 1, 0.82, 0, 1)
|
||||||
|
else
|
||||||
|
GameTooltip:AddLine(desc[vr], 1, 0.82, 0, 1)
|
||||||
|
if vr < mr and desc[vr + 1] then
|
||||||
|
GameTooltip:AddLine(" ")
|
||||||
|
GameTooltip:AddLine("下一级:", 0, 1, 0)
|
||||||
|
GameTooltip:AddLine(desc[vr + 1], 1, 0.82, 0, 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
GameTooltip:AddLine(" ")
|
||||||
|
for _, line in ipairs(desc) do
|
||||||
|
GameTooltip:AddLine(line, 1, 0.82, 0, 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
GameTooltip:Show()
|
||||||
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Virtual point helpers
|
-- Virtual point helpers
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@@ -1090,6 +1119,9 @@ function SFrames.TalentTree:OnTalentClick(btn, buttonType)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self:Update()
|
self:Update()
|
||||||
|
if GameTooltip:IsVisible() then
|
||||||
|
self:ShowTalentTooltip(btn)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function SFrames.TalentTree:ResetVirtualPoints()
|
function SFrames.TalentTree:ResetVirtualPoints()
|
||||||
|
|||||||
188
WorldMap.lua
188
WorldMap.lua
@@ -141,6 +141,49 @@ local function HideBlizzardDecorations()
|
|||||||
WorldMapFrameTitle:Hide()
|
WorldMapFrameTitle:Hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for _, n in ipairs({"WorldMapFrameSizeUpButton", "WorldMapFrameSizeDownButton"}) do
|
||||||
|
local f = _G[n]
|
||||||
|
if f then
|
||||||
|
f:Hide()
|
||||||
|
f:SetAlpha(0)
|
||||||
|
f:EnableMouse(false)
|
||||||
|
if f.ClearAllPoints then
|
||||||
|
f:ClearAllPoints()
|
||||||
|
f:SetPoint("TOPLEFT", UIParent, "TOPLEFT", -9999, 9999)
|
||||||
|
end
|
||||||
|
if f.GetRegions then
|
||||||
|
local regs = { f:GetRegions() }
|
||||||
|
for _, r in ipairs(regs) do
|
||||||
|
if r and r.Hide then r:Hide() end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if WorldMapFrame.GetChildren then
|
||||||
|
local wmCh = { WorldMapFrame:GetChildren() }
|
||||||
|
for _, c in ipairs(wmCh) do
|
||||||
|
if c and not c._nanamiNuked and not c._nanamiSkinned then
|
||||||
|
local cn = c.GetName and c:GetName() or ""
|
||||||
|
if cn ~= "" and (
|
||||||
|
string.find(cn, "SizeUp") or
|
||||||
|
string.find(cn, "SizeDown") or
|
||||||
|
string.find(cn, "Resize") or
|
||||||
|
string.find(cn, "Maximize") or
|
||||||
|
string.find(cn, "Minimize")
|
||||||
|
) then
|
||||||
|
NukeFrame(c)
|
||||||
|
elseif cn == "" then
|
||||||
|
local w = c.GetWidth and c:GetWidth() or 999
|
||||||
|
local h = c.GetHeight and c:GetHeight() or 999
|
||||||
|
if w > 0 and w < 30 and h > 0 and h < 30 then
|
||||||
|
NukeFrame(c)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
blizzHooked = true
|
blizzHooked = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -377,6 +420,8 @@ local function HookTooltipShow(tip)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local RepositionWorldMapControls
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- 4. Per-frame updater
|
-- 4. Per-frame updater
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@@ -412,6 +457,7 @@ local function OnFrameUpdate()
|
|||||||
UpdateTitle()
|
UpdateTitle()
|
||||||
UpdateCoords()
|
UpdateCoords()
|
||||||
HideBlizzardDecorations()
|
HideBlizzardDecorations()
|
||||||
|
RepositionWorldMapControls()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -425,13 +471,103 @@ local function ApplyLayout(cfg)
|
|||||||
WorldMapFrame:SetScale(s)
|
WorldMapFrame:SetScale(s)
|
||||||
WorldMapFrame:ClearAllPoints()
|
WorldMapFrame:ClearAllPoints()
|
||||||
WorldMapFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 30)
|
WorldMapFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 30)
|
||||||
WorldMapFrame:SetWidth(WorldMapButton:GetWidth() + 20)
|
WorldMapFrame:SetWidth(WorldMapButton:GetWidth() + 12)
|
||||||
WorldMapFrame:SetHeight(WorldMapButton:GetHeight() + 60)
|
WorldMapFrame:SetHeight(WorldMapButton:GetHeight() + 40)
|
||||||
|
|
||||||
|
WorldMapDetailFrame:ClearAllPoints()
|
||||||
|
WorldMapDetailFrame:SetPoint("TOPLEFT", WorldMapFrame, "TOPLEFT", 6, -32)
|
||||||
|
WorldMapButton:ClearAllPoints()
|
||||||
|
WorldMapButton:SetPoint("TOPLEFT", WorldMapDetailFrame, "TOPLEFT", 0, 0)
|
||||||
|
WorldMapButton:SetPoint("BOTTOMRIGHT", WorldMapDetailFrame, "BOTTOMRIGHT", 0, 0)
|
||||||
|
|
||||||
if BlackoutWorld then
|
if BlackoutWorld then
|
||||||
BlackoutWorld:Hide()
|
BlackoutWorld:Hide()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local blizzLabelsKilled = false
|
||||||
|
local function KillBlizzardDropDownLabels()
|
||||||
|
if blizzLabelsKilled then return end
|
||||||
|
local _G = getfenv(0)
|
||||||
|
local targets = {
|
||||||
|
_G["WorldMapContinentDropDown"],
|
||||||
|
_G["WorldMapZoneDropDown"],
|
||||||
|
_G["WorldMapZoneMinimapDropDown"],
|
||||||
|
_G["WorldMapFrameMiniBorderLeft"],
|
||||||
|
_G["WorldMapFrameMiniBorderRight"],
|
||||||
|
WorldMapFrame,
|
||||||
|
}
|
||||||
|
local found = 0
|
||||||
|
for _, parent in ipairs(targets) do
|
||||||
|
if parent and parent.GetRegions then
|
||||||
|
local regions = { parent:GetRegions() }
|
||||||
|
for _, r in ipairs(regions) do
|
||||||
|
if r and not r._nanamiCustom and r.GetObjectType
|
||||||
|
and r:GetObjectType() == "FontString" then
|
||||||
|
local t = r.GetText and r:GetText() or ""
|
||||||
|
if t == "大陆" or t == "地区"
|
||||||
|
or t == "Continent" or t == "Zone" then
|
||||||
|
r:SetText("")
|
||||||
|
r:SetAlpha(0)
|
||||||
|
r:Hide()
|
||||||
|
r.Show = function() end
|
||||||
|
r.SetText = function() end
|
||||||
|
r.SetAlpha = function() end
|
||||||
|
found = found + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, n in ipairs({"WorldMapContinentDropDownLabel", "WorldMapZoneDropDownLabel", "WorldMapZoneMinimapDropDownLabel"}) do
|
||||||
|
local lbl = _G[n]
|
||||||
|
if lbl then
|
||||||
|
lbl:SetAlpha(0)
|
||||||
|
lbl:Hide()
|
||||||
|
lbl.Show = function() end
|
||||||
|
lbl.SetText = function() end
|
||||||
|
found = found + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if found > 0 then blizzLabelsKilled = true end
|
||||||
|
end
|
||||||
|
|
||||||
|
RepositionWorldMapControls = function()
|
||||||
|
if not skinFrame or not titleBar then return end
|
||||||
|
local _G = getfenv(0)
|
||||||
|
|
||||||
|
if not blizzLabelsKilled then KillBlizzardDropDownLabels() end
|
||||||
|
|
||||||
|
if WorldMapDetailFrame then
|
||||||
|
WorldMapDetailFrame:ClearAllPoints()
|
||||||
|
WorldMapDetailFrame:SetPoint("TOPLEFT", WorldMapFrame, "TOPLEFT", 6, -32)
|
||||||
|
end
|
||||||
|
if WorldMapButton and WorldMapDetailFrame then
|
||||||
|
WorldMapButton:ClearAllPoints()
|
||||||
|
WorldMapButton:SetPoint("TOPLEFT", WorldMapDetailFrame, "TOPLEFT", 0, 0)
|
||||||
|
WorldMapButton:SetPoint("BOTTOMRIGHT", WorldMapDetailFrame, "BOTTOMRIGHT", 0, 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
local cDD = _G["WorldMapContinentDropDown"]
|
||||||
|
local zDD = _G["WorldMapZoneDropDown"]
|
||||||
|
local zBtn = _G["WorldMapZoomOutButton"]
|
||||||
|
|
||||||
|
if cDD then
|
||||||
|
cDD:ClearAllPoints()
|
||||||
|
cDD:SetPoint("TOPLEFT", skinFrame, "TOPLEFT", 200, -3)
|
||||||
|
end
|
||||||
|
if zDD then
|
||||||
|
zDD:ClearAllPoints()
|
||||||
|
zDD:SetPoint("LEFT", cDD, "RIGHT", 0, 0)
|
||||||
|
end
|
||||||
|
if zBtn then
|
||||||
|
zBtn:ClearAllPoints()
|
||||||
|
zBtn:SetPoint("LEFT", zDD, "RIGHT", -14, 2)
|
||||||
|
zBtn:SetWidth(48)
|
||||||
|
zBtn:SetHeight(20)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- 6. Window mode setup
|
-- 6. Window mode setup
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@@ -462,6 +598,7 @@ function WM:SetupWindowMode()
|
|||||||
WorldMapFrame:SetFrameStrata("FULLSCREEN_DIALOG")
|
WorldMapFrame:SetFrameStrata("FULLSCREEN_DIALOG")
|
||||||
if BlackoutWorld then BlackoutWorld:Hide() end
|
if BlackoutWorld then BlackoutWorld:Hide() end
|
||||||
HideBlizzardDecorations()
|
HideBlizzardDecorations()
|
||||||
|
RepositionWorldMapControls()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
HookScript(WorldMapFrame, "OnHide", function()
|
HookScript(WorldMapFrame, "OnHide", function()
|
||||||
@@ -521,11 +658,13 @@ function WM:SetupWindowMode()
|
|||||||
if origMaximize then origMaximize() end
|
if origMaximize then origMaximize() end
|
||||||
ApplyLayout(WM:GetConfig())
|
ApplyLayout(WM:GetConfig())
|
||||||
HideBlizzardDecorations()
|
HideBlizzardDecorations()
|
||||||
|
RepositionWorldMapControls()
|
||||||
end
|
end
|
||||||
_G2.WorldMapFrame_Minimize = function()
|
_G2.WorldMapFrame_Minimize = function()
|
||||||
if origMinimize then origMinimize() end
|
if origMinimize then origMinimize() end
|
||||||
ApplyLayout(WM:GetConfig())
|
ApplyLayout(WM:GetConfig())
|
||||||
HideBlizzardDecorations()
|
HideBlizzardDecorations()
|
||||||
|
RepositionWorldMapControls()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -548,7 +687,12 @@ local function SkinDropDown(dropdownName)
|
|||||||
bg:SetPoint("TOPLEFT", dd, "TOPLEFT", 16, -2)
|
bg:SetPoint("TOPLEFT", dd, "TOPLEFT", 16, -2)
|
||||||
bg:SetPoint("BOTTOMRIGHT", dd, "BOTTOMRIGHT", -16, 6)
|
bg:SetPoint("BOTTOMRIGHT", dd, "BOTTOMRIGHT", -16, 6)
|
||||||
bg:SetFrameLevel(dd:GetFrameLevel())
|
bg:SetFrameLevel(dd:GetFrameLevel())
|
||||||
bg:SetBackdrop(PANEL_BACKDROP)
|
bg:SetBackdrop({
|
||||||
|
bgFile = "Interface\\Buttons\\WHITE8X8",
|
||||||
|
edgeFile = "Interface\\Buttons\\WHITE8X8",
|
||||||
|
edgeSize = 1,
|
||||||
|
insets = { left = 1, right = 1, top = 1, bottom = 1 },
|
||||||
|
})
|
||||||
bg:SetBackdropColor(_A.btnBg[1], _A.btnBg[2], _A.btnBg[3], _A.btnBg[4])
|
bg:SetBackdropColor(_A.btnBg[1], _A.btnBg[2], _A.btnBg[3], _A.btnBg[4])
|
||||||
bg:SetBackdropBorderColor(_A.btnBorder[1], _A.btnBorder[2], _A.btnBorder[3], _A.btnBorder[4])
|
bg:SetBackdropBorderColor(_A.btnBorder[1], _A.btnBorder[2], _A.btnBorder[3], _A.btnBorder[4])
|
||||||
dd._nanamiBG = bg
|
dd._nanamiBG = bg
|
||||||
@@ -561,6 +705,36 @@ local function SkinDropDown(dropdownName)
|
|||||||
text:SetTextColor(_A.btnText[1], _A.btnText[2], _A.btnText[3])
|
text:SetTextColor(_A.btnText[1], _A.btnText[2], _A.btnText[3])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local origLabel = _G[dropdownName .. "Label"]
|
||||||
|
local labelText = ""
|
||||||
|
if origLabel then
|
||||||
|
labelText = origLabel:GetText() or ""
|
||||||
|
origLabel:Hide()
|
||||||
|
origLabel:SetAlpha(0)
|
||||||
|
origLabel:SetText("")
|
||||||
|
origLabel:ClearAllPoints()
|
||||||
|
origLabel:SetPoint("TOPLEFT", UIParent, "TOPLEFT", -9999, 9999)
|
||||||
|
origLabel.Show = function() end
|
||||||
|
origLabel.SetText = function() end
|
||||||
|
origLabel.SetPoint = function() end
|
||||||
|
origLabel.ClearAllPoints = function() end
|
||||||
|
end
|
||||||
|
if labelText == "" then
|
||||||
|
if string.find(dropdownName, "Continent") then labelText = "大陆"
|
||||||
|
elseif string.find(dropdownName, "ZoneMinimap") then labelText = ""
|
||||||
|
elseif string.find(dropdownName, "Zone") then labelText = "地区"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if labelText ~= "" then
|
||||||
|
local newLabel = bg:CreateFontString(nil, "OVERLAY")
|
||||||
|
newLabel._nanamiCustom = true
|
||||||
|
newLabel:SetFont(font, 11, "OUTLINE")
|
||||||
|
newLabel:SetTextColor(_A.dimText[1], _A.dimText[2], _A.dimText[3])
|
||||||
|
newLabel:SetPoint("RIGHT", bg, "LEFT", -4, 0)
|
||||||
|
newLabel:SetText(labelText)
|
||||||
|
dd._nanamiLabel = newLabel
|
||||||
|
end
|
||||||
|
|
||||||
local btn = _G[dropdownName .. "Button"]
|
local btn = _G[dropdownName .. "Button"]
|
||||||
if btn then
|
if btn then
|
||||||
local nt = btn:GetNormalTexture()
|
local nt = btn:GetNormalTexture()
|
||||||
@@ -624,7 +798,12 @@ local function SkinNativeButton(btnName, labelOverride)
|
|||||||
local ht = btn.GetHighlightTexture and btn:GetHighlightTexture()
|
local ht = btn.GetHighlightTexture and btn:GetHighlightTexture()
|
||||||
if ht then ht:SetAlpha(0) end
|
if ht then ht:SetAlpha(0) end
|
||||||
|
|
||||||
btn:SetBackdrop(PANEL_BACKDROP)
|
btn:SetBackdrop({
|
||||||
|
bgFile = "Interface\\Buttons\\WHITE8X8",
|
||||||
|
edgeFile = "Interface\\Buttons\\WHITE8X8",
|
||||||
|
edgeSize = 1,
|
||||||
|
insets = { left = 1, right = 1, top = 1, bottom = 1 },
|
||||||
|
})
|
||||||
btn:SetBackdropColor(_A.btnBg[1], _A.btnBg[2], _A.btnBg[3], _A.btnBg[4])
|
btn:SetBackdropColor(_A.btnBg[1], _A.btnBg[2], _A.btnBg[3], _A.btnBg[4])
|
||||||
btn:SetBackdropBorderColor(_A.btnBorder[1], _A.btnBorder[2], _A.btnBorder[3], _A.btnBorder[4])
|
btn:SetBackdropBorderColor(_A.btnBorder[1], _A.btnBorder[2], _A.btnBorder[3], _A.btnBorder[4])
|
||||||
|
|
||||||
@@ -663,6 +842,7 @@ local function SkinWorldMapControls()
|
|||||||
SkinNativeButton("WorldMapZoomOutButton", "缩小")
|
SkinNativeButton("WorldMapZoomOutButton", "缩小")
|
||||||
|
|
||||||
SkinDropDownLists()
|
SkinDropDownLists()
|
||||||
|
RepositionWorldMapControls()
|
||||||
|
|
||||||
if not ddListHooked then
|
if not ddListHooked then
|
||||||
ddListHooked = true
|
ddListHooked = true
|
||||||
|
|||||||
Reference in New Issue
Block a user