完成多出修改

修复拾取界面点击无效问题
修复宠物训练界面不显示训练点问题
新增天赋分享到聊天界面
修复飞行界面无法关闭问题
修复术士宠物的显示问题
为天赋界面添加默认数据库支持
框架现在也可自主选择是否启用
玩家框架和目标框架可取消显示3D头像以及透明度修改
背包和银行也添加透明度自定义支持
优化tooltip性能和背包物品显示方式
修复布局模式在ui缩放后不能正常定位的问题
添加硬核模式危险和死亡的工会通报
添加拾取和已拾取的框体
等等
This commit is contained in:
rucky
2026-03-23 10:25:25 +08:00
parent 63337b14d2
commit ec9e3c29d6
34 changed files with 13897 additions and 578 deletions

220
Core.lua
View File

@@ -2,6 +2,44 @@
SFrames = {}
DEFAULT_CHAT_FRAME:AddMessage("SF: Loading Core.lua...")
do
local _orig_wipe = wipe
if _orig_wipe then
wipe = function(t)
if t == nil then return end
return _orig_wipe(t)
end
end
local _orig_tinsert = tinsert
if _orig_tinsert then
tinsert = function(t, a2, a3)
if type(t) ~= "table" then return end
if a3 ~= nil then
return _orig_tinsert(t, a2, a3)
else
return _orig_tinsert(t, a2)
end
end
end
end
do
local _orig_UIFrameFade = UIFrameFade
if _orig_UIFrameFade then
UIFrameFade = function(frame, fadeInfo)
if not frame or not fadeInfo then return end
return _orig_UIFrameFade(frame, fadeInfo)
end
end
local origOnUpdate = UIParent and UIParent.GetScript and UIParent:GetScript("OnUpdate")
if origOnUpdate then
UIParent:SetScript("OnUpdate", function()
pcall(origOnUpdate)
end)
end
end
BINDING_HEADER_NANAMI_UI = "Nanami-UI"
BINDING_NAME_NANAMI_TOGGLE_NAV = "切换导航地图"
@@ -118,14 +156,22 @@ function SFrames:DoFullInitialize()
SFrames.Tooltip = CreateFrame("GameTooltip", "SFramesScanTooltip", nil, "GameTooltipTemplate")
SFrames.Tooltip:SetOwner(UIParent, "ANCHOR_NONE")
SFrames.Tooltip:SetAlpha(0)
SFrames.Tooltip:Hide()
-- Phase 1: Critical modules (unit frames, action bars) — must load immediately
if SFramesDB.enableUnitFrames ~= false then
if SFrames.Player and SFrames.Player.Initialize then SFrames.Player:Initialize() end
if SFrames.Pet and SFrames.Pet.Initialize then SFrames.Pet:Initialize() end
if SFrames.Target and SFrames.Target.Initialize then SFrames.Target:Initialize() end
if SFrames.ToT and SFrames.ToT.Initialize then SFrames.ToT:Initialize() end
if SFrames.Party and SFrames.Party.Initialize then SFrames.Party:Initialize() end
if SFramesDB.enablePlayerFrame ~= false then
if SFrames.Player and SFrames.Player.Initialize then SFrames.Player:Initialize() end
if SFrames.Pet and SFrames.Pet.Initialize then SFrames.Pet:Initialize() end
end
if SFramesDB.enableTargetFrame ~= false then
if SFrames.Target and SFrames.Target.Initialize then SFrames.Target:Initialize() end
if SFrames.ToT and SFrames.ToT.Initialize then SFrames.ToT:Initialize() end
end
if SFramesDB.enablePartyFrame ~= false then
if SFrames.Party and SFrames.Party.Initialize then SFrames.Party:Initialize() end
end
end
if SFrames.FloatingTooltip and SFrames.FloatingTooltip.Initialize then SFrames.FloatingTooltip:Initialize() end
@@ -150,6 +196,7 @@ function SFrames:DoFullInitialize()
{ "MapIcons", function() if SFrames.MapIcons and SFrames.MapIcons.Initialize then SFrames.MapIcons:Initialize() end end },
{ "Tweaks", function() if SFrames.Tweaks and SFrames.Tweaks.Initialize then SFrames.Tweaks:Initialize() end end },
{ "AFKScreen", function() if SFrames.AFKScreen and SFrames.AFKScreen.Initialize then SFrames.AFKScreen:Initialize() end end },
{ "LootDisplay", function() if SFrames.LootDisplay and SFrames.LootDisplay.Initialize then SFrames.LootDisplay:Initialize() end end },
}
local idx = 1
@@ -344,7 +391,11 @@ function SFrames:InitSlashCommands()
SFrames:Print("/nui afk - toggle AFK screen")
SFrames:Print("/nui pin - 地图标记 (clear/share)")
SFrames:Print("/nui nav - 切换导航地图")
SFrames:Print("/nui mapscan - 扫描所有地图更新迷雾揭示数据")
SFrames:Print("/nui mapexport - 导出扫描到的地图数据")
SFrames:Print("/nui layout - 布局模式(拖拽调整所有框体位置)")
SFrames:Print("/nui bind - 按键绑定模式(悬停按钮+按键)")
SFrames:Print("/nui talentdb - 天赋默认数据库管理/导出")
elseif cmd == "ui" or cmd == "uiconfig" then
if SFrames.ConfigUI and SFrames.ConfigUI.Build then SFrames.ConfigUI:Build("ui") end
elseif cmd == "chat" or cmd == "chatconfig" then
@@ -390,12 +441,78 @@ function SFrames:InitSlashCommands()
else
SFrames:Print("WorldMap module unavailable.")
end
elseif cmd == "mapscan" or cmd == "scanmap" then
if SFrames.MapReveal and SFrames.MapReveal.ScanAllMaps then
SFrames.MapReveal:ScanAllMaps()
else
SFrames:Print("MapReveal module unavailable.")
end
elseif cmd == "mapexport" then
if SFrames.MapReveal and SFrames.MapReveal.ExportScannedData then
SFrames.MapReveal:ExportScannedData()
else
SFrames:Print("MapReveal module unavailable.")
end
elseif cmd == "layout" or cmd == "movers" then
if SFrames.Movers and SFrames.Movers.ToggleLayoutMode then
SFrames.Movers:ToggleLayoutMode()
else
SFrames:Print("Layout mode unavailable.")
end
elseif cmd == "bind" or cmd == "keybind" then
if SFrames.ActionBars and SFrames.ActionBars.ToggleKeyBindMode then
SFrames.ActionBars:ToggleKeyBindMode()
else
SFrames:Print("ActionBars module unavailable.")
end
elseif cmd == "keybinds" or cmd == "kb" then
local KBM = SFrames.KeyBindManager
if not KBM then
SFrames:Print("KeyBindManager module unavailable.")
elseif args == "" then
if SFrames.ConfigUI and SFrames.ConfigUI.Build then
SFrames.ConfigUI:Build("keybinds")
end
elseif string.find(args, "^save ") then
local name = string.gsub(args, "^save ", "")
if name ~= "" then KBM:SaveProfile(name) end
elseif string.find(args, "^load ") then
local name = string.gsub(args, "^load ", "")
if name ~= "" then KBM:LoadProfile(name) end
elseif string.find(args, "^delete ") then
local name = string.gsub(args, "^delete ", "")
if name ~= "" then KBM:DeleteProfile(name) end
elseif args == "list" then
local list = KBM:GetProfileList()
if table.getn(list) == 0 then
SFrames:Print("没有保存的按键绑定方案")
else
SFrames:Print("按键绑定方案列表:")
for _, name in ipairs(list) do
local info = KBM:GetProfileInfo(name)
local desc = info and (info.charName .. ", " .. info.count .. "") or ""
SFrames:Print(" |cffffd100" .. name .. "|r " .. desc)
end
end
elseif args == "export" then
KBM:ShowExportDialog()
elseif args == "import" then
KBM:ShowImportDialog()
else
SFrames:Print("/nui keybinds - 打开设置面板")
SFrames:Print("/nui keybinds save <名称> - 保存当前绑定为方案")
SFrames:Print("/nui keybinds load <名称> - 加载方案")
SFrames:Print("/nui keybinds delete <名称> - 删除方案")
SFrames:Print("/nui keybinds list - 列出所有方案")
SFrames:Print("/nui keybinds export - 导出当前绑定")
SFrames:Print("/nui keybinds import - 导入绑定")
end
elseif cmd == "talentdb" or cmd == "tdb" then
if SFrames.TalentTree and SFrames.TalentTree.HandleTalentDBCommand then
SFrames.TalentTree:HandleTalentDBCommand(args)
else
SFrames:Print("TalentTree module unavailable.")
end
elseif cmd == "debugbuffs" or cmd == "db" then
local hex = SFrames.Theme and SFrames.Theme:GetAccentHex() or "ffffb3d9"
DEFAULT_CHAT_FRAME:AddMessage("|c" .. hex .. "[Nanami-UI]|r 当前所有 Buff")
@@ -437,7 +554,7 @@ function SFrames:InitSlashCommands()
if SFrames.ConfigUI and SFrames.ConfigUI.Build then SFrames.ConfigUI:Build("ui") end
else
local hex = SFrames.Theme and SFrames.Theme:GetAccentHex() or "ffffb3d9"
DEFAULT_CHAT_FRAME:AddMessage("|c" .. hex .. "[Nanami-UI]|r Commands: /nui, /nui ui, /nui bags, /nui chat, /nui unlock, /nui lock, /nui test, /nui partyh, /nui partyv, /nui focushelp, /nui mapreveal, /nui stats, /nui afk, /nui pin, /nui bind")
DEFAULT_CHAT_FRAME:AddMessage("|c" .. hex .. "[Nanami-UI]|r Commands: /nui, /nui ui, /nui bags, /nui chat, /nui layout, /nui unlock, /nui lock, /nui test, /nui partyh, /nui partyv, /nui focushelp, /nui mapreveal, /nui mapscan, /nui stats, /nui afk, /nui pin, /nui bind, /nui keybinds")
end
end
end
@@ -480,41 +597,44 @@ function SFrames:HideBlizzardFrames()
if SFramesDB and SFramesDB.enableUnitFrames == false then
-- Keep Blizzard unit frames when Nanami frames are disabled
else
-- Hide Player Frame
if PlayerFrame then
PlayerFrame:UnregisterAllEvents()
PlayerFrame:Hide()
PlayerFrame.Show = function() end
if not SFramesDB or SFramesDB.enablePlayerFrame ~= false then
if PlayerFrame then
PlayerFrame:UnregisterAllEvents()
PlayerFrame:Hide()
PlayerFrame.Show = function() end
end
if PetFrame then
PetFrame:UnregisterAllEvents()
PetFrame:Hide()
PetFrame.Show = function() end
end
end
-- Hide Pet Frame
if PetFrame then
PetFrame:UnregisterAllEvents()
PetFrame:Hide()
PetFrame.Show = function() end
if not SFramesDB or SFramesDB.enableTargetFrame ~= false then
if TargetFrame then
TargetFrame:UnregisterAllEvents()
TargetFrame:Hide()
TargetFrame.Show = function() end
end
if ComboFrame then
ComboFrame:UnregisterAllEvents()
ComboFrame:Hide()
ComboFrame.Show = function() end
ComboFrame.fadeInfo = ComboFrame.fadeInfo or {}
if ComboFrame_Update then
ComboFrame_Update = function() end
end
end
end
-- Hide Target Frame
if TargetFrame then
TargetFrame:UnregisterAllEvents()
TargetFrame:Hide()
TargetFrame.Show = function() end
end
-- Hide Combo Frame
if ComboFrame then
ComboFrame:UnregisterAllEvents()
ComboFrame:Hide()
ComboFrame.Show = function() end
end
-- Hide Party Frames
for i = 1, 4 do
local pf = _G["PartyMemberFrame"..i]
if pf then
pf:UnregisterAllEvents()
pf:Hide()
pf.Show = function() end
if not SFramesDB or SFramesDB.enablePartyFrame ~= false then
for i = 1, 4 do
local pf = _G["PartyMemberFrame"..i]
if pf then
pf:UnregisterAllEvents()
pf:Hide()
pf.Show = function() end
end
end
end
end
@@ -523,12 +643,12 @@ function SFrames:HideBlizzardFrames()
if (not SFramesDB) or (SFramesDB.enableRaidFrames ~= false) then
local function NeuterBlizzardRaidUI()
-- Default Classic UI (1.12)
if RaidFrame then
RaidFrame:UnregisterAllEvents()
RaidFrame:SetScript("OnEvent", nil)
RaidFrame:SetScript("OnUpdate", nil)
end
-- Prevent Raid groups from updating and showing
for i = 1, NUM_RAID_GROUPS or 8 do
local rgf = _G["RaidGroupButton"..i]
if rgf then
@@ -536,11 +656,18 @@ function SFrames:HideBlizzardFrames()
end
end
-- Override pullout generation
RaidPullout_Update = function() end
RaidPullout_OnEvent = function() end
RaidPullout_Update = function() return {} end
RaidPullout_OnEvent = function() return {} end
RaidGroupFrame_OnEvent = function() return {} end
RaidGroupFrame_Update = RaidGroupFrame_Update or function() end
if not RAID_SUBGROUP_LISTS then RAID_SUBGROUP_LISTS = {} end
for i = 1, NUM_RAID_GROUPS or 8 do
if not RAID_SUBGROUP_LISTS[i] then
RAID_SUBGROUP_LISTS[i] = {}
end
end
-- Hide individual pullout frames that might already exist
for i = 1, 40 do
local pf = _G["RaidPullout"..i]
if pf then
@@ -549,13 +676,7 @@ function SFrames:HideBlizzardFrames()
pf.Show = function() end
end
end
-- Hide standard GroupFrames
if RaidGroupFrame_OnEvent then
RaidGroupFrame_OnEvent = function() end
end
-- Hide newer/backported Compact Raid Frames if they exist
if CompactRaidFrameManager then
CompactRaidFrameManager:UnregisterAllEvents()
CompactRaidFrameManager:Hide()
@@ -570,7 +691,6 @@ function SFrames:HideBlizzardFrames()
NeuterBlizzardRaidUI()
-- Hook ADDON_LOADED to catch Blizzard_RaidUI loaded on demand
local raidHook = CreateFrame("Frame")
raidHook:RegisterEvent("ADDON_LOADED")
raidHook:SetScript("OnEvent", function()