This hack really is horrible: sure text and icons are lined up, but then it's the whole thing that "climb". Unusable with LDB... Unless we push the hack further: adding a "fontstringOffsetY" attribute or something that display addons would use to relocate the fontstring on the frame/button. :p
Usually I use "info.checked = variable == 'value'" to simulate radio buttons with checkmarks within a dropdown menu.
Now, the problem is I want to set "info.keepShownOnClick = true" and find a way to refresh the checkmarks at the current menu level when an item is clicked.
Below is an ugly attempt to do this but it seems to conflict with the Blizzard's handling of checkmarks and only works half of the time.
[php]
local function SetOption(frame, var, val, checked)
config[var] = val or checked -- works with "radio" & "check"
-- ugly attempt to refresh checkmarks
local sub = strsub(frame:GetName(), 1, 19)
for i = 1, 5 do
local menuFrame = _G[ sub .. tostring(i) ]
local checkmark = _G[ sub .. tostring(i) .. "Check" ]
checkmark:SetTexture(menuFrame == frame and "Interface\\Buttons\\UI-CheckBox-Check" or "")
end
-- --> something to clear the menu lines
-- dropdown_init(nil, UIDROPDOWNMENU_MENU_LEVEL)
end
local options = {
{ text = format( "|cffffb366Ara|r Reputations (%s)", GetAddOnMetadata( "Ara_Broker_Reputations", "Version") ), isTitle = true },
{ text = "Block display", submenu = {
{ text = "ASCII Bar", var = "blockDisplay", type = "radio", val = "ascii", submenu = {
{ text = "Single Color", var = "asciiBar", type = "radio", val = "singleColor" },
{ text = "Dual Colors", var = "asciiBar", type = "radio", val = "dualColors" }, } },
{ text = "Text", var = "blockDisplay", type = "radio", val = "text", submenu = {
{ text = levels[6].." - 7500/12000 ", var = "textInfo", type = "radio", val = "standingValues" },
{ text = levels[6].." - 62%", var = "textInfo", type = "radio", val = "standingPerc" }, } } } },
{ text = "Tooltip bars", submenu = {
{ text = "Standard", var = "tipDisplay", type = "radio", val = "standard" },
{ text = "Double Wide", var = "tipDisplay", type = "radio", val = "doubleWide" } } },
{ text = "Hide Hints", var = "hideHints", type = "check" }
}
dropdown_init = function(self, level)
level = level or 1
for i, v in ipairs( level > 1 and UIDROPDOWNMENU_MENU_VALUE or options ) do
local info = UIDropDownMenu_CreateInfo()
info.text = v.text
info.isTitle = v.isTitle
if v.type == "radio" then
info.checked = config[v.var] == v.val
info.func, info.arg1, info.arg2 = SetOption, v.var, v.val
info.keepShownOnClick = true -- TRY
elseif v.type == "check" then
info.checked = config[v.var]
info.func, info.arg1 = SetOption, v.var
info.keepShownOnClick = true
end
info.hasArrow = v.submenu ~= nil
info.value = v.submenu
UIDropDownMenu_AddButton( info, level )
end
end
[/php]
Is there a way to clear the lines of the current menu level and call the dropdown init function to redraw the menu, or something clever ?
Im looking for addons that have nice implementation of the fauxscrollframe, preferably small addons in order not to spend too much time looking into it :p
Can someone provide some names ?
Just tested it, and you don't need to call :Show() when hooking "OnTooltipSetUnit" or "OnTooltipSetItem", as it will get called after using your hook.
But it is required for stuff like hooking the recipe shown when mouse is over the recipe icon in the tradeskill panel:
[php]
local button = _G.TradeSkillSkillIcon
local TS_OnEnter = button:GetScript"OnEnter"
local TS_OnLeave = button:GetScript"OnLeave"
local orgSetTradeSkillItem = GameTooltip.SetTradeSkillItem
local function newSetTradeSkillItem(...)
orgSetTradeSkillItem(...)
GameTooltip:AddLine("\n"..L"|cffff8040Click|r to create a shortcut.", .2, 1, .2)
GameTooltip:Show()
end
cargoShip seems to follow the same design as oUF (haste): ultra light but requires you to write code for the layout if you don't like the provided one or want to enhance it.
What I meant is: you can't delay a spell cast programatically. The only way to cast a spell is through a secure button, and the secure action button template doesn't provide any way to delay it.
Just write a function that checks which static popup is shown and if it's the enchantment replacement popup, click the OK button and then do /script ClickFunction() in your macro.
I use the REPLACE_ENCHANT event so I know it's the replace popup. But I don't get the part where you ask for clicking the OK button. If you meant "programatically" click the OK button, I can't find how to achieve this without error. Is there really a way to refresh a weapon buff in just one click ?
0
0
I'm looking for someone (preferably an addon author) on the 3.3.5 PTR (EU) to test the real ID system. My character is Moobringer on the Brill server.
I wasn't able to convince people from my entourage to install the PTR client ._. and I need to implement that feature on a friend list addon.
If interested, leave me a private message here.
Thank you.
EDIT: oops ! I wanted to post in general forums.
0
0
0
I want that checking a menu entry:
- keep the menu entry shown (keepShownOnClick = true)
- uncheck the other menu entries of this level
0
Can you throw some code, or an addon where you're doing that ? :p
EDIT: I found that
works for most of the radio button menus. Unfortunatly it doesn't work if a radio button has a sub-menu as shown below:
0
Now, the problem is I want to set "info.keepShownOnClick = true" and find a way to refresh the checkmarks at the current menu level when an item is clicked.
Below is an ugly attempt to do this but it seems to conflict with the Blizzard's handling of checkmarks and only works half of the time.
[php]
local function SetOption(frame, var, val, checked)
config[var] = val or checked -- works with "radio" & "check"
-- ugly attempt to refresh checkmarks
local sub = strsub(frame:GetName(), 1, 19)
for i = 1, 5 do
local menuFrame = _G[ sub .. tostring(i) ]
local checkmark = _G[ sub .. tostring(i) .. "Check" ]
checkmark:SetTexture(menuFrame == frame and "Interface\\Buttons\\UI-CheckBox-Check" or "")
end
-- --> something to clear the menu lines
-- dropdown_init(nil, UIDROPDOWNMENU_MENU_LEVEL)
end
local options = {
{ text = format( "|cffffb366Ara|r Reputations (%s)", GetAddOnMetadata( "Ara_Broker_Reputations", "Version") ), isTitle = true },
{ text = "Block display", submenu = {
{ text = "ASCII Bar", var = "blockDisplay", type = "radio", val = "ascii", submenu = {
{ text = "Single Color", var = "asciiBar", type = "radio", val = "singleColor" },
{ text = "Dual Colors", var = "asciiBar", type = "radio", val = "dualColors" }, } },
{ text = "Text", var = "blockDisplay", type = "radio", val = "text", submenu = {
{ text = levels[6].." - 7500/12000 ", var = "textInfo", type = "radio", val = "standingValues" },
{ text = levels[6].." - 62%", var = "textInfo", type = "radio", val = "standingPerc" }, } } } },
{ text = "Tooltip bars", submenu = {
{ text = "Standard", var = "tipDisplay", type = "radio", val = "standard" },
{ text = "Double Wide", var = "tipDisplay", type = "radio", val = "doubleWide" } } },
{ text = "Hide Hints", var = "hideHints", type = "check" }
}
dropdown_init = function(self, level)
level = level or 1
for i, v in ipairs( level > 1 and UIDROPDOWNMENU_MENU_VALUE or options ) do
local info = UIDropDownMenu_CreateInfo()
info.text = v.text
info.isTitle = v.isTitle
if v.type == "radio" then
info.checked = config[v.var] == v.val
info.func, info.arg1, info.arg2 = SetOption, v.var, v.val
info.keepShownOnClick = true -- TRY
elseif v.type == "check" then
info.checked = config[v.var]
info.func, info.arg1 = SetOption, v.var
info.keepShownOnClick = true
end
info.hasArrow = v.submenu ~= nil
info.value = v.submenu
UIDropDownMenu_AddButton( info, level )
end
end
[/php]
Is there a way to clear the lines of the current menu level and call the dropdown init function to redraw the menu, or something clever ?
Sorry for my bad explanations. :(
0
Ara_Broker_Guild_Friends can now scroll large guilds with little to no additions besides the creation of the slider.
Thank you :)
0
Can someone provide some names ?
Thank you in advance. :p
0
But it is required for stuff like hooking the recipe shown when mouse is over the recipe icon in the tradeskill panel:
[php]
local button = _G.TradeSkillSkillIcon
local TS_OnEnter = button:GetScript"OnEnter"
local TS_OnLeave = button:GetScript"OnLeave"
local orgSetTradeSkillItem = GameTooltip.SetTradeSkillItem
local function newSetTradeSkillItem(...)
orgSetTradeSkillItem(...)
GameTooltip:AddLine("\n"..L"|cffff8040Click|r to create a shortcut.", .2, 1, .2)
GameTooltip:Show()
end
button:SetScript("OnEnter", function(...)
GameTooltip.SetTradeSkillItem = newSetTradeSkillItem
TS_OnEnter(...)
end)
button:SetScript("OnLeave", function(...)
TS_OnLeave(...)
GameTooltip.SetTradeSkillItem = orgSetTradeSkillItem
end)
[/php]
0
0
What I meant is: you can't delay a spell cast programatically. The only way to cast a spell is through a secure button, and the secure action button template doesn't provide any way to delay it.
0
But how do you achieve that ? If the /in command doesnt accept /use and /cast it probably means it's not possible programatically either.
0
I give up, stupid Blizzard. The first click is legit, so why can't we bypass the confirm dialog ? It makes no sense. :mad: :mad: :mad:
0
I use the REPLACE_ENCHANT event so I know it's the replace popup. But I don't get the part where you ask for clicking the OK button. If you meant "programatically" click the OK button, I can't find how to achieve this without error. Is there really a way to refresh a weapon buff in just one click ?