From 92bafd7b7fd8c566e466dcb4f554ba819895b85a Mon Sep 17 00:00:00 2001 From: Repooc Date: Mon, 17 Mar 2014 23:22:39 -0400 Subject: [PATCH] Some more updates. --- ElvUI_SLE/modules/characterframe/communication.lua | 25 +-- ElvUI_SLE/modules/characterframe/inspectframe.lua | 167 ++++++++++++-------- 2 files changed, 114 insertions(+), 78 deletions(-) diff --git a/ElvUI_SLE/modules/characterframe/communication.lua b/ElvUI_SLE/modules/characterframe/communication.lua index 8ff27a1..f83acf5 100644 --- a/ElvUI_SLE/modules/characterframe/communication.lua +++ b/ElvUI_SLE/modules/characterframe/communication.lua @@ -11,8 +11,7 @@ if not AISM then local playerName = UnitName('player') local playerRealm = GetRealmName() - local playerClass, playerClassID - _, playerClass, playerClassID = UnitClass('player') + local _, playerClass, playerClassID = UnitClass('player') local playerRace, playerRaceID = UnitRace('player') local playerSex = UnitSex('player') local isHelmDisplayed = ShowingHelm() == 1 @@ -25,7 +24,7 @@ if not AISM then AISM.Tooltip:SetOwner(UIParent, 'ANCHOR_NONE') AISM.Updater = CreateFrame('Frame', 'AISM_Updater', UIParent) - AISM.SendMessageDelay = 1 + AISM.SendMessageDelay = 2 AISM.SendDataGroupUpdated = AISM.SendMessageDelay AISM.SendDataGuildUpdated = AISM.SendMessageDelay @@ -451,7 +450,7 @@ if not AISM then if IsInGuild() then TableToSave.GuildInfo = GetGuildLevel()..'/'..GetNumGuildMembers() - for _, DataString in ipairs({ GetGuildLogoInfo(UnitID) }) do + for _, DataString in ipairs({ GetGuildLogoInfo('player') }) do TableToSave.GuildInfo = TableToSave.GuildInfo..'/'..DataString end end @@ -605,14 +604,12 @@ if not AISM then end if self.needSendDataGroup and self.Updater.SpecUpdated and self.Updater.GlyphUpdated and self.Updater.GearUpdated then - print('??') self.SendDataGroupUpdated = self.SendDataGroupUpdated - elapsed if self.SendDataGroupUpdated < 0 then self.SendDataGroupUpdated = self.SendMessageDelay self:SendData(self.PlayerData_ShortString) - print('센드??터') self.needSendDataGroup = nil end end @@ -631,7 +628,6 @@ if not AISM then end if self.needSendDataGroup == nil and self.needSendDataGuild == nil then - print('??') self:Hide() -- close function end end @@ -673,7 +669,13 @@ if not AISM then local needplayerName, needplayerRealm = Message:match('^.+:(.+)-(.+)$') if needplayerName == playerName and needplayerRealm == playerRealm then - local DataToSend = E:CopyTable({}, self.PlayerData) + --local DataToSend = E:CopyTable({}, self.PlayerData) + local TableToSend = {} + + for Index, Data in pairs(self.PlayerData) do + TableToSend[Index] = Data + end + self:SettingInspectData(DataToSend) self:SendData(DataToSend, Prefix, Channel, Sender) @@ -710,7 +712,9 @@ if not AISM then if self.DataTypeTable[DataType] == 'Profession' then if stringTable[1] == 'F' then - TableToSave.Profession[Group] = {} + --TableToSave.Profession[Group] = {} + TableToSave.Profession[Group].Name = EMPTY + TableToSave.Profession[Group].Level = 0 else for localeName, Key in pairs(self.ProfessionList) do if Key == stringTable[1] then @@ -826,9 +830,6 @@ if not AISM then self:GetCurrentInstanceType() isHelmDisplayed = ShowingHelm() == 1 isCloakDisplayed = ShowingCloak() == 1 - - print('HeadSlot : '..(isHelmDisplayed and 'TRUE' or 'False')) - print('BackSlot : '..(isCloakDisplayed and 'TRUE' or 'False')) elseif Event == 'PLAYER_GUILD_UPDATE' then if IsInGuild() then self.needSendDataGuild = true diff --git a/ElvUI_SLE/modules/characterframe/inspectframe.lua b/ElvUI_SLE/modules/characterframe/inspectframe.lua index aa3864a..69178d8 100644 --- a/ElvUI_SLE/modules/characterframe/inspectframe.lua +++ b/ElvUI_SLE/modules/characterframe/inspectframe.lua @@ -55,7 +55,6 @@ KI.Default_CurrentInspectData = { ['Glyph'] = { [1] = {}, [2] = {} }, ['Profession'] = { [1] = {}, [2] = {} } } -KI.Default_ReInspectCount = 2 local function Button_OnEnter(self) self:SetBackdropBorderColor(unpack(E.media.rgbvaluecolor)) @@ -167,23 +166,19 @@ KI.ScrollFrame_OnMouseWheel = function(self, spinning) elseif self.Offset < 0 then self.Offset = 0 end - Page:Point('TOPLEFT', self, 0, self.Offset) - Page:Point('TOPRIGHT', self, 0, self.Offset) else - self.Offset = nil + self.Offset = 0 end + + Page:Point('TOPLEFT', self, 0, self.Offset) + Page:Point('TOPRIGHT', self, 0, self.Offset) end KI.Category_OnClick = function(self) self = self:GetParent() + self.Closed = not self.Closed - if self.IsOpened then - self:Height(INFO_TAB_SIZE + SPACING * 2) - self.IsOpened = nil - else - self:Height(self.CategoryHeight) - self.IsOpened = true - end + KI:ReArrangeCategory() end KI.GemSocket_OnEnter = function(self) @@ -608,61 +603,57 @@ function KI:CreateInspectFrame() self.Info.Page:SetFrameLevel(CoreFrameLevel + 2) self.Info.Page:Point('TOPLEFT', self.Info) self.Info.Page:Point('TOPRIGHT', self.Info, -1, 0) - self.Info.Page:Height(600) - local f for _, CategoryType in pairs(KI.InfoPageCategoryList) do - f = CreateFrame('ScrollFrame', nil, self.Info.Page) - f:SetBackdrop({ + self.Info[CategoryType] = CreateFrame('ScrollFrame', nil, self.Info.Page) + self.Info[CategoryType]:SetBackdrop({ bgFile = E.media.blankTex, edgeFile = E.media.blankTex, tile = false, tileSize = 0, edgeSize = E.mult, insets = { left = 0, right = 0, top = 0, bottom = 0} }) - f:SetBackdropColor(.08, .08, .08, .8) - f:SetBackdropBorderColor(0, 0, 0) - f:Point('LEFT', self.Info.Page) - f:Point('RIGHT', self.Info.Page) - f:Height(INFO_TAB_SIZE + SPACING * 2) - - f.IconSlot = CreateFrame('Frame', nil, f) - f.IconSlot:Size(INFO_TAB_SIZE) - f.IconSlot:SetBackdrop({ + self.Info[CategoryType]:SetBackdropColor(.08, .08, .08, .8) + self.Info[CategoryType]:SetBackdropBorderColor(0, 0, 0) + self.Info[CategoryType]:Point('LEFT', self.Info.Page) + self.Info[CategoryType]:Point('RIGHT', self.Info.Page) + self.Info[CategoryType]:Height(INFO_TAB_SIZE + SPACING * 2) + + self.Info[CategoryType].IconSlot = CreateFrame('Frame', nil, self.Info[CategoryType]) + self.Info[CategoryType].IconSlot:Size(INFO_TAB_SIZE) + self.Info[CategoryType].IconSlot:SetBackdrop({ bgFile = E.media.blankTex, edgeFile = E.media.blankTex, tile = false, tileSize = 0, edgeSize = E.mult, insets = { left = 0, right = 0, top = 0, bottom = 0} }) - f.IconSlot:Point('TOPLEFT', f, SPACING, -SPACING) - f.Icon = f.IconSlot:CreateTexture(nil, 'OVERLAY') - f.Icon:SetTexCoord(unpack(E.TexCoords)) - f.Icon:SetInside() - - f.Tab = CreateFrame('Frame', nil, f) - f.Tab:Point('TOPLEFT', f.IconSlot, 'TOPRIGHT', 1, 0) - f.Tab:Point('BOTTOMRIGHT', f, 'TOPRIGHT', -SPACING, -(SPACING + INFO_TAB_SIZE)) - f.Tab:SetBackdrop({ + self.Info[CategoryType].IconSlot:Point('TOPLEFT', self.Info[CategoryType], SPACING, -SPACING) + self.Info[CategoryType].Icon = self.Info[CategoryType].IconSlot:CreateTexture(nil, 'OVERLAY') + self.Info[CategoryType].Icon:SetTexCoord(unpack(E.TexCoords)) + self.Info[CategoryType].Icon:SetInside() + + self.Info[CategoryType].Tab = CreateFrame('Frame', nil, self.Info[CategoryType]) + self.Info[CategoryType].Tab:Point('TOPLEFT', self.Info[CategoryType].IconSlot, 'TOPRIGHT', 1, 0) + self.Info[CategoryType].Tab:Point('BOTTOMRIGHT', self.Info[CategoryType], 'TOPRIGHT', -SPACING, -(SPACING + INFO_TAB_SIZE)) + self.Info[CategoryType].Tab:SetBackdrop({ bgFile = E.media.normTex, edgeFile = E.media.blankTex, tile = false, tileSize = 0, edgeSize = E.mult, insets = { left = 0, right = 0, top = 0, bottom = 0} }) - f.Tooltip = CreateFrame('Button', nil, f) - f.Tooltip:Point('TOPLEFT', f.Icon) - f.Tooltip:Point('BOTTOMRIGHT', f.Tab) - f.Tooltip:SetFrameLevel(CoreFrameLevel + 4) - f.Tooltip:SetScript('OnClick', KI.Category_OnClick) - - C.Toolkit.TextSetting(f.Tab, CategoryType, { ['FontSize'] = 10 }, 'LEFT', 6, 1) + self.Info[CategoryType].Tooltip = CreateFrame('Button', nil, self.Info[CategoryType]) + self.Info[CategoryType].Tooltip:Point('TOPLEFT', self.Info[CategoryType].Icon) + self.Info[CategoryType].Tooltip:Point('BOTTOMRIGHT', self.Info[CategoryType].Tab) + self.Info[CategoryType].Tooltip:SetFrameLevel(CoreFrameLevel + 4) + self.Info[CategoryType].Tooltip:SetScript('OnClick', KI.Category_OnClick) - f.Page = CreateFrame('Frame', nil, f) - f:SetScrollChild(f.Page) - f.Page:SetFrameLevel(CoreFrameLevel + 2) - f.Page:Point('TOPLEFT', f.Icon, 'BOTTOMLEFT', 0, -SPACING) - f.Page:Point('BOTTOMRIGHT', f, -SPACING, SPACING) + C.Toolkit.TextSetting(self.Info[CategoryType].Tab, CategoryType, { ['FontSize'] = 10 }, 'LEFT', 6, 1) - self.Info[CategoryType] = f + self.Info[CategoryType].Page = CreateFrame('Frame', nil, self.Info[CategoryType]) + self.Info[CategoryType]:SetScrollChild(self.Info[CategoryType].Page) + self.Info[CategoryType].Page:SetFrameLevel(CoreFrameLevel + 2) + self.Info[CategoryType].Page:Point('TOPLEFT', self.Info[CategoryType].Icon, 'BOTTOMLEFT', 0, -SPACING) + self.Info[CategoryType].Page:Point('BOTTOMRIGHT', self.Info[CategoryType], -SPACING, SPACING) end do -- Profession Part @@ -701,7 +692,6 @@ function KI:CreateInspectFrame() self.Info.Profession['Prof'..i].Bar:SetInside() self.Info.Profession['Prof'..i].Bar:SetStatusBarTexture(E.media.normTex) self.Info.Profession['Prof'..i].Bar:SetMinMaxValues(0, 600) - self.Info.Profession['Prof'..i].Bar:SetValue(100) C.Toolkit.TextSetting(self.Info.Profession['Prof'..i], '257', { ['Tag'] = 'Level', ['FontSize'] = 10 }, 'TOP', self.Info.Profession['Prof'..i].Icon) self.Info.Profession['Prof'..i].Level:Point('RIGHT', self.Info.Profession['Prof'..i].Bar) @@ -713,41 +703,40 @@ function KI:CreateInspectFrame() self.Info.Profession.Prof1:Point('TOPLEFT', self.Info.Profession.Page, 6, -8) self.Info.Profession.Prof2:Point('TOPLEFT', self.Info.Profession.Page, 'TOP', 6, -8) - - self.Info.Profession:Point('TOP', self.Info.Page) end do -- PvP Category self.Info.PvP.CategoryHeight = 100 self.Info.PvP.Icon:SetTexture('Interface\\Icons\\achievement_bg_killxenemies_generalsroom') - self.Info.PvP:Point('TOP', self.Info.Profession, 'BOTTOM', 0, -SPACING * 2) end do -- Guild Category self.Info.Guild.CategoryHeight = INFO_TAB_SIZE + 66 + SPACING * 3 self.Info.Guild.Icon:SetTexture(GetSpellTexture(83968)) - self.Info.Guild.BG = self.Info.Guild.Page:CreateTexture(nil, 'BACKGROUND') + self.Info.Guild.Banner = CreateFrame('Frame', nil, self.Info.Guild.Page) + self.Info.Guild.Banner:SetInside() + self.Info.Guild.Banner:SetFrameLevel(CoreFrameLevel + 3) + + self.Info.Guild.BG = self.Info.Guild.Banner:CreateTexture(nil, 'BACKGROUND') self.Info.Guild.BG:Size(33, 44) self.Info.Guild.BG:SetTexCoord(.00781250, .32812500, .01562500, .84375000) self.Info.Guild.BG:SetTexture('Interface\\GuildFrame\\GuildDifficulty') self.Info.Guild.BG:Point('TOP', self.Info.Guild.Page, 0, -1) - self.Info.Guild.Border = self.Info.Guild.Page:CreateTexture(nil, 'ARTWORK') + self.Info.Guild.Border = self.Info.Guild.Banner:CreateTexture(nil, 'ARTWORK') self.Info.Guild.Border:Size(33, 44) self.Info.Guild.Border:SetTexCoord(.34375000, .66406250, .01562500, .84375000) self.Info.Guild.Border:SetTexture('Interface\\GuildFrame\\GuildDifficulty') self.Info.Guild.Border:Point('CENTER', self.Info.Guild.BG) - self.Info.Guild.Emblem = self.Info.Guild.Page:CreateTexture(nil, 'OVERLAY') + self.Info.Guild.Emblem = self.Info.Guild.Banner:CreateTexture(nil, 'OVERLAY') self.Info.Guild.Emblem:Size(16) self.Info.Guild.Emblem:SetTexture('Interface\\GuildFrame\\GuildEmblems_01') self.Info.Guild.Emblem:Point('CENTER', self.Info.Guild.BG, 0, 2) - C.Toolkit.TextSetting(self.Info.Guild.Page, nil, { ['Tag'] = 'Name', ['FontSize'] = 14 }, 'TOP', self.Info.Guild.BG, 'BOTTOM', 0, 7) - C.Toolkit.TextSetting(self.Info.Guild.Page, nil, { ['Tag'] = 'LevelMembers', ['FontSize'] = 9 }, 'TOP', self.Info.Guild.Page.Name, 'BOTTOM', 0, -2) - - self.Info.Guild:Point('TOP', self.Info.PvP, 'BOTTOM', 0, -SPACING * 2) + C.Toolkit.TextSetting(self.Info.Guild.Banner, nil, { ['Tag'] = 'Name', ['FontSize'] = 14 }, 'TOP', self.Info.Guild.BG, 'BOTTOM', 0, 7) + C.Toolkit.TextSetting(self.Info.Guild.Banner, nil, { ['Tag'] = 'LevelMembers', ['FontSize'] = 9 }, 'TOP', self.Info.Guild.Banner.Name, 'BOTTOM', 0, -2) end end @@ -1097,10 +1086,8 @@ function KI:CreateInspectFrame() return true end end, TableIndex, true) - print('전송') SendAddonMessage('AISM_Inspect', 'AISM_DataRequestForInspecting:'..Name..'-'..Realm, SendChannel, TableIndex) elseif Unit then - print('직접 살펴보기') KI.InspectUnit(Unit) end end @@ -1644,14 +1631,32 @@ function KI:InspectFrame_DataSetting(DataTable) end do --<< Information Page Setting >>-- - if DataTable.guildName and DataTable.guildLevel and DataTable.guildNumMembers then - self.Info.Guild:Show() - self.Info.Guild.Page.Name:SetText('|cff2eb7e4'..DataTable.guildName) - self.Info.Guild.Page.LevelMembers:SetText('|cff77c0ff'..DataTable.guildLevel..'|r '..LEVEL..(DataTable.guildNumMembers > 0 and ' / '..format(INSPECT_GUILD_NUM_MEMBERS:gsub('%%d', '%%s'), '|cff77c0ff'..DataTable.guildNumMembers..'|r ') or '')) - SetSmallGuildTabardTextures('player', self.Info.Guild.Emblem, self.Info.Guild.BG, self.Info.Guild.Border, DataTable.guildEmblem) - else - self.Info.Guild:Hide() + do -- Profession + for i = 1, 2 do + if DataTable.Profession[i].Name then + self.Info.Profession:Show() + self.Info.Profession['Prof'..i].Name:SetText(DataTable.Profession[i].Name) + self.Info.Profession['Prof'..i].Level:SetText(DataTable.Profession[i].Level) + self.Info.Profession['Prof'..i].Bar:SetValue(DataTable.Profession[i].Level) + else + self.Info.Profession:Hide() + break + end + end + end + + do -- Guild + if DataTable.guildName and DataTable.guildLevel and DataTable.guildNumMembers then + self.Info.Guild:Show() + self.Info.Guild.Banner.Name:SetText('|cff2eb7e4'..DataTable.guildName) + self.Info.Guild.Banner.LevelMembers:SetText('|cff77c0ff'..DataTable.guildLevel..'|r '..LEVEL..(DataTable.guildNumMembers > 0 and ' / '..format(INSPECT_GUILD_NUM_MEMBERS:gsub('%%d', '%%s'), '|cff77c0ff'..DataTable.guildNumMembers..'|r ') or '')) + SetSmallGuildTabardTextures('player', self.Info.Guild.Emblem, self.Info.Guild.BG, self.Info.Guild.Border, DataTable.guildEmblem) + else + self.Info.Guild:Hide() + end end + + KI:ReArrangeCategory() end do --<< Specialization Page Setting >>-- @@ -1753,6 +1758,36 @@ function KI:InspectFrame_DataSetting(DataTable) self.LastDataSetting = DataTable.Name..(DataTable.Realm and '-'..DataTable.Realm or '') end +function KI:ReArrangeCategory() + local InfoPage_Height = 0 + local PrevCategory + + for _, CategoryType in pairs(self.InfoPageCategoryList) do + if self.Info[CategoryType]:IsShown() then + if self.Info[CategoryType].Closed then + InfoPage_Height = InfoPage_Height + INFO_TAB_SIZE + SPACING * 2 + self.Info[CategoryType]:Height(INFO_TAB_SIZE + SPACING * 2) + else + InfoPage_Height = InfoPage_Height + self.Info[CategoryType].CategoryHeight + self.Info[CategoryType]:Height(self.Info[CategoryType].CategoryHeight) + end + + if PrevCategory then + InfoPage_Height = InfoPage_Height + SPACING * 2 + self.Info[CategoryType]:Point('TOP', PrevCategory, 'BOTTOM', 0, -SPACING * 2) + else + self.Info[CategoryType]:Point('TOP', self.Info.Page) + end + + PrevCategory = self.Info[CategoryType] + end + end + + self.Info.Page:Height(InfoPage_Height) + self.ScrollFrame_OnMouseWheel(self.Info, 0) +end + + function KI:ToggleSpecializationTab(Group, DataTable) local r, g, b self.LastActiveSpec = DataTable.Specialization.ActiveSpec or 1 -- 1.7.9.5