• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Shortcut??

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Although one could easilly be made. All that is needed is replacing all trigger creation calls to a custom function that returns a trigger.

In this function, you create a new trigger, place it onto a list of triggers (I advise an array list) and then return it.
Do not forget a function to remove the trigger but you may be forced to perform a linear search of the list which is less optimal.

As you have a list of all triggers ever created, you can simply enumerate through them and pause or unpause them (I advise a function that does that).

More advanced data structures and code complexity could be used to improve the efficiency of the trigger removal code. One such example is using a list of structs (which have both a trigger and the position it is in the array list) and mapping each trigger to its corosponding struct.
 
Status
Not open for further replies.
Top