1 /* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *
21 */
22
23 #include "ags/plugins/core/dialog.h"
24 #include "ags/engine/ac/dialog.h"
25
26 namespace AGS3 {
27 namespace Plugins {
28 namespace Core {
29
AGS_EngineStartup(IAGSEngine * engine)30 void Dialog::AGS_EngineStartup(IAGSEngine *engine) {
31 ScriptContainer::AGS_EngineStartup(engine);
32
33 SCRIPT_METHOD(Dialog::get_ID, Dialog::GetID);
34 SCRIPT_METHOD(Dialog::get_OptionCount, Dialog::GetOptionCount);
35 SCRIPT_METHOD(Dialog::get_ShowTextParser, Dialog::GetShowTextParser);
36 SCRIPT_METHOD(Dialog::DisplayOptions^1, Dialog::DisplayOptions);
37 SCRIPT_METHOD(Dialog::GetOptionState^1, Dialog::GetOptionState);
38 SCRIPT_METHOD(Dialog::GetOptionText^1, Dialog::GetOptionText);
39 SCRIPT_METHOD(Dialog::HasOptionBeenChosen^1, Dialog::HasOptionBeenChosen);
40 SCRIPT_METHOD(Dialog::SetOptionState^2, Dialog::SetOptionState);
41 SCRIPT_METHOD(Dialog::Start^0, Dialog::Start);
42 }
43
GetID(ScriptMethodParams & params)44 void Dialog::GetID(ScriptMethodParams ¶ms) {
45 PARAMS1(ScriptDialog *, sd);
46 params._result = AGS3::Dialog_GetID(sd);
47 }
48
GetOptionCount(ScriptMethodParams & params)49 void Dialog::GetOptionCount(ScriptMethodParams ¶ms) {
50 PARAMS1(ScriptDialog *, sd);
51 params._result = AGS3::Dialog_GetOptionCount(sd);
52 }
53
GetShowTextParser(ScriptMethodParams & params)54 void Dialog::GetShowTextParser(ScriptMethodParams ¶ms) {
55 PARAMS1(ScriptDialog *, sd);
56 params._result = AGS3::Dialog_GetShowTextParser(sd);
57 }
58
DisplayOptions(ScriptMethodParams & params)59 void Dialog::DisplayOptions(ScriptMethodParams ¶ms) {
60 PARAMS2(ScriptDialog *, sd, int, sayChosenOption);
61 params._result = AGS3::Dialog_DisplayOptions(sd, sayChosenOption);
62 }
63
GetOptionState(ScriptMethodParams & params)64 void Dialog::GetOptionState(ScriptMethodParams ¶ms) {
65 PARAMS2(ScriptDialog *, sd, int, option);
66 params._result = AGS3::Dialog_GetOptionState(sd, option);
67 }
68
GetOptionText(ScriptMethodParams & params)69 void Dialog::GetOptionText(ScriptMethodParams ¶ms) {
70 PARAMS2(ScriptDialog *, sd, int, option);
71 params._result = AGS3::Dialog_GetOptionText(sd, option);
72 }
73
HasOptionBeenChosen(ScriptMethodParams & params)74 void Dialog::HasOptionBeenChosen(ScriptMethodParams ¶ms) {
75 PARAMS2(ScriptDialog *, sd, int, option);
76 params._result = AGS3::Dialog_HasOptionBeenChosen(sd, option);
77 }
78
SetOptionState(ScriptMethodParams & params)79 void Dialog::SetOptionState(ScriptMethodParams ¶ms) {
80 PARAMS3(ScriptDialog *, sd, int, option, int, newState);
81 AGS3::Dialog_SetOptionState(sd, option, newState);
82 }
83
Start(ScriptMethodParams & params)84 void Dialog::Start(ScriptMethodParams ¶ms) {
85 PARAMS1(ScriptDialog *, sd);
86 AGS3::Dialog_Start(sd);
87 }
88
89 } // namespace Core
90 } // namespace Plugins
91 } // namespace AGS3
92