Blamite Game Engine - blam!  00272.10.26.20.0001.blamite
The core library for the Blamite Game Engine.
regenerate_debug_menu.hpp
Go to the documentation of this file.
1 #include "../console.h"
2 
6 
7 namespace Blam::Console
8 {
16  {
17  public:
19  {
20  name = "regenerate_debug_menu";
21  description = "Reloads debug_menu_init.xml and rebuilds the debug menu contents";
22  aliases = { "regendebugmenu", "reloadmenu", "rdm" };
23 
25  }
26 
28  {
29  delete this;
30  }
31 
32  CommandStatus onCommand(std::vector<std::string> arguments)
33  {
34  using namespace BlamRendering::RenderStack;
35 
37 
38  StackObjectBase* stack_item = GetStackItem("debug_menu");
39 
40  if (stack_item)
41  {
43 
44  if (debug_menu_item->visible == true)
45  {
46  debug_menu_item->toggleVisibility();
47  }
48 
50  Blam::Logger::LogEventForce("debug menu reloaded, please re-open the menu", WSV_NONE);
51  }
52  else
53  {
54  Blam::Logger::LogEventForce("failed to fetch debug menu item from render stack, could not regenerate menu", WSV_ERROR);
55  }
56 
57  return CommandStatus::Ok;
58  }
59  };
60 }
Blam::Console::ConsoleCommand::aliases
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:75
Blam::DebugMenu::GetDebugMenu
BLAM Menu GetDebugMenu()
Retrieves the debug menu data.
Definition: debug_menu.cpp:26
Blam::Console::ConsoleCommand::description
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:73
Blam::Console::ConsoleCommand::type
CommandType type
The type of command this is. See Blam::Console::CommandType for more information.
Definition: console.h:77
Blam::DebugMenu::Menu::title
std::string title
The title of the main page of the debug menu. Defaults to Main.
Definition: blam_ui.h:114
Blam::DebugMenu::ReloadDebugMenu
BLAM void ReloadDebugMenu()
Clears all existing data for the debug menu and reloads it from the file.
Definition: debug_menu.cpp:356
Blam::Console::CommandStatus
CommandStatus
Indicates the return state of a console command.
Definition: console.h:28
logger.h
BlamRendering::RenderStack
Namespace containing things relating to the Render Stack.
Definition: drawing.h:14
Blam::Console::Builtin
@ Builtin
A command that is hard-coded into the engine.
Definition: console.h:41
Blam::Console::ConsoleCommand::name
std::string name
The name of the console command.
Definition: console.h:70
BlamRendering::RenderStack::DebugMenu
Stack item representing the debug menu.
Definition: debug_menu.hpp:20
BlamRendering::RenderStack::DebugMenu::toggleVisibility
void toggleVisibility()
Toggles the visibility of the debug menu.
Definition: debug_menu.hpp:602
WSV_ERROR
#define WSV_ERROR
Macro for 'Error' log seveirty. Original pre-enum value was 2.
Definition: logger.h:17
Blam::DebugMenu::Menu::items
std::vector< MenuItem > items
The list of items within the debug menu.
Definition: blam_ui.h:116
Blam::Console::RegenDebugMenuCommand::RegenDebugMenuCommand
RegenDebugMenuCommand()
Definition: regenerate_debug_menu.hpp:18
debug_menu.hpp
Blam::Console::RegenDebugMenuCommand::~RegenDebugMenuCommand
~RegenDebugMenuCommand()
Definition: regenerate_debug_menu.hpp:27
WSV_NONE
#define WSV_NONE
Macro for 'None' log seveirty. Original pre-enum value was 0.
Definition: logger.h:15
Blam::Console::RegenDebugMenuCommand
Class for the regenerate_debug_menu command.
Definition: regenerate_debug_menu.hpp:15
BlamRendering::RenderStack::DebugMenu::BuildMenuList
void BuildMenuList(std::vector< Blam::DebugMenu::MenuItem > item_list, std::string menu_title)
Rebuilds the menu contents.
Definition: debug_menu.hpp:470
blam_ui.h
Blam::Console
Namespace for things relating to the debug console.
Definition: abort.hpp:5
Blam::Console::ConsoleCommand
Class used to represent a console command.
Definition: console.h:50
Blam::Logger::LogEventForce
BLAM void LogEventForce(std::string message, LogSeverity severity)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:150
BlamRendering::RenderStack::StackObjectBase
Base class for all render stack objects.
Definition: render_stack.h:194
BlamRendering::RenderStack::DebugMenu::visible
bool visible
Whether or not the menu should be displayed.
Definition: debug_menu.hpp:63
Blam::Globals::Ok
@ Ok
The global was updated successfully.
Definition: globals.h:202
Blam::Console::RegenDebugMenuCommand::onCommand
CommandStatus onCommand(std::vector< std::string > arguments)
Called upon command execution.
Definition: regenerate_debug_menu.hpp:32
BlamRendering::RenderStack::GetStackItem
BLAM StackObjectBase * GetStackItem(std::string id)
Retrieves an item from the render stack.
Definition: render_stack.cpp:75