Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 1761c510db2c96251f3629ac44fc32c515871a3f Mon Sep 17 00:00:00 2001
- Date: Wed, 10 Sep 2014 23:46:44 +0200
- Subject: [PATCH 1/2] Model: Add a checkbox for unit's models
- ---
- WeakAuras/RegionTypes/model.lua | 13 +++++++++++--
- WeakAurasOptions/RegionOptions/model.lua | 22 +++++++++++++++-------
- 2 files changed, 26 insertions(+), 9 deletions(-)
- diff --git a/WeakAuras/RegionTypes/model.lua b/WeakAuras/RegionTypes/model.lua
- index 325e7f3..0da05e2 100644
- --- a/WeakAuras/RegionTypes/model.lua
- +++ b/WeakAuras/RegionTypes/model.lua
- @@ -4,6 +4,7 @@ local SharedMedia = LibStub("LibSharedMedia-3.0");
- -- Default settings
- local default = {
- model_path = "Creature/Arthaslichking/arthaslichking.m2",
- + modelIsUnit = false,
- model_x = 0,
- model_y = 0,
- model_z = 0,
- @@ -70,7 +71,11 @@ local function modify(parent, region, data)
- if tonumber(data.model_path) then
- model:SetDisplayInfo(tonumber(data.model_path))
- else
- - model:SetModel(data.model_path);
- + if (data.modelIsUnit) then
- + model:SetUnit(data.model_path)
- + else
- + model:SetModel(data.model_path);
- + end
- end
- model:SetPosition(data.model_z, data.model_x, data.model_y);
- @@ -145,7 +150,11 @@ local function modify(parent, region, data)
- if tonumber(data.model_path) then
- model:SetDisplayInfo(tonumber(data.model_path))
- else
- - model:SetModel(data.model_path);
- + if (data.modelIsUnit) then
- + model:SetUnit(data.model_path)
- + else
- + model:SetModel(data.model_path);
- + end
- end
- -- end
- end
- diff --git a/WeakAurasOptions/RegionOptions/model.lua b/WeakAurasOptions/RegionOptions/model.lua
- index 8f21428..ad19bcd 100644
- --- a/WeakAurasOptions/RegionOptions/model.lua
- +++ b/WeakAurasOptions/RegionOptions/model.lua
- @@ -13,11 +13,10 @@ local function createOptions(id, data)
- name = L["Model"],
- order = 0
- },
- - space1 = {
- - type = "execute",
- - name = "",
- - order = 2,
- - image = function() return "", 0, 0 end,
- + modelIsUnit = {
- + type = "toggle",
- + name = L["Show model of unit "],
- + order = 3
- },
- space2 = {
- type = "execute",
- @@ -168,13 +167,21 @@ local function modifyThumbnail(parent, region, data, fullModify, size)
- if tonumber(data.model_path) then
- model:SetDisplayInfo(tonumber(data.model_path))
- else
- - model:SetModel(data.model_path);
- + if (data.modelIsUnit) then
- + model:SetUnit(data.model_path)
- + else
- + model:SetModel(data.model_path);
- + end
- end
- model:SetScript("OnShow", function()
- if tonumber(data.model_path) then
- model:SetDisplayInfo(tonumber(data.model_path))
- else
- - model:SetModel(data.model_path);
- + if (data.modelIsUnit) then
- + model:SetUnit(data.model_path)
- + else
- + model:SetModel(data.model_path);
- + end
- end
- end);
- model:SetPosition(data.model_z, data.model_x, data.model_y);
- @@ -184,6 +191,7 @@ end
- local function createIcon()
- local data = {
- model_path = "Creature/Arthaslichking/arthaslichking.m2",
- + modelIsUnit = false,
- model_x = 0,
- model_y = 0,
- model_z = 0.35,
- --
- 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement