|
2019-09-03 07:24
조회: 4,194
추천: 0
클래식 캐스팅바 타이머![]() 현재 확장팩인 격전의 아제로스 기본UI의 시전바가 좋아서 거기에 타이머를 넣은 스크립트를 클래식에서도 써보고 싶어서 캐스팅바 타이머를 조금 수정했는데 잘 되는 것 같아 공유하고자 남깁니다. CastingBarFrame:ClearAllPoints() CastingBarFrame:SetPoint("CENTER", UIParent, "CENTER", 0, -295)-- 시전바 위치 수정 CastingBarFrame.SetPoint = function() end CastingBarFrame:SetScale(1.2)-- 시전바 크기 PetCastingBarFrame:SetScale(1.2) CastingBarFrame.timer = CastingBarFrame:CreateFontString(nil, "OVERLAY", "GameFontHighlight") CastingBarFrame.timer:SetFont(STANDARD_TEXT_FONT, 14, "OUTLINE") CastingBarFrame.timer:SetPoint("LEFT", CastingBarFrame, "LEFT", 3, 3) CastingBarFrame.timer.maxValue = CastingBarFrame:CreateFontString(nil, "OVERLAY", "GameFontHighlight") CastingBarFrame.timer.maxValue:SetFont(STANDARD_TEXT_FONT, 14, "OUTLINE") CastingBarFrame.timer.maxValue:SetPoint("RIGHT", CastingBarFrame, "RIGHT", -1, 3) CastingBarFrame.update = .1; CastingBarFrame.Icon:Show()-- 아이콘 보이기 CastingBarFrame.Icon:SetSize(19, 19)-- 아이콘 크기 CastingBarFrame.Border:SetTexture("InterfaceCastingBarUI-CastingBar-Border-Small") CastingBarFrame.Flash:SetTexture("InterfaceCastingBarUI-CastingBar-Flash-Small") local function CastingBarFrame_OnUpdate_Hook(self, elapsed) if not self.timer then return end if self.update and self.update < elapsed then if self.timer.maxValue then self.timer.maxValue:SetText(format("|cffffff00%1.1f", self.maxValue)) end if self.casting then self.timer:SetText(format("|cffffff00%1.1f", max(self.maxValue - self.value, 0))) elseif self.channeling then self.timer:SetText(format("|cffffff00%.1f", max(self.value, 0))) else self.timer:SetText("") if self.timer.maxValue then self.timer.maxValue:SetText("") end end self.update = .1 else self.update = self.update - elapsed end end CastingBarFrame:HookScript("OnUpdate", CastingBarFrame_OnUpdate_Hook) |

배틀리 