phrase_action cleanups for future hacks
This commit is contained in:
parent
71bc74d660
commit
c2b9ff972a
|
@ -824,8 +824,8 @@ end
|
||||||
|
|
||||||
function phrase_action(self)
|
function phrase_action(self)
|
||||||
local ph = self;
|
local ph = self;
|
||||||
local r = here();
|
local r = nil;
|
||||||
local ret;
|
local ret = nil;
|
||||||
if isDisabled(ph) then
|
if isDisabled(ph) then
|
||||||
return nil, false
|
return nil, false
|
||||||
end
|
end
|
||||||
|
@ -837,21 +837,26 @@ function phrase_action(self)
|
||||||
if f ~= nil then
|
if f ~= nil then
|
||||||
ret = f();
|
ret = f();
|
||||||
else
|
else
|
||||||
error ("Error while eval phrase action");
|
error ("Error while eval phrase action.");
|
||||||
end
|
end
|
||||||
elseif type(ph.do_act) == 'function' then
|
elseif type(ph.do_act) == 'function' then
|
||||||
ret = ph.do_act(self, nam);
|
ret = ph.do_act(self, nam);
|
||||||
end
|
end
|
||||||
local last = call(ph, 'ans');
|
local last = call(ph, 'ans');
|
||||||
|
if last == true or ret == true then
|
||||||
|
r = true;
|
||||||
|
end
|
||||||
if isDialog(here()) and not dialog_rescan(here()) then
|
if isDialog(here()) and not dialog_rescan(here()) then
|
||||||
ret = par(' ', ret, me():back());
|
ret = par(' ', ret, me():back());
|
||||||
end
|
end
|
||||||
return par("^^", last, ret);
|
|
||||||
-- if dialog_getn(self, 1) == nil then
|
ret = par("^^", last, ret);
|
||||||
-- me():back();
|
|
||||||
-- end
|
if ret == nil then
|
||||||
-- self._last = call(ph, 'ans');
|
return r -- hack?
|
||||||
-- return self._last;
|
end
|
||||||
|
|
||||||
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
function phrase_save(self, name, h, need)
|
function phrase_save(self, name, h, need)
|
||||||
|
|
Reference in a new issue