mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-09-11 18:15:24 -05:00
Add N3DS XL Loopy 3D Mode
Some checks are pending
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 name:Windows VS2022 Win32 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 name:Windows VS2022 x64 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 name:Windows VS2022 ARM os:windows-2022]) (push) Waiting to run
CD / Create Pi Mono Setup (push) Blocked by required conditions
CD / Publishing (push) Blocked by required conditions
Some checks are pending
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 name:Windows VS2022 Win32 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 name:Windows VS2022 x64 os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 name:Windows VS2022 ARM os:windows-2022]) (push) Waiting to run
CD / Create Pi Mono Setup (push) Blocked by required conditions
CD / Publishing (push) Blocked by required conditions
This commit is contained in:
@@ -9,43 +9,50 @@ struct RelativePositionMenuOptionInfo {
|
||||
const int position_x, position_y, multiplier_y;
|
||||
float text_factor_multiplier;
|
||||
const BottomRelativePosition out_action;
|
||||
const int divisor_x;
|
||||
};
|
||||
|
||||
static const RelativePositionMenuOptionInfo above_option = {
|
||||
.base_name = "Above", .is_selectable = true,
|
||||
.position_x = 1, .position_y = 0, .multiplier_y = 1,
|
||||
.text_factor_multiplier = 1.0,
|
||||
.out_action = UNDER_TOP};
|
||||
.out_action = UNDER_TOP,
|
||||
.divisor_x = 3};
|
||||
|
||||
static const RelativePositionMenuOptionInfo left_option = {
|
||||
.base_name = "Left", .is_selectable = true,
|
||||
.position_x = 0, .position_y = 1, .multiplier_y = 1,
|
||||
.text_factor_multiplier = 1.0,
|
||||
.out_action = RIGHT_TOP};
|
||||
.out_action = RIGHT_TOP,
|
||||
.divisor_x = 3};
|
||||
|
||||
static const RelativePositionMenuOptionInfo right_option = {
|
||||
.base_name = "Right", .is_selectable = true,
|
||||
.position_x = 2, .position_y = 1, .multiplier_y = 1,
|
||||
.text_factor_multiplier = 1.0,
|
||||
.out_action = LEFT_TOP};
|
||||
.out_action = LEFT_TOP,
|
||||
.divisor_x = 3};
|
||||
|
||||
static const RelativePositionMenuOptionInfo below_option = {
|
||||
.base_name = "Below", .is_selectable = true,
|
||||
.position_x = 1, .position_y = 2, .multiplier_y = 1,
|
||||
.text_factor_multiplier = 1.0,
|
||||
.out_action = ABOVE_TOP};
|
||||
.out_action = ABOVE_TOP,
|
||||
.divisor_x = 3};
|
||||
|
||||
static const RelativePositionMenuOptionInfo desc_option = {
|
||||
.base_name = "Top Screen", .is_selectable = false,
|
||||
.position_x = 1, .position_y = 2, .multiplier_y = 2,
|
||||
.text_factor_multiplier = 0.95,
|
||||
.out_action = BOT_REL_POS_END};
|
||||
.out_action = BOT_REL_POS_END,
|
||||
.divisor_x = 3};
|
||||
|
||||
static const RelativePositionMenuOptionInfo desc2_option = {
|
||||
.base_name = "Position", .is_selectable = false,
|
||||
.position_x = 1, .position_y = 3, .multiplier_y = 2,
|
||||
.text_factor_multiplier = 0.95,
|
||||
.out_action = BOT_REL_POS_END};
|
||||
.out_action = BOT_REL_POS_END,
|
||||
.divisor_x = 3};
|
||||
|
||||
static const RelativePositionMenuOptionInfo* pollable_options[] = {
|
||||
&above_option,
|
||||
@@ -56,7 +63,21 @@ static const RelativePositionMenuOptionInfo* pollable_options[] = {
|
||||
&desc2_option,
|
||||
};
|
||||
|
||||
RelativePositionMenu::RelativePositionMenu() {
|
||||
}
|
||||
|
||||
RelativePositionMenu::RelativePositionMenu(bool font_load_success, sf::Font &text_font) {
|
||||
this->initialize(font_load_success, text_font);
|
||||
}
|
||||
|
||||
RelativePositionMenu::~RelativePositionMenu() {
|
||||
for(int i = 0; i < this->num_elements_displayed_per_screen; i++)
|
||||
delete this->labels[i];
|
||||
delete []this->labels;
|
||||
delete []this->selectable_labels;
|
||||
}
|
||||
|
||||
void RelativePositionMenu::initialize(bool font_load_success, sf::Font &text_font) {
|
||||
this->class_setup();
|
||||
this->after_class_setup_connected_values();
|
||||
this->menu_rectangle.setFillColor(this->menu_color);
|
||||
@@ -80,16 +101,10 @@ RelativePositionMenu::RelativePositionMenu(bool font_load_success, sf::Font &tex
|
||||
this->selectable_labels[this->title_id] = false;
|
||||
}
|
||||
|
||||
RelativePositionMenu::~RelativePositionMenu() {
|
||||
for(int i = 0; i < this->num_elements_displayed_per_screen; i++)
|
||||
delete this->labels[i];
|
||||
delete []this->labels;
|
||||
delete []this->selectable_labels;
|
||||
}
|
||||
|
||||
void RelativePositionMenu::class_setup() {
|
||||
this->num_options_per_screen = NUM_TOTAL_MENU_OPTIONS;
|
||||
this->min_elements_text_scaling_factor = 4;
|
||||
this->num_vertical_slices = 4;
|
||||
this->width_factor_menu = 16;
|
||||
this->width_divisor_menu = 9;
|
||||
this->base_height_factor_menu = 12;
|
||||
@@ -104,7 +119,6 @@ void RelativePositionMenu::after_class_setup_connected_values() {
|
||||
this->num_title_back_x_elements = 2;
|
||||
this->num_elements_per_screen = this->num_options_per_screen;
|
||||
this->num_elements_displayed_per_screen = num_title_back_x_elements + num_elements_per_screen;
|
||||
this->num_vertical_slices = 4;
|
||||
this->title_back_x_start_id = 0;
|
||||
this->elements_start_id = num_title_back_x_elements + title_back_x_start_id;
|
||||
this->back_x_id = title_back_x_start_id + 1;
|
||||
@@ -145,6 +159,22 @@ void RelativePositionMenu::set_default_cursor_position() {
|
||||
}
|
||||
}
|
||||
|
||||
bool RelativePositionMenu::is_option_left(int index) {
|
||||
return pollable_options[index]->out_action == LEFT_TOP;
|
||||
}
|
||||
|
||||
bool RelativePositionMenu::is_option_right(int index) {
|
||||
return pollable_options[index]->out_action == RIGHT_TOP;
|
||||
}
|
||||
|
||||
bool RelativePositionMenu::is_option_above(int index) {
|
||||
return pollable_options[index]->out_action == ABOVE_TOP;
|
||||
}
|
||||
|
||||
bool RelativePositionMenu::is_option_below(int index) {
|
||||
return pollable_options[index]->out_action == UNDER_TOP;
|
||||
}
|
||||
|
||||
void RelativePositionMenu::decrement_selected_option(bool is_simple) {
|
||||
if(this->future_data.option_selected < 0) {
|
||||
this->set_default_cursor_position();
|
||||
@@ -152,7 +182,7 @@ void RelativePositionMenu::decrement_selected_option(bool is_simple) {
|
||||
}
|
||||
int elem_index = this->future_data.option_selected - this->elements_start_id;
|
||||
if(!is_simple) {
|
||||
if(this->is_option_element(this->future_data.option_selected) && ((pollable_options[elem_index]->out_action == LEFT_TOP) || (pollable_options[elem_index]->out_action == ABOVE_TOP)))
|
||||
if(this->is_option_element(this->future_data.option_selected) && (this->is_option_left(elem_index) || this->is_option_above(elem_index)))
|
||||
this->future_data.option_selected -= 1;
|
||||
}
|
||||
do {
|
||||
@@ -169,7 +199,7 @@ void RelativePositionMenu::increment_selected_option(bool is_simple) {
|
||||
}
|
||||
int elem_index = this->future_data.option_selected - this->elements_start_id;
|
||||
if(!is_simple) {
|
||||
if(this->is_option_element(this->future_data.option_selected) && (pollable_options[elem_index]->out_action == RIGHT_TOP))
|
||||
if(this->is_option_element(this->future_data.option_selected) && this->is_option_right(elem_index))
|
||||
this->future_data.option_selected += 1;
|
||||
}
|
||||
do {
|
||||
@@ -208,7 +238,7 @@ void RelativePositionMenu::prepare_options() {
|
||||
this->labels[this->back_x_id]->setShowText(true);
|
||||
this->labels[this->title_id]->setText(this->title);
|
||||
this->labels[this->title_id]->setShowText(true);
|
||||
for(int i = 0; i < NUM_TOTAL_MENU_OPTIONS; i++) {
|
||||
for(int i = 0; i < this->num_options_per_screen; i++) {
|
||||
int label_start_index = i + this->elements_start_id;
|
||||
this->labels[label_start_index]->setText(this->get_string_option(i));
|
||||
this->selectable_labels[label_start_index] = this->is_option_selectable(i);
|
||||
@@ -254,12 +284,12 @@ void RelativePositionMenu::down_code(bool is_simple) {
|
||||
void RelativePositionMenu::left_code() {
|
||||
if(!this->can_execute_action())
|
||||
return;
|
||||
if(this->is_option_element(this->future_data.option_selected) && (pollable_options[this->future_data.option_selected - this->elements_start_id]->out_action == RIGHT_TOP))
|
||||
if(this->is_option_element(this->future_data.option_selected) && this->is_option_right(this->future_data.option_selected - this->elements_start_id))
|
||||
this->option_selection_handling();
|
||||
else {
|
||||
this->future_data.option_selected -= 1;
|
||||
for(int i = 0; i < NUM_TOTAL_MENU_OPTIONS; i++) {
|
||||
if(pollable_options[i]->out_action == RIGHT_TOP) {
|
||||
for(int i = 0; i < this->num_options_per_screen; i++) {
|
||||
if(this->is_option_right(i)) {
|
||||
this->future_data.option_selected = i + this->elements_start_id;
|
||||
break;
|
||||
}
|
||||
@@ -272,12 +302,12 @@ void RelativePositionMenu::right_code() {
|
||||
if(!this->can_execute_action())
|
||||
return;
|
||||
int elem_index = this->future_data.option_selected - this->elements_start_id;
|
||||
if(this->is_option_element(this->future_data.option_selected) && (pollable_options[this->future_data.option_selected - this->elements_start_id]->out_action == LEFT_TOP))
|
||||
if(this->is_option_element(this->future_data.option_selected) && this->is_option_left(this->future_data.option_selected - this->elements_start_id))
|
||||
this->option_selection_handling();
|
||||
else {
|
||||
this->future_data.option_selected -= 1;
|
||||
for(int i = 0; i < NUM_TOTAL_MENU_OPTIONS; i++) {
|
||||
if(pollable_options[i]->out_action == LEFT_TOP) {
|
||||
for(int i = 0; i < this->num_options_per_screen; i++) {
|
||||
if(this->is_option_left(i)) {
|
||||
this->future_data.option_selected = i + this->elements_start_id;
|
||||
break;
|
||||
}
|
||||
@@ -427,7 +457,7 @@ void RelativePositionMenu::prepare_text_slices(int x_multiplier, int x_divisor,
|
||||
}
|
||||
|
||||
void RelativePositionMenu::prepare(float menu_scaling_factor, int view_size_x, int view_size_y, BottomRelativePosition curr_bottom_pos) {
|
||||
for(int i = 0; i < NUM_TOTAL_MENU_OPTIONS; i++) {
|
||||
for(int i = 0; i < this->num_options_per_screen; i++) {
|
||||
int index = i + this->elements_start_id;
|
||||
switch(pollable_options[i]->out_action) {
|
||||
case BOT_REL_POS_END:
|
||||
@@ -444,6 +474,10 @@ void RelativePositionMenu::prepare(float menu_scaling_factor, int view_size_x, i
|
||||
this->base_prepare(menu_scaling_factor, view_size_x, view_size_y);
|
||||
}
|
||||
|
||||
void RelativePositionMenu::option_slice_prepare(int i, int index, int num_vertical_slices, float text_scaling_factor) {
|
||||
this->prepare_text_slices(pollable_options[i]->position_x, pollable_options[i]->divisor_x, pollable_options[i]->position_y + (1 * pollable_options[i]->multiplier_y), num_vertical_slices * pollable_options[i]->multiplier_y, index, text_scaling_factor * pollable_options[i]->text_factor_multiplier);
|
||||
}
|
||||
|
||||
void RelativePositionMenu::base_prepare(float menu_scaling_factor, int view_size_x, int view_size_y) {
|
||||
const float base_height = (7 * BASE_PIXEL_FONT_HEIGHT * 11) / 9;
|
||||
int max_width = (view_size_x * 9) / 10;
|
||||
@@ -477,9 +511,9 @@ void RelativePositionMenu::base_prepare(float menu_scaling_factor, int view_size
|
||||
int top_divisor = 6;
|
||||
this->prepare_text_slices(0, 6, 0, this->num_vertical_slices, this->back_x_id, text_scaling_factor);
|
||||
this->prepare_text_slices(0, 1, 0, this->num_vertical_slices, this->title_id, text_scaling_factor);
|
||||
for(int i = 0; i < NUM_TOTAL_MENU_OPTIONS; i++) {
|
||||
for(int i = 0; i < this->num_options_per_screen; i++) {
|
||||
int index = i + this->elements_start_id;
|
||||
this->prepare_text_slices(pollable_options[i]->position_x, 3, pollable_options[i]->position_y + (1 * pollable_options[i]->multiplier_y), this->num_vertical_slices * pollable_options[i]->multiplier_y, index, text_scaling_factor * pollable_options[i]->text_factor_multiplier);
|
||||
this->option_slice_prepare(i, index, this->num_vertical_slices, text_scaling_factor);
|
||||
}
|
||||
this->loaded_data = this->future_data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user