mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-12-05 15:35:12 -06:00
Start Implement inc/dec menu options
This commit is contained in:
@@ -133,8 +133,8 @@ MainMenu::~MainMenu() {
|
||||
}
|
||||
|
||||
void MainMenu::class_setup() {
|
||||
this->num_elements_per_screen = 5;
|
||||
this->min_elements_text_scaling_factor = num_elements_per_screen + 2;
|
||||
this->num_options_per_screen = 5;
|
||||
this->min_elements_text_scaling_factor = num_options_per_screen + 2;
|
||||
this->width_factor_menu = 16;
|
||||
this->width_divisor_menu = 9;
|
||||
this->base_height_factor_menu = 12;
|
||||
@@ -174,8 +174,8 @@ void MainMenu::reset_output_option() {
|
||||
this->selected_index = MainMenuOutAction::MAIN_MENU_NO_ACTION;
|
||||
}
|
||||
|
||||
void MainMenu::set_output_option(int index) {
|
||||
if(index == -1)
|
||||
void MainMenu::set_output_option(int index, int action) {
|
||||
if(index == BACK_X_OUTPUT_OPTION)
|
||||
this->selected_index = MAIN_MENU_CLOSE_MENU;
|
||||
else
|
||||
this->selected_index = pollable_options[this->options_indexes[index]]->out_action;
|
||||
@@ -185,7 +185,7 @@ int MainMenu::get_num_options() {
|
||||
return this->num_enabled_options;
|
||||
}
|
||||
|
||||
std::string MainMenu::get_string_option(int index) {
|
||||
std::string MainMenu::get_string_option(int index, int action) {
|
||||
return pollable_options[this->options_indexes[index]]->base_name;
|
||||
}
|
||||
|
||||
@@ -199,9 +199,9 @@ void MainMenu::prepare(float menu_scaling_factor, int view_size_x, int view_size
|
||||
int num_pages = this->get_num_pages();
|
||||
if(this->future_data.page >= num_pages)
|
||||
this->future_data.page = num_pages - 1;
|
||||
int start = this->future_data.page * this->num_elements_per_screen;
|
||||
for(int i = 0; i < this->num_elements_per_screen; i++) {
|
||||
int index = i + this->elements_start_id;
|
||||
int start = this->future_data.page * this->num_options_per_screen;
|
||||
for(int i = 0; i < this->num_options_per_screen + 1; i++) {
|
||||
int index = (i * this->single_option_multiplier) + this->elements_start_id;
|
||||
if(!this->future_enabled_labels[index])
|
||||
continue;
|
||||
int option_index = this->options_indexes[start + i];
|
||||
|
||||
Reference in New Issue
Block a user