Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Module] Save/load window locations
#4
The way to solve your meshmanager problem would be to either hook or overwrite the mm.ToggleMenu() function and remove the line

Code:
GUI_MoveWindow( mm.mainwindow.name, wnd.x+wnd.width,wnd.y)

Overwriting:
When the lua interpreter loads modules it does so in a specific order specified by the "Dependencies=xyz" line in module.def for each module. If you set your module to be dependent on FFXIVMINION, for example, with "Dependencies=FFXIVMINION", it means your module will be loaded after FFXIVMINION (which contains ffxiv_mesher.lua). This gives you access to a very nice property of lua, which is that if multiple definitions of a function are present only the last definition will be used. This means that you can simply copy and paste mm.ToggleMenu(), place it in your own module code, and remove the line. At runtime, your function will be called instead of the one in ffxiv_mesher.lua. You can use this property to have your module change default functionality without actually modifying any of the base code.

Hooking:
Another convenient property of lua is how easy it is to hook a function. I won't go into the intricacies of hooking but its a cleaner method of function modification than overwriting since you don't have to update every time the original function is updated. Here's a snippet from a wow lua book that explains it pretty well and gives an example:

http://books.google.com/books?id=tFZyUCo...ng&f=false

Note that in order for hooking to work properly you still need to make your module dependent on whatever module contains the function you want to hook.
 


Messages In This Thread
[Module] Save/load window locations - by Sil - 10-14-2013, 06:08 PM
RE: [Module] Save/load window locations - by Sil - 10-15-2013, 11:03 AM
RE: [Module] Save/load window locations - by ferenz - 10-18-2013, 08:20 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)

We help you win the game.

FFXIV Bot and More.

 

Products