27 #include <boost/bind.hpp> 53 _engine(&engine), _maxSizeMusic(0) {
56 "Usage: exitmodule\nExit the module, returning to the main menu");
58 "Usage: listmodules\nList all modules");
60 "Usage: loadmodule <module>\nLoad and enter the specified module");
62 "Usage: listmusic\nList all available music resources");
64 "Usage: stopmusic\nStop the currently playing music resource");
66 "Usage: playmusic [<music>]\nPlay the specified music resource. " 67 "If none was specified, play the default area music.");
69 "Usage: flycam\nToggle free roam camera mode");
71 "Usage: showwalkmesh\nToggle walkmesh display");
73 "Usage: showtriggers\nToggle triggers display");
75 "Usage: getpcroom\nGet a room PC is in");
77 "Usage: listroomsvisiblefrom <room>\nList rooms that are visible from the specified room");
79 "Usage: playanim <base> [<head>]\nPlay the specified animations on the active object");
81 "Usage: additem <item> [<count>]\nAdd the specified item to the active object");
128 for (std::vector<Common::UString>::iterator m =
_modules.begin(); m !=
_modules.end(); ++m)
138 for (std::vector<Common::UString>::iterator m =
_modules.begin(); m !=
_modules.end(); ++m) {
139 if (m->equalsIgnoreCase(cl.
args)) {
186 for (std::vector<Common::UString>::const_iterator r = rooms.begin();
187 r != rooms.end(); ++r) {
197 std::vector<Common::UString> anims;
199 size_t animCount = anims.size();
201 animCount >= 2 ? anims[1] :
"");
210 std::vector<Common::UString> args;
213 if (args.size() >= 2)
#define ResMan
Shortcut for accessing the sound manager.
const std::vector< Common::UString > & getRoomsVisibleFrom(const Common::UString &room) const
Game & getGame()
Return the context running the actual game.
void cmdLoadModule(const CommandLine &cl)
void cmdExitModule(const CommandLine &cl)
static UString getExtension(const UString &p)
Return a file name's extension.
void cmdStopMusic(const CommandLine &cl)
The global config manager.
void addItemToActiveObject(const Common::UString &item, int count)
void cmdPlayAnim(const CommandLine &cl)
A room within a Star Wars: Knights of the Old Republic area.
void playMusic(const Common::UString &music="")
Overwrite all currently playing music.
std::vector< Common::UString > _modules
All known modules.
Console(KotOREngine &engine)
void cmdGetPCRoom(const CommandLine &cl)
void cmdPlayMusic(const CommandLine &cl)
bool equalsIgnoreCase(const UString &str) const
std::list< UString >::const_iterator const_iterator
void load(const Common::UString &module, const Common::UString &entryLocation="", ObjectType entryLocationType=kObjectTypeAll)
Load a module.
Utility templates and functions for working with strings and streams.
void stopMusic()
Force all currently playing music stopped.
void cmdListModules(const CommandLine &cl)
void cmdShowWalkmesh(const CommandLine &cl)
const char * c_str() const
Return the (utf8 encoded) string data.
Star Wars: Knights of the Old Republic (debug) console.
void toggleFreeRoamCamera()
Basic Aurora graphics types.
The context handling the gameplay in Star Wars: Knights of the Old Republic.
Utility templates and functions.
Engine class handling Star Wars: Knights of the Old Republic.
Room * getRoom()
Get a room the object is in.
Common::UString getResRef() const
const char * kSystemFontMono
Identifier used for the monospaced system font.
const Common::UString & getName() const
Return the module's name.
void printList(const std::vector< Common::UString > &list, size_t maxSize=0)
bool empty() const
Is the string empty?
The context holding a Star Wars: Knights of the Old Republic area.
static void getModules(std::vector< Common::UString > &modules)
Return a list of all modules.
void cmdListRoomsVisibleFrom(const CommandLine &cl)
std::vector< Common::UString > _music
All known music resources.
static UString getStem(const UString &p)
Return a file name's stem.
void cmdFlyCam(const CommandLine &cl)
Module & getModule()
Return the module context.
void cmdShowTriggers(const CommandLine &cl)
void playAnimationOnActiveObject(const Common::UString &baseAnim, const Common::UString &headAnim)
void printf(const char *s,...) GCC_PRINTF(2
const_iterator begin() const
Return a const_iterator pointing to the beginning of the list.
virtual void updateCaches()
void printCommandHelp(const Common::UString &cmd)
void split(iterator splitPoint, UString &left, UString &right, bool remove=false) const
The context needed to run a Star Wars: Knights of the Old Republic module.
Area * getCurrentArea()
Return the area the PC is currently in.
void setArguments(const Common::UString &cmd, const std::vector< Common::UString > &args)
void parseString(const UString &str, T &value, bool allowEmpty)
Parse a string into any POD integer, float/double or bool type.
bool registerCommand(const Common::UString &cmd, const CommandCallback &callback, const Common::UString &help)
The global resource manager for Aurora resources.
Utility class for manipulating file paths.
void cmdAddItem(const CommandLine &cl)
const_iterator end() const
Return a const_iterator pointing past the end of the list.
static UString findSubDirectory(const UString &directory, const UString &subDirectory, bool caseInsensitive=false)
Find a directory's subdirectory.
void exit()
Exit the currently running module.
void cmdListMusic(const CommandLine &cl)
Creature * getPC()
Return the currently playing PC.