Thread Tools Display Modes
11-30-11, 01:44 PM   #1
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Blizz LOD interface changes

So something has changed in the way the bliz LOD addons work like the calendar and the debugtools. more specific maybe is the fact that they actually function now. two examples... one is with the calender invite notification i had made now does not work right for some odd reason. More noticeable is the button i made for /framestack, it just passed the slash command to chat but that now does not work. Anyone have any ideas or know what exactly was changed? The patch notes are vague... always are.

This is my run slash command function... make a button and put /framestack as the slash command to pass and tell me what you think?

Code:
function addon:RunSlashCmd(cmd)
	local slash, rest = cmd:match("^(%S+)%s*(.-)$")
	for name, func in pairs(SlashCmdList) do
		local i, slashCmd = 1
		repeat
			slashCmd = _G['SLASH_' .. name .. i]
			if slashCmd == slash then
				func(rest)
				return true
			end
			i = i + 1
		until not slashCmd
	end
end
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
11-30-11, 03:12 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Blizz screwed around with the slash command tables so it's a little difficult to scan them. However, there are a few ways you can approach this. What I would recommend is to call SlashCmdList.FRAMESTACK() directly. No need to scan since the function is right there.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
11-30-11, 03:30 PM   #3
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
im going to try that, another option i just found works is to make a function that looks like this and run it...
Code:
function addon:FrameStack()
	LoadAddOn("Blizzard_DebugTools")
	FrameStackTooltip_Toggle(showHidden)
end
Also does not explain the calender issues but that issue may just be my half arsed code for it.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 11-30-11 at 03:41 PM.
  Reply With Quote
11-30-11, 03:58 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,930
Hmm LoadOnDemand changes .. perhaps another sneak peek. It would explain why my many combo plugins for nUI now do something different if 2 or more of them are turned on. In the fact that it ignores my load/unload commands, which, seeing as the toc in the addons themselves are not showing load on demand functionality, is the way it should be working haha
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
11-30-11, 04:22 PM   #5
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
in the bliz addons? LOD set to 1 means its a load on demand addon right?

Oh and on the framestack issue reason i think it has to do with the LOD working now is because if i ran that FrameStackTooltip_Toggle(showHidden) function it would fire an error but cause my /framestack button to work again. Also if i /framestack then fire that function it will not error and my framestack beings to function. Its like not all of the debugtool code is actually loaded until you call the bliz /framestack function on its own which is why i was thinking maybe the LOD is functioning right now... digging into it more with the calender issue since the framestack issue was an easy fix with your direct grab from the slash command list
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 11-30-11 at 04:25 PM.
  Reply With Quote
11-30-11, 04:30 PM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,930
My apologies .. I meant addons in general .. I noticed a non breaking effect to my addons that would be explained by this if they had made it so that LoadOnDemand works as expected now than seemingly always before from what I could see.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
11-30-11, 04:54 PM   #7
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Originally Posted by Xrystal View Post
My apologies .. I meant addons in general .. I noticed a non breaking effect to my addons that would be explained by this if they had made it so that LoadOnDemand works as expected now than seemingly always before from what I could see.
Hmm my own LOD stuff works the same as it always has which seemed proper? Its all the bliz LOD addons that seem to be functioning now like normal addons as apposed to just always being on like they were before. Maybe none of it works and we are all just very confused
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
11-30-11, 05:21 PM   #8
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,930
Yeah, maybe its just another of those loading order changes they sneak in that involves changing our code again rofl
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
11-30-11, 05:33 PM   #9
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Originally Posted by SDPhantom View Post
Blizz screwed around with the slash command tables so it's a little difficult to scan them.
[...]
Could you expand on that? did they do something involving metatables?
I'm just very very confused on how SlashCmdList works right now in 4.3 :|
  Reply With Quote
11-30-11, 06:37 PM   #10
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
I noticed that the one other place in GrimUI where i used that code to pass a / command through is working intermittently.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
12-01-11, 02:36 AM   #11
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Ketho View Post
Could you expand on that? did they do something involving metatables?
I'm just very very confused on how SlashCmdList works right now in 4.3 :|
I'll post the relevant parts so you can look at it.

The first quoted code sets up a second table as a metatable to move entries into after their hashes have been stored. This is to keep track of which entries have been processed and which are still waiting. When a new entry is added, the second quoted block of code starts the hashing process again when a slash command is run.



Main chunk of ChatFrame.lua:2419
lua Code:
  1. function ChatFrame_SetupListProxyTable(list)
  2.     if ( getmetatable(list) ) then
  3.         return;
  4.     end
  5.    
  6.     setmetatable(list, { __index = {} });
  7. end
  8.  
  9. function ChatFrame_ImportListToHash(list, hash)
  10.     for k, v in pairs(list) do
  11.         local i = 1;
  12.         local tag = _G["SLASH_"..k..i];
  13.         while(tag) do
  14.             tag = strupper(tag);
  15.             if ( hash ) then
  16.                 hash[tag] = v;
  17.             end
  18.             hash_ChatTypeInfoList[tag] = k; --Also need to import it here for all types.
  19.             i = i + 1;
  20.             tag = _G["SLASH_"..k..i];
  21.         end
  22.         --Add the item we removed to the proxy table.
  23.         local proxyTable = getmetatable(list).__index;
  24.         proxyTable[k] = v;
  25.     end
  26.    
  27.     table.wipe(list);
  28. end
  29.  
  30. function ChatFrame_ImportEmoteTokensToHash()
  31.     local i = 1;
  32.     local j = 1;
  33.     local cmdString = _G["EMOTE"..i.."_CMD"..j];
  34.     while ( i <= MAXEMOTEINDEX ) do
  35.         local token = _G["EMOTE"..i.."_TOKEN"];
  36.         -- if the code in here changes - change the corresponding code above
  37.         if ( token ) then
  38.             hash_EmoteTokenList[strupper(cmdString)] = token;   -- add to hash
  39.         end
  40.         j = j + 1;
  41.         cmdString = _G["EMOTE"..i.."_CMD"..j];
  42.         if ( not cmdString ) then
  43.             i = i + 1;
  44.             j = 1;
  45.             cmdString = _G["EMOTE"..i.."_CMD"..j];
  46.         end
  47.     end
  48. end
  49.  
  50. function ChatFrame_ImportAllListsToHash()
  51.     ChatFrame_ImportListToHash(SecureCmdList, hash_SecureCmdList);
  52.     ChatFrame_ImportListToHash(SlashCmdList, hash_SlashCmdList);
  53.     ChatFrame_ImportListToHash(ChatTypeInfo);
  54. end
  55.  
  56. ChatFrame_SetupListProxyTable(SecureCmdList);
  57. ChatFrame_SetupListProxyTable(SlashCmdList);
  58. ChatFrame_SetupListProxyTable(ChatTypeInfo);
  59. ChatFrame_ImportAllListsToHash();
  60. ChatFrame_ImportEmoteTokensToHash();

ChatEdit_ParseText() in ChatFrame.lua:4272
lua Code:
  1. if ( send == 1 and hash_SecureCmdList[command] ) then
  2.         hash_SecureCmdList[command](strtrim(msg));
  3.         editBox:AddHistoryLine(text);
  4.         ChatEdit_OnEscapePressed(editBox);
  5.         return;
  6.     end
  7.  
  8.     ChatFrame_ImportAllListsToHash();
  9.    
  10.     -- Handle chat types. No need for a securecall here, since we should be done with anything secure.
  11.     if ( ChatEdit_HandleChatType(editBox, msg, command, send) ) then
  12.         return;
  13.     end
  14.  
  15.     if ( send == 0 ) then
  16.         return;
  17.     end
  18.  
  19.     -- Check the hash tables for slash commands and emotes to see if we've run this before.
  20.     if ( hash_SlashCmdList[command] ) then
  21.         -- if the code in here changes - change the corresponding code below
  22.         hash_SlashCmdList[command](strtrim(msg), editBox);
  23.         editBox:AddHistoryLine(text);
  24.         ChatEdit_OnEscapePressed(editBox);
  25.         return;
  26.     elseif ( hash_EmoteTokenList[command] ) then
  27.         -- if the code in here changes - change the corresponding code below
  28.         DoEmote(hash_EmoteTokenList[command], msg);
  29.         editBox:AddHistoryLine(text);
  30.         ChatEdit_OnEscapePressed(editBox);
  31.         return;
  32.     end
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 12-01-11 at 02:42 AM.
  Reply With Quote
12-10-11, 08:17 AM   #12
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Originally Posted by SDPhantom View Post
Blizz screwed around with the slash command tables so it's a little difficult to scan them. However, there are a few ways you can approach this. What I would recommend is to call SlashCmdList.FRAMESTACK() directly. No need to scan since the function is right there.
is there a function like that for /roll?
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
12-10-11, 09:34 AM   #13
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Originally Posted by Grimsin View Post
is there a function like that for /roll?
afaik this should be it: [1] [2]
  Reply With Quote
12-10-11, 12:12 PM   #14
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Grimsin View Post
Originally Posted by SDPhantom View Post
Blizz screwed around with the slash command tables so it's a little difficult to scan them. However, there are a few ways you can approach this. What I would recommend is to call SlashCmdList.FRAMESTACK() directly. No need to scan since the function is right there.
is there a function like that for /roll?
Here's an explanation on how that call was made. All non-secure slash command functions are stored in the table SlashCmdList with a token as the key. For example, /framestack has "FRAMESTACK" as its token and can be called by SlashCmdList["FRAMESTACK"](). Note any string index that follows the same naming restrictions as a Lua variable can be indexed with dot notation, this would allow someone to make the same call with SlashCmdList.FRAMESTACK().

To find the token for a slash command, you need to open up GlobalStrings.lua and look through the SLASH_* entries. All of the slash definitions are stored in these variables in which the naming convention is SLASH_<Token><Index>. <Index> is just a sequential number that allows there to be multiple slash definitions for each token.



Originally Posted by Ketho View Post
afaik this should be it: [1] [2]
Ketho's links show the definition of such function in ChatFrame.lua. Notice the token for /roll is "RANDOMROLL" so the resulting call would be SlashCmdList["RANDOMROLL"]() or SlashCmdList.RANDOMROLL().

This specific command appears to be a wrapper for RandomRoll(min,max) so it would be best to call that directly anyway. Both arguments appear to be required, so a standard 1-100 roll would be RandomRoll(1,100).
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 12-10-11 at 12:23 PM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Blizz LOD interface changes


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off