Thread Tools Display Modes
11-08-14, 06:35 AM   #1
coree
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 28
Editing a layout by an extra file

Hello,

i like to edit a layout by writing my changes into an extra file.

So i.e. the layout i want to edit uses a file called unitframes.lua for the style of the unitframes.
inside that file there is a function called: local styleFunc(self, unit) ... where i can find code like self.Health.value = ...

now i want to create an extra file to edit this health value. but how can i achieve this? How can i modify the styleFunc function?

I hope my idea is clear enough described (if not, just ask).

Tia

EDIT: Just found a solution... I'll edit the frames by oUF_Player.Health.value = ...

Last edited by coree : 11-08-14 at 07:57 AM.
  Reply With Quote
11-09-14, 02:41 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I see you already found a solution, but to give a technical answer for this question:

Originally Posted by coree View Post
there is a function called: local styleFunc(self, unit) ... How can i modify the styleFunc function?
You can't. If a name (eg. "styleFunc") is local to one file, you can't access it from another file. It's also not possible to modify a function in Lua; you can overwrite it with another function, but you can't just change the code inside the same function.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Editing a layout by an extra file


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off