Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
移除LBF所用函数SaveSkin
  • Loading branch information
licj0910 committed Sep 24, 2024
1 parent 814a9af commit 785a6c4
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 111 deletions.
61 changes: 30 additions & 31 deletions AbilityBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,13 @@ GhostRecon.CONST_PADDING = 1

local nextId = 1


local masterSpellFrame = nil
local nextRefreshTime = nil
local inCombat = false

local mobsInCombat = {}

local function SaveSkin(arg, SkinID, Gloss, Backdrop, Group, Button, Colors)
GhostReconDB.SkinSettings = GhostReconDB.SkinSettings or {}
GhostReconDB.SkinSettings.SkinID = SkinID
GhostReconDB.SkinSettings.Gloss = Gloss
GhostReconDB.SkinSettings.Backdrop = Backdrop
GhostReconDB.SkinSettings.Colors = Colors
end

local function GetSpellInfo(spellID)
if not spellID then
return nil;
Expand Down Expand Up @@ -326,32 +319,38 @@ local function SpellsForMob(unitId)
end

local function UpdateSpellBar(spells)
masterSpellFrame:SetSpells(spells)

if GhostReconDB.Settings.AbilitiesBarEnabled then
masterSpellFrame:Show()
masterSpellFrame:SetAlpha(masterSpellFrame.preferredAlpha or GhostReconDB.Settings.OutOfCombatAlpha or 1)
end
if masterSpellFrame then
masterSpellFrame:SetSpells(spells)

if GhostReconDB.Settings.AbilitiesBarEnabled then
masterSpellFrame:Show()
masterSpellFrame:SetAlpha(masterSpellFrame.preferredAlpha or GhostReconDB.Settings.OutOfCombatAlpha or 1)
end
end
end

function GhostRecon:RefreshSpells(unitId)
local spells = SpellsForMob(unitId)

UpdateSpellBar(spells)

-- stop existing effects
masterSpellFrame:StopCooldowns()

-- now, reset all the cooldowns in progress for the mob the bar is showing
local spellInfo = mobsInCombat[masterSpellFrame.mobGuid]

if spellInfo then
for i, v in pairs(spellInfo) do
if v.radarType == "COOLDOWN" then
masterSpellFrame:SetCooldown(v.spellId, v.startTime, v.duration, 1)
end
end
end
local spells = SpellsForMob(unitId)

UpdateSpellBar(spells)

-- stop existing effects
if masterSpellFrame then
masterSpellFrame:StopCooldowns()
end

-- now, reset all the cooldowns in progress for the mob the bar is showing
local spellInfo = mobsInCombat[masterSpellFrame.mobGuid]

if spellInfo then
for i, v in pairs(spellInfo) do
if v.radarType == "COOLDOWN" then
if masterSpellFrame then
masterSpellFrame:SetCooldown(v.spellId, v.startTime, v.duration, 1)
end
end
end
end
end

local function BarUnitChanged()
Expand Down
10 changes: 5 additions & 5 deletions Comms.lua
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ end
function GhostRecon:SendNotification(notifyType, mobGuid, mobName, spellId, spellName, zone, success, inInstance)
if IsInGuild() and GhostRecon.useComms and GhostReconDB.Settings.GuildSync then
if notifyType ~= nil and
mobGuid ~= nil and
mobName ~= nil and
spellId ~= nil and
spellName ~= nil and
zone ~= nil then
mobGuid ~= nil and
mobName ~= nil and
spellId ~= nil and
spellName ~= nil and
zone ~= nil then

local msg

Expand Down
86 changes: 25 additions & 61 deletions Localization.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@ namespace.L = L
local LOCALE = GetLocale()

if LOCALE == "enUS" then
-- The EU English game client also uses the US English locale code.
--The EU English game client also uses the US English locale code.
--Config.lua
L["Bar Scale: "] = "Bar Scale: "
L["Columns: "] = "Columns: "
L["Out of Combat Alpha: %d%%"] = "Out of Combat Alpha: %d%%"
L["In-Combat Alpha: %d%%"] = "In-Combat Alpha: %d%%"

L["Tooltip enabled"] = "Tooltip enabled"
L["Add spells to tooltip"] = "Add spells to tooltip"
L["Show icons in tooltip"] = "Show icons in tooltip"
L["Show abilities bar"] = "Show abilities bar"
L["Unit for bar"] = "Unit for bar"

L["Synchronize with guild members"] = "Synchronize with guild members"
L["Display information messages"] = "Display information messages"
L["Record instances/raids only"] = "Record instances/raids only"
Expand All @@ -53,16 +51,16 @@ if LOCALE == "enUS" then
L["Saw spell/ability: %s has a spell/ability called %s."] = "Saw spell/ability: %s has a spell/ability called %s."
L["Saw control: %s is not affected by %s."] = "Saw control: %s is not affected by %s."
L["Ghost: Recon users in guild currently on-line..."] = "Ghost: Recon users in guild currently on-line..."
L["Ghost: Recon - Spells and Abilities of '%s'..."] = "Ghost: Recon - Spells and Abilities of '%s'..."
L["Ghost: Recon - Spells and Abilities of '%s'..."] = "Ghost: Recon - Spells and Abilities of '%s'..."
L["Recording is switched on."] = "Recording is switched on."
L["Recording is switched off."] = "Recording is switched off."

--Search.lua
L["Abilities"] = "Abilities"
L["Ghost: Recon - Mob Search"] = "Ghost: Recon - Mob Search"
L["Zone"] = "Zone"
L["Mob"] = "Mob"
L["Notes"] = "Notes"
L["Abilities"] = "Abilities"
L["Ghost: Recon - Mob Search"] = "Ghost: Recon - Mob Search"
L["Zone"] = "Zone"
L["Mob"] = "Mob"
L["Notes"] = "Notes"
L["Clear Mob"] = "Clear Mob"
L["Whisper"] = "Whisper"
L["Report"] = "Report"
Expand All @@ -76,58 +74,26 @@ if LOCALE == "enUS" then
L["Instant"] = "Instant"
L["%0.1f sec"] = "%0.1f sec"
L[" (%d yds)"] = " (%d yds)"
L[" (%d-%d yds)"] = " (%d-%d yds)"
L[" (%d-%d yds)"] = " (%d-%d yds)"
L["Tauntable"] = "Tauntable"
L["Not tauntable"] = "Not tauntable"
L["Stunnable"] = "Stunnable"
L["Stunnable"] = "Stunnable"
L["Not stunnable"] = "Not stunnable"
return end

if LOCALE == "deDE" then
-- German translations go here

return end

if LOCALE == "frFR" then
-- French translations go here

return end

if LOCALE == "esES" or LOCALE == "esMX" then
-- Spanish translations go here

return end

if LOCALE == "ptBR" then
-- Brazilian Portuguese translations go here
-- Note that the EU Portuguese WoW client also uses the Brazilian Portuguese locale code.

return end

if LOCALE == "ruRU" then
-- Russian translations go here

return end

if LOCALE == "koKR" then
-- Korean translations go here

return end

if LOCALE == "zhCN" then
-- Simplified Chinese translations go here
--Simplified Chinese translations go here
--Config.lua
L["Bar Scale: "] = "技能条缩放: "
L["Columns: "] = "每行图标: "
L["Out of Combat Alpha: %d%%"] = "脱战透明: %d%%"
L["In-Combat Alpha: %d%%"] = "战斗中透明: %d%%"

L["Tooltip enabled"] = "启用鼠标提示"
L["Add spells to tooltip"] = "添加技能到提示"
L["Show icons in tooltip"] = "显示提示图标"
L["Show abilities bar"] = "显示技能条"
L["Unit for bar"] = "技能条对象"

L["Synchronize with guild members"] = "公会同步"
L["Display information messages"] = "聊天栏显示信息"
L["Record instances/raids only"] = "仅记录副本/团本"
Expand All @@ -154,16 +120,16 @@ if LOCALE == "zhCN" then
L["Saw spell/ability: %s has a spell/ability called %s."] = "发现法术/技能: %s 有法术/技能叫 %s."
L["Saw control: %s is not affected by %s."] = "发现控制: %s 不可被影响 %s."
L["Ghost: Recon users in guild currently on-line..."] = "Ghost: Recon 当前在线公会成员..."
L["Ghost: Recon - Spells and Abilities of '%s'..."] = "Ghost: Recon - '%s'的法术和技能..."
L["Ghost: Recon - Spells and Abilities of '%s'..."] = "Ghost: Recon - '%s'的法术和技能..."
L["Recording is switched on."] = "打开记录"
L["Recording is switched off."] = "关闭记录"

--Search.lua
L["Abilities"] = "技能"
L["Ghost: Recon - Mob Search"] = "Ghost: Recon - 怪物搜索"
L["Zone"] = "区域"
L["Mob"] = "怪物"
L["Notes"] = "注释"
L["Abilities"] = "技能"
L["Ghost: Recon - Mob Search"] = "Ghost: Recon - 怪物搜索"
L["Zone"] = "区域"
L["Mob"] = "怪物"
L["Notes"] = "注释"
L["Clear Mob"] = "清除怪物"
L["Whisper"] = "密语"
L["Report"] = "报告"
Expand All @@ -180,24 +146,22 @@ if LOCALE == "zhCN" then
L[" (%d-%d yds)"] = " (%d-%d 码)"
L["Tauntable"] = "可嘲讽"
L["Not tauntable"] = "不可嘲讽"
L["Stunnable"] = "可晕"
L["Stunnable"] = "可晕"
L["Not stunnable"] = "不可晕"
return end

if LOCALE == "zhTW" then
-- Traditional Chinese translations go here
--Traditional Chinese translations go here
--Config.lua
L["Bar Scale: "] = "技能條縮放: "
L["Columns: "] = "每行圖標: "
L["Out of Combat Alpha: %d%%"] = "脫戰透明: %d%%"
L["In-Combat Alpha: %d%%"] = "戰鬥中透明: %d%%"

L["Tooltip enabled"] = "啓用鼠標提示"
L["Add spells to tooltip"] = "添加技能到提示"
L["Show icons in tooltip"] = "顯示提示圖標"
L["Show abilities bar"] = "顯示技能條"
L["Unit for bar"] = "技能條對象"

L["Synchronize with guild members"] = "公會同步"
L["Display information messages"] = "聊天欄顯示信息"
L["Record instances/raids only"] = "僅記錄副本/團本"
Expand All @@ -224,16 +188,16 @@ if LOCALE == "zhTW" then
L["Saw spell/ability: %s has a spell/ability called %s."] = "發現法術/技能: %s 有法術/技能叫 %s。"
L["Saw control: %s is not affected by %s."] = "發現控制: %s 不可被影響 %s."
L["Ghost: Recon users in guild currently on-line..."] = "Ghost: Recon 當前在線公會成員..."
L["Ghost: Recon - Spells and Abilities of '%s'..."] = "Ghost: Recon - '%s'的法術和技能..."
L["Ghost: Recon - Spells and Abilities of '%s'..."] = "Ghost: Recon - '%s'的法術和技能..."
L["Recording is switched on."] = "打開記錄"
L["Recording is switched off."] = "關閉記錄"

--Search.lua
L["Abilities"] = "技能"
L["Ghost: Recon - Mob Search"] = "Ghost: Recon - 怪物搜索"
L["Zone"] = "區域"
L["Mob"] = "怪物"
L["Notes"] = "註釋"
L["Abilities"] = "技能"
L["Ghost: Recon - Mob Search"] = "Ghost: Recon - 怪物搜索"
L["Zone"] = "區域"
L["Mob"] = "怪物"
L["Notes"] = "註釋"
L["Clear Mob"] = "清除怪物"
L["Whisper"] = "密語"
L["Report"] = "報告"
Expand All @@ -250,6 +214,6 @@ if LOCALE == "zhTW" then
L[" (%d-%d yds)"] = " (%d-%d 碼)"
L["Tauntable"] = "可嘲諷"
L["Not tauntable"] = "不可嘲諷"
L["Stunnable"] = "可暈"
L["Stunnable"] = "可暈"
L["Not stunnable"] = "不可暈"
return end
17 changes: 3 additions & 14 deletions Search.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ local frm = CreateFrame("Frame", "GhostReconBrowser", UIParent)
local mouseOverMob
local nextId = 1


local function GetSpellInfo(spellID)
if not spellID then
return nil;
Expand Down Expand Up @@ -215,7 +214,6 @@ local function CreateSpellFrame(spellId, parent)

rc:GrSetSize(CONST_SIZE)


rc.FrameRepresentsSpell = function(this, spellId)
local retCode

Expand Down Expand Up @@ -267,7 +265,6 @@ local function CreateSpellBar()
end
end


local maxCols = math.min(this.spellCount, CONST_COLUMNS)
local maxRows = math.floor(this.spellCount / maxCols)

Expand Down Expand Up @@ -376,7 +373,7 @@ local function InputValid()
return rc
end

local function UpdateTooltip()
local function UpdateTooltip(this)
if InputValid() then
if mouseOverMob then
GameTooltip_SetDefaultAnchor(GameTooltip, this)
Expand Down Expand Up @@ -531,18 +528,14 @@ frm.Zone:SetScript("OnTextChanged", function()
local current = nil
local count = 0


-- frm.Mob:SetText("")

for _, v in pairs(zones) do
local curZone = v


-- match it up with what we typed
local l = math.min(string.len(curText), string.len(curZone))
local comp = string.sub(curText, 1, l)


if string.lower(comp) == string.lower(string.sub(curZone, 1, l)) then
current = v
count = count + 1
Expand All @@ -556,6 +549,7 @@ frm.Zone:SetScript("OnTextChanged", function()

InfoVisible(InputValid())
end)

frm.Zone:SetScript("OnTabPressed", function()
frm.Mob:SetFocus()
frm.Mob:HighlightText()
Expand Down Expand Up @@ -590,16 +584,13 @@ frm.Mob:SetScript("OnTextChanged", function()
local current = nil
local count = 0


for _, v in pairs(mobs) do
local curMob = v


-- match it up with what we typed
local l = math.min(string.len(curText), string.len(curMob))
local comp = string.sub(curText, 1, l)


if string.lower(comp) == string.lower(string.sub(curMob, 1, l)) then
current = v
count = count + 1
Expand All @@ -614,7 +605,6 @@ frm.Mob:SetScript("OnTextChanged", function()
if InputValid() then
local spells = SpellsForMob("", frm.Mob:GetText(), frm.Zone:GetText())


frm.spellFrame:SetSpells(spells)
frm.Notes:SetText(GhostRecon:GetNotes(frm.Zone:GetText(), "", frm.Mob:GetText()))
InfoVisible(true)
Expand Down Expand Up @@ -730,7 +720,6 @@ StaticPopupDialogs["GhostReconWhisper"] = {
OnAccept = function(self)
local who = getglobal(self:GetName().."EditBox"):GetText()


if who ~= nil and string.len(who) > 0 then
ReportCurrentMob(who)
end
Expand All @@ -753,4 +742,4 @@ frm.ReportMob:Disable()
local subcategory, _ = Settings.RegisterCanvasLayoutSubcategory(GhostRecon.optionsFrame.settingsCategory, frm, frm.name);
frm.settingsCategory = subcategory;

GhostRecon.browser = frm
GhostRecon.browser = frm

0 comments on commit 785a6c4

Please sign in to comment.