Last active
June 16, 2019 17:30
-
-
Save d87/c8d1903d64fffac351505bcb122b3822 to your computer and use it in GitHub Desktop.
Sample model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Test82Models() | |
local Redraw = function(self) | |
if not self.model_path then return end | |
self:SetModelScale(1) | |
self:SetPosition(0,0,0) | |
self:SetModel(self.model_path) | |
self:SetModelScale(self.model_scale) | |
self:SetPosition(self.ox, self.oy, self.oz) | |
end | |
local ResetTransformations = function(self) | |
self:SetModelScale(1) | |
self:SetPosition(0,0,0) | |
end | |
local MakeModelRegion = function(parent, w, h, model_path, x,y,z) | |
local pmf = CreateFrame("PlayerModel", nil, parent ) | |
pmf:SetSize(w,h) | |
pmf.model_scale = 1 | |
pmf.ox = x | |
pmf.oy = y | |
pmf.oz = z | |
pmf.model_path = model_path | |
pmf:SetScript("OnHide", ResetTransformations) | |
pmf:SetScript("OnShow", Redraw) | |
pmf.Redraw = Redraw | |
pmf.ResetTransformations = ResetTransformations | |
pmf:Redraw() | |
return pmf | |
end | |
local is82 = select(4,GetBuildInfo()) > 80100 | |
local ambientSmoke = MakeModelRegion(nil, 200, 200, is82 and 165535 or "spells/acidburn_blue.m2", 0,0,1 ) | |
ambientSmoke:SetPoint("CENTER", UIParent, "CENTER", 0, 0) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment