매크로 게시판

전체보기

모바일 상단 메뉴

본문 페이지

[공통] 클래식 캐스팅바 타이머

아이콘 배틀리
댓글: 3 개
조회: 4189
2019-09-03 07:24:28


현재 확장팩인 격전의 아제로스 기본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)

와우저

Lv91 배틀리

하늘아래푸르름

모바일 게시판 하단버튼

댓글

새로고침
새로고침

모바일 게시판 하단버튼

지금 뜨는 인벤

더보기+

모바일 게시판 리스트

모바일 게시판 하단버튼

글쓰기

모바일 게시판 페이징

최근 HOT한 콘텐츠

  • 와우
  • 게임
  • IT
  • 유머
  • 연예
AD