From e1ca11a950b7553cbafff6902a26c6a4023f9df9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 19 Mar 2016 21:09:38 +0300 Subject: Replace select with yes/no to askyesno function. --- npc/functions/beds.txt | 2 +- npc/functions/main.txt | 5 +++++ npc/functions/marriage.txt | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'npc/functions') diff --git a/npc/functions/beds.txt b/npc/functions/beds.txt index 299ceda8..8fa1e4b1 100644 --- a/npc/functions/beds.txt +++ b/npc/functions/beds.txt @@ -21,7 +21,7 @@ function script bedTouch { function script bedClic { narrator 4, l("Do you want to use this place as save point?"); - if (select (menuaction(l("Yes")), menuaction(l("No"))) == 1) + if (askyesno() == ASK_YES) { savepointparticle (getarg (0), getarg (1), getarg (2), getarg (3)); } diff --git a/npc/functions/main.txt b/npc/functions/main.txt index 0632bcec..f2dad770 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -167,3 +167,8 @@ function script abs { .@n = getarg(0); return .@n >= 0 ? .@n : -.@n; } + +function script askyesno { + return select (menuaction(l("Yes")), + menuaction(l("No"))); +} diff --git a/npc/functions/marriage.txt b/npc/functions/marriage.txt index 222d4934..bb24f439 100644 --- a/npc/functions/marriage.txt +++ b/npc/functions/marriage.txt @@ -122,7 +122,7 @@ function script marriageacceptpartner { function script askmarry { speech l("Do you want to marry @@?", getarg(0)); - if (select(menuaction(l("Yes")), menuaction(l("No"))) == 1) + if (askyesno() == ASK_YES) return true; return false; } @@ -236,7 +236,7 @@ function script marriagedivorce { { case 1: speech l("Are you sure?"); - if (select(menuaction(l("Yes")), menuaction(l("No"))) == 1) + if (askyesno() == ASK_YES) { if (divorce()) { -- cgit v1.2.3-70-g09d2