diff --git a/iffy.coffee b/iffy.coffee index 2c062a2..98445a4 100644 --- a/iffy.coffee +++ b/iffy.coffee @@ -163,7 +163,8 @@ class Gst @ClearMenu(true) jMenu = $("
").hide() for verb in rgverb - jMenuItem = $("#{verb.stDisplay}
").click(() => verb.dgActivate(); @Display()) + dgClick = ((verbT) => () => verbT.dgActivate(); @Display())(verb) + jMenuItem = $("#{verb.stDisplay}
").click(dgClick) jMenu.append(jMenuItem) jMenu.css({ @@ -227,6 +228,8 @@ class Gst stHtml = stHtml + "

[[error interpreting markup: #{error}]]

" stHtml +bind = (fn, me) -> ((args...) -> fn.apply(me, args))# argh new coffeescript won't let me use __bind :( + # narrative event -- the story is told as a sequence of these. Contains the HTML to display when the # narrative event happens, the preconditions to make sure the event should be allowed to occur, and # the resultant effect on the state of the model of the world @@ -370,7 +373,7 @@ class Word nev = new Nev(dVerb) if not nev.FHasRun(wst) and not @gst.story.actorPlayer.FWillAttempt(wst, nev) stDisplay = $(dVerb).attr("display") or $(dVerb).attr("name") - dgActivate = () => @gst.story.actorPlayer.RespondTo(wst.nev, new Nev(dVerb)) + dgActivate = ((dVerbT) => () => @gst.story.actorPlayer.RespondTo(wst.nev, new Nev(dVerbT)))(dVerb) rgverb.push(new Verb(stDisplay, dgActivate)) rgverb