1
0
Fork 0
mirror of https://gitlab.com/Oreolek/black_phone.git synced 2024-05-17 08:28:32 +03:00

Hiding fixes

This commit is contained in:
Alexander Yakovlev 2016-03-10 21:03:54 +07:00
parent 236962ee87
commit cfadea775a
2 changed files with 8 additions and 9 deletions

View file

@ -169,13 +169,11 @@ class SaletRoom
@entering.fcall(this, system, @name)
return system.view.write(thing.take.fcall(thing, system).toString())
if thing.act
system.view.changeLevel(thing.level)
return system.view.write(
system.view.wrapLevel(
thing.act.fcall(thing, system).toString(),
thing.level
)
text = system.view.wrapLevel(
thing.act.fcall(thing, system).toString(),
thing.level
)
return system.view.changeLevel(thing.level, text)
# the loop is done but no return came - match not found
console.error("Could not find #{link[2]} in current room.")

View file

@ -205,7 +205,7 @@ class SaletView
# Remove every section marked as a different level.
# For a link level 0, we hide every link of level 1 and above.
# It's for the player to focus.
changeLevel: (level) =>
changeLevel: (level, text) =>
maxLevel = 6
if level < maxLevel
i = level + 1
@ -214,10 +214,11 @@ class SaletView
hideArray.push("#content .lvl"+i)
i++
directive = hideArray.join(", ")
$(directive).fadeOut("slow")
$(directive).hide()
@write text
wrapLevel: (text, level) =>
return "<span class='lvl#{level}'>"+text+'</span>'
return "<div class='lvl#{level}'>"+markdown(text)+'</div>'
# At last, we scroll the view so that .new objects are in view.
endOutputTransaction: () =>