mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
Add "VIEWMODE" to config.
This commit is contained in:
@@ -133,7 +133,7 @@ void ScriptBrowse::Draw(void) const {
|
||||
Gui::DrawString(7.5, 1.5, 0.72f, BLACK, "\uE003");
|
||||
Gui::DrawString(317-Gui::GetStringWidth(0.6f, std::to_string(selection + 1) + " / " + maxScripts), 4, 0.6f, Config::TxtColor, std::to_string(selection + 1) + " / " + maxScripts);
|
||||
|
||||
if (listMode == 0) {
|
||||
if (Config::viewMode == 0) {
|
||||
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)infoJson.size();i++) {
|
||||
if(screenPos + i == selection) {
|
||||
Gui::Draw_Rect(0, 40+(i*57), 320, 45, Config::SelectedColor);
|
||||
@@ -149,7 +149,7 @@ void ScriptBrowse::Draw(void) const {
|
||||
Gui::DrawStringCentered(0, 38+(i*57), 0.7f, Config::TxtColor, infoJson[screenPos+i]["title"], 320);
|
||||
Gui::DrawStringCentered(0, 62+(i*57), 0.7f, Config::TxtColor, infoJson[screenPos+i]["author"], 320);
|
||||
}
|
||||
} else if (listMode == 1) {
|
||||
} else if (Config::viewMode == 1) {
|
||||
for(int i=0;i<ENTRIES_PER_LIST && i<(int)infoJson.size();i++) {
|
||||
if(screenPosList + i == selection) {
|
||||
Gui::Draw_Rect(0, 30+(i*25), 320, 30, Config::SelectedColor);
|
||||
@@ -228,20 +228,20 @@ void ScriptBrowse::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
}
|
||||
|
||||
if (hDown & KEY_X) {
|
||||
if (listMode == 0) {
|
||||
listMode = 1;
|
||||
if (Config::viewMode == 0) {
|
||||
Config::viewMode = 1;
|
||||
} else {
|
||||
listMode = 0;
|
||||
Config::viewMode = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (listMode == 0) {
|
||||
if (Config::viewMode == 0) {
|
||||
if(selection < screenPos) {
|
||||
screenPos = selection;
|
||||
} else if (selection > screenPos + ENTRIES_PER_SCREEN - 1) {
|
||||
screenPos = selection - ENTRIES_PER_SCREEN + 1;
|
||||
}
|
||||
} else if (listMode == 1) {
|
||||
} else if (Config::viewMode == 1) {
|
||||
if(selection < screenPosList) {
|
||||
screenPosList = selection;
|
||||
} else if (selection > screenPosList + ENTRIES_PER_LIST - 1) {
|
||||
|
||||
@@ -311,7 +311,7 @@ void ScriptList::DrawList(void) const {
|
||||
Gui::DrawStringCentered(0, 120, 0.6f, Config::TxtColor, std::string(fileInfo[selection].shortDesc), 400);
|
||||
|
||||
Gui::DrawBottom();
|
||||
if (listMode == 0) {
|
||||
if (Config::viewMode == 0) {
|
||||
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)fileInfo.size();i++) {
|
||||
line1 = fileInfo[screenPos + i].title;
|
||||
line2 = fileInfo[screenPos + i].author;
|
||||
@@ -323,7 +323,7 @@ void ScriptList::DrawList(void) const {
|
||||
Gui::DrawStringCentered(0, 38+(i*57), 0.7f, Config::TxtColor, line1, 320);
|
||||
Gui::DrawStringCentered(0, 62+(i*57), 0.7f, Config::TxtColor, line2, 320);
|
||||
}
|
||||
} else if (listMode == 1) {
|
||||
} else if (Config::viewMode == 1) {
|
||||
for(int i=0;i<ENTRIES_PER_LIST && i<(int)fileInfo.size();i++) {
|
||||
line1 = fileInfo[screenPosList + i].title;
|
||||
if(screenPosList + i == selection) {
|
||||
@@ -363,7 +363,7 @@ void ScriptList::DrawSingleObject(void) const {
|
||||
Gui::DrawStringCentered(0, 120-((lines.size()*20)/2)+i*20, 0.6f, TextColor, lines[i], 400);
|
||||
}
|
||||
Gui::DrawBottom();
|
||||
if (listMode == 0) {
|
||||
if (Config::viewMode == 0) {
|
||||
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)fileInfo2.size();i++) {
|
||||
info = fileInfo2[screenPos2 + i];
|
||||
if(screenPos2 + i == selection2) {
|
||||
@@ -373,7 +373,7 @@ void ScriptList::DrawSingleObject(void) const {
|
||||
}
|
||||
Gui::DrawStringCentered(0, 50+(i*57), 0.7f, TextColor, info, 320);
|
||||
}
|
||||
} else if (listMode == 1) {
|
||||
} else if (Config::viewMode == 1) {
|
||||
for(int i=0;i<ENTRIES_PER_LIST && i<(int)fileInfo2.size();i++) {
|
||||
info = fileInfo2[screenPosList2 + i];
|
||||
if(screenPosList2 + i == selection2) {
|
||||
@@ -445,13 +445,13 @@ void ScriptList::ListSelection(u32 hDown, u32 hHeld) {
|
||||
fastMode = false;
|
||||
}
|
||||
|
||||
if (listMode == 0) {
|
||||
if (Config::viewMode == 0) {
|
||||
if(selection < screenPos) {
|
||||
screenPos = selection;
|
||||
} else if (selection > screenPos + ENTRIES_PER_SCREEN - 1) {
|
||||
screenPos = selection - ENTRIES_PER_SCREEN + 1;
|
||||
}
|
||||
} else if (listMode == 1) {
|
||||
} else if (Config::viewMode == 1) {
|
||||
if(selection < screenPosList) {
|
||||
screenPosList = selection;
|
||||
} else if (selection > screenPosList + ENTRIES_PER_LIST - 1) {
|
||||
@@ -518,13 +518,13 @@ void ScriptList::SelectFunction(u32 hDown, u32 hHeld) {
|
||||
mode = 0;
|
||||
}
|
||||
|
||||
if (listMode == 0) {
|
||||
if (Config::viewMode == 0) {
|
||||
if(selection2 < screenPos2) {
|
||||
screenPos2 = selection2;
|
||||
} else if (selection2 > screenPos2 + ENTRIES_PER_SCREEN - 1) {
|
||||
screenPos2 = selection2 - ENTRIES_PER_SCREEN + 1;
|
||||
}
|
||||
} else if (listMode == 1) {
|
||||
} else if (Config::viewMode == 1) {
|
||||
if(selection2 < screenPosList2) {
|
||||
screenPosList2 = selection2;
|
||||
} else if (selection2 > screenPosList2 + ENTRIES_PER_LIST - 1) {
|
||||
@@ -542,10 +542,10 @@ void ScriptList::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
}
|
||||
|
||||
if (hDown & KEY_X) {
|
||||
if (listMode == 0) {
|
||||
listMode = 1;
|
||||
if (Config::viewMode == 0) {
|
||||
Config::viewMode = 1;
|
||||
} else {
|
||||
listMode = 0;
|
||||
Config::viewMode = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -235,7 +235,6 @@ void Settings::LanguageSelection(u32 hDown, touchPosition touch) {
|
||||
if (touching(touch, langBlocks[language])) {
|
||||
Config::lang = language;
|
||||
Lang::load(Config::lang);
|
||||
Config::save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -252,7 +251,6 @@ void Settings::colorChanging(u32 hDown, touchPosition touch) {
|
||||
int blue;
|
||||
|
||||
if (hDown & KEY_B) {
|
||||
Config::save();
|
||||
mode = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ void TinyDB::Draw(void) const {
|
||||
Gui::sprite(sprites_search_idx, -3, 0);
|
||||
Gui::DrawString(7.5, 1.5, 0.72f, BLACK, "\uE003");
|
||||
|
||||
if (listMode == 0) {
|
||||
if (Config::viewMode == 0) {
|
||||
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)tinyDBList.size();i++) {
|
||||
info = tinyDBList[screenPos + i];
|
||||
if(screenPos + i == selection) {
|
||||
@@ -128,7 +128,7 @@ void TinyDB::Draw(void) const {
|
||||
}
|
||||
Gui::DrawStringCentered(0, 50+(i*57), 0.7f, WHITE, info, 320);
|
||||
}
|
||||
} else if (listMode == 1) {
|
||||
} else if (Config::viewMode == 1) {
|
||||
for(int i=0;i<ENTRIES_PER_LIST && i<(int)tinyDBList.size();i++) {
|
||||
info = tinyDBList[screenPosList + i];
|
||||
if(screenPosList + i == selection) {
|
||||
@@ -184,13 +184,13 @@ void TinyDB::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
}
|
||||
}
|
||||
|
||||
if (listMode == 0) {
|
||||
if (Config::viewMode == 0) {
|
||||
if(selection < screenPos) {
|
||||
screenPos = selection;
|
||||
} else if (selection > screenPos + ENTRIES_PER_SCREEN - 1) {
|
||||
screenPos = selection - ENTRIES_PER_SCREEN + 1;
|
||||
}
|
||||
} else if (listMode == 1) {
|
||||
} else if (Config::viewMode == 1) {
|
||||
if(selection < screenPosList) {
|
||||
screenPosList = selection;
|
||||
} else if (selection > screenPosList + ENTRIES_PER_LIST - 1) {
|
||||
@@ -199,10 +199,10 @@ void TinyDB::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
}
|
||||
|
||||
if (hDown & KEY_X) {
|
||||
if (listMode == 0) {
|
||||
listMode = 1;
|
||||
if (Config::viewMode == 0) {
|
||||
Config::viewMode = 1;
|
||||
} else {
|
||||
listMode = 0;
|
||||
Config::viewMode = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user