xoreos  0.0.5
functions_conversation.cpp
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos 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 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #include "src/common/util.h"
26 
27 #include "src/aurora/talkman.h"
28 
30 
35 
37 
38 namespace Engines {
39 
40 namespace Witcher {
41 
44 
45  if (object)
46  object->speakString(ctx.getParams()[0].getString(), ctx.getParams()[1].getInt());
47 }
48 
51  if (!object)
52  return;
53 
54  // TODO: Volume
55  const uint32 strRef = (uint32) ctx.getParams()[0].getInt();
56  const uint32 volume = (uint32) ctx.getParams()[1].getInt();
57 
58  object->speakString(TalkMan.getString(strRef).c_str(), volume);
59 }
60 
63  if (!object)
64  return;
65 
66  const Common::UString &dlg = ctx.getParams()[0].getString();
68 
69  object->speakOneLiner(dlg, tokenTarget);
70 }
71 
72 } // End of namespace Witcher
73 
74 } // End of namespace Engines
A container of The Witcher objects.
#define TalkMan
Shortcut for accessing the talk manager.
Definition: talkman.h:111
void speakStringByStrRef(Aurora::NWScript::FunctionContext &ctx)
A class holding an UTF-8 string.
Definition: ustring.h:48
An object within a Witcher area.
Definition: object.h:51
Context of an NWScript function.
static Aurora::NWScript::Object * getParamObject(const Aurora::NWScript::FunctionContext &ctx, size_t n)
Definition: functions.cpp:124
Utility templates and functions.
An object in a The Witcher area.
void speakOneLinerConversation(Aurora::NWScript::FunctionContext &ctx)
uint32_t uint32
Definition: types.h:204
The global talk manager for Aurora strings.
The context needed to run a The Witcher module.
The Witcher engine functions.
The context handling the gameplay in The Witcher.
void speakString(Aurora::NWScript::FunctionContext &ctx)
static Witcher::Object * toObject(::Aurora::NWScript::Object *object)
void speakString(const Common::UString &string, uint32 volume)
Speak the specified string.
Definition: object.cpp:168