0
0
Fork 0
mirror of https://gitlab.com/Oreolek/salet-module.git synced 2024-06-26 03:50:49 +03:00

Random IDs mess up the saves. IDs have to be predictable.

This commit is contained in:
Alexander Yakovlev 2016-03-24 20:24:44 +07:00
parent ba3fbf6bcd
commit 10314558af
3 changed files with 2 additions and 10 deletions

View file

@ -1,5 +1,4 @@
room = require("../room.coffee")
randomid = require("./randomid.coffee")
###
A dialogue shortcut.
Usage:
@ -9,7 +8,7 @@ Usage:
""", "character.sandbox.mild = true"
###
dialogue = (title, salet, startTag, endTag, text, effect) ->
retval = room(randomid(), salet, {
retval = room("dialogue_"+salet.rooms.length, salet, {
optionText: title
dsc: text
clear: false # backlog is useful in dialogues

View file

@ -1,5 +1,4 @@
room = require("../room.coffee")
randomid = require("./randomid.coffee")
###
A phrase shortcut.
Usage:
@ -15,7 +14,7 @@ Usage:
@param string effect an optional parameter, eval'd code
###
phrase = (title, salet, tag, text, effect) ->
retval = room(randomid(), salet, {
retval = room("phrase_"+salet.rooms.length, salet, {
optionText: title
dsc: text
clear: false # backlog is useful in dialogues

View file

@ -1,6 +0,0 @@
module.exports = () ->
alphabet = "abcdefghijklmnopqrstuvwxyz0123456789" # see the dreaded linkRe expression in Undum
rndstr = []
for i in [1..10]
rndstr.push alphabet.charAt(Math.floor(Math.random() * alphabet.length))
return rndstr.join('').toString()