51 if (commandString.length() >= 1) {
53 if (commandString.at(0) ==
'/') {
54 const string::size_type commandEnd = commandString.find(
' ', 1);
55 string command = commandString.substr(1, commandEnd - 1);
56 string commandArgs = commandString.substr(commandEnd + 1, commandString.length() - (commandEnd + 1));
58 if (commandString != commandArgs) {
62 for (
auto& it : command) {
63 it =
static_cast<char>(tolower(it));
96 for (
const CommandMap::value_type& it :
_commands) {
97 if (it.first !=
_ID(
"invalidhelp") &&
98 it.first !=
_ID(
"invalidcommand")) {
112 if (
context().paramHandler().isParam<string>(
_ID(args.c_str()))) {
114 "N/A",
"N/A",
"N/A");
121 const ResourcePath filename(Paths::g_assetsLocation / args);
123 const std::ifstream soundfile(filename.
string().c_str() );
139 sound.assetLocation(data.
_path);
141 if (filename.
string().find(
"music") != string::npos) {
156 auto& sceneGraph = sMgr->activeProject()->getActiveScene()->sceneGraph();
164 auto& aiManager = sceneGraph->parentScene().aiManager();
173 temp->
setFileName( sMgr->activeProject()->getActiveScene()->resourceName());
175 bool loaded = temp->
load(sceneGraph->getRoot());
181 temp->
save(sceneGraph->getRoot());
200 const I32 FoV = CLAMPED<I32>(atoi(args.c_str()), 40, 140);
bool save(const SceneGraphNode *sgn)
Save the NavigationMesh to a file.
DELEGATE< void, NavigationMesh * > CreationCallback
bool build(SceneGraphNode *sgn, CreationCallback creationCompleteCallback, bool threaded=true)
void setFileName(const Str< 256 > &fileName)
bool load(const SceneGraphNode *sgn)
Load a saved NavigationMesh from a file.
void RequestShutdown(bool clearCache) noexcept
static Camera * playerCamera(const Divide::ProjectManager *mgr, const bool skipOverride=false) noexcept
void setHorizontalFoV(Angle::DEGREES< F32 > horizontalFoV) noexcept
hashMap< U64, DELEGATE< void, string > > _commands
void handleNavMeshCommand(const string &args)
void handleHelpCommand(const string &args)
void handleEditParamCommand(const string &args)
Handle< AudioDescriptor > _sound
used for sound playback
hashMap< U64, const char * > _commandHelp
Help text for every command.
void handleShaderRecompileCommand(const string &args)
void handleFOVCommand(const string &args)
void handleQuitCommand(const string &args)
void handleInvalidCommand(const string &args)
GUIConsoleCommandParser(PlatformContext &context)
void handleSayCommand(const string &args)
void handlePlaySoundCommand(const string &args)
bool processCommand(const string &commandString) override
If we need a parser , just override this.
PlatformContext & context() noexcept
PlatformContext & _context
Application & app() noexcept
Kernel & kernel() noexcept
SFXDevice & sfx() noexcept
AI::Navigation::DivideRecast * recast() const noexcept
void playMusic(Handle< AudioDescriptor > music) override
void playSound(Handle< AudioDescriptor > sound) override
void stopMusic() override
static bool RecompileShaderProgram(const std::string_view name)
Queue a shaderProgram recompile request.
bool IsNumber(const T_str &s)
Handle console commands that start with a forward slash.
bool hasExtension(const ResourcePath &filePath, const std::string_view extensionNoDot)
F32 FoV(const GFXShaderData::CamData &dataIn) noexcept
constexpr U64 _ID(const char *const str, const U64 value=val_64_const) noexcept
FORCE_INLINE Handle< T > CreateResource(const ResourceDescriptor< T > &descriptor, bool &wasInCache, std::atomic_uint &taskCounter)
FileNameAndPath splitPathToNameAndLocation(const ResourcePath &input)
static NO_INLINE void errorfn(const char *format, T &&... args)
static NO_INLINE void printfn(const char *format, T &&... args)
StringReturnType< N > string() const noexcept