This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTION] TC: GUI show bad value of Power - Energy  (Read 1291 times)

Daweo

  • Registred Member
  • Race Changer
  • *****
  • Posts: 39
    • View Profile
[QUESTION] TC: GUI show bad value of Power - Energy
« 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?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [QUESTION] TC: GUI show bad value of Power - Energy
« Reply #1 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
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Daweo

  • Registred Member
  • Race Changer
  • *****
  • Posts: 39
    • View Profile
Re: [QUESTION] TC: GUI show bad value of Power - Energy
« Reply #2 on: July 10, 2014, 10:27:00 pm »
Thank You very much... :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Daweo

  • Registred Member
  • Race Changer
  • *****
  • Posts: 39
    • View Profile
Re: [QUESTION] TC: GUI show bad value of Power - Energy
« Reply #3 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...
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [QUESTION] TC: GUI show bad value of Power - Energy
« Reply #4 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Krang Stonehoof

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 164
    • View Profile
Re: [QUESTION] TC: GUI show bad value of Power - Energy
« Reply #5 on: August 01, 2015, 06:28:22 pm »
I have the same problem, have you find any solution so far, Daweo?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »