A little Script Creator work and little checks. (#9)

* No builds allowed here.

* Try something.

* Next work.

* Add some Logging stuff for testing purpose.

* Ok, this should log it priperly.

* Replace MainMenu with Screen Selection.

* Redo Screen Logic.

* Switch back to old MainMenu.

* Only access Scriptlist, when Scripts are found.

Hopefully avoid crashes with that.

* Remove unused String, because we use the MainMenu again.
This commit is contained in:
StackZ
2019-12-17 19:22:39 +01:00
committed by GitHub
parent 5d80ec6111
commit 0a308c43e8
27 changed files with 847 additions and 361 deletions
+8 -14
View File
@@ -25,6 +25,7 @@
*/
#include "gui.hpp"
#include "logging.hpp"
#include "lang/lang.hpp"
@@ -45,9 +46,6 @@ touchPosition touch;
sound *bgm = NULL;
bool songIsFound = false;
int fadealpha = 255;
bool fadein = true;
// If button Position pressed -> Do something.
bool touching(touchPosition touch, Structs::ButtonPos button) {
if (touch.px >= button.x && touch.px <= (button.x + button.w) && touch.py >= button.y && touch.py <= (button.y + button.h))
@@ -97,7 +95,12 @@ int main()
}
Config::load();
Lang::load(Config::lang);
Gui::setScreen(std::make_unique<MainMenu>());
if (Config::Logging == true) {
Logging::createLogFile();
}
Screen::set(std::make_unique<MainMenu>());
osSetSpeedupEnable(true); // Enable speed-up for New 3DS users
if( access( "sdmc:/3ds/dspfirm.cdc", F_OK ) != -1 ) {
@@ -107,7 +110,6 @@ int main()
playMusic();
}
// Loop as long as the status is not exit
while (aptMainLoop() && !exiting)
{
@@ -119,17 +121,9 @@ int main()
C2D_TargetClear(top, BLACK);
C2D_TargetClear(bottom, BLACK);
Gui::clearTextBufs();
Gui::mainLoop(hDown, hHeld, touch);
Screen::loop(hDown, hHeld, touch);
C3D_FrameEnd(0);
gspWaitForVBlank();
if (fadein == true) {
fadealpha -= 3;
if (fadealpha < 0) {
fadealpha = 0;
fadein = false;
}
}
}
if (songIsFound == true) {