27 #include <boost/bind.hpp> 49 _engine(&engine), _maxSizeMusic(0) {
52 "Usage: listmusic\nList all available music resources");
54 "Usage: stopmusic\nStop the currently playing music resource");
56 "Usage: playmusic [<music>]\nPlay the specified music resource. " 57 "If none was specified, play the default area music.");
59 "Usage: move <x> <y> <z>\nMove to this position in the current area");
61 "Usage: listareas\nList all areas in the current module");
63 "Usage: gotoarea <area>\nMove to a specific area");
65 "Usage: listcampaigns\nList all campaigns");
67 "Usage: loadcampaign <campaign>\nLoads a campaign, " 68 "replacing the currently running one");
70 "Usage: listmodules\nList all modules");
72 "Usage: loadmodule <module>\nLoads a module, " 73 "replacing the currently running one");
92 std::list<Aurora::ResourceManager::ResourceID> music;
95 for (std::list<Aurora::ResourceManager::ResourceID>::const_iterator m = music.begin();
96 m != music.end(); ++m) {
137 std::vector<Common::UString> args;
141 if ((args.size() < 3) ||
142 (std::sscanf(args[0].c_str(),
"%f", &x) != 1) ||
143 (std::sscanf(args[1].c_str(),
"%f", &y) != 1) ||
144 (std::sscanf(args[2].c_str(),
"%f", &z) != 1)) {
157 for (std::vector<Common::UString>::const_iterator a = areas.begin(); a != areas.end(); ++a)
168 for (std::vector<Common::UString>::const_iterator a = areas.begin(); a != areas.end(); ++a)
169 if (a->equalsIgnoreCase(cl.
args)) {
181 for (std::vector<Common::UString>::const_iterator c =
_campaigns.begin(); c !=
_campaigns.end(); ++c)
192 for (std::vector<Common::UString>::const_iterator c =
_campaigns.begin(); c !=
_campaigns.end(); ++c) {
193 if (c->equalsIgnoreCase(cl.
args)) {
206 for (std::vector<Common::UString>::const_iterator m =
_modules.begin(); m !=
_modules.end(); ++m) {
223 for (std::vector<Common::UString>::const_iterator m =
_modules.begin(); m !=
_modules.end(); ++m) {
224 if (m->equalsIgnoreCase(cl.
args)) {
#define ResMan
Shortcut for accessing the sound manager.
void cmdLoadModule(const CommandLine &cl)
The context handling the gameplay in Neverwinter Nights 2.
Neverwinter Nights 2 (debug) console.
A class holding an UTF-8 string.
static void splitArguments(Common::UString argLine, std::vector< Common::UString > &args)
void cmdGotoArea(const CommandLine &cl)
The context holding a Neverwinter Nights 2 campaign.
void cmdListAreas(const CommandLine &cl)
The context holding a Neverwinter Nights 2 area.
static void getCampaigns(std::vector< Common::UString > &campaigns)
Return a list of all campaigns.
const Common::UString & getName()
Return the area's localized name.
std::vector< Common::UString > _modules
All known modules.
void loadModule(const Common::UString &module)
Load a stand-alone module as a campaign.
The context needed to run a Neverwinter Nights 2 module.
const Common::UString & getName() const
Return the module's name.
const char * c_str() const
Return the (utf8 encoded) string data.
Basic Aurora graphics types.
Utility templates and functions.
void load(const Common::UString &campaign)
Load a campaign.
void cmdLoadCampaign(const CommandLine &cl)
void playMusic(const Common::UString &music="")
Overwrite all currently playing music.
void cmdListCampaigns(const CommandLine &cl)
const char * kSystemFontMono
Identifier used for the monospaced system font.
static void getModules(std::vector< Common::UString > &modules)
Return a list of all modules.
const std::vector< Common::UString > & getAreas() const
Return the list of areas in the module.
void printList(const std::vector< Common::UString > &list, size_t maxSize=0)
const Common::UString & getName() const
Return the name of the current campaign.
bool empty() const
Is the string empty?
Console(NWN2Engine &engine)
void movePC(const Common::UString &area)
Move the player character to this area.
std::vector< Common::UString > _music
All known music resources.
void cmdListModules(const CommandLine &cl)
void cmdMove(const CommandLine &cl)
void cmdStopMusic(const CommandLine &cl)
void printf(const char *s,...) GCC_PRINTF(2
Game & getGame()
Return the context running the actual game.
Campaign & getCampaign()
Return the campaign context.
void cmdListMusic(const CommandLine &cl)
void stopMusic()
Force all currently playing music stopped.
virtual void updateCaches()
void printCommandHelp(const Common::UString &cmd)
Engine class handling Neverwinter Nights 2.
const Aurora::IFOFile & getIFO() const
Return the IFO of the currently loaded module.
void cmdPlayMusic(const CommandLine &cl)
std::vector< Common::UString > _campaigns
All known campaigns.
Module & getModule()
Return the module context.
void setArguments(const Common::UString &cmd, const std::vector< Common::UString > &args)
bool registerCommand(const Common::UString &cmd, const CommandCallback &callback, const Common::UString &help)
The global resource manager for Aurora resources.
Audio, MP3 with extra header.