")
###
Element helpers. There is no real need to build monsters like a().id("hello")
because you won't use them as is. It does not make sense in context, the
author has Markdown and all utilities to *forget* about the markup.
###
way_to = (content, ref) ->
return "#{content}"
textlink = (content, ref) ->
return "#{content}"
actlink = (content, ref) ->
return "#{content}"
sysroom = (name, options) ->
options.canSave = false
options.enter = () ->
$(".action").hide()
options.exit = () ->
salet.view.clearContent('#current-room')
$(".action").show()
options.dsc = () ->
return @text.fcall()
###
+"\n\n"
+"""
'
spec.enter = () ->
salet.character.update_sidebar()
if @onEnter?
@onEnter()
return room(name, spec)
sysroom "inventory",
text: () ->
if salet.character.inventory.length == 0
text = "You are carrying nothing."
else
text = "You are carrying:\n\n"
for thing in salet.character.inventory
text += "* #{salet.character.listinv(thing.name)}\n"
sysroom "settings",
text: () ->
nightclass = ""
if window.night
nightclass = "active"
return "credits".l() + """
"""
sysroom "map",
text: () ->
return ""
after: () ->
data = {
edges: []
nodes: []
}
edges = []
for name, room of salet.rooms
if room.canSave == false or name == "start"
continue
data.nodes.push({
"id": name
"label": room.title()
"size": 5
"color": "#000"
"x": Math.random()
"y": Math.random()
})
if room.ways? and room.ways.length > 0
for way in room.ways
id = "edge_"+name+"_"+way
# we don't want to display a two-way link twice
if edges.indexOf("edge_"+way+"_"+name) == -1
edges.push(id)
data.edges.push({
"id": id
"source": room.name
"target": way
"size": 1
"color": "#ccc"
})
console.log data
s = new sigma({
graph: data,
container: 'map'
})
console.log(s)
return ""