Thread Tools Display Modes
06-08-10, 01:49 PM   #21
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Yea totally sweet! And i am using meta tables... here is my metatable setup. Im still having issues with the party frames im down to making the code that makes it switch party styles... it does not like my dropdownmnu selection one bit....

here is my metatable setup in my core though which btw you can dump the metatable with the /dump to.

lua Code:
  1. local eventFrame = CreateFrame("Frame", nil, UIParent)
  2. eventFrame:RegisterEvent("PLAYER_LOGIN")
  3. eventFrame:SetScript("OnEvent", function()
  4.    
  5.     GrimUI.Data = setmetatable(GrimUIData, defaults)
  6.  
  7.     for name, module in pairs(modules) do
  8.         if module.OnFirstLoad and not GrimUIData.modsConfigured[name] then
  9.             module:OnFirstLoad(GrimUIData)
  10.             GrimUIData.modsConfigured[name] = true
  11.         end
  12.         if module.OnInitialize then
  13.             module:OnInitialize()
  14.         end
  15.     end
  16. end)

this following code is my dropdown menu. this is the second one i have made i think the problem is with the use of locals being the same in both of the dropdown menus code... ill post both the one for artskins works just fine. soon as i add the one for the party frame style it freaks out...

artskins -
lua Code:
  1. GrimUISkinMenu = CreateFrame("Frame", "GrimUISkinMenu", GrimOptionsPanel, "UIDropDownMenuTemplate");
  2.     GrimUISkinMenu:ClearAllPoints()
  3.     GrimUISkinMenu:SetPoint("LEFT",GrimOptionsPanel, 0, 95);
  4.     GrimUISkinMenu:Show()
  5.    
  6.     name = GrimUISkinMenu:CreateFontString()
  7.     name:SetPoint('LEFT', GrimUISkinMenu, 'RIGHT', -5, 0)
  8.     name:SetFontObject(GameFontNormal)
  9.     name:SetText('Art Skin')
  10.     -- info.text = "First Menu Item"; --the text of the menu item
  11.     -- info.value = 0; -- the value of the menu item. This can be a string also.
  12.     -- info.func = function() MyDropDownMenuItem_OnClick() end; --sets the function to execute when this item is clicked
  13.     -- info.owner = this:GetParent(); --binds the drop down menu as the parent of the menu item. This is very important for dynamic drop down menues.
  14.     -- info.checked = nil; --initially set the menu item to being unchecked with a yellow tick
  15.     -- info.icon = nil; --we can use this to set an icon for the drop down menu item to accompany the text
  16.     -- UIDropDownMenu_AddButton(info, level); --Adds the new button to the drop down menu specified in the UIDropDownMenu_Initialise function. In this case, it's MyDropDownMenu
  17.      
  18.      
  19.     -- info.text = "Second Menu Item";
  20.     -- info.value = 1;
  21.     -- info.func = function() MyDropDownMenuItem_OnClick() end;
  22.     -- info.owner = this:GetParent();
  23.     -- info.checked = nil;
  24.     -- info.icon = nil;
  25.     -- UIDropDownMenu_AddButton(info, level);
  26.      
  27.     local items = {
  28.        "Horde Skin 1",
  29.        "Alliance Skin 1",
  30.        "Black Metal Skin by Noob123 ",
  31.        "Alliance Skin 2",
  32.     }
  33.      
  34.     local function OnClick(self)
  35.        UIDropDownMenu_SetSelectedID(GrimUISkinMenu, self:GetID())
  36.        GrimUIData.ArtSkinNumb = self.value
  37.        GrimUI:GetModule("ArtSkins"):UpdateSkin()
  38.     end
  39.      
  40.     local function initialize(self, level)
  41.        for k,v in pairs(items) do
  42.           info = UIDropDownMenu_CreateInfo()
  43.           info.text = v
  44.           info.value = k
  45.           info.func = OnClick
  46.           UIDropDownMenu_AddButton(info, level)
  47.        end
  48.     end
  49.      
  50.      
  51.      
  52.     UIDropDownMenu_Initialize(GrimUISkinMenu, initialize)
  53.     UIDropDownMenu_SetWidth(GrimUISkinMenu, 100);
  54.     UIDropDownMenu_SetButtonWidth(GrimUISkinMenu, 124)
  55.     UIDropDownMenu_SetSelectedID(GrimUISkinMenu, 1)
  56.     UIDropDownMenu_JustifyText(GrimUISkinMenu, "LEFT")



and then this is the one for the style selection but it does not work it of course comes after the one i posted above but in the same file. Neither of which are in any file related to what they do which is why there are global function calls from my other files... two different methods and maybe the method im using is the problem. maybe someone has an idea?

lua Code:
  1. ------------------------------------
  2.     -- GrimUI PartyFrame Layout style menue
  3.     ----------------
  4.  
  5.  
  6.     GrimUIPartyStyleMenu = CreateFrame("Frame", "GrimUIPartyStyleMenu", GrimOptionsPanel, "UIDropDownMenuTemplate");
  7.     GrimUIPartyStyleMenu:ClearAllPoints()
  8.     GrimUIPartyStyleMenu:SetPoint("LEFT",GrimOptionsPanel, 0, 70);
  9.     GrimUIPartyStyleMenu:Show()
  10.    
  11.     name = GrimUIPartyStyleMenu:CreateFontString()
  12.     name:SetPoint('LEFT', GrimUIPartyStyleMenu, 'RIGHT', -5, 0)
  13.     name:SetFontObject(GameFontNormal)
  14.     name:SetText('Party Frame Style')
  15.      
  16.     local items = {
  17.        "Vertical Style",
  18.        "Horizontal Style",
  19.     }
  20.      
  21.     local function OnClick(self)
  22.        UIDropDownMenu_SetSelectedID(GrimUIPartyStyleMenu, self:GetID())
  23.        GrimUIData.GUIPartyStyle = self.value
  24.        
  25.         GrimUI.UpdatePartyStyle()
  26.         GrimUI.Party1LayoutInitiate()
  27.         GrimUI.Party2LayoutInitiate()
  28.         GrimUI.Party3LayoutInitiate()
  29.         GrimUI.Party4LayoutInitiate()
  30.     end
  31.      
  32.     local function initialize(self, level)
  33.        for k,v in pairs(items) do
  34.           info = UIDropDownMenu_CreateInfo()
  35.           info.text = v
  36.           info.value = k
  37.           info.func = OnClick
  38.           UIDropDownMenu_AddButton(info, level)
  39.        end
  40.  
  41.     end
  42.      
  43.      
  44.      
  45.     UIDropDownMenu_Initialize(GrimUIPartyStyleMenu, initialize)
  46.     UIDropDownMenu_SetWidth(GrimUIPartyStyleMenu, 100);
  47.     UIDropDownMenu_SetButtonWidth(GrimUIPartyStyleMenu, 124)
  48.     UIDropDownMenu_SetSelectedID(GrimUIPartyStyleMenu, 1)
  49.     UIDropDownMenu_JustifyText(GrimUIPartyStyleMenu, "LEFT")
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
06-08-10, 02:15 PM   #22
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
hmm or it has to do with the fact i need to clearallpoints on the frames attached to the frame being resized so it can resize those on the new frames sizes... i think? haha damn this is starting to get overly complicated...

-- still no luck on the style selection and just figured out my frame moving stuff causes taint in combat heh.... not that im really that surprised...
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 06-08-10 at 07:15 PM.
  Reply With Quote
06-08-10, 09:46 PM   #23
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Is it just not possible at all to move the PaperDollFrame, SpellBookFrame and GameOptionsFrame in combat? no method of secure code?
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
06-08-10, 09:48 PM   #24
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Why do you have to be able to move them in combat?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
06-09-10, 12:56 AM   #25
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
sometimes i have the paperdoll frame open in combat... not often but occasionally. or i realize i dont have a spell on my bar and want to open the spell book and grab it in combat if need be or use it in combat but be able to move the frames...

edit - and thinking about it... none of this is for "me" lol. my interface works just fine for me... its when i add options for other people to have a choice on things is where i run into problems lol.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 06-09-10 at 10:08 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » ummm


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