Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
menubar.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
6 
7 #ifndef BLAM
8 #define BLAM
9 #endif
10 
11 #define MENUBAR_FILE "menu_bar_init.xml"
12 
13 
19 {
20  Menu,
21  MenuItem,
22  Label,
23  Separator,
24  Undefined
25 };
26 
34 {
36  Command,
37  Global,
39 };
40 
45 {
48 
49  std::string name;
50  std::string variable;
51  std::string shortcut;
52  bool has_shortcut;
53  bool enabled;
54 
55  BlamColor color;
57 
58  std::vector<BlamMenubarItem> items;
59 
61  {
64 
65  name = "default";
66  variable = "";
67  shortcut = "";
68  has_shortcut = false;
69  enabled = true;
70 
71  color = BlamColor(255, 255, 255, 255);
72  override_color = false;
73  }
74 };
75 
80 {
81  std::vector<BlamMenubarItem> items;
82  int version = -1;
83 };
84 
92 {
96  BLAM void LoadMenubarLayout();
97 
101  BLAM void ReloadMenubar();
102 
106  BLAM void ReleaseMenubar();
107 
114 }
BlamMenubarItem
Structure representing a menu bar item.
Definition: menubar.h:44
verify_engine_folder_mappings
void verify_engine_folder_mappings()
Definition: paths.cpp:28
Blam::Settings::Menubar::LoadMenubarLayout
BLAM void LoadMenubarLayout()
Loads the menu bar data from disk.
Definition: menubar.cpp:252
BlamUserDataFolder::Screenshots
@ Screenshots
Directory used to store engine screenshots. Defaults to {DataRoot}/screenshots/.
Blam::Settings::Config::GetEngineConfiguration
BLAM BlamConfigurationFile * GetEngineConfiguration()
Definition: config.cpp:58
BlamUserDataFolder::Mods
@ Mods
Directory storing user-created mod packages. Defaults to {DataRoot}/mods/.
Blam::EngineText::LookupString
BLAM std::string LookupString(std::string id)
Finds a string with a given ID.
Definition: engine_text.cpp:36
ENGINE_CFG_SECTION
#define ENGINE_CFG_SECTION(section_name)
Macro to quickly access a configuration section from the engine configuration file.
Definition: config.h:29
BlamMenubarItem::override_color
bool override_color
Whether or not the label has a custom color set.
Definition: menubar.h:56
BlamMenubarItem::variable
std::string variable
The item variable. Will either be the command to run upon clicking, or the label text.
Definition: menubar.h:50
Blam::Settings::Paths::GetUserDataFolderFromString
BLAM BlamUserDataFolder GetUserDataFolderFromString(std::string folder)
Attempts to convert a string to the equivalent user data folder.
Definition: paths.cpp:344
BlamUserDataFolder::Reports
@ Reports
Directory used to store the latest report (log) files. Defaults to {DataRoot}/reports/.
Blam::Settings::Paths::GetDefaultEngineDataPath
BLAM std::string GetDefaultEngineDataPath(BlamEngineDataFolder folder)
Retrieves a default value of a given engine data directory.
Definition: paths.cpp:138
Blam::Settings::Menubar::ReleaseMenubar
BLAM void ReleaseMenubar()
Releases the menu bar resources from memory.
Definition: menubar.cpp:358
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:142
BlamEngineDataFolder::DataRoot
@ DataRoot
The root of all game engine data. Defaults to ./
BlamUserDataFolder::Extensions
@ Extensions
Directory storing user-created extensions. Defaults to {DataRoot}/extensions/.
BlamMenubarItem::color
BlamColor color
The color of the label.
Definition: menubar.h:55
color
BlamColor color
Typedef for a color field, used in tag definitions.
Definition: tags.h:359
BlamMenubar
Structure representing the menu bar.
Definition: menubar.h:79
BLAM
#define BLAM
Definition: menubar.h:8
BlamMenubar::version
int version
The menu file version.
Definition: menubar.h:82
logger.h
menubar.h
BlamEngineDataFolder::Tags
@ Tags
Directory used for reading engine tags. Defaults to ./tags/
Blam::Placeholders::ApplyPlaceholders
BLAM std::string ApplyPlaceholders(std::string string)
Replaces any and all placeholder tags in the specified string with their evaulated values.
Definition: placeholders.cpp:22
BlamMenubarItemType::Separator
@ Separator
A separator item.
BlamUserDataFolder::Plugins
@ Plugins
Directory used to store customized plugin files for use with the Editing Kit. Defaults to {DataRoot}/...
BlamMenubarItemType::Menu
@ Menu
A submenu within the menu.
engine_text.h
USER_DATA_PATH
#define USER_DATA_PATH(path)
Macro to quickly access a user data folder.
Definition: config.h:43
Blam::Settings::Paths::GetEngineDataPath
BLAM std::string GetEngineDataPath(BlamEngineDataFolder folder)
Retrieves the configured value of a given engine directory.
Definition: paths.cpp:205
BlamEngineDataFolder::Fonts
@ Fonts
Directory used for game engine fonts. Defaults to ./maps/fonts/
BlamUserDataFolder::LogArchives
@ LogArchives
Directory used to store previous log archives. Defaults to {DataRoot}/logs/.
Blam::Settings::Config::GetConfiguration
BLAM BlamConfigurationFile * GetConfiguration(std::string filename)
Definition: config.cpp:70
BlamEngineDataFolder
BlamEngineDataFolder
Enumerator listing all possible engine data folders.
Definition: config.h:59
BlamUserDataFolder::Cache
@ Cache
Directory used to store any cached data used by the engine (not to be confused with ....
BlamMenubarItem::enabled
bool enabled
Whether or not this menu item is enabled and can be clicked.
Definition: menubar.h:53
BlamCommandType::Global
@ Global
A command that is used to modify a global.
user_folder_mappings
std::map< BlamUserDataFolder, std::string > user_folder_mappings
Definition: paths.cpp:8
MENUBAR_FILE
#define MENUBAR_FILE
The filename of the menu bar layout.
Definition: menubar.h:11
menu_bar_data
BlamMenubar * menu_bar_data
The currently loaded menu bar data.
Definition: menubar.cpp:13
Blam::Settings::Paths::GetDefaultUserDataPath
BLAM std::string GetDefaultUserDataPath(BlamUserDataFolder folder)
Retrieves a default value of a given user data directory.
Definition: paths.cpp:64
expand_section_placeholders
void expand_section_placeholders(BlamConfigurationSection *section, std::string filename)
Definition: placeholder_expand.cpp:133
Blam::Settings::Config::ExpandFilePlaceholders
BLAM void ExpandFilePlaceholders(BlamConfigurationFile *file)
Definition: placeholder_expand.cpp:143
load_menu_bar_item
bool load_menu_bar_item(rapidxml::xml_node<> *menu_item_node, BlamMenubarItem *item)
Parses a menu bar item from an XML node.
Definition: menubar.cpp:23
BlamUserDataFolder
BlamUserDataFolder
Enumerator listing all possible user data folders.
Definition: config.h:86
Blam::EngineText::StringExists
BLAM bool StringExists(std::string id)
Looks through the list of loaded engine strings to see if a given string has been loaded.
Definition: engine_text.cpp:70
verify_path
std::string verify_path(std::string _path)
Definition: paths.cpp:45
BlamMenubarItemType::Label
@ Label
A non-clickable text label.
ENGINE_DATA_PATH
#define ENGINE_DATA_PATH(path)
Macro to quickly access a game engine data folder.
Definition: config.h:36
engine_folder_mappings
std::map< BlamEngineDataFolder, std::string > engine_folder_mappings
Definition: paths.cpp:9
BlamMenubarItemVariableType::Command
@ Command
Indicates the menu item will execute a command upon being clicked.
Blam::Settings::Paths::ParseFolderPlaceholders
BLAM std::string ParseFolderPlaceholders(std::string string)
Parses any engine/user data folder placeholders within a string.
Definition: paths.cpp:382
BlamEngineDataFolder::Resources
@ Resources
Directory containing other resources and data, usually string tables and globals. Defaults to ....
globals.h
BlamUserDataFolder::Maps
@ Maps
Directory storing user-installed cache files. Defaults to {DataRoot}/maps/.
verify_user_folder_mappings
void verify_user_folder_mappings()
Definition: paths.cpp:11
BlamEngineDataFolder::Extensions
@ Extensions
Directory used for engine extensions. Defaults to ./extensions/
BlamEngineDataFolder::Maps
@ Maps
Directory used for storing built-in cache files. Defaults to ./maps/
it
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
BlamMenubarItem::type
BlamMenubarItemType type
The type of this menu item.
Definition: menubar.h:46
BlamMenubarItemVariableType::Unimplemented
@ Unimplemented
Indicates the menu item is a placeholder item intended for future use.
BlamEngineDataFolder::DefaultConfigs
@ DefaultConfigs
Directory containing default configuration files. Defaults to ./content/blam/default_configs/
Blam::Settings::Menubar::GetMenuBar
BLAM BlamMenubar * GetMenuBar()
Retrieves the menu bar data.
Definition: menubar.cpp:370
BlamDebugMenuItemType::Command
@ Command
Runs a console command upon activation.
file
sock planetquake com All rights reserved Quake III Arena is a registered trademark of id Inc This level may be electronically distributed only at NO CHARGE to the recipient in its current MUST include this txt file
Definition: chiropteraDM.txt:95
BlamMenubarItem::shortcut
std::string shortcut
The menu item shortcut label. Cosmetic only.
Definition: menubar.h:51
BlamMenubarItem::items
std::vector< BlamMenubarItem > items
List of all child items in this submenu.
Definition: menubar.h:58
BlamCompositorPassType::Undefined
@ Undefined
BlamMenubarItem::var_type
BlamMenubarItemVariableType var_type
The type of variable the menu item uses.
Definition: menubar.h:47
BlamMenubarItemType::MenuItem
@ MenuItem
A standard menu item.
BlamEngineDataFolder::Plugins
@ Plugins
Directory used to store built-in plugin files for use with the Editing Kit. Defaults to ....
Blam::Settings::Menubar::ReloadMenubar
BLAM void ReloadMenubar()
Reloads the menu bar data from disk.
Definition: menubar.cpp:352
Blam::Settings::Menubar
Namespace for things related to the imgui menu bar.
Definition: menubar.h:91
BlamMenubarItem::has_shortcut
bool has_shortcut
Whether or not this item has a shortcut label.
Definition: menubar.h:52
Blam::Settings::Paths::GetUserDataPath
BLAM std::string GetUserDataPath(BlamUserDataFolder folder)
Retrieves the configured value of a given user directory.
Definition: paths.cpp:275
BlamMenubar::items
std::vector< BlamMenubarItem > items
List of all items in this menu.
Definition: menubar.h:81
config.h
BlamMenubarItem::name
std::string name
The item name.
Definition: menubar.h:49
placeholders.h
BlamUserDataFolder::DataRoot
@ DataRoot
The root of all user data. Defaults to BlamStrings::Utils::IO::GetEngineDataRoot().
BlamEngineDataFolder::Gallery
@ Gallery
Directory containing general-purpose images. Defaults to ./content/Gallery/
BlamMenubarItemType
BlamMenubarItemType
Enumerator containing all possible types of menu bar items.
Definition: menubar.h:18
BlamMenubarItemVariableType::Global
@ Global
Indicates the menu item will modify an engine global.
BlamEngineDataFolder::Content
@ Content
Directory containing general-purpose resources. Defaults to ./content/
BlamUserDataFolder::Tags
@ Tags
Directory storing user-created tags. Defaults to {DataRoot}/tags/.
BlamMenubarItemVariableType
BlamMenubarItemVariableType
Enumerator containing all possible types of menu bar item variables.
Definition: menubar.h:33
generate_default_menubar
bool generate_default_menubar()
Definition: menubar.cpp:233
expand_setting_placeholders
void expand_setting_placeholders(BlamConfigurationSetting *setting, std::string filename)
Definition: placeholder_expand.cpp:6
BlamMenubarItemVariableType::UndefinedVariable
@ UndefinedVariable
Fallback item type in the event no valid type is found.
BlamMenubarItemType::Undefined
@ Undefined
Fallback item type in the event no valid type is found.
BlamMenubarItem::BlamMenubarItem
BlamMenubarItem()
Definition: menubar.h:60
Blam::Settings::Paths::GetEngineDataFolderFromString
BLAM BlamEngineDataFolder GetEngineDataFolderFromString(std::string folder)
Attempts to convert a string to the equivalent engine data folder.
Definition: paths.cpp:363