Author Topic: ULib.HOOK_ULIBDONELOADING  (Read 2219 times)

0 Members and 1 Guest are viewing this topic.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
ULib.HOOK_ULIBDONELOADING
« on: December 20, 2014, 03:06:23 PM »
Creating custom addons and placing them in <myaddon>/lua/ulib/modules/<x> will ensure loading of custom addons are done after ULib loads, but, I still think it would be helpful to create a hook event for ULib.HOOK_ULIBDONELOADING for various reasons.
Might be helpful just to be able to have additional code for when ULib isn't loaded.
Say, make an addon, runs normal at startup, if that hook gets called, run additional enhancements/etc that depend on ULib.


"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ULib.HOOK_ULIBDONELOADING
« Reply #1 on: December 21, 2014, 06:32:02 PM »
Hmm, we have a hook like this for ULX, but not ULib. Though, the example you posed could still be done via the ULib module folder. We'd also have the problem of ensuring that all addons have been loaded before calling the hook.
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULib.HOOK_ULIBDONELOADING
« Reply #2 on: December 21, 2014, 08:04:38 PM »
Yes, I found the ULX hook, and, seeing the ULX hook was why I suggested it here for ULib.
As for ensuring fully loaded, I saw that queuFunctionCall is used in a few instances to ensure all things are loaded for ULX before other post-initialization work is done.

The person I helped here ended up using our modules folder, but, I could imagine a hook being a nicer method in some instances.
Why ULX has one but not ULib seems like a which should have come first, chicken or egg, puzzle.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming