WoWInterface SVN NeedToKnow-Updated

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /branches
    from Rev 79 to Rev 80
    Reverse comparison

Rev 79 → Rev 80

Kitjan/NeedToKnow/NeedToKnow.xml
11,10 → 11,10
</Anchors>
<Scripts>
<OnLoad>
UIDropDownMenu_Initialize(this, NeedToKnow.BarMenu_Initialize, "MENU");
UIDropDownMenu_Initialize(self, NeedToKnow.BarMenu_Initialize, "MENU");
</OnLoad>
<OnShow>
UIDropDownMenu_Initialize(this, NeedToKnow.BarMenu_Initialize, "MENU");
UIDropDownMenu_Initialize(self, NeedToKnow.BarMenu_Initialize, "MENU");
</OnShow>
</Scripts>
</Frame>
92,7 → 92,7
</Anchors>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Layer level="BORDER">
<Texture name="$parentTexture">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
103,6 → 103,8
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString name="$parentText" inherits="GameFontHighlight" justifyH="LEFT">
<Size>
<AbsDimension x="180" y="16"/>
127,8 → 129,6
</Anchor>
</Anchors>
</FontString>
</Layer>
<Layer level="OVERLAY">
<Texture name="$parentSpark" file="Interface\CastingBar\UI-CastingBar-Spark" alphaMode="ADD">
<Size>
<AbsDimension x="32" y="60"/>
144,7 → 144,11
self:RegisterForDrag("LeftButton");
</OnLoad>
<OnEnter>
NeedToKnow.Bar_OnEnter(self, motion);
local tooltip = _G["GameTooltip"];
tooltip:SetOwner(self:GetParent(), "ANCHOR_TOPLEFT");
tooltip:AddLine(NEEDTOKNOW.BAR_TOOLTIP1, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b, 1);
tooltip:AddLine(NEEDTOKNOW.BAR_TOOLTIP2, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1);
tooltip:Show();
</OnEnter>
<OnLeave>
GameTooltip:Hide();
Kitjan/NeedToKnow/NeedToKnow.lua
1,11 → 1,7
-- ---------------------
-- ----------------------
-- NeedToKnow
-- by Nephthys of Hyjal
-- updated by
-- kitjan
-- Bilt of Lightninghoof
-- lieandswell@yahoo.com
-- ---------------------
-- by Kitjan, lieandswell
-- ----------------------
 
 
if not trace then trace = print end
18,7 → 14,7
 
-- NEEDTOKNOW = {} is defined in the localization file, which must be loaded before this file
 
NEEDTOKNOW.VERSION = "3.1.1"
NEEDTOKNOW.VERSION = "3.1.7"
NEEDTOKNOW.MAXGROUPS = 4
NEEDTOKNOW.MAXBARS = 6
NEEDTOKNOW.UPDATE_INTERVAL = 0.05
55,11 → 51,13
vct_extra = 0,
bDetectExtends = false,
show_text = true,
show_count = true,
show_time = true,
show_spark = true,
show_icon = false,
show_mypip = false,
show_all_stacks = false,
show_text_user = "",
blink_enabled = false,
blink_ooc = true,
blink_boss = false,
116,7 → 114,6
-- SharedMedia Support
-- -------------------
 
 
NeedToKnow.LSM = LibStub("LibSharedMedia-3.0", true)
 
if not NeedToKnow.LSM:Fetch("statusbar", "Aluminum", true) then NeedToKnow.LSM:Register("statusbar", "Aluminum", [[Interface\Addons\NeedToKnow\Textures\Aluminum.tga]]) end
250,6 → 247,11
NeedToKnow.guidPlayer = UnitGUID("player")
NEEDTOKNOW.CURRENTSPEC = GetActiveTalentGroup()
 
local _, player_CLASS = UnitClass("player")
if player_CLASS == "DEATHKNIGHT" then
NeedToKnow.is_DK = 1
end
 
NeedToKnow.Update()
NeedToKnow.UIPanel_Update()
end
265,16 → 267,22
end
 
 
local function SetStatusBarValue(bar,texture,value)
local function SetStatusBarValue(bar,texture,value,value0)
local pct0 = 0
if value0 then
pct0 = value0 / bar.max_value
if pct0 > 1 then pct0 = 1 end
end
 
local pct = value / bar.max_value
texture.cur_value = value
if pct > 1 then pct = 1 end
local w = pct * bar:GetWidth()
local w = (pct-pct0) * bar:GetWidth()
if w < 1 then
texture:Hide()
else
texture:SetWidth(pct * bar:GetWidth())
texture:SetTexCoord(0,0,0,1,pct,0,pct,1)
texture:SetWidth(w)
texture:SetTexCoord(pct0,0, pct0,1, pct,0, pct,1)
texture:Show()
end
end
496,28 → 504,32
then
barSettings.Unit = "player"
end
 
-- Look for certain magic "spell" names
 
-- Split the spell names
bar.spells = {}
for barSpell in bar.auraName:gmatch("([^,]+),*") do
barSpell = strtrim(barSpell)
table.insert(bar.spells, barSpell)
end
 
-- split the user name overrides
bar.spell_names = {}
for un in barSettings.show_text_user:gmatch("([^,]+),*") do
un = strtrim(un)
table.insert(bar.spell_names, un)
end
 
-- Look for certain special "spell" names
barSettings.bAutoShot = nil
if ( barSettings.BuffOrDebuff == "CASTCD" ) then
local startIndex=1
local lastBuff = -1
if bar.auraName:len() > 0 then
_ , lastBuff = string.gsub(bar.auraName, "," , ",")
end
 
for idxBuff=0, lastBuff do
local endIndex = bar.auraName:find(",",startIndex,true) or (string.len(bar.auraName)+1)
local barSpell = strtrim(string.sub(bar.auraName, startIndex, endIndex-1))
startIndex = endIndex+1
 
for idx, barSpell in ipairs(bar.spells) do
if ( barSpell == "Auto Shot" or
barSpell == NEEDTOKNOW.AUTO_SHOT or
barSpell == "75" )
then
barSettings.bAutoShot = true
end
end
end
end
 
bar.settings = barSettings
621,23 → 633,28
if ( barSettings.show_mypip ) then
txt = txt.."* "
end
 
 
if ( barSettings.show_text ) then
txt = txt .. bar.auraName
if "" ~= barSettings.show_text_user then
txt = barSettings.show_text_user
else
txt = txt .. bar.auraName
end
 
if ( barSettings.append_cd
and (barSettings.BuffOrDebuff == "CASTCD"
or barSettings.BuffOrDebuff == "BUFFCD") )
then
txt = txt .. " CD"
elseif ( barSettings.append_usable
and barSettings.BuffOrDebuff == "USABLE" )
then
txt = txt .. " Usable"
end
if ( barSettings.bDetectExtends == true ) then
txt = txt .. " + 3s"
end
end
if ( barSettings.append_cd
and (barSettings.BuffOrDebuff == "CASTCD"
or barSettings.BuffOrDebuff == "BUFFCD") )
then
txt = txt .. " CD"
elseif ( barSettings.append_usable
and barSettings.BuffOrDebuff == "USABLE" )
then
txt = txt .. " Usable"
end
bar.text:SetText(txt)
 
if ( barSettings.Enabled ) then
679,7 → 696,7
end
end
 
if bar.settings.bDetectExtends then
if bar.settings.bDetectExtends or NeedToKnow.is_DK then
bar:RegisterEvent("UNIT_SPELLCAST_SENT")
end
if not bar.settings.blink_ooc then
708,7 → 725,7
 
function NeedToKnow.Bar_OnSizeChanged(self)
if (self.bar1.cur_value) then SetStatusBarValue(self, self.bar1, self.bar1.cur_value) end
if (self.bar2) then SetStatusBarValue(self, self.bar2, self.bar2.cur_value) end
if (self.bar2) then SetStatusBarValue(self, self.bar2, self.bar2.cur_value, self.bar1.cur_value) end
end
 
function NeedToKnow.Bar_OnEvent(self, event, ...)
744,8 → 761,8
elseif ( event == "UNIT_TARGET" and select(1, ...) == "target" ) then
NeedToKnow.Bar_AuraCheck(self)
elseif ( event == "UNIT_SPELLCAST_SENT" ) then
local unit, spell = select(1, ...)
if ( self.settings.bDetectExtends ) then
local unit, spell = select(1, ...)
if unit == "player" and self.buffName == spell then
local r = NeedToKnow.last_cast[spell]
if ( r and r.state == 0 ) then
755,6 → 772,15
end
end
end
if NeedToKnow.is_DK then
-- TODO: I hate that DKs have to pay this memory cost for every "spell" they ever cast
if unit == "player" then
if not NeedToKnow.last_sent then
NeedToKnow.last_sent = {}
end
NeedToKnow.last_sent[spell] = GetTime()
end
end
elseif ( event == "START_AUTOREPEAT_SPELL" ) then
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
elseif ( event == "STOP_AUTOREPEAT_SPELL" ) then
762,8 → 788,8
elseif ( event == "UNIT_SPELLCAST_SUCCEEDED" ) then
local caster, spell = select(1,...)
if ( self.settings.bAutoShot and caster == "player" and spell == NEEDTOKNOW.AUTO_SHOT ) then
local interval = UnitRangedDamage("player")
self.tAutoShotCD = interval
local interval = UnitRangedDamage("player")
self.tAutoShotCD = interval
self.tAutoShotExpires = GetTime() + interval
NeedToKnow.Bar_AuraCheck(self)
end
850,8 → 876,8
function NeedToKnow.CreateBar2(bar)
if ( not bar.bar2 ) then
local n = bar:GetName() .. "Bar2"
bar.bar2 = bar:CreateTexture(n, "ARTWORK")
bar.bar2:SetPoint("TOPLEFT", bar, "TOPLEFT")
bar.bar2 = bar:CreateTexture(n, "BORDER")
bar.bar2:SetPoint("TOPLEFT", bar.bar1, "TOPRIGHT")
bar.bar2:SetPoint("BOTTOM", bar, "BOTTOM")
bar.bar2:SetWidth(bar:GetWidth())
end
886,7 → 912,17
end
 
if ( bar.settings.show_text ) then
txt = txt .. NeedToKnow.ComputeBarText(bar.buffName, count, extended)
local n = bar.buffName
if "" ~= bar.settings.show_text_user then
local idx=bar.idxName
if idx > #bar.spell_names then idx = #bar.spell_names end
n = bar.spell_names[idx]
end
local c = count
if not bar.settings.show_count then
c = 1
end
txt = txt .. NeedToKnow.ComputeBarText(n, c, extended)
end
if ( bar.settings.append_cd
and (bar.settings.BuffOrDebuff == "CASTCD"
901,7 → 937,7
-- Is this an aura with a finite duration?
local vct_width = 0
if ( bar.duration > 0 ) then
-- Configure the main status bar
-- Configure the main status bar
local duration = bar.fixedDuration or bar.duration
bar.max_value = duration
 
961,16 → 997,25
local tt = CreateFrame("GameTooltip", ttname)
tt:SetOwner(UIParent, "ANCHOR_NONE")
tt.left = {}
tt.right = tt:CreateFontString()
tt.right:SetFontObject(GameFontNormal)
-- Most of the tooltip lines share the same text widget,
-- But we need to query the third one for cooldown info
tt.right1 = tt:CreateFontString()
tt.right1:SetFontObject(GameFontNormal)
tt.right3 = tt:CreateFontString()
tt.right3:SetFontObject(GameFontNormal)
for i = 1, 30 do
tt.left[i] = tt:CreateFontString()
tt.left[i]:SetFontObject(GameFontNormal)
tt:AddFontStrings(tt.left[i], tt.right)
if i ~= 3 then
tt:AddFontStrings(tt.left[i], tt.right1)
else
tt:AddFontStrings(tt.left[i], tt.right3)
end
end
end
end
local tt1,tt2 = NeedToKnow_Tooltip1, NeedToKnow_Tooltip2
 
tt1:ClearLines()
tt2:ClearLines()
return tt1,tt2
1015,9 → 1060,50
end
end
 
 
 
-- Looks at the tooltip for the given spell to see if a cooldown
-- is listed with a duration in seconds. Longer cooldowns don't
-- need this logic, so we don't need to do unit conversion
function NeedToKnow.DetermineShortCooldownFromTooltip(spell)
if not NeedToKnow.short_cds then
NeedToKnow.short_cds = {}
end
if not NeedToKnow.short_cds[spell] then
-- Figure out what a cooldown in seconds should look like
local ref = SecondsToTime(10):lower()
local unit_ref = ref:match("10 (.+)")
 
-- Get the number and unit of the cooldown from the tooltip
local tt1 = NeedToKnow.GetUtilityTooltips()
tt1:SetHyperlink( GetSpellLink(spell) )
local cd = tt1.right3:GetText()
local n_cd, unit_cd
if cd then
cd = cd:lower()
n_cd, unit_cd = cd:match("(%d+) (.+) ")
end
 
-- unit_ref will be "|4sec:sec;" in english, so do a find rather than a ==
if not n_cd then
-- If we couldn't parse the tooltip, assume there's no cd
NeedToKnow.short_cds[spell] = 0
elseif unit_ref:find(unit_cd) then
NeedToKnow.short_cds[spell] = tonumber(n_cd)
else
-- Not a short cooldown. Record it as a minute
NeedToKnow.short_cds[spell] = 60
end
end
 
return NeedToKnow.short_cds[spell]
end
 
 
-- Called whenever the state of auras on the bar's unit may have changed
function NeedToKnow.Bar_AuraCheck(bar)
local buffName, count, duration, expirationTime, caster, iconPath
local idxName = 0
local all_stacks
local settings = bar.settings
local bUnitExists, isWeapon
1053,17 → 1139,10
end
end
 
local startIndex=1
local lastBuff = -1
if bar.auraName:len() > 0 then
_ , lastBuff = string.gsub(bar.auraName, "," , ",")
end
 
for idxBuff=0, lastBuff do
local endIndex = bar.auraName:find(",",startIndex,true) or (string.len(bar.auraName)+1)
local barSpell = strtrim(string.sub(bar.auraName, startIndex, endIndex-1))
for idx, barSpell in ipairs(bar.spells) do
idxName = idx
local filter = settings.BuffOrDebuff
local _, nDigits = barSpell:find("^[0-9]+")
local _, nDigits = barSpell:find("^%d+")
local isSpellID = ( nDigits == barSpell:len() )
 
if ( settings.BuffOrDebuff == "TOTEM" ) then
1115,6 → 1194,11
caster = "player"
end
elseif settings.BuffOrDebuff == "CASTCD" then
local spellName=barSpell, spellRank, spellIconPath
local spellPower=0
if isSpellID or NeedToKnow.is_DK then
spellName, spellRank, spellIconPath, _, _, spellPower = GetSpellInfo(barSpell)
end
if ( settings.bAutoShot and (barSpell == "Auto Shot" or barSpell == NEEDTOKNOW.AUTO_SHOT or barSpell == "75") ) then
local tNow = GetTime()
if ( bar.tAutoShotExpires and bar.tAutoShotExpires > tNow ) then
1125,14 → 1209,51
caster = "player"
end
else
local start, cd_len = GetSpellCooldown(barSpell)
local tNow = GetTime()
local start, cd_len, should_cooldown = GetSpellCooldown(barSpell)
local is_spell = true
if not start then
start, cd_len = GetItemCooldown(barSpell)
is_spell = false
end
local tNow = GetTime()
if start and cd_len and cd_len > 1.5 then
 
if is_spell and start and start > 0 then
if 0 == should_cooldown then
-- Filter out conditions like Stealth while stealthed
start = nil
elseif spellPower == 5 then -- Rune
-- Filter out rune cooldown artificially extending the cd
if cd_len <= 10 then
if bar.expirationTime and tNow < bar.expirationTime then
-- We've already seen the correct CD for this; keep using it
start = bar.expirationTime - bar.duration
cd_len = bar.duration
elseif NeedToKnow.last_sent and NeedToKnow.last_sent[barSpell] and NeedToKnow.last_sent[barSpell] > (tNow - 1.5) then
-- We think the spell was just cast, and a CD just started but it's short.
-- Look at the tooltip to tell what the correct CD should be. If it's supposed
-- to be short (Ghoul Frenzy, Howling Blast), then start a CD bar
cd_len = NeedToKnow.DetermineShortCooldownFromTooltip(barSpell)
if cd_len == 0 or cd_len > 10 then
start = nil
end
else
start = nil
end
end
end
end
 
-- filter out the GCD, we only care about actual spell CDs
if cd_len <= 1.5 then
if not bar.expirationTime or bar.expirationTime < tNow then
start = nil
else
start = bar.expirationTime - bar.duration
cd_len = bar.duration
end
end
 
if start and cd_len then
local tEnd = start + cd_len
if ( tEnd > tNow + 0.1 ) then
if is_spell then
1150,7 → 1271,7
end
end
elseif settings.BuffOrDebuff == "USABLE" then
local _, nDigits = barSpell:find("^[0-9]+")
local _, nDigits = barSpell:find("^%d+")
local isSpellID = ( nDigits == barSpell:len() )
local key = barSpell
if ( isSpellID ) then key = tonumber(barSpell) end
1232,6 → 1353,7
 
all_stacks.total = all_stacks.total + count
if ( 0 == all_stacks.min.expirationTime or all_stacks.min.expirationTime > expirationTime ) then
all_stacks.min.idxName = idxName
all_stacks.min.buffName = buffName
all_stacks.min.caster = caster
all_stacks.min.duration = duration
1246,12 → 1368,11
break
end
end
 
startIndex = endIndex+1
end
end
 
if ( all_stacks ) then
idxName = all_stacks.min.idxName
buffName = all_stacks.min.buffName
caster = all_stacks.min.caster
duration = all_stacks.max.duration
1308,6 → 1429,7
bar.duration = duration
 
bar.expirationTime = expirationTime
bar.idxName = idxName
bar.buffName = buffName
bar.iconPath = iconPath
if ( all_stacks and all_stacks.max.expirationTime ~= expirationTime ) then
1317,7 → 1439,7
end
 
-- Mark the bar as not blinking before calling ConfigureVisibleBar,
-- since it calls OnUpdate which checks bar.blink
-- since it calls OnUpdate which checks bar.blink
bar.blink=false
NeedToKnow.ConfigureVisibleBar(bar, count, extended)
bar:Show()
1384,7 → 1506,7
local now = GetTime()
if ( now > self.nextUpdate ) then
self.nextUpdate = now + NEEDTOKNOW.UPDATE_INTERVAL
 
 
if ( self.blink ) then
self.blink_phase = self.blink_phase + NEEDTOKNOW.UPDATE_INTERVAL
if ( self.blink_phase >= 2 ) then
1418,25 → 1540,25
 
if ( self.duration > 0 ) then
local duration = self.fixedDuration or self.duration
local timeLeft = self.expirationTime - GetTime()
if ( timeLeft < 0 ) then
local bar1_timeLeft = self.expirationTime - GetTime()
if ( bar1_timeLeft < 0 ) then
if ( self.settings.BuffOrDebuff == "CASTCD" or
self.settings.BuffOrDebuff == "BUFFCD" )
then
NeedToKnow.Bar_AuraCheck(self)
return
end
timeLeft = 0
bar1_timeLeft = 0
end
SetStatusBarValue(self, self.bar1, timeLeft);
SetStatusBarValue(self, self.bar1, bar1_timeLeft);
if ( self.settings.show_time ) then
local fn = NeedToKnow[self.settings.TimeFormat]
local oldText = self.time:GetText()
local newText
if ( fn ) then
newText = fn(timeLeft)
newText = fn(bar1_timeLeft)
else
newText = string.format(SecondsToTimeAbbrev(timeLeft))
newText = string.format(SecondsToTimeAbbrev(bar1_timeLeft))
end
 
if ( newText ~= oldText ) then
1446,16 → 1568,16
self.time:SetText("")
end
 
if ( self.settings.show_spark and timeLeft <= duration ) then
self.spark:SetPoint("CENTER", self, "LEFT", self:GetWidth()*timeLeft/duration, 0)
if ( self.settings.show_spark and bar1_timeLeft <= duration ) then
self.spark:SetPoint("CENTER", self, "LEFT", self:GetWidth()*bar1_timeLeft/duration, 0)
self.spark:Show()
else
self.spark:Hide()
end
 
if ( self.max_expirationTime ) then
local timeLeft = self.max_expirationTime - GetTime()
SetStatusBarValue(self, self.bar2, timeLeft)
local bar2_timeLeft = self.max_expirationTime - GetTime()
SetStatusBarValue(self, self.bar2, bar2_timeLeft, bar1_timeLeft)
end
 
if ( self.vct_refresh ) then
Kitjan/NeedToKnow/NeedToKnow.toc
1,11 → 1,13
## Interface: 30300
## X-Compatible-With: 40000
## Title: NeedToKnow
## Author: Kitjan
## Version: 3.1.1
## Notes: Buff/debuff timer bars, original code by Nephthys of Hyjal-US. Additional work by lieandswell and Bilt
## Author: Kitjan, lieandswell
## Version: 3.1.7
## Notes: Timer bars for buffs, debuffs, cooldowns, etc.
## X-Credits: Bilt, Fxfighter EU-Echsenkessel, metalchoir, sp00n, Vlakarados, wowui.cn
## X-Category: Buffs, Combat
## OptionalDeps: LibStub,LibSharedMedia-3.0
## DefaultState: Enabled
## LoadOnDemand: 0
## DefaultState: enabled
## SavedVariablesPerCharacter: NeedToKnow_Settings
libs\LibStub\LibStub.lua
libs\CallbackHandler-1.0\CallbackHandler-1.0.lua
Kitjan/NeedToKnow/NeedToKnow_Localization.lua
1,8 → 1,63

-- If you want to be super helpful, you can translate this stuff into whatever non-enUS language you happen to know. Email them to me and I'll credit you. ZOMG 15 minutes of fame. Neph <lieandswell@yahoo.com>
--[[
 
If you want to be super helpful, you can translate this stuff into whatever non-enUS language you happen to know and we'll credit you. Please post the translations as a ticket on CurseForge.com (http://wow.curseforge.com/addons/need-to-know/tickets/) or email them to us (lieandswell@yahoo.com).
 
Thanks a bunch!
 
--]]
 
NEEDTOKNOW = {};
-- Untranslated defaults
 
-- Define defaults in enUS
NEEDTOKNOW.BAR_TOOLTIP1 = "NeedToKnow";
NEEDTOKNOW.BAR_TOOLTIP2 = "Right click bars to configure. More options in the Blizzard interface options menu. Type /needtoknow to lock and enable.";
 
NEEDTOKNOW.RESIZE_TOOLTIP = "Click and drag to change size";
 
NEEDTOKNOW.BARMENU_ENABLE = "Enable bar";
NEEDTOKNOW.BARMENU_CHOOSENAME = "Choose buff/debuff to time";
NEEDTOKNOW.CHOOSENAME_DIALOG = "Enter the name of the buff or debuff to time with this bar"
NEEDTOKNOW.CHOOSE_OVERRIDE_TEXT = "Normally, the name of the aura/item/spell that activated the bar is displayed. By entering text here, you can override that text with something else. Leave this blank to use the default behavior."
NEEDTOKNOW.BARMENU_CHOOSEUNIT = "Unit to monitor";
NEEDTOKNOW.BARMENU_PLAYER = "Player";
NEEDTOKNOW.BARMENU_TARGET = "Target";
NEEDTOKNOW.BARMENU_FOCUS = "Focus";
NEEDTOKNOW.BARMENU_PET = "Pet";
NEEDTOKNOW.BARMENU_VEHICLE = "Vehicle";
NEEDTOKNOW.BARMENU_TARGETTARGET = "Target of Target";
NEEDTOKNOW.BARMENU_BUFFORDEBUFF = "Bar Type";
NEEDTOKNOW.BARMENU_SPELLID = "Use SpellID";
NEEDTOKNOW.BARMENU_HELPFUL = "Buff";
NEEDTOKNOW.BARMENU_HARMFUL = "Debuff";
NEEDTOKNOW.BARMENU_ONLYMINE = "Only show if cast by self";
NEEDTOKNOW.BARMENU_BARCOLOR = "Bar color";
NEEDTOKNOW.BARMENU_CLEARSETTINGS = "Clear settings";
 
NEEDTOKNOW.UIPANEL_SUBTEXT1 = "These options allow you to customize NeedToKnow's timer bars.";
-- NEEDTOKNOW.UIPANEL_SUBTEXT2 = "Bars work when locked. When unlocked, you can move/size bar groups and right click individual bars for more settings. You can also type '/needtoknow' or '/ntk' to lock/unlock.";
NEEDTOKNOW.UIPANEL_BARGROUP = "Group ";
NEEDTOKNOW.UIPANEL_NUMBERBARS = "Number of bars";
NEEDTOKNOW.UIPANEL_FIXEDDURATION = "Max bar duration";
NEEDTOKNOW.UIPANEL_LOCK = "Lock";
NEEDTOKNOW.UIPANEL_UNLOCK = "Unlock";
NEEDTOKNOW.UIPANEL_TOOLTIP_ENABLEGROUP = "Show and enable this group of bars";
NEEDTOKNOW.UIPANEL_TOOLTIP_FIXEDDURATION = "Set the maximum length of bars for this group (in seconds). Leave empty to set dynamically per bar.";
NEEDTOKNOW.UIPANEL_TOOLTIP_BARTEXTURE = "Choose the texture graphic for timer bars";
NEEDTOKNOW.CMD_RESET = "reset";
 
NEEDTOKNOW.UIPANEL_CONFIGMODE = "Config mode";
NEEDTOKNOW.UIPANEL_CONFIGMODE_TOOLTIP = "Unlock timer bars and make them configurable";
NEEDTOKNOW.UIPANEL_PLAYMODE = "Play mode";
NEEDTOKNOW.UIPANEL_PLAYMODE_TOOLTIP = "Lock and enable timer bars, making them click-through";
 
NEEDTOKNOW.UIPANEL_APPEARANCE = "Appearance";
NEEDTOKNOW.UIPANEL_BACKGROUNDCOLOR = "Background color";
NEEDTOKNOW.UIPANEL_BARSPACING = "Bar spacing";
NEEDTOKNOW.UIPANEL_BARPADDING = "Bar padding";
NEEDTOKNOW.UIPANEL_BARTEXTURE = "Bar texture";
NEEDTOKNOW.UIPANEL_BARFONT = "Bar font";
NEEDTOKNOW.UIPANEL_FONT = "Font";
 
NEEDTOKNOW.BARMENU_TOTEM = "Totem";
NEEDTOKNOW.BARMENU_CASTCD = "Spell Cooldown";
NEEDTOKNOW.BARMENU_BUFFCD = "Internal Cooldown";
27,9 → 82,9
NEEDTOKNOW.USABLE_DURATION_DIALOG = "Enter the cooldown duration triggered by the abilities watched by this bar.";
 
 
 
-- replace with translations, if available
if ( GetLocale() == "deDE" ) then
-- Thanks, sp00n & Fxfighter EU-Echsenkessel!
-- by sp00n and Fxfighter EU-Echsenkessel
NEEDTOKNOW.BAR_TOOLTIP1 = "NeedToKnow";
NEEDTOKNOW.BAR_TOOLTIP2 = "Rechtsklick auf einen Balken für Einstellungen. Mehr Optionen sind im Blizzard Interface vorhanden. Zum Festsetzen und Aktivieren /needtoknow oder /ntk eingeben.";
NEEDTOKNOW.RESIZE_TOOLTIP = "Klicken und ziehen, um die Größe zu ändern";
66,7 → 121,7
NEEDTOKNOW.CMD_RESET = "reset";
 
elseif ( GetLocale() == "koKR" ) then
-- Thanks, metalchoir!
-- by metalchoir
NEEDTOKNOW.BAR_TOOLTIP1 = "NeedToKnow";
NEEDTOKNOW.BAR_TOOLTIP2 = "우?�릭: 메뉴 불러오기\n세부옵션? �기본 ?�터페?�스 설정?�서 가능\n/ntk 명령어로 잠근 후? �애드온 사용가능";
NEEDTOKNOW.RESIZE_TOOLTIP = "드래그: ?�기 변경";
104,79 → 159,116
NEEDTOKNOW.CMD_RESET = "초기화";
 
elseif ( GetLocale() == "ruRU" ) then
-- Thanks, Vlakarados!
-- by Vlakarados
NEEDTOKNOW.BAR_TOOLTIP1 = "NeedToKnow";
NEEDTOKNOW.BAR_TOOLTIP2 = "Клик правой кнопкой мыши по поло?�е дл? �на?�тройки. Больше на?�троек в Интерфей? / �Модификации / NeedToKnow меню. Вве?�ти /needtoknow или /ntk дл? �блокировки и включени?.";
NEEDTOKNOW.RESIZE_TOOLTIP = "�Кликнуть и тащить дл? �изменени? �размера";
NEEDTOKNOW.BARMENU_ENABLE = "Включить поло?�у";
NEEDTOKNOW.BARMENU_CHOOSENAME = "Выбрать бафф/дебафф дл? �?�лежени?";
NEEDTOKNOW.CHOOSENAME_DIALOG = "�Введите название баффа/дебаффа дл? �?�лежени?"
NEEDTOKNOW.BARMENU_CHOOSEUNIT = "�Юнит ?�лежени?";
NEEDTOKNOW.BARMENU_PLAYER = "�Игрок";
NEEDTOKNOW.BAR_TOOLTIP2 = "Клик правой кнопкой мыши по полосе для настройки. Больше настроек в Интерфейс / Модификации / NeedToKnow меню. Ввести /needtoknow или /ntk для блокировки и включения.";
NEEDTOKNOW.RESIZE_TOOLTIP = "Кликнуть и тащить для изменения размера";
NEEDTOKNOW.BARMENU_ENABLE = "Включить полосу";
NEEDTOKNOW.BARMENU_CHOOSENAME = "Выбрать бафф/дебафф для слежения";
NEEDTOKNOW.CHOOSENAME_DIALOG = "Введите название баффа/дебаффа для слежения"
NEEDTOKNOW.BARMENU_CHOOSEUNIT = "Юнит слежения";
NEEDTOKNOW.BARMENU_PLAYER = "Игрок";
NEEDTOKNOW.BARMENU_TARGET = "Цель";
NEEDTOKNOW.BARMENU_FOCUS = "Фоку?";
NEEDTOKNOW.BARMENU_PET = "�Питомец";
NEEDTOKNOW.BARMENU_VEHICLE = "Сред?�тво передвижени?";
NEEDTOKNOW.BARMENU_TARGETTARGET = "�Цель цели";
NEEDTOKNOW.BARMENU_FOCUS = "Фокус";
NEEDTOKNOW.BARMENU_PET = "Питомец";
NEEDTOKNOW.BARMENU_VEHICLE = "Средство передвижения";
NEEDTOKNOW.BARMENU_TARGETTARGET = "Цель цели";
NEEDTOKNOW.BARMENU_BUFFORDEBUFF = "Бафф или дебафф?";
NEEDTOKNOW.BARMENU_SPELLID = "И?�пользуйте удо?�товерение лично?�ти произношени? �по буквам";
NEEDTOKNOW.BARMENU_SPELLID = "Используйте удостоверение личности произношения по буквам";
NEEDTOKNOW.BARMENU_HELPFUL = "Бафф";
NEEDTOKNOW.BARMENU_HARMFUL = "Дебафф";
NEEDTOKNOW.BARMENU_ONLYMINE = "Показывать только наложенные мной";
NEEDTOKNOW.BARMENU_BARCOLOR = "Цвет поло?�ы";
NEEDTOKNOW.BARMENU_CLEARSETTINGS = "Очи?�тить на?�тройки";
NEEDTOKNOW.UIPANEL_SUBTEXT1 = "Эти на?�тройки позвол?�ют на?�троить бафф/дебафф поло?�ы ?�лежени?.";
NEEDTOKNOW.UIPANEL_SUBTEXT2 = "�Поло?�ы работают только когда заблокированы группы. Можно мен?�ть размер и перемещать группы поло? �и кликнуть правой кнопкой мыши дл? �изменени? �индивидуальных на?�троек. Вве?�ти '/needtoknow' или '/ntk' to блокировки/разблокировки.";
NEEDTOKNOW.BARMENU_BARCOLOR = "Цвет полосы";
NEEDTOKNOW.BARMENU_CLEARSETTINGS = "Очистить настройки";
NEEDTOKNOW.UIPANEL_SUBTEXT1 = "Эти настройки позволяют настроить бафф/дебафф полосы слежения.";
NEEDTOKNOW.UIPANEL_SUBTEXT2 = "Полосы работают только когда заблокированы группы. Можно менять размер и перемещать группы полос и кликнуть правой кнопкой мыши для изменения индивидуальных настроек. Ввести '/needtoknow' или '/ntk' to блокировки/разблокировки.";
NEEDTOKNOW.UIPANEL_BARGROUP = "Группа ";
NEEDTOKNOW.UIPANEL_NUMBERBARS = "Количе?�тво поло?";
NEEDTOKNOW.UIPANEL_FIXEDDURATION = "�Мак?�имальное врем? �на поло?�е";
NEEDTOKNOW.UIPANEL_BARTEXTURE = "Тек?�тура поло?";
NEEDTOKNOW.UIPANEL_BARSPACING = "�Промежуток поло?";
NEEDTOKNOW.UIPANEL_BARPADDING = "�Уплотнение поло?";
NEEDTOKNOW.UIPANEL_BACKGROUNDCOLOR = "�Цвет фона";
NEEDTOKNOW.UIPANEL_NUMBERBARS = "Количество полос";
NEEDTOKNOW.UIPANEL_FIXEDDURATION = "Максимальное время на полосе";
NEEDTOKNOW.UIPANEL_BARTEXTURE = "Текcтура полоc";
NEEDTOKNOW.UIPANEL_BARSPACING = "Промежуток полоc";
NEEDTOKNOW.UIPANEL_BARPADDING = "Уплотнение полоc";
NEEDTOKNOW.UIPANEL_BACKGROUNDCOLOR = "Цвет фона";
NEEDTOKNOW.UIPANEL_LOCK = "Заблокировать";
NEEDTOKNOW.UIPANEL_UNLOCK = "Разблокировать";
NEEDTOKNOW.UIPANEL_TOOLTIP_ENABLEGROUP = "Показать и включить ?�ту группу поло?";
NEEDTOKNOW.UIPANEL_TOOLTIP_FIXEDDURATION = "�Указать мак?�имальное врем? �пробега поло?�ы в ?�екундах. О?�тавить пу?�тым дл? �динамиче?�кого времени дл? �каждой поло?�ы (полное врем? = �длительно?�ть баффа/дебаффа).";
NEEDTOKNOW.UIPANEL_TOOLTIP_BARTEXTURE = "Выбрать тек?�туру дл? �поло?.";
NEEDTOKNOW.CMD_RESET = "�?�бро?";
NEEDTOKNOW.UIPANEL_TOOLTIP_ENABLEGROUP = "Показать и включить эту группу полос";
NEEDTOKNOW.UIPANEL_TOOLTIP_FIXEDDURATION = "Указать максимальное время пробега полосы в секундах. Оставить пустым для динамического времени для каждой полойы (полное время = длительность баффа/дебаффа).";
NEEDTOKNOW.UIPANEL_TOOLTIP_BARTEXTURE = "Выбрать текстуру для полос.";
NEEDTOKNOW.CMD_RESET = "Сброс";
 
else
elseif ( GetLocale() == "zhCN" ) then
-- by wowui.cn
NEEDTOKNOW.BAR_TOOLTIP1 = "NeedToKnow";
NEEDTOKNOW.BAR_TOOLTIP2 = "右键点击计时条配置. 更多的选项在暴雪界面选项菜单里. 输入 /needtoknow 来锁定并启用.";
NEEDTOKNOW.RESIZE_TOOLTIP = "点击和拖动来修改计时条尺寸";
NEEDTOKNOW.BARMENU_ENABLE = "启用计时条";
NEEDTOKNOW.BARMENU_CHOOSENAME = "选择需要计时的Buff/Debuff";
NEEDTOKNOW.CHOOSENAME_DIALOG = "输入在这个计时条内计时的Buff或Debuff的精确名字"
NEEDTOKNOW.BARMENU_CHOOSEUNIT = "需要监视的单位";
NEEDTOKNOW.BARMENU_PLAYER = "玩家";
NEEDTOKNOW.BARMENU_TARGET = "目标";
NEEDTOKNOW.BARMENU_FOCUS = "焦点";
NEEDTOKNOW.BARMENU_PET = "宠物";
NEEDTOKNOW.BARMENU_VEHICLE = "载具";
NEEDTOKNOW.BARMENU_TARGETTARGET = "目标的目标";
NEEDTOKNOW.BARMENU_BUFFORDEBUFF = "Buff还是Debuff?";
NEEDTOKNOW.BARMENU_BUFF = "Buff";
NEEDTOKNOW.BARMENU_DEBUFF = "Debuff";
NEEDTOKNOW.BARMENU_ONLYMINE = "仅显示自身施放的";
NEEDTOKNOW.BARMENU_BARCOLOR = "计时条颜色";
NEEDTOKNOW.BARMENU_CLEARSETTINGS = "清除设置";
NEEDTOKNOW.UIPANEL_SUBTEXT1 = "这些选项允许你自定义Buff/Debuff计时条.";
NEEDTOKNOW.UIPANEL_SUBTEXT2 = "计时条锁定后才能正常工作. 当解锁时, 你可以移动或修改计时条分组的大小, 右键点击单独的计时条可以进行更多的设置. 你也可以输入 '/needtoknow' 或 '/ntk' 来锁定/解锁.";
NEEDTOKNOW.UIPANEL_BARGROUP = "分组 ";
NEEDTOKNOW.UIPANEL_NUMBERBARS = "计时条数量";
NEEDTOKNOW.UIPANEL_FIXEDDURATION = "计时条最大持续时间";
NEEDTOKNOW.UIPANEL_BARTEXTURE = "计时条材质";
NEEDTOKNOW.UIPANEL_BARSPACING = "计时条空距";
NEEDTOKNOW.UIPANEL_BARPADDING = "计时条间距";
NEEDTOKNOW.UIPANEL_BACKGROUNDCOLOR = "背景颜色";
NEEDTOKNOW.UIPANEL_LOCK = "锁定";
NEEDTOKNOW.UIPANEL_UNLOCK = "解锁";
NEEDTOKNOW.UIPANEL_TOOLTIP_ENABLEGROUP = "显示并启用这个分组的计时条";
NEEDTOKNOW.UIPANEL_TOOLTIP_FIXEDDURATION = "设置这个分组计时条的最大长度 (按秒数). 留空为每个计时条设置不同的数值.";
NEEDTOKNOW.UIPANEL_TOOLTIP_BARTEXTURE = "选择计时条的材质图像.";
NEEDTOKNOW.CMD_RESET = "重置";
 
elseif ( GetLocale() == "zhTW" ) then
-- by wowui.cn
NEEDTOKNOW.BAR_TOOLTIP1 = "NeedToKnow";
NEEDTOKNOW.BAR_TOOLTIP2 = "Right click bars to configure. More options in the Blizzard interface options menu. Type /needtoknow to lock and enable.";
NEEDTOKNOW.RESIZE_TOOLTIP = "Click and drag to change size";
NEEDTOKNOW.BARMENU_ENABLE = "Enable bar";
NEEDTOKNOW.BARMENU_CHOOSENAME = "Choose buff/debuff to time";
NEEDTOKNOW.CHOOSENAME_DIALOG = "Enter the name of the buff or debuff to time with this bar"
NEEDTOKNOW.BARMENU_CHOOSEUNIT = "Unit to monitor";
NEEDTOKNOW.BARMENU_PLAYER = "Player";
NEEDTOKNOW.BARMENU_TARGET = "Target";
NEEDTOKNOW.BARMENU_FOCUS = "Focus";
NEEDTOKNOW.BARMENU_PET = "Pet";
NEEDTOKNOW.BARMENU_VEHICLE = "Vehicle";
NEEDTOKNOW.BARMENU_TARGETTARGET = "Target of Target";
NEEDTOKNOW.BARMENU_BUFFORDEBUFF = "Bar Type";
NEEDTOKNOW.BARMENU_SPELLID = "Use SpellID";
NEEDTOKNOW.BARMENU_HELPFUL = "Buff";
NEEDTOKNOW.BARMENU_HARMFUL = "Debuff";
NEEDTOKNOW.BARMENU_ONLYMINE = "Only show if cast by self";
NEEDTOKNOW.BARMENU_BARCOLOR = "Bar color";
NEEDTOKNOW.BARMENU_CLEARSETTINGS = "Clear settings";
NEEDTOKNOW.UIPANEL_SUBTEXT1 = "These options allow you to customize the buff/debuff timer bars.";
NEEDTOKNOW.UIPANEL_SUBTEXT2 = "Bars work when locked. When unlocked, you can move/size bar groups and right click individual bars for more settings. You can also type '/needtoknow' or '/ntk' to lock/unlock.";
NEEDTOKNOW.UIPANEL_BARGROUP = "Group ";
NEEDTOKNOW.UIPANEL_NUMBERBARS = "Number of bars";
NEEDTOKNOW.UIPANEL_FIXEDDURATION = "Max bar duration";
NEEDTOKNOW.UIPANEL_BARTEXTURE = "Bar texture";
NEEDTOKNOW.UIPANEL_BARSPACING = "Bar spacing";
NEEDTOKNOW.UIPANEL_BARPADDING = "Bar padding";
NEEDTOKNOW.UIPANEL_BACKGROUNDCOLOR = "Background color";
NEEDTOKNOW.UIPANEL_LOCK = "Lock";
NEEDTOKNOW.UIPANEL_UNLOCK = "Unlock";
NEEDTOKNOW.UIPANEL_TOOLTIP_ENABLEGROUP = "Show and enable this group of bars";
NEEDTOKNOW.UIPANEL_TOOLTIP_FIXEDDURATION = "Set the maximum length of bars for this group (in seconds). Leave empty to set dynamically per bar.";
NEEDTOKNOW.UIPANEL_TOOLTIP_BARTEXTURE = "Choose the texture graphic for timer bars";
NEEDTOKNOW.CMD_RESET = "reset";
NEEDTOKNOW.BAR_TOOLTIP2 = "右鍵點擊計時條配置. 更多的選項在暴雪介面選項菜單裏. 輸入 /needtoknow 來鎖定並啟用.";
NEEDTOKNOW.RESIZE_TOOLTIP = "點擊和拖動來修改計時條尺寸";
NEEDTOKNOW.BARMENU_ENABLE = "啟用計時條";
NEEDTOKNOW.BARMENU_CHOOSENAME = "選擇需要計時的Buff/Debuff";
NEEDTOKNOW.CHOOSENAME_DIALOG = "輸入在這個計時條內計時的Buff或Debuff的精確名字"
NEEDTOKNOW.BARMENU_CHOOSEUNIT = "需要監視的單位";
NEEDTOKNOW.BARMENU_PLAYER = "玩家";
NEEDTOKNOW.BARMENU_TARGET = "目標";
NEEDTOKNOW.BARMENU_FOCUS = "焦點";
NEEDTOKNOW.BARMENU_PET = "寵物";
NEEDTOKNOW.BARMENU_VEHICLE = "載具";
NEEDTOKNOW.BARMENU_TARGETTARGET = "目標的目標";
NEEDTOKNOW.BARMENU_BUFFORDEBUFF = "Buff還是Debuff?";
NEEDTOKNOW.BARMENU_BUFF = "Buff";
NEEDTOKNOW.BARMENU_DEBUFF = "Debuff";
NEEDTOKNOW.BARMENU_ONLYMINE = "僅顯示自身施放的";
NEEDTOKNOW.BARMENU_BARCOLOR = "計時條顏色";
NEEDTOKNOW.BARMENU_CLEARSETTINGS = "清除設置";
NEEDTOKNOW.UIPANEL_SUBTEXT1 = "這些選項允許妳自定義Buff/Debuff計時條.";
NEEDTOKNOW.UIPANEL_SUBTEXT2 = "計時條鎖定後才能正常工作. 當解鎖時, 妳可以移動或修改計時條分組的大小, 右鍵點擊單獨的計時條可以進行更多的設置. 妳也可以輸入 '/needtoknow' 或 '/ntk' 來鎖定/解鎖.";
NEEDTOKNOW.UIPANEL_BARGROUP = "分組 ";
NEEDTOKNOW.UIPANEL_NUMBERBARS = "計時條數量";
NEEDTOKNOW.UIPANEL_FIXEDDURATION = "計時條最大持續時間";
NEEDTOKNOW.UIPANEL_BARTEXTURE = "計時條材質";
NEEDTOKNOW.UIPANEL_BARSPACING = "計時條空距";
NEEDTOKNOW.UIPANEL_BARPADDING = "計時條間距";
NEEDTOKNOW.UIPANEL_BACKGROUNDCOLOR = "背景顏色";
NEEDTOKNOW.UIPANEL_LOCK = "鎖定";
NEEDTOKNOW.UIPANEL_UNLOCK = "解鎖";
NEEDTOKNOW.UIPANEL_TOOLTIP_ENABLEGROUP = "顯示並啟用這個分組的計時條";
NEEDTOKNOW.UIPANEL_TOOLTIP_FIXEDDURATION = "設置這個分組計時條的最大長度 (按秒數). 留空為每個計時條設置不同的數值.";
NEEDTOKNOW.UIPANEL_TOOLTIP_BARTEXTURE = "選擇計時條的材質圖像.";
NEEDTOKNOW.CMD_RESET = "重置";
 
end
 
Kitjan/NeedToKnow/NeedToKnow_Options.xml
22,7 → 22,7
NeedToKnow.GroupEnableButton_OnClick(self);
</OnClick>
<OnEnter>
GameTooltip:SetOwner(this, "ANCHOR_TOPLEFT");
GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
GameTooltip:SetText(NEEDTOKNOW.UIPANEL_TOOLTIP_ENABLEGROUP, nil, nil, nil, nil, 1);
</OnEnter>
<OnLeave>
148,7 → 148,7
</Layers>
<Scripts>
<OnEnter>
GameTooltip:SetOwner(this, "ANCHOR_TOPLEFT");
GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
GameTooltip:SetText(NEEDTOKNOW.UIPANEL_TOOLTIP_FIXEDDURATION, nil, nil, nil, nil, 1);
</OnEnter>
<OnLeave>
257,23 → 257,6
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentSubText2" inherits="GameFontHighlightSmall" nonspacewrap="false" justifyH="LEFT" justifyV="BOTTOM">
<Size>
<AbsDimension x="0" y="48"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="128" y="16"/>
</Offset>
</Anchor>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="-24" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentNumberbarsLabel" inherits="GameFontNormalSmall">
<Anchors>
<Anchor point="BOTTOM" relativeTo="$parentSubText1" relativePoint="BOTTOMLEFT">
296,9 → 279,9
</Layers>
<Scripts>
<OnLoad>
this.name = "NeedToKnow";
this.default = NeedToKnow.Reset;
this.cancel = NeedToKnow.Cancel;
self.name = "NeedToKnow";
self.default = NeedToKnow.Reset;
self.cancel = NeedToKnow.Cancel;
InterfaceOptions_AddCategory(self);
NeedToKnow.UIPanel_OnLoad(self);
</OnLoad>
306,9 → 289,6
NeedToKnow_OldSettings = CopyTable(NeedToKnow_Settings);
NeedToKnow.UIPanel_OnShow();
</OnShow>
<OnHide>
NeedToKnow.UIPanel_OnHide();
</OnHide>
</Scripts>
<Frames>
<Frame name="$parentGroup1" inherits="NeedToKnow_GroupOptionsTemplate" id="1">
339,18 → 319,154
</Anchor>
</Anchors>
</Frame>
<Slider name="$parentBarSpacingSlider" inherits="OptionsSliderTemplate">
<Button name="$parentConfigModeButton" inherits="UIPanelButtonTemplate">
<Size>
<AbsDimension x="128" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="24" y="24"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName().."Text"]:SetText(NEEDTOKNOW.UIPANEL_CONFIGMODE);
</OnLoad>
<OnClick>
PlaySound("gsTitleOptionOK");
NeedToKnow_Settings["Locked"] = false;
NeedToKnow.Update();
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(NEEDTOKNOW.UIPANEL_CONFIGMODE_TOOLTIP, nil, nil, nil, nil, 1);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
<NormalFont inherits="GameFontNormalSmall"/>
<HighlightFont inherits="GameFontHighlightSmall"/>
</Button>
<Button name="$parentPlayModeButton" inherits="UIPanelButtonTemplate">
<Size>
<AbsDimension x="128" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-24" y="24"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName().."Text"]:SetText(NEEDTOKNOW.UIPANEL_PLAYMODE);
</OnLoad>
<OnClick>
PlaySound("gsTitleOptionOK");
NeedToKnow_Settings["Locked"] = true;
NeedToKnow.Update();
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(NEEDTOKNOW.UIPANEL_PLAYMODE_TOOLTIP, nil, nil, nil, nil, 1);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
<NormalFont inherits="GameFontNormalSmall"/>
<HighlightFont inherits="GameFontHighlightSmall"/>
</Button>
</Frames>
</Frame>
 
<Frame name="InterfaceOptionsNeedToKnowAppearancePanel" hidden="true" parent="InterfaceOptionsFramePanelContainer">
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentTitle" text="NeedToKnow" inherits="GameFontNormalLarge" justifyH="LEFT" justifyV="TOP">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="16" y="-16"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentVersion" inherits="GameFontNormalLarge" justifyH="LEFT" justifyV="TOP">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentTitle" relativePoint="RIGHT">
<Offset>
<AbsDimension x="4" y="-0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentSubText1" inherits="GameFontHighlightSmall" nonspacewrap="true" maxLines="3" justifyH="LEFT" justifyV="TOP">
<Size>
<AbsDimension y="24" x="0"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTitle" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-8"/>
</Offset>
</Anchor>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="-24" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self.name = NEEDTOKNOW.UIPANEL_APPEARANCE;
self.parent = "NeedToKnow";
self.default = NeedToKnow.Reset;
-- self.cancel = NeedToKnow.Cancel;
-- need different way to handle cancel? users might open appearance panel without opening main panel
InterfaceOptions_AddCategory(self);
NeedToKnow.UIPanel_Appearance_OnLoad(self)
</OnLoad>
<OnShow>
NeedToKnow.UIPanel_Appearance_OnShow();
</OnShow>
<OnHide>
</OnHide>
</Scripts>
<Frames>
<Button name="$parentBackgroundColorButton" inherits="NeedToKnow_ColorButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentSubText1" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="16" y="-208"/>
<AbsDimension x="16" y="-16"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
getglobal(self:GetName().."Text"):SetText(NEEDTOKNOW.UIPANEL_BARSPACING);
_G[self:GetName().."Label"]:SetText(NEEDTOKNOW.UIPANEL_BACKGROUNDCOLOR);
self:RegisterForClicks("LeftButtonUp");
</OnLoad>
<OnClick>
NeedToKnow.ChooseColor("BkgdColor");
</OnClick>
</Scripts>
</Button>
<Slider name="$parentBarSpacingSlider" inherits="OptionsSliderTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentBackgroundColorButton" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-32"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName().."Text"]:SetText(NEEDTOKNOW.UIPANEL_BARSPACING);
</OnLoad>
<OnValueChanged>
NeedToKnow_Settings["BarSpacing"] = value;
NeedToKnow.Update();
367,7 → 483,7
</Anchors>
<Scripts>
<OnLoad>
getglobal(self:GetName().."Text"):SetText(NEEDTOKNOW.UIPANEL_BARPADDING);
_G[self:GetName().."Text"]:SetText(NEEDTOKNOW.UIPANEL_BARPADDING);
</OnLoad>
<OnValueChanged>
NeedToKnow_Settings["BarPadding"] = value;
435,40 → 551,60
</Scripts>
</Slider>
 
<Button name="$parentBackgroundColorButton" inherits="NeedToKnow_ColorButtonTemplate">
<Button name="$parentConfigModeButton" inherits="UIPanelButtonTemplate">
<Size>
<AbsDimension x="128" y="22"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentGroup4" relativePoint="BOTTOMLEFT">
<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="80" y="-8"/>
<AbsDimension x="24" y="24"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonUp");
_G[self:GetName().."Text"]:SetText(NEEDTOKNOW.UIPANEL_CONFIGMODE);
</OnLoad>
<OnClick>
NeedToKnow.ChooseColor("BkgdColor");
PlaySound("gsTitleOptionOK");
NeedToKnow_Settings["Locked"] = false;
NeedToKnow.Update();
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(NEEDTOKNOW.UIPANEL_CONFIGMODE_TOOLTIP, nil, nil, nil, nil, 1);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
<NormalFont inherits="GameFontNormalSmall"/>
<HighlightFont inherits="GameFontHighlightSmall"/>
</Button>
<Button name="$parentLockUnlockButton" inherits="UIPanelButtonTemplate">
<Button name="$parentPlayModeButton" inherits="UIPanelButtonTemplate">
<Size>
<AbsDimension x="96" y="22"/>
<AbsDimension x="128" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="16" y="16"/>
<AbsDimension x="-24" y="24"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
_G[self:GetName().."Text"]:SetText(NEEDTOKNOW.UIPANEL_PLAYMODE);
</OnLoad>
<OnClick>
PlaySound("gsTitleOptionOK");
NeedToKnow.LockToggle();
NeedToKnow.LockUnlockButton_Update();
NeedToKnow_Settings["Locked"] = true;
NeedToKnow.Update();
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(NEEDTOKNOW.UIPANEL_PLAYMODE_TOOLTIP, nil, nil, nil, nil, 1);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
<NormalFont inherits="GameFontNormalSmall"/>
<HighlightFont inherits="GameFontHighlightSmall"/>
Kitjan/NeedToKnow/NeedToKnow_Options.lua
1,9 → 1,3
-- --------------------------------------
-- TellMeWhen
-- by Nephthys <Drunken Monkeys> of Hyjal
-- --------------------------------------
 
 
NEEDTOKNOW.MAXBARSPACING = 24;
NEEDTOKNOW.MAXBARPADDING = 12;
 
23,96 → 17,51
end
end
 
function NeedToKnow.LockToggle()
if ( NeedToKnow_Settings["Locked"] ) then
NeedToKnow_Settings["Locked"] = false;
else
NeedToKnow_Settings["Locked"] = true;
end
NeedToKnow.Show(true);
PlaySound("UChatScrollButton");
NeedToKnow.last_cast = {};
NeedToKnow.Update();
end
 
-- -----------------------
-- INTERFACE OPTIONS PANEL
-- -----------------------
 
-- -----------------------------
-- INTERFACE OPTIONS PANEL: MAIN
-- -----------------------------
 
function NeedToKnow.UIPanel_OnLoad(self)
local panelName = self:GetName();
local versionText = getglobal(panelName.."Version");
local subText1 = getglobal(panelName.."SubText1");
local subText2 = getglobal(panelName.."SubText2");
local numberbarsLabel = getglobal(panelName.."NumberbarsLabel");
local fixedDurationLabel = getglobal(panelName.."FixedDurationLabel");
local barTextureLabel = getglobal(panelName.."BarTextureSliderLabel");
local barFontLabel = getglobal(panelName.."BarFontSliderLabel");
local backgroundColorLabel = getglobal(panelName.."BackgroundColorButtonLabel");
 
versionText:SetText(NEEDTOKNOW.VERSION);
subText1:SetText(NEEDTOKNOW.UIPANEL_SUBTEXT1);
subText2:SetText(NEEDTOKNOW.UIPANEL_SUBTEXT2);
local numberbarsLabel = _G[panelName.."NumberbarsLabel"];
local fixedDurationLabel = _G[panelName.."FixedDurationLabel"];
_G[panelName.."Version"]:SetText(NEEDTOKNOW.VERSION);
_G[panelName.."SubText1"]:SetText(NEEDTOKNOW.UIPANEL_SUBTEXT1);
numberbarsLabel:SetText(NEEDTOKNOW.UIPANEL_NUMBERBARS);
numberbarsLabel:SetWidth(50);
fixedDurationLabel:SetText(NEEDTOKNOW.UIPANEL_FIXEDDURATION);
fixedDurationLabel:SetWidth(50);
barTextureLabel:SetText(NEEDTOKNOW.UIPANEL_BARTEXTURE);
barFontLabel:SetText("Bar Font"); -- FIXME: Localize
backgroundColorLabel:SetText(NEEDTOKNOW.UIPANEL_BACKGROUNDCOLOR);
end
 
function NeedToKnow.UIPanel_OnShow()
NeedToKnow_OldSettings = CopyTable(NeedToKnow_Settings);
NeedToKnow.bUIPanelVisible = true;
NeedToKnow.UIPanel_Update()
NeedToKnow.UIPanel_Update();
end
 
function NeedToKnow.UIPanel_OnHide()
NeedToKnow.bUIPanelVisible = nil;
end
 
function NeedToKnow.UIPanel_Update()
if ( not NeedToKnow.bUIPanelVisible ) then return ; end
local settings = NeedToKnow_Settings;
local panelName = "InterfaceOptionsNeedToKnowPanel";
if not _G[panelName]:IsVisible() then return end
 
local settings = NeedToKnow_Settings;
 
for groupID = 1, NEEDTOKNOW.MAXGROUPS do
NeedToKnow.GroupEnableButton_Update(groupID);
NeedToKnow.NumberbarsWidget_Update(groupID);
_G[panelName.."Group"..groupID.."FixedDurationBox"]:SetText(settings["Spec"][NEEDTOKNOW.CURRENTSPEC]["Groups"][groupID]["FixedDuration"] or "");
end
_G[panelName.."BackgroundColorButtonNormalTexture"]:SetVertexColor(unpack(NeedToKnow_Settings["BkgdColor"]));
 
local barSpacingSlider = _G[panelName.."BarSpacingSlider"];
barSpacingSlider:SetMinMaxValues(0, NEEDTOKNOW.MAXBARSPACING);
barSpacingSlider:SetValue(settings.BarSpacing);
 
local barTextureSlider = _G[panelName.."BarTextureSlider"];
barTextureSlider:SetMinMaxValues(1, #(textureList));
barTextureSlider:SetValueStep(1);
getglobal(panelName.."BarTextureSliderLow"):SetText('');
getglobal(panelName.."BarTextureSliderHigh"):SetText('');
local textureLabel = getglobal(panelName.."BarTextureSliderLabel");
textureLabel:SetText(settings["BarTexture"]);
local fn = textureLabel:GetFont();
textureLabel:SetFont(fn, 10); -- There's got to be some way to say this in the xml
getglobal(panelName.."BarTextureSliderText"):SetText('Bar Texture');
for i=1, #(textureList) do
if textureList[i] == settings.BarTexture then
barTextureSlider:SetValue(i);
end
end
 
local barFontSlider = _G[panelName.."BarFontSlider"];
barFontSlider:SetMinMaxValues(1, #(fontList));
barFontSlider:SetValueStep(1);
getglobal(panelName.."BarFontSliderLow"):SetText('');
getglobal(panelName.."BarFontSliderHigh"):SetText('');
getglobal(panelName.."BarFontSliderText"):SetText('Bar Font'); -- Fixme: Localize? What does this do?
for i=1, #(fontList) do
if ( LSM:Fetch("font", fontList[i]) == settings.BarFont ) then
barFontSlider:SetValue(i);
local lbl = getglobal(panelName.."BarFontSliderLabel");
lbl:SetText(fontList[i]);
lbl:SetFont(fn, 10);
end
end
 
local barPaddingSlider = _G[panelName.."BarPaddingSlider"];
barPaddingSlider:SetMinMaxValues(0, NEEDTOKNOW.MAXBARPADDING);
barPaddingSlider:SetValue(settings.BarPadding);
 
NeedToKnow.LockUnlockButton_Update();
end
 
function NeedToKnow.GroupEnableButton_Update(groupID)
132,9 → 81,9
 
function NeedToKnow.NumberbarsWidget_Update(groupID)
local widgetName = "InterfaceOptionsNeedToKnowPanelGroup"..groupID.."NumberbarsWidget";
local text = getglobal(widgetName.."Text");
local leftButton = getglobal(widgetName.."LeftButton");
local rightButton = getglobal(widgetName.."RightButton");
local text = _G[widgetName.."Text"];
local leftButton = _G[widgetName.."LeftButton"];
local rightButton = _G[widgetName.."RightButton"];
local numberBars = NeedToKnow_Settings["Spec"][NEEDTOKNOW.CURRENTSPEC]["Groups"][groupID]["NumberBars"];
text:SetText(numberBars);
leftButton:Enable();
169,6 → 118,62
NeedToKnow.Update();
end
 
function NeedToKnow.Reset()
NeedToKnow_Settings = CopyTable(NEEDTOKNOW.DEFAULTS);
NeedToKnow_Settings["Spec"][1]["Groups"][1]["Enabled"] = true;
NeedToKnow_Settings["Spec"][2]["Groups"][1]["Enabled"] = true;
for groupID = 1, NEEDTOKNOW.MAXGROUPS do
local group = _G["NeedToKnow_Group"..groupID];
group:ClearAllPoints();
group:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", 100, -100 - 100*groupID);
end
NeedToKnow.Update();
NeedToKnow.UIPanel_Update();
NeedToKnow.UIPanel_Appearance_Update();
end
 
function NeedToKnow.Cancel()
NeedToKnow_Settings = CopyTable(NeedToKnow_OldSettings);
NeedToKnow.Update();
end
 
 
-- -----------------------------------
-- INTERFACE OPTIONS PANEL: APPEARANCE
-- -----------------------------------
 
function NeedToKnow.UIPanel_Appearance_OnLoad(self)
local panelName = self:GetName();
_G[panelName.."Version"]:SetText(NEEDTOKNOW.VERSION);
_G[panelName.."SubText1"]:SetText(NEEDTOKNOW.UIPANEL_SUBTEXT1);
end
 
function NeedToKnow.UIPanel_Appearance_OnShow()
NeedToKnow.UIPanel_Appearance_Update();
end
 
function NeedToKnow.UIPanel_Appearance_Update()
local panelName = "InterfaceOptionsNeedToKnowAppearancePanel";
if not _G[panelName]:IsVisible() then return end
 
local settings = NeedToKnow_Settings;
local barSpacingSlider = _G[panelName.."BarSpacingSlider"];
local barPaddingSlider = _G[panelName.."BarPaddingSlider"];
 
-- Mimic the behavior of the context menu, and force the alpha to one in the swatch
local r,g,b = unpack(settings.BkgdColor);
_G[panelName.."BackgroundColorButtonNormalTexture"]:SetVertexColor(r,g,b,1);
 
barSpacingSlider:SetMinMaxValues(0, NEEDTOKNOW.MAXBARSPACING);
barSpacingSlider:SetValue(settings.BarSpacing);
barPaddingSlider:SetMinMaxValues(0, NEEDTOKNOW.MAXBARPADDING);
barPaddingSlider:SetValue(settings.BarPadding);
 
NeedToKnow.UpdateBarTextureDropDown(panelName);
NeedToKnow.UpdateBarFontDropDown(panelName);
end
 
 
function NeedToKnow.UpdateBarTextureSlider(info, value)
getglobal(info:GetName().."Label"):SetText(textureList[value]);
NeedToKnow_Settings["BarTexture"] = textureList[value];
181,8 → 186,10
getglobal(info:GetName().."Label"):SetText(fontName);
NeedToKnow_Settings["BarFont"] = fontPath;
NeedToKnow.Update();
NeedToKnow.UIPanel_Appearance_Update();
end
 
 
function NeedToKnow.ChooseColor(variable)
info = UIDropDownMenu_CreateInfo();
info.r, info.g, info.b, info.opacity = unpack(NeedToKnow_Settings[variable]);
205,14 → 212,14
NeedToKnow_Settings[variable][2] = g;
NeedToKnow_Settings[variable][3] = b;
NeedToKnow.Update();
NeedToKnow.UIPanel_Update();
NeedToKnow.UIPanel_Appearance_Update();
end
 
function NeedToKnow.SetOpacity()
local variable = ColorPickerFrame.extraInfo;
NeedToKnow_Settings[variable][4] = 1 - OpacitySliderFrame:GetValue();
NeedToKnow.Update();
NeedToKnow.UIPanel_Update();
NeedToKnow.UIPanel_Appearance_Update();
end
 
function NeedToKnow.CancelColor(previousValues)
220,50 → 227,46
local variable = ColorPickerFrame.extraInfo;
NeedToKnow_Settings[variable] = {previousValues.r, previousValues.g, previousValues.b, previousValues.opacity};
NeedToKnow.Update();
NeedToKnow.UIPanel_Update();
NeedToKnow.UIPanel_Appearance_Update();
end
end
 
function NeedToKnow.LockUnlockButton_Update()
local text = getglobal("InterfaceOptionsNeedToKnowPanelLockUnlockButtonText");
if ( NeedToKnow_Settings["Locked"] ) then
text:SetText(NEEDTOKNOW.UIPANEL_UNLOCK);
else
text:SetText(NEEDTOKNOW.UIPANEL_LOCK);
function NeedToKnow.UpdateBarTextureDropDown(panelName)
local barTextureSlider = _G[panelName.."BarTextureSlider"];
barTextureSlider:SetMinMaxValues(1, #(textureList));
barTextureSlider:SetValueStep(1);
getglobal(panelName.."BarTextureSliderLow"):SetText('');
getglobal(panelName.."BarTextureSliderHigh"):SetText('');
local textureLabel = getglobal(panelName.."BarTextureSliderLabel");
textureLabel:SetText(NeedToKnow_Settings["BarTexture"]);
local fn = textureLabel:GetFont();
textureLabel:SetFont(fn, 10); -- There's got to be some way to say this in the xml
getglobal(panelName.."BarTextureSliderText"):SetText(NEEDTOKNOW.UIPANEL_BARTEXTURE);
for i=1, #(textureList) do
if textureList[i] == NeedToKnow_Settings.BarTexture then
barTextureSlider:SetValue(i);
end
end
end
 
function NeedToKnow.LockToggle()
if ( NeedToKnow_Settings["Locked"] ) then
NeedToKnow_Settings["Locked"] = false;
else
NeedToKnow_Settings["Locked"] = true;
function NeedToKnow.UpdateBarFontDropDown(panelName)
local barFontSlider = _G[panelName.."BarFontSlider"];
barFontSlider:SetMinMaxValues(1, #(fontList));
barFontSlider:SetValueStep(1);
getglobal(panelName.."BarFontSliderLow"):SetText('');
getglobal(panelName.."BarFontSliderHigh"):SetText('');
getglobal(panelName.."BarFontSliderText"):SetText(NEEDTOKNOW.UIPANEL_BARFONT);
 
for i=1, #(fontList) do
if ( LSM:Fetch("font", fontList[i]) == NeedToKnow_Settings.BarFont ) then
barFontSlider:SetValue(i);
local lbl = getglobal(panelName.."BarFontSliderLabel");
lbl:SetText(fontList[i]);
lbl:SetFont(NeedToKnow_Settings.BarFont, 10);
end
end
NeedToKnow.Show(true);
PlaySound("UChatScrollButton");
NeedToKnow.last_cast = {};
NeedToKnow.Update();
end
 
function NeedToKnow.Reset()
NeedToKnow_Settings = CopyTable(NEEDTOKNOW.DEFAULTS);
NeedToKnow_Settings["Spec"][1]["Groups"][1]["Enabled"] = true;
NeedToKnow_Settings["Spec"][2]["Groups"][1]["Enabled"] = true;
for groupID = 1, NEEDTOKNOW.MAXGROUPS do
local group = getglobal("NeedToKnow_Group"..groupID);
group:ClearAllPoints();
group:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", 100, -100 - 100*groupID);
end
NeedToKnow.Update();
NeedToKnow.UIPanel_Update();
end
 
function NeedToKnow.Cancel()
NeedToKnow_Settings = CopyTable(NeedToKnow_OldSettings);
NeedToKnow.Update();
end
 
 
-- --------
-- BAR GUI
-- --------
276,29 → 279,32
button2 = CANCEL,
hasEditBox = 1,
maxLetters = 255,
OnAccept = function(iconNumber)
local text = getglobal(this:GetParent():GetName().."EditBox"):GetText();
local variable = this:GetParent().variable;
OnAccept = function(self)
local text = self.editBox:GetText();
local variable = self.variable;
if ( nil ~= variable ) then
NeedToKnow.BarMenu_ChooseName(text, variable);
end
end,
EditBoxOnEnterPressed = function(iconNumber)
local text = getglobal(this:GetParent():GetName().."EditBox"):GetText();
local variable = this:GetParent().variable;
EditBoxOnEnterPressed = function(self)
local text = self:GetParent().editBox:GetText();
local variable = self:GetParent().variable;
if ( nil ~= variable ) then
NeedToKnow.BarMenu_ChooseName(text, variable);
end
this:GetParent():Hide();
self:GetParent():Hide();
end,
EditBoxOnEscapePressed = function()
this:GetParent():Hide();
EditBoxOnEscapePressed = function(self)
self:GetParent():Hide();
end,
OnHide = function()
if ( ChatFrameEditBox:IsVisible() ) then
ChatFrameEditBox:SetFocus();
end
getglobal(this:GetName().."EditBox"):SetText("");
OnHide = function(self)
-- Removed for wow 3.3.5, it seems like there is a focu stack
-- now that obsoletes this anyway. If not, there isn't a
-- single ChatFrameEditBox anymore, there's ChatFrame1EditBox etc.
-- if ( ChatFrameEditBox:IsVisible() ) then
-- ChatFrameEditBox:SetFocus();
-- end
self.editBox:SetText("");
end,
timeout = 0,
whileDead = 1,
373,9 → 379,11
Show = {
{ VariableName = "show_icon", MenuText = "Icon" },
{ VariableName = "show_text", MenuText = "Aura Name" },
{ VariableName = "show_count", MenuText = "Stack Count" },
{ VariableName = "show_time", MenuText = "Time Remaining" },
{ VariableName = "show_spark", MenuText = "Spark" },
{ VariableName = "show_mypip", MenuText = "Indicator if mine" },
{ VariableName = "show_text_user", MenuText = "Override Aura Name", Type = "Dialog", DialogText = "CHOOSE_OVERRIDE_TEXT", Checked = function(settings) return "" ~= settings.show_text_user end },
},
BlinkSettings = {
{ VariableName = "blink_enabled", MenuText = NEEDTOKNOW.BARMENU_VCT_ENABLE },
385,16 → 393,9
{ VariableName = "blink_boss", MenuText = "Blink only for bosses" }, -- FIXME: Localization
},
};
 
NeedToKnow.BarMenu_SubMenus.Opt_HARMFUL = NeedToKnow.BarMenu_SubMenus.Opt_HELPFUL;
 
function NeedToKnow.Bar_OnEnter(self)
local tooltip = getglobal("GameTooltip");
GameTooltip_SetDefaultAnchor(tooltip, self);
tooltip:AddLine(NEEDTOKNOW.BAR_TOOLTIP1, HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b, 1);
tooltip:AddLine(NEEDTOKNOW.BAR_TOOLTIP2, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1);
tooltip:Show();
end
 
function NeedToKnow.Bar_OnMouseUp(self, button)
if ( button == "RightButton" ) then
PlaySound("UChatScrollButton");
415,48 → 416,55
 
function NeedToKnow.BarMenu_AddButton(barSettings, i_desc, i_parent)
info = UIDropDownMenu_CreateInfo();
local type = i_desc["Type"];
local item_type = i_desc["Type"];
info.text = i_desc["MenuText"];
info.value = i_desc["VariableName"];
if ( nil == info.value and nil ~= i_desc["Setting"]) then
info.value = i_parent;
type = "SetVar";
item_type = "SetVar";
end;
 
local varSettings = barSettings[info.value];
if ( not varSettings and (type == "Check" or type == "Color") ) then
if ( not varSettings and (item_type == "Check" or item_type == "Color") ) then
print (string.format("NTK: Could not find %s in", info.value), barSettings);
return
end
 
info.hasArrow = false;
info.checked = false;
local b = i_desc["Checked"]
if b then
if type(b) == "function" then
info.checked = b(barSettings)
else
info.checked = b
end
end
--info.notCheckable = true; -- Doesn't prevent checking, just formats the line differently
info.keepShownOnClick = true;
 
if ( not type and not text and not info.value ) then
if ( not item_type and not text and not info.value ) then
info.func = NeedToKnow.BarMenu_IgnoreToggle;
info.disabled = true;
elseif ( nil == type or type == "Check" ) then
elseif ( nil == item_type or item_type == "Check" ) then
info.func = NeedToKnow.BarMenu_ToggleSetting;
info.checked = (nil ~= varSettings and varSettings);
info.notCheckable = false;
elseif ( type == "SetVar" ) then
elseif ( item_type == "SetVar" ) then
info.func = NeedToKnow.BarMenu_ChooseSetting;
info.value = i_desc["Setting"];
info.checked = (varSettings == info.value);
info.notCheckable = false;
info.keepShownOnClick = false;
elseif ( type == "Submenu" ) then
elseif ( item_type == "Submenu" ) then
info.hasArrow = true;
--info.notCheckable = true;
-- The above doesn't really do what we want, so do it ourselves
info.func = NeedToKnow.BarMenu_IgnoreToggle;
elseif ( type == "Dialog" ) then
elseif ( item_type == "Dialog" ) then
info.func = NeedToKnow.BarMenu_ShowNameDialog;
info.keepShownOnClick = false;
info.value = {variable = i_desc.VariableName, text = i_desc.DialogText, numeric = i_desc.Numeric };
elseif ( type == "Color" ) then
elseif ( item_type == "Color" ) then
info.hasColorSwatch = 1;
info.hasOpacity = true;
info.r = varSettings.r;
473,14 → 481,14
 
UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
 
if ( type == "Color" ) then
if ( item_type == "Color" ) then
-- Sadly, extraInfo isn't a field propogated to the button
-- Code to get the button copied from UIDropDownMenu_AddButton
local level = UIDROPDOWNMENU_MENU_LEVEL;
local listFrame = _G["DropDownList"..level];
local index = listFrame and (listFrame.numButtons) or 1;
local listFrameName = listFrame:GetName();
local button = getglobal(listFrameName.."Button"..index);
local button = _G[listFrameName.."Button"..index];
button.extraInfo = info.value;
end
end
557,7 → 565,7
local button = NeedToKnow.BarMenu_GetItem(NeedToKnow.BarMenu_GetItemLevel(self), self.value);
if ( button ) then
local checkName = button:GetName() .. "Check";
getglobal(checkName):Hide();
_G[checkName]:Hide();
button.checked = false;
end
end
599,7 → 607,7
local listFrameName = listFrame:GetName();
local n = listFrame.numButtons;
for index=1,n do
local button = getglobal(listFrameName.."Button"..index);
local button = _G[listFrameName.."Button"..index];
local txt = button.value;
if ( txt == i_valueName ) then
return button;
612,7 → 620,7
local button = NeedToKnow.BarMenu_GetItem(i_level, i_valueName);
if ( button ) then
local checkName = button:GetName() .. "Check";
local check = getglobal(checkName);
local check = _G[checkName];
if ( i_bCheck ) then
check:Show();
button.checked = true;
646,7 → 654,7
NeedToKnow.BarMenu_SubMenus.Options = Opt;
local button = NeedToKnow.BarMenu_GetItem(1, "Options");
if button then
local arrow = getglobal(button:GetName().."ExpandArrow")
local arrow = _G[button:GetName().."ExpandArrow"]
local lbl = ""
if #Opt == 0 then
lbl = lbl .. "No "
665,7 → 673,7
local groupID = NeedToKnow.CurrentBar["groupID"];
local barID = NeedToKnow.CurrentBar["barID"];
local barSettings = NeedToKnow_Settings["Spec"][NEEDTOKNOW.CURRENTSPEC]["Groups"][groupID]["Bars"][barID]
barSettings[UIDROPDOWNMENU_MENU_VALUE] = this.value;
barSettings[UIDROPDOWNMENU_MENU_VALUE] = self.value;
NeedToKnow.Bar_Update(groupID, barID);
 
if ( UIDROPDOWNMENU_MENU_VALUE == "BuffOrDebuff" ) then
695,11 → 703,11
end
 
function NeedToKnow.BarMenu_ShowNameDialog(self, a1, a2, checked)
StaticPopupDialogs["NEEDTOKNOW.CHOOSENAME_DIALOG"].text = NEEDTOKNOW[this.value.text];
StaticPopupDialogs["NEEDTOKNOW.CHOOSENAME_DIALOG"].text = NEEDTOKNOW[self.value.text];
local dialog = StaticPopup_Show("NEEDTOKNOW.CHOOSENAME_DIALOG");
dialog.variable = this.value.variable;
dialog.variable = self.value.variable;
 
local edit = getglobal(dialog:GetName().."EditBox");
local edit = _G[dialog:GetName().."EditBox"];
local groupID = NeedToKnow.CurrentBar["groupID"];
local barID = NeedToKnow.CurrentBar["barID"];
local barSettings = NeedToKnow_Settings["Spec"][NEEDTOKNOW.CURRENTSPEC]["Groups"][groupID]["Bars"][barID];
710,7 → 718,7
-- curval = NeedToKnow.ExportSettingsToString(barSettings);
end
 
local numeric = this.value.numeric or false;
local numeric = self.value.numeric or false;
-- TODO: There has to be a better way to do this, this has pretty bad user feel
if ( nil == NeedToKnow.EditBox_Original_OnTextChanged ) then
NeedToKnow.EditBox_Original_OnTextChanged = edit:GetScript("OnTextChanged");
818,7 → 826,7
-- -------------
 
function NeedToKnow.Resizebutton_OnEnter(self)
local tooltip = getglobal("GameTooltip");
local tooltip = _G["GameTooltip"];
GameTooltip_SetDefaultAnchor(tooltip, self);
tooltip:AddLine(NEEDTOKNOW.RESIZE_TOOLTIP, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1);
tooltip:Show();
833,7 → 841,7
-- group:ClearAllPoints();
-- group:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", group.oldX, group.oldY);
self.oldCursorX, self.oldCursorY = GetCursorPosition(UIParent);
self.oldWidth = getglobal(group:GetName().."Bar1"):GetWidth();
self.oldWidth = _G[group:GetName().."Bar1"]:GetWidth();
self:SetScript("OnUpdate", NeedToKnow.Sizing_OnUpdate);
end
 
846,6 → 854,13
-- calculate & set new scale
local newYScale = group.oldScale * (cursorY/uiScale - group.oldY*group.oldScale) / (self.oldCursorY/uiScale - group.oldY*group.oldScale) ;
local newScale = max(0.6, newYScale);
 
-- clamp the scale so the group is a whole number of pixels tall
local bar1 = _G[group:GetName().."Bar1"]
local barHeight = bar1:GetHeight()
local newHeight = newScale * barHeight
newHeight = math.floor(newHeight + 0.0002)
newScale = newHeight / barHeight
group:SetScale(newScale);
 
-- set new frame coords to keep same on-screen position
861,12 → 876,12
 
function NeedToKnow.SetWidth(groupID, width)
for barID = 1, NeedToKnow_Settings["Spec"][NEEDTOKNOW.CURRENTSPEC]["Groups"][groupID]["NumberBars"] do
local bar = getglobal("NeedToKnow_Group"..groupID.."Bar"..barID);
local background = getglobal(bar:GetName().."Background");
local text = getglobal(bar:GetName().."Text");
local bar = _G["NeedToKnow_Group"..groupID.."Bar"..barID];
local background = _G[bar:GetName().."Background"];
local text = _G[bar:GetName().."Text"];
bar:SetWidth(width);
text:SetWidth(width-60);
background:SetWidth(width + 2*NeedToKnow_Settings["BarPadding"]);
NeedToKnow.SizeBackground(bar, bar.settings.show_icon);
end
NeedToKnow_Settings["Spec"][NEEDTOKNOW.CURRENTSPEC]["Groups"][groupID]["Width"] = width; -- move this to StopSizing?
end