View Single Post
09-20-10, 12:20 PM   #8
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Model viewer
http://www.wowinterface.com/download...delViewer.html

*edit*

There are actually some Blizzards scripts that use SetDisplayInfo oder SetPortraitZoom

SetDisplayInfo
http://github.com/tekkub/wow-ui-sour...Frame.lua#L401

SetPortraitZoom
http://github.com/tekkub/wow-ui-sour...rent.lua#L2814
http://github.com/tekkub/wow-ui-sour...Frame.xml#L255
http://github.com/tekkub/wow-ui-sour...Frame.xml#L853

There seems to be a new API function aswell for questgivers that will contain their displayid. Will return -1 if not found.

Code:
local questPortrait, questPortraitText, questPortraitName = GetQuestPortraitGiver();
Actually there are three more that could be of the same type
Code:
GetQuestPortraitTurnIn
GetQuestLogPortraitGiver
GetQuestLogPortraitTurnIn
http://www.wowwiki.com/Global_functions/Cataclysm

There seems to be a new config option aswell

Code:
QuestLogShouldShowPortrait
That would explain why they added the new stuff. You may know the quest giver but you will not have any clue of the turn in person by the moment you take the quest. That one is not cached yet.

What's kinde of interesting is that the tutorialframe works with SetCreature.

http://github.com/tekkub/wow-ui-sour...e.lua#L795-798

A little dataming reveals this in TutorialFrame.lua

Code:
local TUTORIAL_QUEST_ARRAY = {
	["HUMAN"] = {questID = 7, displayNPC = 197, killCreature = 49871},
	["DWARF"] = {questID = 24469, displayNPC = 37081, killCreature = 37070},
	["NIGHTELF"] = {questID = 456, displayNPC = 2079, killCreature = 2031},
	["GNOME"] = {questID = 27670, displayNPC = 15744, killCreature = 46363},
	["ORC"] = {questID = 25126, displayNPC = 3143, killCreature = 3098, killQuestSecond = true},
	["SCOURGE"] = {questID = 26799, displayNPC = 1569, killCreature = 1501},
	["TAUREN"] = {questID = 14452, displayNPC = 9937, killCreature = 36943, killQuestSecond = true},

	["TROLLWARRIOR"] = nil,

	["DRAENEI"] = nil,
	["BLOODELF"] = nil,
	["WORGEN"] = nil,
	["GOBLIN"] = nil,
};
CURRENT_TUTORIAL_QUEST_INFO = TUTORIAL_QUEST_ARRAY["HUMAN"];
And this information is then used in SetCreature.

Code:
	local displayNPC = CURRENT_TUTORIAL_QUEST_INFO.displayNPC;
	local killCreature = CURRENT_TUTORIAL_QUEST_INFO.killCreature;
	if (displayData.displayNPC and displayNPC) then
		TutorialNPCModel:SetCreature(displayNPC);
		TutorialNPCModel:Show();
	elseif (displayData.killCreature and killCreature) then
		TutorialNPCModel:SetCreature(killCreature);
		TutorialNPCModel:Show();
	end
I will test the model with SetCreatureIDs later. Because if you should display a killcreature that is currently unknown to you (not cached) it should not work.

Even more cool stuff found in UIParent.lua
Code:
function Model_OnMouseWheel(self, delta, maxZoom)
    if (not maxZoom) then
        maxZoom = MODELFRAME_MAX_PET_ZOOM;
    end
    if (not self.zoomLevel) then
        self.zoomLevel = 0;
    end
    self.zoomLevel = self.zoomLevel + delta*0.15;
    if (self.zoomLevel > maxZoom) then
        self.zoomLevel = maxZoom;
    end
    if (0 > self.zoomLevel) then
        self.zoomLevel = 0;
    end
    self:SetPortraitZoom(self.zoomLevel);
end
Usage:
Code:
<Scripts>
  <OnLoad>
    Model_OnLoad(self);
    self:SetCamDistanceScale(1.3);
  </OnLoad>
  <OnEvent function="Model_OnEvent"/>
  <OnUpdate function="Model_OnUpdate"/>
  <OnMouseUp function="Model_OnMouseUp"/>
  <OnMouseDown function="Model_OnMouseDown"/>
  <OnMouseWheel>
    Model_OnMouseWheel(self, delta, MODELFRAME_MAX_PET_ZOOM);
  </OnMouseWheel>
</Scripts>
Lua conversion
Code:
model:SetScript("OnMouseWheel", function(s,d,...)
  Model_OnMouseWheel(s,d)
end)
So there is another option
Code:
SetCamDistanceScale
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 09-21-10 at 09:23 AM.
  Reply With Quote