mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
Hopefully *Center* everything properly.
This commit is contained in:
+10
-7
@@ -47,6 +47,7 @@ std::string Config::MusicPath;
|
||||
bool Config::Logging;
|
||||
bool Config::UseBars;
|
||||
std::string Config::StorePath;
|
||||
int Config::LangPath;
|
||||
nlohmann::json configJson;
|
||||
|
||||
void Config::load() {
|
||||
@@ -96,6 +97,12 @@ void Config::load() {
|
||||
Config::ScriptPath = getString("SCRIPTPATH");
|
||||
}
|
||||
|
||||
if(!configJson.contains("LANGPATH")) {
|
||||
Config::LangPath = 0;
|
||||
} else {
|
||||
Config::LangPath = getInt("LANGPATH");
|
||||
}
|
||||
|
||||
if(!configJson.contains("LANGUAGE")) {
|
||||
Config::lang = 2;
|
||||
} else {
|
||||
@@ -147,6 +154,7 @@ void Config::load() {
|
||||
Config::SelectedColor = SelectedColordefault;
|
||||
Config::UnselectedColor = UnselectedColordefault;
|
||||
Config::ScriptPath = SCRIPTS_PATH;
|
||||
Config::LangPath = 0;
|
||||
Config::lang = 2;
|
||||
Config::viewMode = 0;
|
||||
Config::progressbarColor = WHITE;
|
||||
@@ -165,6 +173,7 @@ void Config::save() {
|
||||
Config::setInt("SELECTEDCOLOR", Config::SelectedColor);
|
||||
Config::setInt("UNSELECTEDCOLOR", Config::UnselectedColor);
|
||||
Config::setString("SCRIPTPATH", Config::ScriptPath);
|
||||
Config::setInt("LANGPATH", Config::LangPath);
|
||||
Config::setInt("LANGUAGE", Config::lang);
|
||||
Config::setInt("VIEWMODE", Config::viewMode);
|
||||
Config::setInt("PROGRESSBARCOLOR", Config::progressbarColor);
|
||||
@@ -187,6 +196,7 @@ void Config::initializeNewConfig() {
|
||||
Config::setInt("SELECTEDCOLOR", SelectedColordefault);
|
||||
Config::setInt("UNSELECTEDCOLOR", UnselectedColordefault);
|
||||
Config::setString("SCRIPTPATH", SCRIPTS_PATH);
|
||||
Config::setInt("LANGPATH", 0);
|
||||
Config::setInt("LANGUAGE", 2);
|
||||
Config::setInt("VIEWMODE", 0);
|
||||
Config::setInt("PROGRESSBARCOLOR", WHITE);
|
||||
@@ -228,11 +238,4 @@ std::string Config::getString(const std::string &key) {
|
||||
}
|
||||
void Config::setString(const std::string &key, const std::string &v) {
|
||||
configJson[key] = v;
|
||||
}
|
||||
|
||||
int Config::getLang(const std::string &key) {
|
||||
if(!configJson.contains(key)) {
|
||||
return 1;
|
||||
}
|
||||
return configJson.at(key).get_ref<const int64_t&>();
|
||||
}
|
||||
+10
-10
@@ -229,11 +229,11 @@ std::string selectFilePath(std::string selectText, const std::vector<std::string
|
||||
char path[PATH_MAX];
|
||||
getcwd(path, PATH_MAX);
|
||||
if (Config::UseBars == true) {
|
||||
Gui::DrawString((400-(Gui::GetStringWidth(0.60f, path)))/2, 2, 0.60f, Config::TxtColor, path);
|
||||
Gui::DrawStringCentered(0, 220, 0.60f, Config::TxtColor, selectText, 400);
|
||||
Gui::DrawString((400-(Gui::GetStringWidth(0.60f, path)))/2, 2, 0.60f, Config::TxtColor, path, 390);
|
||||
Gui::DrawStringCentered(0, 220, 0.60f, Config::TxtColor, selectText, 390);
|
||||
} else {
|
||||
Gui::DrawString((400-(Gui::GetStringWidth(0.60f, path)))/2, 0, 0.60f, Config::TxtColor, path);
|
||||
Gui::DrawStringCentered(0, 218, 0.60f, Config::TxtColor, selectText, 400);
|
||||
Gui::DrawString((400-(Gui::GetStringWidth(0.60f, path)))/2, 0, 0.60f, Config::TxtColor, path, 390);
|
||||
Gui::DrawStringCentered(0, 218, 0.60f, Config::TxtColor, selectText, 390);
|
||||
}
|
||||
Gui::DrawBottom();
|
||||
if (Config::viewMode == 0) {
|
||||
@@ -259,9 +259,9 @@ std::string selectFilePath(std::string selectText, const std::vector<std::string
|
||||
}
|
||||
|
||||
if (Config::UseBars == true) {
|
||||
Gui::DrawStringCentered(0, 0, 0.5f, Config::TxtColor, Lang::get("FILEBROWSE_MSG"), 320);
|
||||
Gui::DrawStringCentered(0, 0, 0.45f, Config::TxtColor, Lang::get("FILEBROWSE_MSG"), 260);
|
||||
} else {
|
||||
Gui::DrawStringCentered(0, 2, 0.5f, Config::TxtColor, Lang::get("FILEBROWSE_MSG"), 320);
|
||||
Gui::DrawStringCentered(0, 2, 0.45f, Config::TxtColor, Lang::get("FILEBROWSE_MSG"), 260);
|
||||
}
|
||||
Gui::DrawArrow(295, -1);
|
||||
Gui::DrawArrow(315, 240, 180.0);
|
||||
@@ -272,10 +272,10 @@ std::string selectFilePath(std::string selectText, const std::vector<std::string
|
||||
Gui::Draw_Rect(buttonPositions[4].x, buttonPositions[4].y, buttonPositions[4].w, buttonPositions[4].h, C2D_Color32(0, 0, 0, 190));
|
||||
Gui::Draw_Rect(buttonPositions[5].x, buttonPositions[5].y, buttonPositions[5].w, buttonPositions[5].h, C2D_Color32(0, 0, 0, 190));
|
||||
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.4f, Lang::get("OPEN")))/2-95-25, 222, 0.4f, Config::TxtColor, Lang::get("OPEN"), 50);
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.4f, Lang::get("SELECT")))/2-30-25, 222, 0.4f, Config::TxtColor, Lang::get("SELECT"), 50);
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.4f, Lang::get("REFRESH")))/2+35-25, 222, 0.4f, Config::TxtColor, Lang::get("REFRESH"), 50);
|
||||
Gui::DrawString((320-Gui::GetStringWidth(0.4f, Lang::get("BACK")))/2+100-25, 222, 0.4f, Config::TxtColor, Lang::get("BACK"), 50);
|
||||
Gui::DrawStringCentered(-120, 222, 0.4, Config::TxtColor, Lang::get("OPEN"), 40);
|
||||
Gui::DrawStringCentered(-55, 222, 0.4, Config::TxtColor, Lang::get("SELECT"), 40);
|
||||
Gui::DrawStringCentered(10, 222, 0.4, Config::TxtColor, Lang::get("REFRESH"), 40);
|
||||
Gui::DrawStringCentered(75, 222, 0.4, Config::TxtColor, Lang::get("BACK"), 40);
|
||||
C3D_FrameEnd(0);
|
||||
|
||||
// The input part.
|
||||
|
||||
Reference in New Issue
Block a user