dash module

This commit is contained in:
p.kosyh 2010-07-02 11:43:33 +00:00
parent e5a30e29bf
commit 44c2fa88e5
4 changed files with 13 additions and 0 deletions

View file

@ -18,6 +18,7 @@ install:
$(INSTALL) snapshot.lua $(STEADPATH)/snapshot.lua
$(INSTALL) object.lua $(STEADPATH)/object.lua
$(INSTALL) para.lua $(STEADPATH)/para.lua
$(INSTALL) dash.lua $(STEADPATH)/dash.lua
uninstall:
$(RM) $(STEADPATH)/stead.lua

View file

@ -15,3 +15,4 @@ install:
copy snapshot.lua ..\bin\stead
copy object.lua ..\bin\stead
copy para.lua ..\bin\stead
copy dash.lua ..\bin\stead

10
stead/dash.lua Normal file
View file

@ -0,0 +1,10 @@
stead.fmt = stead.hook(stead.fmt, function(f, ...)
local r = f(unpack(arg))
if game.codepage ~= 'UTF-8' then
error("You can not use dash module with non UTF-8 encoding.");
end
if type(r) == 'string' then
r = r:gsub('%-%-', '');
end
return r;
end)

View file

@ -1624,6 +1624,7 @@ end
game = game {
codepage = "UTF-8",
nam = "INSTEAD -- Simple Text Adventure interpreter v"..stead.version.." '2009-2010 by Peter Kosyh",
dsc = [[
Commands:^