mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
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:
+3
-29
@@ -30,18 +30,10 @@
|
||||
|
||||
#include "utils/config.hpp"
|
||||
|
||||
#include <3ds.h>
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stack>
|
||||
|
||||
C3D_RenderTarget* top;
|
||||
C3D_RenderTarget* bottom;
|
||||
|
||||
C2D_TextBuf sizeBuf;
|
||||
std::stack<std::unique_ptr<Screen>> screens;
|
||||
C2D_SpriteSheet sprites;
|
||||
bool currentScreen = false;
|
||||
extern bool isScriptSelected;
|
||||
@@ -162,33 +154,15 @@ bool Gui::Draw_Rect(float x, float y, float w, float h, u32 color) {
|
||||
return C2D_DrawRectSolid(x, y, 0.5f, w, h, color);
|
||||
}
|
||||
|
||||
// Mainloop the GUI.
|
||||
void Gui::mainLoop(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
screens.top()->Draw();
|
||||
screens.top()->Logic(hDown, hHeld, touch);
|
||||
}
|
||||
|
||||
// Set the current Screen.
|
||||
void Gui::setScreen(std::unique_ptr<Screen> screen)
|
||||
{
|
||||
screens.push(std::move(screen));
|
||||
}
|
||||
|
||||
// Go a Screen back.
|
||||
void Gui::screenBack()
|
||||
{
|
||||
screens.pop();
|
||||
}
|
||||
|
||||
// Select, on which Screen should be drawn.
|
||||
void Gui::ScreenDraw(C3D_RenderTarget * screen)
|
||||
void Gui::setDraw(C3D_RenderTarget * screen)
|
||||
{
|
||||
C2D_SceneBegin(screen);
|
||||
currentScreen = screen == top ? 1 : 0;
|
||||
}
|
||||
|
||||
void Gui::DrawTop(void) {
|
||||
Gui::ScreenDraw(top);
|
||||
Gui::setDraw(top);
|
||||
if (isScriptSelected == false) {
|
||||
Gui::Draw_Rect(0, 0, 400, 25, Config::Color1);
|
||||
Gui::Draw_Rect(0, 25, 400, 190, Config::Color2);
|
||||
@@ -205,7 +179,7 @@ void Gui::DrawTop(void) {
|
||||
}
|
||||
|
||||
void Gui::DrawBottom(void) {
|
||||
Gui::ScreenDraw(bottom);
|
||||
Gui::setDraw(bottom);
|
||||
if (isScriptSelected == false) {
|
||||
Gui::Draw_Rect(0, 0, 320, 25, Config::Color1);
|
||||
Gui::Draw_Rect(0, 25, 320, 190, Config::Color3);
|
||||
|
||||
Reference in New Issue
Block a user