04-07-12, 06:50 PM | #1 |
nibProfileLoader
Im currently trying to set up a UI that has two totally different layouts for a tank and a healer. What I have used so far is Reflux and nibprofileloader. What I want to see if I can do is rework nibprofileloader to instead of asking this.....
New Character detected. Would you like to load profile xxxx? --- Yes --- --- No ---- I want it two have different answers like this.. Thanks for using xxxx UI. Please select a UI layout from options below. ---Tank --- --- Healer --- Basically what nib does is if you press YES it will load a predetermined profile and if you press no it cancels out and closes the window. What I need it to do is where the Yes button is will load a tank profile and where No button is load Heal profile. Hope someone understands this and can help!!
__________________
“Do not go where the path may lead, go instead where there is no path -- and leave a trail.” |
|
04-07-12, 08:52 PM | #2 |
I've never heard of nibProfileLoader, but you could probably write something like that very easily for Reflux. You would need to read a list of Reflux profiles, and add a button for each one.
If you want more specific help, you will need to post your code and describe what you want to change, and what you have already tried. |
|
04-07-12, 10:10 PM | #3 |
Here is the code from the addon I am using. I want an option to load two different profiles instead of just one. Right now the choices are load one profile or exit with the No button. Just a Yes or No button is currently there and I want like I descirbed in original post..
Lua Code:
__________________
“Do not go where the path may lead, go instead where there is no path -- and leave a trail.” |
|
04-08-12, 05:58 AM | #4 |
This should work for you, not tested as I dont use reflux or nibProfileLoader.
Lua Code:
|
|
04-08-12, 03:44 PM | #5 |
Oh sweet I will try this ASAP. The problem I have is I dont know how to code and did not know how the buttons worked. Couldnt figure that part out. Ill see how this goes and will let you know.
__________________
“Do not go where the path may lead, go instead where there is no path -- and leave a trail.” |
|
04-08-12, 03:57 PM | #6 |
Ok I tried this modification and it does not do anything. After selecting Tank or Heal the window cancels and nothing happens. No profile switch or reloadui. Trying to see what I can find out. Im not getting any errors or anything. Just not doing what its intended to do.
__________________
“Do not go where the path may lead, go instead where there is no path -- and leave a trail.” |
|
04-08-12, 04:29 PM | #7 |
There were some quotes missing around Tank and Heal, but rest should be good.
Lua Code:
|
|
04-08-12, 04:32 PM | #8 |
Ah that was it and now its working. I still do not know how the addon knows what button is hit but anyhow its working. I really wanna learn this stuff but I had no idea where to begin.
Thanks again all. Now its working with 2 profiles.
__________________
“Do not go where the path may lead, go instead where there is no path -- and leave a trail.” |
|
04-08-12, 04:35 PM | #9 |
Also I changed this line....
local NewProfile = UseClassProfiles and ClassProfiles[class] or ProfileName to this... local NewProfile = UseClassProfiles and ClassProfiles[class] or TankName and also for healer one... local NewProfile = UseClassProfiles and ClassProfiles[class] or HealName Not sure if that was needed but its still working with no errors.
__________________
“Do not go where the path may lead, go instead where there is no path -- and leave a trail.” |
|
04-08-12, 04:36 PM | #10 | |
All done through WoW's PopupDialog API.
Lua Code:
|
||
04-08-12, 05:21 PM | #11 |
Thank you very much for adding those comments. Now I got a better understanding how it works. Heck yeah! I learned something today
__________________
“Do not go where the path may lead, go instead where there is no path -- and leave a trail.” |
|
04-14-12, 03:37 AM | #12 |
Code:
local frame = CreateFrame("FRAME"); frame:RegisterEvent("VARIABLES_LOADED"); -- BEGIN USER OPTIONS -- -- InterfaceName = Name to describe your UI -- ProfileName = Addon profile name to use with /reflux switch local InterfaceName = "Deeui4" local TankName = "DeeUi-DPS" local HealName = "DeeUi-Heal" local UseClassProfiles = false -- Use specific profile names for different classes local ClassProfiles = { -- Change profile names to suit ["DEATHKNIGHT"] = "MyProfile", ["DRUID"] = "MyProfile", ["HUNTER"] = "MyProfile", ["MAGE"] = "MyProfile", ["PALADIN"] = "MyProfile", ["PRIEST"] = "MyProfile", ["ROGUE"] = "MyProfile", ["SHAMAN"] = "MyProfile", ["WARLOCK"] = "MyProfile", ["WARRIOR"] = "MyProfile", } -- END USER OPTIONS -- local LocalizedMessages = { ["enUS"] = { [1] = "Thanks for using DeeUi4. Choose your destiny.", [2] = "Tank/DPS", [3] = "Heal", }, ["deDE"] = { [1] = "Neuen Character gefunden! Willst du die %s einstellungen laden?", [2] = "Ja", [3] = "Nein", }, } local CID, CE, HasAdded = "", false, false local function AddChar() if (CID ~= "") and not HasAdded then tinsert(nibPLNames, CID) HasAdded = true end end local function CharAnswered(ans) AddChar() if ans == "Tank" then local _, class = UnitClass("player") local NewProfile = UseClassProfiles and ClassProfiles[class] or TankName local RefluxArg = string.format("%s %s", "switch", DeeUi-DPS) SlashCmdList.REFLUX(RefluxArg) -- This will cause a UI reload elseif ans == "Heal" then local _, class = UnitClass("player") local NewProfile = UseClassProfiles and ClassProfiles[class] or HealName local RefluxArg = string.format("%s %s", "switch", DeeUi-Heal) SlashCmdList.REFLUX(RefluxArg) -- This will cause a UI reload end end local function AskNewChar() local Locale = GetLocale() or "enUS" local MsgTexts = LocalizedMessages[Locale] or LocalizedMessages["enUS"] -- Define a new Pop Up message StaticPopupDialogs["PUDASKNEWCHAR"] = { -- Message to display text = Thank you for using DeeUi4[1], -- Text to show on first button button1 = Tank/DPS[2], -- Text to show on second button button2 = Heal[3], -- Function to call when first button is pressed OnAccept = function() -- Call CharAnswered with "Tank" argument CharAnswered("Tank/DPS") end, -- Function to call when second button is pressed OnCancel = function() -- Call CharAnswered with "Heal" argument CharAnswered("Heal") end, -- Pop Up message stays open until user action timeout = 0, -- Pop Up message is shown even if the player is dead whileDead = true, -- Hitting Esc won't close the Pop Up message hideOnEscape = false, -- Logging out won't send the signal to hit the second button (OnCancel), thereby making the Pop Up message show next time they log in if they didn't click any buttons notClosableByLogout = true, } -- Show the Pop Up message StaticPopup_Show ("PUDASKNEWCHAR", InterfaceName); end local function CheckNewChar() CID = string.format("%s - %s", GetRealmName(), UnitName("player")) CE = false if (nibPLNames == nil) then nibPLNames = { }; end for i,v in pairs(nibPLNames) do if (v == CID) then CE = true; end end if not CE then AskNewChar(); end end local function eventHandler(self, event, ...) if (event == "VARIABLES_LOADED") then CheckNewChar() end end frame:SetScript("OnEvent", eventHandler); Code:
Interface\AddOns\nibProfileLoader\nibProfileLoader.lua:70: '}' expected (to close '{' at line 68) near 'you' Time: 04/14/12 12:34:02 Count: 1 Stack: Locals <-Lua Nub/Greenhorn |
|
04-14-12, 05:07 AM | #13 |
Line 70 is
Lua Code:
Strings should be put in '' or "" ... and no clue what your [#] is meant to be
__________________
The cataclysm broke the world ... and the pandas could not fix it! |
|
04-14-12, 06:28 AM | #14 |
changed what you said so now it is like this
Code:
local frame = CreateFrame("FRAME"); frame:RegisterEvent("VARIABLES_LOADED"); -- BEGIN USER OPTIONS -- -- InterfaceName = Name to describe your UI -- ProfileName = Addon profile name to use with /reflux switch local InterfaceName = "Deeui4" local TankName = "DeeUi-DPS" local HealName = "DeeUi-Heal" local UseClassProfiles = false -- Use specific profile names for different classes local ClassProfiles = { -- Change profile names to suit ["DEATHKNIGHT"] = "MyProfile", ["DRUID"] = "MyProfile", ["HUNTER"] = "MyProfile", ["MAGE"] = "MyProfile", ["PALADIN"] = "MyProfile", ["PRIEST"] = "MyProfile", ["ROGUE"] = "MyProfile", ["SHAMAN"] = "MyProfile", ["WARLOCK"] = "MyProfile", ["WARRIOR"] = "MyProfile", } -- END USER OPTIONS -- local LocalizedMessages = { ["enUS"] = { [1] = "Thanks for using DeeUi4. Choose your destiny.", [2] = "Tank/DPS", [3] = "Heal", }, ["deDE"] = { [1] = "Neuen Character gefunden! Willst du die %s einstellungen laden?", [2] = "Ja", [3] = "Nein", }, } local CID, CE, HasAdded = "", false, false local function AddChar() if (CID ~= "") and not HasAdded then tinsert(nibPLNames, CID) HasAdded = true end end local function CharAnswered(ans) AddChar() if ans == "Tank" then local _, class = UnitClass("player") local NewProfile = UseClassProfiles and ClassProfiles[class] or TankName local RefluxArg = string.format("%s %s", "switch", DeeUi-DPS) SlashCmdList.REFLUX(RefluxArg) -- This will cause a UI reload elseif ans == "Heal" then local _, class = UnitClass("player") local NewProfile = UseClassProfiles and ClassProfiles[class] or HealName local RefluxArg = string.format("%s %s", "switch", DeeUi-Heal) SlashCmdList.REFLUX(RefluxArg) -- This will cause a UI reload end end local function AskNewChar() local Locale = GetLocale() or "enUS" local MsgTexts = LocalizedMessages[Locale] or LocalizedMessages["enUS"] -- Define a new Pop Up message StaticPopupDialogs["PUDASKNEWCHAR"] = { -- Message to display text = "Thank you for using DeeUi4"[1]; -- Text to show on first button button1 = "Tank/DPS"[2]; -- Text to show on second button button2 = "Heal"[3]; -- Function to call when first button is pressed OnAccept = function() -- Call CharAnswered with "Tank" argument CharAnswered("Tank/DPS"); end -- Function to call when second button is pressed OnCancel = function() -- Call CharAnswered with "Heal" argument CharAnswered("Heal"); end -- Pop Up message stays open until user action timeout = 0; -- Pop Up message is shown even if the player is dead whileDead = true, -- Hitting Esc won't close the Pop Up message hideOnEscape = false; -- Logging out won't send the signal to hit the second button (OnCancel), thereby making the Pop Up message show next time they log in if they didn't click any buttons notClosableByLogout = true }; -- Show the Pop Up message StaticPopup_Show ("PUDASKNEWCHAR", InterfaceName); end local function CheckNewChar() CID = string.format("%s - %s", GetRealmName(), UnitName("player")) CE = false if (nibPLNames == nil) then nibPLNames = { }; end for i,v in pairs(nibPLNames) do if (v == CID) then CE = true; end end if not CE then AskNewChar(); end end local function eventHandler(self, event, ...) if (event == "VARIABLES_LOADED") then CheckNewChar() end end frame:SetScript("OnEvent", eventHandler); Code:
Message: Interface\AddOns\nibProfileLoader\nibProfileLoader.lua:70: '}' expected (to close '{' at line 68) near '[' Time: 04/14/12 15:24:37 Count: 1 Stack: Locals: |
|
04-14-12, 10:31 AM | #15 |
skip [1][2][3] ... those brackets make no sense at all
__________________
The cataclysm broke the world ... and the pandas could not fix it! |
|
04-14-12, 12:54 PM | #16 |
Lua Code:
|
|
04-14-12, 04:43 PM | #17 |
cant get it pasted the code from nib into NibProfileLoader.lua and i still get this error :
Code:
Interface\AddOns\nibProfileLoader\nibProfileLoader.lua:85: '}' expected (to close '{' at line 68) near 'OnCancel' Time: 04/15/12 01:41:12 Count: 1 Stack: Locals: |
|
04-14-12, 06:45 PM | #18 |
The one I have works just fine. I do see something different with yours and let me try and explain this since I am a noob at all this coding
Line 54: Lua Code:
This is different than mine. Mine reads like this. Lua Code:
Now I think the reason your might not be working is this local thing that is making NewProfile like on line 53: Lua Code:
So change DeeUi-DPS to NewProfile and see if that works
__________________
“Do not go where the path may lead, go instead where there is no path -- and leave a trail.” |
|
04-14-12, 07:04 PM | #19 |
Yeah, I missed that one. If using straight text as a variable, please enclose it in quotes.
|
|
04-15-12, 02:10 PM | #20 |
Any chance we can update your addon nib or can I upload this modified one? I think there were some players asking about this before on these boards. On how to swap between multiple profiles.
__________________
“Do not go where the path may lead, go instead where there is no path -- and leave a trail.” |
|
WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » nibProfileLoader |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|