Skip to content

Commit

Permalink
Remove auto-caps option for subtitles
Browse files Browse the repository at this point in the history
This should be handled when using the menu, not by the menu itself. Also
restores ability to do colors normally.
  • Loading branch information
ikt32 committed Aug 24, 2017
1 parent ac2c922 commit ec9477b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
5 changes: 1 addition & 4 deletions menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,7 @@ void Menu::Title(std::string title, int textureHandle, float customSize) {
headerHeight = titleHeight;
}

void Menu::Subtitle(std::string subtitle, bool allcaps) {
if (allcaps)
subtitle = makeCaps(subtitle);

void Menu::Subtitle(std::string subtitle) {
float subtitleY = subtitleTextureOffset + menuY + totalHeight;
float subtitleTextY = menuY + totalHeight;
textDraws.push_back(
Expand Down
2 changes: 1 addition & 1 deletion menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Menu {
* A menu subtitle. This is optional. If added, this must be added directly
* below the title, before any options are specified.
*/
void Subtitle(std::string subtitle, bool allcaps = true);
void Subtitle(std::string subtitle);

/*
* Optional: Specify a different background texture for the footer.
Expand Down
11 changes: 8 additions & 3 deletions menuutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ namespace NativeMenu {
return elems;
}

std::string makeCaps(std::string input) {
/*std::string makeCaps(std::string input) {
std::locale loc;
std::stringstream caps;
for (std::string::size_type i = 0; i < input.length(); ++i)
for (std::string::size_type i = 0; i < input.length(); ++i) {
if (i > 0 && i < input.length() - 1 && input[i - 1] == '~' && input[i + 1] == '~') {
caps << input[i];
continue;
}
caps << std::toupper(input[i], loc);
}
return caps.str();
}
}*/
}
2 changes: 1 addition & 1 deletion menuutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ namespace NativeMenu {

std::vector<std::string> split(const std::string &s, char delim);

std::string makeCaps(std::string input);
//std::string makeCaps(std::string input);
}

0 comments on commit ec9477b

Please sign in to comment.