MenuLabel*classSelectionLabel=newMenuLabel(CLASS_SELECTION,{{4,20},{outlineSize.x,32}},"Choose a Character Class",2,ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND);
MenuLabel*classSelectionLabel=NEWMenuLabel(CLASS_SELECTION,{{4,20},{outlineSize.x,32}},"Choose a Character Class",2,ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND);
classSelectionWindow->AddComponent("Class Selection Title Label",classSelectionLabel);
std::cout<<"Error TOGGLE!!! Please turn on debug_toggleable_items in configuration.txt and re-run the program to see which toggleable item did not properly get a toggleable group set."<<std::endl;
throw;
ERR("Error TOGGLE!!! Please turn on debug_toggleable_items in configuration.txt and re-run the program to see which toggleable item did not properly get a toggleable group set.");
}
if(Unlock::unlocks.size()==0){
std::cout<<"WARNING! There are no unlocks set! This was probably not intentional! It means no areasa on the overworld are accessible!"<<std::endl;
throw;
ERR("WARNING! There are no unlocks set! This was probably not intentional! It means no areasa on the overworld are accessible!");
//We don't have to actually populate the inventory list because now when an item gets added, it will automatically add the correct component in for us.
std::cout<<"WARNING! Component "<<component->name<<" has already been added to the "<<category<<" listener list! There should not be any duplicates!!"<<std::endl;
throw;
ERR("WARNING! Component "<<component->name<<" has already been added to the "<<category<<" listener list! There should not be any duplicates!!")
}
listenerList.push_back(component);
}else{
std::cout<<"WARNING! Inventory category "<<category<<" does not exist!"<<std::endl;
throw;
ERR("WARNING! Inventory category "<<category<<" does not exist!")
}
}
@ -632,8 +627,7 @@ void Menu::CloseMenu(){
if(stack.size()>0){
stack.pop_back();
}else{
std::cout<<"WARNING! Trying to close out no menu?? Why are we doing this?"<<std::endl;
throw;
ERR("WARNING! Trying to close out no menu?? Why are we doing this?")
staticstd::vector<MenuComponent*>unhandledComponents;//This list contains MenuComponents that are created and haven't been assigned via AddComponent. If we get to the end of menu initialization and there are any components in this vector, we have leaked memory and will report this.
staticconstvf2dCENTERED;
staticboolIsMenuOpen();
safemap<std::string,MenuComponent*>components;//A friendly way to interrogate any component we are interested in.
std::vector<MenuComponent*>displayComponents;//Components that are only for displaying purposes.
//A class that has an initialization lock so that when the lock is activated, any further gets that are missing items in it will report themselves for easier debugging detection.
template<typenameT,typenameO>
@ -8,15 +9,13 @@ class safemap{
public:
O&operator[](Tkey){
if(initialized&&map.count(key)==0){
std::cout<<"WARNING! Trying to get non-existent key "<<key<<"!"<<std::endl;
throw;
ERR("WARNING! Trying to get non-existent key "<<key<<"!")
}
if(!initialized){
size_toriginalSize=map.size();
O&val=map[key];
if(originalSize==map.size()){
std::cout<<"WARNING! A previously set value has been overwritten! Key: "<<key<<std::endl;
throw;
ERR("WARNING! A previously set value has been overwritten! Key: "<<key)
}
returnval;
}else{
@ -65,15 +64,13 @@ class safeunorderedmap{
public:
O&operator[](Tkey){
if(initialized&&map.count(key)==0){
std::cout<<"WARNING! Trying to get non-existent key "<<key<<"!"<<std::endl;
throw;
ERR("WARNING! Trying to get non-existent key "<<key<<"!")
}
if(!initialized){
size_toriginalSize=map.size();
map[key]=items.size();
if(originalSize==map.size()){
std::cout<<"WARNING! A previously set value has been overwritten! Key: "<<key<<std::endl;
throw;
ERR("WARNING! A previously set value has been overwritten! Key: "<<key)