魔兽插件吧 关注:30,394贴子:83,211

[转]OUF头像编辑设定及DIY研究

只看楼主收藏回复

OUF头像编辑设定及DIY研究
原文地址:http://wowskinui.com/article/84/140.html
- Configuration - font, fontsize and textures --材质和字体大小等设置
-- ------------------------------------------------------------------------
local font = "Interface\\AddOns\\oUF_Asym\\fonts\\XXXX.ttf" -- 字体设置,修改成自己喜欢的字体所在路径。或把喜欢的字体重命名替换
local fontsize = 12 -- default 12 --字体大小(除了施法条以外的字号)默认为12
local fontsizeCB = 12 -- castbar fontsize --施法条的字体大小,默认为12
local bartex = "Interface\\AddOns\\oUF_Asym\\textures\\dm" -- change bar texture here --头像的背景框,默认是dm,可以自己去该文件夹查看图片并替换成自己喜欢的
local castbartex = "Interface\\AddOns\\oUF_Asym\\textures\\dm" -- change castbar texture here --施法条的背景框材质,默认是dm
local bufftex = "Interface\\AddOns\\oUF_Asym\\textures\\border1" -- change buff/debuff border texture here --buff和debuff的背景框材质
local playerClass = select(2, UnitClass("player"))
local PorBG = "Interface\\AddOns\\oUF_Asym\\textures\\Border4.tga" -- change target portait background texture here --头像材质
local frameborder = "Interface\\AddOns\\oUF_Asym\\textures\\frameborder4.tga" --边框材质
local borderDebuffHigh = "Interface\\AddOns\\oUF_Asym\\textures\\frameborder4large.tga" --debuff边框高亮材质
-- color and alpha for frameborders --背景框色调和透明度设置,一般不用改
local color_rb = 0.40 -- default 0.00
local color_gb = 0.40 -- default 0.00
local color_bb = 0.40 -- default 0.00
local alpha_fb = 0.80 -- default 0.35
-- Castbar position for player and target --施法条的位置
local playerCB_x = 0 --自己施法条的横坐标
local playerCB_y = -265 --自己施法条的纵坐标
local targetCB_x = 270 --目标施法条的横坐标
local targetCB_y = -152 --目标施法条的纵坐标
-- Portraits --小队和团队头像开关
-- enable/disable party portrait -- 0 = disable, 1 = enable
local partyport = 1 --是否显示小队头像,1开0闭
-- enable/disable raid portrait -- 0 = disable, 1 = enable
local raidport = 0 -- disabled by default --是否显示团队头像,1开0闭
-- ------------------------------------------------------------------------
-- End of Configuration
-- ------------------------------------------------------------------------
-- local background --头像背景透明度设置
-- ------------------------------------------------------------------------
local backdrop = {
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
insets = {top = -1, left = -1, bottom = -1, right = -1},
}
-- ------------------------------------------------------------------------
-- change some colors :)
-- ------------------------------------------------------------------------
oUF.colors.happiness = {
[1] = {182/225, 34/255, 32/255}, -- unhappy --不开心的颜色
[2] = {220/225, 180/225, 52/225}, -- content --普通状态的颜色
[3] = {143/255, 194/255, 32/255}, -- happy --开心的颜色
}
local corb = 1
local cogb = 0
local cobb = 0



IP属地:新疆1楼2011-05-09 23:34回复
    -- ------------------------------------------------------------------------
    -- right click
    -- ------------------------------------------------------------------------
    local menu = function(self)
    local unit = self.unit:sub(1, -2)
    local cunit = self.unit:gsub("(.)", string.upper, 1)
    if(unit == "party" or unit == "partypet") then
       ToggleDropDownMenu(1, nil, _G["PartyMemberFrame"..self.id.."DropDown"], "cursor", 0, 0)
    elseif(_G[cunit.."FrameDropDown"]) then
       ToggleDropDownMenu(1, nil, _G[cunit.."FrameDropDown"], "cursor", 0, 0)
    end
    end
    -- ------------------------------------------------------------------------
    -- reformat everything above 9999, i.e. 10000 -> 10k --血条数值设置
    -- ------------------------------------------------------------------------
    local numberize = function(v)
    if v <= 99999 then return v end --生命在10万以内,不会科学计数
    if v >= 1000000 then
       local value = string.format("%.1fm", v/1000000)
       return value
    elseif v >= 100000 then --生命大于10万时,才会科学计数
       local value = string.format("%.1fk", v/1000)
       return value
    end
    end
    -- ------------------------------------------------------------------------
    -- level update --等级设置
    -- ------------------------------------------------------------------------
    local updateLevel = function(self, unit, name)
    local lvl = UnitLevel(unit)
    local typ = UnitClassification(unit)
    local color = GetDifficultyColor(lvl)
    if lvl <= 0 then lvl = "??" end
    if typ=="worldboss" then
        self.Level:SetText("|cffff0000"..lvl.."b|r")
    elseif typ=="rareelite" then
        self.Level:SetText(lvl.."r+")
       self.Level:SetTextColor(color.r, color.g, color.b)
    elseif typ=="elite" then
        self.Level:SetText(lvl.."+")
       self.Level:SetTextColor(color.r, color.g, color.b)
    elseif typ=="rare" then
       self.Level:SetText(lvl.."r")
       self.Level:SetTextColor(color.r, color.g, color.b)
    else
       if UnitIsConnected(unit) == nil then
    self.Level:SetText("??")
       else
    self.Level:SetText(lvl)
       end
       if(not UnitIsPlayer(unit)) then
    self.Level:SetTextColor(color.r, color.g, color.b)
       else
    local _, class = UnitClass(unit)
    color = self.colors.class[class]
    self.Level:SetTextColor(color[1], color[2], color[3])
       end
    end
    end
    -- ------------------------------------------------------------------------
    -- name update --角色名设置
    -- ------------------------------------------------------------------------
    local updateName = function(self, event, unit)
    if(self.unit ~= unit) then return end
    local name = UnitName(unit)self.Name:SetText(string.lower(name):sub(1, 30, nil)) -- only use lower case for names, truncate to 17 for Oksana, 20 for Santana, 30 for Roadway
    if unit=="targettarget" then
    


    IP属地:新疆2楼2011-05-09 23:35
    回复
      2025-06-09 04:15:34
      广告
         local totName = UnitName(unit)
         local pName = UnitName("player")
         if totName==pName then
      self.Name:SetTextColor(0.9, 0.5, 0.2) 这里说下颜色,由于BLZ的颜色范围是0-1 ,所以RGB 红绿蓝三通道的数值都除以255就可以了
         else
      self.Name:SetTextColor(1,1,1)
         end
      else
         self.Name:SetTextColor(1,1,1)
      end
      if unit=="target" then   -- Show level value on targets only 如果鼠标指向为目标时,只在目标上显示等级,玩家头像不显示
         updateLevel(self, unit, name)
      end
      end
      -- ------------------------------------------------------------------------
      -- health update --生命条的设置
      -- ------------------------------------------------------------------------
      local updateHealth = function(self, event, unit, bar, min, max)
      local cur, maxhp = min, max
      local d = floor(cur/maxhp*100)
      if(UnitIsDead(unit) or UnitIsGhost(unit)) then
         bar:SetValue(0)
         bar.value:SetText"dead"
      elseif(not UnitIsConnected(unit)) then
         bar.value:SetText"D/C"
      elseif(unit == "player") then
         if(min ~= max) then
      bar.value:SetText("|cff33EE44"..numberize(cur) .."|r-".. d.."%")
         else
      bar.value:SetText("|cff33EE44"..numberize(cur) .."|r") --满血也显示自己生命值
         end
      elseif(unit == "targettarget") then
         bar.value:SetText(d.."%")
      elseif(unit == "target") then
         if(d < 100) then
      bar.value:SetText("|cff33EE44"..numberize(cur).."|r-"..d.."%")
         else
      bar.value:SetText("|cff33EE44"..numberize(cur) .."|r") --同上,可以满血也显示目标生命值
         end
      elseif(min == max) then
             if unit == "pet" then
      bar.value:SetText("|cff33EE44"..numberize(cur) .."|r") -- just here if otherwise wanted --同上,显示BB血量,也可以改为显示BB名字
      else
      bar.value:SetText("|cff33EE44"..numberize(cur) .."|r")
         end
      else
             if((max-min) < max) then
      if unit == "pet" then
      bar.value:SetText("|cff33EE44"..numberize(cur) .."|r-".. d.."%") -- just here if otherwise wanted
      else
      bar.value:SetText("-"..maxhp-cur) -- just here if otherwise wanted
      end
          end
      end
      self:UNIT_NAME_UPDATE(event, unit)
      end
      


      IP属地:新疆3楼2011-05-09 23:35
      回复
        -- druid mana (fixed alpha settings) --XD蓝条设置参数
        -- ------------------------------------------------------------------------
        local function UpdateDruidPower(self)
        local ptype = UnitPowerType("player")
        if(ptype ~= 0) then
           local min = UnitPower("player",0)
           local max = UnitPowerMax("player",0)
           self.DruidPower:SetMinMaxValues(0, max)
           self.DruidPower:SetValue(min)
           self.DruidPower:SetStatusBarColor(unpack(self.colors.power["MANA"]))
           self.DruidPower.value:SetText(min.." . "..max)
           self.DruidPower.percent:SetText(floor(min / max * 100).."%") 文本格式
           if(min ~= max) then
        self.DruidPower:SetMinMaxValues(0, max)
        self.DruidPower:SetValue(min)
        self.DruidPower:SetAlpha(0.8)
           else
        self.DruidPower:SetAlpha(0)
           end
        else
           local min = UnitPower("player",3)
           local max = UnitPowerMax("player",3)
           self.DruidPower:SetStatusBarColor(unpack(self.colors.power["ENERGY"]))
           self.DruidPower.value:SetText()
           self.DruidPower.percent:SetText()
           self.DruidPower:SetAlpha(0)
        end
        end
        -- ------------------------------------------------------------------------
        -- power update --法力,能量、怒气的设置
        -- ------------------------------------------------------------------------
        local updatePower = function(self, event, unit, bar, min, max)
        if UnitIsPlayer(unit)==nil then
           bar.value:SetText()
        else
           local _, ptype = UnitPowerType(unit)
           local color = oUF.colors.power[ptype]
           if(min==0) then
        bar.value:SetText()
           elseif(UnitIsDead(unit) or UnitIsGhost(unit)) then
        bar:SetValue(0)
           elseif(not UnitIsConnected(unit)) then
        bar.value:SetText()
           elseif unit=="player" then
        if((max-min) > 0) then
                        bar.value:SetText(min)
        if color then
            bar.value:SetTextColor(color[1], color[2], color[3])
        else
            bar.value:SetTextColor(0.2, 0.66, 0.93)   RGB代码,可自行替换其他颜色
        end
        elseif(min==max) then
        bar.value:SetText(min) --始终显示法力、能量、怒气值
              else
        bar.value:SetText(min)
        if color then
            bar.value:SetTextColor(color[1], color[2], color[3])
        else
            bar.value:SetTextColor(0.2, 0.66, 0.93)
        end
        end
              else
        if((max-min) > 0) then
        bar.value:SetText(min)
        if color then
            bar.value:SetTextColor(color[1], color[2], color[3])


        IP属地:新疆4楼2011-05-09 23:36
        回复
          local TopEdge = self:CreateTexture(nil, "OVERLAY")
          TopEdge:SetTexture(frameborder)
          TopEdge:SetTexCoord(1/3, 2/3, 0, 1/3)
          TopEdge:SetPoint("TOPLEFT", TopLeft, "TOPRIGHT")
          TopEdge:SetPoint("TOPRIGHT", TopRight, "TOPLEFT")
          TopEdge:SetHeight(14)
          TopEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
          local BottomEdge = self:CreateTexture(nil, "OVERLAY")
          BottomEdge:SetTexture(frameborder)
          BottomEdge:SetTexCoord(1/3, 2/3, 2/3, 1)
          BottomEdge:SetPoint("BOTTOMLEFT", BottomLeft, "BOTTOMRIGHT")
          BottomEdge:SetPoint("BOTTOMRIGHT", BottomRight, "BOTTOMLEFT")
          BottomEdge:SetHeight(14)
          BottomEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
          local LeftEdge = self:CreateTexture(nil, "OVERLAY")
          LeftEdge:SetTexture(frameborder)
          LeftEdge:SetTexCoord(0, 1/3, 1/3, 2/3)
          LeftEdge:SetPoint("TOPLEFT", TopLeft, "BOTTOMLEFT")
          LeftEdge:SetPoint("BOTTOMLEFT", BottomLeft, "TOPLEFT")
          LeftEdge:SetWidth(14)
          LeftEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
          local RightEdge = self:CreateTexture(nil, "OVERLAY")
          RightEdge:SetTexture(frameborder)
          RightEdge:SetTexCoord(2/3, 1, 1/3, 2/3)
          RightEdge:SetPoint("TOPRIGHT", TopRight, "BOTTOMRIGHT")
          RightEdge:SetPoint("BOTTOMRIGHT", BottomRight, "TOPRIGHT")
          RightEdge:SetWidth(14)
          RightEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
          --
          -- healthbar
          --
          self.Health = CreateFrame"StatusBar"
          self.Health:SetHeight(12) -- custom height used for partytargets/pets
          self.Health:SetStatusBarTexture(bartex)
          self.Health:SetParent(self)
          self.Health:SetPoint"TOP"
          self.Health:SetPoint"LEFT"
          self.Health:SetPoint"RIGHT"
          self.Health.frequentUpdates = true
          --
          -- healthbar background
          --
          self.Health.bg = self.Health:CreateTexture(nil, "BORDER")
          self.Health.bg:SetAllPoints(self.Health)
          self.Health.bg:SetTexture(bartex)
          self.Health.bg:SetAlpha(0.30)
          --
          -- healthbar text
          --
          self.Health.value = self.Health:CreateFontString(nil, "OVERLAY")
          self.Health.value:SetPoint("RIGHT", self.Health, -2, 2)
          self.Health.value:SetFont(font, fontsize, "OUTLINE")
          self.Health.value:SetTextColor(1,1,1)
          self.Health.value:SetShadowOffset(1, -1)
          --
          -- healthbar functions
          --
          self.Health.colorClass = true
          self.Health.colorReaction = true
          self.Health.colorDisconnected = true
          self.Health.colorTapping = true
          self.PostUpdateHealth = updateHealth -- let the colors be
          --
          -- powerbar
          --
          self.Power = CreateFrame"StatusBar"
          self.Power:SetHeight(3) -- custom height used for partytargets/pets
          self.Power:SetStatusBarTexture(bartex)
          self.Power:SetParent(self)
          self.Power:SetPoint"LEFT"
          self.Power:SetPoint"RIGHT"
          self.Power:SetPoint("TOP", self.Health, "BOTTOM", 0, -1.45) -- Little offset to make it pretty
          self.Power.frequentUpdates = true


          IP属地:新疆6楼2011-05-09 23:37
          回复
            --
            -- powerbar background
            --
            self.Power.bg = self.Power:CreateTexture(nil, "BORDER")
            self.Power.bg:SetAllPoints(self.Power)
            self.Power.bg:SetTexture(bartex)
            self.Power.bg:SetAlpha(0.30)
            --
            -- powerbar text
            --
            self.Power.value = self.Power:CreateFontString(nil, "OVERLAY")
            self.Power.value:SetPoint("RIGHT", self.Health.value, "BOTTOMRIGHT", 0, -5) -- powerbar text in health box
            self.Power.value:SetFont(font, fontsize, "OUTLINE")
            self.Power.value:SetTextColor(1,1,1)
            self.Power.value:SetShadowOffset(1, -1)
            self.Power.value:Hide()
            --
            -- powerbar functions
            --
            self.Power.colorTapping = true
            self.Power.colorDisconnected = true
            self.Power.colorClass = true
            self.Power.colorPower = true
            self.Power.colorHappiness = false
            self.PostUpdatePower = updatePower -- let the colors be
            --
            -- names
            --
            self.Name = self.Health:CreateFontString(nil, "OVERLAY")
            self.Name:SetPoint("LEFT", self, 0, 9)
            self.Name:SetJustifyH"LEFT"
            self.Name:SetFont(font, fontsize, "OUTLINE")
            self.Name:SetShadowOffset(1, -1)
            self.UNIT_NAME_UPDATE = updateName
            --
            -- level
            --
            self.Level = self.Health:CreateFontString(nil, "OVERLAY")
            self.Level:SetPoint("LEFT", self.Health, 0, 9)
            self.Level:SetJustifyH("LEFT")
            self.Level:SetFont(font, fontsize, "OUTLINE")
            self.Level:SetTextColor(1,1,1)
            self.Level:SetShadowOffset(1, -1)
            self.UNIT_LEVEL = updateLevel
            -- ------------------------------------
            -- oUF_SpellRange fading and oUF_Smooth support for all frames
            -- ------------------------------------
               if(unit) or (self:GetParent():GetName():match"oUF_Raid") or (self:GetParent():GetName():match"oUF_Party") then
               self.SpellRange = true; -- fadeout if units are out of range
               self.inRangeAlpha = 1.0; -- Frame alpha when in range
               self.outsideRangeAlpha = 0.6; -- 超出距离的边框透明度
               self.Power.Smooth = true
               self.Health.Smooth = true
               end
            -- ------------------------------------
            -- Hide Portrait for units that are disconnected, don't exist or are not visible (out of range)
            -- ------------------------------------
            local HidePortrait = function(self, unit)
               if (self.unit == 'target' or (self:GetParent():GetName():match"oUF_Party")) then
            if (not UnitExists(self.unit) or not UnitIsConnected(self.unit) or not UnitIsVisible(self.unit)) then
            self.Portrait:SetAlpha(0)
            else
            self.Portrait:SetAlpha(1)
            end
               elseif (self.unit == 'player' or (self:GetParent():GetName():match"oUF_Raid")) then
            if (not UnitExists(self.unit) or not UnitIsConnected(self.unit) or not UnitIsVisible(self.unit)) then
            self.Portrait:SetAlpha(0)
            else
            self.Portrait:SetAlpha(0.3) -- 小队在团队中的透明度
            end
               end
            end


            IP属地:新疆7楼2011-05-09 23:37
            回复
              -- oUF_DebuffHighlight support - border highlight debuff边框高亮设置
              -- ------------------------------------
              if unit=="player" or unit=="target" or unit=="pet" or (self:GetParent():GetName():match"oUF_Party") then
                 self.DebuffHighlight = self:CreateTexture(nil, "OVERLAY")
                 self.DebuffHighlight:SetPoint("TOPLEFT",self,"TOPLEFT",-6,6)
                 self.DebuffHighlight:SetPoint("BOTTOMRIGHT",self,"BOTTOMRIGHT",6,-6)
                 self.DebuffHighlight:SetTexture(borderDebuffHigh)
                 self.DebuffHighlight:SetVertexColor(0, 0, 0, 0)
                 self.DebuffHighlight:SetBlendMode("BLEND")
                 self.DebuffHighlightAlpha = 0.8
                 self.DebuffHighlightFilter = true
              elseif(self:GetParent():GetName():match"oUF_Raid") then
                 self.DebuffHighlight = self:CreateTexture(nil, "OVERLAY")
                 self.DebuffHighlight:SetPoint("TOPLEFT",self,"TOPLEFT",-6,6)
                 self.DebuffHighlight:SetPoint("BOTTOMRIGHT",self,"BOTTOMRIGHT",6,-6)
                 self.DebuffHighlight:SetTexture(frameborder)
                 self.DebuffHighlight:SetVertexColor(0, 0, 0, 0)
                 self.DebuffHighlight:SetBlendMode("BLEND")
                 self.DebuffHighlightAlpha = 0.8
                 self.DebuffHighlightFilter = true
              end
              -- ------------------------------------
              -- player --玩家设置
              -- ------------------------------------
              if unit=="player" then
                 self:SetWidth(250) --头像长度
                     self:SetHeight(42) --头像高度
                 self.Health:SetHeight(15) --血条高度
                 self.Name:Hide() --姓名显示(隐藏),显示改为Show()
                 self.Health.value:SetPoint("RIGHT", 0, 9) 生命条位置
                 self.Power:SetHeight(5) --蓝条高度
                 self.Power.value:Show()
                 self.Power.value:SetPoint("LEFT", self.Health, 0, 9)
                 self.Power.value:SetJustifyH"LEFT"
                 self.Level:Hide() --等级显示(隐藏),显示改为Show()
                 self.Power:SetAlpha(1.0) --透明度
                 self.Health:SetAlpha(1.0) --透明度
                 self.Power:SetPoint("TOP", self.Health, "BOTTOM", 0, -22) --蓝条位置,如果自己添加2D 或者3D头像,可添加这句,具体数值由添加的头像高度决定
              --
                 -- Portrait --添加的玩家3D头像
                 --
                 local portrait = CreateFrame("PlayerModel", nil, self)
                 portrait:SetScript("OnShow", function(self) self:SetCamera(0) end)
                 portrait:SetWidth(250) --头像宽度
                 portrait:SetHeight(20) --头像高度
                 portrait:SetPoint("TOPLEFT", self.Health, "BOTTOMLEFT", 0, -1) --头像位置,TOPLEFT指3d头像左上角,self.Health指自己的血条,BOTTOMLEFT指自己血条底部左下角
                 portrait.type = "3D" 头像类型


              IP属地:新疆8楼2011-05-09 23:38
              回复
                   self.Portrait = portrait
                   portrait:SetFrameLevel(0)
                --
                   -- oUF_Banzai - ignore aggro coloring for player - uncomment this if you want aggro coloring on your player frame
                   --
                   self.ignoreBanzai = true
                   --
                   -- resting icon --休息标识(zzZ)
                   --
                   self.Resting = self.Health:CreateTexture(nil, 'OVERLAY') --素材无
                   self.Resting:SetHeight(14) --标识的高度
                   self.Resting:SetWidth(14) --标识的宽度
                   self.Resting:SetPoint('BOTTOMLEFT', self, 2, 6) --标识的位置
                   self.Resting:SetTexture('Interface\\CharacterFrame\\UI-StateIcon')
                   self.Resting:SetTexCoord(0,0.5,0,0.5)
                   --
                   -- Druid Mana --XD蓝条相关设置
                   --
                   if playerClass=="DRUID" then
                self.DruidPower = CreateFrame"StatusBar"
                self.DruidPower:SetStatusBarTexture(bartex)
                self.DruidPower:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -14)
                self.DruidPower:SetHeight(8)
                self.DruidPower:SetWidth(225)
                self.DruidPower.Smooth = true
                self.DruidPower.bg = self.DruidPower:CreateTexture(nil, "BORDER")
                self.DruidPower.bg:SetAllPoints(self.DruidPower)
                self.DruidPower.bg:SetTexture(bartex)
                self.DruidPower.bg:SetAlpha(0.30)
                self.DruidPower.value = self.DruidPower:CreateFontString(nil, "OVERLAY")
                self.DruidPower.value:SetPoint("LEFT", self.DruidPower, 2, 0)
                self.DruidPower.value:SetFont(font, fontsize-1)
                self.DruidPower.value:SetTextColor(1,1,1)
                self.DruidPower.value:SetShadowOffset(1, -1)
                self.DruidPower.percent = self.DruidPower:CreateFontString(nil, "OVERLAY")
                self.DruidPower.percent:SetPoint("RIGHT", self.DruidPower, -1, 0)
                self.DruidPower.percent:SetFont(font, fontsize-1)
                self.DruidPower.percent:SetTextColor(1,1,1)
                self.DruidPower.percent:SetShadowOffset(1, -1)
                self.DruidPower:SetBackdrop{
                bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
                insets = {left = -1, right = -1, top = -1, bottom = -1},
                }
                self.DruidPower:SetBackdropColor(0,0,0,0.6)
                self:RegisterEvent("UNIT_MANA", UpdateDruidPower)
                self:RegisterEvent("UNIT_ENERGY", UpdateDruidPower)
                self:RegisterEvent("PLAYER_LOGIN", UpdateDruidPower)
                -- Druid Mana border
                local TopLeft = self.DruidPower:CreateTexture(nil, "OVERLAY")
                TopLeft:SetTexture(frameborder)
                TopLeft:SetTexCoord(0, 1/3, 0, 1/3)
                TopLeft:SetPoint("TOPLEFT", -6, 6)
                TopLeft:SetWidth(12) TopLeft:SetHeight(12)


                IP属地:新疆9楼2011-05-09 23:38
                回复
                  2025-06-09 04:09:34
                  广告
                  TopLeft:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                  local TopRight = self.DruidPower:CreateTexture(nil, "OVERLAY")
                  TopRight:SetTexture(frameborder)
                  TopRight:SetTexCoord(2/3, 1, 0, 1/3)
                  TopRight:SetPoint("TOPRIGHT", 6, 6)
                  TopRight:SetWidth(12) TopRight:SetHeight(12)
                  TopRight:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                  local BottomLeft = self.DruidPower:CreateTexture(nil, "OVERLAY")
                  BottomLeft:SetTexture(frameborder)
                  BottomLeft:SetTexCoord(0, 1/3, 2/3, 1)
                  BottomLeft:SetPoint("BOTTOMLEFT", -6, -6)
                  BottomLeft:SetWidth(12) BottomLeft:SetHeight(12)
                  BottomLeft:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                  local BottomRight = self.DruidPower:CreateTexture(nil, "OVERLAY")
                  BottomRight:SetTexture(frameborder)
                  BottomRight:SetTexCoord(2/3, 1, 2/3, 1)
                  BottomRight:SetPoint("BOTTOMRIGHT", 6, -6)
                  BottomRight:SetWidth(12) BottomRight:SetHeight(12)
                  BottomRight:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                  local TopEdge = self.DruidPower:CreateTexture(nil, "OVERLAY")
                  TopEdge:SetTexture(frameborder)
                  TopEdge:SetTexCoord(1/3, 2/3, 0, 1/3)
                  TopEdge:SetPoint("TOPLEFT", TopLeft, "TOPRIGHT")
                  TopEdge:SetPoint("TOPRIGHT", TopRight, "TOPLEFT")
                  TopEdge:SetHeight(12)
                  TopEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                  local BottomEdge = self.DruidPower:CreateTexture(nil, "OVERLAY")
                  BottomEdge:SetTexture(frameborder)
                  BottomEdge:SetTexCoord(1/3, 2/3, 2/3, 1)
                  BottomEdge:SetPoint("BOTTOMLEFT", BottomLeft, "BOTTOMRIGHT")
                  BottomEdge:SetPoint("BOTTOMRIGHT", BottomRight, "BOTTOMLEFT")
                  BottomEdge:SetHeight(12)
                  BottomEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                  local LeftEdge = self.DruidPower:CreateTexture(nil, "OVERLAY")
                  LeftEdge:SetTexture(frameborder)
                  LeftEdge:SetTexCoord(0, 1/3, 1/3, 2/3)
                  LeftEdge:SetPoint("TOPLEFT", TopLeft, "BOTTOMLEFT")
                  LeftEdge:SetPoint("BOTTOMLEFT", BottomLeft, "TOPLEFT")
                  LeftEdge:SetWidth(12)
                  LeftEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                  local RightEdge = self.DruidPower:CreateTexture(nil, "OVERLAY")
                  RightEdge:SetTexture(frameborder)
                  RightEdge:SetTexCoord(2/3, 1, 1/3, 2/3)
                  RightEdge:SetPoint("TOPRIGHT", TopRight, "BOTTOMRIGHT")
                  RightEdge:SetPoint("BOTTOMRIGHT", BottomRight, "TOPRIGHT")


                  IP属地:新疆10楼2011-05-09 23:38
                  回复
                    RightEdge:SetWidth(12)
                    RightEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                       end
                    --
                       -- leader icon --队长标识
                       --
                       self.Leader = self.Health:CreateTexture(nil, "OVERLAY")
                       self.Leader:SetHeight(12)
                       self.Leader:SetWidth(12)
                       self.Leader:SetPoint("BOTTOMRIGHT", self, -2, 6)
                       self.Leader:SetTexture"Interface\\GroupFrame\\UI-Group-LeaderIcon"
                       --
                       -- Combat icon --战斗状态标志(交叉剑)
                       --
                       self.Combat = self.Health:CreateTexture(nil, 'OVERLAY')
                       self.Combat:SetHeight(14)
                       self.Combat:SetWidth(14)
                       self.Combat:SetPoint('BOTTOM', self, 0, -9)
                       self.Combat:SetTexture('Interface\\CharacterFrame\\UI-StateIcon')
                       self.Combat:SetTexCoord(0.58, 0.90, 0.08, 0.41)
                       --
                       -- raid target icons -团队标记
                       --
                       self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
                       self.RaidIcon:SetHeight(16)
                       self.RaidIcon:SetWidth(16)
                       self.RaidIcon:SetPoint("TOP", self, 0, 9)
                       self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
                    --
                       -- oUF_PowerSpark support --对PowerSpark插件的支持代码,提示战斗回蓝的光标效果
                       --
                       self.Spark = self.Power:CreateTexture(nil, "OVERLAY")
                       self.Spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark")
                       self.Spark:SetVertexColor(1, 1, 1, 1)
                       self.Spark:SetBlendMode("ADD")
                       self.Spark:SetHeight(self.Power:GetHeight()*2.5)
                       self.Spark:SetWidth(self.Power:GetHeight()*2)
                       -- self.Spark.rtl = true -- Make the spark go from Right To Left instead
                       -- self.Spark.manatick = true -- Show mana regen ticks outside FSR (like the energy ticker)
                       -- self.Spark.highAlpha = 1 -- What alpha setting to use for the FSR and energy spark
                       -- self.Spark.lowAlpha = 0.25 -- What alpha setting to use for the mana regen ticker
                       --
                       -- oUF_BarFader --对BarFader插件的支持代码,可以在你满血满蓝的时候渐隐或者全隐玩家头像
                       --
                       self.BarFade = true
                    end
                    -- ------------------------------------
                    -- pet --bb设置
                    -- ------------------------------------
                    if unit=="pet" then
                       self:SetWidth(120) --头像宽度
                       self:SetHeight(20) --头像高度
                       self.Health:SetHeight(14.5) --血条高度
                       self.Power:SetHeight(4) --蓝条高度
                       self.Power.value:Hide()
                       --self.Health.value:Hide() --生命值隐藏,也可在前面添加(去掉注释--即加载)
                       self.Level:Hide() --BB等级
                       self.Name:Hide() --BB名字
                       self.Power:SetAlpha(1.0) --透明度
                       self.Health:SetAlpha(1.0)


                    IP属地:新疆11楼2011-05-09 23:39
                    回复
                      --透明度
                         if playerClass=="HUNTER" then
                      self.Health.colorReaction = false
                      self.Health.colorClass = false
                      self.Health.colorHappiness = true
                         end
                         --
                         -- buffs buff参数设置
                         --
                         self.Buffs = CreateFrame("Frame", nil, self) -- buffs
                         self.Buffs.size = 26 --buff尺寸
                         self.Buffs:SetHeight(self.Buffs.size)
                         self.Buffs:SetWidth(self.Buffs.size * 6) --buff栏宽度,以buff的数量计算
                         self.Buffs:SetPoint("BOTTOMLEFT", self, "RIGHT", 15, -10) --buff位置
                         self.Buffs.initialAnchor = "BOTTOMLEFT"
                         self.Buffs["growth-y"] = "TOP"
                         self.Buffs.num = 4
                         self.Buffs.spacing = 2   间隔
                         --
                         -- debuffs
                         --
                         self.Debuffs = CreateFrame("Frame", nil, self)
                         self.Debuffs.size = 26 --debuff的设置,同buff设置
                         self.Debuffs:SetHeight(self.Debuffs.size)
                         self.Debuffs:SetWidth(self.Debuffs.size * 5)
                         self.Debuffs:SetPoint("TOPLEFT", self, "BOTTOMLEFT", -2, -10)
                         self.Debuffs.initialAnchor = "TOPLEFT"
                         self.Debuffs["growth-y"] = "DOWN" 延伸方向
                         self.Debuffs.filter = false   自身放的debuff突出放大
                         self.Debuffs.num = 4
                         self.Debuffs.spacing = 2
                         --
                         -- oUF_BarFader
                         --
                         self.BarFade = true
                      end
                      -- ------------------------------------
                      -- target --目标的设置
                      -- ------------------------------------
                      if unit=="target" then
                         self:SetWidth(250) --宽度
                         self:SetHeight(20) --高度
                         self.Health:SetHeight(14.5) --血条高度
                         self.Power:SetHeight(4) --蓝条高度
                         self.Power.value:Hide()
                         self.Health.value:SetPoint("RIGHT", 0, 9)
                         self.Name:SetPoint("LEFT", self.Level, "RIGHT", 0, 0)
                         self.Name:SetHeight(20) --姓名高度
                         self.Name:SetWidth(154) --姓名长度限制
                         self.Power:SetAlpha(1.0) --透明度
                         self.Health:SetAlpha(1.0)
                         table.insert(self.__elements, HidePortrait)
                         self.Health.colorClass = true
                         --
                         -- PvP Icon --pvp 标识
                         --
                         local pvp = self.Health:CreateTexture(nil, "OVERLAY")
                         pvp:SetPoint("LEFT", self.Health, "LEFT", -22, -7)
                         pvp:SetHeight(30)
                         pvp:SetWidth(30)
                         self.PvP = pvp
                         --
                         -- Portrait --中部3D头像 设置
                         --
                         local portrait = CreateFrame("PlayerModel", nil, self)
                         portrait:SetScript("OnShow", function(self) self:SetCamera(0) end)


                      IP属地:新疆12楼2011-05-09 23:39
                      回复
                        portrait:SetWidth(90) --宽度
                           portrait:SetHeight(100) --高度
                           portrait:SetPoint("TOPLEFT", self.Power, "BOTTOMLEFT", 0, -20) --位置
                           portrait.type = "3D"
                           self.Portrait = portrait
                           portrait:SetFrameLevel(0)
                           --
                           -- Portrait background --目标头像背景材质
                           --
                           local TargetPorBG = CreateFrame("Frame", nil, oUF_Target)
                           local TPBG = TargetPorBG:CreateTexture(nil,"BACKGROUND")
                           TargetPorBG:SetPoint("TOPLEFT", self.Power, "BOTTOMLEFT", -6, -14)
                           TargetPorBG:SetWidth(102) -- default 102
                           TargetPorBG:SetHeight(111) -- default 111
                           --TargetPorBG:SetFrameStrata("BACKGROUND") -- move the texture behind the portrait
                           TPBG:SetTexture(PorBG)
                           --TPBG:SetTexture(frameborder)
                           TPBG:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                           TPBG:SetAllPoints(TargetPorBG)
                           TargetPorBG.texture = TPBG
                           TargetPorBG:Show()
                        --[[
                        -- alternative (old/default/whatever) background
                        TargetPorBG = CreateFrame('Frame', 'TargetBG', oUF_Target)
                        TargetPorBG:SetFrameStrata'BACKGROUND'
                        TargetPorBG:SetWidth(102)
                        TargetPorBG:SetHeight(112)
                        TargetPorBG:SetPoint("TOPLEFT", self.Power, "BOTTOMLEFT", -6, -14)
                        TargetPorBG:SetBackdrop({bgFile = "Interface\\ChatFrame\\ChatFrameBackground",edgeFile = "Interface\\Tooltips\\ChatBubble-Backdrop",tile = false, tileSize = 0,edgeSize = 9,insets = { left = 6, right = 6, top = 6, bottom = 6 }})
                        TargetPorBG:SetBackdropColor(0,0,0,0.8)
                        TargetPorBG:SetBackdropBorderColor(0.2,0.5,0.5,0.35)
                        --]]
                           --
                           -- combo points --连击点设置
                           --
                           if(playerClass=="ROGUE" or playerClass=="DRUID") then
                        self.CPoints = self:CreateFontString(nil, "OVERLAY")
                        self.CPoints:SetPoint("RIGHT", self, "LEFT", -10, 0)
                        self.CPoints:SetFont(font, 38, "OUTLINE")
                        self.CPoints:SetTextColor(0, 0.81, 1)
                        self.CPoints:SetShadowOffset(1, -1)
                        self.CPoints:SetJustifyH"RIGHT"
                           end
                           --
                           -- raid target icons --团队标记
                           --
                           self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
                           self.RaidIcon:SetHeight(24)
                           self.RaidIcon:SetWidth(24)
                           self.RaidIcon:SetPoint("LEFT", self, -30, 0)
                           self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
                           --
                           -- buffs --目标buff的设置,同上
                           --
                           self.Buffs = CreateFrame("Frame", nil, self)   -- buffs
                           self.Buffs.size = 30
                           self.Buffs:SetHeight(self.Buffs.size)
                           self.Buffs:SetWidth(self.Buffs.size * 6)


                        IP属地:新疆13楼2011-05-09 23:39
                        回复
                          self.Buffs:SetPoint("BOTTOMLEFT", self, "RIGHT", 15, -15)
                             self.Buffs.initialAnchor = "BOTTOMLEFT"
                             self.Buffs["growth-y"] = "TOP"
                             self.Buffs.num = 30
                             self.Buffs.spacing = 2
                             --
                             -- debuffs --目标debuff的设置,同上
                             --
                             self.Debuffs = CreateFrame("Frame", nil, self)
                             self.Debuffs.size = 30
                             self.Debuffs:SetHeight(self.Debuffs.size)
                             self.Debuffs:SetWidth(self.Debuffs.size * 9)
                             self.Debuffs:SetPoint("BOTTOMLEFT", self, "TOPLEFT", -2, 15)
                             self.Debuffs.initialAnchor = "BOTTOMLEFT"
                             self.Debuffs["growth-y"] = "TOP"
                             self.Debuffs.filter = "HARMFUL|PLAYER" --debuff过滤器,只显示自己的还是全部的,("HARMFUL|PLAYER"改成false 即可显示全部)
                             self.Debuffs.num = 40
                             self.Debuffs.spacing = 2
                          end
                          -- ------------------------------------
                          -- player and target castbar --施法条的设置,玩家的和目标的
                          -- ------------------------------------
                          if(unit == 'player' or unit == 'target') then
                              self.Castbar = CreateFrame('StatusBar', nil, self)
                              self.Castbar:SetStatusBarTexture(castbartex)
                              self.Castbar:SetFrameStrata'HIGH'
                          if(unit == "player") then
                             local _, class = UnitClass(unit)
                             color = self.colors.class[class]
                             --self.Castbar:SetStatusBarColor(0.10, 0.3, 0.70, 0.9)
                             self.Castbar:SetStatusBarColor(0.5, 0.5, 0.5, 0.8) --施法条颜色
                             self.Castbar:SetHeight(20) --玩家施法条高度
                             self.Castbar:SetWidth(250) --玩家施法条宽度
                             self.Castbar:SetBackdrop{
                          bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
                          insets = {left = -1, right = -1, top = -1, bottom = -1}} --玩家施法条背景(可删)
                             self.Castbar.SafeZone = self.Castbar:CreateTexture(nil,"ARTWORK")
                             self.Castbar.SafeZone:SetTexture(castbartex)
                             self.Castbar.SafeZone:SetVertexColor(0.75,0.10,0.10,0.7)
                             self.Castbar.SafeZone:SetPoint("TOPRIGHT")
                             self.Castbar.SafeZone:SetPoint("BOTTOMRIGHT")
                             self.Castbar:SetPoint('CENTER', UIParent, 'CENTER', playerCB_x, playerCB_y)
                             else --else 目标的施法条设置
                             --self.Castbar:SetStatusBarColor(0.10, 0.3, 0.70, 0.9)
                             self.Castbar:SetStatusBarColor(0.5, 0.5, 0.5, 0.8) --施法条颜色
                             self.Castbar:SetHeight(20) --高度
                             self.Castbar:SetWidth(250) --宽度
                             self.Castbar:SetBackdrop{
                          bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
                          insets = {left = -1, right = -1, top = -1, bottom = -1}}
                             self.Castbar:SetPoint('CENTER', UIParent, 'CENTER', targetCB_x, targetCB_y)


                          IP属地:新疆15楼2011-05-09 23:40
                          回复
                            end
                               self.Castbar:SetBackdropColor(0, 0, 0, 0.25)
                               self.Castbar.Text = self.Castbar:CreateFontString(nil, 'OVERLAY')
                               self.Castbar.Text:SetPoint('CENTER', self.Castbar, 0, 0)
                               self.Castbar.Text:SetFont(font, fontsizeCB)
                               self.Castbar.Text:SetShadowOffset(1, -1)
                               self.Castbar.Text:SetTextColor(1, 1, 1)
                               self.Castbar.Text:SetJustifyH('LEFT')
                               self.Castbar.Time = self.Castbar:CreateFontString(nil, 'OVERLAY')
                               self.Castbar.Time:SetPoint('RIGHT', self.Castbar, -4, 0)
                               self.Castbar.Time:SetFont(font, fontsizeCB)
                               self.Castbar.Time:SetTextColor(1, 1, 1)
                               self.Castbar.Time:SetJustifyH('RIGHT')
                            --
                            -- Castbar frameborder --施法条背景框设置
                            --
                            local TopLeft = self.Castbar:CreateTexture(nil, "OVERLAY")
                            --TopLeft:SetTexture(frameborder) --前面加--,即表示不显示施法条背景框 (以下相同)
                            TopLeft:SetTexCoord(0, 1/3, 0, 1/3)
                            TopLeft:SetPoint("TOPLEFT", -6, 6)
                            TopLeft:SetWidth(16) TopLeft:SetHeight(16)
                            TopLeft:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                            local TopRight = self.Castbar:CreateTexture(nil, "OVERLAY")
                            --TopRight:SetTexture(frameborder)
                            TopRight:SetTexCoord(2/3, 1, 0, 1/3)
                            TopRight:SetPoint("TOPRIGHT", 6, 6)
                            TopRight:SetWidth(16) TopRight:SetHeight(16)
                            TopRight:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                            local BottomLeft = self.Castbar:CreateTexture(nil, "OVERLAY")
                            --BottomLeft:SetTexture(frameborder)
                            BottomLeft:SetTexCoord(0, 1/3, 2/3, 1)
                            BottomLeft:SetPoint("BOTTOMLEFT", -6, -6)
                            BottomLeft:SetWidth(16) BottomLeft:SetHeight(16)
                            BottomLeft:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                            local BottomRight = self.Castbar:CreateTexture(nil, "OVERLAY")
                            --BottomRight:SetTexture(frameborder)
                            BottomRight:SetTexCoord(2/3, 1, 2/3, 1)
                            BottomRight:SetPoint("BOTTOMRIGHT", 6, -6)
                            BottomRight:SetWidth(16) BottomRight:SetHeight(16)
                            BottomRight:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                            local TopEdge = self.Castbar:CreateTexture(nil, "OVERLAY")
                            --TopEdge:SetTexture(frameborder)
                            TopEdge:SetTexCoord(1/3, 2/3, 0, 1/3)
                            TopEdge:SetPoint("TOPLEFT", TopLeft, "TOPRIGHT")
                            TopEdge:SetPoint("TOPRIGHT", TopRight, "TOPLEFT")
                            TopEdge:SetHeight(16)
                            TopEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                            local BottomEdge = self.Castbar:CreateTexture(nil, "OVERLAY")


                            IP属地:新疆16楼2011-05-09 23:40
                            回复
                              2025-06-09 04:03:34
                              广告
                              --BottomEdge:SetTexture(frameborder)
                              BottomEdge:SetTexCoord(1/3, 2/3, 2/3, 1)
                              BottomEdge:SetPoint("BOTTOMLEFT", BottomLeft, "BOTTOMRIGHT")
                              BottomEdge:SetPoint("BOTTOMRIGHT", BottomRight, "BOTTOMLEFT")
                              BottomEdge:SetHeight(16)
                              BottomEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                              local LeftEdge = self.Castbar:CreateTexture(nil, "OVERLAY")
                                
                              --LeftEdge:SetTexture(frameborder)
                              LeftEdge:SetTexCoord(0, 1/3, 1/3, 2/3)
                              LeftEdge:SetPoint("TOPLEFT", TopLeft, "BOTTOMLEFT")
                              LeftEdge:SetPoint("BOTTOMLEFT", BottomLeft, "TOPLEFT")
                              LeftEdge:SetWidth(16)
                              LeftEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                              local RightEdge = self.Castbar:CreateTexture(nil, "OVERLAY")
                              --RightEdge:SetTexture(frameborder)
                              RightEdge:SetTexCoord(2/3, 1, 1/3, 2/3)
                              RightEdge:SetPoint("TOPRIGHT", TopRight, "BOTTOMRIGHT")
                              RightEdge:SetPoint("BOTTOMRIGHT", BottomRight, "TOPRIGHT")
                              RightEdge:SetWidth(16)
                              RightEdge:SetVertexColor(color_rb,color_gb,color_bb,alpha_fb)
                              end
                              -- ------------------------------------
                              -- target of target and focus --目标的目标 和 焦点设置
                              -- ------------------------------------
                              if unit=="targettarget" or unit=="focus" then
                                 self:SetWidth(120)
                                 self:SetHeight(20)
                                 self.Health:SetHeight(14.5)
                                 self.Power:Show()
                                 self.Power:SetHeight(4
                                 self.Power.value:Hide()
                                 self.Health.value:Hide()
                                 self.Name:SetWidth(95)
                                 self.Name:SetHeight(18)
                                 self.Power:SetAlpha(1.0)
                                 self.Health:SetAlpha(1.0)
                              --
                                 -- raid target icons
                                 --
                                 self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
                                 self.RaidIcon:SetHeight(16)
                                 self.RaidIcon:SetWidth(16)
                                 self.RaidIcon:SetPoint("RIGHT", self, 0, 9)
                                 self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
                                 --
                                 -- oUF_BarFader
                                 --
                                 if unit=="focus" then
                              self.BarFade = false
                                 end
                              end
                              -- ------------------------------------
                              -- party --小队的设置
                              -- ------------------------------------
                              if(self:GetParent():GetName():match"oUF_Party") then
                                 self:SetWidth(180)
                                 self:SetHeight(20)
                                 self.Health:SetHeight(15)
                                 self.Power:SetHeight(3)
                                 self.Power.value:Hide()
                                 self.Health.value:SetPoint("RIGHT", 0 , 9)
                                 self.Name:SetPoint("LEFT", 0, 9)


                              IP属地:新疆17楼2011-05-09 23:40
                              回复