From be1b9ff311b649ffed98d6565b7f6e9e582a942d Mon Sep 17 00:00:00 2001 From: "p.kosyh" Date: Tue, 22 Jun 2010 10:03:24 +0000 Subject: [PATCH] para module, no ACTION_TEXT while goto from life --- stead/Makefile | 1 + stead/Makefile.windows | 1 + stead/goto.lua | 3 +++ stead/gui.lua | 2 +- stead/para.lua | 7 +++++++ 5 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 stead/para.lua diff --git a/stead/Makefile b/stead/Makefile index a32d206..891fc5b 100644 --- a/stead/Makefile +++ b/stead/Makefile @@ -17,6 +17,7 @@ install: $(INSTALL) prefs.lua $(STEADPATH)/prefs.lua $(INSTALL) snapshot.lua $(STEADPATH)/snapshot.lua $(INSTALL) object.lua $(STEADPATH)/object.lua + $(INSTALL) para.lua $(STEADPATH)/para.lua uninstall: $(RM) $(STEADPATH)/stead.lua diff --git a/stead/Makefile.windows b/stead/Makefile.windows index 8f89cdb..e1b8acf 100644 --- a/stead/Makefile.windows +++ b/stead/Makefile.windows @@ -14,3 +14,4 @@ install: copy prefs.lua ..\bin\stead copy snapshot.lua ..\bin\stead copy object.lua ..\bin\stead + copy para.lua ..\bin\stead diff --git a/stead/goto.lua b/stead/goto.lua index 719b300..381135c 100644 --- a/stead/goto.lua +++ b/stead/goto.lua @@ -94,5 +94,8 @@ go = hook(go, function(f, ...) if type(r) == 'string' then pr (r) end + if stead.in_life_call then + ACTION_TEXT = nil + end return r,v end) diff --git a/stead/gui.lua b/stead/gui.lua index 41cce04..085af0a 100644 --- a/stead/gui.lua +++ b/stead/gui.lua @@ -166,7 +166,7 @@ fmt = function(...) end for i=1,stead.table.maxn(arg) do if type(arg[i]) == 'string' then - local s = stead.string.gsub(arg[i],'\t', ' '):gsub('[\n]+', ' '):gsub('%^','\n'):gsub('~', txtnb(' ')); + local s = stead.string.gsub(arg[i],'\t', ' '):gsub('[\n]+', ' '):gsub('%^','\n'); res = stead.par('', res, s); end end diff --git a/stead/para.lua b/stead/para.lua new file mode 100644 index 0000000..f6a01ba --- /dev/null +++ b/stead/para.lua @@ -0,0 +1,7 @@ +stead.fmt = hook(stead.fmt, function(f, ...) + local r = f(unpack(arg)) + if type(r) == 'string' then + r = r:gsub('~', txtnb(' ')); + end + return r; +end)