You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
982 lines
32 KiB
982 lines
32 KiB
|
5 years ago
|
----------------------------------------------------------------------------------------
|
||
|
|
local DEFAULT_WIDTH, DEFAULT_HEIGHT = 450, 545; --BLZ dressing room size
|
||
|
|
|
||
|
|
----------------------------------------------------------------------------------------
|
||
|
|
local L = Narci.L;
|
||
|
|
local After = C_Timer.After;
|
||
|
|
local C_TransmogCollection = C_TransmogCollection;
|
||
|
|
local IsFavorite = C_TransmogCollection.GetIsAppearanceFavorite;
|
||
|
|
|
||
|
|
local FadeFrame = NarciFadeUI.Fade;
|
||
|
|
local GetInspectSources = C_TransmogCollection.GetInspectSources or C_TransmogCollection.GetInspectItemTransmogInfoList; --API changed in 9.1.0
|
||
|
|
|
||
|
|
local WIDTH_HEIGHT_RATIO = DEFAULT_WIDTH/DEFAULT_HEIGHT;
|
||
|
|
local OVERRIDE_HEIGHT = math.floor(GetScreenHeight()*0.8 + 0.5);
|
||
|
|
local OVERRIDE_WIDTH = math.floor(WIDTH_HEIGHT_RATIO * OVERRIDE_HEIGHT + 0.5);
|
||
|
|
|
||
|
|
local slotFrameEnabled = true; --If DressUp addon is loaded, hide our slot frame
|
||
|
|
local UseTargetModel = true; --Replace your model with target's
|
||
|
|
|
||
|
|
local GetActorInfoByUnit = NarciAPI_GetActorInfoByUnit;
|
||
|
|
|
||
|
|
--Frames:
|
||
|
|
local DressingRoomOverlayFrame;
|
||
|
|
local DressingRoomItemButtons = {};
|
||
|
|
|
||
|
|
local function CreateSlotButton(frame)
|
||
|
|
local container = frame.SlotFrame;
|
||
|
|
local slotArrangement = {
|
||
|
|
[1] = {"HeadSlot", "ShoulderSlot", "BackSlot", "ChestSlot", "WristSlot"},
|
||
|
|
[2] = {"HandsSlot", "WaistSlot", "LegsSlot", "FeetSlot"},
|
||
|
|
[3] = {"MainHandSlot", "SecondaryHandSlot"},
|
||
|
|
[4] = {"ShirtSlot", "TabardSlot"},
|
||
|
|
};
|
||
|
|
|
||
|
|
local button, slotID;
|
||
|
|
local buttons = {};
|
||
|
|
local buttonWidth;
|
||
|
|
local offsetY = 12;
|
||
|
|
local buttonGap = 4;
|
||
|
|
local extrudeX = 16;
|
||
|
|
local fullWidth = extrudeX;
|
||
|
|
|
||
|
|
for sectorIndex = 1, #slotArrangement do
|
||
|
|
if sectorIndex ~= 1 then
|
||
|
|
fullWidth = fullWidth + 12;
|
||
|
|
end
|
||
|
|
for i = 1, #slotArrangement[sectorIndex] do
|
||
|
|
button = CreateFrame("Button", nil, container, "NarciRectangularItemButtonTemplate");
|
||
|
|
slotID = button:Init(slotArrangement[sectorIndex][i]);
|
||
|
|
buttons[slotID] = button;
|
||
|
|
button:SetPoint("BOTTOMLEFT", container, "BOTTOMLEFT", fullWidth, offsetY);
|
||
|
|
if not buttonWidth then
|
||
|
|
buttonWidth = math.floor(button:GetWidth() + 0.5);
|
||
|
|
end
|
||
|
|
fullWidth = fullWidth + buttonWidth + buttonGap;
|
||
|
|
end
|
||
|
|
end
|
||
|
|
DressingRoomItemButtons = buttons;
|
||
|
|
fullWidth = fullWidth + extrudeX;
|
||
|
|
container:SetWidth(fullWidth);
|
||
|
|
|
||
|
|
slotArrangement = nil;
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
--------------------------------------------------
|
||
|
|
local DataProvider = {};
|
||
|
|
|
||
|
|
DataProvider.isCurrentModelPlayer = false;
|
||
|
|
DataProvider.inspectedPlayerGUID = {};
|
||
|
|
|
||
|
|
function DataProvider:GetActorSlotSourceID(actor, slotID)
|
||
|
|
if not self.isLoaded then
|
||
|
|
if actor.GetItemTransmogInfo then
|
||
|
|
self.isNewAPI = true;
|
||
|
|
else
|
||
|
|
self.isNewAPI = false;
|
||
|
|
end
|
||
|
|
self.isLoaded = true;
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.isNewAPI then
|
||
|
|
local transmogInfo = actor:GetItemTransmogInfo(slotID);
|
||
|
|
if transmogInfo then
|
||
|
|
if slotID == 16 or slotID == 17 then
|
||
|
|
return (transmogInfo.appearanceID or 0), (transmogInfo.illusionID or 0);
|
||
|
|
else
|
||
|
|
return (transmogInfo.appearanceID or 0), (transmogInfo.secondaryAppearanceID or 0);
|
||
|
|
end
|
||
|
|
else
|
||
|
|
return 0, 0;
|
||
|
|
end
|
||
|
|
else
|
||
|
|
return actor:GetSlotTransmogSources(slotID);
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function DataProvider:SetInspectedUnit(unit)
|
||
|
|
local guid = UnitGUID(unit);
|
||
|
|
self.inspectedPlayerGUID[guid] = true;
|
||
|
|
end
|
||
|
|
|
||
|
|
function DataProvider:IsInspectedUnit(guid)
|
||
|
|
if self.inspectedPlayerGUID[guid] then
|
||
|
|
self.inspectedPlayerGUID[guid] = nil;
|
||
|
|
return true
|
||
|
|
else
|
||
|
|
return false
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function DataProvider:UnitInQueue()
|
||
|
|
local hasUnit = false;
|
||
|
|
for guid, monitored in pairs(self.inspectedPlayerGUID) do
|
||
|
|
if monitored then
|
||
|
|
hasUnit = true;
|
||
|
|
break
|
||
|
|
end
|
||
|
|
end
|
||
|
|
return hasUnit
|
||
|
|
end
|
||
|
|
|
||
|
|
-------Create Mogit List-------
|
||
|
|
local newSet = {items = {}}
|
||
|
|
-------------------------------
|
||
|
|
local UnitInfo = {
|
||
|
|
raceID = nil,
|
||
|
|
genderID = nil,
|
||
|
|
classID = nil,
|
||
|
|
};
|
||
|
|
|
||
|
|
--Background Transition Animation--
|
||
|
|
local function Narci_SetDressUpBackground(unit, instant)
|
||
|
|
local _, atlasPostfix = UnitClass(unit or "player");
|
||
|
|
local frame = DressUpFrame;
|
||
|
|
if ( frame.ModelBackground and frame.ModelBackgroundOverlay and atlasPostfix ) then
|
||
|
|
if instant then
|
||
|
|
frame.ModelBackground:SetAtlas("dressingroom-background-"..atlasPostfix);
|
||
|
|
else
|
||
|
|
frame.ModelBackgroundOverlay:SetAtlas("dressingroom-background-"..atlasPostfix);
|
||
|
|
frame.ModelBackgroundOverlay:StopAnimating();
|
||
|
|
frame.ModelBackgroundOverlay.animIn:Play();
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
local function GetDressingSourceFromActor()
|
||
|
|
local slotID;
|
||
|
|
local buttons = DressingRoomItemButtons;
|
||
|
|
local appliedSourceID;
|
||
|
|
local secondarySourceID; --secondarySourceID or illusionID
|
||
|
|
local playerActor = DressUpFrame.ModelScene:GetPlayerActor();
|
||
|
|
if not playerActor then return end;
|
||
|
|
|
||
|
|
for k, slotButton in pairs(buttons) do
|
||
|
|
slotID = slotButton.slotID;
|
||
|
|
|
||
|
|
appliedSourceID, secondarySourceID = DataProvider:GetActorSlotSourceID(playerActor, slotID);
|
||
|
|
|
||
|
|
slotButton:SetItemSource(appliedSourceID, secondarySourceID);
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
local function DressingRoomOverlayFrame_OnLoad(self)
|
||
|
|
self:SetParent(DressUpFrame);
|
||
|
|
self:GetParent():SetMovable(true);
|
||
|
|
self:GetParent():RegisterForDrag("LeftButton");
|
||
|
|
self:GetParent():SetScript("OnDragStart", function(self)
|
||
|
|
self:StartMoving();
|
||
|
|
end);
|
||
|
|
self:GetParent():SetScript("OnDragStop", function(self)
|
||
|
|
self:StopMovingOrSizing();
|
||
|
|
end);
|
||
|
|
|
||
|
|
self.mode = "visual";
|
||
|
|
|
||
|
|
|
||
|
|
local GearTextScrollFrame = self.OptionFrame.SharePopup.GearTextContainer.ScrollFrame;
|
||
|
|
local totalHeight = 240;
|
||
|
|
local maxScroll = totalHeight;
|
||
|
|
GearTextScrollFrame.buttonHeight = 14;
|
||
|
|
GearTextScrollFrame.scrollBar:SetRange(maxScroll, true);
|
||
|
|
NarciAPI_SmoothScroll_Initialization(GearTextScrollFrame, nil, nil, 2, 0.14);
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
local PrintItemList = NarciDressingRoomAPI.PrintItemList;
|
||
|
|
|
||
|
|
local function IsDressUpFrameMaximized()
|
||
|
|
return (DressUpFrame.MaximizeMinimizeFrame and not DressUpFrame.MaximizeMinimizeFrame:IsMinimized())
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
local function UpdateDressingRoomModelByUnit(unit)
|
||
|
|
if not DressingRoomOverlayFrame then
|
||
|
|
return
|
||
|
|
end
|
||
|
|
|
||
|
|
unit = unit or "player";
|
||
|
|
local overlay = DressingRoomOverlayFrame;
|
||
|
|
if not UnitExists(unit) then
|
||
|
|
return
|
||
|
|
else
|
||
|
|
if UnitIsPlayer(unit) then
|
||
|
|
if CanInspect(unit, false) then
|
||
|
|
overlay.OptionFrame.InspectButton:Enable();
|
||
|
|
if UnitIsUnit(unit, "player") and UnitOnTaxi("player") then
|
||
|
|
--Somehow you won't receive INSPECT_READY when you are on a vehicle
|
||
|
|
overlay.SlotFrame:ShowPlayerTransmog();
|
||
|
|
return
|
||
|
|
end
|
||
|
|
else
|
||
|
|
overlay.OptionFrame.InspectButton:Disable();
|
||
|
|
end
|
||
|
|
else
|
||
|
|
overlay.OptionFrame.InspectButton:Disable();
|
||
|
|
return;
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
Narci_SetDressUpBackground(unit);
|
||
|
|
local ModelScene = DressUpFrame.ModelScene;
|
||
|
|
local actor = ModelScene:GetPlayerActor();
|
||
|
|
if not actor then return; end;
|
||
|
|
|
||
|
|
--Acquire target's gears
|
||
|
|
overlay:RegisterEvent("INSPECT_READY");
|
||
|
|
DataProvider:SetInspectedUnit(unit);
|
||
|
|
NotifyInspect(unit);
|
||
|
|
|
||
|
|
local _;
|
||
|
|
_, _, UnitInfo.raceID = UnitRace(unit);
|
||
|
|
UnitInfo.genderID = UnitSex(unit);
|
||
|
|
_, _, UnitInfo.classID = UnitClass(unit);
|
||
|
|
|
||
|
|
local modelUnit;
|
||
|
|
local updateScale;
|
||
|
|
local sheatheWeapons = actor:GetSheathed() or false;
|
||
|
|
|
||
|
|
if UseTargetModel then
|
||
|
|
modelUnit = unit;
|
||
|
|
actor:SetModelByUnit(modelUnit, sheatheWeapons, true);
|
||
|
|
updateScale = true;
|
||
|
|
DataProvider.isCurrentModelPlayer = false;
|
||
|
|
else
|
||
|
|
modelUnit = "player";
|
||
|
|
if not DataProvider.isCurrentModelPlayer then
|
||
|
|
DataProvider.isCurrentModelPlayer = true;
|
||
|
|
actor:SetModelByUnit(modelUnit, sheatheWeapons, true);
|
||
|
|
updateScale = true;
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
if updateScale then
|
||
|
|
local modelInfo;
|
||
|
|
modelInfo = GetActorInfoByUnit(modelUnit);
|
||
|
|
if modelInfo then
|
||
|
|
After(0.0,function()
|
||
|
|
ModelScene:InitializeActor(actor, modelInfo); --Re-scale
|
||
|
|
end);
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
return true
|
||
|
|
end
|
||
|
|
|
||
|
|
local function RefreshFavoriteState(visualID)
|
||
|
|
local buttons = DressingRoomItemButtons;
|
||
|
|
local state;
|
||
|
|
for slot, button in pairs(buttons) do
|
||
|
|
if button.visualID and button.visualID == visualID then
|
||
|
|
state = IsFavorite(button.visualID);
|
||
|
|
button:UpdateBottomMark();
|
||
|
|
local note = button:GetParent().Notification;
|
||
|
|
note.fadeOut:Stop();
|
||
|
|
note:ClearAllPoints();
|
||
|
|
note:SetPoint("TOP", button, "BOTTOM", 0, 0);
|
||
|
|
if state then
|
||
|
|
note:SetText("|cffffe8a5"..L["Favorited"]);
|
||
|
|
else
|
||
|
|
note:SetText("|cffcccccc"..L["Unfavorited"]);
|
||
|
|
end
|
||
|
|
note.fadeOut:Play();
|
||
|
|
|
||
|
|
if slot == 16 then
|
||
|
|
local offHandSlot = buttons[17];
|
||
|
|
if offHandSlot.visualID and offHandSlot.visualID == visualID then
|
||
|
|
offHandSlot:UpdateBottomMark();
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
return
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
local function NarciBridge_MogIt_SaveButton_OnClick(self)
|
||
|
|
StaticPopup_Show("MOGIT_WISHLIST_CREATE_SET", nil, nil, newSet); --Create a new whishlist
|
||
|
|
MogIt.view:Show(); --Open a view window
|
||
|
|
end
|
||
|
|
|
||
|
|
local function ShareButton_OnClick(self)
|
||
|
|
local Popup = NarciDressingRoomSharePopup;
|
||
|
|
if not Popup:IsShown() then
|
||
|
|
Popup:Show();
|
||
|
|
PrintItemList();
|
||
|
|
Popup.GearTextContainer:SetFocus();
|
||
|
|
else
|
||
|
|
Popup:Hide();
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
local function InspectButton_OnClick(self)
|
||
|
|
local state = NarcissusDB.DressingRoomUseTargetModel;
|
||
|
|
NarcissusDB.DressingRoomUseTargetModel = not state;
|
||
|
|
UseTargetModel = not state;
|
||
|
|
self.useTargetModel = not state;
|
||
|
|
if not state then --true
|
||
|
|
self.Label:SetText(self.targetModelText);
|
||
|
|
else
|
||
|
|
self.Label:SetText(self.yourModelText);
|
||
|
|
end
|
||
|
|
UpdateDressingRoomModelByUnit("target");
|
||
|
|
end
|
||
|
|
|
||
|
|
function Narci_UpdateDressingRoom()
|
||
|
|
local frame = DressingRoomOverlayFrame;
|
||
|
|
if not frame or not slotFrameEnabled then return end;
|
||
|
|
|
||
|
|
frame.mode = "visual";
|
||
|
|
|
||
|
|
if not frame.pauseUpdate then
|
||
|
|
frame.pauseUpdate = true;
|
||
|
|
After(0, function()
|
||
|
|
if slotFrameEnabled and IsDressUpFrameMaximized() then
|
||
|
|
frame.SlotFrame:Show();
|
||
|
|
frame.OptionFrame:Show();
|
||
|
|
GetDressingSourceFromActor();
|
||
|
|
if NarciDressingRoomGearTextsClipborad:IsVisible() then
|
||
|
|
PrintItemList();
|
||
|
|
end
|
||
|
|
end
|
||
|
|
frame.pauseUpdate = nil;
|
||
|
|
end)
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
local Narci_UpdateDressingRoom = Narci_UpdateDressingRoom;
|
||
|
|
|
||
|
|
function Narci_ShowDressingRoom()
|
||
|
|
local frame = DressUpFrame;
|
||
|
|
--derivated from Blizzard DressUpFrames.lua / DressUpFrame_Show
|
||
|
|
if ( not frame:IsShown() ) then
|
||
|
|
if InCombatLockdown() then
|
||
|
|
frame:Show();
|
||
|
|
DressingRoomOverlayFrame:ListenEscapeKey(true);
|
||
|
|
else
|
||
|
|
DressUpFrame_Show(frame);
|
||
|
|
end
|
||
|
|
|
||
|
|
if frame.mode ~= "player" then
|
||
|
|
frame.mode = "player";
|
||
|
|
frame.ResetButton:SetShown(true);
|
||
|
|
frame.MaximizeMinimizeFrame:Maximize(true);
|
||
|
|
frame.ModelScene:ClearScene();
|
||
|
|
frame.ModelScene:SetViewInsets(0, 0, 0, 0);
|
||
|
|
frame.ModelScene:TransitionToModelSceneID(290, CAMERA_TRANSITION_TYPE_IMMEDIATE, CAMERA_MODIFICATION_TYPE_DISCARD, true);
|
||
|
|
|
||
|
|
local sheatheWeapons = false;
|
||
|
|
local autoDress = true;
|
||
|
|
local itemModifiedAppearanceIDs = nil;
|
||
|
|
SetupPlayerForModelScene(frame.ModelScene, itemModifiedAppearanceIDs, sheatheWeapons, autoDress);
|
||
|
|
Narci_UpdateDressingRoom();
|
||
|
|
end
|
||
|
|
|
||
|
|
if slotFrameEnabled then
|
||
|
|
UpdateDressingRoomModelByUnit("player");
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
----------------------------------------------------------------------------------------
|
||
|
|
local Adaptor = {};
|
||
|
|
|
||
|
|
function Adaptor:IsBetterWardrobeDressingRoomEnabled()
|
||
|
|
local hasBW = IsAddOnLoaded("BetterWardrobe");
|
||
|
|
if hasBW then
|
||
|
|
local db = BetterWardrobe_Options;
|
||
|
|
if db then
|
||
|
|
local playerName = UnitName("player");
|
||
|
|
local realmName = GetRealmName(); --GetNormalizedRealmName
|
||
|
|
local searchKey = playerName .. " - "..realmName;
|
||
|
|
local profileKey = "Default";
|
||
|
|
if db.profileKeys then
|
||
|
|
profileKey = db.profileKeys[searchKey] or profileKey;
|
||
|
|
end
|
||
|
|
local settings = db.profiles[profileKey];
|
||
|
|
if settings then
|
||
|
|
return settings.DR_OptionsEnable
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function Adaptor:IsAddOnDressUpEnabled()
|
||
|
|
return IsAddOnLoaded("DressUp");
|
||
|
|
end
|
||
|
|
|
||
|
|
function Adaptor:IsConflictedAddOnLoaded()
|
||
|
|
local result = (self:IsBetterWardrobeDressingRoomEnabled() or self:IsAddOnDressUpEnabled());
|
||
|
|
wipe(self);
|
||
|
|
return result;
|
||
|
|
end
|
||
|
|
|
||
|
|
----------------------------------------------------------------------------------------
|
||
|
|
local function OverrideMaximizeFunc()
|
||
|
|
local ReScaleFrame = DressUpFrame.MaximizeMinimizeFrame;
|
||
|
|
|
||
|
|
if ReScaleFrame then
|
||
|
|
local function OnMaximize(f)
|
||
|
|
f:GetParent():SetSize(OVERRIDE_WIDTH, OVERRIDE_HEIGHT); --Override DressUpFrame Resize Mixin
|
||
|
|
UpdateUIPanelPositions(f);
|
||
|
|
end
|
||
|
|
ReScaleFrame:SetOnMaximizedCallback(OnMaximize);
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
local function DressingRoomOverlayFrame_Initialize()
|
||
|
|
if not (NarcissusDB and NarcissusDB.DressingRoom) then return; end;
|
||
|
|
|
||
|
|
local parentFrame = DressUpFrame;
|
||
|
|
if not parentFrame then
|
||
|
|
print("Narcissus failed to initialize Advanced Dressing Room");
|
||
|
|
return;
|
||
|
|
end
|
||
|
|
|
||
|
|
local frame = CreateFrame("Frame", "NarciDressingRoomOverlay", parentFrame, "NarciDressingRoomOverlayTemplate")
|
||
|
|
CreateSlotButton(frame)
|
||
|
|
DressingRoomOverlayFrame_OnLoad(frame);
|
||
|
|
|
||
|
|
local texName = parentFrame:GetName() and parentFrame:GetName().."BackgroundOverlay"
|
||
|
|
local tex = parentFrame:CreateTexture(texName, "BACKGROUND", "NarciDressingRoomBackgroundTemplate", 2)
|
||
|
|
|
||
|
|
hooksecurefunc("DressUpVisual", Narci_UpdateDressingRoom);
|
||
|
|
|
||
|
|
local function SetDressingRoomMode(mode, link)
|
||
|
|
frame.mode = mode;
|
||
|
|
frame.SlotFrame:Hide();
|
||
|
|
frame.OptionFrame:Hide();
|
||
|
|
end
|
||
|
|
|
||
|
|
hooksecurefunc("DressUpMountLink", function(link)
|
||
|
|
--[[
|
||
|
|
if link then
|
||
|
|
local _, _, _, linkType, linkID = strsplit(":|H", link);
|
||
|
|
if linkType == "item" or linkType == "spell" then
|
||
|
|
link = WOWHEAD_DOMAIN .. linkType .. "=" .. linkID;
|
||
|
|
end
|
||
|
|
end
|
||
|
|
SetDressingRoomMode("mount", link);
|
||
|
|
--]]
|
||
|
|
SetDressingRoomMode("mount");
|
||
|
|
end)
|
||
|
|
|
||
|
|
hooksecurefunc("DressUpBattlePet", function(creatureID)
|
||
|
|
--SetDressingRoomMode("battlePet", WOWHEAD_DOMAIN .. "npc=" .. creatureID);
|
||
|
|
SetDressingRoomMode("battlePet");
|
||
|
|
end)
|
||
|
|
|
||
|
|
frame.OptionFrame.ShareButton:SetScript("OnClick", ShareButton_OnClick);
|
||
|
|
frame.OptionFrame.InspectButton:SetScript("OnClick", InspectButton_OnClick);
|
||
|
|
|
||
|
|
|
||
|
|
if DressUpFrame.ResetButton then
|
||
|
|
DressUpFrame.ResetButton:HookScript("OnClick", function(self)
|
||
|
|
UpdateDressingRoomModelByUnit("player");
|
||
|
|
end)
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
local initialize = CreateFrame("Frame")
|
||
|
|
initialize:RegisterEvent("ADDON_LOADED");
|
||
|
|
initialize:RegisterEvent("PLAYER_ENTERING_WORLD");
|
||
|
|
initialize:RegisterEvent("UI_SCALE_CHANGED");
|
||
|
|
initialize:SetScript("OnEvent",function(self,event,...)
|
||
|
|
if event == "ADDON_LOADED" then
|
||
|
|
local name = ...;
|
||
|
|
if name == "Narcissus" then
|
||
|
|
self:UnregisterEvent("ADDON_LOADED");
|
||
|
|
DressingRoomOverlayFrame_Initialize();
|
||
|
|
end
|
||
|
|
elseif event == "PLAYER_ENTERING_WORLD" then
|
||
|
|
self:UnregisterEvent(event);
|
||
|
|
UseTargetModel = NarcissusDB.DressingRoomUseTargetModel;
|
||
|
|
|
||
|
|
if not DressingRoomOverlayFrame then
|
||
|
|
self:UnregisterAllEvents();
|
||
|
|
return
|
||
|
|
end
|
||
|
|
|
||
|
|
local InspectButton = DressingRoomOverlayFrame.OptionFrame.InspectButton;
|
||
|
|
InspectButton:SetScript("OnClick", InspectButton_OnClick);
|
||
|
|
if UseTargetModel then --true
|
||
|
|
InspectButton.Label:SetText(L["Use Target Model"]);
|
||
|
|
InspectButton.useTargetModel = true;
|
||
|
|
else
|
||
|
|
InspectButton.Label:SetText(L["Use Your Model"]);
|
||
|
|
InspectButton.useTargetModel = false;
|
||
|
|
end
|
||
|
|
|
||
|
|
local ShareButton = DressingRoomOverlayFrame.OptionFrame.ShareButton;
|
||
|
|
local buttonOffsetX, buttonOffsetY, buttonGap;
|
||
|
|
if Adaptor:IsConflictedAddOnLoaded() then --DressUp: Hide our dressing room slot frame
|
||
|
|
DressingRoomOverlayFrame.SlotFrame:Disable();
|
||
|
|
slotFrameEnabled = false;
|
||
|
|
buttonOffsetX = 24;
|
||
|
|
buttonOffsetY = 48;
|
||
|
|
buttonGap = 8;
|
||
|
|
function Narci_SetDressUpBackground()
|
||
|
|
return
|
||
|
|
end
|
||
|
|
else
|
||
|
|
buttonOffsetX = 0;
|
||
|
|
buttonOffsetY = 96;
|
||
|
|
buttonGap = 24;
|
||
|
|
OverrideMaximizeFunc();
|
||
|
|
end
|
||
|
|
ShareButton:ClearAllPoints();
|
||
|
|
ShareButton:SetPoint("CENTER", DressingRoomOverlayFrame.OptionFrame, "BOTTOMLEFT", buttonOffsetX, buttonOffsetY);
|
||
|
|
DressingRoomOverlayFrame.OptionFrame.GroupController:SetButtonGap(buttonGap);
|
||
|
|
|
||
|
|
elseif event == "UI_SCALE_CHANGED" then
|
||
|
|
After(0.5, function()
|
||
|
|
OVERRIDE_HEIGHT = math.floor(GetScreenHeight()*0.8 + 0.5);
|
||
|
|
OVERRIDE_WIDTH = math.floor(WIDTH_HEIGHT_RATIO * OVERRIDE_HEIGHT + 0.5);
|
||
|
|
if IsDressUpFrameMaximized() then
|
||
|
|
DressUpFrame:SetSize(OVERRIDE_WIDTH, OVERRIDE_HEIGHT)
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
end
|
||
|
|
end);
|
||
|
|
|
||
|
|
|
||
|
|
NarciDressingRoomOverlayMixin = {};
|
||
|
|
|
||
|
|
function NarciDressingRoomOverlayMixin:OnLoad()
|
||
|
|
DressingRoomOverlayFrame = self;
|
||
|
|
self.updateSize = true;
|
||
|
|
end
|
||
|
|
|
||
|
|
function NarciDressingRoomOverlayMixin:OnShow()
|
||
|
|
if self.mode ~= "visual" then return end;
|
||
|
|
|
||
|
|
Narci_SetDressUpBackground("player", true);
|
||
|
|
self:RegisterEvent("PLAYER_TARGET_CHANGED");
|
||
|
|
self:RegisterEvent("TRANSMOG_COLLECTION_UPDATED");
|
||
|
|
|
||
|
|
if self.updateSize then
|
||
|
|
self.updateSize = nil;
|
||
|
|
self:OnSizeChanged();
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function NarciDressingRoomOverlayMixin:ListenEscapeKey(state)
|
||
|
|
if state then
|
||
|
|
self:SetScript("OnKeyDown", function(frame, key, down)
|
||
|
|
if key == "ESCAPE" then
|
||
|
|
DressUpFrame:Hide();
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
else
|
||
|
|
self:SetScript("OnKeyDown", nil);
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function NarciDressingRoomOverlayMixin:OnHide()
|
||
|
|
self:UnregisterEvent("PLAYER_TARGET_CHANGED");
|
||
|
|
self:UnregisterEvent("TRANSMOG_COLLECTION_UPDATED");
|
||
|
|
self:UnregisterEvent("INSPECT_READY");
|
||
|
|
self.isActorHooked = false;
|
||
|
|
self:ListenEscapeKey(false);
|
||
|
|
end
|
||
|
|
|
||
|
|
function NarciDressingRoomOverlayMixin:InspectTarget()
|
||
|
|
if UpdateDressingRoomModelByUnit("target") then
|
||
|
|
self.SlotFrame:FadeOut();
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function NarciDressingRoomOverlayMixin:OnEvent(event, ...)
|
||
|
|
if event == "PLAYER_TARGET_CHANGED" then
|
||
|
|
self:InspectTarget();
|
||
|
|
elseif event == "TRANSMOG_COLLECTION_UPDATED" then
|
||
|
|
local collectionIndex, modID, itemAppearanceID, reason = ...
|
||
|
|
if reason == "favorite" and itemAppearanceID then
|
||
|
|
RefreshFavoriteState(itemAppearanceID);
|
||
|
|
end
|
||
|
|
elseif event == "INSPECT_READY" then
|
||
|
|
if not self.pauseInspect then
|
||
|
|
self.pauseInspect = true;
|
||
|
|
local guid = ...;
|
||
|
|
if DataProvider:IsInspectedUnit(guid) then
|
||
|
|
if not DataProvider:UnitInQueue() then
|
||
|
|
self:UnregisterEvent(event);
|
||
|
|
end
|
||
|
|
After(0, function()
|
||
|
|
self.SlotFrame:SetSources( GetInspectSources() );
|
||
|
|
self.SlotFrame:FadeIn();
|
||
|
|
if NarciDressingRoomGearTextsClipborad:IsVisible() then
|
||
|
|
PrintItemList();
|
||
|
|
end
|
||
|
|
ClearInspectPlayer();
|
||
|
|
self.pauseInspect = nil;
|
||
|
|
end);
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
function NarciDressingRoomOverlayMixin:OnSizeChanged(width, height)
|
||
|
|
--print(width.." x "..height);
|
||
|
|
local uiScale = UIParent:GetEffectiveScale();
|
||
|
|
local frameScale = math.max(uiScale, 0.75);
|
||
|
|
self.OptionFrame.SharePopup:SetScale(frameScale);
|
||
|
|
|
||
|
|
if slotFrameEnabled then
|
||
|
|
self.OptionFrame.GroupController:SetLabelScale(frameScale);
|
||
|
|
if IsDressUpFrameMaximized() then
|
||
|
|
self.SlotFrame:SetInvisible(false);
|
||
|
|
self.OptionFrame:SetScale(frameScale);
|
||
|
|
else
|
||
|
|
self.SlotFrame:SetInvisible(true);
|
||
|
|
self.OptionFrame:SetScale(0.5);
|
||
|
|
end
|
||
|
|
else
|
||
|
|
self.SlotFrame:Hide();
|
||
|
|
self.OptionFrame:SetScale(frameScale);
|
||
|
|
self.OptionFrame.GroupController:SetLabelScale(frameScale);
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
--[[
|
||
|
|
hooksecurefunc("PanelTemplates_TabResize", function(tab, padding, absoluteSize, minWidth, maxWidth, absoluteTextSize)
|
||
|
|
print(tab:GetName())
|
||
|
|
print(padding)
|
||
|
|
print(absoluteSize)
|
||
|
|
print(minWidth)
|
||
|
|
print(maxWidth)
|
||
|
|
end)
|
||
|
|
|
||
|
|
/run A1=DressUpFrame.ModelScene:GetPlayerActor()
|
||
|
|
/run DressUpFrame.ModelScene:SetLightDirection(- 0.44699833180028 , 0.72403680806459 , -0.52532198881773)
|
||
|
|
/dump A1:GetScale(); SetModelByUnit SetModelByFileID GetModelFileID()
|
||
|
|
/dump A1:GetModelFileID() 1100258 BE female
|
||
|
|
/run A1:SetAnimation() 48 CrossBow/Rifle
|
||
|
|
/dump A1:SetCustomRace(1,1)
|
||
|
|
/dump A1.OnModelLoaded
|
||
|
|
/run A1:TryOn(105951) 105951 Renowned Explorer's Versatile Vest 105950 104948 105946 105945 105949 105947 105944 Cap 105952 Cloak 105959 Tabard 105953 Rucksack 1287 Explorer's Jungle Hopper
|
||
|
|
/script local a=DressUpFrame.ModelScene:GetPlayerActor();a:Undress();for i=105945,105951 do a:TryOn(i);end;a:TryOn(105953);
|
||
|
|
|
||
|
|
Wooly Wendigo
|
||
|
|
/script local a=DressUpFrame.ModelScene:GetPlayerActor();a:Undress();for i=105954,105958 do a:TryOn(i);end;
|
||
|
|
|
||
|
|
/script local a=NarciPlayerModelFrame1;a:Undress();for i=105945,105951 do a:TryOn(i);end;a:TryOn(105953);
|
||
|
|
/run NarciPlayerModelFrame1:TryOn(66602)
|
||
|
|
/dump DressUpFrame.ModelScene:GetCameraPosition()
|
||
|
|
/dump DressUpFrame.ModelScene:GetActiveCamera():GetZoomDistance()
|
||
|
|
:GetZoomDistance()
|
||
|
|
local modelSceneType, cameraIDs, actorIDs = C_ModelInfo.GetModelSceneInfoByID(modelSceneID);
|
||
|
|
playerActor:SetRequestedScale()
|
||
|
|
/run A1:SetRequestedScale(0.65)
|
||
|
|
C_ModelInfo.GetModelSceneActorInfoByID(486)
|
||
|
|
ModelScene:AcquireActor()
|
||
|
|
/run DressUpFrame.ModelScene:InitializeActor(DressUpFrame.ModelScene:GetPlayerActor(), C_ModelInfo.GetModelSceneActorInfoByID(438))
|
||
|
|
/run local a = C_ModelInfo.GetModelSceneActorInfoByID(438);print(a.scriptTag)
|
||
|
|
/run DressUpFrame.ModelScene:CreateActorFromScene(486)
|
||
|
|
/run DressUpFrame.ModelScene:AcquireAndInitializeActor(C_ModelInfo.GetModelSceneActorInfoByID(486))
|
||
|
|
/dump DressUpFrame.ModelScene.actorTemplate ModelSceneActorTemplate
|
||
|
|
ApplyFromModelSceneActorInfo
|
||
|
|
ReleaseAllActors()
|
||
|
|
|
||
|
|
/dump C_TransmogCollection.GetItemInfo(itemID) 171324 118559 Shovel 66602 (return appearanceID, sourceID)
|
||
|
|
2921871 Gillvanas ModelFileID 93312(DisplayID) Finduin 2924741/93311 animation 217
|
||
|
|
A1:SetAnimation(217,1,0.5,0)
|
||
|
|
9331 Gnome
|
||
|
|
/run DressingRoomOverlayFrame.SlotFrame:Hide();
|
||
|
|
|
||
|
|
function DressUpMountLink(link)
|
||
|
|
if( link ) then
|
||
|
|
local mountID = 0;
|
||
|
|
|
||
|
|
local _, _, _, linkType, linkID = strsplit(":|H", link);
|
||
|
|
if linkType == "item" then
|
||
|
|
mountID = C_MountJournal.GetMountFromItem(tonumber(linkID));
|
||
|
|
elseif linkType == "spell" then
|
||
|
|
mountID = C_MountJournal.GetMountFromSpell(tonumber(linkID));
|
||
|
|
end
|
||
|
|
|
||
|
|
if ( mountID ) then
|
||
|
|
return DressUpMount(mountID);
|
||
|
|
end
|
||
|
|
end
|
||
|
|
return false
|
||
|
|
end
|
||
|
|
local speciesID, customName, level, xp, maxXp, displayID, isFavorite, name, icon, petType = C_PetJournal.GetPetInfoByPetID(petID)
|
||
|
|
SpeciesID = C_PetJournal.GetPetInfoByIndex()
|
||
|
|
speciesName, speciesIcon, petType, companionID, tooltipSource, tooltipDescription, isWild, canBattle, isTradeable, isUnique, obtainable, creatureDisplayID = C_PetJournal.GetPetInfoBySpeciesID(speciesID)
|
||
|
|
C_PetJournal.FindPetIDByName()
|
||
|
|
|
||
|
|
local creatureDisplayID, _, _, isSelfMount, _, modelSceneID, animID, spellVisualKitID, disablePlayerMountPreview = C_MountJournal.GetMountInfoExtraByID(mountID); --93202 Hopper
|
||
|
|
local mountActor = frame.ModelScene:GetActorByTag("unwrapped");
|
||
|
|
if mountActor then
|
||
|
|
mountActor:SetModelByCreatureDisplayID(creatureDisplayID); --93202
|
||
|
|
DressUpFrame.ModelScene:AttachPlayerToMount(A2, 91, false, false);
|
||
|
|
DressUpFrame.ModelScene:AttachPlayerToMount(mountActor, animID, isSelfMount, disablePlayerMountPreview);
|
||
|
|
|
||
|
|
local calcMountScale = mountActor:CalculateMountScale(playerActor);
|
||
|
|
local inverseScale = 1 / calcMountScale;
|
||
|
|
playerActor:SetRequestedScale( inverseScale );
|
||
|
|
mountActor:AttachToMount(playerActor, animID, spellVisualKitID);
|
||
|
|
|
||
|
|
actorIDs:
|
||
|
|
[486] = troll-female 0.65 (expected:0.8526)
|
||
|
|
[487] = undead-female
|
||
|
|
[488] = lightforgeddraenei-male
|
||
|
|
[489] = lightforgeddraenei-female
|
||
|
|
[490] = highmountaintauren-male
|
||
|
|
[491] = highmountaintauren-female
|
||
|
|
[492] = zandalaritroll
|
||
|
|
[495] = magharorc-male
|
||
|
|
[497] = kultiran-female
|
||
|
|
[498] = magharorc-female
|
||
|
|
[499] = darkirondwarf-male
|
||
|
|
[500] = worgen-female
|
||
|
|
[501] = draenei-female
|
||
|
|
[494] = kultiran-male
|
||
|
|
[438] player!!!!
|
||
|
|
[449] = tauren-male
|
||
|
|
[450] = gnome
|
||
|
|
[471] = dwarf-male
|
||
|
|
[472] = undead-male
|
||
|
|
[473] = pandaren
|
||
|
|
[474] = worgen-male
|
||
|
|
[475] = draenei-male
|
||
|
|
[484] = tauren-female
|
||
|
|
[483] = orc
|
||
|
|
[477] = goblin-female
|
||
|
|
[476] = goblin-male
|
||
|
|
[485] = troll-male
|
||
|
|
|
||
|
|
|
||
|
|
normalizeScaleAggressiveness
|
||
|
|
A1:CalculateNormalizedScale(0.65)
|
||
|
|
/run MountDressingRoom(307256)
|
||
|
|
|
||
|
|
--Unlisted APIs:
|
||
|
|
ModelSceneActor:
|
||
|
|
SetModelByFileID(fileID [, enableMips])
|
||
|
|
SetModelByCreatureDisplayID()
|
||
|
|
SetAnimation(animation[, variation, animSpeed, timeOffsetSecs])
|
||
|
|
SetSpellVisualKit(spellVisualKitID[, oneShot])
|
||
|
|
|
||
|
|
--]]
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
--[[
|
||
|
|
--For Testing
|
||
|
|
|
||
|
|
function MountDressingRoom(mountSpellID)
|
||
|
|
if not DressingRoomMountModel then
|
||
|
|
DressingRoomMountModel = DressUpFrame.ModelScene:CreateActor();
|
||
|
|
end
|
||
|
|
|
||
|
|
local mountActor = DressingRoomMountModel;
|
||
|
|
local ModelScene = DressUpFrame.ModelScene;
|
||
|
|
local playerActor = ModelScene:GetPlayerActor();
|
||
|
|
|
||
|
|
local mountID = C_MountJournal.GetMountFromSpell(tonumber(mountSpellID));
|
||
|
|
local creatureDisplayID, _, _, isSelfMount, _, modelSceneID, animID, spellVisualKitID, disablePlayerMountPreview = C_MountJournal.GetMountInfoExtraByID(mountID); --93202 Hopper
|
||
|
|
mountActor:SetModelByCreatureDisplayID(creatureDisplayID);
|
||
|
|
|
||
|
|
local calcMountScale = mountActor:CalculateMountScale(playerActor);
|
||
|
|
if false then --Scale down Player
|
||
|
|
local inverseScale = 1 / calcMountScale;
|
||
|
|
playerActor:SetRequestedScale( inverseScale );
|
||
|
|
else --Scale Mount
|
||
|
|
mountActor:SetScale( calcMountScale );
|
||
|
|
end
|
||
|
|
playerActor:SetYaw(0)
|
||
|
|
mountActor:AttachToMount(playerActor, animID, spellVisualKitID);
|
||
|
|
end
|
||
|
|
|
||
|
|
function GetActorScriptTag(actorID)
|
||
|
|
local a = C_ModelInfo.GetModelSceneActorInfoByID(actorID)
|
||
|
|
if a then print(" Tag: "..(a.scriptTag or "N/A") ); end;
|
||
|
|
end
|
||
|
|
|
||
|
|
function GetAllActorScriptTags()
|
||
|
|
local modelSceneID = 290; --DressUpFrame
|
||
|
|
local _, _, actorIDs = C_ModelInfo.GetModelSceneInfoByID(modelSceneID);
|
||
|
|
for k, v in pairs(actorIDs) do
|
||
|
|
print("ID: "..(k or "N/A"));
|
||
|
|
GetActorScriptTag(v);
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function GetDressUpFrameInfo()
|
||
|
|
local ModelScene = DressUpFrame.ModelScene;
|
||
|
|
local camera = ModelScene:GetActiveCamera();
|
||
|
|
local actor = ModelScene:GetPlayerActor();
|
||
|
|
local scale = actor:GetScale();
|
||
|
|
local x, y, z = ModelScene:GetCameraPosition();
|
||
|
|
local cameraDistance = camera:GetZoomDistance();
|
||
|
|
print("Model Scale: "..scale);
|
||
|
|
print(x.."\n"..y.."\n"..z);
|
||
|
|
print("Distance: "..cameraDistance)
|
||
|
|
--/run GetDressUpFrameInfo()
|
||
|
|
end
|
||
|
|
|
||
|
|
function TestActorIDs(begin, ending)
|
||
|
|
local temp;
|
||
|
|
for i = begin, ending do
|
||
|
|
temp = C_ModelInfo.GetModelSceneActorInfoByID(i)
|
||
|
|
if temp and temp.scriptTag then
|
||
|
|
print(i.." Tag: "..temp.scriptTag);
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function GetActorID(RaceName)
|
||
|
|
--Run this when new playable race available
|
||
|
|
local temp, tag;
|
||
|
|
local match1 = RaceName.."-male";
|
||
|
|
local match2 = RaceName.."-female";
|
||
|
|
|
||
|
|
for i = 1, 1500 do
|
||
|
|
temp = C_ModelInfo.GetModelSceneActorInfoByID(i)
|
||
|
|
if temp and temp.scriptTag then
|
||
|
|
tag = temp.scriptTag
|
||
|
|
if tag == match1 or tag == match2 or tag == RaceName then
|
||
|
|
print(i.." "..tag);
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
hooksecurefunc("ChatFrame_DisplayUsageError", function(messageTag)
|
||
|
|
print(messageTag)
|
||
|
|
end)
|
||
|
|
--]]
|
||
|
|
|
||
|
|
--[[
|
||
|
|
function ModelSceneActorMixin:OnModelLoaded()
|
||
|
|
self:MarkScaleDirty();
|
||
|
|
self:SetAlpha(0);
|
||
|
|
After(0, function()
|
||
|
|
if self:IsShown() then
|
||
|
|
print("Loaded")
|
||
|
|
UIFrameFadeIn(self, 0.2, 0, 1)
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
end
|
||
|
|
--]]
|
||
|
|
|
||
|
|
--[[
|
||
|
|
WardrobeCollectionFrame.SetsCollectionFrame:Refresh()
|
||
|
|
|
||
|
|
|
||
|
|
local customSources = {};
|
||
|
|
local CustomSet = {
|
||
|
|
["description"] = "Custom",
|
||
|
|
["label"] = "This Is A Set Description",
|
||
|
|
["hiddenUntilCollected"] = false,
|
||
|
|
["setID"] = 1208001,
|
||
|
|
["expansionID"] = 9,
|
||
|
|
["limitedTimeSet"] = true,
|
||
|
|
["patchID"] = 90000,
|
||
|
|
["classMask"] = 3592,
|
||
|
|
["collected"] = true,
|
||
|
|
["uiOrder"] = 3592,
|
||
|
|
["favorite"] = false,
|
||
|
|
["name"] = "Custom Name",
|
||
|
|
}
|
||
|
|
|
||
|
|
local GetSetInfo = C_TransmogSets.GetSetInfo;
|
||
|
|
local GetBaseSets = C_TransmogSets.GetBaseSets;
|
||
|
|
local GetVariantSets = C_TransmogSets.GetVariantSets;
|
||
|
|
local GetBaseSetID = C_TransmogSets.GetBaseSetID;
|
||
|
|
local GetSetSources = C_TransmogSets.GetSetSources;
|
||
|
|
local GetSourcesForSlot = C_TransmogSets.GetSourcesForSlot;
|
||
|
|
local IsBaseSetCollected = C_TransmogSets.IsBaseSetCollected;
|
||
|
|
|
||
|
|
local function IsSourceCollected(sourceID)
|
||
|
|
return C_TransmogCollection.GetSourceInfo(sourceID) or false
|
||
|
|
end
|
||
|
|
|
||
|
|
function C_TransmogSets.GetSetInfo(setID)
|
||
|
|
if setID < 10000 then
|
||
|
|
return GetSetInfo(setID)
|
||
|
|
else
|
||
|
|
return CustomSet
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function C_TransmogSets.GetVariantSets(setID)
|
||
|
|
if setID < 10000 then
|
||
|
|
return GetVariantSets(setID)
|
||
|
|
else
|
||
|
|
return {}
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function C_TransmogSets.GetBaseSetID(setID)
|
||
|
|
if setID < 10000 then
|
||
|
|
return GetBaseSetID(setID)
|
||
|
|
else
|
||
|
|
return setID
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function C_TransmogSets.GetSetSources(setID)
|
||
|
|
if setID < 10000 then
|
||
|
|
return GetSetSources(setID)
|
||
|
|
else
|
||
|
|
local table = {}
|
||
|
|
for k, v in pairs(customSources) do
|
||
|
|
table[v] = IsSourceCollected(v);
|
||
|
|
end
|
||
|
|
|
||
|
|
return table
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function C_TransmogSets.GetSourcesForSlot(setID, slot)
|
||
|
|
if setID < 10000 then
|
||
|
|
return GetSourcesForSlot(setID, slot)
|
||
|
|
else
|
||
|
|
return {}
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function C_TransmogSets.IsBaseSetCollected(setID)
|
||
|
|
if setID < 10000 then
|
||
|
|
return IsBaseSetCollected(setID)
|
||
|
|
else
|
||
|
|
return true
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function C_TransmogSets.GetBaseSets()
|
||
|
|
local Sets = GetBaseSets();
|
||
|
|
if CustomSet and #customSources ~= 0 then
|
||
|
|
tinsert(Sets, CustomSet);
|
||
|
|
end
|
||
|
|
return Sets
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
hooksecurefunc(C_TransmogCollection, "SaveOutfit", function(name, sourceIDTable, mainHandEnchant, offHandEnchant, icon)
|
||
|
|
print(name);
|
||
|
|
CustomSet.name = name;
|
||
|
|
customSources = sourceIDTable;
|
||
|
|
if WardrobeCollectionFrame then
|
||
|
|
After(0, function()
|
||
|
|
local SetsCollectionFrame = WardrobeCollectionFrame.SetsCollectionFrame;
|
||
|
|
SetsCollectionFrame:Hide();
|
||
|
|
SetsCollectionFrame:Show();
|
||
|
|
end)
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
|
||
|
|
|
||
|
|
/script local n = CreateFromMixins(ItemTransmogInfoMixin); n:Init(146480, 113239);NarciPlayerModelFrame1:SetItemTransmogInfo(n, 3)
|
||
|
|
/script local n = CreateFromMixins(ItemTransmogInfoMixin); n:Init(113239, 146480);NarciPlayerModelFrame1:SetItemTransmogInfo(n, 3)
|
||
|
|
/dump C_TransmogCollection.GetAllAppearanceSources(55699)
|
||
|
|
--]]
|