xoreos  0.0.5
functions_module.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 
28 
29 #include "src/engines/kotor/game.h"
32 
34 
35 namespace Engines {
36 
37 namespace KotOR {
38 
41 }
42 
45 }
46 
48  ctx.getReturn() = (Aurora::NWScript::Object *) 0;
49 }
50 
53 }
54 
56  float wait = ctx.getParams()[0].getFloat();
57  float run = ctx.getParams()[1].getFloat();
58  float r = ctx.getParams()[2].getFloat();
59  float g = ctx.getParams()[3].getFloat();
60  float b = ctx.getParams()[4].getFloat();
61 
63 
64  fadeQuad.setColor(r, g, b);
65  fadeQuad.setWaitTime(wait);
66  fadeQuad.setRunTime(run);
67  fadeQuad.fadeOut();
68 }
69 
71  float wait = ctx.getParams()[0].getFloat();
72  float run = ctx.getParams()[1].getFloat();
73  float r = ctx.getParams()[2].getFloat();
74  float g = ctx.getParams()[3].getFloat();
75  float b = ctx.getParams()[4].getFloat();
76 
78 
79  fadeQuad.setColor(r, g, b);
80  fadeQuad.setWaitTime(wait);
81  fadeQuad.setRunTime(run);
82  fadeQuad.fadeIn();
83 }
84 
86  bool show = (ctx.getParams()[0].getInt() != 0);
87  int returnStrref = ctx.getParams()[1].getInt();
88  int returnQueryStrref = ctx.getParams()[2].getInt();
89 
90  if (show) {
91  _game->getModule().setReturnStrref(returnStrref);
92  _game->getModule().setReturnQueryStrref(returnQueryStrref);
93  } else {
94  // if the travel system is deactivated change the string to "Travelsystem deactivated"
96  }
98 }
99 
100 } // End of namespace KotOR
101 
102 } // End of namespace Engines
void setWaitTime(float wait)
Set the time to wait until fading begins.
Definition: fadequad.cpp:57
Context of an NWScript function.
void getPCSpeaker(Aurora::NWScript::FunctionContext &ctx)
void getNextPC(Aurora::NWScript::FunctionContext &ctx)
void setReturnQueryStrref(uint32 id)
Set the string for the return dialog.
Definition: module.cpp:867
void setReturnStrref(uint32 id)
Set the return string for the &#39;Return to Ebon Hawk&#39; button.
Definition: module.cpp:863
void setGlobalFadeIn(Aurora::NWScript::FunctionContext &ctx)
The context handling the gameplay in Star Wars: Knights of the Old Republic.
Utility templates and functions.
A container of Star Wars: Knights of the Old Republic objects.
void fadeIn()
Start a fade in.
Definition: fadequad.cpp:69
Graphics::Aurora::FadeQuad & getFadeQuad()
Return the fade quad.
Definition: module.cpp:185
void setReturnStrref(Aurora::NWScript::FunctionContext &ctx)
void getModule(Aurora::NWScript::FunctionContext &ctx)
Star Wars: Knights of the Old Republic engine functions.
void setReturnEnabled(bool enabled)
Enable or disable the &#39;Return to Ebon Hawk&#39; button.
Definition: module.cpp:871
void setColor(float r, float g, float b)
Set the current color of the quad.
Definition: fadequad.cpp:47
Module & getModule()
Return the module context.
Definition: game.cpp:65
void getFirstPC(Aurora::NWScript::FunctionContext &ctx)
void fadeOut()
Start a fade out.
Definition: fadequad.cpp:75
The context needed to run a Star Wars: Knights of the Old Republic module.
void setGlobalFadeOut(Aurora::NWScript::FunctionContext &ctx)
void setRunTime(float run)
Set the time the quad is fading.
Definition: fadequad.cpp:65
Creature * getPC()
Return the currently playing PC.
Definition: module.cpp:181