mirror of
https://gitlab.com/Oreolek/salet.git
synced 2024-07-07 01:04:25 +03:00
Hiding fixes
This commit is contained in:
parent
cbd0f37ad8
commit
6e3cda3a9c
|
@ -169,13 +169,11 @@ class SaletRoom
|
||||||
@entering.fcall(this, system, @name)
|
@entering.fcall(this, system, @name)
|
||||||
return system.view.write(thing.take.fcall(thing, system).toString())
|
return system.view.write(thing.take.fcall(thing, system).toString())
|
||||||
if thing.act
|
if thing.act
|
||||||
system.view.changeLevel(thing.level)
|
text = system.view.wrapLevel(
|
||||||
return system.view.write(
|
thing.act.fcall(thing, system).toString(),
|
||||||
system.view.wrapLevel(
|
thing.level
|
||||||
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
|
# the loop is done but no return came - match not found
|
||||||
console.error("Could not find #{link[2]} in current room.")
|
console.error("Could not find #{link[2]} in current room.")
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,7 @@ class SaletView
|
||||||
# Remove every section marked as a different level.
|
# Remove every section marked as a different level.
|
||||||
# For a link level 0, we hide every link of level 1 and above.
|
# For a link level 0, we hide every link of level 1 and above.
|
||||||
# It's for the player to focus.
|
# It's for the player to focus.
|
||||||
changeLevel: (level) =>
|
changeLevel: (level, text) =>
|
||||||
maxLevel = 6
|
maxLevel = 6
|
||||||
if level < maxLevel
|
if level < maxLevel
|
||||||
i = level + 1
|
i = level + 1
|
||||||
|
@ -214,10 +214,11 @@ class SaletView
|
||||||
hideArray.push("#content .lvl"+i)
|
hideArray.push("#content .lvl"+i)
|
||||||
i++
|
i++
|
||||||
directive = hideArray.join(", ")
|
directive = hideArray.join(", ")
|
||||||
$(directive).fadeOut("slow")
|
$(directive).hide()
|
||||||
|
@write text
|
||||||
|
|
||||||
wrapLevel: (text, level) =>
|
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.
|
# At last, we scroll the view so that .new objects are in view.
|
||||||
endOutputTransaction: () =>
|
endOutputTransaction: () =>
|
||||||
|
|
Loading…
Reference in a new issue