 |
Blamite Game Engine - blam!
00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
|
Go to the documentation of this file. 1 #include "../console.h"
3 #include <Strings/components/utils/io/io.h>
20 description =
"saves a file called hs_doc.txt with parameters for all script commands and globals.";
22 syntax =
"script_doc [quiet]";
27 BlamResult
Execute(std::vector<std::string> arguments)
31 if (arguments.size() > 0)
33 if (arguments[0] ==
"quiet")
39 std::string doc_contents =
"";
43 doc_contents +=
"== Built-in Commands ==";
44 doc_contents +=
"\n\n\n\n";
47 std::map<std::string, BlamConsoleCommand*>::iterator
it;
49 for (
it = commands.begin();
it != commands.end();
it++)
55 std::string syntax_line =
"(";
57 syntax_line += command->
name;
62 syntax_line += command->
syntax;
67 doc_contents += syntax_line;
71 if (command->
aliases.size() > 0)
73 doc_contents +=
"\n\n";
75 std::string aliases_line =
"aliases: [";
77 for (
int i = 0; i < command->
aliases.size(); i++)
79 std::string alias = command->
aliases.at(i);
81 aliases_line += alias;
83 if (i != command->
aliases.size() - 1)
91 doc_contents += aliases_line;
97 doc_contents +=
"\n\n";
103 doc_contents +=
"\n\n";
104 doc_contents +=
"NETWORK SAFE: Unspecified (networking is not available yet)";
107 doc_contents +=
"\n\n\n\n";
113 doc_contents +=
"== Commands ==";
114 doc_contents +=
"\n\n\n\n";
121 doc_contents +=
"== Script Globals ==";
122 doc_contents +=
"\n\n\n\n";
125 std::map<std::string, BlamEngineGlobal>::iterator
it;
133 if (
it->second.read_only)
135 global_line +=
" [protected]";
138 doc_contents += global_line;
141 if (
it->second.info !=
"")
143 doc_contents +=
"\n";
144 doc_contents +=
it->second.info;
147 doc_contents +=
"\n\n";
151 std::string file_path = *
ENGINE_CFG->GetString(
"paths",
"game_data_root") +
"/hs_doc.txt";
153 BlamStrings::Utils::IO::CreateNewFile(file_path, doc_contents);
162 return BlamResult::Success_OK;
BLAM bool OpenLocalURL(std::string url)
Opens a local file with the user's default application.
Definition: keystone.cpp:84
@ Builtin
A command that is hard-coded into the engine.
ScriptDocCommand()
Definition: script_doc.hpp:17
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:34
BlamResult Execute(std::vector< std::string > arguments)
Called upon command execution.
Definition: script_doc.hpp:27
Class used to represent a console command.
Definition: console.h:31
#define ENGINE_CFG
Macro to allow quicker access to the main configuration file.
Definition: config.h:20
std::string name
The name of the console command.
Definition: console.h:33
ARPHIC PUBLIC LICENSE Ltd Yung Chi Taiwan All rights reserved except as specified below Everyone is permitted to copy and distribute verbatim copies of this license but changing it is forbidden Preamble The licenses for most software are designed to take away your freedom to share and change it By the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software Legal Terms Font means the TrueType fonts AR PL Mingti2L AR PL KaitiM AR PL KaitiM and the derivatives of those fonts created through any modification including modifying reordering converting changing font or adding deleting some characters in from glyph table PL means Public License Copyright Holder means whoever is named in the copyright or copyrights for the Font You means the or person redistributing or modifying the Font Freely Available means that you have the freedom to copy or modify the Font as well as redistribute copies of the Font under the same conditions you not price If you you can charge for this service Copying &Distribution You may copy and distribute verbatim copies of this Font in any without provided that you retain this license including modifying reordering converting changing font or adding deleting some characters in from glyph and copy and distribute such modifications under the terms of Section provided that the following conditions are such as by offering access to copy the modifications from a designated or distributing the modifications on a medium customarily used for software interchange c If the modified fonts normally reads commands interactively when you must cause it
Definition: ARPHICPL.TXT:36
BLAM std::map< std::string, BlamConsoleCommand * > GetCommandList()
Retrieves the list of all loaded console commands.
Definition: console.cpp:228
BLAM std::string GetGlobalTypeLabel(BlamGlobalType type)
Retrieves a string representation of a global's type, for use in UI.
Definition: globals.cpp:40
Class for the script_doc command.
Definition: script_doc.hpp:14
std::string syntax
The syntax information for the command. Shown to the user when using the help command with an argumen...
Definition: console.h:35
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition: console.h:38
std::vector< std::string > aliases
A list of aliases for the command. Executing any of these instead of the command name will behave the...
Definition: console.h:36
Namespace for things relating to the debug console.
Definition: abort.hpp:5
BLAM std::map< std::string, BlamEngineGlobal > * GetGlobalsList()
Retrieves the list of loaded globals.
Definition: globals.cpp:22