Skip to content

Commit

Permalink
See desc for more.
Browse files Browse the repository at this point in the history
- Fix Splash being able to lock the app.
- Update Credits + Screenshots.
- Fill Selected Option in the same color to look better.
  • Loading branch information
SuperSaiyajinStackZ committed Jan 24, 2022
1 parent fa51699 commit ebf4f1d
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 34 deletions.
3 changes: 3 additions & 0 deletions 3DS/include/Components/Tabs/SettingsTab.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ class SettingsTab {
};


int8_t AIModeClr() const;
void GameSettingsHandle();
/* X-Positions of the Stone colors. */
static constexpr int XPos[10] = { 15, 45, 75, 105, 135, 165, 195, 225, 255, 285 };


int8_t LangHandlerToSelection() const;
int8_t SelectionToLangHandler(const int8_t Slt) const;
void LanguageHandle();
static constexpr Structs::ButtonPos LanguagePos[4] = {
{ 37, 32, 18, 18 }, // English.
Expand Down
6 changes: 3 additions & 3 deletions 3DS/source/Components/Splash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ void Splash::Handler() {

/* State 0: Fade In. */
if (this->State == 0) {
if (StackMill3DS::App->FadeAlpha > 0) {
if (StackMill3DS::App->FadeAlpha >= 0) {
StackMill3DS::App->FadeAlpha -= 3;

if (StackMill3DS::App->FadeAlpha == 0) this->State = 1;
}

/* State 1: Waiting. */
} else if (this->State == 1) {
if (this->Wait > 0) {
if (this->Wait >= 0) {
this->Wait--;

if (this->Wait == 0) this->State = 2;
Expand All @@ -82,7 +82,7 @@ void Splash::Handler() {
while(aptMainLoop() && !this->Done) {
StackMill3DS::App->Draw();

if (StackMill3DS::App->FadeAlpha > 0) {
if (StackMill3DS::App->FadeAlpha >= 0) {
if (StackMill3DS::App->FadeAlpha - 5 <= 0) StackMill3DS::App->FadeAlpha = 0;
else StackMill3DS::App->FadeAlpha -= 5;

Expand Down
3 changes: 2 additions & 1 deletion 3DS/source/Components/Tabs/CreditsTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ void CreditsTab::DrawSubTab(const CreditsTab::SubTab STab, const int AddOffs) {

Gui::DrawStringCentered(0 + Tab::CreditsOffset, 65 + AddOffs, 0.5f, TEXT_BG_COLOR, "Deutsch - SuperSaiyajinStackZ", 310);
Gui::DrawStringCentered(0 + Tab::CreditsOffset, 85 + AddOffs, 0.5f, TEXT_BG_COLOR, "English - Pk11, SuperSaiyajinStackZ", 310);
Gui::DrawStringCentered(0 + Tab::CreditsOffset, 105 + AddOffs, 0.5f, TEXT_BG_COLOR, "日本語 - Pk11", 310);
Gui::DrawStringCentered(0 + Tab::CreditsOffset, 105 + AddOffs, 0.5f, TEXT_BG_COLOR, "Italiano - Samplasion", 310);
Gui::DrawStringCentered(0 + Tab::CreditsOffset, 125 + AddOffs, 0.5f, TEXT_BG_COLOR, "日本語 - Pk11", 310);
break;
}
}
Expand Down
15 changes: 6 additions & 9 deletions 3DS/source/Components/Tabs/GameTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,17 +976,14 @@ void GameTab::PopupPrompt() {

/* Handle Input for the prompt. */
if (SwipedIn && !EndIt) {
hidScanInput();
const uint32_t Down = hidKeysDown();
touchPosition T;
hidTouchRead(&T);
StackMill3DS::App->ScanKeys();

if (Down & KEY_A) State = true, EndIt = true; // New Game.
if (Down & KEY_B) State = false, EndIt = true; // Exit.
if (StackMill3DS::App->Down & KEY_A) State = true, EndIt = true; // New Game.
if (StackMill3DS::App->Down & KEY_B) State = false, EndIt = true; // Exit.

if (Down & KEY_TOUCH) {
if (this->Prompt[0].Touched(T)) State = false, EndIt = true; // Exit.
else if (this->Prompt[1].Touched(T)) State = true, EndIt = true; // New Game.
if (StackMill3DS::App->Down & KEY_TOUCH) {
if (this->Prompt[0].Touched(StackMill3DS::App->T)) State = false, EndIt = true; // Exit.
else if (this->Prompt[1].Touched(StackMill3DS::App->T)) State = true, EndIt = true; // New Game.
}
}

Expand Down
56 changes: 44 additions & 12 deletions 3DS/source/Components/Tabs/SettingsTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void SettingsTab::DrawMenu(const SettingsTab::SubMenu M, const int AddOffs) {
StackMill3DS::App->GData->DrawStone(Idx, this->XPos[Idx] + Tab::SettingsOffset, 45 + AddOffs);
}

StackMill3DS::App->GData->DrawSprite(sprites_selector_0_idx + SettingsTab::StoneColors[2], this->XPos[SettingsTab::StoneColors[0]] + Tab::SettingsOffset, 45 + AddOffs);
StackMill3DS::App->GData->DrawSprite(sprites_selector_0_idx + SettingsTab::StoneColors[0], this->XPos[SettingsTab::StoneColors[0]] + Tab::SettingsOffset, 45 + AddOffs);
if (this->SelectedOption == 0) Gui::drawGrid(5 + Tab::SettingsOffset, 25 + AddOffs, 310, 50, BAR_COLOR_OUTLINE);

/* Player 2 Stone Color. */
Expand All @@ -65,7 +65,7 @@ void SettingsTab::DrawMenu(const SettingsTab::SubMenu M, const int AddOffs) {
StackMill3DS::App->GData->DrawStone(Idx, this->XPos[Idx] + Tab::SettingsOffset, 100 + AddOffs);
}

StackMill3DS::App->GData->DrawSprite(sprites_selector_0_idx + SettingsTab::StoneColors[2], this->XPos[SettingsTab::StoneColors[1]] + Tab::SettingsOffset, 100 + AddOffs);
StackMill3DS::App->GData->DrawSprite(sprites_selector_0_idx + SettingsTab::StoneColors[1], this->XPos[SettingsTab::StoneColors[1]] + Tab::SettingsOffset, 100 + AddOffs);
if (this->SelectedOption == 1) Gui::drawGrid(5 + Tab::SettingsOffset, 80 + AddOffs, 310, 50, BAR_COLOR_OUTLINE);

/* Possibly Play Color. */
Expand All @@ -83,7 +83,7 @@ void SettingsTab::DrawMenu(const SettingsTab::SubMenu M, const int AddOffs) {
StackMill3DS::App->GData->DrawStone(4, this->XPos[5] - 15 + Tab::SettingsOffset, 210 + AddOffs); // Yellow.
StackMill3DS::App->GData->DrawStone(7, this->XPos[6] - 15 + Tab::SettingsOffset, 210 + AddOffs); // Green.

StackMill3DS::App->GData->DrawSprite(sprites_selector_0_idx + SettingsTab::StoneColors[2], this->XPos[4 + SettingsTab::AI] - 15 + Tab::SettingsOffset, 210 + AddOffs);
StackMill3DS::App->GData->DrawSprite(sprites_selector_0_idx + this->AIModeClr(), this->XPos[4 + SettingsTab::AI] - 15 + Tab::SettingsOffset, 210 + AddOffs);
if (this->SelectedOption == 3) Gui::drawGrid(5 + Tab::SettingsOffset, 190 + AddOffs, 310, 45, BAR_COLOR_OUTLINE);
break;

Expand All @@ -97,13 +97,13 @@ void SettingsTab::DrawMenu(const SettingsTab::SubMenu M, const int AddOffs) {
else ClrIdx = 0;

StackMill3DS::App->GData->DrawStone(ClrIdx, this->LanguagePos[Lang].x + Tab::SettingsOffset, this->LanguagePos[Lang].y + AddOffs);
if (this->Language == Lang) StackMill3DS::App->GData->DrawSprite(sprites_selector_0_idx + SettingsTab::StoneColors[2], this->LanguagePos[Lang].x + Tab::SettingsOffset, this->LanguagePos[Lang].y + AddOffs);
if (this->Language == Lang) StackMill3DS::App->GData->DrawSprite(sprites_selector_0_idx + ClrIdx, this->LanguagePos[Lang].x + Tab::SettingsOffset, this->LanguagePos[Lang].y + AddOffs);
}

Gui::DrawString(this->LanguagePos[0].x + 25 + Tab::SettingsOffset, this->LanguagePos[0].y - 1 + AddOffs, 0.6f, TEXT_BG_COLOR, "English");
Gui::DrawString(this->LanguagePos[1].x + 25 + Tab::SettingsOffset, this->LanguagePos[1].y - 1 + AddOffs, 0.6f, TEXT_BG_COLOR, "Deutsch");
Gui::DrawString(this->LanguagePos[2].x + 25 + Tab::SettingsOffset, this->LanguagePos[2].y - 1 + AddOffs, 0.6f, TEXT_BG_COLOR, "日本語");
Gui::DrawString(this->LanguagePos[3].x + 25 + Tab::SettingsOffset, this->LanguagePos[3].y - 1 + AddOffs, 0.6f, TEXT_BG_COLOR, "Italiano");
Gui::DrawString(this->LanguagePos[0].x + 25 + Tab::SettingsOffset, this->LanguagePos[0].y - 1 + AddOffs, 0.6f, TEXT_BG_COLOR, "Deutsch");
Gui::DrawString(this->LanguagePos[1].x + 25 + Tab::SettingsOffset, this->LanguagePos[1].y - 1 + AddOffs, 0.6f, TEXT_BG_COLOR, "English");
Gui::DrawString(this->LanguagePos[2].x + 25 + Tab::SettingsOffset, this->LanguagePos[2].y - 1 + AddOffs, 0.6f, TEXT_BG_COLOR, "Italiano");
Gui::DrawString(this->LanguagePos[3].x + 25 + Tab::SettingsOffset, this->LanguagePos[3].y - 1 + AddOffs, 0.6f, TEXT_BG_COLOR, "日本語");
break;
}

Expand Down Expand Up @@ -152,7 +152,7 @@ void SettingsTab::MainHandle() {
if (this->MainPos[Idx - 1].Touched(StackMill3DS::App->T)) {
this->Menu = (SettingsTab::SubMenu)Idx;
this->In = true, this->SelectedOption = 0;
if (this->Menu == SettingsTab::SubMenu::Language) this->Language = StackMill3DS::App->LH->GetLang();
if (this->Menu == SettingsTab::SubMenu::Language) this->Language = this->LangHandlerToSelection();
SettingsTab::Swipe = true;
break;
}
Expand All @@ -169,7 +169,7 @@ void SettingsTab::MainHandle() {

case 1:
this->Menu = SettingsTab::SubMenu::Language;
this->In = true, this->Language = StackMill3DS::App->LH->GetLang();
this->In = true, this->Language = this->LangHandlerToSelection();
SettingsTab::Swipe = true;
break;

Expand All @@ -191,6 +191,16 @@ void SettingsTab::MainHandle() {
};


int8_t SettingsTab::AIModeClr() const {
switch(SettingsTab::AI) {
default:
case 0: return 9; // Mode 0 => Red.
case 1: return 4; // Mode 1 => Yellow.
case 2: return 7; // Mode 2 => Green.
}
};


void SettingsTab::GameSettingsHandle() {
if (StackMill3DS::App->Down & KEY_B) {
this->In = false, this->SelectedOption = 0;
Expand Down Expand Up @@ -267,6 +277,28 @@ void SettingsTab::GameSettingsHandle() {
};


int8_t SettingsTab::LangHandlerToSelection() const {
switch(StackMill3DS::App->LH->GetLangEnum()) {
case LangHandler::Langs::German: return 0;
default:
case LangHandler::Langs::English: return 1;
case LangHandler::Langs::Italian: return 2;
case LangHandler::Langs::Japanese: return 3;
}
};


int8_t SettingsTab::SelectionToLangHandler(const int8_t Slt) const {
switch(Slt) {
case 0: return 1; // German.
default:
case 1: return 0; // English.
case 2: return 3; // Italian.
case 3: return 2; // Japanese.
}
};


void SettingsTab::LanguageHandle() {
if (StackMill3DS::App->Down & KEY_B) {
this->In = false, this->SelectedOption = 1;
Expand All @@ -283,7 +315,7 @@ void SettingsTab::LanguageHandle() {

if (StackMill3DS::App->Down & KEY_A) {
/* Load Language. */
StackMill3DS::App->LH->LoadLang((LangHandler::Langs)this->Language);
StackMill3DS::App->LH->LoadLang((LangHandler::Langs)this->SelectionToLangHandler(this->Language));
StackMill3DS::App->ConfigChanged();

this->In = false, this->SelectedOption = 1;
Expand All @@ -296,7 +328,7 @@ void SettingsTab::LanguageHandle() {
this->Language = Idx;

/* Load Language. */
StackMill3DS::App->LH->LoadLang((LangHandler::Langs)this->Language);
StackMill3DS::App->LH->LoadLang((LangHandler::Langs)this->SelectionToLangHandler(this->Language));
StackMill3DS::App->ConfigChanged();

this->In = false, this->SelectedOption = 1;
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ StackMill includes the following features right now:

* Select a color from 10 for the Stones from Player 1, Player 2 and a highlighted color for possible plays.

* Multi Language support. Currently supporting English, German and Japanese.
* Multi Language support. Currently supporting English, German, Italian and Japanese.

* Importing / Exporting the current match's data, so you can save important matches whenever you want and load them whenever you want.

Expand All @@ -30,13 +30,12 @@ You want to learn more about the GameData Structure? Then checkout the [GameData

<details><summary>Screenshots</summary>

### Credits Tab
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/creditsTab.png)
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/creditsTabTranslators.png)

### Game Tab
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/gameTab.png)

### Splash
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/splash.png)

### Rules
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/rules1.png)
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/rules2.png)
Expand All @@ -52,9 +51,9 @@ You want to learn more about the GameData Structure? Then checkout the [GameData
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/settingsTabLanguage.png)
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/settingsTabImportExport.png)


### Splash
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/splash.png)
### Credits Tab
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/creditsTab.png)
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/creditsTabTranslators.png)


</details>
Expand Down Expand Up @@ -97,4 +96,5 @@ Once you've cloned the repository (with submodules), simply run `make` in the `3

### Translators
- [SuperSaiyajinStackZ](https://github.com/SuperSaiyajinStackZ): German & English.
- [Pk11](https://github.com/Epicpkmn11): Japanese & English.
- [Pk11](https://github.com/Epicpkmn11): Japanese & English.
- [Samplasion](https://github.com/Samplasion): Italian.
Binary file modified resources/screenshots/creditsTabTranslators.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/screenshots/settingsTabGameSettings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/screenshots/settingsTabLanguage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ebf4f1d

Please sign in to comment.