• 0

    posted a message on API function GetQuestLogRewardFactionInfo(index) broken?
    Indeed, I updated the default UI files and I see it now. That is unexpected and annoying.

    Thanks for the quick relpy.
    Posted in: AddOn HELP!
  • 0

    posted a message on API function GetQuestLogRewardFactionInfo(index) broken?
    If I run the following script:

    for index = 1, GetNumQuestLogEntries() do
      local title, _, _, isHeader  = GetQuestLogTitle(index)
    
      if title and not isHeader then
        SelectQuestLogEntry(index)
    
        print(GetQuestLogSelection(), ": XP - ", GetQuestLogRewardXP())
    
        for i = 1, GetNumQuestLogRewardFactions() do		
          print(GetQuestLogRewardFactionInfo(i))
        end
      end
    end

    I get all the correct XP information. But all quests list the same reputation info.

    As it turns out all quests return the reputation reward info of the quest last selected with the mouse in the interface. I open the quest log, select a quest, and close the quest log again. I run the script and all quest show the reward info of the quest I just clicked in the interface.

    It is as if the SelectQuestLogEntry(index) call is ignored. But GetQuestLogSelection() and GetQuestLogRewardXP() provide the data of the correct index selected by SelectQuestLogEntry(index) before.

    Are the GetNumQuestLogRewardFactions() and GetQuestLogRewardFactionInfo(index) functions broken? Or is there something I'm doing wrong here? I'm working on a feature of one of my addons and this is a very annoying blocker.

    Thanks for any advice on the issue!

    Best regards
    burny_dd
    Posted in: AddOn HELP!
  • 0

    posted a message on Find out Logging-skill level
    Hello,

    Does anyone know a proper way of how to get the information which level the logging skill has respectively which timber nodes a player can harvest?

    For an addon I'm working on I need to have that information. But since 'Logging' is not a profession but a skill provided by the Lumber Mill this turned out to be a bit tricky. So far I found no way to get that info directly via the Blizzard API so I tried to find a workaround.

    First I tried via the spells connected to the quests after each level of the Lumber Mill: Apprentice Logging (167911), Journeyman Logging (167946) and Expert Logging (167947). But IsSpellKnown() returns false for all of those.

    Then I found on wowhead.com that beside the skill 'Logging' (id 1945) there are 3 spells called 'Logging' (id 167895, 167896, 167897) with value 1, 2 and 3 mentioned in the effect description. So I was hoping to make use of that but it turned out no matter what level the Lumber Mill has IsSpellKnown() only returns true for 167895 and false for the other two.

    So I check directly which level the Lumber Mill has. Which basically works fine. But it turned out using C_Garrison.GetPlots and C_Garrison.GetOwnedBuildingInfo when outside the garrison return no data.

    I help myself getting the information while in the garrison and storing it as variable in the options and work with that if the player is not in the garrison on login. But I find that a very cumbersome way of doing it. So I wonder if there is direct way of getting that information.

    Best regards
    burny_dd
    Posted in: AddOn HELP!
  • 0

    posted a message on LibQTip
    Hm, no reply so far? I still got that problem and I consider it to be a bug. Some feedback would be appreciated.
    Posted in: Libraries
  • 0

    posted a message on LibQTip
    Alright, I played around a bit with other addons using LibQTip. I found that the problem disappears in release r135 and before. Release r136 replaced the width handling for colspans: function LayoutColspans(tooltip) with function FixCellSizes(tooltip).

    After a bit of poking I found that cell:getContentHeight() returned the same value after the resizing of the columns. This is because the actual cell width used in function getContentHeight() never got touched. As far as I can see it the cell size is nowhere set at all but the calculations depend on column width values alone.

    So I think you either need to adjust the cell width values to their actual values so the fontstring width is set correctly so it returns the correct fontstring height.

    Or (since the whole point of the resizing is to fit the content of the cell in one line) you just continue to recalculate the line height values with cell.fontstring:GetStringHeight():

    function FixCellSizes(tooltip)
    	...
    
    	for _, line in ipairs(lines) do
    		if #(line.cells) > 0 then
    			local lineheight = 0
    			for _, cell in pairs(line.cells) do
    				if cell [B]and cell.fontstring[/B] then
    					lineheight = max(lineheight, [B]cell.fontstring:GetStringHeight()[/B])
    				end
    			end
    			if lineheight > 0 then
    				ResizeLine(tooltip, line, lineheight)
    			end
    		end
    	end
    end
    Posted in: Libraries
  • 0

    posted a message on LibQTip
    I have got a problem with the line heights in my tooltip when I span the content over several cells.
    When displayed the content is shown in a single line, but the height is much bigger than a single line would require.
    Actually it seems like the height is calculated based on the total width of the 2 short cells above. It's like the content of the spanned cell was wrapped around first but then extended to full width without adjusting the height again.

    It's not so bad if the total width of the single cells if fairly as big as the spanned cells. But if that is not the case it can look quite bad. This is what it looks like when only spanned cells are displayed:
    http://i286.photobucket.com/albums/ll117/wujxin/WoWScrnShot_091010_093726.jpg

    Oh, and I use the most recent Version: LibQTip-1.0 r139

    local tooltip
    local dataobj = LDB:NewDataObject(MODNAME, {
    	...,
    	OnEnter = function ( self )
    		tooltip = QT:Acquire( MODNAME.."TT", 2, "LEFT", "LEFT" )
    		tooltip:Hide()
    		tooltip:Clear()
    		tooltip:SetScale(1)
    		
    		DrawTooltip()
    
    		tooltip:SmartAnchorTo( self )
    		tooltip:Show()
    	end,
    	OnLeave = function()
    		if(tooltip) then
    			QT:Release(tooltip)
    			tooltip = nil
    		end
    	end,
    })
    
    function DrawTooltip()
    	local colcount = tooltip:GetColumnCount()	
    
    	local lineNum = tooltip:AddLine( " " )
    	tooltip:SetCell( lineNum, 1, "short", "LEFT" )
    	tooltip:SetCell( lineNum, 2, "short", "LEFT" )
    
    	local lineNum = tooltip:AddLine( " " )
    	tooltip:SetCell( lineNum, 1, "quite a lot of text that exceeds total width of the two single cells above", 
                nil, "LEFT", colcount)
    end
    
    Posted in: Libraries
  • To post a comment, please or register a new account.