“No Badges”: About the Code

“No Badges” is a little mod for The Secret World that hides the SP and AP icons once you have maxed their respective pools. The floating icons are called anima wheel links and the little numbers attached to them are called badges. So why is the mod that removes anima wheel links called “No Badges”? Because you didn’t know what an anima wheel link was until I told you. There is nothing else in the game called “badges” so I chose that description. Moving on.

The code, as it is now, is entirely ghetto. It is a few lines in OnEnterFrame that continuously checks the number of points in each pool and hides the respective icon if the pool is maxed. The mod didn’t start out that way, though. I tried to be a little more sophisticated. I didn’t use OnEnterFrame at all. All the actions were associated with signals.

For example, whenever you got an AP or an SP, the mod received a signal. I tied a function to that signal that would check if you were maxed in a pool and, if you were, to hide the anima wheel link.

This worked fine and was a simple, unobtrusive, low overhead bit of code. Except when you zoned. When you zone your character gets destructed and remade. There are signals tied to each event and I tried to use them. Unfortunately, it didn’t work. I’m not sure of the order of things following a zoning event. Its possible “No Badges” received the signal of the character being created before the UI had created its anima wheel link icons. That would cause the mod to attempt to remove an icon that wasn’t there yet and then the icon to be rendered afterwards, with no action done to it. That’s what I’m guessing. Could be something else. By this point in the development, I was ready to move on.

Below is a copy of the source with some additional comments.

NoBadges Source

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>