don't show actions if the player's gonna do them
This commit is contained in:
parent
6aa6cf96c5
commit
13e0166667
16
iffy.coffee
16
iffy.coffee
|
@ -142,6 +142,7 @@ class Nevgen
|
||||||
class Gst
|
class Gst
|
||||||
constructor: (@story, @jDiv) ->
|
constructor: (@story, @jDiv) ->
|
||||||
@wstInit = @story.WstInit(this)
|
@wstInit = @story.WstInit(this)
|
||||||
|
@rgwst = null
|
||||||
@igenID = 0
|
@igenID = 0
|
||||||
|
|
||||||
Display: () ->
|
Display: () ->
|
||||||
|
@ -156,15 +157,25 @@ class Gst
|
||||||
dgEnter = () -> $(this).addClass('hover')
|
dgEnter = () -> $(this).addClass('hover')
|
||||||
dgLeave = () -> $(this).removeClass('hover')
|
dgLeave = () -> $(this).removeClass('hover')
|
||||||
|
|
||||||
for wst in @RgwstRun()
|
@rgwst = null
|
||||||
|
@rgwst = @RgwstRun()
|
||||||
|
for wst in @rgwst
|
||||||
jDivNev = $("<div class='iffy-nev'/>")
|
jDivNev = $("<div class='iffy-nev'/>")
|
||||||
jDivNev.append(wst.nev.StHtmlDisplay(this, wst))
|
jDivNev.append(wst.nev.StHtmlDisplay(this, wst))
|
||||||
@jDiv.append(jDivNev)
|
@jDiv.append(jDivNev)
|
||||||
jDivNev.hover(dgEnter, dgLeave)
|
jDivNev.hover(dgEnter, dgLeave)
|
||||||
|
@wstLast = wst
|
||||||
|
|
||||||
for stId_dgOnClick in @mpstId_dgOnClick
|
for stId_dgOnClick in @mpstId_dgOnClick
|
||||||
@jDiv.find("##{stId_dgOnClick[0]}").click(stId_dgOnClick[1])
|
@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) ->
|
ShowMenu: (ev, dLink, rgverb) ->
|
||||||
@ClearMenu(true)
|
@ClearMenu(true)
|
||||||
jMenu = $("<div class='iffy-menu'/>").hide()
|
jMenu = $("<div class='iffy-menu'/>").hide()
|
||||||
|
@ -385,7 +396,7 @@ class Word
|
||||||
rgverb = []
|
rgverb = []
|
||||||
for dVerb in @jWord.find("verb")
|
for dVerb in @jWord.find("verb")
|
||||||
nev = new Nev(dVerb)
|
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")
|
stDisplay = $(dVerb).attr("display") or $(dVerb).attr("name")
|
||||||
dgActivate = ((dVerbT) => () => @gst.story.actorPlayer.RespondTo(wst.nev, new Nev(dVerbT)))(dVerb)
|
dgActivate = ((dVerbT) => () => @gst.story.actorPlayer.RespondTo(wst.nev, new Nev(dVerbT)))(dVerb)
|
||||||
rgverb.push(new Verb(stDisplay, dgActivate))
|
rgverb.push(new Verb(stDisplay, dgActivate))
|
||||||
|
@ -420,6 +431,7 @@ class ActorPlayer
|
||||||
if nevResponse.ID() == nev.ID()
|
if nevResponse.ID() == nev.ID()
|
||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
|
|
||||||
EninevResponse: (nev, wst) ->
|
EninevResponse: (nev, wst) ->
|
||||||
rgnev = @mpnevID_rgnev[nev.ID()]
|
rgnev = @mpnevID_rgnev[nev.ID()]
|
||||||
if rgnev? then new EniArray(rgnev) else EniEmpty
|
if rgnev? then new EniArray(rgnev) else EniEmpty
|
||||||
|
|
Loading…
Reference in a new issue