renomena tipus niats a CamelCase (Bouncing, Stage, Item, Selector, ...)
This commit is contained in:
@@ -107,7 +107,7 @@ auto Menu::parseFromStream(std::istream &file, const std::string &filename) -> b
|
||||
while (std::getline(file, line)) {
|
||||
strip_cr(line);
|
||||
if (line == "[item]") {
|
||||
item_t newItem;
|
||||
Item newItem;
|
||||
newItem.label = "";
|
||||
newItem.hPaddingDown = 1;
|
||||
newItem.selectable = true;
|
||||
@@ -171,7 +171,7 @@ auto Menu::loadFromBytes(const std::vector<uint8_t> &bytes, const std::string &n
|
||||
}
|
||||
|
||||
// Asigna variables a partir de dos cadenas
|
||||
auto Menu::setItem(item_t *item, const std::string &var, const std::string &value) -> bool {
|
||||
auto Menu::setItem(Item *item, const std::string &var, const std::string &value) -> bool {
|
||||
// Indicador de éxito en la asignación
|
||||
bool success = true;
|
||||
|
||||
@@ -449,7 +449,7 @@ void Menu::setSelectorPos(int index) {
|
||||
|
||||
// Obtiene la anchura del elemento más ancho del menu
|
||||
auto Menu::getWidestItem() -> int {
|
||||
return std::accumulate(item.begin(), item.end(), 0, [](int acc, const item_t &i) { return std::max(acc, i.rect.w); });
|
||||
return std::accumulate(item.begin(), item.end(), 0, [](int acc, const Item &i) { return std::max(acc, i.rect.w); });
|
||||
}
|
||||
|
||||
// Deja el menu apuntando al primer elemento
|
||||
@@ -737,7 +737,7 @@ void Menu::centerMenuElementsOnX() {
|
||||
}
|
||||
|
||||
// Añade un item al menu
|
||||
void Menu::addItem(item_t new_item) {
|
||||
void Menu::addItem(Item new_item) {
|
||||
if (item.empty()) { // Si es el primer item coge la posición en el eje Y del propio menu
|
||||
new_item.rect.y = y;
|
||||
} else { // En caso contrario, coge la posición en el eje Y a partir del último elemento
|
||||
@@ -811,7 +811,7 @@ auto Menu::findWidth() -> int {
|
||||
|
||||
// Calcula el alto del menu
|
||||
auto Menu::findHeight() -> int {
|
||||
const int height = std::accumulate(item.begin(), item.end(), 0, [](int acc, const item_t &i) { return acc + i.rect.h + i.hPaddingDown; });
|
||||
const int height = std::accumulate(item.begin(), item.end(), 0, [](int acc, const Item &i) { return acc + i.rect.h + i.hPaddingDown; });
|
||||
|
||||
return height - item.back().hPaddingDown;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user