mirror of
https://gitlab.com/Oreolek/salet.git
synced 2024-07-07 01:04:25 +03:00
wrapLevel sort of fixed
This commit is contained in:
parent
6e3cda3a9c
commit
e1b4f82156
|
@ -169,11 +169,9 @@ 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
|
||||||
text = system.view.wrapLevel(
|
return system.view.changeLevel(thing.level, () ->
|
||||||
thing.act.fcall(thing, system).toString(),
|
return 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.")
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ class Salet
|
||||||
room = @rooms[roomId]
|
room = @rooms[roomId]
|
||||||
assert(room, "unknown_situation".l({id:roomId}))
|
assert(room, "unknown_situation".l({id:roomId}))
|
||||||
|
|
||||||
if (room.canView.fcall(this, currentRoom))
|
if (room.canView.fcall(this, this, currentRoom))
|
||||||
viewableRoomData.push({
|
viewableRoomData.push({
|
||||||
priority: room.priority
|
priority: room.priority
|
||||||
id: roomId
|
id: roomId
|
||||||
|
|
|
@ -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, text) =>
|
changeLevel: (level, callback) =>
|
||||||
maxLevel = 6
|
maxLevel = 6
|
||||||
if level < maxLevel
|
if level < maxLevel
|
||||||
i = level + 1
|
i = level + 1
|
||||||
|
@ -215,7 +215,7 @@ class SaletView
|
||||||
i++
|
i++
|
||||||
directive = hideArray.join(", ")
|
directive = hideArray.join(", ")
|
||||||
$(directive).hide()
|
$(directive).hide()
|
||||||
@write text
|
@write system.view.wrapLevel(callback(), level)
|
||||||
|
|
||||||
wrapLevel: (text, level) =>
|
wrapLevel: (text, level) =>
|
||||||
return "<div class='lvl#{level}'>"+markdown(text)+'</div>'
|
return "<div class='lvl#{level}'>"+markdown(text)+'</div>'
|
||||||
|
|
Loading…
Reference in a new issue