Make the software compatible with lower end hardware
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 -DCMAKE_PARALLEL_MSVC=TRUE 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 -DCMAKE_PARALLEL_MSVC=TRUE 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 -DCMAKE_PARALLEL_MSVC=TRUE 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:
Lorenzooone
2025-04-27 01:29:22 +02:00
parent 33660b3ef7
commit 64dec0a515
68 changed files with 846 additions and 296 deletions

View File

@@ -66,8 +66,8 @@ static const RelativePositionMenuOptionInfo* pollable_options[] = {
RelativePositionMenu::RelativePositionMenu() {
}
RelativePositionMenu::RelativePositionMenu(bool font_load_success, sf::Font &text_font) {
this->initialize(font_load_success, text_font);
RelativePositionMenu::RelativePositionMenu(TextRectanglePool* text_rectangle_pool) {
this->initialize(text_rectangle_pool);
}
RelativePositionMenu::~RelativePositionMenu() {
@@ -77,15 +77,16 @@ RelativePositionMenu::~RelativePositionMenu() {
delete []this->selectable_labels;
}
void RelativePositionMenu::initialize(bool font_load_success, sf::Font &text_font) {
void RelativePositionMenu::initialize(TextRectanglePool* text_pool) {
this->class_setup();
this->after_class_setup_connected_values();
this->menu_rectangle.setFillColor(this->menu_color);
this->menu_rectangle.setPosition({1, 1});
text_pool->request_num_text_rectangles(this->num_elements_displayed_per_screen);
this->labels = new TextRectangle*[this->num_elements_displayed_per_screen];
this->selectable_labels = new bool[this->num_elements_displayed_per_screen];
for(int i = 0; i < this->num_elements_displayed_per_screen; i++) {
this->labels[i] = new TextRectangle(font_load_success, text_font);
this->labels[i] = text_pool->get_text_rectangle(i);
this->labels[i]->setProportionalBox(false);
this->labels[i]->setText(std::to_string(i));
this->labels[i]->setShowText(true);
@@ -224,6 +225,10 @@ void RelativePositionMenu::set_output_option(int index) {
}
}
bool RelativePositionMenu::is_option_drawable(int index) {
return true;
}
bool RelativePositionMenu::is_option_selectable(int index) {
return pollable_options[index]->is_selectable;
}
@@ -428,7 +433,8 @@ void RelativePositionMenu::draw(float scaling_factor, sf::RenderTarget &window)
this->menu_rectangle.setPosition({(float)this->loaded_data.pos_x, (float)this->loaded_data.pos_y});
window.draw(this->menu_rectangle);
for(int i = 0; i < this->num_elements_displayed_per_screen; i++) {
this->labels[i]->draw(window);
if(this->is_option_drawable(i))
this->labels[i]->draw(window);
}
}