If you wish to help support this site please disable your adblock program.


Click here to become a Premium Member : No ads site-wide : Forum privileges : Upgraded services : Giveaway & moreSupport the Site! Support Us!
Tukui » Tukui » Guides » Adding new Datatext points
  1. Hero Hydra
    online
    Overlord

    XP: 
     

    1337 / 1337

    It's been asked a few times how to create a new datatext location (typically under the minimap), so I will do a run through on how to create one.

    First of all i've created a new panel above the minimap like so --
    (If you're not familiar with how to create a basic panel read me)

    Now open up Tukui/core/functions.lua
    from line 29-84 there's a function that looks like this --

    T.DataTextPosition = function(p, obj)
    	local left = TukuiInfoLeft
    	local right = TukuiInfoRight
    	local mapleft = TukuiMinimapStatsLeft
    	local mapright = TukuiMinimapStatsRight
    
    	if p == 1 then
    		obj:SetParent(left)
    		obj:SetHeight(left:GetHeight())
    		obj:SetPoint("LEFT", left, 30, 0)
    		obj:SetPoint('TOP', left)
    		obj:SetPoint('BOTTOM', left)
    	elseif p == 2 then
    		obj:SetParent(left)
    		obj:SetHeight(left:GetHeight())
    		obj:SetPoint('TOP', left)
    		obj:SetPoint('BOTTOM', left)
    	elseif p == 3 then
    		obj:SetParent(left)
    		obj:SetHeight(left:GetHeight())
    		obj:SetPoint("RIGHT", left, -30, 0)
    		obj:SetPoint('TOP', left)
    		obj:SetPoint('BOTTOM', left)
    	elseif p == 4 then
    		obj:SetParent(right)
    		obj:SetHeight(right:GetHeight())
    		obj:SetPoint("LEFT", right, 30, 0)
    		obj:SetPoint('TOP', right)
    		obj:SetPoint('BOTTOM', right)
    	elseif p == 5 then
    		obj:SetParent(right)
    		obj:SetHeight(right:GetHeight())
    		obj:SetPoint('TOP', right)
    		obj:SetPoint('BOTTOM', right)
    	elseif p == 6 then
    		obj:SetParent(right)
    		obj:SetHeight(right:GetHeight())
    		obj:SetPoint("RIGHT", right, -30, 0)
    		obj:SetPoint('TOP', right)
    		obj:SetPoint('BOTTOM', right)
    	end
    
    	if TukuiMinimap then
    		if p == 7 then
    			obj:SetParent(mapleft)
    			obj:SetHeight(mapleft:GetHeight())
    			obj:SetPoint('TOP', mapleft)
    			obj:SetPoint('BOTTOM', mapleft)
    		elseif p == 8 then
    			obj:SetParent(mapright)
    			obj:SetHeight(mapright:GetHeight())
    			obj:SetPoint('TOP', mapright)
    			obj:SetPoint('BOTTOM', mapright)
    		end
    	end
    end

    so to create a new datatext area we need to add a bit of code like this within this function, like this

    elseif p == 9 then
    			obj:SetParent(panel)
    			obj:SetHeight(panel:GetHeight())
    			obj:SetPoint('TOP', panel)
    			obj:SetPoint('BOTTOM', panel)

    make sure you change the word "panel" to the name of the panel you've created for your datatext,
    so now the bottom of your function should look like this --

    	if TukuiMinimap then
    		if p == 7 then
    			obj:SetParent(mapleft)
    			obj:SetHeight(mapleft:GetHeight())
    			obj:SetPoint('TOP', mapleft)
    			obj:SetPoint('BOTTOM', mapleft)
    		elseif p == 8 then
    			obj:SetParent(mapright)
    			obj:SetHeight(mapright:GetHeight())
    			obj:SetPoint('TOP', mapright)
    			obj:SetPoint('BOTTOM', mapright)
    		elseif p == 9 then
    			obj:SetParent(panel)
    			obj:SetHeight(panel:GetHeight())
    			obj:SetPoint('TOP', panel)
    			obj:SetPoint('BOTTOM', panel)
    		end
    	end

    now the number "9" is the number you want to use in Tukui/config/config.lua to make a text appear there, i'll use FPS/MS as an example,

    C["datatext"] = {
    	["fps_ms"] = 9, -- show fps and ms on panels

    make sure you save the changes to the files and do a /rl ingame, the result:

    Enjoy, feel free to ask questions!

    I don't suffer from insanity, I enjoy it.
    Posted 4 years ago - #1
     


  2. If you wish to help support this site please disable your adblock program.


    Gladiator BuG
    offline
    Premium

    XP: 
     

    1337 / 1337

    Perfect!

    would you mind posting the code of you panel :-)

    13:40:26 ‹Elv› I kissed a boy, and I liiiked it
    10:39:13 ‹tSgt› then give me your ass i give you mine
    13:53:27 ‹Sgt› Because i like deep things
    Posted 4 years ago - #2
     
  3. Challenger Illumai
    offline
    Member

    XP: 
     

    26 / 1337

    Love the new threads :) i know these will come in handy :) another one you could do is how to change the bars to 2x12 as opposed to the default 2x24. I know i looked for that one for a while when i first came here.

    Posted 4 years ago - #3
     
  4. Hero Hydra
    online
    Overlord

    XP: 
     

    1337 / 1337

    zbug said:
    Perfect!

    would you mind posting the code of you panel dear :-)

    I actually deleted it right after I wrote this >.<
    Although it was like this

    -- PANEL
    local panel = CreateFrame("Frame", "Panel", Minimap)
    TukuiDB:CreatePanel(panel, 148, TukuiDB:Scale(19), "BOTTOM", Minimap, "TOP", 0, TukuiDB:Scale(5))
    I don't suffer from insanity, I enjoy it.
    Posted 4 years ago - #4
     
  5. Gladiator BuG
    offline
    Premium

    XP: 
     

    1337 / 1337

    Thanks !

    13:40:26 ‹Elv› I kissed a boy, and I liiiked it
    10:39:13 ‹tSgt› then give me your ass i give you mine
    13:53:27 ‹Sgt› Because i like deep things
    Posted 4 years ago - #5
     
  6. Hero Hydra
    online
    Overlord

    XP: 
     

    1337 / 1337

    If you're playing with default Tukui though your panel would have to be like this --

    -- PANEL
    local panel = CreateFrame("Frame", "Panel", TukuiMinimapStatsLeft)
    TukuiDB:CreatePanel(panel, 148, TukuiDB:Scale(19), "TOPLEFT", TukuiMinimapStatsLeft, "BOTTOMLEFT", 0, TukuiDB:Scale(-3))
    I don't suffer from insanity, I enjoy it.
    Posted 4 years ago - #6
     
  7. Gladiator BuG
    offline
    Premium

    XP: 
     

    1337 / 1337

    AH! you're a genious, i was going to post that it was giving me issues cause i was trying to move it down under the minimap..and moving the 2 other panels is a nightmare...now this just works perfectly..! thanks so much mate !

    13:40:26 ‹Elv› I kissed a boy, and I liiiked it
    10:39:13 ‹tSgt› then give me your ass i give you mine
    13:53:27 ‹Sgt› Because i like deep things
    Posted 4 years ago - #7
     
  8. Gladiator BuG
    offline
    Premium

    XP: 
     

    1337 / 1337

    well for now at least i have a panel, will have to dig deep to understand how to put what i want in it ! damn its not easy :-P

    13:40:26 ‹Elv› I kissed a boy, and I liiiked it
    10:39:13 ‹tSgt› then give me your ass i give you mine
    13:53:27 ‹Sgt› Because i like deep things
    Posted 4 years ago - #8
     
  9. Hero Hydra
    online
    Overlord

    XP: 
     

    1337 / 1337

    Is this guide hard to understand, or..?

    I don't suffer from insanity, I enjoy it.
    Posted 4 years ago - #9
     
  10. Gladiator BuG
    offline
    Premium

    XP: 
     

    1337 / 1337

    nope, your guide is very easy to get ;-)

    Creating the datatext object i want is harder. more and more understanding what im doing, but still a long way to go ;-)

    13:40:26 ‹Elv› I kissed a boy, and I liiiked it
    10:39:13 ‹tSgt› then give me your ass i give you mine
    13:53:27 ‹Sgt› Because i like deep things
    Posted 4 years ago - #10
     
  11. Hero Hydra
    online
    Overlord

    XP: 
     

    1337 / 1337

    oh okay!

    I don't suffer from insanity, I enjoy it.
    Posted 4 years ago - #11
     
  12. Challenger snuffles
    offline
    Member

    XP: 
     

    25 / 1337

    since odine's edit is a bit different. i dont think it will work this way... atleast i tried it and it didnt work. changed the tukui info stuff to match the oui.db etc info like the other panels are set up in his edit.. or perhaps im just not fully understanding.. still need to learn a bit more about all of the lua im better when it comes to other things lol.

    Posted 4 years ago - #12
     
  13. Hero Hydra
    online
    Overlord

    XP: 
     

    1337 / 1337

    Well, this is only for default Tukui, i'm not going to support Odines edit.

    I don't suffer from insanity, I enjoy it.
    Posted 4 years ago - #13
     
  14. Hero Jasje
    offline
    VIP

    XP: 
     

    1337 / 1337

    Your a busy little fellow, good job on making some easy thing's available for others to use.

    Every man is the architect of his own fortune.
    Posted 4 years ago - #14
     
  15. Hero Hydra
    online
    Overlord

    XP: 
     

    1337 / 1337

    Yeah i'm trying to think of some other topics though :P

    I don't suffer from insanity, I enjoy it.
    Posted 4 years ago - #15
     
  16. Rival Ruden
    offline
    Member

    XP: 
     

    248 / 1337

    Damn nice thread! Love it!

    Posted 4 years ago - #16
     
  17. Challenger Duality
    offline
    Member

    XP: 
     

    69 / 1337

    err nvm

    Posted 4 years ago - #17
     
  18. Challenger DAGAN
    offline
    Member

    XP: 
     

    58 / 1337

    is there a way to make it so if I left click a panel it shows HPS and right click shows DPS or just clicking will change it to either?

    using Elv Edit

    Posted 4 years ago - #18
     
  19. Challenger Apocolypto
    offline
    Member

    XP: 
     

    13 / 1337

    WTB update for v11 :)

    Posted 4 years ago - #19
     
  20. Challenger Apocolypto
    offline
    Member

    XP: 
     

    13 / 1337

    Sweet, looking forward to it.

    Posted 4 years ago - #20
     
  21. Hero Hydra
    online
    Overlord

    XP: 
     

    1337 / 1337

    Updated for v12, i'll polish it off later since i'm not convinced it's very clear

    I don't suffer from insanity, I enjoy it.
    Posted 3 years ago - #21
     
  22. Challenger bearscantank
    offline
    Member

    XP: 
     

    163 / 1337

    okay i just did what the guide said and i still dont have the data bar

    Go ahead and knock yourself out
    Posted 3 years ago - #22
     
  23. Hero Hydra
    online
    Overlord

    XP: 
     

    1337 / 1337

    Sorry for the extremely late response, this guide won't make a panel for you, if you read the top part you have to make a panel before following this guide.

    I don't suffer from insanity, I enjoy it.
    Posted 3 years ago - #23
     
  24. Challenger Kimbasinger
    offline
    Donor

    XP: 
     

    29 / 1337

    I had some succes following the guides, I just have a small problem.

    When I anchor my new panel to the minimap the clock is behind the frame, and it wont hide with the rest of the minimap and frame when I use the toggle-minimap option.

    This is what I got so far:

    -- Clockminimap Panel
    local clockminimap = CreateFrame("Frame", "clockminimap", Minimap)
    TukuiDB.CreatePanel(clockminimap, 144, 20, "RIGHT", Minimap, "LEFT", 142, -85)
    
    HydraDB.SetBorder(clockminimap)
    elseif p == 7 then
    obj:SetHeight(clockminimap:GetHeight())
    obj:SetPoint("TOP", clockminimap)
    obj:SetPoint('BOTTOM', clockminimap)
    end

    Edit: If I use UIParent instead of Minimap it's all good, except now the new panel doesn't hide with the minimap-toggle.

    Posted 3 years ago - #24
     
  25. Challenger pewp
    offline
    Member

    XP: 
     

    128 / 1337

    Hoping to bump for great justice!

    I am in the same boat as Jaylin. I'm working on creating a datatext to read the profession skill level info and put it in a new panel under the minimap.

    I am using the latest Hydra's edit, and based on the guide, this is where I got. But I am having a frame layering issue i believe.

    local profPanel = CreateFrame("Frame", "profs", Minimap)
    TukuiDB.CreatePanel(profs, 144, 23, "TOP", Minimap, "BOTTOM", 0, -5)
    HydraDB.SetBorder(profs)
    profs:SetFrameLevel(2)
    TukuiDB.CreateShadow(profs)

    seems a little silly to be calling the HydraDB, which sets frame level to 1, and then setting it to 2 right after, but I'm not the best coder :P

    setting the variable in functions:

    local profPan = profs

    then inside the if loop of datatext position declarations:

    elseif p == 7 then
    		obj:SetHeight(profPan:GetHeight())
    		obj:SetPoint("LEFT", profPan, 6, 0)
    		obj:SetPoint('TOP', profPan)
    		obj:SetPoint('BOTTOM', profPan)
    	elseif p == 8 then
    		obj:SetHeight(profPan:GetHeight())
    		obj:SetPoint("RIGHT", profPan, -6, 0)
    		obj:SetPoint('TOP', profPan)
    		obj:SetPoint('BOTTOM', profPan)	
    Posted 3 years ago - #25
     
  26. Hero Hydra
    online
    Overlord

    XP: 
     

    1337 / 1337

    Updated for t13

    I don't suffer from insanity, I enjoy it.
    Posted 3 years ago - #26
     
  27. Challenger sarfael
    offline
    Donor

    XP: 
     

    55 / 1337

    I am trying to add a new panel to Duffed's edit. I have the panel created and it set up to look just like the other info panels. I am getting lost in the guide as I am not trying to anchor it to one of the predefined spaces such as minimap.

    Any help is greatly appreciated. The screenshot shows the location where I have the new panel located. I added this is my Panels.Lua to make it:

    -- Panel 9 (center)
    local infocenter = CreateFrame("Frame", "infocenter ", UIParent)
    TukuiDB.CreatePanel(infocenter , T.InfoLeftRightWidth, 19, "TOP", UIParent, "TOP", 7, -8)
    Posted 3 years ago - #27
     
  28. Challenger smithinspace
    offline
    Member

    XP: 
     

    23 / 1337

    sarfael said:
    I am trying to add a new panel to Duffed's edit. I have the panel created and it set up to look just like the other info panels. I am getting lost in the guide as I am not trying to anchor it to one of the predefined spaces such as minimap.

    Any help is greatly appreciated. The screenshot shows the location where I have the new panel located. I added this is my Panels.Lua to make it:

    -- Panel 9 (center)
    local infocenter = CreateFrame("Frame", "infocenter ", UIParent)
    TukuiDB.CreatePanel(infocenter , T.InfoLeftRightWidth, 19, "TOP", UIParent, "TOP", 7, -8)

    use this code

    -- PANEL
    local infocenter = CreateFrame("Frame", "infocenter", UIParent)
    infocenter:CreatePanel("Default", T.Scale(200), T.Scale(19), "TOP", UIParent, "TOP", 0, -T.Scale(3))
    Posted 3 years ago - #28
     
  29. Challenger Amaric
    offline
    Member

    XP: 
     

    31 / 1337

    So this is a great thread but I would like Data Text in one of the lower frames - left or right. The left one already has Guild / Armor / Friends positions 1, 2, and 3. On the right side (where the bags are) there are positions 4, 5, and 6 for Latency / Memory / Gold .... so how do I get the Time in there too or - where else can the time be shown?

    Posted 3 years ago - #29
     
  30. Challenger Nargot
    offline
    Member

    XP: 
     

    31 / 1337

    Is there a way to add datatext variables?
    For instance, I would like to see my current Mana Regen in combat.

    I'm convinced this shouldn't be a big issue, it would be greatly appreciated if someone would help me out on this! :)

    Posted 3 years ago - #30
     
RSS feed for this topic

Reply »

You must log in to post.