diff --git a/iffy.coffee b/iffy.coffee index 70c2b15..5198aec 100644 --- a/iffy.coffee +++ b/iffy.coffee @@ -511,10 +511,25 @@ class ActorPlayer if (wst.nev.player_nevIDRespondedTo?) wst.gst.Link("Undo", (() => @RemoveResponse(wst.nev); wst.gst.Display()), "class='iffy-undo'") +class ActorNext + constructor: (@story) -> + @mpnevID_rgnev = {} + for section in @story.Rgsection() + for dDoNext in section.jSection.find("donext") + @add(new Nev($(dDoNext.parentNode)), section.NevByName($(dDoNext).attr("nev"))) + add: (nev, nevResponse) -> + if not @mpnevID_rgnev[nev.ID()]? + @mpnevID_rgnev[nev.ID()] = [] + @mpnevID_rgnev[nev.ID()].push(nevResponse) + EninevResponse: (nev, wst) -> + rgnev = @mpnevID_rgnev[nev.ID()] + if rgnev? then new EniArray(rgnev) else EniEmpty + + FilterStHtml: (stHtml, wst) -> stHtml class Story constructor: (@jStory) -> @actorPlayer = new ActorPlayer(this) - @rgactor = [@actorPlayer] + @rgactor = [@actorPlayer, new ActorNext(this)] SectionByName: (stName) -> jSection = @jStory.find("section[name=#{stName}]") if jSection.length == 1 then new Section(this, jSection)