Skip to content

Commit ebf4f1d

Browse files
See desc for more.
- Fix Splash being able to lock the app. - Update Credits + Screenshots. - Fill Selected Option in the same color to look better.
1 parent fa51699 commit ebf4f1d

File tree

9 files changed

+67
-34
lines changed

9 files changed

+67
-34
lines changed

3DS/include/Components/Tabs/SettingsTab.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,14 @@ class SettingsTab {
5757
};
5858

5959

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

6465

66+
int8_t LangHandlerToSelection() const;
67+
int8_t SelectionToLangHandler(const int8_t Slt) const;
6568
void LanguageHandle();
6669
static constexpr Structs::ButtonPos LanguagePos[4] = {
6770
{ 37, 32, 18, 18 }, // English.

3DS/source/Components/Splash.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ void Splash::Handler() {
5252

5353
/* State 0: Fade In. */
5454
if (this->State == 0) {
55-
if (StackMill3DS::App->FadeAlpha > 0) {
55+
if (StackMill3DS::App->FadeAlpha >= 0) {
5656
StackMill3DS::App->FadeAlpha -= 3;
5757

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

6161
/* State 1: Waiting. */
6262
} else if (this->State == 1) {
63-
if (this->Wait > 0) {
63+
if (this->Wait >= 0) {
6464
this->Wait--;
6565

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

85-
if (StackMill3DS::App->FadeAlpha > 0) {
85+
if (StackMill3DS::App->FadeAlpha >= 0) {
8686
if (StackMill3DS::App->FadeAlpha - 5 <= 0) StackMill3DS::App->FadeAlpha = 0;
8787
else StackMill3DS::App->FadeAlpha -= 5;
8888

3DS/source/Components/Tabs/CreditsTab.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ void CreditsTab::DrawSubTab(const CreditsTab::SubTab STab, const int AddOffs) {
6868

6969
Gui::DrawStringCentered(0 + Tab::CreditsOffset, 65 + AddOffs, 0.5f, TEXT_BG_COLOR, "Deutsch - SuperSaiyajinStackZ", 310);
7070
Gui::DrawStringCentered(0 + Tab::CreditsOffset, 85 + AddOffs, 0.5f, TEXT_BG_COLOR, "English - Pk11, SuperSaiyajinStackZ", 310);
71-
Gui::DrawStringCentered(0 + Tab::CreditsOffset, 105 + AddOffs, 0.5f, TEXT_BG_COLOR, "日本語 - Pk11", 310);
71+
Gui::DrawStringCentered(0 + Tab::CreditsOffset, 105 + AddOffs, 0.5f, TEXT_BG_COLOR, "Italiano - Samplasion", 310);
72+
Gui::DrawStringCentered(0 + Tab::CreditsOffset, 125 + AddOffs, 0.5f, TEXT_BG_COLOR, "日本語 - Pk11", 310);
7273
break;
7374
}
7475
}

3DS/source/Components/Tabs/GameTab.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -976,17 +976,14 @@ void GameTab::PopupPrompt() {
976976

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

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

987-
if (Down & KEY_TOUCH) {
988-
if (this->Prompt[0].Touched(T)) State = false, EndIt = true; // Exit.
989-
else if (this->Prompt[1].Touched(T)) State = true, EndIt = true; // New Game.
984+
if (StackMill3DS::App->Down & KEY_TOUCH) {
985+
if (this->Prompt[0].Touched(StackMill3DS::App->T)) State = false, EndIt = true; // Exit.
986+
else if (this->Prompt[1].Touched(StackMill3DS::App->T)) State = true, EndIt = true; // New Game.
990987
}
991988
}
992989

3DS/source/Components/Tabs/SettingsTab.cpp

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void SettingsTab::DrawMenu(const SettingsTab::SubMenu M, const int AddOffs) {
5656
StackMill3DS::App->GData->DrawStone(Idx, this->XPos[Idx] + Tab::SettingsOffset, 45 + AddOffs);
5757
}
5858

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

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

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

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

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

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

9999
StackMill3DS::App->GData->DrawStone(ClrIdx, this->LanguagePos[Lang].x + Tab::SettingsOffset, this->LanguagePos[Lang].y + AddOffs);
100-
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);
100+
if (this->Language == Lang) StackMill3DS::App->GData->DrawSprite(sprites_selector_0_idx + ClrIdx, this->LanguagePos[Lang].x + Tab::SettingsOffset, this->LanguagePos[Lang].y + AddOffs);
101101
}
102102

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

@@ -152,7 +152,7 @@ void SettingsTab::MainHandle() {
152152
if (this->MainPos[Idx - 1].Touched(StackMill3DS::App->T)) {
153153
this->Menu = (SettingsTab::SubMenu)Idx;
154154
this->In = true, this->SelectedOption = 0;
155-
if (this->Menu == SettingsTab::SubMenu::Language) this->Language = StackMill3DS::App->LH->GetLang();
155+
if (this->Menu == SettingsTab::SubMenu::Language) this->Language = this->LangHandlerToSelection();
156156
SettingsTab::Swipe = true;
157157
break;
158158
}
@@ -169,7 +169,7 @@ void SettingsTab::MainHandle() {
169169

170170
case 1:
171171
this->Menu = SettingsTab::SubMenu::Language;
172-
this->In = true, this->Language = StackMill3DS::App->LH->GetLang();
172+
this->In = true, this->Language = this->LangHandlerToSelection();
173173
SettingsTab::Swipe = true;
174174
break;
175175

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

193193

194+
int8_t SettingsTab::AIModeClr() const {
195+
switch(SettingsTab::AI) {
196+
default:
197+
case 0: return 9; // Mode 0 => Red.
198+
case 1: return 4; // Mode 1 => Yellow.
199+
case 2: return 7; // Mode 2 => Green.
200+
}
201+
};
202+
203+
194204
void SettingsTab::GameSettingsHandle() {
195205
if (StackMill3DS::App->Down & KEY_B) {
196206
this->In = false, this->SelectedOption = 0;
@@ -267,6 +277,28 @@ void SettingsTab::GameSettingsHandle() {
267277
};
268278

269279

280+
int8_t SettingsTab::LangHandlerToSelection() const {
281+
switch(StackMill3DS::App->LH->GetLangEnum()) {
282+
case LangHandler::Langs::German: return 0;
283+
default:
284+
case LangHandler::Langs::English: return 1;
285+
case LangHandler::Langs::Italian: return 2;
286+
case LangHandler::Langs::Japanese: return 3;
287+
}
288+
};
289+
290+
291+
int8_t SettingsTab::SelectionToLangHandler(const int8_t Slt) const {
292+
switch(Slt) {
293+
case 0: return 1; // German.
294+
default:
295+
case 1: return 0; // English.
296+
case 2: return 3; // Italian.
297+
case 3: return 2; // Japanese.
298+
}
299+
};
300+
301+
270302
void SettingsTab::LanguageHandle() {
271303
if (StackMill3DS::App->Down & KEY_B) {
272304
this->In = false, this->SelectedOption = 1;
@@ -283,7 +315,7 @@ void SettingsTab::LanguageHandle() {
283315

284316
if (StackMill3DS::App->Down & KEY_A) {
285317
/* Load Language. */
286-
StackMill3DS::App->LH->LoadLang((LangHandler::Langs)this->Language);
318+
StackMill3DS::App->LH->LoadLang((LangHandler::Langs)this->SelectionToLangHandler(this->Language));
287319
StackMill3DS::App->ConfigChanged();
288320

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

298330
/* Load Language. */
299-
StackMill3DS::App->LH->LoadLang((LangHandler::Langs)this->Language);
331+
StackMill3DS::App->LH->LoadLang((LangHandler::Langs)this->SelectionToLangHandler(this->Language));
300332
StackMill3DS::App->ConfigChanged();
301333

302334
this->In = false, this->SelectedOption = 1;

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ StackMill includes the following features right now:
1616

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

19-
* Multi Language support. Currently supporting English, German and Japanese.
19+
* Multi Language support. Currently supporting English, German, Italian and Japanese.
2020

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

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

3131
<details><summary>Screenshots</summary>
3232

33-
### Credits Tab
34-
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/creditsTab.png)
35-
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/creditsTabTranslators.png)
36-
3733
### Game Tab
3834
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/gameTab.png)
3935

36+
### Splash
37+
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/splash.png)
38+
4039
### Rules
4140
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/rules1.png)
4241
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/rules2.png)
@@ -52,9 +51,9 @@ You want to learn more about the GameData Structure? Then checkout the [GameData
5251
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/settingsTabLanguage.png)
5352
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/settingsTabImportExport.png)
5453

55-
56-
### Splash
57-
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/splash.png)
54+
### Credits Tab
55+
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/creditsTab.png)
56+
![](https://github.com/SuperSaiyajinStackZ/StackMill/blob/main/resources/screenshots/creditsTabTranslators.png)
5857

5958

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

9897
### Translators
9998
- [SuperSaiyajinStackZ](https://github.com/SuperSaiyajinStackZ): German & English.
100-
- [Pk11](https://github.com/Epicpkmn11): Japanese & English.
99+
- [Pk11](https://github.com/Epicpkmn11): Japanese & English.
100+
- [Samplasion](https://github.com/Samplasion): Italian.
1.58 KB
Loading
-31 Bytes
Loading
1.01 KB
Loading

0 commit comments

Comments
 (0)