pseen/punseen in dlg

This commit is contained in:
p.kosyh 2010-07-23 11:31:52 +00:00
parent 3190ab5415
commit a09ce53fce
2 changed files with 47 additions and 3 deletions

1
debian/changelog vendored
View file

@ -34,6 +34,7 @@ instead (1.2.0) unstable; urgency=low
* args in call;
* var and global;
* self() is now self;
* psen/punseen for dlg;
* no return goto needed;
* disable_all/enable_all for lists;
* purge and list_purge;

View file

@ -926,6 +926,29 @@ function dialog_phrase(self, num)
return ref(self.obj[tonumber(num)]);
end
function phrase_seen(s, enb, ...)
local i, ph
if stead.table.maxn(arg) == 0 then
return false
end
for i=1,stead.table.maxn(arg) do
ph = dialog_phrase(s, arg[i]);
local r = not isPhrase(ph) or isRemoved(ph) or ph:disabled();
if not enb then r = not r end
if r then return false end
end
return true
end
function dialog_pseen(s, ...)
return phrase_seen(s, true, unpack(arg));
end
function dialog_punseen(s, ...)
return phrase_seen(s, false, unpack(arg));
end
function ponoff(s, on, ...)
local i, ph
if stead.table.maxn(arg) == 0 then
@ -987,6 +1010,12 @@ function dlg(v) --constructor
if v.prem == nil then
v.prem = dialog_prem;
end
if v.pseen == nil then
v.pseen = dialog_pseen;
end
if v.punseen == nil then
v.punseen = dialog_punseen;
end
v = room(v);
return v;
end
@ -2035,23 +2064,37 @@ function xref(str, obj, ...)
return iface:xref(str, obj, unpack(arg));
end
function pseen(...)
if not isDialog(here()) then
return
end
return here():pseen(unpack(arg));
end
function punseen(...)
if not isDialog(here()) then
return
end
return here():punseen(unpack(arg));
end
function pon(...)
if not isDialog(here()) then
return
end
dialog_pon(here(), unpack(arg));
here():pon(unpack(arg));
end
function poff(...)
if not isDialog(here()) then
return
end
dialog_poff(here(), unpack(arg));
here():poff(unpack(arg));
end
function prem(...)
if not isDialog(here()) then
return
end
dialog_prem(here(), unpack(arg));
here():prem(unpack(arg));
end
function lifeon(what)