월드 오브 워크래프트 인벤

와우 화제 집중

확장팩 커뮤니티

확장팩 직업 게시판

확장팩 연합 서버 게시판

클래식 커뮤니티

클래식 직업 게시판

클래식 서버 게시판

시대 커뮤니티

미디어 갤러리 (공통)

워크래프트 IP 커뮤니티

정보 공유 게시판 (공통)

공통 커뮤니티

인기 팟벤

 

UnitFramesImproved 질문



이걸 쓰면 플레이어(나) 창 색깔까지 직업색이 돼버리는데요
이걸 그냥 기본 초록색으로 바꾸고싶은데 가능할까요? 파란색이라 마나창이랑 헷갈리네요
1. 플레이어 체력창만 초록색으로
2. 적군 체력창을 빨간색으로
3. 적군 체력창도 초록색으로 
능력자님 찾습니다

-- Credits to stassart on curse.com for suggesting to use InCombatLockdown() checks in the code

-- Debug function. Adds message to the chatbox (only visible to the loacl player)
function dout(msg)
DEFAULT_CHAT_FRAME:AddMessage(msg);
end

-- Additional debug info can be found on http://www.wowwiki.com/Blizzard_DebugTools
-- /framestack [showhidden]
-- showhidden - if "true" then will also display information about hidden frames
-- /eventtrace [command]
--  start - enables event capturing to the EventTrace frame
-- stop - disables event capturing
-- number - captures the provided number of events and then stops
-- If no command is given the EventTrace frame visibility is toggled. The first time the frame is displayed, event tracing is automatically started.
-- /dump expression
-- expression can be any valid lua expression that results in a value. So variable names, function calls, frames or tables can all be dumped.

function tokenize(str)
local tbl = {};
for v in string.gmatch(str, "[^ ]+") do
tinsert(tbl, v);
end
return tbl;
end

-- Create the addon main instance
local UnitFramesImproved = CreateFrame('Button', 'UnitFramesImproved');

-- Event listener to make sure we enable the addon at the right time
function UnitFramesImproved:PLAYER_ENTERING_WORLD()
-- Set some default settings
if (characterSettings == nil) then
UnitFramesImproved_LoadDefaultSettings();
end
EnableUnitFramesImproved();
end

-- Event listener to make sure we've loaded our settings and thta we apply them
function UnitFramesImproved:VARIABLES_LOADED()
dout("UnitFramesImproved settings loaded!");
-- Set some default settings
if (characterSettings == nil) then
UnitFramesImproved_LoadDefaultSettings();
end
if (not (characterSettings["PlayerFrameAnchor"] == nil)) then
StaticPopup_Show("LAYOUT_RESETDEFAULT");
characterSettings["PlayerFrameX"] = nil;
characterSettings["PlayerFrameY"] = nil;
characterSettings["PlayerFrameMoved"] = nil;
characterSettings["PlayerFrameAnchor"] = nil;
end
UnitFramesImproved_ApplySettings(characterSettings);
end

function UnitFramesImproved_ApplySettings(settings)
UnitFramesImproved_SetFrameScale(settings["FrameScale"])
end

function UnitFramesImproved_LoadDefaultSettings()
characterSettings = {}
characterSettings["FrameScale"] = "1.0";
if not TargetFrame:IsUserPlaced() then
TargetFrame:SetPoint("TOPLEFT", PlayerFrame, "TOPRIGHT", 36, 0);
end
end

function EnableUnitFramesImproved()
-- Generic status text hook
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", UnitFramesImproved_TextStatusBar_UpdateTextStringWithValues);
-- Hook PlayerFrame functions
hooksecurefunc("PlayerFrame_ToPlayerArt", UnitFramesImproved_PlayerFrame_ToPlayerArt);
hooksecurefunc("PlayerFrame_ToVehicleArt", UnitFramesImproved_PlayerFrame_ToVehicleArt);
-- Hook TargetFrame functions
hooksecurefunc("TargetFrame_CheckDead", UnitFramesImproved_TargetFrame_Update);
hooksecurefunc("TargetFrame_Update", UnitFramesImproved_TargetFrame_Update);
hooksecurefunc("TargetFrame_CheckFaction", UnitFramesImproved_TargetFrame_CheckFaction);
hooksecurefunc("TargetFrame_CheckClassification", UnitFramesImproved_TargetFrame_CheckClassification);
hooksecurefunc("TargetofTarget_Update", UnitFramesImproved_TargetFrame_Update);
-- BossFrame hooks
hooksecurefunc("BossTargetFrame_OnLoad", UnitFramesImproved_BossTargetFrame_Style);

-- Setup relative layout for targetframe compared to PlayerFrame
if not TargetFrame:IsUserPlaced() then
if not InCombatLockdown() then 
TargetFrame:SetPoint("TOPLEFT", PlayerFrame, "TOPRIGHT", 36, 0);
end
end
-- Set up some stylings
UnitFramesImproved_Style_PlayerFrame();
UnitFramesImproved_BossTargetFrame_Style(Boss1TargetFrame);
UnitFramesImproved_BossTargetFrame_Style(Boss2TargetFrame);
UnitFramesImproved_BossTargetFrame_Style(Boss3TargetFrame);
UnitFramesImproved_BossTargetFrame_Style(Boss4TargetFrame);
UnitFramesImproved_Style_TargetFrame(TargetFrame);
UnitFramesImproved_Style_TargetFrame(FocusFrame);
UnitFramesImproved_Style_TargetOfTargetFrame();
-- Update some values
TextStatusBar_UpdateTextString(PlayerFrame.healthbar);
TextStatusBar_UpdateTextString(PlayerFrame.manabar);
end

function UnitFramesImproved_Style_TargetOfTargetFrame()
if not InCombatLockdown() then 
TargetFrameToTHealthBar.lockColor = true;
end
end

function UnitFramesImproved_Style_PlayerFrame()
if not InCombatLockdown() then 
PlayerFrameHealthBar.lockColor = true;
PlayerFrameHealthBar.capNumericDisplay = true;
PlayerFrameHealthBar:SetWidth(119);
PlayerFrameHealthBar:SetHeight(29);
PlayerFrameHealthBar:SetPoint("TOPLEFT",106,-22);
PlayerFrameHealthBarText:SetPoint("CENTER",50,6);
end
PlayerFrameTexture:SetTexture("InterfaceAddonsUnitFramesImprovedTexturesUI-TargetingFrame");
PlayerStatusTexture:SetTexture("InterfaceAddonsUnitFramesImprovedTexturesUI-Player-Status");
PlayerFrameHealthBar:SetStatusBarColor(UnitColor("player"));
end

function UnitFramesImproved_Style_TargetFrame(self)
--if not InCombatLockdown() then
local classification = UnitClassification(self.unit);
if (classification == "minus") then
self.healthbar:SetHeight(12);
self.healthbar:SetPoint("TOPLEFT",7,-41);
self.healthbar.TextString:SetPoint("CENTER",-50,4);
self.deadText:SetPoint("CENTER",-50,4);
self.Background:SetPoint("TOPLEFT",7,-41);
else
self.healthbar:SetHeight(29);
self.healthbar:SetPoint("TOPLEFT",7,-22);
self.healthbar.TextString:SetPoint("CENTER",-50,6);
self.deadText:SetPoint("CENTER",-50,6);
self.nameBackground:Hide();
self.Background:SetPoint("TOPLEFT",7,-22);
end
self.healthbar:SetWidth(119);
self.healthbar.lockColor = true;
--end
end

function UnitFramesImproved_BossTargetFrame_Style(self)
self.borderTexture:SetTexture("InterfaceAddonsUnitFramesImprovedTexturesUI-UnitFrame-Boss");

UnitFramesImproved_Style_TargetFrame(self);
if (not (characterSettings["FrameScale"] == nil)) then
if not InCombatLockdown() then 
self:SetScale(characterSettings["FrameScale"] * 0.9);
end
end
end

function UnitFramesImproved_SetFrameScale(scale)
if not InCombatLockdown() then 
-- Scale the main frames
PlayerFrame:SetScale(scale);
TargetFrame:SetScale(scale);
FocusFrame:SetScale(scale);
-- Scale sub-frames
ComboFrame:SetScale(scale); -- Still needed
--RuneFrame:SetScale(scale); -- Can't do this as it messes up the scale horribly
--RuneButtonIndividual1:SetScale(scale); -- No point in doing these either as the runeframes are now sacled to parent
--RuneButtonIndividual2:SetScale(scale); -- No point in doing these either as the runeframes are now sacled to parent
--RuneButtonIndividual3:SetScale(scale); -- No point in doing these either as the runeframes are now sacled to parent
--RuneButtonIndividual4:SetScale(scale); -- No point in doing these either as the runeframes are now sacled to parent
--RuneButtonIndividual5:SetScale(scale); -- No point in doing these either as the runeframes are now sacled to parent
--RuneButtonIndividual6:SetScale(scale); -- No point in doing these either as the runeframes are now sacled to parent
-- Scale the BossFrames, skip now as this seems to break
-- Boss1TargetFrame:SetScale(scale*0.9);
-- Boss2TargetFrame:SetScale(scale*0.9);
-- Boss3TargetFrame:SetScale(scale*0.9);
-- Boss4TargetFrame:SetScale(scale*0.9);
characterSettings["FrameScale"] = scale;
end
end

-- Slashcommand stuff
SLASH_UNITFRAMESIMPROVED1 = "/unitframesimproved";
SLASH_UNITFRAMESIMPROVED2 = "/ufi";
SlashCmdList["UNITFRAMESIMPROVED"] = function(msg, editBox)
local tokens = tokenize(msg);
if(table.getn(tokens) > 0 and strlower(tokens[1]) == "reset") then
StaticPopup_Show("LAYOUT_RESET");
elseif(table.getn(tokens) > 0 and strlower(tokens[1]) == "settings") then
InterfaceOptionsFrame_OpenToCategory(UnitFramesImproved.panelSettings);
elseif(table.getn(tokens) > 0 and strlower(tokens[1]) == "scale") then
if(table.getn(tokens) > 1) then
UnitFramesImproved_SetFrameScale(tokens[2]);
else
dout("Please supply a number, between 0.0 and 10.0 as the second parameter.");
end
else
dout("Valid commands for UnitFramesImproved are:")
dout("    help    (shows this message)");
dout("    scale # (scales the player frames)");
dout("    reset   (resets the scale of the player frames)");
dout("");
end
end

-- Setup the static popup dialog for resetting the UI
StaticPopupDialogs["LAYOUT_RESET"] = {
text = "Are you sure you want to reset your scale?",
button1 = "Yes",
button2 = "No",
OnAccept = function()
UnitFramesImproved_LoadDefaultSettings();
end,
timeout = 0,
whileDead = true,
hideOnEscape = true
}

StaticPopupDialogs["LAYOUT_RESETDEFAULT"] = {
text = "In order for UnitFramesImproved to work properly,nyour old layout settings need to be reset.nThis will reload your UI.",
button1 = "Reset",
button2 = "Ignore",
OnAccept = function()
PlayerFrame:SetUserPlaced(false);
ReloadUI();
end,
timeout = 0,
whileDead = true,
hideOnEscape = true
}

function UnitFramesImproved_TextStatusBar_UpdateTextStringWithValues(statusFrame, textString, value, valueMin, valueMax)
if( statusFrame.LeftText and statusFrame.RightText ) then
statusFrame.LeftText:SetText("");
statusFrame.RightText:SetText("");
statusFrame.LeftText:Hide();
statusFrame.RightText:Hide();
textString:Show();
end
if ( ( tonumber(valueMax) ~= valueMax or valueMax > 0 ) and not ( statusFrame.pauseUpdates ) ) then
local valueDisplay = value;
local valueMaxDisplay = valueMax;
if ( statusFrame.capNumericDisplay ) then
valueDisplay = UnitFramesImproved_AbbreviateLargeNumbers(value);
valueMaxDisplay = UnitFramesImproved_AbbreviateLargeNumbers(valueMax);
else
valueDisplay = BreakUpLargeNumbers(value);
valueMaxDisplay = BreakUpLargeNumbers(valueMax);
end

local textDisplay = GetCVar("statusTextDisplay");
if ( value and valueMax > 0 and ( textDisplay ~= "NUMERIC" or statusFrame.showPercentage ) and not statusFrame.showNumeric) then
-- if ( value == 0 and statusFrame.zeroText ) then
-- textString:SetText(statusFrame.zeroText);
-- statusFrame.isZero = 1;
-- textString:Show();
-- return;
-- end
percent = math.ceil((value / valueMax) * 100) .. "%";
if ( textDisplay == "BOTH" and not statusFrame.showPercentage) then
valueDisplay = valueDisplay .. " (" .. percent .. ")";
textString:SetText(valueDisplay);
else
valueDisplay = percent;
if ( statusFrame.prefix and (statusFrame.alwaysPrefix or not (statusFrame.cvar and GetCVar(statusFrame.cvar) == "1" and statusFrame.textLockable) ) ) then
textString:SetText(statusFrame.prefix .. " " .. valueDisplay);
else
textString:SetText(valueDisplay);
end
end
elseif ( value == 0 and statusFrame.zeroText ) then
-- textString:SetText(statusFrame.zeroText);
-- statusFrame.isZero = 1;
-- textString:Show();
return;
else
statusFrame.isZero = nil;
if ( statusFrame.prefix and (statusFrame.alwaysPrefix or not (statusFrame.cvar and GetCVar(statusFrame.cvar) == "1" and statusFrame.textLockable) ) ) then
textString:SetText(statusFrame.prefix.." "..valueDisplay.."/"..valueMaxDisplay);
else
textString:SetText(valueDisplay.."/"..valueMaxDisplay);
end
end
end
end

function UnitFramesImproved_PlayerFrame_ToPlayerArt(self)
if not InCombatLockdown() then
UnitFramesImproved_Style_PlayerFrame();
end
end

function UnitFramesImproved_PlayerFrame_ToVehicleArt(self)
if not InCombatLockdown() then
PlayerFrameHealthBar:SetHeight(12);
PlayerFrameHealthBarText:SetPoint("CENTER",50,3);
end
end

function UnitFramesImproved_TargetFrame_Update(self)
-- Set back color of health bar
if ( not UnitPlayerControlled(self.unit) and UnitIsTapDenied(self.unit) ) then
-- Gray if npc is tapped by other player
self.healthbar:SetStatusBarColor(0.5, 0.5, 0.5);
else
-- Standard by class etc if not
self.healthbar:SetStatusBarColor(UnitColor(self.healthbar.unit));
end
end

function UnitFramesImproved_TargetFrame_CheckClassification(self, forceNormalTexture)
local texture;
local classification = UnitClassification(self.unit);
if ( classification == "worldboss" or classification == "elite" ) then
texture = "InterfaceAddonsUnitFramesImprovedTexturesUI-TargetingFrame-Elite";
elseif ( classification == "rareelite" ) then
texture = "InterfaceAddonsUnitFramesImprovedTexturesUI-TargetingFrame-Rare-Elite";
elseif ( classification == "rare" ) then
texture = "InterfaceAddonsUnitFramesImprovedTexturesUI-TargetingFrame-Rare";
end
if ( texture and not forceNormalTexture) then
self.borderTexture:SetTexture(texture);
else
if ( not (classification == "minus") ) then
self.borderTexture:SetTexture("InterfaceAddonsUnitFramesImprovedTexturesUI-TargetingFrame");
end
end
self.nameBackground:Hide();
end

function UnitFramesImproved_TargetFrame_CheckFaction(self)
local factionGroup = UnitFactionGroup(self.unit);
if ( UnitIsPVPFreeForAll(self.unit) ) then
self.pvpIcon:SetTexture("InterfaceTargetingFrameUI-PVP-FFA");
self.pvpIcon:Show();
elseif ( factionGroup and UnitIsPVP(self.unit) and UnitIsEnemy("player", self.unit) ) then
self.pvpIcon:SetTexture("InterfaceTargetingFrameUI-PVP-FFA");
self.pvpIcon:Show();
elseif ( factionGroup == "Alliance" or factionGroup == "Horde" ) then
self.pvpIcon:SetTexture("InterfaceTargetingFrameUI-PVP-"..factionGroup);
self.pvpIcon:Show();
else
self.pvpIcon:Hide();
end
UnitFramesImproved_Style_TargetFrame(self);
end

-- Utility functions
function UnitColor(unit)
local r, g, b;
if ( ( not UnitIsPlayer(unit) ) and ( ( not UnitIsConnected(unit) ) or ( UnitIsDeadOrGhost(unit) ) ) ) then
--Color it gray
r, g, b = 0.5, 0.5, 0.5;
elseif ( UnitIsPlayer(unit) ) then
--Try to color it by class.
local localizedClass, englishClass = UnitClass(unit);
local classColor = RAID_CLASS_COLORS[englishClass];
if ( classColor ) then
r, g, b = classColor.r, classColor.g, classColor.b;
else
if ( UnitIsFriend("player", unit) ) then
r, g, b = 0.0, 1.0, 0.0;
else
r, g, b = 1.0, 0.0, 0.0;
end
end
else
r, g, b = UnitSelectionColor(unit);
end
return r, g, b;
end

function UnitFramesImproved_AbbreviateLargeNumbers(value)
local strLen = strlen(value);
local retString = value;
if (true) then
if ( strLen >= 10 ) then
retString = string.sub(value, 1, -10).."."..string.sub(value, -9, -9).."G";
elseif ( strLen >= 7 ) then
retString = string.sub(value, 1, -7).."."..string.sub(value, -6, -6).."M";
elseif ( strLen >= 4 ) then
retString = string.sub(value, 1, -4).."."..string.sub(value, -3, -3).."k";
end
else
if ( strLen >= 10 ) then
retString = string.sub(value, 1, -10).."G";
elseif ( strLen >= 7 ) then
retString = string.sub(value, 1, -7).."M";
elseif ( strLen >= 4 ) then
retString = string.sub(value, 1, -4).."k";
end
end
return retString;
end

-- Bootstrap
function UnitFramesImproved_StartUp(self)
self:SetScript('OnEvent', function(self, event) self[event](self) end);
self:RegisterEvent('PLAYER_ENTERING_WORLD');
self:RegisterEvent('VARIABLES_LOADED');
end

UnitFramesImproved_StartUp(UnitFramesImproved);

-- Table Dump Functions -- http://lua-users.org/wiki/TableSerialization
function print_r (t, indent, done)
  done = done or {}
  indent = indent or ''
  local nextIndent -- Storage for next indentation value
  for key, value in pairs (t) do
    if type (value) == "table" and not done [value] then
      nextIndent = nextIndent or
          (indent .. string.rep(' ',string.len(tostring (key))+2))
          -- Shortcut conditional allocation
      done [value] = true
      print (indent .. "[" .. tostring (key) .. "] => Table {");
      print  (nextIndent .. "{");
      print_r (value, nextIndent .. string.rep(' ',2), done)
      print  (nextIndent .. "}");
    else
      print  (indent .. "[" .. tostring (key) .. "] => " .. tostring (value).."")
    end
  end
end

EXP 111,250 (5%) / 135,001

Lv70 조홍


장난감 마스터를 향하여
350/395개
2016-09-22 장난감 350개 달성

363/395 현재 장난감

2016-10-21 와접
레벨
Lv70
경험치
111,250 (5%) / 135,001 ( 다음 레벨까지 23,751 / 마격까지 22,500 남음 )
포인트

이니 169,370

베니 722

제니 756

명성
2,260
획득스킬
  • 5
  • 9
  • 5
  • 1

댓글

새로고침
새로고침

와우 인벤 매크로 게시판 게시판

목록 글쓰기
인증글 3추글 즐겨찾기
와우 인벤 매크로 게시판
번호 제목 글쓴이 등록일 조회 추천
16093 레벨 아이콘 왕랑 06:32 46 0
16092 레벨 아이콘 dkvkv 12-27 153 1
16091 레벨 아이콘 도웃고오 12-14 243 0
16090 레벨 아이콘 용하네 12-06 348 0
16089 레벨 아이콘 수달볶음밥 11-20 385 0
16088 레벨 아이콘 릴라화나면 11-19 361 0
16087 레벨 아이콘 타잔과제인 11-13 618 0
16086 레벨 아이콘 상리놈 11-12 468 0
16085 레벨 아이콘 레이델라 10-30 704 0
16084 레벨 아이콘 wlswnds 10-29 738 0
16083 레벨 아이콘 Mardok 10-28 611 0
16082 레벨 아이콘 히데미츠 10-23 779 0
16080 레벨 아이콘 Saige 10-14 1,278 0
16079 레벨 아이콘 규화 10-12 704 0
16078 레벨 아이콘 QTmini 10-08 681 0
16077 레벨 아이콘 Nicer2000 10-06 1,981 1
16076 레벨 아이콘 서수남팬클럽 10-03 677 0
16074 레벨 아이콘 Mvtcd2 10-01 664 0
16073 레벨 아이콘 도풀1 09-24 822 0
16072 레벨 아이콘 우옵 09-24 712 0
16071 레벨 아이콘 f2f2fe 09-23 1,111 0
16070 레벨 아이콘 새우눈깔 09-20 1,313 0
16069 레벨 아이콘 도둑맨 09-19 607 0
16068 레벨 아이콘 f2f2fe 09-18 832 0
16066 레벨 아이콘 October28th 09-18 867 0
16065 레벨 아이콘 Plan88 09-16 668 0
16064 레벨 아이콘 신브 09-15 612 0
16063 레벨 아이콘 Nobrain 09-14 948 0
16061 레벨 아이콘 하한아 09-10 792 0
16060 레벨 아이콘 BOGU 09-06 1,514 0
16059 레벨 아이콘 귤맨 09-02 863 0
16058 레벨 아이콘 Wpzmfktm 08-27 1,026 0
16057 레벨 아이콘 자유게시판0 08-26 1,922 0
16056 레벨 아이콘 스프렌트 08-22 1,397 0
16055 레벨 아이콘 헬스냥쿠니 08-22 920 0
목록 글쓰기

인벤 공식 미디어 파트너 및 제휴 파트너

명칭: 주식회사 인벤 | 등록번호: 경기 아51514 |
등록연월일: 2009. 12. 14 | 제호: 인벤(INVEN)

발행인: 박규상 | 편집인: 강민우 |
발행소: 경기도 성남시 분당구 구미로 9번길 3-4 한국빌딩 3층

발행연월일: 2004 11. 11 |
전화번호: 02 - 6393 - 7700 | E-mail: help@inven.co.kr

인벤의 콘텐츠 및 기사는 저작권법의 보호를 받으므로, 무단 전재, 복사, 배포 등을 금합니다.

Copyrightⓒ Inven. All rights reserved.

인터넷 신문 위원회 배너

2023.08.26 ~ 2026.08.25

인벤 온라인서비스 운영

(웹진, 커뮤니티, 마켓인벤)