WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   nUI: Developer Chat (https://www.wowinterface.com/forums/forumdisplay.php?f=96)
-   -   need help getting code to work (https://www.wowinterface.com/forums/showthread.php?t=27393)

rossman 09-19-09 12:33 AM

need help getting code to work
 
First off I would like to say I do not know anything about lua programming. I would like to understand any explanations you give so please try and help me learn.
I created a hud addon called nUI_Hud_RM that works as just a replacement to the default player\target nUI hud and it works good. I am trying to get my hud layout to be in the hud rotation not just a replacement.
I based this code on the info panel code layout thinking they would work the same way. I tried different variations but cant get it to work. I am hoping that between all of the good programmers on this board we should get this working and I can learn along the way.
Thank You all in advance

This is the nUI_Hud_RM.lua

if not nUI_HUDLayouts then nUI_HUDLayouts = {}; end
if not nUI_UnitSkins then nUI_UnitSkins = {}; end

nUI_HUDMODE_RM_HUDLAYOUT_PLAYERTARGET = 6;
RM_HUDLAYOUT_PLAYERTARGET = "RM_HUDLayout_PlayerTarget";
nUI_L[RM_HUDLAYOUT_PLAYERTARGET.."Desc"] = "RM HUD: Player Left / Target Right";
nUI_L[RM_HUDLAYOUT_PLAYERTARGET.."Label"] = "RM HUD";

local frame = CreateFrame( "Frame", "nUI_Hud_RM", UIParent );

local function onEvent()

for skin in pairs( nUI_UnitSkins ) do
nUI_UnitSkins[skin] = nUI_UnitSkins[skin];
end

end

frame:SetScript( "OnEvent", onEvent );
frame:RegisterEvent( "VARIABLES_LOADED" );

Xrystal 09-19-09 07:12 AM

Well I just tried adding a new hud layout but errors big time so I guess there is something else I am missing.

I copied the PlayerTarget HUD folder and renamed the PlayerTarget section with XrystalPT and the PLAYERTARGET with XRYSTALPT.

I then edited the XML file in the Layout Folder and copied the PlayerTarget section and converted it to XrystalPT.

I then added XrystalPT and XRYSTALPT elements to the localization file.

No luck, errors abounded. I am now commenting out until Scott can confirm if the current setup in nUI allows us to do this or not.

rossman 09-19-09 12:39 PM

When I started testing this morning I was able to get the RM Hud in the rotation but it does not show the hud layout when selected only a broken(only the bars show no text) nUI playertarget and the when you get to the original nUI playerparget selection that layout is also broken (only the bars no text). So I am getting closer.

I would guess I am not adding my layout to the table of Hudlayouts but mixing it with the nUI playertarget.

How much of the HudLayouts\playertarget\RM_HUDLAYOUT_PLAYERTARGET.lua and the associated unit files need to be modified to make it a new hud. I am using the code that works for the replacemnt of the nUI playertarget hud.


All times are GMT -6. The time now is 07:17 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI