mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
Add Settings Stuff. :P
This commit is contained in:
@@ -25,22 +25,32 @@
|
||||
*/
|
||||
|
||||
#include "screens/mainMenu.hpp"
|
||||
#include "screens/settings.hpp"
|
||||
#include "screens/scriptlist.hpp"
|
||||
|
||||
#include "utils/config.hpp"
|
||||
|
||||
extern int mode;
|
||||
extern bool exiting;
|
||||
extern bool touching(touchPosition touch, Structs::ButtonPos button);
|
||||
|
||||
void MainMenu::Draw(void) const {
|
||||
Gui::DrawTop();
|
||||
Gui::DrawStringCentered(0, 2, 0.7f, TextColor, "Universal-Updater", 400);
|
||||
Gui::DrawString(395-Gui::GetStringWidth(0.72f, VERSION_STRING), 218, 0.72f, WHITE, VERSION_STRING);
|
||||
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, "Universal-Updater", 400);
|
||||
Gui::DrawString(395-Gui::GetStringWidth(0.72f, VERSION_STRING), 218, 0.72f, Config::TxtColor, VERSION_STRING);
|
||||
Gui::DrawBottom();
|
||||
|
||||
// Draw 2 'Buttons'.
|
||||
Gui::Draw_Rect(mainButtons[0].x, mainButtons[0].y, mainButtons[0].w, mainButtons[0].h, TopBGColor);
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("SCRIPTLIST")))/2, mainButtons[0].y+10, 0.6f, WHITE, Lang::get("SCRIPTLIST"), 140);
|
||||
Gui::Draw_Rect(mainButtons[1].x, mainButtons[1].y, mainButtons[1].w, mainButtons[1].h, TopBGColor);
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("SETTINGS")))/2, mainButtons[1].y+10, 0.6f, WHITE, Lang::get("SETTINGS"), 140);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (Selection == i) {
|
||||
Gui::Draw_Rect(mainButtons[i].x, mainButtons[i].y, mainButtons[i].w, mainButtons[i].h, Config::SelectedColor);
|
||||
} else {
|
||||
Gui::Draw_Rect(mainButtons[i].x, mainButtons[i].y, mainButtons[i].w, mainButtons[i].h, Config::UnselectedColor);
|
||||
}
|
||||
}
|
||||
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("SCRIPTLIST")))/2, mainButtons[0].y+10, 0.6f, Config::TxtColor, Lang::get("SCRIPTLIST"), 140);
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("LANGUAGE")))/2, mainButtons[1].y+10, 0.6f, Config::TxtColor, Lang::get("LANGUAGE"), 140);
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("COLORS")))/2, mainButtons[2].y+10, 0.6f, Config::TxtColor, Lang::get("COLORS"), 140);
|
||||
}
|
||||
|
||||
void MainMenu::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
@@ -48,9 +58,37 @@ void MainMenu::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
exiting = true;
|
||||
}
|
||||
|
||||
if (hDown & KEY_UP) {
|
||||
if(Selection > 0) Selection--;
|
||||
} else if (hDown & KEY_DOWN) {
|
||||
if(Selection < 2) Selection++;
|
||||
}
|
||||
|
||||
if (hDown & KEY_A) {
|
||||
switch(Selection) {
|
||||
case 0:
|
||||
Gui::setScreen(std::make_unique<ScriptList>());
|
||||
break;
|
||||
case 1:
|
||||
mode = 0;
|
||||
Gui::setScreen(std::make_unique<Settings>());
|
||||
break;
|
||||
case 2:
|
||||
mode = 0;
|
||||
Gui::setScreen(std::make_unique<Settings>());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hDown & KEY_TOUCH) {
|
||||
if (touching(touch, mainButtons[0])) {
|
||||
Gui::setScreen(std::make_unique<ScriptList>());
|
||||
} else if (touching(touch, mainButtons[1])) {
|
||||
mode = 0;
|
||||
Gui::setScreen(std::make_unique<Settings>());
|
||||
} else if (touching(touch, mainButtons[2])) {
|
||||
mode = 1;
|
||||
Gui::setScreen(std::make_unique<Settings>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "screens/mainMenu.hpp"
|
||||
#include "screens/scriptlist.hpp"
|
||||
|
||||
#include "utils/config.hpp"
|
||||
#include "utils/parse.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -138,16 +139,16 @@ ScriptList::ScriptList() {
|
||||
void ScriptList::DrawList(void) const {
|
||||
std::string titleinfo;
|
||||
Gui::DrawTop();
|
||||
Gui::DrawStringCentered(0, 2, 0.7f, TextColor, "Universal-Updater", 400);
|
||||
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, "Universal-Updater", 400);
|
||||
Gui::DrawBottom();
|
||||
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)fileInfo.size();i++) {
|
||||
titleinfo = fileInfo[screenPos + i].title + '\n' + fileInfo[screenPos + i].description;
|
||||
if(screenPos + i == selection) {
|
||||
Gui::Draw_Rect(0, 40+(i*57), 320, 45, SelectedColor);
|
||||
Gui::Draw_Rect(0, 40+(i*57), 320, 45, Config::SelectedColor);
|
||||
} else {
|
||||
Gui::Draw_Rect(0, 40+(i*57), 320, 45, UnselectedColor);
|
||||
Gui::Draw_Rect(0, 40+(i*57), 320, 45, Config::UnselectedColor);
|
||||
}
|
||||
Gui::DrawString(0, 40+(i*57), 0.7f, WHITE, titleinfo, 320);
|
||||
Gui::DrawString(0, 40+(i*57), 0.7f, Config::TxtColor, titleinfo, 320);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,16 +164,16 @@ void ScriptList::Draw(void) const {
|
||||
void ScriptList::DrawSingleObject(void) const {
|
||||
std::string info;
|
||||
Gui::DrawTop();
|
||||
Gui::DrawStringCentered(0, 2, 0.7f, TextColor, "Universal-Updater", 400);
|
||||
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, "Universal-Updater", 400);
|
||||
Gui::DrawBottom();
|
||||
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)fileInfo2.size();i++) {
|
||||
info = fileInfo2[screenPos2 + i];
|
||||
if(screenPos2 + i == selection2) {
|
||||
Gui::Draw_Rect(0, 40+(i*57), 320, 45, SelectedColor);
|
||||
Gui::Draw_Rect(0, 40+(i*57), 320, 45, Config::SelectedColor);
|
||||
} else {
|
||||
Gui::Draw_Rect(0, 40+(i*57), 320, 45, UnselectedColor);
|
||||
Gui::Draw_Rect(0, 40+(i*57), 320, 45, Config::UnselectedColor);
|
||||
}
|
||||
Gui::DrawString(0, 40+(i*57), 0.7f, WHITE, info, 320);
|
||||
Gui::DrawString(0, 40+(i*57), 0.7f, Config::TxtColor, info, 320);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,357 @@
|
||||
/*
|
||||
* This file is part of Universal-Updater
|
||||
* Copyright (C) 2019 VoltZ, Epicpkmn11, Flame, RocketRobz, TotallyNotGuy
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
|
||||
* * Requiring preservation of specified reasonable legal notices or
|
||||
* author attributions in that material or in the Appropriate Legal
|
||||
* Notices displayed by works containing it.
|
||||
* * Prohibiting misrepresentation of the origin of that material,
|
||||
* or requiring that modified versions of such material be marked in
|
||||
* reasonable ways as different from the original version.
|
||||
*/
|
||||
|
||||
#include "keyboard.hpp"
|
||||
|
||||
#include "screens/settings.hpp"
|
||||
|
||||
#include "utils/config.hpp"
|
||||
|
||||
extern bool touching(touchPosition touch, Structs::ButtonPos button);
|
||||
|
||||
int mode;
|
||||
int colorMode = 0;
|
||||
|
||||
void Settings::Draw(void) const {
|
||||
if (mode == 0) {
|
||||
DrawLanguageSelection();
|
||||
} else if (mode == 1) {
|
||||
DrawColorChanging();
|
||||
}
|
||||
}
|
||||
|
||||
void Settings::DrawLanguageSelection(void) const {
|
||||
Gui::DrawTop();
|
||||
Gui::DrawString((400-Gui::GetStringWidth(0.8f, Lang::get("SELECT_LANG")))/2, 2, 0.8f, Config::TxtColor, Lang::get("SELECT_LANG"), 400);
|
||||
Gui::DrawBottom();
|
||||
|
||||
if (Config::lang == 0) {
|
||||
Gui::Draw_Rect(37, 52, 20, 20, Config::SelectedColor);
|
||||
Gui::Draw_Rect(37, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
Gui::Draw_Rect(177, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
} else if (Config::lang == 1) {
|
||||
Gui::Draw_Rect(37, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 92, 20, 20, Config::SelectedColor);
|
||||
Gui::Draw_Rect(37, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
Gui::Draw_Rect(177, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
} else if (Config::lang == 2) {
|
||||
Gui::Draw_Rect(37, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 132, 20, 20, Config::SelectedColor);
|
||||
Gui::Draw_Rect(37, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
Gui::Draw_Rect(177, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
} else if (Config::lang == 3) {
|
||||
Gui::Draw_Rect(37, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 172, 20, 20, Config::SelectedColor);
|
||||
|
||||
Gui::Draw_Rect(177, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
} else if (Config::lang == 4) {
|
||||
Gui::Draw_Rect(37, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
Gui::Draw_Rect(177, 52, 20, 20, Config::SelectedColor);
|
||||
Gui::Draw_Rect(177, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
} else if (Config::lang == 5) {
|
||||
Gui::Draw_Rect(37, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
Gui::Draw_Rect(177, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 172, 20, 20, Config::SelectedColor);
|
||||
|
||||
} else if (Config::lang == 6) {
|
||||
Gui::Draw_Rect(37, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
Gui::Draw_Rect(177, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 92, 20, 20, Config::SelectedColor);
|
||||
Gui::Draw_Rect(177, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
} else if (Config::lang == 7) {
|
||||
Gui::Draw_Rect(37, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 132, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(37, 172, 20, 20, Config::UnselectedColor);
|
||||
|
||||
Gui::Draw_Rect(177, 52, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 92, 20, 20, Config::UnselectedColor);
|
||||
Gui::Draw_Rect(177, 132, 20, 20, Config::SelectedColor);
|
||||
Gui::Draw_Rect(177, 172, 20, 20, Config::UnselectedColor);
|
||||
}
|
||||
|
||||
Gui::DrawString(langBlocks[0].x+25, langBlocks[0].y-2, 0.7f, Config::TxtColor, "Deutsch", 320);
|
||||
Gui::DrawString(langBlocks[1].x+25, langBlocks[1].y-2, 0.7f, Config::TxtColor, "English", 320);
|
||||
Gui::DrawString(langBlocks[2].x+25, langBlocks[2].y-2, 0.7f, Config::TxtColor, "Español", 320);
|
||||
Gui::DrawString(langBlocks[3].x+25, langBlocks[3].y-2, 0.7f, Config::TxtColor, "Français", 320);
|
||||
|
||||
Gui::DrawString(langBlocks[4].x+25, langBlocks[4].y-2, 0.7f, Config::TxtColor, "Italiano", 320);
|
||||
Gui::DrawString(langBlocks[5].x+25, langBlocks[5].y-2, 0.7f, Config::TxtColor, "Lietuvių", 320);
|
||||
Gui::DrawString(langBlocks[6].x+25, langBlocks[6].y-2, 0.7f, Config::TxtColor, "Português", 320);
|
||||
Gui::DrawString(langBlocks[7].x+25, langBlocks[7].y-2, 0.7f, Config::TxtColor, "日本語", 320);
|
||||
}
|
||||
|
||||
void Settings::DrawColorChanging(void) const {
|
||||
Gui::DrawTop();
|
||||
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, "Universal-Updater", 400);
|
||||
|
||||
if (colorMode == 3) {
|
||||
Gui::Draw_Rect(0, 40, 400, 45, Config::SelectedColor);
|
||||
Gui::DrawStringCentered(0, 45, 0.7f, Config::TxtColor, Lang::get("TEXT_COLOR"), 320);
|
||||
} else if (colorMode == 4) {
|
||||
Gui::Draw_Rect(0, 40, 400, 45, Config::SelectedColor);
|
||||
Gui::DrawStringCentered(0, 45, 0.7f, Config::TxtColor, Lang::get("SELECTED_COLOR"), 320);
|
||||
} else if (colorMode == 5) {
|
||||
Gui::Draw_Rect(0, 40, 400, 45, Config::UnselectedColor);
|
||||
Gui::DrawStringCentered(0, 45, 0.7f, Config::TxtColor, Lang::get("UNSELECTED_COLOR"), 320);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Gui::DrawBottom();
|
||||
|
||||
for (int i = 0; i < 6; i++) {
|
||||
if (colorMode == i) {
|
||||
Gui::Draw_Rect(25 + i * 25, 5, 16, 16, Config::SelectedColor);
|
||||
}
|
||||
}
|
||||
|
||||
Gui::DrawString(29 + 0 * 25, 5, 0.5f, Config::TxtColor, "1", 400);
|
||||
Gui::DrawString(29 + 1 * 25, 5, 0.5f, Config::TxtColor, "2", 400);
|
||||
Gui::DrawString(29 + 2 * 25, 5, 0.5f, Config::TxtColor, "3", 400);
|
||||
Gui::DrawString(29 + 3 * 25, 5, 0.5f, Config::TxtColor, "4", 400);
|
||||
Gui::DrawString(29 + 4 * 25, 5, 0.5f, Config::TxtColor, "5", 400);
|
||||
Gui::DrawString(29 + 5 * 25, 5, 0.5f, Config::TxtColor, "6", 400);
|
||||
|
||||
Gui::Draw_Rect(buttons[0].x, buttons[0].y, 95, 41, C2D_Color32(255, 0, 0, 255));
|
||||
Gui::Draw_Rect(buttons[1].x, buttons[1].y, 95, 41, C2D_Color32(0, 255, 0, 255));
|
||||
Gui::Draw_Rect(buttons[2].x, buttons[2].y, 95, 41, C2D_Color32(0, 0, 255, 255));
|
||||
|
||||
if (colorMode == 0) {
|
||||
Gui::DrawStringCentered(0, 60, 0.7f, Config::TxtColor, Lang::get("BAR_COLOR"), 320);
|
||||
Gui::DrawString(40, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::Color1, 2).c_str(), 400);
|
||||
Gui::DrawString(140, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::Color1, 1).c_str(), 400);
|
||||
Gui::DrawString(245, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::Color1, 0).c_str(), 400);
|
||||
} else if (colorMode == 1) {
|
||||
Gui::DrawStringCentered(0, 60, 0.7f, Config::TxtColor, Lang::get("TOP_BG_COLOR"), 320);
|
||||
Gui::DrawString(40, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::Color2, 2).c_str(), 400);
|
||||
Gui::DrawString(140, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::Color2, 1).c_str(), 400);
|
||||
Gui::DrawString(245, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::Color2, 0).c_str(), 400);
|
||||
} else if (colorMode == 2) {
|
||||
Gui::DrawStringCentered(0, 60, 0.7f, Config::TxtColor, Lang::get("BOTTOM_BG_COLOR"), 320);
|
||||
Gui::DrawString(40, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::Color3, 2).c_str(), 400);
|
||||
Gui::DrawString(140, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::Color3, 1).c_str(), 400);
|
||||
Gui::DrawString(245, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::Color3, 0).c_str(), 400);
|
||||
} else if (colorMode == 3) {
|
||||
Gui::DrawStringCentered(0, 60, 0.7f, Config::TxtColor, Lang::get("TEXT_COLOR"), 320);
|
||||
Gui::DrawString(40, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::TxtColor, 2).c_str(), 400);
|
||||
Gui::DrawString(140, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::TxtColor, 1).c_str(), 400);
|
||||
Gui::DrawString(245, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::TxtColor, 0).c_str(), 400);
|
||||
} else if (colorMode == 4) {
|
||||
Gui::DrawStringCentered(0, 60, 0.7f, Config::TxtColor, Lang::get("SELECTED_COLOR"), 320);
|
||||
Gui::DrawString(40, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::SelectedColor, 2).c_str(), 400);
|
||||
Gui::DrawString(140, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::SelectedColor, 1).c_str(), 400);
|
||||
Gui::DrawString(245, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::SelectedColor, 0).c_str(), 400);
|
||||
} else if (colorMode == 5) {
|
||||
Gui::DrawStringCentered(0, 60, 0.7f, Config::TxtColor, Lang::get("UNSELECTED_COLOR"), 320);
|
||||
Gui::DrawString(40, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::UnselectedColor, 2).c_str(), 400);
|
||||
Gui::DrawString(140, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::UnselectedColor, 1).c_str(), 400);
|
||||
Gui::DrawString(245, 98, 0.7f, Config::TxtColor, ColorHelper::getColorName(Config::UnselectedColor, 0).c_str(), 400);
|
||||
}
|
||||
}
|
||||
|
||||
void Settings::LanguageSelection(u32 hDown, touchPosition touch) {
|
||||
if (hDown & KEY_TOUCH) {
|
||||
if (touching(touch, langBlocks[0])) {
|
||||
Config::lang = 0;
|
||||
Lang::load(Config::lang);
|
||||
Config::saveConfig();
|
||||
|
||||
} else if (touching(touch, langBlocks[1])) {
|
||||
Config::lang = 1;
|
||||
Lang::load(Config::lang);
|
||||
Config::saveConfig();
|
||||
|
||||
} else if (touching(touch, langBlocks[2])) {
|
||||
Config::lang = 2;
|
||||
Lang::load(Config::lang);
|
||||
Config::saveConfig();
|
||||
|
||||
} else if (touching(touch, langBlocks[3])) {
|
||||
Config::lang = 3;
|
||||
Lang::load(Config::lang);
|
||||
Config::saveConfig();
|
||||
|
||||
} else if (touching(touch, langBlocks[4])) {
|
||||
Config::lang = 4;
|
||||
Lang::load(Config::lang);
|
||||
Config::saveConfig();
|
||||
|
||||
} else if (touching(touch, langBlocks[5])) {
|
||||
Config::lang = 6;
|
||||
Lang::load(Config::lang);
|
||||
Config::saveConfig();
|
||||
|
||||
} else if (touching(touch, langBlocks[6])) {
|
||||
Config::lang = 7;
|
||||
Lang::load(Config::lang);
|
||||
Config::saveConfig();
|
||||
|
||||
} else if (touching(touch, langBlocks[7])) {
|
||||
Config::lang = 5;
|
||||
Lang::load(Config::lang);
|
||||
Config::saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
if (hDown & KEY_B) {
|
||||
Gui::screenBack();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void Settings::colorChanging(u32 hDown, touchPosition touch) {
|
||||
int red;
|
||||
int green;
|
||||
int blue;
|
||||
|
||||
if (hDown & KEY_B) {
|
||||
Config::saveConfig();
|
||||
Gui::screenBack();
|
||||
return;
|
||||
}
|
||||
|
||||
if (hDown & KEY_L || hDown & KEY_LEFT) {
|
||||
if(colorMode > 0) colorMode--;
|
||||
}
|
||||
|
||||
if (hDown & KEY_R || hDown & KEY_RIGHT) {
|
||||
if(colorMode < 5) colorMode++;
|
||||
}
|
||||
|
||||
if (hDown & KEY_TOUCH) {
|
||||
if (touching(touch, buttons[0])) {
|
||||
int temp = Input::getUint(255, Lang::get("ENTER_RED_RGB"));
|
||||
if(temp != -1) {
|
||||
red = temp;
|
||||
if (colorMode == 0) {
|
||||
Config::Color1 = RGBA8(red, ColorHelper::getColorValue(Config::Color1, 1), ColorHelper::getColorValue(Config::Color1, 0), 255);
|
||||
} else if (colorMode == 1) {
|
||||
Config::Color2 = RGBA8(red, ColorHelper::getColorValue(Config::Color2, 1), ColorHelper::getColorValue(Config::Color2, 0), 255);
|
||||
} else if (colorMode == 2) {
|
||||
Config::Color3 = RGBA8(red, ColorHelper::getColorValue(Config::Color3, 1), ColorHelper::getColorValue(Config::Color3, 0), 255);
|
||||
} else if (colorMode == 3) {
|
||||
Config::TxtColor = RGBA8(red, ColorHelper::getColorValue(Config::TxtColor, 1), ColorHelper::getColorValue(Config::TxtColor, 0), 255);
|
||||
} else if (colorMode == 4) {
|
||||
Config::SelectedColor = RGBA8(red, ColorHelper::getColorValue(Config::SelectedColor, 1), ColorHelper::getColorValue(Config::SelectedColor, 0), 255);
|
||||
} else if (colorMode == 5) {
|
||||
Config::UnselectedColor = RGBA8(red, ColorHelper::getColorValue(Config::UnselectedColor, 1), ColorHelper::getColorValue(Config::UnselectedColor, 0), 255);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else if (touching(touch, buttons[1])) {
|
||||
int temp = Input::getUint(255, Lang::get("ENTER_GREEN_RGB"));
|
||||
if(temp != -1) {
|
||||
green = temp;
|
||||
if (colorMode == 0) {
|
||||
Config::Color1 = RGBA8(ColorHelper::getColorValue(Config::Color1, 2), green, ColorHelper::getColorValue(Config::Color1, 0), 255);
|
||||
} else if (colorMode == 1) {
|
||||
Config::Color2 = RGBA8(ColorHelper::getColorValue(Config::Color2, 2), green, ColorHelper::getColorValue(Config::Color2, 0), 255);
|
||||
} else if (colorMode == 2) {
|
||||
Config::Color3 = RGBA8(ColorHelper::getColorValue(Config::Color3, 2), green, ColorHelper::getColorValue(Config::Color3, 0), 255);
|
||||
} else if (colorMode == 3) {
|
||||
Config::TxtColor = RGBA8(ColorHelper::getColorValue(Config::TxtColor, 2), green, ColorHelper::getColorValue(Config::TxtColor, 0), 255);
|
||||
} else if (colorMode == 4) {
|
||||
Config::SelectedColor = RGBA8(ColorHelper::getColorValue(Config::SelectedColor, 2), green, ColorHelper::getColorValue(Config::SelectedColor, 0), 255);
|
||||
} else if (colorMode == 5) {
|
||||
Config::UnselectedColor = RGBA8(ColorHelper::getColorValue(Config::UnselectedColor, 2), green, ColorHelper::getColorValue(Config::UnselectedColor, 0), 255);
|
||||
}
|
||||
}
|
||||
} else if (touching(touch, buttons[2])) {
|
||||
int temp = Input::getUint(255, Lang::get("ENTER_BLUE_RGB"));
|
||||
if(temp != -1) {
|
||||
blue = temp;
|
||||
if (colorMode == 0) {
|
||||
Config::Color1 = RGBA8(ColorHelper::getColorValue(Config::Color1, 2), ColorHelper::getColorValue(Config::Color1, 1), blue, 255);
|
||||
} else if (colorMode == 1) {
|
||||
Config::Color2 = RGBA8(ColorHelper::getColorValue(Config::Color2, 2), ColorHelper::getColorValue(Config::Color2, 1), blue, 255);
|
||||
} else if (colorMode == 2) {
|
||||
Config::Color3 = RGBA8(ColorHelper::getColorValue(Config::Color3, 2), ColorHelper::getColorValue(Config::Color3, 1), blue, 255);
|
||||
} else if (colorMode == 3) {
|
||||
Config::TxtColor = RGBA8(ColorHelper::getColorValue(Config::TxtColor, 2), ColorHelper::getColorValue(Config::TxtColor, 1), blue, 255);
|
||||
} else if (colorMode == 4) {
|
||||
Config::SelectedColor = RGBA8(ColorHelper::getColorValue(Config::SelectedColor, 2), ColorHelper::getColorValue(Config::SelectedColor, 1), blue, 255);
|
||||
} else if (colorMode == 5) {
|
||||
Config::UnselectedColor = RGBA8(ColorHelper::getColorValue(Config::UnselectedColor, 2), ColorHelper::getColorValue(Config::UnselectedColor, 1), blue, 255);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Settings::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
if (mode == 0) {
|
||||
LanguageSelection(hDown, touch);
|
||||
} else if (mode == 1) {
|
||||
colorChanging(hDown, touch);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user