Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language selection for Koopair #151

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update SettingsScreen.cpp
WorthYapper958 authored Sep 21, 2024
commit 0a2b8aed129ed630cd336e0082271aca23d66e94
14 changes: 6 additions & 8 deletions koopair/source/screens/SettingsScreen.cpp
Original file line number Diff line number Diff line change
@@ -16,14 +16,14 @@
*/
#include "SettingsScreen.hpp"
#include "Gfx.hpp"
#include "LanguageSelectionScreen.hpp" // Füge diese Zeile hinzu, um die Sprachauswahl-Seite einzubinden
#include "LanguageSelectionScreen.hpp"

SettingsScreen::SettingsScreen()
: mSelectedOption(OPTION_LANGUAGE) // Setze den Standard-Button auf den neuen Menüpunkt
: mSelectedOption(OPTION_LANGUAGE)
{
mEntries = {
{ OPTION_LANGUAGE, "Language Selection" }, // Neuer Button für Sprachauswahl
// Weitere Einträge können hier hinzugefügt werden
{ OPTION_LANGUAGE, "Language Selection" },
// Further entries can be added here
};
}

@@ -35,12 +35,11 @@ void SettingsScreen::Draw()
{
DrawTopBar("Settings");

// Zeige den Button für die Sprachauswahl
int yOff = Gfx::SCREEN_HEIGHT / 2 - 75;
Gfx::DrawRectFilled(0, yOff, Gfx::SCREEN_WIDTH, 150, Gfx::COLOR_ALT_BACKGROUND);
Gfx::Print(Gfx::SCREEN_WIDTH / 2, yOff + 75, 60, Gfx::COLOR_TEXT, "Language Selection", Gfx::ALIGN_CENTER);

// Hebe den Button hervor, wenn er ausgewählt ist
// Highlight the button when it is selected
if (mSelectedOption == OPTION_LANGUAGE) {
Gfx::DrawRect(0, yOff, Gfx::SCREEN_WIDTH, 150, 8, Gfx::COLOR_HIGHLIGHTED);
}
@@ -54,9 +53,8 @@ bool SettingsScreen::Update(const CombinedInputController& input)
return false;
}

// Wenn A gedrückt wird und der Language-Button ausgewählt ist, wechsle zur Sprachauswahl-Seite
// If A is pressed and the Language button is selected, switch to the language selection page
if ((input.GetButtonsTriggered() & Controller::BUTTON_A) && mSelectedOption == OPTION_LANGUAGE) {
// Öffne die Sprachauswahl-Seite
mSubscreen = std::make_unique<LanguageSelectionScreen>();
}