27 #include <boost/bind.hpp> 54 _engine(&engine), _maxSizeMusic(0) {
57 "Usage: listmusic\nList all available music resources");
59 "Usage: stopmusic\nStop the currently playing music resource");
61 "Usage: playmusic [<music>]\nPlay the specified music resource. " 62 "If none was specified, play the default area music.");
64 "Usage: move <x> <y> <z>\nMove to this position in the current area");
66 "Usage: listareas\nList all areas in the current module");
68 "Usage: gotoarea <area>\nMove to a specific area");
70 "Usage: listcampaigns\nList all campaigns");
72 "Usage: loadcampaign <campaign>\nLoads a campaign, " 73 "replacing the currently running one");
75 "Usage: listmodules\nList all modules");
77 "Usage: loadmodule <module>\nLoads a module, " 78 "replacing the currently running one");
100 if (musicDir.
empty())
108 if (!musicFiles.
getSubList(
".ogg",
true, oggFiles))
151 std::vector<Common::UString> args;
155 if ((args.size() < 3) ||
156 (std::sscanf(args[0].c_str(),
"%f", &x) != 1) ||
157 (std::sscanf(args[1].c_str(),
"%f", &y) != 1) ||
158 (std::sscanf(args[2].c_str(),
"%f", &z) != 1)) {
171 for (std::vector<Common::UString>::const_iterator a = areas.begin(); a != areas.end(); ++a)
182 for (std::vector<Common::UString>::const_iterator a = areas.begin(); a != areas.end(); ++a)
183 if (a->equalsIgnoreCase(cl.
args)) {
195 for (std::vector<Common::UString>::const_iterator c =
_campaigns.begin(); c !=
_campaigns.end(); ++c)
206 for (std::vector<Common::UString>::const_iterator c =
_campaigns.begin(); c !=
_campaigns.end(); ++c) {
207 if (c->equalsIgnoreCase(cl.
args)) {
220 for (std::vector<Common::UString>::const_iterator m =
_modules.begin(); m !=
_modules.end(); ++m) {
237 for (std::vector<Common::UString>::const_iterator m =
_modules.begin(); m !=
_modules.end(); ++m) {
238 if (m->equalsIgnoreCase(cl.
args)) {
void load(const Common::UString &campaign)
Load a campaign.
The context holding a The Witcher campaign.
#define ResMan
Shortcut for accessing the sound manager.
A class holding an UTF-8 string.
const Aurora::LocString & getName() const
Return the name of the current campaign.
The global config manager.
static void splitArguments(Common::UString argLine, std::vector< Common::UString > &args)
void cmdStopMusic(const CommandLine &cl)
Game & getGame()
Return the context running the actual game.
void cmdListMusic(const CommandLine &cl)
std::list< UString >::const_iterator const_iterator
void cmdLoadModule(const CommandLine &cl)
void cmdPlayMusic(const CommandLine &cl)
static void getCampaigns(std::vector< Common::UString > &campaigns)
Return a list of all campaigns.
std::vector< Common::UString > _music
All known music resources.
const Common::UString & getString(Language language, LanguageGender gender=kLanguageGenderCurrent) const
Get the string of that language.
void cmdListAreas(const CommandLine &cl)
Module & getModule()
Return the module context.
The Witcher (debug) console.
static void getModules(std::vector< Common::UString > &modules)
Return a list of all modules.
const char * c_str() const
Return the (utf8 encoded) string data.
Basic Aurora graphics types.
Utility templates and functions.
void cmdMove(const CommandLine &cl)
const Aurora::IFOFile & getIFO() const
Return the IFO of the currently loaded module.
const char * kSystemFontMono
Identifier used for the monospaced system font.
const std::vector< Common::UString > & getAreas() const
Return the list of areas in the module.
void cmdListModules(const CommandLine &cl)
void printList(const std::vector< Common::UString > &list, size_t maxSize=0)
bool empty() const
Is the string empty?
std::vector< Common::UString > _campaigns
All known campaigns.
void cmdLoadCampaign(const CommandLine &cl)
void stopMusic()
Force all currently playing music stopped.
void cmdGotoArea(const CommandLine &cl)
static UString getStem(const UString &p)
Return a file name's stem.
bool getSubList(const UString &str, bool caseInsensitive, FileList &subList) const
Add files ending with the given string into another FileList.
Console(WitcherEngine &engine)
const Aurora::LocString & getName() const
Return the module's name.
The context needed to run a The Witcher module.
The context holding a The Witcher area.
void printf(const char *s,...) GCC_PRINTF(2
const_iterator begin() const
Return a const_iterator pointing to the beginning of the list.
bool addDirectory(const UString &directory, int recurseDepth=0)
Add a directory to the list.
Generic Aurora engines utility functions.
Campaign & getCampaign()
Return the campaign context.
Engine class handling The Witcher.
virtual void updateCaches()
void printCommandHelp(const Common::UString &cmd)
The context handling the gameplay in The Witcher.
const Aurora::LocString & getName() const
Return the area's name.
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)
void playMusic(const Common::UString &music="")
Overwrite all currently playing music.
The global resource manager for Aurora resources.
Utility class for manipulating file paths.
const_iterator end() const
Return a const_iterator pointing past the end of the list.
std::vector< Common::UString > _modules
All known modules.
static UString findSubDirectory(const UString &directory, const UString &subDirectory, bool caseInsensitive=false)
Find a directory's subdirectory.
void loadModule(const Common::UString &module)
Load a stand-alone module as a campaign.
void movePC(const Common::UString &area)
Move the player character to this area.
void cmdListCampaigns(const CommandLine &cl)