don't show actions if the player's gonna do them

This commit is contained in:
Jeremy Penner 2011-02-10 17:32:49 -08:00
parent 6aa6cf96c5
commit 13e0166667

View file

@ -142,6 +142,7 @@ class Nevgen
class Gst
constructor: (@story, @jDiv) ->
@wstInit = @story.WstInit(this)
@rgwst = null
@igenID = 0
Display: () ->
@ -155,16 +156,26 @@ class Gst
</div>")
dgEnter = () -> $(this).addClass('hover')
dgLeave = () -> $(this).removeClass('hover')
for wst in @RgwstRun()
@rgwst = null
@rgwst = @RgwstRun()
for wst in @rgwst
jDivNev = $("<div class='iffy-nev'/>")
jDivNev.append(wst.nev.StHtmlDisplay(this, wst))
@jDiv.append(jDivNev)
jDivNev.hover(dgEnter, dgLeave)
@wstLast = wst
for stId_dgOnClick in @mpstId_dgOnClick
@jDiv.find("##{stId_dgOnClick[0]}").click(stId_dgOnClick[1])
# only valid to call after the story has been run
FWasRun: (nev) ->
for wst in @rgwst
if wst.nev.ID() == nev.ID()
return true
return false
ShowMenu: (ev, dLink, rgverb) ->
@ClearMenu(true)
jMenu = $("<div class='iffy-menu'/>").hide()
@ -385,7 +396,7 @@ class Word
rgverb = []
for dVerb in @jWord.find("verb")
nev = new Nev(dVerb)
if not nev.FHasRun(wst) and not @gst.story.actorPlayer.FWillAttempt(wst, nev)
if not @gst.FWasRun(nev) and not @gst.story.actorPlayer.FWillAttempt(wst, nev)
stDisplay = $(dVerb).attr("display") or $(dVerb).attr("name")
dgActivate = ((dVerbT) => () => @gst.story.actorPlayer.RespondTo(wst.nev, new Nev(dVerbT)))(dVerb)
rgverb.push(new Verb(stDisplay, dgActivate))
@ -420,6 +431,7 @@ class ActorPlayer
if nevResponse.ID() == nev.ID()
return true
return false
EninevResponse: (nev, wst) ->
rgnev = @mpnevID_rgnev[nev.ID()]
if rgnev? then new EniArray(rgnev) else EniEmpty