add "donext" which forces one nev to follow another
This commit is contained in:
parent
2c8380a776
commit
b5b15da057
17
iffy.coffee
17
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)
|
||||
|
|
Loading…
Reference in a new issue