Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Miscellaneous => Topic started by: Daweo on July 10, 2014, 08:10:37 pm

Title: [QUESTION] TC: GUI show bad value of Power - Energy
Post by: Daweo on July 10, 2014, 08:10:37 pm
Hi, Modcraft.

I have problem with changing my player power regeneration. I set the energy as main power and disable regeneration in config and core then too. Energy doesnt regenerate, but ingame the GUI still show regeneration.
For example I have only 10 energy, but GUI show regen up to maximum of 100. When You want to cast spell uses energy it will show you error text. I think, that this is coded somewhere in LUA, but I cant find it.
Is there somebody who has an experience with, please?
Title: Re: [QUESTION] TC: GUI show bad value of Power - Energy
Post by: stoneharry on July 10, 2014, 10:15:36 pm
Quote from: "Daweo"
Hi, Modcraft.

I have problem with changing my player power regeneration. I set the energy as main power and disable regeneration in config and core then too. Energy doesnt regenerate, but ingame the GUI still show regeneration.
For example I have only 10 energy, but GUI show regen up to maximum of 100. When You want to cast spell uses energy it will show you error text. I think, that this is coded somewhere in LUA, but I cant find it.
Is there somebody who has an experience with, please?

It is handled in FrameXMLAlternatePowerBar.lua
Title: Re: [QUESTION] TC: GUI show bad value of Power - Energy
Post by: Daweo on July 10, 2014, 10:27:00 pm
Thank You very much... :)
Title: Re: [QUESTION] TC: GUI show bad value of Power - Energy
Post by: Daweo on July 10, 2014, 10:46:37 pm
But,
this file only handles additional Mana bar. Not the power (previously Mana) bar, which is replaced with new power (Energy).



I tried to find something in FrameXML/PlayerFrame.lua but I am not good at Lua so much...
Title: Re: [QUESTION] TC: GUI show bad value of Power - Energy
Post by: stoneharry on July 10, 2014, 11:56:07 pm
Hmm, in UnitFrame.lua:

Code: [Select]
function UnitFrameManaBar_OnUpdate(self)
if ( not self.disconnected and not self.lockValues ) then
local currValue = UnitPower(self.unit, self.powerType);
if ( currValue ~= self.currValue ) then
self:SetValue(currValue);
self.currValue = currValue;
TextStatusBar_UpdateTextString(self);
end
end
end

function UnitFrameManaBar_Update(statusbar, unit)
if ( not statusbar or statusbar.lockValues ) then
return;
end

if ( unit == statusbar.unit ) then
-- be sure to update the power type before grabbing the max power!
UnitFrameManaBar_UpdateType(statusbar);

local maxValue = UnitPowerMax(unit, statusbar.powerType);

statusbar:SetMinMaxValues(0, maxValue);

statusbar.disconnected = not UnitIsConnected(unit);
if ( statusbar.disconnected ) then
statusbar:SetValue(maxValue);
statusbar.currValue = maxValue;
if ( not statusbar.lockColor ) then
statusbar:SetStatusBarColor(0.5, 0.5, 0.5);
end
else
local currValue = UnitPower(unit, statusbar.powerType);
statusbar:SetValue(currValue);
statusbar.currValue = currValue;
end
end
TextStat

Try changing this. Pretty sure it is it.

Also while taking a peek I found this comment:
Code: [Select]
-- Mmmm, runic Power Bars, my favorite kind. Tastes like Death Knnigget.Really. Game devs make such lame jokes.
Title: Re: [QUESTION] TC: GUI show bad value of Power - Energy
Post by: Krang Stonehoof on August 01, 2015, 06:28:22 pm
I have the same problem, have you find any solution so far, Daweo?