Permalink
Browse files

afterEnter hook

  • Loading branch information...
1 parent 421b18e commit 2019935e46d8e4f068a45843ea955c7c5013dd2b @juhana juhana committed Jul 9, 2011
Showing with 12 additions and 0 deletions.
  1. +12 −0 games/media/js/undum.js
@@ -738,6 +738,13 @@
* function(character, system, oldSituationId, newSituationId);
*/
enter: null,
+
+ /* Hook for when the situation has already been carried out and printed.
+ * The signature is
+ *
+ * function( character, system, oldSituationId, newSituationId );
+ */
+ afterEnter: null,
/* This function is called before carrying out any action in
* any situation. It is called before the corresponding
@@ -1156,6 +1163,11 @@
game.enter(character, system, oldSituationId, newSituationId);
}
newSituation.enter(character, system, oldSituationId);
+
+ // additional hook for when the situation text has already been printed
+ if( game.afterEnter ) {
+ game.afterEnter( character, system, oldSituationId, newSituationId );
+ }
};
/* Returns HTML from the given content with the non-raw links

0 comments on commit 2019935

Please sign in to comment.